Re: [Valgrind-users] How to include the Valgrind stack traces in a stand-alone debug version?

2021-05-24 Thread John Reiser

On 5/24/21, Martin Licht via Valgrind-users wrote:


I think the Valgrind stack tracer is pretty great and I would like to use it as 
a substitute for `backtrace` in my C++ debug builds.


It would help to give an explicit list of why valgrind's backtrace() is "pretty 
great"
in contrast to GNU's.  The comment
 
https://blog.mozilla.org/nnethercote/2011/01/11/using-valgrind-to-get-stack-traces/#comment-438
identifies one item: GNU backtrace() shows only global (non-static) symbols.
What else?

Also, a detailed list would make a good request for enhancement
at https://www.gnu.org/software/libc/bugs.html ,
especially if accompanied by an actual test case
that shows how much better valgrind backtrace() is currently.

--



___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] How to include the Valgrind stack traces in a stand-alone debug version?

2021-05-24 Thread Philippe Waroquiers
On Mon, 2021-05-24 at 10:31 -0700, Martin Licht via Valgrind-users wrote:
> Hello,
> 
> I think the Valgrind stack tracer is pretty great and I would like to use it 
> as a substitute for `backtrace` in my C++ debug builds.
> 
> A blog post by Nicholas Nethercote (Using Valgrind to get stack traces) 
> describes a similar idea:
> https://blog.mozilla.org/nnethercote/2011/01/11/using-valgrind-to-get-stack-traces/
> 
> However, while this is already fairly elegant, I am wondering whether this 
> can be done without invoking the program under valgrind.
> 
> If the Valgrind stack tracer were a simple #include that would be best. 
> Alternatively, a means of including any necessary valgrind framework into the 
> debug build would be helpful. I appreciate your feedback.
The valgrind unwinder is very fast, so having it as a "standalone" library that 
can be
linked to a normal executable and used outside of the valgrind JIT framework 
would
be really nice. 

However, I think this unwind logic/code has a lot of dependencies
to other parts of valgrind (debug info reader, address space manager, valgrind 
own malloc
library, valgrind log and debug framework, ...).

So, clearly not a small task to 'cleanly' lib-ify the valgrind unwinder,
in particular if this library must then be usable both in a valgrind context 
and in a
'native' context.

Philippe




___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


[Valgrind-users] How to include the Valgrind stack traces in a stand-alone debug version?

2021-05-24 Thread Martin Licht via Valgrind-users
Hello,

I think the Valgrind stack tracer is pretty great and I would like to use
it as a substitute for `backtrace` in my C++ debug builds.

A blog post by Nicholas Nethercote (Using Valgrind to get stack traces)
describes a similar idea:
https://blog.mozilla.org/nnethercote/2011/01/11/using-valgrind-to-get-stack-traces/

However, while this is already fairly elegant, I am wondering whether this
can be done without invoking the program under valgrind.

If the Valgrind stack tracer were a simple #include that would be best.
Alternatively, a means of including any necessary valgrind framework into
the debug build would be helpful. I appreciate your feedback.

Regards,
Martin
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users