aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-01-21 19:43:48 +0000
committerAndrew Cagney <cagney@redhat.com>2003-01-21 19:43:48 +0000
commit73c1f219a3acce0f4763fa968de7e74525b4313d (patch)
tree391549e9dfdfcf4945cbf4c0a6446626f42f8b41
parenteb4f72c5f97465009446c097eef2204c6e8573e2 (diff)
downloadgdb-73c1f219a3acce0f4763fa968de7e74525b4313d.zip
gdb-73c1f219a3acce0f4763fa968de7e74525b4313d.tar.gz
gdb-73c1f219a3acce0f4763fa968de7e74525b4313d.tar.bz2
2003-01-21 Andrew Cagney <ac131313@redhat.com>
* exec.c (text_start): Delete global variable. (exec_file_attach): Make text_start local to the function. * inferior.h (BEFORE_TEXT_END, AFTER_TEXT_END): Delete macros. * valops.c (hand_function_call): Delete code that handles BEFORE_TEXT_END and AFTER_TEXT_END. * gdbarch.sh (CALL_DUMMY_LENGTH): Test call_dummy_length instead of CALL_DUMMY_LOCATION. * gdbarch.c: Regenerate. * inferior.h (deprecated_pc_in_call_dummy_before_text_end) (deprecated_pc_in_call_dummy_after_text_end): Delete declaration. * blockframe.c (deprecated_pc_in_call_dummy_before_text_end) (deprecated_pc_in_call_dummy_after_text_end): Delete functions. (text_end): Delete extern declaration.
-rw-r--r--gdb/ChangeLog16
-rw-r--r--gdb/blockframe.c18
-rw-r--r--gdb/exec.c3
-rw-r--r--gdb/gdbarch.c2
-rwxr-xr-xgdb/gdbarch.sh2
-rw-r--r--gdb/inferior.h20
-rw-r--r--gdb/sh-tdep.c2
-rw-r--r--gdb/valops.c31
8 files changed, 20 insertions, 74 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f2df4ca..33b9a09 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,21 @@
2003-01-21 Andrew Cagney <ac131313@redhat.com>
+ * exec.c (text_start): Delete global variable.
+ (exec_file_attach): Make text_start local to the function.
+ * inferior.h (BEFORE_TEXT_END, AFTER_TEXT_END): Delete macros.
+ * valops.c (hand_function_call): Delete code that handles
+ BEFORE_TEXT_END and AFTER_TEXT_END.
+ * gdbarch.sh (CALL_DUMMY_LENGTH): Test call_dummy_length instead
+ of CALL_DUMMY_LOCATION.
+ * gdbarch.c: Regenerate.
+ * inferior.h (deprecated_pc_in_call_dummy_before_text_end)
+ (deprecated_pc_in_call_dummy_after_text_end): Delete declaration.
+ * blockframe.c (deprecated_pc_in_call_dummy_before_text_end)
+ (deprecated_pc_in_call_dummy_after_text_end): Delete functions.
+ (text_end): Delete extern declaration.
+
+2003-01-21 Andrew Cagney <ac131313@redhat.com>
+
* frame.h (FRAME_OBSTACK_ZALLOC): Define.
* blockframe.c (backtrace_below_main): Move to "frame.c".
(frame_chain_valid): Delete check for backtrace_below_main.
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index df94e85..d5ed002 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -607,24 +607,6 @@ block_innermost_frame (struct block *block)
below is for infrun.c, which may give the macro a pc without that
subtracted out. */
-extern CORE_ADDR text_end;
-
-int
-deprecated_pc_in_call_dummy_before_text_end (CORE_ADDR pc, CORE_ADDR sp,
- CORE_ADDR frame_address)
-{
- return ((pc) >= text_end - CALL_DUMMY_LENGTH
- && (pc) <= text_end + DECR_PC_AFTER_BREAK);
-}
-
-int
-deprecated_pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp,
- CORE_ADDR frame_address)
-{
- return ((pc) >= text_end
- && (pc) <= text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK);
-}
-
/* Is the PC in a call dummy? SP and FRAME_ADDRESS are the bottom and
top of the stack frame which we are checking, where "bottom" and
"top" refer to some section of memory which contains the code for
diff --git a/gdb/exec.c b/gdb/exec.c
index 036df00..0bde096 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -90,7 +90,6 @@ int write_files = 0;
#ifndef NEED_TEXT_START_END
#define NEED_TEXT_START_END (0)
#endif
-CORE_ADDR text_start = 0;
CORE_ADDR text_end = 0;
struct vmap *vmap;
@@ -279,7 +278,7 @@ exec_file_attach (char *filename, int from_tty)
/* FIXME: The comment above does not match the code. The
code checks for sections with are either code *or*
readonly. */
- text_start = ~(CORE_ADDR) 0;
+ CORE_ADDR text_start = ~(CORE_ADDR) 0;
text_end = (CORE_ADDR) 0;
for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++)
if (bfd_get_section_flags (p->bfd, p->the_bfd_section)
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index bd19793..81efdad 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -986,7 +986,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"gdbarch_dump: CALL_DUMMY_LENGTH # %s\n",
XSTRING (CALL_DUMMY_LENGTH));
- if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END)
+ if (gdbarch->call_dummy_length >= 0)
fprintf_unfiltered (file,
"gdbarch_dump: CALL_DUMMY_LENGTH = %d\n",
CALL_DUMMY_LENGTH);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index fd9ddd5..87cc01f 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -502,7 +502,7 @@ f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0::gdbarch->call_du
v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1:::0x%08lx
v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1:0x%08lx::CALL_DUMMY_BREAKPOINT_OFFSET_P
v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1
-v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END
+v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::gdbarch->call_dummy_length >= 0
# NOTE: cagney/2002-11-24: This function with predicate has a valid
# (callable) initial value. As a consequence, even when the predicate
# is false, the corresponding function works. This simplifies the
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 67c1170..4616a1f 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -418,8 +418,6 @@ extern int attach_flag;
/* Possible values for CALL_DUMMY_LOCATION. */
#define ON_STACK 1
-#define BEFORE_TEXT_END 2
-#define AFTER_TEXT_END 3
#define AT_ENTRY_POINT 4
#if !defined (CALL_DUMMY_ADDRESS)
@@ -482,24 +480,6 @@ extern int attach_flag;
version should be able to handle all cases since that code works by
saving the address of the dummy's breakpoint (where ever it is). */
-extern int deprecated_pc_in_call_dummy_before_text_end (CORE_ADDR pc,
- CORE_ADDR sp,
- CORE_ADDR frame_address);
-
-/* NOTE: cagney/2002-11-24: Targets need to both switch to generic
- dummy frames, and use generic_pc_in_call_dummy(). The generic
- version should be able to handle all cases since that code works by
- saving the address of the dummy's breakpoint (where ever it is). */
-
-extern int deprecated_pc_in_call_dummy_after_text_end (CORE_ADDR pc,
- CORE_ADDR sp,
- CORE_ADDR frame_address);
-
-/* NOTE: cagney/2002-11-24: Targets need to both switch to generic
- dummy frames, and use generic_pc_in_call_dummy(). The generic
- version should be able to handle all cases since that code works by
- saving the address of the dummy's breakpoint (where ever it is). */
-
extern int deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc,
CORE_ADDR sp,
CORE_ADDR frame_address);
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 08281ba..fc1049b 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -33,7 +33,7 @@
#include "gdbcore.h"
#include "value.h"
#include "dis-asm.h"
-#include "inferior.h" /* for BEFORE_TEXT_END etc. */
+#include "inferior.h"
#include "gdb_string.h"
#include "arch-utils.h"
#include "floatformat.h"
diff --git a/gdb/valops.c b/gdb/valops.c
index d1a1877..c487634 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1398,37 +1398,6 @@ hand_function_call (struct value *function, int nargs, struct value **args)
generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1);
}
- if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END)
- {
- /* Convex Unix prohibits executing in the stack segment. */
- /* Hope there is empty room at the top of the text segment. */
- extern CORE_ADDR text_end;
- static int checked = 0;
- if (!checked)
- for (start_sp = text_end - sizeof_dummy1; start_sp < text_end; ++start_sp)
- if (read_memory_integer (start_sp, 1) != 0)
- error ("text segment full -- no place to put call");
- checked = 1;
- sp = old_sp;
- real_pc = text_end - sizeof_dummy1;
- write_memory (real_pc, (char *) dummy1, sizeof_dummy1);
- if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
- generic_save_call_dummy_addr (real_pc, real_pc + sizeof_dummy1);
- }
-
- if (CALL_DUMMY_LOCATION == AFTER_TEXT_END)
- {
- extern CORE_ADDR text_end;
- int errcode;
- sp = old_sp;
- real_pc = text_end;
- errcode = target_write_memory (real_pc, (char *) dummy1, sizeof_dummy1);
- if (errcode != 0)
- error ("Cannot write text segment -- call_function failed");
- if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
- generic_save_call_dummy_addr (real_pc, real_pc + sizeof_dummy1);
- }
-
if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
{
real_pc = funaddr;