]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Pass down ptid in bsd_uthread_ops layer
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 7 Feb 2017 22:04:38 +0000 (17:04 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 7 Mar 2017 15:56:40 +0000 (10:56 -0500)
commit825c8a4e88a55b027e8b76d2a64f527a103fd68b
tree0cdd63fa4e6a90bd8fffc885fe1bd3ef1e81394e
parent35e8c540b1014bd4a8baa3233886e1342b14ec5d
Pass down ptid in bsd_uthread_ops layer

The following patches will add a ptid_t parameter to
target_fetch_registers and target_store_registers.  In the bsd uthread
implementations, there's another indirection layer in the form of
bsd_uthread_ops.  This patch adds the same ptid_t parameter to this
layer, so that the implementations of bsd_uthread_ops don't rely on the
current value of inferior_ptid.

From what I understand, the register values of the userspace threads
(uthreads) are stored in the memory of the "real" thread to which those
userspace threads are mapped.  Therefore, the implementation of these
register fetching/storing functions consists of reading/writing memory.
Since the memory read/write functions still rely on the value of
inferior_ptid to know which thread to read/write memory from/to, it is
necessary to set and restore inferior_ptid in those functions (e.g.
amd64fbsd_supply_uthread).  Eventually, when we add a ptid_t parameter
to the memory functions, this should go away as we'll simply pass down
the ptid parameter.

gdb/ChangeLog:

* amd64-fbsd-tdep.c (amd64fbsd_supply_uthread,
amd64fbsd_collect_uthread): Add ptid parameter, set and restore
inferior_ptid.
* amd64-obsd.tdep.c (amd64fbsd_collect_uthread,
amd64obsd_supply_uthread): Likewise.
* bsd-uthread.c (bsd_uthread_fetch_registers): Pass ptid value
to supply_uthread.
(bsd_uthread_store_registers): Pass ptid value to
collect_uthread.
* bsd-uthread.h (bsd_uthread_supply_register_ftype,
bsd_uthread_collect_register_ftype): Add ptid parameter.
* i386-fbsd-tdep.c (i386fbsd_supply_uthread,
i386fbsd_collect_uthread): Add ptid parameter, set and restore
inferior_ptid.
* i386-obsd-tdep.c (i386obsd_supply_uthread,
i386obsd_collect_uthread): Add ptid parameter, set and restore
inferior_ptid.
* sparc-obsd-tdep.c (sparc32obsd_supply_uthread,
sparc32obsd_collect_uthread): Add ptid parameter, set and restore
inferior_ptid.
* sparc-obsd-tdep.c (sparc64obsd_supply_uthread,
sparc64obsd_collect_uthread): Add ptid parameter, set and restore
inferior_ptid.
gdb/amd64-fbsd-tdep.c
gdb/amd64-obsd-tdep.c
gdb/bsd-uthread.c
gdb/bsd-uthread.h
gdb/i386-fbsd-tdep.c
gdb/i386-obsd-tdep.c
gdb/sparc-obsd-tdep.c
gdb/sparc64-obsd-tdep.c