|
From: Stefano S. <ste...@gm...> - 2010-04-20 10:18:16
|
Hi all, I'm currently using valgrind-3.5.0-Debian. I see in the commentary: ... ==7197== by 0x80688A3: XYZ::Foo::Bar() (FooBar.cxx:361) ==7197== by 0x4326435: PThread::PX_ThreadStart(void*) (tlibthrd.cxx:1341) ==7197== by 0x4042584: start_thread (pthread_create.c:300) ==7197== by 0x47CA29D: clone (clone.S:130) Since I'm using emacs, which has support for the path/to/file:line_num syntax, I'd like valgrind to print the complete pathname and allow me to jump to the source with just one click. So I wonder if it would be possible for example for valgrind to print: ==7197== by 0x80688A3: XYZ::Foo::Bar() (/home/stefano/src/foobar-proj/libfoobar/FooBar.cxx:361) Is it currently already implemented? (from the reading of the docs it seems no) Should I file a feat request on bugzilla? Regards. |
|
From: Alexander P. <gl...@go...> - 2010-04-20 11:07:07
|
This should be tuned in gcc, not Valgrind. Valgrind just prints the
debug info generated by gcc.
For example:
$ cat leak.cc
int foobar() {
int *foo = new int;
delete[] foo;
return 0;
}
int main() {
foobar();
return 0;
}
$ g++ ../leak/leak.cc -o leak -g
$ valgrind ./leak
...
==11525== Mismatched free() / delete / delete []
==11525== at 0x4C23530: operator delete[](void*)
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:446
==11525== by 0x40060D: foobar() /home/glider/src/leak/../leak/leak.cc:3
==11525== by 0x40061E: main /home/glider/src/leak/../leak/leak.cc:8
==11525== Address 0x5926040 is 0 bytes inside a block of size 4 alloc'd
==11525== at 0x4C255C7: operator new(unsigned long)
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:281
==11525== by 0x4005F9: foobar() /home/glider/src/leak/../leak/leak.cc:2
==11525== by 0x40061E: main /home/glider/src/leak/../leak/leak.cc:8
==11525==
On Tue, Apr 20, 2010 at 2:18 PM, Stefano Sabatini <ste...@gm...> wrote:
> Hi all,
>
> I'm currently using valgrind-3.5.0-Debian.
>
> I see in the commentary:
> ...
> ==7197== by 0x80688A3: XYZ::Foo::Bar() (FooBar.cxx:361)
> ==7197== by 0x4326435: PThread::PX_ThreadStart(void*) (tlibthrd.cxx:1341)
> ==7197== by 0x4042584: start_thread (pthread_create.c:300)
> ==7197== by 0x47CA29D: clone (clone.S:130)
>
> Since I'm using emacs, which has support for the
> path/to/file:line_num syntax, I'd like valgrind to print the complete
> pathname and allow me to jump to the source with just one click.
>
> So I wonder if it would be possible for example for valgrind to print:
> ==7197== by 0x80688A3: XYZ::Foo::Bar() (/home/stefano/src/foobar-proj/libfoobar/FooBar.cxx:361)
>
> Is it currently already implemented? (from the reading of the docs it seems no)
>
> Should I file a feat request on bugzilla?
>
> Regards.
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
--
Alexander Potapenko
Software Engineer
Google Moscow
|
|
From: Konstantin S. <kon...@gm...> - 2010-04-20 14:02:24
|
On Tue, Apr 20, 2010 at 2:18 PM, Stefano Sabatini <ste...@gm...>wrote:
> Hi all,
>
> I'm currently using valgrind-3.5.0-Debian.
>
> I see in the commentary:
> ...
> ==7197== by 0x80688A3: XYZ::Foo::Bar() (FooBar.cxx:361)
> ==7197== by 0x4326435: PThread::PX_ThreadStart(void*)
> (tlibthrd.cxx:1341)
> ==7197== by 0x4042584: start_thread (pthread_create.c:300)
> ==7197== by 0x47CA29D: clone (clone.S:130)
>
> Since I'm using emacs, which has support for the
> path/to/file:line_num syntax, I'd like valgrind to print the complete
> pathname and allow me to jump to the source with just one click.
>
> So I wonder if it would be possible for example for valgrind to print:
> ==7197== by 0x80688A3: XYZ::Foo::Bar()
> (/home/stefano/src/foobar-proj/libfoobar/FooBar.cxx:361)
>
> Is it currently already implemented? (from the reading of the docs it seems
> no)
>
Yes, in regular (non-xml) mode valgrind does not print full path names
(dunno why).
I usually run patched valgrind which does:
===================================================================
--- coregrind/m_debuginfo/debuginfo.c (revision 11094)
+++ coregrind/m_debuginfo/debuginfo.c (working copy)
@@ -1851,12 +1851,14 @@
APPEND("???");
}
if (know_srcloc) {
- APPEND(" (");
+ APPEND(" ");
+ APPEND(buf_dirname);
+ APPEND("/");
APPEND(buf_srcloc);
APPEND(":");
VG_(sprintf)(ibuf,"%d",lineno);
APPEND(ibuf);
- APPEND(")");
+ //APPEND(")");
} else if (know_objname) {
APPEND(" (in ");
APPEND(buf_obj);
>
> Should I file a feat request on bugzilla?
>
> Regards.
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
|
|
From: Konstantin S. <kon...@gm...> - 2010-07-23 11:42:28
|
Just filed https://bugs.kde.org/show_bug.cgi?id=245535 --kcc On Tue, Apr 20, 2010 at 6:01 PM, Konstantin Serebryany <kon...@gm...> wrote: > > > On Tue, Apr 20, 2010 at 2:18 PM, Stefano Sabatini <ste...@gm...> > wrote: >> >> Hi all, >> >> I'm currently using valgrind-3.5.0-Debian. >> >> I see in the commentary: >> ... >> ==7197== by 0x80688A3: XYZ::Foo::Bar() (FooBar.cxx:361) >> ==7197== by 0x4326435: PThread::PX_ThreadStart(void*) >> (tlibthrd.cxx:1341) >> ==7197== by 0x4042584: start_thread (pthread_create.c:300) >> ==7197== by 0x47CA29D: clone (clone.S:130) >> >> Since I'm using emacs, which has support for the >> path/to/file:line_num syntax, I'd like valgrind to print the complete >> pathname and allow me to jump to the source with just one click. >> >> So I wonder if it would be possible for example for valgrind to print: >> ==7197== by 0x80688A3: XYZ::Foo::Bar() >> (/home/stefano/src/foobar-proj/libfoobar/FooBar.cxx:361) >> >> Is it currently already implemented? (from the reading of the docs it >> seems no) > > Yes, in regular (non-xml) mode valgrind does not print full path names > (dunno why). > I usually run patched valgrind which does: > =================================================================== > --- coregrind/m_debuginfo/debuginfo.c (revision 11094) > +++ coregrind/m_debuginfo/debuginfo.c (working copy) > @@ -1851,12 +1851,14 @@ > APPEND("???"); > } > if (know_srcloc) { > - APPEND(" ("); > + APPEND(" "); > + APPEND(buf_dirname); > + APPEND("/"); > APPEND(buf_srcloc); > APPEND(":"); > VG_(sprintf)(ibuf,"%d",lineno); > APPEND(ibuf); > - APPEND(")"); > + //APPEND(")"); > } else if (know_objname) { > APPEND(" (in "); > APPEND(buf_obj); > > > >> >> Should I file a feat request on bugzilla? >> >> Regards. >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Valgrind-users mailing list >> Val...@li... >> https://lists.sourceforge.net/lists/listinfo/valgrind-users > > |