我的硬件平台是MIPS架构,调试环境为eclipse+gdb-7.5.
1.
交叉编译应用程序并下载到目标单板上,在目标单板上执行启动gdbserver
./gdbserver192.168.1.2:10000pthread_test
2.
PC端启动eclipse进入调试窗口,在单步执行的时候,碰到pthread_create函数后,提示以下错误信息:
Nosourceavailablefor"0x2ac21d38"
warning:GDBcan'tfindthestartofthefunctionat0x2ac21d38.
GDBisunabletofindthestartofthefunctionat0x2ac21d38
andthuscan'tdeterminethesizeofthatfunction'sstackframe.
ThismeansthatGDBmaybeunabletoaccessthatstackframe,or
theframesbelowit.
Thisproblemismostlikelycausedbyaninvalidprogramcounteror
stackpointer.
However,ifyouthinkGDBshouldsimplysearchfartherback
from0x2ac21d38forcodewhichlookslikethebeginningofa
function,youcanincreasetherangeofthesearchusingthe`set
heuristic-fence-post'command.
编译应用程序的时候已经加了“-g”。各位大侠帮忙给点建议,帮忙解决问题?谢谢!
附上我的代码:
void*fun(void*para)
{
while(1)
{
printf("runingthread...\n");
usleep(1000);
}
}
intmain()
{
pthread_tpid;
printf("teststart...\n");
pthread_create(&pid,NULL,fun,NULL);
getchar();
return0;
}
分 --> |