From: Doug Evans <dje@google.com>
To: Stan Shebs <stanshebs@earthlink.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Collect return addresses at tracepoints
Date: Sat, 24 Sep 2011 09:19:00 -0000 [thread overview]
Message-ID: <CADPb22QYi+e=m69660iuGM_8NuG=Dy8bm-=1Zd1C4WEWMuocVg@mail.gmail.com> (raw)
In-Reply-To: <4E7A5B0C.2020802@earthlink.net>
On Wed, Sep 21, 2011 at 2:45 PM, Stan Shebs <stanshebs@earthlink.net> wrote:
> This patch introduces a new tracepoint collection directive $_ret, which
> asks for the collection of the return address stored in the current stack
> frame. It's not the complete solution for what users really want, which is
> to collect several frames of the stack, but that's hard to get right without
> adding a fancy unwinder to the tracepoint agent. This is much simpler,
> needing only an architecture-specific method to generate appropriate
> bytecodes.
>
> Not too much controversial here - the testsuite exercises the code, but it
> won't fail the test if the caller's name doesn't appear in the backtrace,
> since we can't guarantee that the method's heuristic will always work.
>
> I'll commit this in a few days if there are no objections.
>
> Stan
> stan@codesourcery.com
>
> 2011-09-21 Stan Shebs <stan@codesourcery.com>
>
> Add return address collection for tracepoints.
> * tracepoint.c (encode_actions_1): Add case for $_ret.
> (validate_actionline): Check for $_ret.
> (trace_dump_actions): Ditto.
> * ax-gdb.h (gen_trace_for_return_address): Declare.
> * ax-gdb.c: Include arch-utils.h.
> (gen_trace_for_return_address): New function.
> (agent_command): Add return address special case.
> * amd64-tdep.c: Include ax.h and ax-gdb.h.
> (amd64_gen_return_address): New function.
> (amd64_init_abi): Call it.
> * i386-tdep.c: Include ax.h and ax-gdb.h.
> (i386_gen_return_address): New function.
> (i386_init_abi): Call it.
> * arch-utils.h (default_gen_return_address): Declare.
> * arch-utils.c (default_gen_return_address): New function.
> * gdbarch.sh (gen_return_address): New method.
> * gdbarch.h, gdbarch.c: Regenerate.
>
> * gdb.texinfo (Tracepoint Action Lists): Document $_ret.
>
> * gdb.trace/collection.exp: Test collection of $_ret.
Hi. Nit:
+ void
+ amd64_gen_return_address (struct gdbarch *gdbarch,
+ struct agent_expr *ax, struct axs_value *value,
+ CORE_ADDR scope)
+ void
+ i386_gen_return_address (struct gdbarch *gdbarch,
+ struct agent_expr *ax, struct axs_value *value,
+ CORE_ADDR scope)
These should be static.
prev parent reply other threads:[~2011-09-23 17:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 22:48 Stan Shebs
2011-09-22 18:22 ` Eli Zaretskii
2011-09-23 7:34 ` Stan Shebs
2011-09-23 8:45 ` Eli Zaretskii
2011-09-22 23:42 ` Yao Qi
2011-09-24 9:19 ` Doug Evans [this message]
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='CADPb22QYi+e=m69660iuGM_8NuG=Dy8bm-=1Zd1C4WEWMuocVg@mail.gmail.com' \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=stanshebs@earthlink.net \
/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