tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] getting debug info for stack dumps


From: Yakov
Subject: [Tinycc-devel] getting debug info for stack dumps
Date: Fri, 25 May 2018 13:24:40 +0300

Hi,

I am using TCC as a backend for another programming language (my own), I need a stack trace functionality. I already ranted that backtrace and backtrace_symbols do not work with TCC for me, so I ended up writing my own backtrace() to get a list of return adresses, and then I am calling `objdump --dump` and parsing the output. This works well and gives me all the functionality that I need, but unfortunately calling objdump and parsing it's output is rather slow and dependency on objdump binary is not very portable and will make users life harder.

Is there a way to get a mapping from addresses to file names/line numbers in a fast and portable way with TinyC? I am even willing to modify TCC a little if that's needed (if I get a good hint on what exectly could be done about it).

My understanding is that TCC only generates Stabs debug info, am I correct? I could't find any library that would read stabs and creating own is frighening. After inspecting objdump.c source code, I found that they do not use any library to read stabs, all code is right in the same file where the 'int main()', which is discouraging. You cannot even isolate stabs related code.

So.. Any help with that? What are my options here? All I need is the nice stack dump done by the compiled program itself (with the original language file names and line numbers).

Thank you
Yash


reply via email to

[Prev in Thread] Current Thread [Next in Thread]