summaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2006-12-31 14:50:37 +0000
committerJoel Brobecker <brobecker@gnat.com>2006-12-31 14:50:37 +0000
commitf4ee17614b1bc7e83be684e3b735d97be0b464ec (patch)
treea2f314d4f750c2ecedf5c32635f9673b5786a9ba /gdb/i386-tdep.c
parent9ec03cca239e88a0c8c4bf6580bd086ca7154034 (diff)
downloadgdb-f4ee17614b1bc7e83be684e3b735d97be0b464ec.tar.gz
* i386-tdep.c (i386_analyze_stack_align): Add handling of two
other possible code sequences that perform a stack realignment.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 3099bf85abf..705e3f32887 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)