summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
diff options
context:
space:
mode:
authorGui Andrade <guiand@google.com>2020-07-22 16:48:51 +0000
committerGui Andrade <guiand@google.com>2020-07-22 17:29:41 +0000
commitf93b55a5ab9d15ee80532642cfa30f9fe8af72c3 (patch)
treea5efa817a90e426ec677b1642b7dc4db527c723f /lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
parent746b5fad5b53ddbc78d36a6b97dcaff7e52540b2 (diff)
[Sanitizers] Add interceptor for xdrrec_create
For now, xdrrec_create is only intercepted Linux as its signature is different on Solaris. The method of intercepting xdrrec_create isn't super ideal but I couldn't think of a way around it: Using an AddrHashMap combined with wrapping the userdata field. We can't just allocate a handle on the heap in xdrrec_create and leave it at that, since there'd be no way to free it later. This is because it doesn't seem to be possible to access handle from the XDR struct, which is the only argument to xdr_destroy. On the other hand, the callbacks don't have a way to get at the x_private field of XDR, which is what I chose for the HashMap key. So we need to wrap the handle parameter of the callbacks. But we can't just pass x_private as handle (as it hasn't been set yet). We can't put the wrapper struct into the HashMap and pass its pointer as handle, as the key we need (x_private again) hasn't been set yet. So I allocate the wrapper struct on the heap, pass its pointer as handle, and put it into the HashMap so xdr_destroy can find it later and destroy it. Differential Revision: https://reviews.llvm.org/D83358
Diffstat (limited to 'lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp')
0 files changed, 0 insertions, 0 deletions