This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/11482] Side effect of set print address on python API
- From: "pmuldoon at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 14 Apr 2010 21:29:44 -0000
- Subject: [Bug python/11482] Side effect of set print address on python API
- References: <20100409172931.11482.michel.metzger@st.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.