gdb/linux-record: Fix readdir and getdents handling
[deliverable/binutils-gdb.git] / gdb / linux-record.c
index d1e02f4e6e373bdfa14675c1f2a37b900312db4b..e950e8d17e84e27c1072a880fc032377965a1c4d 100644 (file)
@@ -689,7 +689,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_old_readdir:
       regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
       if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
-                                        tdep->size_dirent))
+                                        tdep->size_old_dirent))
         return -1;
       break;
 
@@ -1344,14 +1344,14 @@ Do you want to stop the program?"),
       break;
 
     case gdb_sys_getdents:
+    case gdb_sys_getdents64:
       {
         ULONGEST count;
 
         regcache_raw_read_unsigned (regcache, tdep->arg2,
                                     &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
-        if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
-                                          tdep->size_dirent * count))
+        if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, count))
           return -1;
       }
       break;
@@ -1745,19 +1745,6 @@ Do you want to stop the program?"),
     case gdb_sys_madvise:
       break;
 
-    case gdb_sys_getdents64:
-      {
-        ULONGEST count;
-
-        regcache_raw_read_unsigned (regcache, tdep->arg2,
-                                    &tmpulongest);
-        regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
-        if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
-                                          tdep->size_dirent64 * count))
-          return -1;
-      }
-      break;
-
     case gdb_sys_fcntl64:
       regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
       if (tmpulongest == tdep->fcntl_F_GETLK64)
This page took 0.025234 seconds and 4 git commands to generate.