Hi Michael -
How did a fundamental bool type (which, if I'm not mistacking, is a c++
type) got into a kernel object?
I think that the answer is to map it to TYPE_CODE_CHAR regarless, so
that the size would be properly handled in structs. c++ seems to be
mapping a bool to a char from a size perspective.
-Luc
-----Original Message-----
From: Michael Holzheu [mailto:holzheu@linux.vnet.ibm.com]
Sent: Monday, March 01, 2010 1:21 PM
To: Chouinard, Luc
Cc: crash
Subject: [PATCH] sial: Oops drilldowntype for bool
Hi Luc,
I have a sial script that uses structures that contain
members of type "bool". When I run the script I get:
File ../devices.sial, line 279, Error: Oops drilldowntype
I looked into the sial code and found that the
drilldowntype() functions fails because no "case
TYPE_CODE_BOOL" is defined.
Here the break point at sial.c (323):
default:.
sial_error("Oops drilldowntype");
Breakpoint 1, drilldowntype (type=0x81f088a8, t=0x808023e8) at
sial.c:323
323 sial_error("Oops drilldowntype");
(gdb) print *type
$1 = {pointer_type = 0x0, reference_type = 0x0, chain = 0x81f088a8,
instance_flags = 0, length = 1, main_type = 0x81f088d0}
(gdb) print *type->main_type
$2 = {code = TYPE_CODE_BOOL, flag_unsigned = 1, flag_nosign = 0,
flag_stub = 0, flag_target_stub = 0, flag_static = 0,
flag_prototyped = 0,
flag_incomplete = 0, flag_varargs = 0, flag_vector = 0,
flag_stub_supported = 0, flag_nottext = 0, flag_fixed_instance = 0,
flag_objfile_owned = 1, nfields = 0, vptr_fieldno = -1,
name = 0x200040d8257 "_Bool", tag_name = 0x0, owner =
{objfile = 0x80618e10,
gdbarch = 0x80618e10}, target_type = 0x0, fields = 0x0,
vptr_basetype = 0x0, type_specific = {cplus_stuff = 0x0,
floatformat = 0x0,
calling_convention = 0}}
When I add "case TYPE_CODE_BOOL" and handle it like "case
TYPE_CODE_INT"
my script works, but I am not sure if that fix is correct.
What do you think?
Michael
---
extensions/sial.c | 1 +
1 file changed, 1 insertion(+)
--- a/extensions/sial.c
+++ b/extensions/sial.c
@@ -286,6 +286,7 @@ int nidx=0;
type=TYPE_TARGET_TYPE(type);
break;
+ case TYPE_CODE_BOOL:
case TYPE_CODE_INT:
sial_parsetype(tstr=TYPE_NAME(type), t, 0);
Confidentiality Notice: This e-mail (including any attachments) is intended only for the
recipients named above. It may contain confidential or privileged information and should
not be read, copied or otherwise used by any other person. If you are not a named
recipient, please notify the sender of that fact and delete the e-mail from your system.