2010-05-27 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
[binutils-gdb.git] / gdb / linux-record.c
index 74ef9bd0132a418c5ea479eebd17e863c03c465d..1311f001d263e745ea88c9153ac028b20ff3a4a6 100644 (file)
@@ -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;
@@ -745,6 +748,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 +759,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 +768,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 +794,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 +836,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 +864,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 +898,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 +1141,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 +1175,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 +1231,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 +1330,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 +1462,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 +1475,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 +1548,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 +1572,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 +1588,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 +1661,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 +1723,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 +1766,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 +1780,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 +1809,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 +1843,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 +1898,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 +1914,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 +1930,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 +2011,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 +2030,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 +2079,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 +2119,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 +2154,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 +2200,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 +2226,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))