Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <hui_zhu@mentor.com>
To: <gdb-patches@sourceware.org>
Cc: <lgustavo@codesourcery.com>
Subject: [PATCH] Fix byte_order issue of traceframe_info of tfile
Date: Mon, 04 Mar 2013 04:13:00 -0000	[thread overview]
Message-ID: <51341F3D.2030608@mentor.com> (raw)

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


             reply	other threads:[~2013-03-04  4:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04  4:13 Hui Zhu [this message]
2013-03-04 12:45 ` Pedro Alves
2013-03-04 13:54   ` Hui Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51341F3D.2030608@mentor.com \
    --to=hui_zhu@mentor.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lgustavo@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox