相关疑难解决方法(0)

Valgrind没有显示行号,尽管-g标志(在Ubuntu 11.10/VirtualBox上)

我正在关注'学习C艰难之路',特别是关于Valgrind的章节.本章给出了一个故意错误的程序来展示Valgrind的工作原理.

当我在Valgrind下运行练习时,我没有在我的堆栈跟踪中获得行号,只是'(在主要下面)'的错误.

肯定用-g标志编译.

我的Valgrind输出如下:

djb@twin:~/projects/Learning/C$ valgrind ./ex4
==5190== Memcheck, a memory error detector
==5190== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==5190== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info
==5190== Command: ./ex4
==5190== 
==5190== Use of uninitialised value of size 4
==5190==    at 0x4078B2B: _itoa_word (_itoa.c:195)
==5190==    by 0x407CE55: vfprintf (vfprintf.c:1619)
==5190==    by 0x40831DE: printf (printf.c:35)
==5190==    by 0x4052112: (below main) (libc-start.c:226)
==5190== 
==5190== Conditional jump or move depends …
Run Code Online (Sandbox Code Playgroud)

c valgrind

64
推荐指数
2
解决办法
5万
查看次数

如何告诉gcc(或ld)链接到标准c和c ++库的调试版本

我有libstdc ++和libc等的调试版本,并且想链接它们。它们位于/ usr / lib / debug而不是/ usr / lib。有任何想法吗?

debugging linker gcc compilation

4
推荐指数
2
解决办法
2345
查看次数

标签 统计

c ×1

compilation ×1

debugging ×1

gcc ×1

linker ×1

valgrind ×1