1.由于两个程序占用内存过大
利用应用程序后台运行 ,使用gdb跟踪
./dosbox & # &:后台运行
2.程序运行后使用ps查看系统进程号
1134 root 44368 S < ./dosbox
3.使用gdb 跟踪pid进程号
Gdb –pid=1134
4
出现段错误时候 使用bt命令出现如下信息 排错
Program received signal SIGSEGV,
Segmentation fault.
CBindGroup::ActivateBindList (this=<value
optimized out>, list=0x1edba08,
value=32767, ev_trigger=true) at sdl_mapper.cpp:1244
1244
sdl_mapper.cpp: No such file or directory.
in sdl_mapper.cpp
(gdb) bt
#0
CBindGroup::ActivateBindList (this=<value optimized out>,
list=0x1edba08,
value=32767, ev_trigger=true) at sdl_mapper.cpp:1244
#1
0x000f4c4c in CKeyBindGroup::CheckEvent (this=0x1ebff68,
event=0xbef0774c)
at sdl_mapper.cpp:502
#2 0x000eb494 in MAPPER_CheckEvent (event=0x0) at
sdl_mapper.cpp:2155
#3
0x000e6cd0 in GFX_Events () at sdlmain.cpp:1423
#4
0x0000cef8 in Normal_Loop () at dosbox.cpp:142
#5
0x0000cdc8 in DOSBOX_RunMachine () at dosbox.cpp:244
#6
0x00017988 in CALLBACK_RunRealInt (intnum=0 '\0') at callback.cpp:106
#7
0x001e57ac in DOS_Shell::Execute (this=<value optimized out>,
name=<value optimized out>, args=<value optimized out>)
at shell_misc.cpp:492
#8
0x001e2ce0 in DOS_Shell::DoCommand (this=0x1ee1128, line=0xbef099c3
"")
at shell_cmds.cpp:153
#9
0x001db3fc in DOS_Shell::ParseLine (this=0x1ee1128,
line=0xbef099b8 "ALADDIN.EXE") at shell.cpp:251
#10 0x001dca60 in DOS_Shell::Run
(this=0x1ee1128) at shell.cpp:323
#11 0x001dbff8 in SHELL_Init () at
shell.cpp:653
#12 0x001d2670 in Config::StartUp
(this=0x0) at setup.cpp:853
^C#13 0x000ea4f0 in
main (argc=<value optimized out>Quit
void MAPPER_CheckEvent(SDL_Event * event) {
printf("hxy
%s:event %x\n",__FUNCTION__,event);
if(event
== NULL)
return
;
for
(CBindGroup_it it=bindgroups.begin();it!=bindgroups.end();it++) {
if
((*it)->CheckEvent(event)) return;
}
}