This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/RFC Prec] Add Linux AMD64 process record support second version, (64 bits system call support) 2/3


Hui Zhu wrote:
The old linux-record.c just support 32 bits system call and some other
problem.  This patch fix them all.

2009-07-07 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.
        * 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.

Again, preliminary, mostly whitespace formatting comments.


@@ -371,8 +371,15 @@ i386_linux_intx80_sysenter_record (struc

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);
+                                  &i386_linux_record_tdep);

This line is just a change between spaces and tabs. We like to have whitespace-only changes submitted separately.

Just add -w and/or -b to your diff flags, and these will disappear.

@@ -481,6 +488,7 @@ i386_linux_init_abi (struct gdbarch_info
   /* 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 = 4;

Can't you use gdbarch_ptr_bit(gdbarch) for this? Just trying to avoid duplication.

+
+  a = alloca (tdep->size_int);
+
+  if (record_arch_list_add_mem ((CORE_ADDR)len, tdep->size_int))
+    return -1;
+
+  /* Get the addrlen.  */
+  if (target_read_memory ((CORE_ADDR)len, a, tdep->size_int))

Space after cast. There are a whole lot like this in this file.


+    {
+      if (record_debug)
+        fprintf_unfiltered (gdb_stdlog,
+                            "Process record: error reading "
+                            "memory at addr = 0x%s len = %d.\n",
+                            phex_nz (len, tdep->size_pointer),
+                            tdep->size_int);
+        return -1;
+    }
+  addrlen = (int)extract_unsigned_integer(a, tdep->size_int, byte_order);

Space after function name. And after cast. Search for "extract_unsigned_integer", there are several like this.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]