Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gdb 在发布模式下分析应用程序的调试器输出_Gdb_Wine_Stack Dump - Fatal编程技术网

Gdb 在发布模式下分析应用程序的调试器输出

Gdb 在发布模式下分析应用程序的调试器输出,gdb,wine,stack-dump,Gdb,Wine,Stack Dump,我使用Ubuntu12.10下的i686-w64-mingw32-GCC4.7.2交叉编译器开发了一个win32应用程序 当我运行在发布模式下编译的应用程序时,它崩溃了,我可能会收到如下输出 我想知道如何解释它?我能从中得到一些有用的信息吗?例如,可以从堆栈转储获取源代码中的行吗 wine: Unhandled page fault on read access to 0x00006c11 at address 0x401cb1 (thread 0009), starting debugger.

我使用Ubuntu12.10下的i686-w64-mingw32-GCC4.7.2交叉编译器开发了一个win32应用程序

当我运行在发布模式下编译的应用程序时,它崩溃了,我可能会收到如下输出

我想知道如何解释它?我能从中得到一些有用的信息吗?例如,可以从堆栈转储获取源代码中的行吗

wine: Unhandled page fault on read access to 0x00006c11 at address 0x401cb1 (thread 0009), starting debugger...
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
Unhandled exception: page fault on read access to 0x00006c11 in 32-bit code (0x00401cb1).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:00401cb1 ESP:007af750 EBP:007af9c8 EFLAGS:00010206(  R- --  I   - -P- )
 EAX:00406a20 EBX:00000004 ECX:00006c11 EDX:00006c11
 ESI:00000068 EDI:00110440
Stack dump:
0x007af750:  007af7df 00000030 00000043 00000004
0x007af760:  00142fc0 3ff54e5b 00406a20 3ff57208
0x007af770:  0207251c 3ff4cb7d 02072574 3ff51f7f
0x007af780:  ea9e6eeb 3ff49b90 e09fe868 3ff4c562
0x007af790:  00006c11 00000045 0209c5b4 007afa0c
0x007af7a0:  00000004 019b0000 007af7f8 00110000
000c: sel=0067 base=00000000 limit=00000000 16-bit --x
Backtrace:
=>0 0x00401cb1 in analyser (+0x1cb1) (0x007af9c8)
  1 0x00536147 in analyser (+0x136146) (0x007afd98)
  2 0x004013fa __tmainCRTStartup+0x279() [/home/ruben/mingw-w64/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:313] in analyser (0x007afe70)
  3 0x7b859ddc call_process_entry+0xb() in kernel32 (0x007afe88)
  4 0x7b85b04f in kernel32 (+0x4b04e) (0x007afec8)
  5 0x7bc71d90 call_thread_func_wrapper+0xb() in ntdll (0x007afed8)
  6 0x7bc7486d call_thread_func+0x7c() in ntdll (0x007affa8)
  7 0x7bc71d6e RtlRaiseException+0x21() in ntdll (0x007affc8)
  8 0x7bc49f4e call_dll_entry_point+0x61d() in ntdll (0x007affe8)
0x00401cb1: movl    0x0(%edx),%eax
Modules:
Module  Address         Debug info  Name (89 modules)
PE    240000-  273000   Deferred        ssleay32
PE    280000-  37e000   Deferred        libeay32
...
我想知道如何解释它

看起来已经很清楚了:您的代码,更准确地说:地址
0x401cb1
处的指令试图解除地址
0x00006c11
处的内存引用。该内存访问无效,并触发了页面错误

我能从中得到一些有用的信息吗

是的,如上所述

例如,可以从堆栈转储获取源代码中的行吗

wine: Unhandled page fault on read access to 0x00006c11 at address 0x401cb1 (thread 0009), starting debugger...
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
Unhandled exception: page fault on read access to 0x00006c11 in 32-bit code (0x00401cb1).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:00401cb1 ESP:007af750 EBP:007af9c8 EFLAGS:00010206(  R- --  I   - -P- )
 EAX:00406a20 EBX:00000004 ECX:00006c11 EDX:00006c11
 ESI:00000068 EDI:00110440
Stack dump:
0x007af750:  007af7df 00000030 00000043 00000004
0x007af760:  00142fc0 3ff54e5b 00406a20 3ff57208
0x007af770:  0207251c 3ff4cb7d 02072574 3ff51f7f
0x007af780:  ea9e6eeb 3ff49b90 e09fe868 3ff4c562
0x007af790:  00006c11 00000045 0209c5b4 007afa0c
0x007af7a0:  00000004 019b0000 007af7f8 00110000
000c: sel=0067 base=00000000 limit=00000000 16-bit --x
Backtrace:
=>0 0x00401cb1 in analyser (+0x1cb1) (0x007af9c8)
  1 0x00536147 in analyser (+0x136146) (0x007afd98)
  2 0x004013fa __tmainCRTStartup+0x279() [/home/ruben/mingw-w64/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:313] in analyser (0x007afe70)
  3 0x7b859ddc call_process_entry+0xb() in kernel32 (0x007afe88)
  4 0x7b85b04f in kernel32 (+0x4b04e) (0x007afec8)
  5 0x7bc71d90 call_thread_func_wrapper+0xb() in ntdll (0x007afed8)
  6 0x7bc7486d call_thread_func+0x7c() in ntdll (0x007affa8)
  7 0x7bc71d6e RtlRaiseException+0x21() in ntdll (0x007affc8)
  8 0x7bc49f4e call_dll_entry_point+0x61d() in ntdll (0x007affe8)
0x00401cb1: movl    0x0(%edx),%eax
Modules:
Module  Address         Debug info  Name (89 modules)
PE    240000-  273000   Deferred        ssleay32
PE    280000-  37e000   Deferred        libeay32
...
当然:在发布模式下构建应用程序时,添加
-g
标志。然后

addr2line -fe analyser 0x401cb1

应该告诉您地址
0x401cb1
对应的文件/行。

特别感谢您指出我不知道的addr2行。