From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Hui Zhu <teawater@gmail.com>
Subject: Re: [PATCH] tracepoint: fix tfile byte order issue
Date: Tue, 19 Oct 2010 09:20:00 -0000 [thread overview]
Message-ID: <201010191020.04495.pedro@codesourcery.com> (raw)
In-Reply-To: <AANLkTikHJTy-0AbF0ssLX0wb3SAgKwO3x9Omh-5Q43Ys@mail.gmail.com>
On Tuesday 19 October 2010 09:48:28, Hui Zhu wrote:
> @@ -3665,6 +3665,9 @@ tfile_get_traceframe_address (off_t tfra
> perror_with_name (trace_filename);
> else if (gotten < 2)
> error (_("Premature end of file while reading trace file"));
> + tpnum = (short) extract_unsigned_integer ((gdb_byte *)&tpnum, 2,
> + gdbarch_byte_order
> + (get_current_arch ()));
>
> tp = get_tracepoint_by_number_on_target (tpnum);
> /* FIXME this is a poor heuristic if multiple locations */
> @@ -3703,6 +3706,9 @@ tfile_trace_find (enum trace_find_type t
> perror_with_name (trace_filename);
> else if (gotten < 2)
> error (_("Premature end of file while reading trace file"));
> + tpnum = (short) extract_unsigned_integer ((gdb_byte *)&tpnum, 2,
> + gdbarch_byte_order
> + (get_current_arch ()));
"The data in this section is raw binary, not a
hexadecimal or other encoding; its endianness matches the target's
endianness."
Please use target_gdbarch instead.
And use extract_signed_integer thus avoiding the casts.
--
Pedro Alves
next prev parent reply other threads:[~2010-10-19 9:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-14 6:41 Hui Zhu
2010-10-19 8:48 ` Hui Zhu
2010-10-19 9:20 ` Pedro Alves [this message]
2010-10-20 8:50 ` Hui Zhu
2010-10-20 10:28 ` Pedro Alves
2010-10-20 14:04 ` 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=201010191020.04495.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=teawater@gmail.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