diff options
author | Joel Brobecker <brobecker@gnat.com> | 2006-12-31 14:50:37 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2006-12-31 14:50:37 +0000 |
commit | ade521568314d0bb2874844e251e77d17e281396 (patch) | |
tree | 09238a441717212a45171543d06dd0f57f28f499 /gdb | |
parent | 6df5070e3fb226764cd0da485b5f596797b87936 (diff) | |
download | gdb-ade521568314d0bb2874844e251e77d17e281396.zip gdb-ade521568314d0bb2874844e251e77d17e281396.tar.gz gdb-ade521568314d0bb2874844e251e77d17e281396.tar.bz2 |
* i386-tdep.c (i386_analyze_stack_align): Add handling of two
other possible code sequences that perform a stack realignment.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5bf4c15..675206d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2006-12-31 Joel Brobecker <brobecker@adacore.com> + + * i386-tdep.c (i386_analyze_stack_align): Add handling of two + other possible code sequences that perform a stack realignment. + 2006-12-31 Mark Kettenis <kettenis@gnu.org> * sparc64-tdep.h (SPARC64_PSTATE_AG, SPARC64_PSTATE_IE) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 3099bf8..705e3f3 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -497,15 +497,27 @@ static CORE_ADDR i386_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, struct i386_frame_cache *cache) { - static const gdb_byte insns[10] = { + static const gdb_byte insns_ecx[10] = { 0x8d, 0x4c, 0x24, 0x04, /* leal 4(%esp), %ecx */ 0x83, 0xe4, 0xf0, /* andl $-16, %esp */ 0xff, 0x71, 0xfc /* pushl -4(%ecx) */ }; + static const gdb_byte insns_edx[10] = { + 0x8d, 0x54, 0x24, 0x04, /* leal 4(%esp), %edx */ + 0x83, 0xe4, 0xf0, /* andl $-16, %esp */ + 0xff, 0x72, 0xfc /* pushl -4(%edx) */ + }; + static const gdb_byte insns_eax[10] = { + 0x8d, 0x44, 0x24, 0x04, /* leal 4(%esp), %eax */ + 0x83, 0xe4, 0xf0, /* andl $-16, %esp */ + 0xff, 0x70, 0xfc /* pushl -4(%eax) */ + }; gdb_byte buf[10]; if (target_read_memory (pc, buf, sizeof buf) - || memcmp (buf, insns, sizeof buf) != 0) + || (memcmp (buf, insns_ecx, sizeof buf) != 0 + && memcmp (buf, insns_edx, sizeof buf) != 0 + && memcmp (buf, insns_eax, sizeof buf) != 0)) return pc; if (current_pc > pc + 4) |