This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix byte_order issue of traceframe_info of tfile
- From: Hui Zhu <hui_zhu at mentor dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: <lgustavo at codesourcery dot com>
- Date: Mon, 4 Mar 2013 12:12:45 +0800
- Subject: [PATCH] Fix byte_order issue of traceframe_info of tfile
Hi,
The function build_traceframe_info doesn't convert the byte_order. So if the tfile is read from different byte_order arch. It will get error.
This patch will fix this issue.
Thanks,
Hui
2013-03-04 Luis Machado <lgustavo@codesourcery.com>
* tracepoint.c (build_traceframe_info): Add code for byte order.
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -4705,7 +4705,14 @@ build_traceframe_info (char blocktype, v
unsigned short mlen;
tfile_read ((gdb_byte *) &maddr, 8);
+ maddr = extract_unsigned_integer ((gdb_byte *) &maddr, 8,
+ gdbarch_byte_order
+ (target_gdbarch ()));
tfile_read ((gdb_byte *) &mlen, 2);
+ mlen = (unsigned short)
+ extract_unsigned_integer ((gdb_byte *) &mlen,
+ 2, gdbarch_byte_order
+ (target_gdbarch ()));
r = VEC_safe_push (mem_range_s, info->memory, NULL);