You can also use backtrace-mingw:

http://code.google.com/p/backtrace-mingw/

a much more recent version (public domain) is found here:

http://wiki.eduke32.com/wiki/Building_EDuke32_on_Windows
http://wiki.eduke32.com/wiki/Acquiring_the_EDuke32_Source_Code  (see daily
snapshots)

compile it with:

gcc -O1 -shared -Wall -o backtrace.dll backtrace.c -I<PathTo>/include/
-L<PathTo>/lib -lbfd -liberty -limagehlp

create backtracetest_test.c

    #include <windows.h>

    static void
    foo()
    {
        int *f=NULL;
        *f = 0;
    }

    static void
    bar()
    {
        foo();
    }

    int
    main()
    {
        LoadLibraryA("backtrace.dll");
        bar();

        return 0;
    }

compile with debuugging symbols and run it:

Caught exception 0xC0000005 at 0x0000000000401504
0x0000000000401504 : C:\<path>\backtracetest.exe :
C:\<path>/backtracetest_test.c (7) : in function (foo)
0x000000000040151D : C:\<path>\backtracetest.exe :
C:\<path>/backtracetest_test.c (13) : in function (bar)
0x0000000000401546 : C:\<path>\backtracetest.exe :
C:\<path>/backtracetest_test.c (22) : in function (main)
0x00000000004013B5 : C:\<path>\backtracetest.exe : crtexe.c
0x00000000004014E8 : C:\<path>\backtracetest.exe : crtexe.c
0x00000000766059ED : C:\WINDOWS\system32\kernel32.dll : BaseThreadInitThunk
0x0000000076CFBA01 : C:\WINDOWS\SYSTEM32\ntdll.dll : RtlUserThreadStart
Wed Jun 25 17:49:40 2014

---------------
- carlkl


2014-10-15 14:35 GMT+02:00 Óscar Fuentes <o...@wanadoo.es>:

> Kai Tietz <ktiet...@googlemail.com> writes:
>
> > for sure there are some issues in gdb about debugging pe and pe+ coff
> > executables in some scenarios.  For pe+ ones the backtrace shown by
> > gdb is much more reliable then for the 32-bit case, as pe+ makes use
> > of the function-tables, which helps on unwinding pretty much.
> > Nevertheless there are some issues when call-stack gets corrupted, or
> > - as here shown - jump to 0x0 address happens.  As for both cases the
> > unwinding doesn't work anymore correct.
>
> Right. If the stack is messed, there is no debugger that can show a
> reliable trace. I've seen that on Visual Studio lots of times.
>
> If the problem is gdb, you can try an alternative method for getting an
> stack trace. drmingw, for instance, which is available on the MSYS2
> repo.
>
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to