diff options
author | Doug Evans <dje@google.com> | 2012-04-06 21:52:22 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2012-04-06 21:52:22 +0000 |
commit | 50f1ae7b0c29405f59f4863657a13738cf8ab5fc (patch) | |
tree | 588c1bdf4b9f1ff24dc0de4a2f0c910cd89adbbc /gdb | |
parent | 8c7a0b00aa8b1fb0cd0c2e6122d9321ac65c319a (diff) | |
download | gdb-50f1ae7b0c29405f59f4863657a13738cf8ab5fc.zip gdb-50f1ae7b0c29405f59f4863657a13738cf8ab5fc.tar.gz gdb-50f1ae7b0c29405f59f4863657a13738cf8ab5fc.tar.bz2 |
* amd64-tdep.c (amd64_analyze_prologue): Recognize both variations of
"mov %rsp,%rbp".
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/amd64-tdep.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 083f9a8..897fe88 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-04-06 Doug Evans <dje@google.com> + + * amd64-tdep.c (amd64_analyze_prologue): Recognize both variations of + "mov %rsp,%rbp". + 2012-04-05 Kevin Buettner <kevinb@redhat.com> * v850-tdep.c (E_NUM_OF_V850_REGS, E_NUM_OF_V850E_REGS): Fix diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index a193099..d15acea 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. */ |