gdb python how to output integer for examine memory

Wesley nispray at gmail.com
Thu Mar 27 02:04:33 CET 2014


在 2014年3月26日星期三UTC+8下午3时10分23秒,dieter写道:
> Wesley <nispray at gmail.com> writes:
> 
> > ...
> 
> > Actually, I can now see the varialbe names at Python level and C level.
> 
> > I just want to verify x command to monitor the memory content.
> 
> > So, in my origin post, I can get variable i's address, and see the value is 1,
> 
> > then, I wanna have a try x command, the issue is, when use x/format i's address, the output is not 1, but other things:-(
> 
> 
> 
> All Python objects start (at C level) with a header (containing
> 
> the reference count, a pointer to the associated type and
> 
> maybe other things); the "real" value starts behind this header.
> 
> 
> 
> This means, to see the "1" in your example, you must skip the
> 
> associated object header -- either in the output or by adding
> 
> the size of the header to the initial address.

Most like this.
I will try later.



More information about the Python-list mailing list