Re: Use enum to declare errno values

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

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux