aboutsummaryrefslogtreecommitdiff
path: root/gdb/CONTRIBUTE
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2023-04-05 17:21:32 +0100
committerNick Alcock <nick.alcock@oracle.com>2023-04-08 16:07:17 +0100
commitd7474051e87c5804c2b674c0d3ad78030f0464a7 (patch)
tree26e0e288d9f536d62807077854efa77a8538cdd6 /gdb/CONTRIBUTE
parent30a794e9f1db2de9099ed4c494d917d4e86de0fd (diff)
downloadgdb-d7474051e87c5804c2b674c0d3ad78030f0464a7.zip
gdb-d7474051e87c5804c2b674c0d3ad78030f0464a7.tar.gz
gdb-d7474051e87c5804c2b674c0d3ad78030f0464a7.tar.bz2
libctf: propagate errors from parents correctly
CTF dicts have per-dict errno values: as with other errno values these are set on error and left unchanged on success. This means that all errors *must* set the CTF errno: if a call leaves it unchanged, the caller is apt to find a previous, lingering error and misinterpret it as the real error. There are many places in libctf where we carry out operations on parent dicts as a result of carrying out other user-requested operations on child dicts (e.g. looking up information on a pointer to a type will look up the type as well: the pointer might well be in a child and the type it's a pointer to in the parent). Those operations on the parent might fail; if they do, the error must be correctly reflected on the child that the user-visible operation was carried out on. In many places this was not happening. So, audit and fix all those places. Add tests for as many of those cases as possible so they don't regress. libctf/ * ctf-create.c (ctf_add_slice): Use the original dict. * ctf-lookup.c (ctf_lookup_variable): Propagate errors. (ctf_lookup_symbol_idx): Likewise. * ctf-types.c (ctf_member_next): Likewise. (ctf_type_resolve_unsliced): Likewise. (ctf_type_aname): Likewise. (ctf_member_info): Likewise. (ctf_type_rvisit): Likewise. (ctf_func_type_info): Set the error on the right dict. (ctf_type_encoding): Use the original dict. * testsuite/libctf-writable/error-propagation.*: New test.
Diffstat (limited to 'gdb/CONTRIBUTE')
0 files changed, 0 insertions, 0 deletions