Change Debugged Application

Sysprogs forums Forums VisualGDB Change Debugged Application

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32918
    Noah
    Participant

    Hello,

    I’ve got multiple different build configurations and I’d like to be able to switch configurations and debug them. So far, I can’t find a way to have configuration-dependent executable paths, I cannot find a setting in VisualGDB to allow my to point at a “.elf” file other than the one in the default location in “$(ProjectDir)/Debug/DEBUG/”; and I can’t find where this variable is defined either.

    I have included a screenshot below where I am trying to download and ‘debug’ the Release configuration as a test (I am aware that this will not “debug” properly, but it should at least download and attempt to attach).

    I am hoping to have some light shed on how to change which .elf is used for debugging depending on the active configuration.

    Thank you for the help!

    Attachments:
    You must be logged in to view attached files.
    #32922
    support
    Keymaster

    Hi,

    For CMake projects, the debugged executable path is automatically derived from the actual project structure. If you would like to debug arbitrary executables, we would advise using Quick Debug instead.

    If you would like to have multiple debug configurations, you can try using the configuration/platform manager. Simply add a CMake-level variable in the configuration settings, and then check it on the CMake statement level (e.g. using the ${} syntax or in conditional statements) to produce different executables in different configurations.

    VisualGDB will automatically pick up the correct executable based on the active platform.

    If this is not what you are looking for, please let us know more what you are trying to accomplish, and we will try to suggest a better solution.

    #32926
    Noah
    Participant

    Ok, thanks for the response. I should clarify a bit more: I’m seeing a few problems that are maybe related. I’ll go through the steps to produce what I am seeing and what I expect.

    Debug Configuration

    If I select the Debug configuration in VisualGDB and press Start then everything works and debugs normally.

    Release Configuration

    When I switch to the Release configuration using the dropdown menu in the toolbar, a few things happen.

    The first notable thing is an exception traceback that shows up in the “VisualGDB Build” tab. It starts off "CMake Error: CMake server mode has been removed in favor of the file-api." and then prints a traceback (see CMakeErrorTraceback.png). Doing a “Clean and Reconfigure CMake Project” produces an error that says “The operation has timed out.”

    Deleting the build/ directory and retrying does not help.

    I can do a clean rebuild and the configure and build steps will both succeed; although the solution explorer will still display the project as having failed to configure.

    To get past this for now, I do a clean rebuild and then click “Start.”

    I then get an error that VisualGDB failed to start the debug session because it could not find the image in build/VisualGDB/Debug/DEBUG (See IncorrectImagePath.png).

    This debug folder does not exist, nor should it. Instead Release builds are located in build/VisualGDB/Release/RELEASE. It seems like VisualGDB should be looking in the Release directory tree for the image, if that’s where CMake is putting the output executable.

    The CMake Binary directory is also correct (see BinaryDirectory.png), I would have thought that VisualGDB would use the ${CMAKE_BINARY_DIR} variable to determine where the executable is placed.

    Thank you for the help,

    Noah

    Attachments:
    You must be logged in to view attached files.
    #32935
    support
    Keymaster

    Hi,

    We have just rechecked the switching between the debug and release configurations and it worked just fine.

    Most likely, you have changed some project settings to the values preventing VisualGDB from loading it.

    Please try creating a new project from scratch and check if the problem persists. If not, please try comparing the settings between the 2 projects and eliminating the differences one-by-one.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.