Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix byte_order issue of traceframe_info of tfile
@ 2013-03-04  4:13 Hui Zhu
  2013-03-04 12:45 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Hui Zhu @ 2013-03-04  4:13 UTC (permalink / raw)
  To: gdb-patches; +Cc: lgustavo

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-04 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-04  4:13 [PATCH] Fix byte_order issue of traceframe_info of tfile Hui Zhu
2013-03-04 12:45 ` Pedro Alves
2013-03-04 13:54   ` Hui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox