Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Eli Zaretskii <eliz@elta.co.il>
Cc: gdb-patches@sources.redhat.com, kettenis@chello.nl
Subject: Re: [patch rfc] push_dummy_call return a frame ID;	eliminate need for  read_fp
Date: Wed, 23 Apr 2003 18:48:00 -0000	[thread overview]
Message-ID: <3EA6A507.5060706@redhat.com> (raw)
In-Reply-To: <2927-Wed23Apr2003123434+0300-eliz@elta.co.il>

Hmm,

Patch withdrawn.  I've just figured out a more straight forward way of 
doing this.  The `else' comment:

> +	   re-identify the dummy breakpoint.  Code using
> +	   push_dummy_call() will have previously computed the dummy
> +	   frame's ID (and hence set "code_addr" to something
> +	   non-zero.  */
> +	id = frame_id_build (read_fp (), sal.pc);
> +      /* else ... is the sal.pc the frame ID's code_addr?  */
> +

gives the hint.

The frame ID's code_addr is always be the address of the breakpoint, so 
instead of having push_dummy_call() return the frame ID, it can return 
the ID's stack_addr, and then the hand function call code can explicitly 
construct the frame ID from that and the sap.pc.

I'll just need to check the Arm.

Andrew


> Now that the inferior function call code is all in a single function, more, and significant, cleanups become possible.
> 
> This patch modifies the architecture method push_dummy_call() so that it returns a frame ID, and not just a stack pointer.  That frame ID is then used:
> 
> - to create the breakpoint (the ID identifies the breakpoint's frame)
> 
> - to identify the dummy (somewhat indirectly at present as it still goes via SAVE_DUMMY_FRAME_TOS() and generic_save_call_dummy_addr())
> 
> This means that:
> 
> - push_dummy_call(regcache, ...) creates the dummy frame's ID
> 
> - unwind_dummy_id(frame, ...) is then expected to return that same value
> 
> so the need for one to match the other is hopefully both clear and easy ...
> 
> Future changes will involve:
> 
> - deprecating read_fp / TARGET_READ_FP, as core GDB no longer contains any legitimate calls
> 
> - merging SAVE_DUMMY_FRAME_TOS and generic_save_call_dummy_addr() into a single method that receives the full frame ID, and can not be overridden by the architecture.
> 
> Someone studying this carefully will probably realise that instead of having push_dummy_call() return the ID, the code could simply use:
> 
>     flush cached frames;
>     id = get_frame_id (get_current_frame ());
> 
> but that would incure additional overhead.
> 
> Mark,
> I think this patch resolves the i386's FP/SP frame ID problem.  It makes push_dummy_call responsible for computing the ID, and then just passes it through.
> 
> Richard,
> For the ARM, I've pulled a quick hack.  I'm not sure what would happen if the ARM started returning a full frame ID.
> 
> I'll leave this one sit for a week.
> 
> Andrew
> 
> 
> 
> 2003-04-22  Andrew Cagney  <cagney@redhat.com>
> 
> 	* d10v-tdep.c (d10v_push_dummy_call): Return a frame ID.
> 	(d10v_gdbarch_init): Do not set read_fp.
> 	(d10v_read_fp): Delete function.
> 	* arm-tdep.c (arm_push_dummy_call): Return the SP in a frame ID.
> 	* infcall.c (call_function_by_hand): New variable "id".
> 	Initialize using gdbarch_push_dummy_call when possible.  For
> 	legacy code, use the the frame ID's "stack_addr" instead of "sp"
> 	to track the stack's inner most address.
> 	* gdbarch.sh (PUSH_DUMMY_CALL): Return the frame ID instead of the
> 	stack's inner most address.
> 	* gdbarch.h, gdbarch.c: Re-generate.
> 	
> Index: doc/ChangeLog
> 2003-04-22  Andrew Cagney  <cagney@redhat.com>
> 
> 	* gdbint.texinfo (Target Architecture Definition): Update
> 	"push_dummy_call", returns a frame ID.  Cross reference
> 	"push_dummy_call" and "unwind_dummy_id".  Drop reference to
> 	SAVE_DUMMY_FRAME_TOS.
> 



      reply	other threads:[~2003-04-23 14:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-22 22:24 Andrew Cagney
2003-04-23 14:37 ` Eli Zaretskii
2003-04-23 18:48   ` Andrew Cagney [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=3EA6A507.5060706@redhat.com \
    --to=ac131313@redhat.com \
    --cc=eliz@elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /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