lkml.org 
[lkml]   [2005]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Use enum to declare errno values
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
object.)

Nikita.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-23 17:27    [W:2.906 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site