public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug remote/19064] New: Running shared in continue post-hook causes gdb remote command/response mismatch
@ 2015-10-05 12:18 cmclachlan@undo-software.com
  0 siblings, 0 replies; only message in thread
From: cmclachlan@undo-software.com @ 2015-10-05 12:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=19064

            Bug ID: 19064
           Summary: Running shared in continue post-hook causes gdb remote
                    command/response mismatch
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: remote
          Assignee: unassigned at sourceware dot org
          Reporter: cmclachlan@undo-software.com
  Target Milestone: ---

I am seeing a problem with putting 'shared' in a continue post hook when
debugging a remote target with gdb from git
(e753e154bf8a1f507b43e03dec04b341dde3f429 cloned from
git://sourceware.org/git/binutils-gdb.git around 12:00 BST 5th October 2015).

It looks like gdb is not waiting for the response to continue before running
shared. This causes an $qXfer:libraries-svr4:read::0,fff#91 serial packet to be
sent before the response to the $vCont;c#a8 is recieved.

Here is a simple reproducer script

gdb_git_install/bin/gdbserver  localhost:6790 /bin/ls nowhere  &
cat <<EOF | gdb_git_install/bin/gdb
set debug remote 1
maintenance set target-async off
define hookpost-continue
shared
end
target remote localhost:6790
continue
EOF

The important bit of the log is (on my machine)

(gdb) Continuing.
Sending packet: $QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;#5f...Packet
received: OK
Sending packet: $vCont?#49...Packet received: vCont;c;C;s;S;t;r
Packet vCont (verbose-resume) is supported
Sending packet: $vCont;c#a8...Sending packet:
$qXfer:libraries-svr4:read::0,fff#91...
...
Unknown remote qXfer reply:
T05swbreak:;06:f0d1ffffff7f0000;07:08d1ffffff7f0000;10:a0a9def7ff7f0000;thread:p34be.34be;core:3;

Showing the two packets ($vCont and $qXfer) being sent out without a 'Packet
received' in between, meaning that qXfer ends up with the response that should
have gone to vCont 

After that, any command I try (apart from interrupt) returns "Target is
executing." and interrupt causes a hang.

Correct behaviour is recovered if target-async is not switched off, by
ommitting the line 'maintenance set target-async off'

This (pretty much as expected) gives the error message

Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target
and then try again.

The commit that seems to have caused the issue is
0b333c5e7d6c3fc65d37ffa11bd21ba52c4adb25
(https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=0b333c5e7d6c3fc65d37ffa11bd21ba52c4adb25)
'Merge async and sync code paths some more' by Pedro Alves

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-05 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05 12:18 [Bug remote/19064] New: Running shared in continue post-hook causes gdb remote command/response mismatch cmclachlan@undo-software.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).