Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-22703

Attached debug program only shows disassembly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 4.9.2, Qt Creator 6.0.2
    • Debugger
    • linux desktop, local webserver
    • Linux/X11

    Description

      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. (pid is owned by me still).
      When I attach to the process only the disassembly shows. No source. Debugging without attaching is no problem.

      qtcreator shows error

      target:/home/chris/testsite.com/public_html/cgi-bin/webtest": could not open as an executable file: Operation not permitted.
      `target:/home/chris/testsite.com/public_html/cgi-bin/webtest': can't open to read symbols: Operation not permitted.
      Could not load vsyscall page because no executable was specified

      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.

      ls -l webtest
      -rwxrwxr-x 1 chris chris 11240 Jul 10 15:05 webtest

      shows that permissions are not a problem

      ps aux | greb webtest shows:

      chris 6883 0.0 0.0 4376 756 ? S 15:35 0:00 /var/www/testsite.com/public_html/cgi-bin/webtest

      So the user is me.

       

      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;
      }
      

       

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

       

      Attachments

        1. main.cpp
          0.4 kB
        2. Screenshot from 2024-06-06 13-57-07.png
          Screenshot from 2024-06-06 13-57-07.png
          380 kB
        3. webtest.pro
          0.9 kB
        4. wtest.html
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            cbruner Chris Bruner
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes