+2004-07-20 Andrew Cagney <cagney@gnu.org>
+
+ * breakpoint.c (deprecated_read_memory_nobpt): Rename
+ read_memory_nobpt.
+ * sparc-linux-tdep.c (sparc_linux_sigtramp_start): Update.
+ * s390-tdep.c (s390_readinstruction, s390_in_function_epilogue_p)
+ (s390_sigtramp_frame_sniffer): Update.
+ * mn10300-tdep.c (mn10300_analyze_prologue): Update.
+ * mipsnbsd-tdep.c (mipsnbsd_sigtramp_offset): Update.
+ * mips-tdep.c (mips_fetch_instruction, mips16_fetch_instruction)
+ (mips32_fetch_instruction): Update.
+ * mcore-tdep.c (get_insn): Update.
+ * m68klinux-tdep.c (m68k_linux_pc_in_sigtramp): Update.
+ * i386nbsd-tdep.c (i386nbsd_sigtramp_offset): Update.
+ * i386ly-tdep.c (i386lynx_saved_pc_after_call): Update.
+ * i386-linux-tdep.c (i386_linux_sigtramp_start)
+ (i386_linux_rt_sigtramp_start): Update.
+ * i386-linux-nat.c (child_resume): Update.
+ * hppa-tdep.c (skip_prologue_hard_way, hppa_frame_cache): Update.
+ * hppa-linux-tdep.c (insns_match_pattern): Update.
+ * gdbcore.h: Update.
+ * frv-tdep.c (frv_gdbarch_adjust_breakpoint_address): Update.
+ * frame.c (safe_frame_unwind_memory): Update.
+ * amd64-linux-tdep.c (amd64_linux_sigtramp_start): Update.
+ * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Update.
+ * alpha-tdep.c (alpha_read_insn): Update.
+
2004-07-20 Andrew Cagney <cagney@gnu.org>
* tramp-frame.h (struct tramp_frame): Change "insn" to a struct
char buf[4];
int status;
- status = read_memory_nobpt (pc, buf, 4);
+ status = deprecated_read_memory_nobpt (pc, buf, 4);
if (status)
memory_error (status, pc);
return extract_unsigned_integer (buf, 4);
LONGEST off;
int i;
- if (read_memory_nobpt (pc, (char *) w, 4) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) w, 4) != 0)
return -1;
for (i = 0; i < RETCODE_NWORDS; i++)
off = i * 4;
pc -= off;
- if (read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0)
return -1;
if (memcmp (ret, sigtramp_retcode, RETCODE_SIZE) == 0)
PC is not at the start of the instruction sequence, there will be
a few trailing readable bytes on the stack. */
- if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
return 0;
if (buf[0] != LINUX_SIGTRAMP_INSN0)
pc -= LINUX_SIGTRAMP_OFFSET1;
- if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
return 0;
}
shadow contents, not the breakpoints themselves. From breakpoint.c. */
int
-read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len)
+deprecated_read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len)
{
int status;
struct bp_location *b;
if (bp_addr > memaddr)
{
/* Copy the section of memory before the breakpoint. */
- status = read_memory_nobpt (memaddr, myaddr, bp_addr - memaddr);
+ status = deprecated_read_memory_nobpt (memaddr, myaddr, bp_addr - memaddr);
if (status != 0)
return status;
}
if (bp_addr + bp_size < memaddr + len)
{
/* Copy the section of memory after the breakpoint. */
- status = read_memory_nobpt (bp_addr + bp_size,
+ status = deprecated_read_memory_nobpt (bp_addr + bp_size,
myaddr + bp_addr + bp_size - memaddr,
memaddr + len - (bp_addr + bp_size));
if (status != 0)
safe_frame_unwind_memory (struct frame_info *this_frame,
CORE_ADDR addr, void *buf, int len)
{
- /* NOTE: read_memory_nobpt returns zero on success! */
- return !read_memory_nobpt (addr, buf, len);
+ /* NOTE: deprecated_read_memory_nobpt returns zero on success! */
+ return !deprecated_read_memory_nobpt (addr, buf, len);
}
/* Architecture method. */
char instr[frv_instr_size];
int status;
- status = read_memory_nobpt (addr, instr, sizeof instr);
+ status = deprecated_read_memory_nobpt (addr, instr, sizeof instr);
if (status != 0)
break;
address out of bounds. If breakpoints are inserted, returns shadow
contents, not the breakpoints themselves. From breakpoint.c. */
-extern int read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len);
+/* NOTE: cagney/2004-06-10: Code reading from a live inferior can use
+ the get_frame_memory methods, code reading from an exec can use the
+ target methods. */
+
+extern int deprecated_read_memory_nobpt (CORE_ADDR memaddr, char *myaddr,
+ unsigned len);
/* Report a memory error with error(). */
{
char buf[4];
- read_memory_nobpt (npc, buf, 4);
+ deprecated_read_memory_nobpt (npc, buf, 4);
insn[i] = extract_unsigned_integer (buf, 4);
if ((insn[i] & pattern[i].mask) == pattern[i].data)
npc += 4;
old_save_sp = save_sp;
old_stack_remaining = stack_remaining;
- status = read_memory_nobpt (pc, buf, 4);
+ status = deprecated_read_memory_nobpt (pc, buf, 4);
inst = extract_unsigned_integer (buf, 4);
/* Yow! */
while (reg_num >= (TARGET_PTR_BIT == 64 ? 19 : 23) && reg_num <= 26)
{
pc += 4;
- status = read_memory_nobpt (pc, buf, 4);
+ status = deprecated_read_memory_nobpt (pc, buf, 4);
inst = extract_unsigned_integer (buf, 4);
if (status != 0)
return pc;
reg_num = inst_saves_fr (inst);
save_fr &= ~(1 << reg_num);
- status = read_memory_nobpt (pc + 4, buf, 4);
+ status = deprecated_read_memory_nobpt (pc + 4, buf, 4);
next_inst = extract_unsigned_integer (buf, 4);
/* Yow! */
while (reg_num >= 4 && reg_num <= (TARGET_PTR_BIT == 64 ? 11 : 7))
{
pc += 8;
- status = read_memory_nobpt (pc, buf, 4);
+ status = deprecated_read_memory_nobpt (pc, buf, 4);
inst = extract_unsigned_integer (buf, 4);
if (status != 0)
return pc;
if ((inst & 0xfc000000) != 0x34000000)
break;
- status = read_memory_nobpt (pc + 4, buf, 4);
+ status = deprecated_read_memory_nobpt (pc + 4, buf, 4);
next_inst = extract_unsigned_integer (buf, 4);
if (status != 0)
return pc;
{
int reg;
char buf4[4];
- long status = read_memory_nobpt (pc, buf4, sizeof buf4);
+ long status = deprecated_read_memory_nobpt (pc, buf4, sizeof buf4);
long inst = extract_unsigned_integer (buf4, sizeof buf4);
/* Note the interesting effects of this instruction. */
that's about to be restored, and set the trace flag there. */
/* First check if PC is at a system call. */
- if (read_memory_nobpt (pc, (char *) buf, LINUX_SYSCALL_LEN) == 0
+ if (deprecated_read_memory_nobpt (pc, (char *) buf, LINUX_SYSCALL_LEN) == 0
&& memcmp (buf, linux_syscall, LINUX_SYSCALL_LEN) == 0)
{
int syscall = read_register_pid (LINUX_SYSCALL_REGNUM,
PC is not at the start of the instruction sequence, there will be
a few trailing readable bytes on the stack. */
- if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
return 0;
if (buf[0] != LINUX_SIGTRAMP_INSN0)
pc -= adjust;
- if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
return 0;
}
PC is not at the start of the instruction sequence, there will be
a few trailing readable bytes on the stack. */
- if (read_memory_nobpt (pc, (char *) buf, LINUX_RT_SIGTRAMP_LEN) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) buf, LINUX_RT_SIGTRAMP_LEN) != 0)
return 0;
if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
pc -= LINUX_RT_SIGTRAMP_OFFSET1;
- if (read_memory_nobpt (pc, (char *) buf, LINUX_RT_SIGTRAMP_LEN) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) buf, LINUX_RT_SIGTRAMP_LEN) != 0)
return 0;
}
static const unsigned char call_inst[] =
{ 0x9a, 0, 0, 0, 0, 8, 0 }; /* lcall 0x8,0x0 */
- read_memory_nobpt (frame->pc - 7, opcode, 7);
+ deprecated_read_memory_nobpt (frame->pc - 7, opcode, 7);
if (memcmp (opcode, call_inst, 7) == 0)
return read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4);
LONGEST off;
int i;
- if (read_memory_nobpt (pc, &insn, 1) != 0)
+ if (deprecated_read_memory_nobpt (pc, &insn, 1) != 0)
return -1;
switch (insn)
case RETCODE_INSN2:
/* INSN2 and INSN3 are the same. Read at the location of PC+1
to determine if we're actually looking at INSN2 or INSN3. */
- if (read_memory_nobpt (pc + 1, &insn, 1) != 0)
+ if (deprecated_read_memory_nobpt (pc + 1, &insn, 1) != 0)
return -1;
if (insn == RETCODE_INSN3)
pc -= off;
- if (read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0)
return -1;
if (memcmp (ret, sigtramp_retcode, sizeof (ret)) == 0)
char buf[12];
unsigned long insn0, insn1, insn2;
- if (read_memory_nobpt (pc - 4, buf, sizeof (buf)))
+ if (deprecated_read_memory_nobpt (pc - 4, buf, sizeof (buf)))
return 0;
insn1 = extract_unsigned_integer (buf + 4, 4);
insn2 = extract_unsigned_integer (buf + 8, 4);
get_insn (CORE_ADDR pc)
{
char buf[4];
- int status = read_memory_nobpt (pc, buf, 2);
+ int status = deprecated_read_memory_nobpt (pc, buf, 2);
if (status != 0)
return 0;
}
else
instlen = MIPS_INSTLEN;
- status = read_memory_nobpt (addr, buf, instlen);
+ status = deprecated_read_memory_nobpt (addr, buf, instlen);
if (status)
memory_error (status, addr);
return extract_unsigned_integer (buf, instlen);
instlen = MIPS16_INSTLEN;
addr = unmake_mips16_addr (addr);
- status = read_memory_nobpt (addr, buf, instlen);
+ status = deprecated_read_memory_nobpt (addr, buf, instlen);
if (status)
memory_error (status, addr);
return extract_unsigned_integer (buf, instlen);
int instlen;
int status;
instlen = MIPS_INSTLEN;
- status = read_memory_nobpt (addr, buf, instlen);
+ status = deprecated_read_memory_nobpt (addr, buf, instlen);
if (status)
memory_error (status, addr);
return extract_unsigned_integer (buf, instlen);
LONGEST off;
int i;
- if (read_memory_nobpt (pc, (char *) w, sizeof (w)) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) w, sizeof (w)) != 0)
return -1;
for (i = 0; i < RETCODE_NWORDS; i++)
off = i * 4;
pc -= off;
- if (read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0)
+ if (deprecated_read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0)
return -1;
if (memcmp (ret, retcode, RETCODE_SIZE) == 0)
/* Get the next two bytes into buf, we need two because rets is a two
byte insn and the first isn't enough to uniquely identify it. */
- status = read_memory_nobpt (pc, buf, 2);
+ status = deprecated_read_memory_nobpt (pc, buf, 2);
if (status != 0)
return pc;
/* Suck in two bytes. */
if (addr + 2 >= stop
- || (status = read_memory_nobpt (addr, buf, 2)) != 0)
+ || (status = deprecated_read_memory_nobpt (addr, buf, 2)) != 0)
{
fix_frame_pointer (fi, 0);
return addr;
if (buf[0] == 0xcf)
{
/* Extract the register list for the movm instruction. */
- status = read_memory_nobpt (addr + 1, buf, 1);
+ status = deprecated_read_memory_nobpt (addr + 1, buf, 1);
movm_args = *buf;
addr += 2;
}
/* Get the next two bytes so the prologue scan can continue. */
- status = read_memory_nobpt (addr, buf, 2);
+ status = deprecated_read_memory_nobpt (addr, buf, 2);
if (status != 0)
{
/* Fix fi->frame since it's bogus at this point. */
}
/* Get two more bytes so scanning can continue. */
- status = read_memory_nobpt (addr, buf, 2);
+ status = deprecated_read_memory_nobpt (addr, buf, 2);
if (status != 0)
{
/* Fix fi->frame if it's bogus at this point. */
If none of the above was found, then this prologue has no
additional stack. */
- status = read_memory_nobpt (addr, buf, 2);
+ status = deprecated_read_memory_nobpt (addr, buf, 2);
if (status != 0)
{
/* Fix fi->frame if it's bogus at this point. */
{
/* Suck in imm_size more bytes, they'll hold the size of the
current frame. */
- status = read_memory_nobpt (addr + 2, buf, imm_size);
+ status = deprecated_read_memory_nobpt (addr + 2, buf, imm_size);
if (status != 0)
{
/* Fix fi->frame if it's bogus at this point. */
static int s390_instrlen[] = { 2, 4, 4, 6 };
int instrlen;
- if (read_memory_nobpt (at, &instr[0], 2))
+ if (deprecated_read_memory_nobpt (at, &instr[0], 2))
return -1;
instrlen = s390_instrlen[instr[0] >> 6];
if (instrlen > 2)
{
- if (read_memory_nobpt (at + 2, &instr[2], instrlen - 2))
+ if (deprecated_read_memory_nobpt (at + 2, &instr[2], instrlen - 2))
return -1;
}
return instrlen;
int d2;
if (word_size == 4
- && !read_memory_nobpt (pc - 4, insn, 4)
+ && !deprecated_read_memory_nobpt (pc - 4, insn, 4)
&& is_rs (insn, op_lm, &r1, &r3, &d2, &b2)
&& r3 == S390_SP_REGNUM - S390_R0_REGNUM)
return 1;
if (word_size == 4
- && !read_memory_nobpt (pc - 6, insn, 6)
+ && !deprecated_read_memory_nobpt (pc - 6, insn, 6)
&& is_rsy (insn, op1_lmy, op2_lmy, &r1, &r3, &d2, &b2)
&& r3 == S390_SP_REGNUM - S390_R0_REGNUM)
return 1;
if (word_size == 8
- && !read_memory_nobpt (pc - 6, insn, 6)
+ && !deprecated_read_memory_nobpt (pc - 6, insn, 6)
&& is_rsy (insn, op1_lmg, op2_lmg, &r1, &r3, &d2, &b2)
&& r3 == S390_SP_REGNUM - S390_R0_REGNUM)
return 1;
CORE_ADDR pc = frame_pc_unwind (next_frame);
bfd_byte sigreturn[2];
- if (read_memory_nobpt (pc, sigreturn, 2))
+ if (deprecated_read_memory_nobpt (pc, sigreturn, 2))
return NULL;
if (sigreturn[0] != 0x0a /* svc */)
sequence, there will be a few trailing readable bytes on the
stack. */
- if (read_memory_nobpt (pc, buf, sizeof buf) != 0)
+ if (deprecated_read_memory_nobpt (pc, buf, sizeof buf) != 0)
return 0;
word0 = extract_unsigned_integer (buf, 4);
return 0;
pc -= 4;
- if (read_memory_nobpt (pc, buf, sizeof buf) != 0)
+ if (deprecated_read_memory_nobpt (pc, buf, sizeof buf) != 0)
return 0;
word0 = extract_unsigned_integer (buf, 4);