简体   繁体   中英

How to use Valgrind with Qt Creator to debug a remote application?

I have a c++ app that I am developing in Qt Creator (Qt Creator 4.7.0, Qt version 5.2.1). The app runs on a beaglebone (debian). I am debugging the app using Qt Creator's remote debugging.

The app has some memory issues, so I am trying to use Valgrind to diagnose them. Whenever I start a Memcheck analysis from Qt Creator, all it outputs is:

16:22:58: /usr/local/bin/valgrind --child-silent-after-fork=yes --xml-socket=10.0.2.15:38409 --log-socket=10.0.2.15:43999 --xml=yes --smc-check=all --tool=memcheck --gen-suppressions=all --track-origins=yes --leak-check=full --num-callers=25 --vgdb=yes --vgdb-error=0 /home/debian/MyApp

==28159== Failed to connect to logging server '10.0.2.15:37567'.

==28159== Logging messages will be sent to stderr instead.

==28159== Failed to connect to XML logging server '10.0.2.15:39405'.

==28159== XML output will be sent to stderr instead.

valgrind: m_libcprint.c:384 (prepare_sink_socket): Assertion 'sink->fd == 2' failed.

16:27:13: Analyzing finished.

To address the first two errors, I would like to change the call to valgrind to make the logging write to a file instead. However, I cannot find where to change the call that Qt Creator makes to valgrind. Tools->Options->Analyzer->Valgrind doesn't seem to allow me to change the logging behavior.

I have no idea what is causing the last error. Qt documentation makes it seem like all I should have to do is press go and it should work.

Any help is appreciated!

Removing the options xml-socket , log-socket and xml=yes worked for me. It removed the warnings and resolved the assertion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM