Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Kevin Pouget <kevin.pouget@gmail.com>
Subject: Re: Python and target-async
Date: Thu, 02 Jun 2011 13:28:00 -0000	[thread overview]
Message-ID: <201106021428.00690.pedro@codesourcery.com> (raw)
In-Reply-To: <BANLkTin-cWG-C+OcHc-MAmFJDTF-EE_zVQ@mail.gmail.com>

On Tuesday 31 May 2011 18:54:10, Kevin Pouget wrote:
> > 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 ?

Very much.  Thanks.  This sounds similar to the
define.exp:nextwhere testcase failing in async mode.
That is, the attach command installing a continuation
and returning before the attach is complete, and 
the "where" command executing before the inferior reports
a stop to the attach command continuation.
I've got a fix for the "nextwhere" issue, that I'll
need some cleaning up before pushing, though
I'll bet that the python code will need fixing
of its own.  :-/

-- 
Pedro Alves


  reply	other threads:[~2011-06-02 13:28 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
2011-06-02 13:28     ` Pedro Alves [this message]
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=201106021428.00690.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb@sourceware.org \
    --cc=kevin.pouget@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