tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Stackdump for Windows


From: grischka
Subject: Re: [Tinycc-devel] Stackdump for Windows
Date: Mon, 13 Sep 2010 20:55:35 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Simon Lehmayr wrote:
Well, I need this info from a DLL...
Can I change tcc somehow to generate code to "print" this info when a crash occurs?

You'd need to borrow some code from tccrun.c plus write some additional
code so "rt_printline" can access the .stabs sections in the exe/dll
and then you'd put all that into a library that tcc would link into your
exe/dll if say -g is given.

Not trivial but possible, as running through gdb shows:

$ tcc -g test.c
$ gdb test.exe
GNU gdb 6.8
Copyright (C) 2008 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 "i686-pc-mingw32"...
(gdb) run
Starting program: test.exe
[New thread 3168.0x7f4]
Program received signal SIGSEGV, Segmentation fault.
0x00401057 in func () at test.c:22
22          *(int*)0 = x;
(gdb) bt
#0  0x00401057 in func () at test.c:22
#1  0x0040102d in main () at test.c:14
#2  0x00401103 in ?? ()
#3  0x00000001 in ?? ()
#4  0x001728d8 in ?? ()
#5  0x00171888 in ?? ()
#6  0x00000000 in ?? ()
(gdb) q

--- grischka


Simon




reply via email to

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