int
hppa_use_struct_convention (int gcc_p, struct type *type)
{
- return (TYPE_LENGTH (type) > 2 * REGISTER_SIZE);
+ return (TYPE_LENGTH (type) > 2 * DEPRECATED_REGISTER_SIZE);
}
\f
return NULL;
}
+const unsigned char *
+hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+{
+ static const char breakpoint[] = {0x00, 0x01, 0x00, 0x04};
+ (*len) = sizeof (breakpoint);
+ return breakpoint;
+}
+
/* Return the adjustment necessary to make for addresses on the stack
as presented by hpread.c.
/* A call dummy is sized in words, but it is actually a
series of instructions. Account for that scaling
factor. */
- + ((REGISTER_SIZE / INSTRUCTION_SIZE)
- * CALL_DUMMY_LENGTH)
+ + ((DEPRECATED_REGISTER_SIZE / INSTRUCTION_SIZE)
+ * DEPRECATED_CALL_DUMMY_LENGTH)
/* Similarly we have to account for 64bit wide register
saves. */
- + (32 * REGISTER_SIZE)
+ + (32 * DEPRECATED_REGISTER_SIZE)
/* We always consider FP regs 8 bytes long. */
+ (NUM_REGS - FP0_REGNUM) * 8
/* Similarly we have to account for 64bit wide register
saves. */
- + (6 * REGISTER_SIZE)))))
+ + (6 * DEPRECATED_REGISTER_SIZE)))))
{
return read_memory_integer ((get_frame_base (frame)
+ (TARGET_PTR_BIT == 64 ? -16 : -20)),
frame. (we always want frame->frame to point at the lowest address
in the frame). */
if (framesize == -1)
- deprecated_update_frame_base_hack (frame, TARGET_READ_FP ());
+ deprecated_update_frame_base_hack (frame, deprecated_read_fp ());
else
deprecated_update_frame_base_hack (frame, get_frame_base (frame) - framesize);
return;
sorts, and its base is the high address in its parent's frame. */
framesize = find_proc_framesize (get_frame_pc (frame));
if (framesize == -1)
- deprecated_update_frame_base_hack (frame, TARGET_READ_FP ());
+ deprecated_update_frame_base_hack (frame, deprecated_read_fp ());
else
deprecated_update_frame_base_hack (frame, read_register (SP_REGNUM) - framesize);
}
saved_regs_frame = tmp_frame;
/* If we have an address for r3, that's good. */
- if (saved_regs[FP_REGNUM])
+ if (saved_regs[DEPRECATED_FP_REGNUM])
break;
}
}
u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
if (!u)
{
- return read_memory_integer (saved_regs[FP_REGNUM],
+ return read_memory_integer (saved_regs[DEPRECATED_FP_REGNUM],
TARGET_PTR_BIT / 8);
}
else
}
}
- return read_memory_integer (saved_regs[FP_REGNUM],
+ return read_memory_integer (saved_regs[DEPRECATED_FP_REGNUM],
TARGET_PTR_BIT / 8);
}
}
u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
if (!u)
{
- return read_memory_integer (saved_regs[FP_REGNUM],
+ return read_memory_integer (saved_regs[DEPRECATED_FP_REGNUM],
TARGET_PTR_BIT / 8);
}
else
/* The value in %r3 was never saved into the stack (thus %r3 still
holds the value of the previous frame pointer). */
- return TARGET_READ_FP ();
+ return deprecated_read_fp ();
}
}
\f
/* The 32bit and 64bit ABIs save the return pointer into different
stack slots. */
- if (REGISTER_SIZE == 8)
- write_memory (sp - 16, (char *) &int_buffer, REGISTER_SIZE);
+ if (DEPRECATED_REGISTER_SIZE == 8)
+ write_memory (sp - 16, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
else
- write_memory (sp - 20, (char *) &int_buffer, REGISTER_SIZE);
+ write_memory (sp - 20, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
- int_buffer = TARGET_READ_FP ();
- write_memory (sp, (char *) &int_buffer, REGISTER_SIZE);
+ int_buffer = deprecated_read_fp ();
+ write_memory (sp, (char *) &int_buffer, DEPRECATED_REGISTER_SIZE);
- write_register (FP_REGNUM, sp);
+ write_register (DEPRECATED_FP_REGNUM, sp);
- sp += 2 * REGISTER_SIZE;
+ sp += 2 * DEPRECATED_REGISTER_SIZE;
for (regnum = 1; regnum < 32; regnum++)
- if (regnum != RP_REGNUM && regnum != FP_REGNUM)
+ if (regnum != RP_REGNUM && regnum != DEPRECATED_FP_REGNUM)
sp = push_word (sp, read_register (regnum));
/* This is not necessary for the 64bit ABI. In fact it is dangerous. */
- if (REGISTER_SIZE != 8)
+ if (DEPRECATED_REGISTER_SIZE != 8)
sp += 4;
for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++)
int i;
/* The 32bit and 64bit ABIs save RP into different locations. */
- if (REGISTER_SIZE == 8)
+ if (DEPRECATED_REGISTER_SIZE == 8)
frame_saved_regs[RP_REGNUM] = (fp - 16) & ~0x3;
else
frame_saved_regs[RP_REGNUM] = (fp - 20) & ~0x3;
- frame_saved_regs[FP_REGNUM] = fp;
+ frame_saved_regs[DEPRECATED_FP_REGNUM] = fp;
- frame_saved_regs[1] = fp + (2 * REGISTER_SIZE);
+ frame_saved_regs[1] = fp + (2 * DEPRECATED_REGISTER_SIZE);
- for (fp += 3 * REGISTER_SIZE, i = 3; i < 32; i++)
+ for (fp += 3 * DEPRECATED_REGISTER_SIZE, i = 3; i < 32; i++)
{
- if (i != FP_REGNUM)
+ if (i != DEPRECATED_FP_REGNUM)
{
frame_saved_regs[i] = fp;
- fp += REGISTER_SIZE;
+ fp += DEPRECATED_REGISTER_SIZE;
}
}
/* This is not necessary or desirable for the 64bit ABI. */
- if (REGISTER_SIZE != 8)
+ if (DEPRECATED_REGISTER_SIZE != 8)
fp += 4;
for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8)
frame_saved_regs[i] = fp;
frame_saved_regs[IPSW_REGNUM] = fp;
- frame_saved_regs[SAR_REGNUM] = fp + REGISTER_SIZE;
- frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * REGISTER_SIZE;
- frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * REGISTER_SIZE;
- frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * REGISTER_SIZE;
- frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * REGISTER_SIZE;
+ frame_saved_regs[SAR_REGNUM] = fp + DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * DEPRECATED_REGISTER_SIZE;
+ frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * DEPRECATED_REGISTER_SIZE;
}
void
for (regnum = 31; regnum > 0; regnum--)
if (fsr[regnum])
write_register (regnum, read_memory_integer (fsr[regnum],
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM; regnum--)
if (fsr[regnum])
if (fsr[IPSW_REGNUM])
write_register (IPSW_REGNUM,
read_memory_integer (fsr[IPSW_REGNUM],
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
if (fsr[SAR_REGNUM])
write_register (SAR_REGNUM,
read_memory_integer (fsr[SAR_REGNUM],
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
/* If the PC was explicitly saved, then just restore it. */
if (fsr[PCOQ_TAIL_REGNUM])
{
npc = read_memory_integer (fsr[PCOQ_TAIL_REGNUM],
- REGISTER_SIZE);
+ DEPRECATED_REGISTER_SIZE);
write_register (PCOQ_TAIL_REGNUM, npc);
}
/* Else use the value in %rp to set the new PC. */
write_pc (npc);
}
- write_register (FP_REGNUM, read_memory_integer (fp, REGISTER_SIZE));
+ write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp, DEPRECATED_REGISTER_SIZE));
if (fsr[IPSW_REGNUM]) /* call dummy */
write_register (SP_REGNUM, fp - 48);
right place. */
write_register (21, read_memory_integer (fsr[PCSQ_HEAD_REGNUM],
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
write_register (22, new_pc);
for (insn_count = 0; insn_count < 3; insn_count++)
the left. We do this by promoting them to full-width,
although the ABI says to pad them with garbage. */
if (is_integral_type (arg_type)
- && TYPE_LENGTH (arg_type) < REGISTER_SIZE)
+ && TYPE_LENGTH (arg_type) < DEPRECATED_REGISTER_SIZE)
{
args[i] = value_cast ((TYPE_UNSIGNED (arg_type)
? builtin_type_unsigned_long
/* Align the size of the argument to the word size for this
target. */
- bytes_reserved = (lengths[i] + REGISTER_SIZE - 1) & -REGISTER_SIZE;
+ bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE;
offset[i] = cum_bytes_reserved;
if (bytes_reserved > 8)
{
/* Round up the offset to a multiple of two slots. */
- int new_offset = ((offset[i] + 2*REGISTER_SIZE-1)
- & -(2*REGISTER_SIZE));
+ int new_offset = ((offset[i] + 2*DEPRECATED_REGISTER_SIZE-1)
+ & -(2*DEPRECATED_REGISTER_SIZE));
/* Note the space we've wasted, if any. */
bytes_reserved += new_offset - offset[i];
/* Align the size of the argument to the word size for this
target. */
- bytes_reserved = (lengths[i] + REGISTER_SIZE - 1) & -REGISTER_SIZE;
+ bytes_reserved = (lengths[i] + DEPRECATED_REGISTER_SIZE - 1) & -DEPRECATED_REGISTER_SIZE;
offset[i] = (cum_bytes_reserved
+ (lengths[i] > 4 ? bytes_reserved : lengths[i]));
/* If the argument is a double word argument, then it needs to be
double word aligned. */
- if ((bytes_reserved == 2 * REGISTER_SIZE)
- && (offset[i] % 2 * REGISTER_SIZE))
+ if ((bytes_reserved == 2 * DEPRECATED_REGISTER_SIZE)
+ && (offset[i] % 2 * DEPRECATED_REGISTER_SIZE))
{
int new_offset = 0;
/* BYTES_RESERVED is already aligned to the word, so we put
This will leave one empty word on the stack, and one unused
register as mandated by the ABI. */
- new_offset = ((offset[i] + 2 * REGISTER_SIZE - 1)
- & -(2 * REGISTER_SIZE));
+ new_offset = ((offset[i] + 2 * DEPRECATED_REGISTER_SIZE - 1)
+ & -(2 * DEPRECATED_REGISTER_SIZE));
- if ((new_offset - offset[i]) >= 2 * REGISTER_SIZE)
+ if ((new_offset - offset[i]) >= 2 * DEPRECATED_REGISTER_SIZE)
{
- bytes_reserved += REGISTER_SIZE;
- offset[i] += REGISTER_SIZE;
+ bytes_reserved += DEPRECATED_REGISTER_SIZE;
+ offset[i] += DEPRECATED_REGISTER_SIZE;
}
}
args = alloca (sizeof (struct value *) * 8); /* 6 for the arguments and one null one??? */
funcval = find_function_in_inferior ("__d_shl_get");
- get_sym = lookup_symbol ("__d_shl_get", NULL, VAR_NAMESPACE, NULL, NULL);
+ get_sym = lookup_symbol ("__d_shl_get", NULL, VAR_DOMAIN, NULL, NULL);
buff_minsym = lookup_minimal_symbol ("__buffer", NULL, NULL);
msymbol = lookup_minimal_symbol ("__shldp", NULL, NULL);
- symbol2 = lookup_symbol ("__shldp", NULL, VAR_NAMESPACE, NULL, NULL);
+ symbol2 = lookup_symbol ("__shldp", NULL, VAR_DOMAIN, NULL, NULL);
endo_buff_addr = SYMBOL_VALUE_ADDRESS (buff_minsym);
namelen = strlen (DEPRECATED_SYMBOL_NAME (function));
value_return_addr = endo_buff_addr + namelen;
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 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.
+ 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.
This has to work across several versions of hpux, bsd, osf1. It has to
work regardless of what compiler was used to build the inferior program.
at *(fun+4). Note the call dummy is *NOT* allowed to
trash %r19 before calling the target function. */
write_register (19, read_memory_integer ((fun & ~0x3) + 4,
- REGISTER_SIZE));
+ DEPRECATED_REGISTER_SIZE));
/* Now get the real address for the function we are calling, it's
at *fun. */
}
/* This is the only site that may directly read_register () the FP
- register. All others must use TARGET_READ_FP (). */
- return read_register (FP_REGNUM);
+ register. All others must use deprecated_read_fp (). */
+ return read_register (DEPRECATED_FP_REGNUM);
}
CORE_ADDR
int start;
- char *buf = alloca (max_register_size (current_gdbarch));
+ char buf[MAX_REGISTER_SIZE];
long long reg_val;
if (!know_which)
static void
pa_print_fp_reg (int i)
{
- char *raw_buffer = alloca (max_register_size (current_gdbarch));
- char *virtual_buffer = alloca (max_register_size (current_gdbarch));
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
/* Get 32bits of data. */
frame_register_read (deprecated_selected_frame, i, raw_buffer);
static void
pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision)
{
- char *raw_buffer = alloca (max_register_size (current_gdbarch));
- char *virtual_buffer = alloca (max_register_size (current_gdbarch));
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
fputs_filtered (REGISTER_NAME (i), stream);
print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), stream);
if (precision == double_precision && (i % 2) == 0)
{
- char *raw_buf = alloca (max_register_size (current_gdbarch));
+ char raw_buf[MAX_REGISTER_SIZE];
/* Get the data in raw format for the 2nd half. */
frame_register_read (deprecated_selected_frame, i + 1, raw_buf);
for (i = 3; i < u->Entry_GR + 3; i++)
{
/* Frame pointer gets saved into a special location. */
- if (u->Save_SP && i == FP_REGNUM)
+ if (u->Save_SP && i == DEPRECATED_FP_REGNUM)
continue;
save_gr |= (1 << i);
/* A call dummy is sized in words, but it is actually a
series of instructions. Account for that scaling
factor. */
- + ((REGISTER_SIZE / INSTRUCTION_SIZE)
- * CALL_DUMMY_LENGTH)
+ + ((DEPRECATED_REGISTER_SIZE / INSTRUCTION_SIZE)
+ * DEPRECATED_CALL_DUMMY_LENGTH)
/* Similarly we have to account for 64bit wide register
saves. */
- + (32 * REGISTER_SIZE)
+ + (32 * DEPRECATED_REGISTER_SIZE)
/* We always consider FP regs 8 bytes long. */
+ (NUM_REGS - FP0_REGNUM) * 8
/* Similarly we have to account for 64bit wide register
saves. */
- + (6 * REGISTER_SIZE)))))
+ + (6 * DEPRECATED_REGISTER_SIZE)))))
find_dummy_frame_regs (frame_info, frame_saved_regs);
/* Interrupt handlers are special too. They lay out the register
for (i = 3; i < u->Entry_GR + 3; i++)
{
/* Frame pointer gets saved into a special location. */
- if (u->Save_SP && i == FP_REGNUM)
+ if (u->Save_SP && i == DEPRECATED_FP_REGNUM)
continue;
save_gr |= (1 << i);
if ( (inst & 0xffffc000) == 0x6fc10000 /* stw,ma r1,N(sr0,sp) */
|| (inst & 0xffffc00c) == 0x73c10008) /* std,ma r1,N(sr0,sp) */
{
- frame_saved_regs[FP_REGNUM] = get_frame_base (frame_info);
+ frame_saved_regs[DEPRECATED_FP_REGNUM] = get_frame_base (frame_info);
save_sp = 0;
}
/* Account for general and floating-point register saves. */
reg = inst_saves_gr (inst);
if (reg >= 3 && reg <= 18
- && (!u->Save_SP || reg != FP_REGNUM))
+ && (!u->Save_SP || reg != DEPRECATED_FP_REGNUM))
{
save_gr &= ~(1 << reg);
/* Next look for the catch enable flag provided in end.o */
sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
- VAR_NAMESPACE, 0, (struct symtab **) NULL);
+ VAR_DOMAIN, 0, (struct symtab **) NULL);
if (sym) /* sometimes present in debug info */
{
eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (sym);
/* Next look for the catch enable flag provided end.o */
sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
- VAR_NAMESPACE, 0, (struct symtab **) NULL);
+ VAR_DOMAIN, 0, (struct symtab **) NULL);
if (sym) /* sometimes present in debug info */
{
eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (sym);
hppa_register_raw_size (int reg_nr)
{
/* All registers have the same size. */
- return REGISTER_SIZE;
+ return DEPRECATED_REGISTER_SIZE;
}
/* Index within the register vector of the first byte of the space i
set_gdbarch_inner_than (gdbarch, hppa_inner_than);
set_gdbarch_stack_align (gdbarch, hppa_stack_align);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_num_regs (gdbarch, hppa_num_regs);
- set_gdbarch_fp_regnum (gdbarch, 3);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 3);
set_gdbarch_sp_regnum (gdbarch, 30);
set_gdbarch_fp0_regnum (gdbarch, 64);
set_gdbarch_pc_regnum (gdbarch, PCOQ_HEAD_REGNUM);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame);
- set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
- /* set_gdbarch_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
+ set_gdbarch_deprecated_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
+ /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments);
set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_read_pc (gdbarch, hppa_target_read_pc);
set_gdbarch_write_pc (gdbarch, hppa_target_write_pc);
- set_gdbarch_read_fp (gdbarch, hppa_target_read_fp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, hppa_target_read_fp);
return gdbarch;
}