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.
This commit is contained in:
parent
eb4f72c5f9
commit
73c1f219a3
8 changed files with 20 additions and 74 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
31
gdb/valops.c
31
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;
|
||||
|
|
Loading…
Reference in a new issue