aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdb.texinfo3
-rw-r--r--gdb/tracefile-tfile.c11
4 files changed, 17 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9f8aa1d..b32a301 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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
check.
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 05d2694..75b24ef 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -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.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 2d09d13..9db234e 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -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
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index dc7b05a..8b42aba 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -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