2004-03-07 Andrew Cagney <cagney@redhat.com>

* infcall.c (legacy_push_dummy_code): Delete #ifdef
	GDB_TARGET_IS_HPPA code.
	* config/pa/tm-hppa.h (DEPRECATED_FIX_CALL_DUMMY)
	(hppa_fix_call_dummy, DEPRECATED_CALL_DUMMY_HAS_COMPLETED)
	(DEPRECATED_DUMMY_WRITE_SP, CALL_DUMMY): Delete.
	* config/pa/tm-hppa64.h (CALL_DUMMY): Delete.
	* hppa-tdep.c (hppa_frame_chain, hppa_frame_chain_valid)
	(hppa_push_dummy_frame, hppa_pop_frame, hppa_push_arguments)
	(hppa_fix_call_dummy, hppa64_stack_align, hppa_frame_saved_pc)
	(hppa_init_extra_frame_info, hppa_saved_pc_after_call)
	(hppa64_call_dummy_breakpoint_offset, hppa_frame_init_saved_regs)
	(hppa_frameless_function_invocation, hppa64_store_return_value)
	(hppa_store_struct_return, hppa64_extract_return_value)
	(hppa64_use_struct_convention, hppa_frame_find_saved_regs)
	(hppa32_call_dummy_length, hppa64_call_dummy_length)
	(find_dummy_frame_regs, FUNC_LDIL_OFFSET, FUNC_LDO_OFFSET)
	(find_proc_framesize, deposit_21, restore_pc_queue)
	(find_return_regnum, pc_in_interrupt_handler, deposit_14)
	(rp_saved, pc_in_linker_stub):
This commit is contained in:
Andrew Cagney 2004-03-07 18:06:14 +00:00
parent 782eae8b54
commit 78161e4820
5 changed files with 21 additions and 2219 deletions

View file

@ -1,5 +1,25 @@
2004-03-07 Andrew Cagney <cagney@redhat.com>
* infcall.c (legacy_push_dummy_code): Delete #ifdef
GDB_TARGET_IS_HPPA code.
* config/pa/tm-hppa.h (DEPRECATED_FIX_CALL_DUMMY)
(hppa_fix_call_dummy, DEPRECATED_CALL_DUMMY_HAS_COMPLETED)
(DEPRECATED_DUMMY_WRITE_SP, CALL_DUMMY): Delete.
* config/pa/tm-hppa64.h (CALL_DUMMY): Delete.
* hppa-tdep.c (hppa_frame_chain, hppa_frame_chain_valid)
(hppa_push_dummy_frame, hppa_pop_frame, hppa_push_arguments)
(hppa_fix_call_dummy, hppa64_stack_align, hppa_frame_saved_pc)
(hppa_init_extra_frame_info, hppa_saved_pc_after_call)
(hppa64_call_dummy_breakpoint_offset, hppa_frame_init_saved_regs)
(hppa_frameless_function_invocation, hppa64_store_return_value)
(hppa_store_struct_return, hppa64_extract_return_value)
(hppa64_use_struct_convention, hppa_frame_find_saved_regs)
(hppa32_call_dummy_length, hppa64_call_dummy_length)
(find_dummy_frame_regs, FUNC_LDIL_OFFSET, FUNC_LDO_OFFSET)
(find_proc_framesize, deposit_21, restore_pc_queue)
(find_return_regnum, pc_in_interrupt_handler, deposit_14)
(rp_saved, pc_in_linker_stub):
Unconditionally enable 64-bit frame and ABI code.
* hppa-tdep.c (hppa_gdbarch_init): Do not set deprecated
call_dummy_breakpoint_offset, call_dummy_length, stack_align,
@ -9,7 +29,7 @@
init_frame_pc, frame_init_saved_regs, init_extra_frame_info,
frame_chain, frame_chain_valid, frameless_function_invocation,
frame_saved_pc, and pop_frame.
* hppa-tdep.c: Replace PC_REGNUM with PCOQ_HEAD_REGNUM.
(hppa64_return_value, hppa64_push_dummy_call): Rewrite.
(hppa_gdbarch_init): Do not set PC_REGNUM.

