I'm developing a shared library for Linux that spawns some threads I want to label in the debugger.
I've read this can be done by writing to /proc/[PID]/tasks/[TID]/comm, but this isn't working (I'm targeting an older libc). I also want to be able to assign names longer than the comm limit.
My plan was to auto-load a Python script to do this by placing it in the .debug_gdb_scripts section.
However I want to strip debug information besides the script and what it needs. I've tried using the --keep-symbol option but all of the debug sections (include .debug_gdb_scripts) are still removed.
Is there some way to keep these?