From: Kevin Pouget <kevin.pouget@gmail.com>
To: mark florisson <markflorisson88@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Python objfile-gdb.py file -- how to handle reloading properly ?
Date: Wed, 23 Mar 2011 10:46:00 -0000 [thread overview]
Message-ID: <AANLkTimuOVgNWYV2kq7P3GeEmKC9km6dSmnjW0uce9dj@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=66tRSet6UgrtBpZzEU5o_PmTdazdkB-NnWEVZ@mail.gmail.com>
symbolic breakpoints would solve half of my problem, I still need to
lookup some global variable addresses when my library has been loaded,
so that I can read the right memory and understand the meaning of my
breakpoint hit
thanks for sharing cydbg, it's always good to have some working examples !
On Wed, Mar 23, 2011 at 6:06 AM, mark florisson
<markflorisson88@gmail.com> wrote:
> On 23 March 2011 11:01, mark florisson <markflorisson88@gmail.com> wrote:
>> On 23 March 2011 10:05, Kevin Pouget <kevin.pouget@gmail.com> wrote:
>>> Hello,
>>>
>>> I'm not writing a pretty-printer, but something quite similar to
>>> thread-event notification (eg, thread creation/death, where some
>>> special locations are breakpointed, and an action is trigger upon
>>> hitting the bp).
>>>
>>> So in this case, maybe the autoloading discussed before is not
>>> actually the best solution. What I would like to do is:
>>>
>>>> (at gdb startup) Load the process-independent part of my --python-- module
>>>> (at application startup/shared library loading) Set my breakpoint, resolve addresses and enable process-dependent commands
>>
>> You can set (symbolic) breakpoints even before your shared library is
>> loaded ('set breakpoint pending on').
>>
>> If you want to provide process independent functionality, create a
>> Python wrapper script that starts gdb and has it import the
>> process-independent code. If you need some inspiration, you could take
>> a look at this:
>> https://github.com/markflorisson88/cython/blob/master/Cython/Debugger/Cygdb.py
>> . It writes gdb commands to a tempfile and then loads gdb which reads
>> the commands from the tempfile.
>
> In fact, if you don't have multi-line commands, you can simply use
> gdb's -ex option: gdb -ex 'python import mymodule'
>
>> Good luck!
>>
>> Mark
>>
>
next prev parent reply other threads:[~2011-03-23 10:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 14:07 Kevin Pouget
[not found] ` <AANLkTikZX2JvZF4bNYh8ZQR-e-bqLS=+zZq_m_b2Y+an@mail.gmail.com>
2011-03-22 15:00 ` Kevin Pouget
2011-03-22 17:00 ` Tom Tromey
[not found] ` <AANLkTi=XEP8x27_BNr6NwS09Ra=nNu=CA6qrrpUJ5N8Z@mail.gmail.com>
2011-03-23 9:06 ` Kevin Pouget
[not found] ` <AANLkTikp_m_zwsUPmmEvgHiEKxBidNd-MNY4cTrprynU@mail.gmail.com>
[not found] ` <AANLkTi=66tRSet6UgrtBpZzEU5o_PmTdazdkB-NnWEVZ@mail.gmail.com>
2011-03-23 10:46 ` Kevin Pouget [this message]
2011-03-23 18:26 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimuOVgNWYV2kq7P3GeEmKC9km6dSmnjW0uce9dj@mail.gmail.com \
--to=kevin.pouget@gmail.com \
--cc=gdb@sourceware.org \
--cc=markflorisson88@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox