*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / linux-record.c
index 1c6aa9ff0421ef8a686b2499ab3290793af33259..f07a889f6716263ccb11042cb5c97b11594a3d77 100644 (file)
@@ -192,7 +192,7 @@ record_linux_msghdr (struct regcache *regcache,
           tmpint = (int) extract_unsigned_integer (iov + tdep->size_pointer,
                                                    tdep->size_size_t,
                                                    byte_order);
-          if (record_arch_list_add_mem (tmpaddr, tmpint));
+          if (record_arch_list_add_mem (tmpaddr, tmpint))
             return -1;
           addr += tdep->size_iovec;
         }
@@ -203,7 +203,7 @@ record_linux_msghdr (struct regcache *regcache,
   addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
   a += tdep->size_pointer;
   tmpint = (int) extract_unsigned_integer (a, tdep->size_size_t, byte_order);
-  if (record_arch_list_add_mem ((CORE_ADDR) addr, tmpint));
+  if (record_arch_list_add_mem ((CORE_ADDR) addr, tmpint))
     return -1;
 
   return 0;
@@ -240,6 +240,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_exit:
       {
         int q;
+
         target_terminal_ours ();
         q = yquery (_("The next instruction is syscall exit.  "
                       "It will make the program exit.  "
@@ -256,6 +257,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_read:
       {
         ULONGEST addr, count;
+
         regcache_raw_read_unsigned (regcache, tdep->arg2, &addr);
         regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
         if (record_arch_list_add_mem ((CORE_ADDR) addr, (int) count))
@@ -654,6 +656,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_readlink:
       {
         ULONGEST len;
+
         regcache_raw_read_unsigned (regcache, tdep->arg2,
                                     &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
@@ -669,11 +672,11 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_reboot:
       {
         int q;
+
         target_terminal_ours ();
-        q =
-          yquery (_("The next instruction is syscall reboot.  "
-                    "It will restart the computer.  "
-                    "Do you want to stop the program?"));
+        q = yquery (_("The next instruction is syscall reboot.  "
+                     "It will restart the computer.  "
+                     "Do you want to stop the program?"));
         target_terminal_inferior ();
         if (q)
           return 1;
@@ -692,21 +695,26 @@ record_linux_system_call (enum gdb_syscall syscall,
 
     case gdb_sys_munmap:
       {
-        int q;
         ULONGEST len;
 
         regcache_raw_read_unsigned (regcache, tdep->arg1,
                                     &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg2, &len);
-        target_terminal_ours ();
-        q = yquery (_("The next instruction is syscall munmap.  "
-                      "It will free the memory addr = 0x%s len = %u.  "
-                      "It will make record target get error.  "
-                      "Do you want to stop the program?"),
-                    OUTPUT_REG (tmpulongest, tdep->arg1), (int) len);
-        target_terminal_inferior ();
-        if (q)
-          return 1;
+        if (record_memory_query)
+          {
+           int q;
+
+            target_terminal_ours ();
+            q = yquery (_("\
+The next instruction is syscall munmap.\n\
+It will free the memory addr = 0x%s len = %u.\n\
+It will make record target cannot record some memory change.\n\
+Do you want to stop the program?"),
+                        OUTPUT_REG (tmpulongest, tdep->arg1), (int) len);
+            target_terminal_inferior ();
+            if (q)
+              return 1;
+          }
       }
       break;
 
@@ -745,6 +753,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_getpeername:
       {
         ULONGEST len;
+
         regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
         if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
@@ -755,6 +764,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_recvfrom:
       {
         ULONGEST len;
+
         regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg5, &len);
         if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
@@ -763,6 +773,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_recv:
       {
         ULONGEST size;
+
         regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg3, &size);
         if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) size))
@@ -788,6 +799,7 @@ record_linux_system_call (enum gdb_syscall syscall,
         {
           ULONGEST optvalp;
           gdb_byte *optlenp = alloca (tdep->size_int);
+
           if (target_read_memory ((CORE_ADDR) tmpulongest, optlenp,
                                   tdep->size_int))
             {
@@ -829,8 +841,6 @@ record_linux_system_call (enum gdb_syscall syscall,
             if (tmpulongest)
               {
                 gdb_byte *a = alloca (tdep->size_ulong * 2);
-                int addrlen;
-                gdb_byte *addrlenp;
                 ULONGEST len;
 
                 tmpulongest += tdep->size_ulong;
@@ -859,6 +869,7 @@ record_linux_system_call (enum gdb_syscall syscall,
         case RECORD_SYS_SOCKETPAIR:
           {
             gdb_byte *a = alloca (tdep->size_ulong);
+
             regcache_raw_read_unsigned (regcache, tdep->arg2,
                                         &tmpulongest);
             if (tmpulongest)
@@ -892,8 +903,6 @@ record_linux_system_call (enum gdb_syscall syscall,
           if (tmpulongest)
             {
               gdb_byte *a = alloca (tdep->size_ulong * 2);
-              int addrlen;
-              gdb_byte *addrlenp;
               ULONGEST len;
 
               tmpulongest += tdep->size_ulong * 4;
@@ -1137,6 +1146,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_msgrcv:
       {
         ULONGEST msgp;
+
         regcache_raw_read_signed (regcache, tdep->arg3, &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg2, &msgp);
         tmpint = (int) tmpulongest + tdep->size_long;
@@ -1170,6 +1180,7 @@ record_linux_system_call (enum gdb_syscall syscall,
           {
             ULONGEST second;
             ULONGEST ptr;
+
             regcache_raw_read_signed (regcache, tdep->arg3, &second);
             regcache_raw_read_unsigned (regcache, tdep->arg5, &ptr);
             tmpint = (int) second + tdep->size_long;
@@ -1225,6 +1236,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest == 0 || tmpulongest == 2)
         {
           ULONGEST ptr, bytecount;
+
           regcache_raw_read_unsigned (regcache, tdep->arg2, &ptr);
           regcache_raw_read_unsigned (regcache, tdep->arg3, &bytecount);
           if (record_arch_list_add_mem ((CORE_ADDR) ptr, (int) bytecount))
@@ -1323,6 +1335,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_getdents:
       {
         ULONGEST count;
+
         regcache_raw_read_unsigned (regcache, tdep->arg2,
                                     &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
@@ -1454,6 +1467,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST nfds;
+
           regcache_raw_read_unsigned (regcache, tdep->arg2, &nfds);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                         tdep->size_pollfd * nfds))
@@ -1466,6 +1480,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest == 7 || tmpulongest == 8)
         {
           int rsize;
+
           if (tmpulongest == 7)
             rsize = tdep->size_NFS_FHSIZE;
           else
@@ -1538,6 +1553,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST sigsetsize;
+
           regcache_raw_read_unsigned (regcache, tdep->arg2,&sigsetsize);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                         (int) sigsetsize))
@@ -1561,6 +1577,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST count;
+
           regcache_raw_read_unsigned (regcache, tdep->arg3,&count);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) count))
             return -1;
@@ -1576,6 +1593,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST size;
+
           regcache_raw_read_unsigned (regcache, tdep->arg2, &size);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) size))
             return -1;
@@ -1648,6 +1666,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST gidsetsize;
+
           regcache_raw_read_unsigned (regcache, tdep->arg1,
                                       &gidsetsize);
           tmpint = tdep->size_gid_t * (int) gidsetsize;
@@ -1709,6 +1728,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_getdents64:
       {
         ULONGEST count;
+
         regcache_raw_read_unsigned (regcache, tdep->arg2,
                                     &tmpulongest);
         regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
@@ -1751,6 +1771,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST size;
+
           regcache_raw_read_unsigned (regcache, tdep->arg4, &size);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) size))
             return -1;
@@ -1764,6 +1785,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST size;
+
           regcache_raw_read_unsigned (regcache, tdep->arg3, &size);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) size))
             return -1;
@@ -1792,6 +1814,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST len;
+
           regcache_raw_read_unsigned (regcache, tdep->arg2, &len);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) len))
             return -1;
@@ -1825,6 +1848,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST nr;
+
           regcache_raw_read_unsigned (regcache, tdep->arg3, &nr);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                         nr * tdep->size_io_event))
@@ -1879,6 +1903,7 @@ record_linux_system_call (enum gdb_syscall syscall,
     case gdb_sys_exit_group:
       {
         int q;
+
         target_terminal_ours ();
         q = yquery (_("The next instruction is syscall exit_group.  "
                       "It will make the program exit.  "
@@ -1894,6 +1919,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST len;
+
           regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) len))
             return -1;
@@ -1909,6 +1935,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST maxevents;
+
           regcache_raw_read_unsigned (regcache, tdep->arg3, &maxevents);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                         maxevents * tdep->size_epoll_event))
@@ -1989,6 +2016,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST maxnode;
+
           regcache_raw_read_unsigned (regcache, tdep->arg3, &maxnode);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                         maxnode * tdep->size_long))
@@ -2007,6 +2035,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST msg_len;
+
           regcache_raw_read_unsigned (regcache, tdep->arg3, &msg_len);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                         (int) msg_len))
@@ -2055,6 +2084,7 @@ record_linux_system_call (enum gdb_syscall syscall,
           if (tmpulongest)
             {
               ULONGEST buflen;
+
               regcache_raw_read_unsigned (regcache, tdep->arg4, &buflen);
               if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                             (int) buflen))
@@ -2094,6 +2124,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST bufsiz;
+
           regcache_raw_read_unsigned (regcache, tdep->arg4, &bufsiz);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) bufsiz))
             return -1;
@@ -2128,6 +2159,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST nfds;
+
           regcache_raw_read_unsigned (regcache, tdep->arg2, &nfds);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                         tdep->size_pollfd * nfds))
@@ -2173,6 +2205,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST nr_pages;
+
           regcache_raw_read_unsigned (regcache, tdep->arg2, &nr_pages);
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
                                         nr_pages * tdep->size_int))
@@ -2198,6 +2231,7 @@ record_linux_system_call (enum gdb_syscall syscall,
       if (tmpulongest)
         {
           ULONGEST maxevents;
+
           regcache_raw_read_unsigned (regcache, tdep->arg3, &maxevents);
           tmpint = (int) maxevents * tdep->size_epoll_event;
           if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest, tmpint))
This page took 0.029843 seconds and 4 git commands to generate.