From: Andrew Cagney <cagney@gnu.org>
To: Randolph Chung <randolph@tausq.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch/rfc/hppa] handle setting gp for calling shlib functions
Date: Tue, 04 May 2004 14:34:00 -0000 [thread overview]
Message-ID: <4097AA0A.4050603@gnu.org> (raw)
In-Reply-To: <20040504141035.GH3965@tausq.org>
>>What happens if the function pointer value, rather than code start
>>> address is passed into push dummy call? The entire value should be
>>> passed in, but this is a simple step in that direction.
>
>
> This will certainly help, as long as we also have a hook later in
> call_function_by_hand () that can twiddle the funcaddr before setting
> the breakpoint. maybe just moving the call that converts a funcptr to an
> address to after the push dummy call?
Yes, or find_function addr could return both.
> btw, a related but slightly different question -- i don't see any code
> in this path which will preserve and restore the call-clobbered
> registers when doing a call. how does gdb ensure that the register
> state before and after the call are the same? (i do see that there is
> a testcase for this though.)
See generic_push_dummy_frame (the name is historic) which saves all
registers in save_reggroup (which by default is all registers).
callfuncs.exp checks that this works, namely tests like:
PASS: gdb.base/callfuncs.exp: gdb function calls preserve register contents
PASS: gdb.base/callfuncs.exp: continue after stop in call dummy
preserves register contents
PASS: gdb.base/callfuncs.exp: finish after stop in call dummy preserves
register contents
PASS: gdb.base/callfuncs.exp: return after stop in call dummy preserves
register contents
PASS: gdb.base/callfuncs.exp: nested call dummies preserve register contents
Andrew
prev parent reply other threads:[~2004-05-04 14:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-29 6:23 Randolph Chung
2004-04-29 14:12 ` Andrew Cagney
2004-04-29 15:07 ` Randolph Chung
2004-04-29 16:02 ` Andrew Cagney
2004-04-29 16:13 ` Randolph Chung
2004-04-29 16:48 ` Andrew Cagney
2004-04-30 4:04 ` Randolph Chung
2004-04-30 14:25 ` Andrew Cagney
2004-05-04 14:03 ` Andrew Cagney
2004-05-04 14:10 ` Randolph Chung
2004-05-04 14:34 ` 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=4097AA0A.4050603@gnu.org \
--to=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
--cc=randolph@tausq.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