summaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-02-29 14:59:40 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-02-29 14:59:40 +0000
commitc5a7f72d9b9da7b13373bfe2090e70e85e6e0d3a (patch)
tree4a1a5b8489526d6e9bbbe16ed44010c757665f10 /gdb/i386-tdep.c
parent380281ab3fa3d6724a92fb5ccbdcef7ac09616c8 (diff)
downloadgdb-c5a7f72d9b9da7b13373bfe2090e70e85e6e0d3a.tar.gz
gdb/
Fix disp-step-syscall.exp: fork: single step over fork. * i386-linux-tdep.c (-i386_linux_get_syscall_number): Rename to ... (i386_linux_get_syscall_number_from_regcache): ... here, new function comment, change parameters gdbarch and ptid to regcache. Remove parameter regcache, initialize gdbarch from regcache here. (i386_linux_get_syscall_number, i386_linux_displaced_step_copy_insn): New functions. (i386_linux_init_abi): Install i386_linux_displaced_step_copy_insn instead. * i386-tdep.c (i386_syscall_p): Check also for 'sysenter' and 'syscall'. Make the 'int' check more strict. gdb/testsuite/ Fix disp-step-syscall.exp: fork: single step over fork. * gdb.base/disp-step-syscall.exp (syscall_insn): Anchor it by whitespaces. (single step over $syscall): Remove its check. (single step over $syscall final pc): New check.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 56e375e2982..d18aa9945da 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -521,7 +521,12 @@ i386_call_p (const gdb_byte *insn)
static int
i386_syscall_p (const gdb_byte *insn, int *lengthp)
{
- if (insn[0] == 0xcd)
+ /* Is it 'int $0x80'? */
+ if ((insn[0] == 0xcd && insn[1] == 0x80)
+ /* Or is it 'sysenter'? */
+ || (insn[0] == 0x0f && insn[1] == 0x34)
+ /* Or is it 'syscall'? */
+ || (insn[0] == 0x0f && insn[1] == 0x05))
{
*lengthp = 2;
return 1;