Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Attach Debugger to Valgrind PID

Attach Debugger to Valgrind PID

Scheduled Pinned Locked Moved Unsolved Language Bindings
2 Posts 1 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rnhwizard
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rnhwizard
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved