Re: Use enum to declare errno values

From: Nikita Danilov
Date: Wed Nov 23 2005 - 11:24:53 EST

moreau francis writes:


> hmm, are you sure that debuggers will tell you that foo returns
> LEFT/RIGHT but not any integer value ?

No. This is not about debugging, this is about typing.

> I just give a try and unfortunately you seem to be wrong here:

I am not, as I never claimed this. :-)

> """"
> (gdb) s
> foo (x=1) at enum_test.c:8
> 8 if (x & 0x1)
> (gdb) finish
> Run till exit from #0 foo (x=1) at enum_test.c:8
> 0x0804837c in main (argc=1, argv=0xbfe14dc4) at enum_test.c:17
> 17 return foo(1);
> Value returned is $1 = 0
> (gdb)

(gdb) p (enum side)$1
$2 = LEFT

(This works when debugging information about enum was stored in ELF

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at