当前位置: 技术问答>linux和unix
gdb调试世纪难题,call_gmon_start () 报段出错
来源: 互联网 发布时间:2016-12-22
本文导语: root@ubuntu:/arm# arm-none-linux-gnueabi-gdb .bencode.so core GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRA...
root@ubuntu:/arm# arm-none-linux-gnueabi-gdb .bencode.so core
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
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 "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi"...
Core was generated by `.bencode.so'.
Program terminated with signal 11, Segmentation fault.
[New process 1598]
#0 0x00000000 in call_gmon_start ()
(gdb) Quit
还没进入主函数,GDB就挂了,GCC编译加了-G,没有用优化和-PG。
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
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 "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi"...
Core was generated by `.bencode.so'.
Program terminated with signal 11, Segmentation fault.
[New process 1598]
#0 0x00000000 in call_gmon_start ()
(gdb) Quit
还没进入主函数,GDB就挂了,GCC编译加了-G,没有用优化和-PG。
|
是不是MAKEFILE里面编译的时候有参数-SHARED。
|
bt看下输出什么
如果没加-pg,确实很奇怪、
一般情况下不会有call_gmon_start
看看使用你交叉工具链的
strings bencode.so
objdump -t bencode.so
里面显示符号里有call_gmon_start么?
如果没加-pg,确实很奇怪、
一般情况下不会有call_gmon_start
看看使用你交叉工具链的
strings bencode.so
objdump -t bencode.so
里面显示符号里有call_gmon_start么?
|
还没进main就挂,感觉上应该是环境问题,呵呵,
可以试试看看检查检查环境设置
可以试试看看检查检查环境设置
|
如果真有call_gmon_start
那么没进main挂掉是有可能的