Reputation: 850
I'm writing a JIT that compiles c fragments using libtcc to an ELF object (output type TCC_OUTPUT_OBJ
) with dwarf-5 debug info, loads the resulting ELF object manually (mapping, relocating and linking with the process image, resolving symbols from the process image but not exporting any back). I plan to let GDB know about the loaded ELF using its JIT interface.
The JIT ELF objects are ephemeral, and are unmapped and freed when their reference counts (from other objects) drop to zero, and the c source for them is typically machine generated and doesn't exist in any file.
My question is: is there any way to provide GDB with the generated c source code in memory rather than having to maintain the active JIT ELF objects' source code in temporary files (with all the cleanup concerns that implies)?
Upvotes: 3
Views: 47