[Crash-utility] [PATCH] sial: Oops drilldowntype for bool
Michael Holzheu
holzheu at linux.vnet.ibm.com
Tue Mar 2 09:32:29 UTC 2010
Hallo Luc,
On Mon, 2010-03-01 at 13:48 -0500, Chouinard, Luc wrote:
> Hi Michael -
> How did a fundamental bool type (which, if I'm not mistacking, is a c++
> type) got into a kernel object?
I assume that this comes from the C99 datatype "_Bool". This is used in
the kernel to define "bool":
types.h:typedef _Bool bool;
crash> whatis bool
_Bool
crash> whatis _Bool
_Bool
(gdb) print *type->main_type
$2 = {code = TYPE_CODE_BOOL, flag_unsigned = 1, flag_nosign = 0,
...
name = 0x200040d8257 "_Bool", tag_name = 0x0, owner = {objfile =
> 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.
Agreed, so would the following be the correct patch?
---
extensions/sial.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/extensions/sial.c
+++ b/extensions/sial.c
@@ -292,6 +292,10 @@ int nidx=0;
type=0;
break;
+ case TYPE_CODE_BOOL:
+ sial_parsetype("char", t, ref);
+ type=0;
+ break;
case TYPE_CODE_UNION:
sial_type_mkunion(t);
goto label;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-5.0.1-sial-bool.patch
Type: text/x-patch
Size: 325 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20100302/2fe62111/attachment.bin>
More information about the Crash-utility
mailing list