This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]