diff options
author | Hui Zhu <teawater@gmail.com> | 2009-08-10 03:04:45 +0000 |
---|---|---|
committer | Hui Zhu <teawater@gmail.com> | 2009-08-10 03:04:45 +0000 |
commit | 2c543fc432a396cc5acf29e9dd042a81d534c51a (patch) | |
tree | c2f22a682023cc4d639d893d0d21e6f121eac37b /gdb/i386-linux-tdep.c | |
parent | cf648174b0ee4bbc9f53deb4d4d67a3e010f534b (diff) | |
download | gdb-2c543fc432a396cc5acf29e9dd042a81d534c51a.zip gdb-2c543fc432a396cc5acf29e9dd042a81d534c51a.tar.gz gdb-2c543fc432a396cc5acf29e9dd042a81d534c51a.tar.bz2 |
2009-08-10 Hui Zhu <teawater@gmail.com>
Add process record Linux system call 64 bits support.
* linux-record.h (linux_record_tdep): Add size_pointer,
size_size_t, size_iovec and arg6. Change the values of
size_int, size_long and size_ulong to
gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT,
gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT.
* i386-linux-tdep.c (i386_linux_init_abi): Ditto.
(i386_linux_intx80_sysenter_record): Add a check for system
call number.
* linux-record.c (record_linux_system_call): Make this
function support 64 bits.
Diffstat (limited to 'gdb/i386-linux-tdep.c')
-rw-r--r-- | gdb/i386-linux-tdep.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 7928299..ecc634f 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -369,7 +369,14 @@ i386_linux_intx80_sysenter_record (struct regcache *regcache) int ret; uint32_t tmpu32; - regcache_raw_read (regcache, I386_EAX_REGNUM, (gdb_byte *)&tmpu32); + regcache_raw_read (regcache, I386_EAX_REGNUM, (gdb_byte *) &tmpu32); + + if (tmpu32 > 499) + { + printf_unfiltered (_("Process record and replay target doesn't " + "support syscall number %u\n"), tmpu32); + return -1; + } ret = record_linux_system_call (tmpu32, regcache, &i386_linux_record_tdep); @@ -481,6 +488,8 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Initialize the i386_linux_record_tdep. */ /* These values are the size of the type that will be used in a system call. They are obtained from Linux Kernel source. */ + i386_linux_record_tdep.size_pointer + = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT; i386_linux_record_tdep.size__old_kernel_stat = 32; i386_linux_record_tdep.size_tms = 16; i386_linux_record_tdep.size_loff_t = 8; @@ -501,9 +510,12 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) i386_linux_record_tdep.size_statfs = 64; i386_linux_record_tdep.size_statfs64 = 84; i386_linux_record_tdep.size_sockaddr = 16; - i386_linux_record_tdep.size_int = 4; - i386_linux_record_tdep.size_long = 4; - i386_linux_record_tdep.size_ulong = 4; + i386_linux_record_tdep.size_int + = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT; + i386_linux_record_tdep.size_long + = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT; + i386_linux_record_tdep.size_ulong + = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT; i386_linux_record_tdep.size_msghdr = 28; i386_linux_record_tdep.size_itimerval = 16; i386_linux_record_tdep.size_stat = 88; @@ -536,7 +548,8 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) i386_linux_record_tdep.size_io_event = 32; i386_linux_record_tdep.size_iocb = 64; i386_linux_record_tdep.size_epoll_event = 12; - i386_linux_record_tdep.size_itimerspec = i386_linux_record_tdep.size_timespec * 2; + i386_linux_record_tdep.size_itimerspec + = i386_linux_record_tdep.size_timespec * 2; i386_linux_record_tdep.size_mq_attr = 32; i386_linux_record_tdep.size_siginfo = 128; i386_linux_record_tdep.size_termios = 36; @@ -546,6 +559,8 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) i386_linux_record_tdep.size_serial_struct = 60; i386_linux_record_tdep.size_serial_icounter_struct = 80; i386_linux_record_tdep.size_hayes_esp_config = 12; + i386_linux_record_tdep.size_size_t = 4; + i386_linux_record_tdep.size_iovec = 8; /* These values are the second argument of system call "sys_ioctl". They are obtained from Linux Kernel source. */ @@ -627,6 +642,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) i386_linux_record_tdep.arg3 = I386_EDX_REGNUM; i386_linux_record_tdep.arg4 = I386_ESI_REGNUM; i386_linux_record_tdep.arg5 = I386_EDI_REGNUM; + i386_linux_record_tdep.arg6 = I386_EBP_REGNUM; tdep->i386_intx80_record = i386_linux_intx80_sysenter_record; tdep->i386_sysenter_record = i386_linux_intx80_sysenter_record; |