aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2010-03-02 20:21:08 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2010-03-02 20:21:08 +0000
commitce50d78b1002f7b7afa72dee74c1972e6ff36cbb (patch)
treec389977523dba080b64c5aa17d2d7b9880914efc
parent7e9af34afe1f237dae5286f2366301ead2d57290 (diff)
downloadgdb-ce50d78b1002f7b7afa72dee74c1972e6ff36cbb.zip
gdb-ce50d78b1002f7b7afa72dee74c1972e6ff36cbb.tar.gz
gdb-ce50d78b1002f7b7afa72dee74c1972e6ff36cbb.tar.bz2
* spu-tdep.c (spu_analyze_prologue): Track instruction to
store backchain as part of prologue.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/spu-tdep.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2f5bbdf..c41c38d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * spu-tdep.c (spu_analyze_prologue): Track instruction to
+ store backchain as part of prologue.
+
2010-03-02 Daniel Jacobowitz <dan@codesourcery.com>
* progspace.c (update_address_spaces): Update inferior address spaces
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index c6db8dc..269ad28 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -633,6 +633,7 @@ spu_analyze_prologue (struct gdbarch *gdbarch,
int found_sp = 0;
int found_fp = 0;
int found_lr = 0;
+ int found_bc = 0;
int reg_immed[SPU_NUM_GPRS];
gdb_byte buf[16];
CORE_ADDR prolog_pc = start_pc;
@@ -661,8 +662,9 @@ spu_analyze_prologue (struct gdbarch *gdbarch,
- The first instruction to set up the stack pointer.
- The first instruction to set up the frame pointer.
- The first instruction to save the link register.
+ - The first instruction to save the backchain.
- We return the instruction after the latest of these three,
+ We return the instruction after the latest of these four,
or the incoming PC if none is found. The first instruction
to set up the stack pointer also defines the frame size.
@@ -771,6 +773,14 @@ spu_analyze_prologue (struct gdbarch *gdbarch,
found_lr = 1;
prolog_pc = pc + 4;
}
+
+ if (ra == SPU_RAW_SP_REGNUM
+ && (found_sp? immed == 0 : rt == SPU_RAW_SP_REGNUM)
+ && !found_bc)
+ {
+ found_bc = 1;
+ prolog_pc = pc + 4;
+ }
}
/* _start uses SELB to set up the stack pointer. */