From: Stan Shebs <stanshebs@earthlink.net>
To: gdb-patches@sourceware.org
Subject: Re: [patch, gdbserver] Uninsert bpkt when regular and fast tracepoint are set at the same address
Date: Thu, 27 Oct 2011 19:47:00 -0000 [thread overview]
Message-ID: <4EA9A527.4030003@earthlink.net> (raw)
In-Reply-To: <4EA8C851.2080703@codesourcery.com>
On 10/26/11 7:56 PM, Yao Qi wrote:
> Hi,
> I find a program will receive segv fault when I set a regular tracepoint
> and a fast tracepoint at the same address, start tracing and resume program.
>
> gdbserver has taken care of this situation in many places of the code,
> when uninserting breakpoint or fast tracepoint, write_inferior_memory is
> called to take care of layering breakpoints on top of fast tracepoints.
> However, it is not right to me. Here is an example to illustrate this
> problem.
>
> Supposing I set a regular tracepoint and a fast tracepoint on 0x080484fc,
>
> 0x080484fc<+3>: e8 f3 ff ff ff call 0x80484f4<func>
>
> During insertion, trap insn (for regular tracepoint) and jmp insn (for
> fast tracepoint) are inserted, and gdbserver takes care of them to make
> sure trap insn is *always* inserted on top of jmp insn.
I'm looking at this and wondering, why are we inserting the fast
tracepoint jump insn at all?
Shouldn't be it sufficient to let the trap handler do the work of both
slow and fast tracepoints at that location? Since hitting the trap has
already put us on the slow path, there's not going to any noticeable
additional penalty for not going to the IPA and interpreting conditional
bytecodes instead of compiled ones, etc. We may not even need to sync
trace buffers (I'm not sure about that, code is tricky).
Stan
stan@codesourcery.com
next prev parent reply other threads:[~2011-10-27 18:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-27 7:04 Yao Qi
2011-10-27 16:09 ` Pedro Alves
2011-10-29 12:40 ` Yao Qi
2011-10-31 9:41 ` Yao Qi
2011-10-31 13:28 ` Pedro Alves
2011-10-27 19:47 ` Stan Shebs [this message]
2011-10-27 21:23 ` 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=4EA9A527.4030003@earthlink.net \
--to=stanshebs@earthlink.net \
--cc=gdb-patches@sourceware.org \
/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