vc66vcc

vc66vcc

0个粉丝

2

问答

0

专栏

0

资料

vc66vcc  发布于  2016-11-29 09:55:13
采纳率 0%
2个问答
5758

valgrind 3535平台移植

 
最近同事需求内存检测工具,打算在HI3536 Hi3535等平台上移植一下valgrind。
移植valgrind-3.12.0到最后挂载程序运行是都提示Illegal instruction

以3535平台为例,移植过程参考网友的http://blog.csdn.net/lizhangping/article/details/51833997这个帖子

解决了valgrind failed to start tool 'memcheck' for platform 'arm-linux': not a direcory问题by
    export VALGRIND_LIB=XXX/../valgrind/lib/valgrind
解决了/lib/下so为strip后的问题,valgrind必须使用为裁剪过的库
     从SDK中找到为裁剪的so文件替换文件系统中已裁剪过的动态库,重新制作了squash的文件文件系统

带-g编译了一个内存泄漏的小demo,挂着跑,出现如下问题:
# ./valgrind ../hello
valgrind: failed to start tool 'memcheck' for platform 'arm-linux': No such file or directory
# export VALGRIND_LIB=/mnt/valgrind/lib/valgrind
# ./valgrind ../hello
==695== Memcheck, a memory error detector
==695== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==695== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==695== Command: ../hello
==695==
==695==
==695== Process terminating with default action of signal 4 (SIGILL)
==695==  Illegal opcode at address 0x38092674
==695==    at 0x4000790: ??? (in /lib/ld-2.11.1.so)
==695==
==695== HEAP SUMMARY:
==695==     in use at exit: 0 bytes in 0 blocks
==695==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==695==
==695== All heap blocks were freed -- no leaks are possible
==695==
==695== For counts of detected and suppressed errors, rerun with: -v
==695== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction


尝试过的解决方法
1.观察valgrind的make过程发现 -fno-builtin  -marm -mcpu=cortex-a8  -O2 -g
  查看3535编译平台信息CFLAGS += -march=armv7-a -mcpu=cortex-a9
  将所有Makefile中cortex-a8 改为cortex-a9 shell脚本如下
  sed -i "s/cortex-a8/cortex-a9/g" `grep "cortex-a8" -rl ./`
  观察到make时 cortex-a8 已被改为cortex-a9
  但是问题依旧。

查资料查到valgrind支持armv7 以上平台,但是出现这个操作码不识别的情况是什么原因,平台架构都已经配置正确了啊。 有移植成功的或者有怀疑对象的童鞋欢迎留言指导。先行谢过。
我来回答
回答7个
时间排序
认可量排序

vc66vcc

0个粉丝

2

问答

0

专栏

0

资料

vc66vcc 2016-11-29 10:06:04
认可0
本帖最后由 vc66vcc 于 2016-11-29 10:15 编辑

文档中写到支持armv7-a指令。
On ARM, essentially the entire ARMv7-A instruction set is supported, in both ARM and Thumb mode. ThumbEE and Jazelle are not supported. NEON, VFPv3 and ARMv6 media support is fairly complete.

qq1330885580

0个粉丝

0

问答

0

专栏

0

资料

qq1330885580 2016-12-02 17:26:44
认可0
请问下,您的问题解决了?

qq1330885580

0个粉丝

0

问答

0

专栏

0

资料

qq1330885580 2016-12-02 17:29:59
认可0
我参照你所说的那个文档进行了移植,结果拷到板子运行程序,总是提示如下信息(任何一个程序都提示如下信息),不知能否给与指点?,运行的提示信息如下:
# valgrind ./BackTraceTest
==3468== Memcheck, a memory error detector
==3468== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==3468== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==3468== Command: ./BackTraceTest
==3468==
==3468== error 22 Invalid argument
==3468== error VG_(am_shared_mmap_file_float_valgrind) /tmp/vgdb-pipe-shared-mem-vgdb-3468-by-root-on-???

yzhiju

0个粉丝

12

问答

0

专栏

0

资料

yzhiju 2016-12-02 17:32:44
认可0
同楼主问题一样啊 :Q

ebainar

0个粉丝

7

问答

0

专栏

0

资料

ebainar 2017-01-12 16:59:47
认可0
此文有重要参考意义:   [url]http://blog.csdn.net/jiazhen/article/details/50588608[/url]

blacktangel

0个粉丝

12

问答

0

专栏

0

资料

blacktangel 2017-05-03 15:49:16
认可0
我也遇到了相同的问题。3535 上的编译和执行,我用的两个版本 一个是  valgrind-3.12.0 另一个是 valgrind-3.8.1  交叉编译器是用glibc的

Takin

1个粉丝

41

问答

0

专栏

0

资料

Takin 2017-05-06 17:13:33
认可0
这个移植运行占用的空间大不大?
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

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

Markdown 语法

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

举报类型

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

详细说明

易百纳技术社区