This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] GDBserver: Fix "Cond. jump or move depends on uninit value" in x87 code
On 07/10/2018 07:58 PM, Simon Marchi wrote:
>
> Hi Pedro,
>
> That looks like a good improvement. This variable is now unused:
>
> i387-fp.c:152:17: error: unused variable ‘val’ [-Werror=unused-variable]
Thanks, I fixed that and pushed the patch in.
>
> Anytime we use collect_register* to write directly in a variable is potentially
> dangerous. It's not really applicable in GDBserver, but in GDB there are also
> endianness issues. Should we aim at making collect_register's parameter a
> gdb_byte* instead, to help avoid this situation? Code such as the one you fixed
> would not compile.
Indeed, that may be a good idea.
I think most current uses of collect_register_by_name would
fail to compile, but then most of those could be replaced
with regcache_raw_get_unsigned_by_name.
Thanks,
Pedro Alves