Please nominate your Qt Champions for 2021!

Attaching to process only shows disassembly

  • The situation:
    Linux cgi build under qt. When it starts there is a delay, allowing me to attach to the process, which is started from a web form. (process user is me still).

    When I attach to the process only the disassembly shows. No source.

    If I use dgb and attach to the pid I can list the source.
    But am unable to step (Cannot find bounds of current function)

    If I start debugging the process with qtcreator, it shows source and steps normally.

    Any ideas what is going on?
    Sample code:
    #include <stdio.h>
    #include <unistd.h>

    define UNUSED(x) (void)x;

    int main(int argc, char *argv[])
    if (access("pause",0)==0)
    int g=100;
    while(g>0) // for debugging
    g = 0;
    printf("past the pause");
    return 0;

    Called from a standard webform.
    <TITLE>web cgi debug test</TITLE>
    <FORM action="" method="POST">
    <INPUT type="submit" value=" web cgi debug test start Now ">

  • Lifetime Qt Champion


    You need to setup gdb for your application which Qt Creator does for you.

  • To be clear, I want to debug under qtcreator, so I was expecting things to be set up. But I only see disassembly, so I think they are not set up.

  • @iplayfast
    Did you compile under debug or release? You won't see anything in release compile. All debug symbols are removed.

  • @fcarney I compile under debug for debugging it. If I just start debugging it works fine, but if I attach to a running program is shows disassembly.

Log in to reply