aboutsummaryrefslogtreecommitdiff
path: root/ld/testplug4.c
diff options
context:
space:
mode:
authorAditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com>2023-02-17 09:07:44 -0600
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2023-02-17 20:12:06 +0100
commit7a2a5ff865bead782393897fc5fde47def30dad4 (patch)
tree09fadd40f5e43094650ca8a122ae5285915791f5 /ld/testplug4.c
parentfe0431855aba332f12ef80b0af65d5a6653f9c96 (diff)
downloadgdb-7a2a5ff865bead782393897fc5fde47def30dad4.zip
gdb-7a2a5ff865bead782393897fc5fde47def30dad4.tar.gz
gdb-7a2a5ff865bead782393897fc5fde47def30dad4.tar.bz2
Fix multi-threaded debugging under AIX
Multi-threaded debugging using the libpthdebug debug interface is currently broken due to multiple issues. When debugging a single inferior, we were getting assertion failures in get_aix_thread_info as no tp->priv structure was allocated for the main thread. We fixed this by switching the main thread from a (pid, 0, 0) ptid_t to a (pid, 0, tid) ptid_t and allocaing the tp->priv structure in sync_threadlists. As a result, the switch_to_thread call in pdc_read_data could now fail since the main thread no longer uses (pid, 0, 0). So we replaced the call by only switching inferior_ptid, the current inferior, and the current address space (like proc-service.c). Add similar switching to pdc_write_data where it was missing completely. When debugging multiple inferiors, an additional set of problems prevented correct multi-threaded debugging: First of all, aix-thread.c used to have a number of global variables holding per-inferior information. We switched hese to a per-inferior data structure instead. Also, sync_threadlists was getting confused as we were comparing the list of threads returned by libpthdebug for *one* process with GDB's list of threads for *all* processes. Now we only use he GDB threads of the current inferior instead. We also skip calling pd_activate from pd_enable if that in_initial_library_scan flag is true for the current inferior. Finally, the presence of the thread library in any but the first inferior was not correctly detected due to a bug in solib-aix.c, where the BFD file name for shared library members was changed when the library was loaded for the first time, which caused the library to no longer be recognized by name when loaded a second time.
Diffstat (limited to 'ld/testplug4.c')
0 files changed, 0 insertions, 0 deletions