From: Kevin Pouget <kevin.pouget@gmail.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb@sourceware.org
Subject: Re: Python and target-async
Date: Tue, 31 May 2011 17:54:00 -0000 [thread overview]
Message-ID: <BANLkTin-cWG-C+OcHc-MAmFJDTF-EE_zVQ@mail.gmail.com> (raw)
In-Reply-To: <201105311844.25465.pedro@codesourcery.com>
> you have "set target-async on" twice. Was that a pasto?
sorry, yes the first one was wrong
here is the correct behaviour:
> (gdb) set target-async off
> (gdb) py gdb.execute("attach PID") ; gdb.execute("where")
> 0x0000003cbd0aa47e in waitpid () from /lib64/libc.so.6
> #0 0x0000003cbd0aa47e in waitpid () from /lib64/libc.so.6
> #1 0x000000000043ede2 in ?? ()
> #2 0x000000000044005f in wait_for ()
> #3 0x0000000000430c45 in execute_command_internal ()
> #4 0x0000000000430e0e in execute_command ()
> #5 0x000000000041d526 in reader_loop ()
> #6 0x000000000041ccde in main ()
and this one is wrong because the backtrace is not correctly computed:
> (gdb) set target-async on
> (gdb) py gdb.execute("attach PID") ; gdb.execute("where")
> #0 0x0000003cbd0aa47e in ?? ()
> #1 0x0000000000000000 in ?? ()
> 0x0000003cbd0aa47e in waitpid () from /lib64/libc.so.6
I expected to read:
> (gdb) set target-async on
> (gdb) py gdb.execute("attach PID") ; gdb.execute("where")
> 0x0000003cbd0aa47e in waitpid () from /lib64/libc.so.6
> #0 0x0000003cbd0aa47e in waitpid () from /lib64/libc.so.6
> #1 0x000000000043ede2 in ?? ()
> #2 0x000000000044005f in wait_for ()
> #3 0x0000000000430c45 in execute_command_internal ()
> #4 0x0000000000430e0e in execute_command ()
> #5 0x000000000041d526 in reader_loop ()
> #6 0x000000000041ccde in main ()
is it clearer this way ?
thanks,
Kevin
> On Tuesday 31 May 2011 14:51:45, Kevin Pouget wrote:
>> Hello,
>>
>> I'm facing a problem with Python not behaving correctly when
>> "target-async" is on. I'll report it in the bugtracker if someone else
>> confirms the problem:
>>
>> (replace PID by any process ID to which you can attach)
>>
>> > (gdb) set target-async on
>> > (gdb) py gdb.execute("attach PID") ; gdb.execute("where")
>> > 0x0000003cbd0aa47e in waitpid () from /lib64/libc.so.6
>> > #0 0x0000003cbd0aa47e in waitpid () from /lib64/libc.so.6
>> > #1 0x000000000043ede2 in ?? ()
>> > #2 0x000000000044005f in wait_for ()
>> > #3 0x0000000000430c45 in execute_command_internal ()
>> > #4 0x0000000000430e0e in execute_command ()
>> > #5 0x000000000041d526 in reader_loop ()
>> > #6 0x000000000041ccde in main ()
>> > (gdb) detach
>> > Detaching from program ...
>> > (gdb) set target-async on
>> > (gdb) py gdb.execute("attach PID") ; gdb.execute("where")
>> > #0 0x0000003cbd0aa47e in ?? ()
>> > #1 0x0000000000000000 in ?? ()
>> > 0x0000003cbd0aa47e in waitpid () from /lib64/libc.so.6
>>
>> --> the inferior can't be access normally
>>
>> the problem lies in the fact that GDB doesn't return from Python
>> between the `attach' and the `where', (the situation occurs during a
>> Python function calls as well).
>>
>> > (gdb) set target-async on
>> > (gdb) py gdb.execute("attach PID")
>> > (gdb) py gdb.execute("where")
>>
>> works correctly.
>>
>>
>> I'm not sure there is something I can do to solve it, any idea what I
>> should look for?
>>
>>
>> thanks,
>>
>> Kevin
>>
>
> --
> Pedro Alves
>
next prev parent reply other threads:[~2011-05-31 17:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 13:52 Kevin Pouget
2011-05-31 17:44 ` Pedro Alves
2011-05-31 17:54 ` Kevin Pouget [this message]
2011-06-02 13:28 ` Pedro Alves
2011-08-17 11:37 ` Kevin Pouget
2011-08-17 12:26 ` Pedro Alves
2011-08-17 13:17 ` Kevin Pouget
2011-08-19 13:35 ` Kevin Pouget
2011-08-30 13:14 ` Pedro Alves
2011-08-30 15:54 ` Jan Kratochvil
2011-09-02 17:13 ` Pedro Alves
2011-09-05 15:54 ` Pedro Alves
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=BANLkTin-cWG-C+OcHc-MAmFJDTF-EE_zVQ@mail.gmail.com \
--to=kevin.pouget@gmail.com \
--cc=gdb@sourceware.org \
--cc=pedro@codesourcery.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