On 10/7/24 23:16, Max Logaev wrote:
Hello!
I noticed that with debug options TCC does not generate ".debug_frame" (described by the DWARF
standard) or similar extended ".eh_frame" + ".eh _framehdr"
(https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html).
And the second one seems critical. I encountered this problem because of
incorrect work of bactrace() from glibc
(https://www.gnu.org/software/libc/manual/html_node/Backtraces.html).
The thing is that bactrace() uses unwinding functions from the libgcc library
for backtracing. And the libgcc library uses .eh_frame.
I think that this debug information would be useful provided that TCC supports
several architectures and unwinding for each architecture may differ.
Also, I do not quite understand how the "-bt" option works. It seems that this
is something completely non-standard.
I would like to know if such functionality is needed or is it redundant? I just
would like to tackle this task.
I added support for .eh_frame and .eh_framehdr.
backtrace() should now work on most targets.
Herman
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel