Re: [PATCH] sial: Oops drilldowntype for bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;


---
 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;
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux