This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to interpret @entry function argument values?


When I see  @entry values , for example ‘pos’ and ‘color’ in frame 2 below :
(gdb) bt
#0  update_liberties (s=0) at engine/board.c:2871
#1  0x000000000040f2c4 in do_remove_string (s=s@entry=1) at engine/board.c:2989
#2  0x00000000004108ba in do_play_move (pos=pos@entry=64, color=color@entry=2) at engine/board.c:3416
….


Does it mean:

a.   The argument variable is  <optimized out>  and their values at function entry are shown.    ( pos =<optimized out> at 0x4108ba , pos@entry=64)
b.    Value  at current PC and at  entry  is same.   ( pos=64 at 0x4108ba , pos@entry=64)


I ask because, I see these values are available in some register in frame 2. So, they are no optimized out.  So, why GDB is printing @entry values?

(gdb) frame 2
#2  0x00000000004108ba in do_play_move (pos=pos@entry=64, color=color@entry=2) at engine/board.c:3416
3416	    captured_stones += do_remove_string(string_number[west]);
(gdb) p pos
$9 = 64
(gdb) p color
$10 = 2
(gdb) p &pos
Address requested for identifier "pos" which is in register $rbx
(gdb) p &color
Address requested for identifier "color" which is in register $r12

If it matters, the code is compiled with gcc 4.7 and debugged with gdb 7.8.
Thanks
Ananth





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]