aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2000-02-26 09:30:30 +0000
committerKevin Buettner <kevinb@redhat.com>2000-02-26 09:30:30 +0000
commitddb20c56a388ad7aa2909f8c1115e2cee1138eb9 (patch)
treeca10e1fea5ab653904ab9d11ba1bed29ad9c6765 /gdb
parent122a33de975a7ed826a11950c1984bd2ceaa80a6 (diff)
downloadfsf-binutils-gdb-ddb20c56a388ad7aa2909f8c1115e2cee1138eb9.zip
fsf-binutils-gdb-ddb20c56a388ad7aa2909f8c1115e2cee1138eb9.tar.gz
fsf-binutils-gdb-ddb20c56a388ad7aa2909f8c1115e2cee1138eb9.tar.bz2
Changes to skip_prologue for PPC architecture.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog13
-rw-r--r--gdb/rs6000-tdep.c38
2 files changed, 40 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b3b3c26..36dc637 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@
+2000-02-26 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Add
+ comment explaining motivation behind this function and why
+ the generic facilities won't work for this platform.
+ * rs6000-tdep.c (skip_prologue): Always test to make sure
+ that an instruction is read successfully from the target's
+ memory. Introduce notion of instructions which may appear in
+ the prologue, but may not end the prologue. Added explicit
+ check for nop instruction. Use memset() to zero the frame
+ data instead of assignment from a statically allocated,
+ uninitialized structure.
+
Sat Feb 26 17:15:16 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: Chris Faylor is responsible for all MS Windows
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index ca094c7..c3cd31b 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -305,11 +305,10 @@ rs6000_software_single_step (signal, insert_breakpoints_p)
#define GET_SRC_REG(x) (((x) >> 21) & 0x1f)
CORE_ADDR
-skip_prologue (pc, fdata)
- CORE_ADDR pc;
- struct rs6000_framedata *fdata;
+skip_prologue (CORE_ADDR pc, struct rs6000_framedata *fdata)
{
CORE_ADDR orig_pc = pc;
+ CORE_ADDR last_prologue_pc;
char buf[4];
unsigned long op;
long offset = 0;
@@ -318,24 +317,31 @@ skip_prologue (pc, fdata)
int reg;
int framep = 0;
int minimal_toc_loaded = 0;
- static struct rs6000_framedata zero_frame;
+ int prev_insn_was_prologue_insn = 1;
- *fdata = zero_frame;
+ memset (fdata, 0, sizeof (struct rs6000_framedata));
fdata->saved_gpr = -1;
fdata->saved_fpr = -1;
fdata->alloca_reg = -1;
fdata->frameless = 1;
fdata->nosavedpc = 1;
- if (target_read_memory (pc, buf, 4))
- return pc; /* Can't access it -- assume no prologue. */
-
- /* Assume that subsequent fetches can fail with low probability. */
pc -= 4;
for (;;)
{
pc += 4;
- op = read_memory_integer (pc, 4);
+
+ /* Sometimes it isn't clear if an instruction is a prologue
+ instruction or not. When we encounter one of these ambiguous
+ cases, we'll set prev_insn_was_prologue_insn to 0 (false).
+ Otherwise, we'll assume that it really is a prologue instruction. */
+ if (prev_insn_was_prologue_insn)
+ last_prologue_pc = pc;
+ prev_insn_was_prologue_insn = 1;
+
+ if (target_read_memory (pc, buf, 4))
+ break;
+ op = extract_signed_integer (buf, 4);
if ((op & 0xfc1fffff) == 0x7c0802a6)
{ /* mflr Rx */
@@ -375,6 +381,16 @@ skip_prologue (pc, fdata)
continue;
}
+ else if ((op & 0xffff0000) == 0x60000000)
+ {
+ /* nop */
+ /* Allow nops in the prologue, but do not consider them to
+ be part of the prologue unless followed by other prologue
+ instructions. */
+ prev_insn_was_prologue_insn = 0;
+ continue;
+
+ }
else if ((op & 0xffff0000) == 0x3c000000)
{ /* addis 0,0,NUM, used
for >= 32k frames */
@@ -564,7 +580,7 @@ skip_prologue (pc, fdata)
#endif /* 0 */
fdata->offset = -fdata->offset;
- return pc;
+ return last_prologue_pc;
}