diff options
author | Pedro Alves <palves@redhat.com> | 2017-09-13 11:43:15 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-09-13 11:43:15 +0100 |
commit | bb276fc2244d56b254728fb54fbae1f517d401f2 (patch) | |
tree | 196da2331e060b2e74bb23c34bfa6510037a8344 /gdb/proc-service.c | |
parent | 9f2815a079efa19ae520293c455ec2910a9879ac (diff) | |
download | binutils-gdb-users/palves/tls-nonthreaded.tar.gz |
Use libthread_db.so with non-threaded programs, for TLSusers/palves/tls-nonthreaded
(This is a hack for experimentation.)
Diffstat (limited to 'gdb/proc-service.c')
-rw-r--r-- | gdb/proc-service.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/proc-service.c b/gdb/proc-service.c index 4620fea21a2..940993c9d07 100644 --- a/gdb/proc-service.c +++ b/gdb/proc-service.c @@ -102,6 +102,8 @@ ps_xfer_memory (const struct ps_prochandle *ph, psaddr_t addr, } +extern unsigned int libthread_db_debug; + /* Search for the symbol named NAME within the object named OBJ within the target process PH. If the symbol is found the address of the symbol is stored in SYM_ADDR. */ @@ -119,9 +121,20 @@ ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, /* FIXME: kettenis/2000-09-03: What should we do with OBJ? */ bound_minimal_symbol ms = lookup_minimal_symbol (name, NULL, NULL); if (ms.minsym == NULL) - return PS_NOSYM; - - *sym_addr = core_addr_to_ps_addr (BMSYMBOL_VALUE_ADDRESS (ms)); + { + if (libthread_db_debug) + fprintf_unfiltered (gdb_stdlog, + "ps_pglobal_lookup: name=\"%s\" => PS_NOSYM\n", + name); + return PS_NOSYM; + } + + CORE_ADDR ms_addr = BMSYMBOL_VALUE_ADDRESS (ms); + if (libthread_db_debug) + fprintf_unfiltered (gdb_stdlog, + "ps_pglobal_lookup: name=\"%s\" => PS_OK, %s\n", name, + paddress (target_gdbarch (), ms_addr)); + *sym_addr = core_addr_to_ps_addr (ms_addr); return PS_OK; } |