qn1542107599

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599  发布于  2018-11-13 20:23:32
采纳率 0%
4个问答
1810

无法在3535板卡上定位core文件错误代码行

 
arm-hisiv100nptl-linux-g++编译生成的程序,在3535板卡上,

通过gdb-arm-hisiv100nptl-linux无法定位core文件错误代码行。

(1)编译测试代码。并拷贝到3535板卡上

arm-hisiv100nptl-linux-g++ -g -g3 -O2 -Wall -DDEBUG aaa.cpp -o testnew

#include
#include

int main()
{
        char *ptest = NULL;
        strcpy(ptest, "hello");
    return 0;
}

(2)3535板卡上打开写core文件功能,并运行test程序生成core文件
ulimit -c unlimited

ulimit -a

./testnew  生成 core文件

(3)在3535板卡上,通过gdb-arm-hisiv100nptl-linux查看core文件。

# ./gdb-arm-hisiv100nptl-linux testnew 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 "arm-hisiv100nptl-linux"...
Reading symbols from /lib/libstdc++.so.6...Error while reading shared library symbols:
Dwarf Error: wrong version in compilation unit header (is 0, should be 2) [in module /lib/libstdc++.so.6]
Reading symbols from /lib/libm.so.0...done.
Loaded symbols for /lib/libm.so.0
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.0...done.
Loaded symbols for /lib/libc.so.0
Reading symbols from /lib/ld-uClibc.so.0...done.
Loaded symbols for /lib/ld-uClibc.so.0
Reading symbols from /lib/libstdc++.so.6...Error while reading shared library symbols:
Dwarf Error: wrong version in compilation unit header (is 0, should be 2) [in module /lib/libstdc++.so.6]
Core was generated by `./testnew'.
Program terminated with signal 11, Segmentation fault.
[New process 1188]
#0  0xb6df1b2c in ?? () from /lib/libc.so.0

(gdb) bt full
#0  0xb6df1b2c in ?? () from /lib/libc.so.0
No symbol table info available.
Cannot access memory at address 0x0

(gdb) bt     
#0  0xb6df1b2c in ?? () from /lib/libc.so.0
我来回答
回答14个
时间排序
认可量排序

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-13 20:24:41
认可0
想通过gdb-arm-hisiv100nptl-linux,定位到ore文件的错误代码行。

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 09:13:53
认可0
是版本不对,还是缺少什么lib文件?

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 10:57:37
认可0
没人来解答问题啊。。。

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 11:20:49
认可0
arm-hisiv100nptl-linux-strip主要用来干什么用的?

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 13:24:58
认可0
# 错误信息
Dwarf Error: wrong version in compilation unit header (is 0, should be 2) [in module /lib/libstdc++.so.6]

# gdb-arm-hisiv100nptl-linux版本
Hi3535_SDK_V1.0.3.0/osdrv/tools/board_tools/gdb/gdb-arm-hisiv100nptl-linux

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 15:20:44
认可0
# arm-hisiv100nptl-linux-g++的版本
gcc-4.4-2010q1

# gdb的版本
GNU gdb 6.8

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 15:39:35
认可0
######################################

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 15:40:12
认可0

######################################

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 15:59:10
认可0

######################################

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 16:00:04
认可0
重新换了gdb版本,不再提示上面的错误,在3535板卡上,还是定位不到core文件的错误代码行。

///////////////////////////////////////////////
# arm-hisiv100nptl-linux-g++的版本
gcc-4.4-2010q1

# gdb-arm-hisiv100nptl-linux的版本
GNU gdb 6.8
///////////////////////////////////////////////
//aaa.cpp 测试文件
#include
#include
int main()
{
    char *ptest = NULL;
    strcpy(ptest, "hello");
    return 0;
}

# arm-hisiv100nptl-linux-g++编译测试代码,
arm-hisiv100nptl-linux-g++ -g -Wall aaa.cpp -o test123
///////////////////////////////////////////////
test程序拷贝到3535板卡上,生成core文件,

ulimit -c unlimited

ulimit -a

./test123

通过gdb-arm-hisiv100nptl-linux调试core文件。
./gdb-arm-hisiv100nptl-linux test123 core
///////////////////////////////////////////////
调试信息如下:

# ./gdb-arm-hisiv100nptl-linux test123 core
GNU gdb 6.8(gdb版本号)
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 "arm-hisiv100nptl-linux"...
Reading symbols from /lib/libstdc++.so.6...done.
Loaded symbols for /lib/libstdc++.so.6
Reading symbols from /lib/libm.so.0...done.
Loaded symbols for /lib/libm.so.0
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.0...done.
Loaded symbols for /lib/libc.so.0
Reading symbols from /lib/ld-uClibc.so.0...done.
Loaded symbols for /lib/ld-uClibc.so.0
Core was generated by `./test123'.
Program terminated with signal 11, Segmentation fault.
[New process 28832]
#0  0xb6dc5b2c in ?? () from /lib/libc.so.0

(gdb) bt
#0  0xb6dc5b2c in ?? () from /lib/libc.so.0

(gdb) bt
#0  0xb6dc5b2c in ?? () from /lib/libc.so.0

(gdb) bt full
#0  0xb6dc5b2c in ?? () from /lib/libc.so.0
No symbol table info available.

(gdb) bt full
#0  0xb6dc5b2c in ?? () from /lib/libc.so.0
No symbol table info available.

(gdb) where
#0  0xb6dc5b2c in ?? () from /lib/libc.so.0

(gdb) where
#0  0xb6dc5b2c in ?? () from /lib/libc.so.0
///////////////////////////////////////////////

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 16:09:02
认可0
之前版本gdb错误信息
Dwarf Error: wrong version in compilation unit header (is 0, should be 2)

0是 g++ 的Dwarf 对应的版本编号,

2是gdb 的Dwarf 对应的版本编号。

换了一个gdb版本,虽然没有错误信息,但是还是看不到core文件的错误代码行。

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2018-11-14 17:31:26
认可0
重启一下电脑和板卡就好了,现在能定位到core文件的错误代码行了。

hero

0个粉丝

1

问答

0

专栏

0

资料

hero 2018-11-14 08:32:59
认可0
:lol:lol:lol:lol

qn1542107599

0个粉丝

4

问答

0

专栏

0

资料

qn1542107599 2019-04-23 06:28:10
认可0
??????
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
相关问答
无更多相似问答 去提问
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区