From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [patch rfc] Eliminate write_sp()
Date: Thu, 27 Mar 2003 02:04:00 -0000 [thread overview]
Message-ID: <3E825C3E.4010201@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
Hello,
It turns out that there is only one call to write_sp() in core GDB,
found in hand_function_call(). Since that call is made redundant by
push_dummy_call(), I think it should be removed / deprecated. This is
just a tiny step - replace it with the underlying TARGET_WRITE_SP().
I'll commit in a day or so,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 4743 bytes --]
2003-03-26 Andrew Cagney <cagney@redhat.com>
* regcache.c (write_sp): Delete function and references.
* inferior.h (write_sp): Delete declaration.
* valops.c (hand_function_call): Replace write_sp with
TARGET_WRITE_SP.
* sparc-tdep.c (sparc_push_dummy_frame): Ditto.
(sparc_pop_frame): Ditto.
Index: doc/ChangeLog
2003-03-26 Andrew Cagney <cagney@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Remove
references to write_sp.
Index: inferior.h
===================================================================
RCS file: /cvs/src/src/gdb/inferior.h,v
retrieving revision 1.43
diff -u -r1.43 inferior.h
--- inferior.h 25 Mar 2003 18:54:15 -0000 1.43
+++ inferior.h 27 Mar 2003 01:54:07 -0000
@@ -178,8 +178,6 @@
extern CORE_ADDR generic_target_read_sp (void);
-extern void write_sp (CORE_ADDR);
-
extern void generic_target_write_sp (CORE_ADDR);
extern CORE_ADDR read_fp (void);
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.73
diff -u -r1.73 regcache.c
--- regcache.c 12 Mar 2003 20:50:13 -0000 1.73
+++ regcache.c 27 Mar 2003 01:54:09 -0000
@@ -1328,16 +1328,16 @@
}
-/* read_pc, write_pc, read_sp, write_sp, read_fp, etc. Special
- handling for registers PC, SP, and FP. */
+/* read_pc, write_pc, read_sp, read_fp, etc. Special handling for
+ registers PC, SP, and FP. */
/* NOTE: cagney/2001-02-18: The functions generic_target_read_pc(),
read_pc_pid(), read_pc(), generic_target_write_pc(),
write_pc_pid(), write_pc(), generic_target_read_sp(), read_sp(),
- generic_target_write_sp(), write_sp(), generic_target_read_fp() and
- read_fp(), will eventually be moved out of the reg-cache into
- either frame.[hc] or to the multi-arch framework. The are not part
- of the raw register cache. */
+ generic_target_write_sp(), generic_target_read_fp() and read_fp(),
+ will eventually be moved out of the reg-cache into either
+ frame.[hc] or to the multi-arch framework. The are not part of the
+ raw register cache. */
/* This routine is getting awfully cluttered with #if's. It's probably
time to turn this into READ_PC and define it in the tm.h file.
@@ -1454,12 +1454,6 @@
#endif
internal_error (__FILE__, __LINE__,
"generic_target_write_sp");
-}
-
-void
-write_sp (CORE_ADDR val)
-{
- TARGET_WRITE_SP (val);
}
CORE_ADDR
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.78
diff -u -r1.78 sparc-tdep.c
--- sparc-tdep.c 26 Mar 2003 22:39:52 -0000 1.78
+++ sparc-tdep.c 27 Mar 2003 01:54:18 -0000
@@ -1040,7 +1040,7 @@
sp -= DUMMY_STACK_SIZE;
- write_sp (sp);
+ TARGET_WRITE_SP (sp);
write_memory (sp + DUMMY_REG_SAVE_OFFSET, ®ister_temp[0],
DUMMY_STACK_REG_BUF_SIZE);
@@ -1310,7 +1310,7 @@
read_memory_integer (fsr[O0_REGNUM + 7],
SPARC_INTREG_SIZE));
- write_sp (get_frame_base (frame));
+ TARGET_WRITE_SP (get_frame_base (frame));
}
else if (fsr[I0_REGNUM])
{
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.99
diff -u -r1.99 valops.c
--- valops.c 26 Mar 2003 22:39:52 -0000 1.99
+++ valops.c 27 Mar 2003 01:54:23 -0000
@@ -1697,7 +1697,7 @@
frame), and none of the code following that code adjusts the
stack-pointer value, the below call is entirely redundant. */
if (!gdbarch_push_dummy_call_p (current_gdbarch))
- write_sp (sp);
+ TARGET_WRITE_SP (sp);
if (SAVE_DUMMY_FRAME_TOS_P ())
SAVE_DUMMY_FRAME_TOS (sp);
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.135
diff -u -r1.135 gdbint.texinfo
--- doc/gdbint.texinfo 26 Mar 2003 22:39:53 -0000 1.135
+++ doc/gdbint.texinfo 27 Mar 2003 01:54:33 -0000
@@ -3894,12 +3894,11 @@
@findex read_pc
@findex write_pc
@findex read_sp
-@findex write_sp
@findex read_fp
These change the behavior of @code{read_pc}, @code{write_pc},
-@code{read_sp}, @code{write_sp} and @code{read_fp}. For most targets,
-these may be left undefined. @value{GDBN} will call the read and write
-register functions with the relevant @code{_REGNUM} argument.
+@code{read_sp} and @code{read_fp}. For most targets, these may be left
+undefined. @value{GDBN} will call the read and write register functions
+with the relevant @code{_REGNUM} argument.
These macros are useful when a target keeps one of these registers in a
hard to get at place; for example, part in a segment register and part
next reply other threads:[~2003-03-27 2:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-27 2:04 Andrew Cagney [this message]
2003-03-27 3:53 ` Eli Zaretskii
2003-03-27 15:30 ` 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=3E825C3E.4010201@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb-patches@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