From: Oleg Nesterov <oleg@redhat.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: archer@sourceware.org, utrace-devel@redhat.com
Subject: Re: gdbstub initial code, v9
Date: Thu, 09 Sep 2010 15:33:00 -0000 [thread overview]
Message-ID: <20100909152937.GA21586@redhat.com> (raw)
In-Reply-To: <y0my6bbccqs.fsf@fche.csb>
On 09/09, Frank Ch. Eigler wrote:
>
> Oleg Nesterov <oleg@redhat.com> writes:
>
> > [...]
> > But, Jan. Implementing the memory writes does not mean breakpoints
> > automatically start to work!
>
> It approximately should though.
>
> > Yes, gdb writes cc, and yes the tracee reports SIGTRAP. But after
> > that "continue" does nothing except "$c", and the tracee naturally
> > gets SIGILL. I expected that, since ugdb doesn't even know the code
> > was changed, gdb should write the original byte back before continue,
> > but this doesn't happen.
>
> In normal all-stop mode,
Currently ugdb only supports non-stop
> gdb does normally replace the old
> instruction, in order to single-step over it with the 's' packet.
Yes, probably single-stepping is needed... I am still trying to
understand how this works with gdbserver, but I see vCont:s packets.
> Perhaps you're testing some buggy non-stop aspect that only works
> with 'Z' breakpoint management packets?
No. Just a trivial test-case which printfs in a loop.
> A fuller packet trace
> would help explain.
Please see below. But the only important part is:
$M4005ba,1:cc <------- set bp
$c <------- resume
of course, this can't work.
Full trace:
=> qSupported:multiprocess+
<= PacketSize=400;QStartNoAckMode+;QNonStop+;multiprocess+;QPassS...
=> QStartNoAckMode
<= OK
=> !
<= OK
=> Hgp0.0
<= E01
=> QNonStop:1
<= OK
=> qfThreadInfo
<= E01
=> ?
<= OK
=> qSymbol::
<=
=> vAttach;95b
<= OK
=> qfThreadInfo
<= mp95b.95b
=> qsThreadInfo
<= l
=> Hgp95b.95b
<= OK
=> vCont?
<= vCont;t
=> vCont;t:p95b.-1
<= OK
<= %Stop:T00thread:p95b.95b;
=> vStopped
<= OK
=> g
<= fcfdffffffffffff90ad5329ff7f0000ffffffffffffffff00000000000000...
=> m600880,8
<= 403c6d7d007f0000
=> m7f007d6d3c48,8
<= 00106d7d007f0000
=> m7f007d6d1000,28
<= 0000000000000000f6e04c7d007f0000e80760000000000080156d7d007f00...
=> m7f007d6d1580,28
<= 00f0ef29ff7f0000f6e04c7d007f000050f45f29ff7f000000c06c7d007f00...
=> m7f007d4ce0f4,4
<= 090a0069
=> m7f007d6cc000,28
<= 0030167d007f0000781f6d7d007f0000400b4b7d007f0000e8346d7d007f00...
=> m7f007d6d1f78,4
<= 2f6c6962
=> m7f007d6d1f7c,4
<= 2f6c6962
=> m7f007d6d1f80,4
<= 632e736f
=> m7f007d6d1f84,4
<= 2e360000
=> m7f007d6d34e8,28
<= 00704b7d007f00000002400000000000082e6d7d007f000000000000000000...
=> m400200,4
<= 2f6c6962
=> m400204,4
<= 2f6c642d
=> m400208,4
<= 6c696e75
=> m40020c,4
<= 782d7838
=> m400210,4
<= 362d3634
=> m400214,4
<= 2e736f2e
=> m400218,4
<= 32000000
=> m7f007d6d3c40,4
<= 01000000
=> m7f007d6d3c48,8
<= 00106d7d007f0000
=> m7f007d6d3c50,8
<= c04e4c7d007f0000
=> Z0,7f007d4c4ec0,1
<=
=> m7f007d4c4ec0,1
<= f3
=> X7f007d4c4ec0,0:
<=
=> M7f007d4c4ec0,1:cc
<= OK
=> m600880,8
<= 403c6d7d007f0000
=> m7f007d6d3c48,8
<= 00106d7d007f0000
=> m7f007d6d1000,28
<= 0000000000000000f6e04c7d007f0000e80760000000000080156d7d007f00...
=> m7f007d6d1580,28
<= 00f0ef29ff7f0000f6e04c7d007f000050f45f29ff7f000000c06c7d007f00...
=> m7f007d4ce0f4,4
<= 090a0069
=> m7f007d6cc000,28
<= 0030167d007f0000781f6d7d007f0000400b4b7d007f0000e8346d7d007f00...
=> m7f007d6d1f78,4
<= 2f6c6962
=> m7f007d6d1f7c,4
<= 2f6c6962
=> m7f007d6d1f80,4
<= 632e736f
=> m7f007d6d1f84,4
<= 2e360000
=> m7f007d6d34e8,28
<= 00704b7d007f00000002400000000000082e6d7d007f000000000000000000...
=> m400200,4
<= 2f6c6962
=> m400204,4
<= 2f6c642d
=> m400208,4
<= 6c696e75
=> m40020c,4
<= 782d7838
=> m400210,4
<= 362d3634
=> m400214,4
<= 2e736f2e
=> m400218,4
<= 32000000
=> m7f007d6d3c40,4
<= 01000000
=> vCont;t:p95b.-1
<= OK
=> m7f007d201f40,1
<= 48
=> m7f007d201f40,1
<= 48
=> g
<= fcfdffffffffffff90ad5329ff7f0000ffffffffffffffff00000000000000...
=> m7f007d201f40,1
<= 48
=> m7f007d201f40,1
<= 48
=> m40056c,12
<= 554889e5e8e3feffff89c6ba07000000bfdc
=> m40056c,1
<= 55
=> m40056d,3
<= 4889e5
=> m40056c,12
<= 554889e5e8e3feffff89c6ba07000000bfdc
=> m40056c,1
<= 55
=> m40056d,3
<= 4889e5
=> m4005ba,1
<= e8
=> m4005ba,1
<= e8
(gdb) b BP.c:13
Breakpoint 1 at 0x4005ba: file BP.c, line 13.
=> M4005ba,1:cc
<= OK
gdb writes "int 3".
(gdb) c
Continuing.
=> QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;4c;
<= OK
=> Hcp95b.95b
<= OK
=> c
<= OK
<= %Stop:T05thread:p95b.95b;
the tracee hits this bp and reports SIGTRAP
=> vStopped
<= OK
=> g
<= 00000000000000000006400000000000401f207d007f000000000000000000...
=> P10=ba05400000000000
<=
=> G00000000000000000006400000000000401f207d007f00000000000000000...
<=
=> m4005ba,1
<= cc
=> m4005ba,1
<= cc
=> g
<= 00000000000000000006400000000000401f207d007f000000000000000000...
=> m4005bb,1
<= 99
=> m4005bb,1
<= 99
Breakpoint 1, main () at BP.c:13
13 printf("THREE %d %d\n\n", getpid(), __LINE__);
(gdb) c
Continuing.
=> c
<= OK
gdb just resumes the tracee,
<= %Stop:T04thread:p95b.95b;
and of course it gets SIGILL after "int 3"
=> vStopped
<= OK
=> g
<= 00000000000000000006400000000000401f207d007f000000000000000000...
=> m4005bc,1
<= fe
=> m4005bc,1
<= fe
=> g
<= 00000000000000000006400000000000401f207d007f000000000000000000...
=> m4005bc,1
<= fe
=> m4005bc,1
<= fe
=> qTStatus
<= T0
=> M4005ba,1:e8
<= OK
=> M7f007d4c4ec0,1:f3
<= OK
=> D;95b
<= OK
=> qTStatus
<= T0
next prev parent reply other threads:[~2010-09-09 15:33 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-08 19:22 Oleg Nesterov
2010-09-09 10:29 ` Jan Kratochvil
2010-09-09 15:06 ` Oleg Nesterov
2010-09-09 12:39 ` Frank Ch. Eigler
2010-09-09 15:33 ` Oleg Nesterov [this message]
2010-09-09 15:54 ` Oleg Nesterov
2010-09-09 16:07 ` Frank Ch. Eigler
2010-09-09 16:37 ` Oleg Nesterov
2010-09-09 16:11 ` Jan Kratochvil
2010-09-09 16:34 ` Oleg Nesterov
2010-09-09 16:36 ` Jan Kratochvil
2010-09-09 16:48 ` Oleg Nesterov
2010-09-09 16:50 ` Oleg Nesterov
2010-09-09 16:51 ` Tom Tromey
2010-09-10 10:12 ` Roland McGrath
2010-09-10 18:14 ` Oleg Nesterov
2010-09-10 19:43 ` Tom Tromey
2010-09-10 19:49 ` Oleg Nesterov
2010-09-13 5:54 ` Kevin Buettner
2010-09-14 2:20 ` Roland McGrath
2010-09-14 16:10 ` Oleg Nesterov
2010-09-14 16:30 ` Jan Kratochvil
2010-09-14 21:30 ` Tom Tromey
2010-09-15 19:43 ` Kevin Buettner
2010-09-10 22:03 ` ugdb && breakpoints Oleg Nesterov
2010-09-10 22:12 ` Tom Tromey
2010-09-14 19:38 ` Roland McGrath
2010-09-14 19:47 ` Oleg Nesterov
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=20100909152937.GA21586@redhat.com \
--to=oleg@redhat.com \
--cc=archer@sourceware.org \
--cc=fche@redhat.com \
--cc=utrace-devel@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).