2003-01-21 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Tue, 21 Jan 2003 19:43:48 +0000 (19:43 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 21 Jan 2003 19:43:48 +0000 (19:43 +0000)
* 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.

gdb/ChangeLog
gdb/blockframe.c
gdb/exec.c
gdb/gdbarch.c
gdb/gdbarch.sh
gdb/inferior.h
gdb/sh-tdep.c
gdb/valops.c

index f2df4caa3f588c39ca4641c0c3a3ea71bf4c9cde..33b9a09bcdba5050282a7afbae15717cf44e86c0 100644 (file)
@@ -1,3 +1,19 @@
+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.
index df94e85913668b309661b6ece3903c5969a5a728..d5ed002593234fe305924190e0ab48877fbbd639 100644 (file)
@@ -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
index 036df003bf8be4edd9eb52d9c3292b0ca88f7774..0bde096c7c2ed51c0e160e71d0ab25f78ed2e8d9 100644 (file)
@@ -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)
index bd19793ff15bb71e1228a2f939a3acc602fcc388..81efdad4d1642f4c6abcc77feef423a14e0e491c 100644 (file)
@@ -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);
index fd9ddd5260585ee1f3d239d48e2b69e6b090d915..87cc01f712497cc8a56fec42bec0b92be23689c5 100755 (executable)
@@ -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
index 67c1170054ac6fa2d9cb89c98f858b97ea05f00f..4616a1f3da7d64e6bc9a5b2fb6d1a272bd52985e 100644 (file)
@@ -418,8 +418,6 @@ extern int attach_flag;
 \f
 /* 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)
@@ -477,24 +475,6 @@ extern int attach_flag;
 
 /* Are we in a call dummy? */
 
-/* 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_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
index 08281badd0ef441b344f4da1a2fc8643bc12d94c..fc1049b0255d7e5a38ca3059efc9abd68c40ee86 100644 (file)
@@ -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"
index d1a18774f964eeefd80097d376041bc468880a54..c4876346ae4d8346aa604872285a4b6b9f96baf9 100644 (file)
@@ -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;