Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: tracepoints: abstract frame base finding in dwarf2loc.c
Date: Mon, 05 Nov 2007 16:41:00 -0000	[thread overview]
Message-ID: <m3ejf4zlu2.fsf@codesourcery.com> (raw)
In-Reply-To: <200711041721.lA4HLvsx030247@d12av02.megacenter.de.ibm.com> (Ulrich Weigand's message of "Sun, 4 Nov 2007 18:21:57 +0100 (CET)")


"Ulrich Weigand" <uweigand at de.ibm.com> writes:
> Jim Blandy wrote:
>
>> Here's a change to dwarf2loc.c that pulls out the guts of the code to
>> find a function symbol's frame base expression into its own function.
>> We'll also use this function to find frame bases for variables we're
>> collecting at a tracepoint, in a later patch.  There should be no
>> change in behavior.  Tested on i386 Linux with no regressions.
>
> Nice; I assume you'll be using that to handle DW_OP_fbreg properly and
> get rid of the gdbarch_virtual_frame_pointer call in tracepoint_var_ref?

Yes, exactly!

>> +/* Find the frame base expression for PC, within FUNCTION.
>> +   Set *START to a pointer to it; set *LENGTH to its length.  */
>> +static void
>> +symbol_frame_base (struct symbol *function, CORE_ADDR pc,
>> +                   gdb_byte **start, size_t *length)
>
> I think the FUNCTION is redundant here, it can be recovered
> via find_pc_function (pc).  This should in all cases have the
> same result as the get_frame_function (frame) call below.
>
>> +  struct symbol *framefunc = get_frame_function (frame);
>> +  CORE_ADDR pc = get_frame_address_in_block (frame);

Yes, I think you're right.  I had been confused about whether the
pc-decrementing magic necessary for find_pc_function to get the right
answer would always happen correctly, but:
- in the dwarf_expr_frame_base case, the PC we'd supply comes from
  get_frame_address_in_block, which does the magic, and
- in the tracepoint case, the address is supplied directly by the
  user, so the magic isn't required.

Thanks!


      reply	other threads:[~2007-11-05 16:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26 23:42 Jim Blandy
2007-10-27  8:19 ` Michael Snyder
2007-11-04 17:22 ` Ulrich Weigand
2007-11-05 16:41   ` Jim Blandy [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=m3ejf4zlu2.fsf@codesourcery.com \
    --to=jimb@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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