This is the mail archive of the gdb-prs@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]

[Bug python/11482] Side effect of set print address on python API


------- Additional Comments From pmuldoon at redhat dot com  2010-04-14 21:29 -------
Oh they can get the value of the pointer, store it, add to it .. manipulate it
in any way ... they just can't print it in GDB with: 'set print address off'

This is output from 7.1 with some of my comments:

(gdb) print argv
$1 = (char **) 0x7fffffffe1f8
(gdb) set print address off

(gdb) print argv
$2 = (char **) 

Ok with 'set print address off' we'll get the value (in the case the
pointer/address).

(gdb) python argv_var = gdb.selected_frame().read_var("argv")

We try to print it

(gdb) python print str(argv_var)

No luck, 'set print address' is off.

Turn 'set print address' back on:

(gdb) set print address on

(gdb) python print str(argv_var)
0x7fffffffe1f8

Aha there it is. The actual value or argv_var always is (in this case)
'0x7fffffffe1f8' -- argv_var always stores that. Just that in GDB when 'set
print address' is set to 'off', all addresses -- regardless of where they come
from are suppressed from being printed. They are still stored in the variable.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11482

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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