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]

Re: [PATCH] tracepoint: fix tfile byte order issue


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


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