diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2017-09-10 17:50:29 -0400 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2017-09-10 18:12:14 -0400 |
commit | a059f00c857d088a7fe55d2dbded9d3210af4989 (patch) | |
tree | c705e911613b5fa27fdfd71e8023f7b9a741bbdc /opcodes/nds32-asm.c | |
parent | cc397f3a236509257acfd5cd17c2f15f87a482d7 (diff) | |
download | gdb-a059f00c857d088a7fe55d2dbded9d3210af4989.zip gdb-a059f00c857d088a7fe55d2dbded9d3210af4989.tar.gz gdb-a059f00c857d088a7fe55d2dbded9d3210af4989.tar.bz2 |
Fix build breakage on GNU/Linux AArch64, take 2
The last commit unfortunately was not enough to fix the build breakage
on AArch64. I made a mistake and did not test it alone on BuildBot,
but along with another patch that was responsible for fixing the
breakage.
The failure is:
In file included from /usr/include/string.h:640:0,
from build-gnulib-gdbserver/import/string.h:41,
from ../../../binutils-gdb/gdb/gdbserver/../common/common-defs.h:56,
from ../../../binutils-gdb/gdb/gdbserver/server.h:22,
from ../../../binutils-gdb/gdb/gdbserver/regcache.c:19:
In function ‘void* memset(void*, int, size_t)’,
inlined from ‘regcache* init_register_cache(regcache*, const target_desc*, unsigned char*)’ at ../../../binutils-gdb/gdb/gdbserver/regcache.c:150:50:
/usr/include/aarch64-linux-gnu/bits/string3.h:81:32: error: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror]
__warn_memset_zero_len ();
^
In function ‘void* memset(void*, int, size_t)’,
inlined from ‘regcache* get_thread_regcache(thread_info*, int)’ at ../../../binutils-gdb/gdb/gdbserver/regcache.c:57:60:
/usr/include/aarch64-linux-gnu/bits/string3.h:81:32: error: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror]
__warn_memset_zero_len ();
This is likely due to a GCC bug, because for some reason the compiler
assumes that the third argument to the memset:
memset (regcache->register_status, REG_UNAVAILABLE,
VEC_length (tdesc_reg_p, regcache->tdesc->reg_defs));
is always zero, which is not always true.
Anyway, the simple fix for this is to guard the memset calls with:
if (!VEC_empty (tdesc_reg_p, regcache->tdesc->reg_defs))
This time, I made sure to regtest only this patch on BuildBot, and it
finally solved the breakage.
gdb/gdbserver/ChangeLog:
2017-09-10 Sergio Durigan Junior <sergiodj@redhat.com>
* regcache.c (get_thread_regcache): Guard calls to "memset"
with "!VEC_empty".
Diffstat (limited to 'opcodes/nds32-asm.c')
0 files changed, 0 insertions, 0 deletions