内存调试工具electric-fence 使用(各种架构方法类似)

dpkg 的命令可用于查看 Debian/ Ubuntu 操作系统是 32 位还是 64 位,此命令只适用于基于 Debian 和 Ubuntu 的 Linux 发行版。

root@Ubuntu-core:~#     dpkg --print-architecture
armhf


我嵌入式系统是armhf,对应的平台electric-fence.deb文件链接如下

https://packages.debian.org/sid/armhf/electric-fence/download


复制到开发板上,运行命令: dpkg -i electric-fence_2.2.5_armhf.deb

查看electric-fence的安装目录

root@Ubuntu-core:/tmp# dpkg -L electric-fence
/.
/usr
/usr/lib
/usr/lib/libefence.a
/usr/lib/libefence.so.0.0
/usr/share
/usr/share/doc
/usr/share/doc/electric-fence
/usr/share/doc/electric-fence/README
/usr/share/doc/electric-fence/README.Debian
/usr/share/doc/electric-fence/README.gdb
/usr/share/doc/electric-fence/changelog.gz
/usr/share/doc/electric-fence/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/electric-fence
/usr/share/man
/usr/share/man/man3
/usr/share/man/man3/libefence.3.gz
/usr/lib/libefence.so
/usr/lib/libefence.so.0

把/usr/lib/libefence.a  复制到项目的lib目录

编译的时候加上-lefence 即可

你可能感兴趣的:(内存调试工具electric-fence 使用(各种架构方法类似))