Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Jafa" <jafa@silicondust.com>
To: <gdb@sources.redhat.com>
Subject: Frame handling
Date: Tue, 01 Jul 2003 01:20:00 -0000	[thread overview]
Message-ID: <09a601c33f6e$b05a3480$0a02a8c0@scenix.com> (raw)

Hi all,

I am bringing the ip2k port back in sync with the trunk and I need to check
my (limited) understanding of the new scheme...

This email is mostly a ramble about my understanding of the new frame
handling that I would like a sanity check on.

frame_base_set_default (gdbarch, &avr_frame_base) registers a set of
function handlers:
this_base - given a frame, figure out the base address of the caller frame
(caller's FP)... usually this means doing some analysis to figure everything
out about the frame and populating the port-specific cache for this new
frame.
this_locals - given a frame, figure out the address of the local variables
of the callers frame (usually caller's FP as debug info already allows for
the offset).
this_args - given a frame, figure out the address of the args passed to the
callers frame (usually caller's FP as debug info already allows for the
offset).

Port specific implementation... The first time one of these functions is
called the port-specific cache will be a NULL pointer... the code should
allocate memory to hold the useful frame variables and figure out the frame
information. Subsequent calls will receive the cache back and can return the
values from the cache.

frame_base_set_default also sets the unwind options...
type - always NORMAL_FRAME?
this_id - Given a frame, return a unique identifier for the caller's frame
based on the caller's frame base address and the calling functions entry
point.
prev_register - Given a frame, return the value of a specified register as
it was on entry to this function (registers that are known to be saved on
the stack)

Question - what registers is gdb expecting prev_register to give reasonable
results for? Just PC? Or SP and FP as well?

Question - reading through this again I think the goal of call these
functions is to work with the current frame and the function get passed the
child frame so they can do a backtrace if it hasn't already been done... why
not call a function to do a 1 level backtrace and then eliminate the
next_frame parameter? It would recduce confusion and most ports will have an
internal unwind function anyway.

frame_unwind_append_predicate (gdbarch, d10v_frame_p) - this seams to
register the same unwind options as above?

I think this makes sense but I would appreciate a sanity check :-)

Thanks

Nick

Nick Kelsey
Senior Software Engineer
Ubicom



             reply	other threads:[~2003-07-01  1:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-01  1:20 Jafa [this message]
2003-07-01  3:42 ` Daniel Jacobowitz
2003-07-01  4:18   ` Andrew Cagney
     [not found]   ` <redirect-6800274@silicondust.com>
2003-07-01  5:13     ` Jafa
2003-07-01 12:58       ` Andrew Cagney
2003-07-01 14:09         ` Daniel Jacobowitz
2003-07-01 14:57           ` Andrew Cagney
     [not found]           ` <redirect-6810110@silicondust.com>
2003-07-01 17:00             ` Jafa
2003-07-02  7:13               ` libgdb jacques
     [not found]       ` <redirect-6810084@silicondust.com>
2003-07-01 16:14         ` Frame handling Jafa
2003-07-01 17:59           ` Andrew Cagney
  -- strict thread matches above, loose matches on Subject: below --
2003-07-01  5:00 Jafa
2003-07-01 12:45 ` Daniel Jacobowitz
2003-07-01 13:02 ` Andrew Cagney
2003-07-03  9:05   ` Paul N. Hilfinger
2003-04-08 18:35 Jafa
2003-04-14  3:43 ` Andrew Cagney

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='09a601c33f6e$b05a3480$0a02a8c0@scenix.com' \
    --to=jafa@silicondust.com \
    --cc=gdb@sources.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