gdb.trace: Use g packet order in tfile_fetch_registers.
authorMarcin Kościelnicki <koriakin@0x04.net>
Sat, 6 Feb 2016 15:26:07 +0000 (16:26 +0100)
committerMarcin Kościelnicki <koriakin@0x04.net>
Wed, 10 Feb 2016 14:30:13 +0000 (15:30 +0100)
tfile_fetch_registers currently wrongly fetches registers using
gdb order instead of g packet order.  On x86_64 with AVX, this causes
problems with ymm*h and orig_rax registers: gdb has ymm*h first, while
g packet has orig_rax first.

gdb/ChangeLog:

* tracefile-tfile.c (tfile_fetch_registers): Use g packet order
instead of gdb order.

gdb/doc/ChangeLog:

* gdb.texinfo (Trace File Format): Remove misleading information
about register block ordering.

gdb/ChangeLog
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/tracefile-tfile.c

index 9f8aa1d5c4116e9c19ce2e7586275ccb5db03e95..b32a301dd9e10e6069374fc7177879f989bd286e 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-10  Marcin Kościelnicki  <koriakin@0x04.net>
+
+       * tracefile-tfile.c (tfile_fetch_registers): Use g packet order
+       instead of gdb order.
+
 2016-02-10  Marcin Kościelnicki  <koriakin@0x04.net>
 
        * tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds
index 05d269473bf446772830ff170269e1de08ef36c3..75b24efcf0fa825bc811dad482ca7cf6941874ac 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-10  Marcin Kościelnicki  <koriakin@0x04.net>
+
+       * gdb.texinfo (Trace File Format): Remove misleading information
+       about register block ordering.
+
 2016-02-01  Doug Evans  <dje@google.com>
 
        * gdb.texinfo (Value Sizes): Fix typo.
index 2d09d13701a0c0d9cc0cb846bdaf3a3eb8264f0c..9db234e774adadb79ac97de74a213d2d3551a3b8 100644 (file)
@@ -41048,8 +41048,7 @@ endianness.
 @item R @var{bytes}
 Register block.  The number and ordering of bytes matches that of a
 @code{g} packet in the remote protocol.  Note that these are the
-actual bytes, in target order and @value{GDBN} register order, not a
-hexadecimal encoding.
+actual bytes, in target order, not a hexadecimal encoding.
 
 @item M @var{address} @var{length} @var{bytes}...
 Memory block.  This is a contiguous block of memory, at the 8-byte
index dc7b05a05ff16688080abe0f0f2d07df5c82906f..8b42aba205b0efd3778b33f0133d064525f27f4e 100644 (file)
@@ -28,6 +28,7 @@
 #include "exec.h" /* exec_bfd */
 #include "completer.h"
 #include "filenames.h"
+#include "remote.h"
 
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
@@ -796,7 +797,7 @@ tfile_fetch_registers (struct target_ops *ops,
                       struct regcache *regcache, int regno)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  int offset, regn, regsize;
+  int offset, regn, regsize, dummy;
 
   /* An uninitialized reg size says we're not going to be
      successful at getting register blocks.  */
@@ -809,11 +810,12 @@ tfile_fetch_registers (struct target_ops *ops,
 
       tfile_read (regs, trace_regblock_size);
 
-      /* Assume the block is laid out in GDB register number order,
-        each register with the size that it has in GDB.  */
-      offset = 0;
       for (regn = 0; regn < gdbarch_num_regs (gdbarch); regn++)
        {
+         if (!remote_register_number_and_offset (get_regcache_arch (regcache),
+                                                 regn, &dummy, &offset))
+           continue;
+
          regsize = register_size (gdbarch, regn);
          /* Make sure we stay within block bounds.  */
          if (offset + regsize > trace_regblock_size)
@@ -830,7 +832,6 @@ tfile_fetch_registers (struct target_ops *ops,
                  regcache_raw_supply (regcache, regn, regs + offset);
                }
            }
-         offset += regsize;
        }
     }
   else
This page took 0.046212 seconds and 4 git commands to generate.