Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Attaching to process only shows disassembly

Attaching to process only shows disassembly

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 894 Views 2 Watching
  • 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.
  • I Offline
    I Offline
    iplayfast
    wrote on last edited by iplayfast
    #1

    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[])
    {
    UNUSED(argc);
    UNUSED(argv);
    if (access("pause",0)==0)
    {
    int g=100;
    while(g>0) // for debugging
    {
    sleep(1);
    if(access("pause",0)!=0)
    g = 0;
    g--;
    }
    }
    printf("past the pause");
    return 0;
    }

    Called from a standard webform.
    <HTML>
    <HEAD>
    <TITLE>web cgi debug test</TITLE>
    </HEAD>
    <BODY>
    <FORM action="http://www.testsite.com/cgi-bin/webtest" method="POST">
    <INPUT type="submit" value=" web cgi debug test start Now ">
    </FORM>
    </BODY>
    </HTML>

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • I Offline
        I Offline
        iplayfast
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by fcarney
          #4

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

          C++ is a perfectly valid school of magic.

          I 1 Reply Last reply
          1
          • fcarneyF fcarney

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

            I Offline
            I Offline
            iplayfast
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            1
            • I Offline
              I Offline
              iplayfast
              wrote on last edited by
              #6

              Bug report submitted https://bugreports.qt.io/browse/QTCREATORBUG-22703

              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