Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #69104

Re: gdb python how to output integer for examine memory

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '(at': 0.04; 'output': 0.05; 'means,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '"real"': 0.16; 'command,': 0.16; 'count,': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'subject:python': 0.16; 'variable': 0.18; 'starts': 0.20; 'command': 0.22; 'memory': 0.22; 'header:User-Agent:1': 0.23; 'pointer': 0.24; 'skip': 0.24; 'header': 0.24; 'initial': 0.24; 'header:X-Complaints-To:1': 0.27; 'origin': 0.31; 'writes:': 0.31; 'level.': 0.33; 'maybe': 0.34; 'objects': 0.35; 'but': 0.35; 'charset:us-ascii': 0.36; 'behind': 0.37; 'example,': 0.37; 'so,': 0.37; 'level': 0.37; 'to:addr :python-list': 0.38; 'issue': 0.38; 'to:addr:python.org': 0.39; 'address.': 0.39; 'either': 0.39; 'received:org': 0.40; 'then,': 0.60; 'received:217': 0.63; 'address,': 0.75; 'actually,': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From dieter <dieter@handshake.de>
Subject Re: gdb python how to output integer for examine memory
Date Wed, 26 Mar 2014 08:10:23 +0100
References <e1e8c3a2-5d8d-4aae-9a5d-82af79be8c4c@googlegroups.com> <mailman.8505.1395733762.18130.python-list@python.org> <2aa794ce-7cc1-4d24-a30b-3fb17b89e33f@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Gmane-NNTP-Posting-Host pd9e09a27.dip0.t-ipconnect.de
User-Agent Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux)
Cancel-Lock sha1:GxbuNG5EVsQ8XuW8qaSet/n+1Qo=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8563.1395817836.18130.python-list@python.org> (permalink)
Lines 15
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1395817836 news.xs4all.nl 2864 [2001:888:2000:d::a6]:41946
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:69104

Show key headers only | View raw


Wesley <nispray@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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

gdb python how to output integer for examine memory Wesley <nispray@gmail.com> - 2014-03-24 03:20 -0700
  Re:gdb python how to output integer for examine memory Dave Angel <davea@davea.name> - 2014-03-24 08:22 -0400
    Re: gdb python how to output integer for examine memory Wesley <nispray@gmail.com> - 2014-03-24 06:37 -0700
  Re: gdb python how to output integer for examine memory dieter <dieter@handshake.de> - 2014-03-25 08:49 +0100
    Re: gdb python how to output integer for examine memory Wesley <nispray@gmail.com> - 2014-03-25 01:07 -0700
      Re: gdb python how to output integer for examine memory dieter <dieter@handshake.de> - 2014-03-26 08:10 +0100
        Re: gdb python how to output integer for examine memory Wesley <nispray@gmail.com> - 2014-03-26 18:04 -0700

csiph-web