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

debugger remember past code

    XMLWordPrintable

Details

    • User Story
    • Resolution: Out of scope
    • P4: Low
    • None
    • None
    • Debugger
    • None
    • Windows

    Description

      Here is a code where the problem is that, if I put breakpoints at the beginning of each line:

      • We go from the breakpoint just before the sprint to the breakpoint just after the sprintf after 20 seconds.
      • The display of string2 takes place again 30 seconds after the execution of the sprintf.
      • Similarly, variables are displayed 30 seconds after each subsequent statement is executed. (And if I want to move to the next breakpoint without waiting for the display, it will then take 30 seconds before performing the instruction).
      void test(const char* string1)
      {
         long long int k,s,cnt,beg,end,op,s1,s1E;
         char* ptr;
         char* string2 = new char[100];
         sprintf(string2,"diff(%s)",string1);
         k = 0;
         s = 0;
         cnt = 0;
         beg = 5;
         end = 0;
         op = 0;
         s1 = 13;
         s1E = 11;
         ptr = NULL;
         char op1 [s1 ]; memcpy(op1 ,&string2[beg] ,s1 -1);
         char op1E[s1E]; memcpy(op1E,&op1[s1 != s1E],s1E-1);
      }
       
      int main(int argc, char *argv[])
      {
         test("12345678*123456");
         return 1;
      }  

      For example, if I remove the line

      ptr = NULL; 

      , the program crashes and displays 2 small windows:

      Le processus gdb s'est arrêté de façon inattendue (code 3).

      Windows recherche une solution au problème.

      Here (https://www.developpez.net/forums/d2170123/c-cpp/cpp/debuter/mode-debug-different-mode-release-sprintf-effectue-temps/#post12045323) is a link where we can see the debugger wait a lot to print each variable when passing through a breaking point.

      Qt Creator 5.4.1

      Thank you

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            nauvisse Armen SARIAN
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes