diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2025-03-21 12:51:43 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2025-03-21 12:51:43 +0000 |
commit | 294756b94ea3ad2b69fc80b58b4ab717427659f3 (patch) | |
tree | 19084edb9fc23e55de567951aa87415daf530b9c /libctf/ctf-inlines.h | |
parent | 89dc89df7175c640c1534bb32f234b07c8ebd1fe (diff) | |
download | binutils-294756b94ea3ad2b69fc80b58b4ab717427659f3.zip binutils-294756b94ea3ad2b69fc80b58b4ab717427659f3.tar.gz binutils-294756b94ea3ad2b69fc80b58b4ab717427659f3.tar.bz2 |
libctf: make debugging easier when hash debugging is on
Arrange that when hash debugging is on, ctf_set_errno and
ctf_set_typed_errno become real functions: renumber the error values (now we
have changed soname and can do that) so that ECTF_NEXT_END is first, and
thus obviously number 1000, so it's easy to drop a breakpoint condition
on err != 1000 to get all real non-end-of-iteration errors even in the
absence of macro debug info.
Diffstat (limited to 'libctf/ctf-inlines.h')
-rw-r--r-- | libctf/ctf-inlines.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libctf/ctf-inlines.h b/libctf/ctf-inlines.h index bf4b61e..5963fb3 100644 --- a/libctf/ctf-inlines.h +++ b/libctf/ctf-inlines.h @@ -90,6 +90,10 @@ ctf_assert_internal (ctf_dict_t *fp, const char *file, size_t line, return expr; } +/* Un-inline these functions if debugging, so you can drop breakpoints on the + setting of any error anywhere by the library. */ + +#ifndef ENABLE_LIBCTF_HASH_DEBUGGING static inline int ctf_set_errno (ctf_dict_t *fp, int err) { @@ -105,7 +109,10 @@ ctf_set_typed_errno (ctf_dict_t *fp, int err) fp->ctf_errno = err; return CTF_ERR; } - +#else +extern int ctf_set_errno (ctf_dict_t *fp, int err); +extern ctf_id_t ctf_set_typed_errno (ctf_dict_t *fp, int err); +#endif #ifdef __cplusplus } |