• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisione909d859f5635d66e79fef467da70d6090bfae1b (tree)
Time2016-02-10 23:30:13
AuthorMarcin Kościelnicki <koriakin@0x04...>
CommiterMarcin Kościelnicki

Log Message

gdb.trace: Use g packet order in tfile_fetch_registers.

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.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
11 2016-02-10 Marcin Kościelnicki <koriakin@0x04.net>
22
3+ * tracefile-tfile.c (tfile_fetch_registers): Use g packet order
4+ instead of gdb order.
5+
6+2016-02-10 Marcin Kościelnicki <koriakin@0x04.net>
7+
38 * tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds
49 check.
510
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
1+2016-02-10 Marcin Kościelnicki <koriakin@0x04.net>
2+
3+ * gdb.texinfo (Trace File Format): Remove misleading information
4+ about register block ordering.
5+
16 2016-02-01 Doug Evans <dje@google.com>
27
38 * gdb.texinfo (Value Sizes): Fix typo.
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -41048,8 +41048,7 @@ endianness.
4104841048 @item R @var{bytes}
4104941049 Register block. The number and ordering of bytes matches that of a
4105041050 @code{g} packet in the remote protocol. Note that these are the
41051-actual bytes, in target order and @value{GDBN} register order, not a
41052-hexadecimal encoding.
41051+actual bytes, in target order, not a hexadecimal encoding.
4105341052
4105441053 @item M @var{address} @var{length} @var{bytes}...
4105541054 Memory block. This is a contiguous block of memory, at the 8-byte
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -28,6 +28,7 @@
2828 #include "exec.h" /* exec_bfd */
2929 #include "completer.h"
3030 #include "filenames.h"
31+#include "remote.h"
3132
3233 #ifndef O_LARGEFILE
3334 #define O_LARGEFILE 0
@@ -796,7 +797,7 @@ tfile_fetch_registers (struct target_ops *ops,
796797 struct regcache *regcache, int regno)
797798 {
798799 struct gdbarch *gdbarch = get_regcache_arch (regcache);
799- int offset, regn, regsize;
800+ int offset, regn, regsize, dummy;
800801
801802 /* An uninitialized reg size says we're not going to be
802803 successful at getting register blocks. */
@@ -809,11 +810,12 @@ tfile_fetch_registers (struct target_ops *ops,
809810
810811 tfile_read (regs, trace_regblock_size);
811812
812- /* Assume the block is laid out in GDB register number order,
813- each register with the size that it has in GDB. */
814- offset = 0;
815813 for (regn = 0; regn < gdbarch_num_regs (gdbarch); regn++)
816814 {
815+ if (!remote_register_number_and_offset (get_regcache_arch (regcache),
816+ regn, &dummy, &offset))
817+ continue;
818+
817819 regsize = register_size (gdbarch, regn);
818820 /* Make sure we stay within block bounds. */
819821 if (offset + regsize > trace_regblock_size)
@@ -830,7 +832,6 @@ tfile_fetch_registers (struct target_ops *ops,
830832 regcache_raw_supply (regcache, regn, regs + offset);
831833 }
832834 }
833- offset += regsize;
834835 }
835836 }
836837 else