summaryrefslogtreecommitdiff
path: root/gdb/amd64-tdep.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2012-04-06 21:52:21 +0000
committerDoug Evans <dje@google.com>2012-04-06 21:52:21 +0000
commita88ce504e76240ca5e134f89f9ccb0a965399f37 (patch)
treedf4086c0d4f0139e45c68a2d9551156a9f554a27 /gdb/amd64-tdep.c
parente3b69961beda8956d22948f1dcef12724ecfba33 (diff)
downloadgdb-a88ce504e76240ca5e134f89f9ccb0a965399f37.tar.gz
* amd64-tdep.c (amd64_analyze_prologue): Recognize both variations of
"mov %rsp,%rbp".
Diffstat (limited to 'gdb/amd64-tdep.c')
-rw-r--r--gdb/amd64-tdep.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index a193099fd1c..d15acea36e8 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -1865,7 +1865,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc,
We will handle only functions beginning with:
pushq %rbp 0x55
- movq %rsp, %rbp 0x48 0x89 0xe5
+ movq %rsp, %rbp 0x48 0x89 0xe5 (or 0x48 0x8b 0xec)
Any function that doesn't start with this sequence will be assumed
to have no prologue and thus no valid frame pointer in %rbp. */
@@ -1876,7 +1876,9 @@ amd64_analyze_prologue (struct gdbarch *gdbarch,
struct amd64_frame_cache *cache)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- static gdb_byte proto[3] = { 0x48, 0x89, 0xe5 }; /* movq %rsp, %rbp */
+ /* There are two variations of movq %rsp, %rbp. */
+ static const gdb_byte mov_rsp_rbp_1[3] = { 0x48, 0x89, 0xe5 };
+ static const gdb_byte mov_rsp_rbp_2[3] = { 0x48, 0x8b, 0xec };
gdb_byte buf[3];
gdb_byte op;
@@ -1900,7 +1902,8 @@ amd64_analyze_prologue (struct gdbarch *gdbarch,
/* Check for `movq %rsp, %rbp'. */
read_memory (pc + 1, buf, 3);
- if (memcmp (buf, proto, 3) != 0)
+ if (memcmp (buf, mov_rsp_rbp_1, 3) != 0
+ && memcmp (buf, mov_rsp_rbp_2, 3) != 0)
return pc + 1;
/* OK, we actually have a frame. */