tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ptrace(2) interface for TLSBASE



On 04.12.2019 19:11, Jason Thorpe wrote:
> 
> 
>> On Dec 4, 2019, at 8:47 AM, Kamil Rytarowski <n54%gmx.com@localhost> wrote:
>>
>> Today it's missing.. do we need it in core files?
> 
> Seems like you would absolutely need it in core files, otherwise the debugger won't know what it is when performing a post-mortem.
> 
> If we add a ptrace accessor a'la Linux, then it fits nicely into the existing model we have for ELF core files:
> 
>  * We also use ptrace(2) request numbers (the ones that exist in
>  * machine-dependent space) to identify register info notes.  The
>  * info in such notes is in the same format that ptrace(2) would
>  * export that information.
> 
> -- thorpej
> 

OK, I will add a core(5) file addition with TLS base
("PT_GET_THREAD_AREA@nnn").

While I will also include a thread name: PT_[SG]ET_THREAD_NAME.

We currently use sysctl to retrieve it from a living process, but miss
in core files. Today using sysctl is more complex than it needs to be
[1] and there is no direct translation to core(5) files.

[1]
https://github.com/llvm/llvm-project/blob/master/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp#L158

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index