<div dir="ltr"><div dir="ltr"><div><br></div>I've gotten llvm.experimental.stackmaps working on macOS to locate a structure that I spill register arguments into so that I can recover them for backtraces.<div><br></div><div>I generate a stackmap entry for every function that I compile and then compile my code to object files and link them into a .so dynamic library.  I load this library into the Clasp executable and the functions become available.  I'm trying to make the stackmap information available as well - I can see that it is in the ELF file using 'readelf'. I can also find it mmap'd into memory using a combination of readelf, peeking at the /proc/<pid>/maps file, gdb and arithmetic.</div><div><br></div><div>On linux,however, I can't figure out how to get access to the llvm_stackmap section of an ELF .so file that is mmap'd into memory.  I can use dl_iterate_phdr to iterate over the ELF segments - but there doesn't appear to be any way to access the .llvm_stackmap section, which IS loaded and relocated in memory (I can dump it with gdb and it's all ready to go if I could figure out its start and end).  I could read the ELF file on disk and figure out where the llvm_stackmap section is in the "section header table" - but that seems really inelegant to go back to disk to figure out where something is in memory.</div><div><br></div><div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="font-size:small">Christian Schafmeister</div><div style="font-size:small">Professor, Chemistry Department</div><div style="font-size:small">Temple University</div></div></div></div></div></div>