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: Wed, 20 Oct 2010 10:28:00 -0000 [thread overview]
Message-ID: <201010201128.17479.pedro@codesourcery.com> (raw)
In-Reply-To: <AANLkTikB9-d0gYeWevWnznrmvDESMyzA5sdcB-YF9b7y@mail.gmail.com>
On Wednesday 20 October 2010 09:49:58, Hui Zhu wrote:
> I make a new patch change to use target_gdbarch and use
> extract_signed_integer in signed value.
>
> And I found that tfile_trace_find define the size of a frame to a int:
> int data_size;
>
> But I found that gdbserver/tracepoint.c:struct traceframe:
> unsigned int data_size : 32;
>
> So I change this int to unsigned int.
Thanks. It appears the format description in gdb.texinfo doesn't
make that explicit, but indeed all sizes should be unsigned.
> @@ -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_signed_integer ((gdb_byte *)&tpnum, 2,
> + gdbarch_byte_order
> + (target_gdbarch));
I don't think you need all the casts to short, int, etc.. anymore. Please
add the missing space in the second cast: "(gdb_byte *) &tpnum" everywhere too.
Otherwise okay. Thanks.
--
Pedro Alves
next prev parent reply other threads:[~2010-10-20 10:28 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
2010-10-20 8:50 ` Hui Zhu
2010-10-20 10:28 ` Pedro Alves [this message]
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=201010201128.17479.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