From f5d08871d3ecec7a6daf3ec0dabcdf440b614e02 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 15 Jun 2001 20:14:44 +0000 Subject: Make some nice SEND_ADDRESS_STDERR and SEND_NUMBER_STDERR macros that operate inline, to help when debugging ldso (i.e. before we can do things like function calls). -Erik --- ldso/ldso/ld_hash.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ldso/ldso/ld_hash.h') diff --git a/ldso/ldso/ld_hash.h b/ldso/ldso/ld_hash.h index cc1c56c42..c7fee6c97 100644 --- a/ldso/ldso/ld_hash.h +++ b/ldso/ldso/ld_hash.h @@ -82,6 +82,24 @@ extern int _dl_linux_dynamic_link(void); #else #define SEND_STDERR(X) _dl_write(2, X, _dl_strlen_inline(X)); #endif + +#define SEND_ADDRESS_STDERR(X, add_a_newline) { \ + char tmp[13]; \ + _dl_write(2, _dl_simple_ltoahex_inline( tmp, (unsigned long)(X)), 12); \ + if (add_a_newline) { \ + tmp[0]='\n'; \ + _dl_write(2, tmp, 1); \ + } \ +}; + +#define SEND_NUMBER_STDERR(X, add_a_newline) { \ + char tmp[13]; \ + _dl_write(2, (void *)_dl_simple_ltoahex_inline( tmp, (unsigned long)(X)), 12); \ + if (add_a_newline) { \ + tmp[0]='\n'; \ + _dl_write(2, tmp, 1); \ + } \ +}; extern int _dl_fdprintf(int, const char *, ...); extern char * _dl_library_path; extern char * _dl_not_lazy; -- cgit v1.2.3