GNU Binutils with patches for OS216
Revision | e909d859f5635d66e79fef467da70d6090bfae1b (tree) |
---|---|
Time | 2016-02-10 23:30:13 |
Author | Marcin Kościelnicki <koriakin@0x04...> |
Commiter | Marcin Kościelnicki |
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.
@@ -1,5 +1,10 @@ | ||
1 | 1 | 2016-02-10 Marcin Kościelnicki <koriakin@0x04.net> |
2 | 2 | |
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 | + | |
3 | 8 | * tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds |
4 | 9 | check. |
5 | 10 |
@@ -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 | + | |
1 | 6 | 2016-02-01 Doug Evans <dje@google.com> |
2 | 7 | |
3 | 8 | * gdb.texinfo (Value Sizes): Fix typo. |
@@ -41048,8 +41048,7 @@ endianness. | ||
41048 | 41048 | @item R @var{bytes} |
41049 | 41049 | Register block. The number and ordering of bytes matches that of a |
41050 | 41050 | @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. | |
41053 | 41052 | |
41054 | 41053 | @item M @var{address} @var{length} @var{bytes}... |
41055 | 41054 | Memory block. This is a contiguous block of memory, at the 8-byte |
@@ -28,6 +28,7 @@ | ||
28 | 28 | #include "exec.h" /* exec_bfd */ |
29 | 29 | #include "completer.h" |
30 | 30 | #include "filenames.h" |
31 | +#include "remote.h" | |
31 | 32 | |
32 | 33 | #ifndef O_LARGEFILE |
33 | 34 | #define O_LARGEFILE 0 |
@@ -796,7 +797,7 @@ tfile_fetch_registers (struct target_ops *ops, | ||
796 | 797 | struct regcache *regcache, int regno) |
797 | 798 | { |
798 | 799 | struct gdbarch *gdbarch = get_regcache_arch (regcache); |
799 | - int offset, regn, regsize; | |
800 | + int offset, regn, regsize, dummy; | |
800 | 801 | |
801 | 802 | /* An uninitialized reg size says we're not going to be |
802 | 803 | successful at getting register blocks. */ |
@@ -809,11 +810,12 @@ tfile_fetch_registers (struct target_ops *ops, | ||
809 | 810 | |
810 | 811 | tfile_read (regs, trace_regblock_size); |
811 | 812 | |
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; | |
815 | 813 | for (regn = 0; regn < gdbarch_num_regs (gdbarch); regn++) |
816 | 814 | { |
815 | + if (!remote_register_number_and_offset (get_regcache_arch (regcache), | |
816 | + regn, &dummy, &offset)) | |
817 | + continue; | |
818 | + | |
817 | 819 | regsize = register_size (gdbarch, regn); |
818 | 820 | /* Make sure we stay within block bounds. */ |
819 | 821 | if (offset + regsize > trace_regblock_size) |
@@ -830,7 +832,6 @@ tfile_fetch_registers (struct target_ops *ops, | ||
830 | 832 | regcache_raw_supply (regcache, regn, regs + offset); |
831 | 833 | } |
832 | 834 | } |
833 | - offset += regsize; | |
834 | 835 | } |
835 | 836 | } |
836 | 837 | else |