View file

@ -26,9 +26,6 @@
#include "regcache.h"
/* Wonder if this is correct? Should be using push_dummy_call(). */
#define DEPRECATED_DUMMY_WRITE_SP(SP) deprecated_write_sp (SP)
#define GDB_MULTI_ARCH 1
/* Hack, get around problem with including "arch-utils.h". */
@ -107,102 +104,8 @@ extern int hppa_instruction_nullified (void);
#define INSTRUCTION_SIZE 4
/* This sequence of words is the instructions
; Call stack frame has already been built by gdb. Since we could be calling
; a varargs function, and we do not have the benefit of a stub to put things in
; the right place, we load the first 4 word of arguments into both the general
; and fp registers.
call_dummy
ldw -36(sp), arg0
ldw -40(sp), arg1
ldw -44(sp), arg2
ldw -48(sp), arg3
ldo -36(sp), r1
fldws 0(0, r1), fr4
fldds -4(0, r1), fr5
fldws -8(0, r1), fr6
fldds -12(0, r1), fr7
ldil 0, r22 ; FUNC_LDIL_OFFSET must point here
ldo 0(r22), r22 ; FUNC_LDO_OFFSET must point here
ldsid (0,r22), r4
ldil 0, r1 ; SR4EXPORT_LDIL_OFFSET must point here
ldo 0(r1), r1 ; SR4EXPORT_LDO_OFFSET must point here
ldsid (0,r1), r20
combt,=,n r4, r20, text_space ; If target is in data space, do a
ble 0(sr5, r22) ; "normal" procedure call
copy r31, r2
break 4, 8
mtsp r21, sr0
ble,n 0(sr0, r22)
text_space ; Otherwise, go through _sr4export,
ble (sr4, r1) ; which will return back here.
stw r31,-24(r30)
break 4, 8
mtsp r21, sr0
ble,n 0(sr0, r22)
nop ; To avoid kernel bugs
nop ; and keep the dummy 8 byte aligned
The dummy decides if the target is in text space or data space. If
it's in data space, there's no problem because the target can
return back to the dummy. However, if the target is in text space,
the dummy calls the secret, undocumented routine _sr4export, which
calls a function in text space and can return to any space. Instead
of including fake instructions to represent saved registers, we
know that the frame is associated with the call dummy and treat it
specially.
The trailing NOPs are needed to avoid a bug in HPUX, BSD and OSF1
kernels. If the memory at the location pointed to by the PC is
0xffffffff then a ptrace step call will fail (even if the instruction
is nullified).
The code to pop a dummy frame single steps three instructions
starting with the last mtsp. This includes the nullified "instruction"
following the ble (which is uninitialized junk). If the
"instruction" following the last BLE is 0xffffffff, then the ptrace
will fail and the dummy frame is not correctly popped.
By placing a NOP in the delay slot of the BLE instruction we can be
sure that we never try to execute a 0xffffffff instruction and
avoid the kernel bug. The second NOP is needed to keep the call
dummy 8 byte aligned. */
#define CALL_DUMMY {0x4BDA3FB9, 0x4BD93FB1, 0x4BD83FA9, 0x4BD73FA1,\
0x37C13FB9, 0x24201004, 0x2C391005, 0x24311006,\
0x2C291007, 0x22C00000, 0x36D60000, 0x02C010A4,\
0x20200000, 0x34210000, 0x002010b4, 0x82842022,\
0xe6c06000, 0x081f0242, 0x00010004, 0x00151820,\
0xe6c00002, 0xe4202000, 0x6bdf3fd1, 0x00010004,\
0x00151820, 0xe6c00002, 0x08000240, 0x08000240}
#define REG_PARM_STACK_SPACE 16
/* If we've reached a trap instruction within the call dummy, then
we'll consider that to mean that we've reached the call dummy's
end after its successful completion. */
#define DEPRECATED_CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \
(DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \
(read_memory_integer((pc), 4) == BREAKPOINT32))
/* Insert the specified number of args and function address into a
call sequence of the above form stored at DUMMYNAME.
On the hppa we need to call the stack dummy through $$dyncall.
Therefore our version of DEPRECATED_FIX_CALL_DUMMY takes an extra
argument, real_pc, which is the location where gdb should start up
the inferior to do the function call. */
/* FIXME: brobecker 2002-12-26. This macro is going to cause us some
problems before we can go to multiarch partial as it has been
diverted on HPUX to return the value of the PC! */
/* NOTE: cagney/2003-05-03: This has been replaced by push_dummy_code.
Hopefully that has all the parameters HP/UX needs. */
#define DEPRECATED_FIX_CALL_DUMMY hppa_fix_call_dummy
extern CORE_ADDR hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int,
struct value **, struct type *, int);
#define GDB_TARGET_IS_HPPA
/*

View file

@ -57,52 +57,6 @@ extern int hpread_adjust_stack_address (CORE_ADDR);
/* jimb: omitted dynamic linking stuff here */
/* This sequence of words is the instructions
; Call stack frame has already been built by gdb. Since we could be calling
; a varargs function, and we do not have the benefit of a stub to put things in
; the right place, we load the first 8 word of arguments into both the general
; and fp registers.
call_dummy
nop
copy %r4,%r29
copy %r5,%r22
copy %r6,%r27
fldd -64(0,%r29),%fr4
fldd -56(0,%r29),%fr5
fldd -48(0,%r29),%fr6
fldd -40(0,%r29),%fr7
fldd -32(0,%r29),%fr8
fldd -24(0,%r29),%fr9
fldd -16(0,%r29),%fr10
fldd -8(0,%r29),%fr11
copy %r22,%r1
ldd -64(%r29), %r26
ldd -56(%r29), %r25
ldd -48(%r29), %r24
ldd -40(%r29), %r23
ldd -32(%r29), %r22
ldd -24(%r29), %r21
ldd -16(%r29), %r20
bve,l (%r1),%r2
ldd -8(%r29), %r19
break 4, 8
mtsp %r21, %sr0
ble 0(%sr0, %r22)
nop
*/
/* Call dummys are sized and written out in word sized hunks. So we have
to pack the instructions into words. Ugh. */
#undef CALL_DUMMY
#define CALL_DUMMY {0x08000240349d0000LL, 0x34b6000034db0000LL, \
0x53a43f8353a53f93LL, 0x53a63fa353a73fb3LL,\
0x53a83fc353a93fd3LL, 0x2fa1100a2fb1100bLL,\
0x36c1000053ba3f81LL, 0x53b93f9153b83fa1LL,\
0x53b73fb153b63fc1LL, 0x53b53fd10fa110d4LL,\
0xe820f0000fb110d3LL, 0x0001000400151820LL,\
0xe6c0000008000240LL}
/* The PA64 ABI reserves 64 bytes of stack space for outgoing register
parameters. */
#undef REG_PARM_STACK_SPACE

File diff suppressed because it is too large Load diff

View file

@ -277,10 +277,6 @@ legacy_push_dummy_code (struct gdbarch *gdbarch,
(PUSH_DUMMY_BREAKPOINT?) should just do everything. */
if (!gdbarch_push_dummy_call_p (current_gdbarch))
{
#ifdef GDB_TARGET_IS_HPPA
(*real_pc) = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs,
args, value_type, using_gcc);
#else
if (DEPRECATED_FIX_CALL_DUMMY_P ())
{
/* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */
@ -288,7 +284,6 @@ legacy_push_dummy_code (struct gdbarch *gdbarch,
value_type, using_gcc);
}
(*real_pc) = start_sp;
#endif
}
/* Yes, the offset is applied to the real_pc and not the dummy addr.
Ulgh! Blame the HP/UX target. */