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. Breakpoint is bypassed

Breakpoint is bypassed

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 441 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.
  • M Offline
    M Offline
    mahmoodn
    wrote on last edited by
    #1

    Hi
    I would like to debug a code, but I don't know why the breakpoint doesn't work. The run script is

    $ cat run2.sh 
    #!/bin/bash
    export CUDA_VERSION="11.6"; export CUDA_VISIBLE_DEVICES="0" ; \
    export TRACES_FOLDER=/home/mnaderan/accel-sim-framework/trace-test/traces; \
    CUDA_INJECTION64_PATH=/home/mnaderan/accel-sim-framework/util/tracer_nvbit/tracer_tool/tracer_tool.so gdb --args \
    /home/mnaderan/gpu-apps/cactus/gms mdrun -notunepme -pme gpu -nb gpu -v -deffnm ./data_dirs/npt
    

    I put this script in the run step. When I click the debug button, it looks normal.
    f0519875-1cc8-4a80-8199-efea282e7e2a-image.png

    After entering 'r' in the GDB, it hits the assertion, and you can see that it bypassed the breakpoint.

    0d279aac-4e48-48af-ab61-ea9ec5faa1d6-image.png

    I appreciate any feedback for that. Is there any workaround for that?

    jsulmJ 1 Reply Last reply
    0
    • M mahmoodn

      Hi
      I would like to debug a code, but I don't know why the breakpoint doesn't work. The run script is

      $ cat run2.sh 
      #!/bin/bash
      export CUDA_VERSION="11.6"; export CUDA_VISIBLE_DEVICES="0" ; \
      export TRACES_FOLDER=/home/mnaderan/accel-sim-framework/trace-test/traces; \
      CUDA_INJECTION64_PATH=/home/mnaderan/accel-sim-framework/util/tracer_nvbit/tracer_tool/tracer_tool.so gdb --args \
      /home/mnaderan/gpu-apps/cactus/gms mdrun -notunepme -pme gpu -nb gpu -v -deffnm ./data_dirs/npt
      

      I put this script in the run step. When I click the debug button, it looks normal.
      f0519875-1cc8-4a80-8199-efea282e7e2a-image.png

      After entering 'r' in the GDB, it hits the assertion, and you can see that it bypassed the breakpoint.

      0d279aac-4e48-48af-ab61-ea9ec5faa1d6-image.png

      I appreciate any feedback for that. Is there any workaround for that?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @mahmoodn It can't work like this! You are basically asking QtCreator to debug GDB. Do not start gdb in your script but only your application then start debugging in QtCreator.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mahmoodn
        wrote on last edited by
        #3

        Sorry but I don't understand what you mean. I tried to start debugging an "unstarted application" and pointing that to the executable (my script without gdb) and then ran the script ./run2.sh in a terminal. As you can see, the terminal hits the assertion and the debugger is still waiting.

        75c95666-52ea-458b-9264-45e57f656c05-image.png

        jsulmJ 1 Reply Last reply
        0
        • M mahmoodn

          Sorry but I don't understand what you mean. I tried to start debugging an "unstarted application" and pointing that to the executable (my script without gdb) and then ran the script ./run2.sh in a terminal. As you can see, the terminal hits the assertion and the debugger is still waiting.

          75c95666-52ea-458b-9264-45e57f656c05-image.png

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @mahmoodn Why do you need this script file at all? You can set all these variables in QtCreator Run configuration (Environment, also parameters can be defined in Run configuration) and then simply start the executable. Then debugging will work.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mahmoodn
            wrote on last edited by mahmoodn
            #5

            Well the explanation is complex.
            1- The raw command for the program is /home/mnaderan/gpu-apps/cactus/gms mdrun -notunepme -pme gpu -nb gpu -v -deffnm ./data_dirs/npt. If I run that in terminal everything is fine.
            2- I use a tracer and load its library file as a variable to analyze that gms program. If I separate them, it will be like:

            $ export CUDA_INJECTION64_PATH=/home/mnaderan/accel-sim-framework/util/tracer_nvbit/tracer_tool/tracer_tool.so
            $ /home/mnaderan/gpu-apps/cactus/gms mdrun -notunepme -pme gpu -nb gpu -v -deffnm ./data_dirs/npt
            

            In terminal that is fine too.

            However, if I want to do the same thing in Qt creator, things don't go well. In the run properties, I point the executable to gms and supply the arguments (see picture). I also have exported that variable in the environment list. However, when I start 'run', the program terminates with as error that no GPU was found (the program needs gpu due to -nb option). Please see that in terminal gpu is detected.

            3f842987-5a46-496e-8a3f-dde4dda7b304-image.png

            If that can be solved, it will be great, but I wasn't able to fix that. So, I decided to put the command in a script and call the script in Qt creator.

            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