Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Attach Debugger to Valgrind PID



  • I am attempting to deploy a QT application to a Beagle Bone target using SSH after which I want to start valgrind and then attach debugging to a Running application.

    My question is how to attach the debugger to valgrind's PID?
    From QtCreator I tried:
    1) Analyze->Valgrind Memory Analyzer with GDB
    valgrind --child-silent-after-fork=yes --xml-socket=10.0.1.179:34543 --log-socket=10.0.1.179:42471 --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/otc_gui
    ==2165== (action at startup) vgdb me ...
    ==2165==
    ==2165== TO DEBUG THIS PROCESS USING GDB: start GDB like this
    ==2165== /path/to/gdb /home/otc_gui
    ==2165== and then give GDB the following command
    ==2165== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=2165
    ==2165== --pid is optional if only one valgrind process is running
    ==2165==

        b) Debug->Attach to Running Application
                 List of Processes Panel Appears:
                         2165 Valgrind --child-silent-after-fork=yes  --xml-socket=weston 
                                                    -idle-time= 0
                         I select the Valgrind Process ID
                         Click "Attach to Process" 
               QtCreator crashes when I attach to the Valgrind Process ID leaving the following messages:
        QXcbShmImage: xcb_shm_attach() failed with error: 10 (BadAccess), sequence 3145, resource id: 39845913
    

    major code: 130 (unknown)
    minor code: 1
    Segmentation fault (core dumped)

    Could you please help me understand what these errors mean and whether they are of consequence and can be resolved prior to attaching to Valgrind.

    My setup:
    UBUNTU 18.04
    Qt Creator 4.6.1 (Based on Qt 5.11.0) GCC 5.3.1
    Valgrind-3.15.0 and LibVEX
    Analyze->Valgrind Memory Analyzer with GDB followed by
    Debug->Attch to Running Application
    QTCreator Crashes



  • Relating to attaching Debugger to Valgrind PID, when I launch qtcreator

    ./qtcreator
    

    The following messages appear before launching
    Analyze->Valgrind Memory Analyzer with GDB
    Debug->Attach to Running Application

    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
    QXcbShmImage: xcb_shm_attach() failed with error: 10 (BadAccess), sequence: 552, resource id: 311, major code: 130 (Unknown), minor code: 1


Log in to reply