tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] debug info broken


From: Michael Matz
Subject: Re: [Tinycc-devel] debug info broken
Date: Mon, 18 Dec 2017 20:24:52 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hi,

On Sun, 17 Dec 2017, foobar wrote:

> Hi list,
> 
> First of all, thanks for the release!
> I've built 0.9.27 for x86_64 and tried a see if debugging works, but:
> 
> $ cat true.c 
> int main() { return 0; }
> 
> $ tcc true.c -g -o true

Above works for me (with 0.9.27 release and others).  The .stabs debug 
info of the executable says:

% objdump -g true
true.c:
<undefined> main ()
{ /* 0x4002c0 */
  /* file /matz/git/tinycc/true.c line 1 addr 0x4002c0 */
  /* file /matz/git/tinycc/true.c line 1 addr 0x4002cb */
} /* 0x4002d2 */

> $ gdb ./true
> GNU gdb (GDB) 7.6.2
> Copyright (C) 2013 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-unknown-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from ./true...DW_FORM_strp pointing outside of .debug_str 
> section [in module /home/rofl/hardcore-utils/true]

Maybe this is the problem in that gdb doesn't want to read debug info 
further after seeing this error?  Doesn't happen for me and must come from 
one of the system .o files (or static C library parts) as tcc doesn't use 
.debug_str (no dwarf in tcc).

> (gdb) b main
> Breakpoint 1 at 0x0 (2 locations)

And for me, as expected:

(gdb) b main
Breakpoint 1 at 0x4002cb: file true.c, line 1.

> IMO the perfect niche for using TCC is for development, since you can 
> rebuild entire projects in the fraction of time it takes with GCC, but 
> if debugging the result is impossible, that's quite a bummer.

TCCs debug information only contains line numbers and symbols for 
functions.  There's no info about local variables (for instance), so the 
debug experience won't be very great in any case.  But the above at least 
should work.


Ciao,
Michael.



reply via email to

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