Devc++ Breakpoints Not Working



Jan 17, 2008 However, I noticed that Dev-C can be used as an editor as well. I find it much easier to read the code on Dev-C due to the various color displays representing different functions, comments etc. However, when I attempt to debug the codes, I am unable to use breakpoint debugging. Developer Community for Visual Studio Product family. This site uses cookies for analytics, personalized content and ads. By continuing to browse this site, you agree to this use. Unable to debug / set breakpoints in C/CLI project. Windows 10.0 visual studio 2017 C.

  1. Dev-c++ Breakpoints Not Working
  2. Devc++ Breakpoints Not Working Capital
  3. Devc++ Breakpoints Not Working Skills
  4. Devc++ Breakpoints Not Working Principle
  5. Devc++ Breakpoints Not Working Remotely
-->

Debug tab shows watched variables in the debugging process. The Results window is used to present the results of the actions of the IDE: compilation errors, compiling directives, debugging commands, etc. The Source code editor shows the code of the program. Files created The files of the project are saved when the source code file is saved. Orwell's Dev-C hasn't been updated in over a year, is not likely to ever be updated, and was using an outdated compiler (GCC 4.9.2) with the last version released. You should consider getting a different IDE, one that is actively supported and updated. Two that work well are Visual Studio 2015 and Code::Blocks.

  • In this video you will learn how to debug any C or C program in Developer C or C IDE. This video will give you sufficient information on debugging tips. For Support Email: support.
  • Configure Dev-C. We need to modify one of the default settings to allow you to use the debugger.

Breakpoints are one of the most important debugging techniques in your developer's toolbox. You set breakpoints wherever you want to pause debugger execution. For example, you may want to see the state of code variables or look at the call stack at a certain breakpoint. If you are trying to resolve a warning or issue while using breakpoints, see Troubleshoot breakpoints in the Visual Studio debugger.

Note

If you know the task or problem you're trying to solve, but you need to know what kind of breakpoint to use, see Find your debugging task.

Set breakpoints in source code

You can set a breakpoint on any line of executable code. For example, in the following C# code, you could set a breakpoint on the variable declaration, the for loop, or any code inside the for loop. You can't set a breakpoint on the namespace or class declarations, or on the method signature.

To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.

For most languages including C#, breakpoint and current execution lines are automatically highlighted. For C++ code, you can turn on highlighting of breakpoint and current lines by selecting Tools (or Debug) > Options > Debugging > Highlight entire source line for breakpoints and current statement (C++ only).

When you debug, execution pauses at the breakpoint, before the code on that line is executed. The breakpoint symbol shows a yellow arrow.

At the breakpoint in the following example, the value of testInt is still 1. So, the value hasn't changed since the variable was initialized (set to a value of 1) because the statement in yellow hasn't yet executed.

When the debugger stops at the breakpoint, you can look at the current state of the app, including variable values and the call stack.

Here are a few general instructions for working with breakpoints.

MDA Piano ePiano DX10 & JX10 VSTNO GUIThese free VST work for Mac OS X, they don’t have UI, you’ll have to use the default interface supplied by your host.– Piano & ePiano are sample based synth, the ePiano is very good, it’s a kind of Rhodes emulation.– DX10 is a FM Synth, it has only two operators, but you can still get nice bell sounds out of it.– JX10 is a very nice virtual analog synth, despite some bugs (the Windows version has the same), it can do some very nice leads.20. VOPM VST synthA VST emulation of the Yamaha YM2151 Chip that was used in many arcade games, and is similar to the chip in the Sega Megadrive. VB1 bassAnother prehistoric virtual synth from Steinberg, this virtual bass plugin is free and available with Model E in the same package (see link above). 4Front R-Piano AU / VST. Dexed vst download mac. Very simple sound, can be useful.Freeware for Mac are rare so we take it!19.

  • The breakpoint is a toggle. You can click it, press F9, or use Debug > Toggle Breakpoint to delete or reinsert it.

  • To disable a breakpoint without deleting it, hover over or right-click it, and select Disable breakpoint. Disabled breakpoints appear as empty dots in the left margin or the Breakpoints window. To re-enable a breakpoint, hover over or right-click it, and select Enable breakpoint.

  • Set conditions and actions, add and edit labels, or export a breakpoint by right-clicking it and selecting the appropriate command, or hovering over it and selecting the Settings icon.

Breakpoint actions and tracepoints

A tracepoint is a breakpoint that prints a message to the Output window. A tracepoint can act like a temporary trace statement in the programming language and does not pause the execution of code. You create a tracepoint by setting a special action in the Breakpoint Settings window. For detailed instructions, see Use tracepoints in the Visual Studio debugger.

Breakpoint conditions

You can control when and where a breakpoint executes by setting conditions. The condition can be any valid expression that the debugger recognizes. For more information about valid expressions, see Expressions in the debugger.

To set a breakpoint condition:

  1. Right-click the breakpoint symbol and select Conditions. Or hover over the breakpoint symbol, select the Settings icon, and then select Conditions in the Breakpoint Settings window.

    You can also set conditions in the Breakpoints window by right-clicking a breakpoint and selecting Settings, and then selecting Conditions.

  2. In the dropdown, select Conditional Expression, Hit Count, or Filter, and set the value accordingly.

  3. Select Close or press Ctrl+Enter to close the Breakpoint Settings window. Or, from the Breakpoints window, select OK to close the dialog.

Breakpoints with conditions set appear with a + symbol in the source code and Breakpoints windows.

Create a conditional expression

When you select Conditional Expression, you can choose between two conditions: Is true or When changed. Choose Is true to break when the expression is satisfied, or When changed to break when the value of the expression has changed.

In the following example, the breakpoint is hit only when the value of testInt is 4:

In the following example, the breakpoint is hit only when the value of testInt changes:

If you set a breakpoint condition with invalid syntax, a warning message appears. If you specify a breakpoint condition with valid syntax but invalid semantics, a warning message appears the first time the breakpoint is hit. In either case, the debugger breaks when it hits the invalid breakpoint. The breakpoint is skipped only if the condition is valid and evaluates to false.

Note

The behavior of the When changed field is different for different programming languages.

  • For native code, the debugger doesn't consider the first evaluation of the condition to be a change, so doesn't hit the breakpoint on the first evaluation.
  • For managed code, the debugger hits the breakpoint on the first evaluation after When changed is selected.

Use Object IDs in conditional expressions (C# and F# only)

There are times when you want to observe the behavior of a specific object. For example, you might want to find out why an object was inserted into a collection more than once. In C# and F#, you can create object IDs for specific instances of reference types, and use them in breakpoint conditions. The object ID is generated by the common language runtime (CLR) debugging services and associated with the object.

To create an Object ID:

  1. Set a breakpoint in the code some place after the object has been created.

  2. Start debugging, and when execution pauses at the breakpoint, select Debug > Windows > Locals or Alt+4 to open the Locals window.

    Find the specific object instance in the Locals window, right-click it, and select Make Object ID.

    You should see a $ plus a number in the Locals window. This is the object ID.

  3. Add a new breakpoint at the point you want to investigate; for example, when the object is to be added to the collection. Right-click the breakpoint and select Conditions.

  4. Use the Object ID in the Conditional Expression field. For example, if the variable item is the object to be added to the collection, select Is true and type item $<n>, where <n> is the object ID number.

    Execution will break at the point when that object is to be added to the collection.

    To delete the Object ID, right-click the variable in the Locals window and select Delete Object ID.

Devc++ breakpoints not working principle

Note

Object IDs create weak references, and do not prevent the object from being garbage collected. They are valid only for the current debugging session.

Set a hit count condition

If you suspect that a loop in your code starts misbehaving after a certain number of iterations, you can set a breakpoint to stop execution after that number of hits, rather than having to repeatedly press F5 to reach that iteration.

Under Conditions in the Breakpoint Settings window, select Hit Count, and then specify the number of iterations. In the following example, the breakpoint is set to hit on every other iteration:

Set a filter condition

You can restrict a breakpoint to fire only on specified devices, or in specified processes and threads.

Under Conditions in the Breakpoint Settings window, select Filter, and then enter one or more of the following expressions:

  • MachineName = 'name'
  • ProcessId = value
  • ProcessName = 'name'
  • ThreadId = value
  • ThreadName = 'name'

Enclose string values in double quotes. You can combine clauses using & (AND), (OR), ! (NOT), and parentheses.

Set function breakpoints

You can break execution when a function is called. This is useful, for example, when you know the function name but not its location. It is also useful if you have functions with the same name and you want to break on them all (such as overloaded functions or functions in different projects).

To set a function breakpoint:

Set Breakpoint Gdb C

  1. Select Debug > New Breakpoint > Function Breakpoint, or press Alt+F9 > Ctrl+B.

    You can also select New > Function Breakpoint in the Breakpoints window.

  2. In the New Function Breakpoint dialog, enter the function name in the Function Name box.

    To narrow the function specification:

    • Use the fully qualified function name.

      Example: Namespace1.ClassX.MethodA()

    • Add the parameter types of an overloaded function.

      Example: MethodA(int, string)

    • Use the '!' symbol to specify the module.

      Example: App1.dll!MethodA

    • Use the context operator in native C++.

      {function, , [module]} [+<line offset from start of method>]

      Example: {MethodA, , App1.dll}+2

  3. In the Language dropdown, choose the language of the function.

  4. Select OK.

Set a function breakpoint using a memory address (native C++ only)

You can use the address of an object to set a function breakpoint on a method called by a specific instance of a class. For example, given an addressable object of type my_class, you can set a function breakpoint on the my_method method that instance calls.

  1. Set a breakpoint somewhere after the instance of the class is instantiated.

  2. Find the address of the instance (for example, 0xcccccccc).

  3. Select Debug > New Breakpoint > Function Breakpoint, or press Alt+F9 > Ctrl+B.

  4. Add the following to the Function Name box, and select C++ language.

Set data breakpoints (.NET Core 3.0 or higher)

Data breakpoints break execution when a specific object's property changes.

To set a data breakpoint

  1. In a .NET Core project, start debugging, and wait until a breakpoint is reached.

  2. In the Autos, Watch, or Locals window, right-click a property and select Break when value changes in the context menu.

Data breakpoints in .NET Core won't work for:

  • Properties that are not expandable in the tooltip, Locals, Autos, or Watch window
  • Static variables
  • Classes with the DebuggerTypeProxy Attribute
  • Fields inside of structs

Set data breakpoints (native C++ only)

Data breakpoints break execution when a value stored at a specified memory address changes. If the value is read but not changed, execution doesn't break.

To set a data breakpoint:

  1. In a C++ project, start debugging, and wait until a breakpoint is reached. On the Debug menu, choose New Breakpoint > Data Breakpoint

    You can also select New > Data Breakpoint in the Breakpoints window or right-click an item in the Autos, Watch, or Locals window and select Break when value changes in the context menu.

  2. In the Address box, type a memory address, or an expression that evaluates to a memory address. For example, type &avar to break when the contents of the variable avar changes.

  3. In the Byte Count dropdown, select the number of bytes you want the debugger to watch. For example, if you select 4, the debugger will watch the four bytes starting at &avar and break if any of those bytes change value.

Data Breakpoints

Data breakpoints don't work under the following conditions:

  • A process that is not being debugged writes to the memory location.
  • The memory location is shared between two or more processes.
  • The memory location is updated within the kernel. For example, if memory is passed to the 32-bit Windows ReadFile function, the memory will be updated from kernel mode, so the debugger won't break on the update.
  • Where the watch expression is larger than 4 bytes on 32-bit hardware and 8 bytes on 64-bit hardware. This is a limitation of the x86 architecture.

Note

Devc++ Breakpoints Not Working
  • Data breakpoints depend on specific memory addresses. The address of a variable changes from one debugging session to the next, so data breakpoints are automatically disabled at the end of each debugging session.

  • If you set a data breakpoint on a local variable, the breakpoint remains enabled when the function ends, but the memory address is no longer applicable, so the behavior of the breakpoint is unpredictable. If you set a data breakpoint on a local variable, you should delete or disable the breakpoint before the function ends.

Manage breakpoints in the Breakpoints window

You can use the Breakpoints window to see and manage all the breakpoints in your solution. This centralized location is especially helpful in a large solution, or for complex debugging scenarios where breakpoints are critical.

In the Breakpoints window, you can search, sort, filter, enable/disable, or delete breakpoints. You can also set conditions and actions, or add a new function or data breakpoint.

To open the Breakpoints window, select Debug > Windows > Breakpoints, or press Alt+F9 or Ctrl+Alt+B.

To select the columns to display in the Breakpoints window, select Show Columns. Select a column header to sort the breakpoints list by that column.

Breakpoint labels

You can use labels to sort and filter the list of breakpoints in the Breakpoints window.

  1. To add a label to a breakpoint, right-click the breakpoint in the source code or the Breakpoints window, and then select Edit labels. Add a new label or choose an existing one, and then select OK.
  2. Sort the breakpoint list in the Breakpoints window by selecting the Labels, Conditions, or other column headers. You can select the columns to display by selecting Show Columns in the toolbar.

Export and import breakpoints

To save or share the state and location of your breakpoints, you can export or import them.

  • To export a single breakpoint to an XML file, right-click the breakpoint in the source code or Breakpoints window, and select Export or Export selected. Select an export location, and then select Save. The default location is the solution folder.
  • To export several breakpoints, in the Breakpoints window, select the boxes next to the breakpoints, or enter search criteria in the Search field. Select the Export all breakpoints matching the current search criteria icon, and save the file.
  • To export all breakpoints, deselect all boxes and leave the Search field blank. Select the Export all breakpoints matching the current search criteria icon, and save the file.
  • To import breakpoints, in the Breakpoints window, select the Import breakpoints from a file icon, navigate to the XML file location, and select Open.

Set breakpoints from debugger windows

You can also set breakpoints from the Call Stack and Disassembly debugger windows.

Set a breakpoint in the Call Stack window

To break at the instruction or line that a calling function returns to, you can set a breakpoint in the Call Stack window.

To set a breakpoint in the Call Stack window:

  1. To open the Call Stack window, you must be paused during debugging. Select Debug > Windows > Call Stack, or press Ctrl+Alt+C.

  2. In the Call Stack window, right-click the calling function and select Breakpoint > Insert Breakpoint, or press F9.

    A breakpoint symbol appears next to the function call name in the left margin of the call stack.

The call stack breakpoint appears in the Breakpoints window as an address, with a memory location that corresponds to the next executable instruction in the function.

The debugger breaks at the instruction.

For more information about the call stack, see How to: Use the Call Stack window.

To visually trace breakpoints during code execution, see Map methods on the call stack while debugging.

Set a breakpoint in the Disassembly window

  1. To open the Disassembly window, you must be paused during debugging. Select Debug > Windows > Disassembly, or press Alt+8.

  2. In the Disassembly window, click in the left margin of the instruction you want to break at. You can also select it and press F9, or right-click and select Breakpoint > Insert Breakpoint.

Devc++ Breakpoints Not Working

See also

-->

This article introduces the features of the Visual Studio debugger in a step-by-step walkthrough. If you want a higher-level view of the debugger features, see First look at the debugger. When you debug your app, it usually means that you are running your application with the debugger attached. When you do this, the debugger provides many ways to see what your code is doing while it runs. You can step through your code and look at the values stored in variables, you can set watches on variables to see when values change, you can examine the execution path of your code, see whether a branch of code is running, and so on. If this is the first time that you've tried to debug code, you may want to read Debugging for absolute beginners before going through this article.

Although the demo app is C++, most of the features are applicable to C#, Visual Basic, F#, Python, JavaScript, and other languages supported by Visual Studio (F# does not support Edit-and-continue. F# and JavaScript do not support the Autos window). The screenshots are in C++.

In this tutorial, you will:

  • Start the debugger and hit breakpoints.
  • Learn commands to step through code in the debugger
  • Inspect variables in data tips and debugger windows
  • Examine the call stack

Prerequisites

You must have Visual Studio 2019 installed and the Desktop development with C++ workload.

You must have Visual Studio 2017 installed and the Desktop development with C++ workload.

If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.

If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.

If you need to install the workload but already have Visual Studio, go to Tools > Get Tools and Features.., which opens the Visual Studio Installer. The Visual Studio Installer launches. Choose the Desktop development with C++ workload, then choose Modify.

Create a project

First, you'll create a C++ console application project. The project type comes with all the template files you'll need, before you've even added anything!

  1. Open Visual Studio 2017.

  2. From the top menu bar, choose File > New > Project.

  3. In the New Project dialog box in the left pane, expand Visual C++ and then choose Windows Desktop. In the middle pane, choose Windows Console Application. Then name the project get-started-debugging.

    If you don't see the Console App project template, choose the Open Visual Studio Installer link in the left pane of the New Project dialog box. The Visual Studio Installer launches. Choose the .NET Core cross-platform development workload, and then choose Modify.

  4. Click OK.

    Visual Studio opens your new project.

  1. Open Visual Studio 2019.

    If the start window is not open, choose File > Start Window.

  2. On the start window, choose Create a new project.

  3. On the Create a new project window, enter or type console in the search box. Next, choose C++ from the Language list, and then choose Windows from the Platform list.

    After you apply the language and platform filters, choose the Console App template, and then choose Next.

    Note

    If you do not see the Console App template, you can install it from the Create a new project window. In the Not finding what you're looking for? message, choose the Install more tools and features link. Then, in the Visual Studio Installer, choose the Desktop development with C++ workload.

  4. In the Configure your new project window, type or enter get-started-debugging in the Project name box. Then, choose Create.

    Visual Studio opens your new project.

Create the application

Remotely
  1. In get-started-debugging.cpp, replace all of the default code with the following code instead:

Start the debugger!

  1. Press F5 (Debug > Start Debugging) or the Start Debugging button in the Debug Toolbar.

    F5 starts the app with the debugger attached to the app process, but right now we haven't done anything special to examine the code. So the app just loads and you see the console output.

    In this tutorial, we'll take a closer look at this app using the debugger and get a look at the debugger features.

  2. Stop the debugger by pressing the red stop button (Shift + F5).

  3. In the console window, press a key and Enter to close the console window.

Set a breakpoint and start the debugger

  1. In the for loop of the main function, set a breakpoint by clicking the left margin of the following line of code:

    name += letters[i];

    A red circle appears where you set the breakpoint.

    Breakpoints are one of the most basic and essential features of reliable debugging. A breakpoint indicates where Visual Studio should suspend your running code so you can take a look at the values of variables, or the behavior of memory, or whether or not a branch of code is getting run.

  2. Press F5 or the Start Debugging button , the app starts, and the debugger runs to the line of code where you set the breakpoint.

    The yellow arrow represents the statement on which the debugger paused, which also suspends app execution at the same point (this statement has not yet executed).

    If the app is not yet running, F5 starts the debugger and stops at the first breakpoint. Otherwise, F5 continues running the app to the next breakpoint.

    Breakpoints are a useful feature when you know the line of code or the section of code that you want to examine in detail. For information on the different types of breakpoints you can set, such as conditional breakpoints, see Using breakpoints.

Navigate code in the debugger using step commands

Mostly, we use the keyboard shortcuts here, because it's a good way to get fast at executing your app in the debugger (equivalent commands such as menu commands are shown in parentheses).

  1. While paused in the for loop in the main method, press F11 (or choose Debug > Step Into) twice to to advance to the SendMessage method call.

    After pressing F11 twice, you should be at this line of code:

    SendMessage(name, a[i]);

  2. Press F11 one more time to step into the SendMessage method.

    The yellow pointer advances into the SendMessage method.

    F11 is the Step Into command and advances the app execution one statement at a time. F11 is a good way to examine the execution flow in the most detail. (To move faster through code, we show you some other options also.) By default, the debugger skips over non-user code (if you want more details, see Just My Code).

    Let's say that you are done examining the SendMessage method, and you want to get out of the method but stay in the debugger. You can do this using the Step Out command.

  3. Press Shift + F11 (or Debug > Step Out).

    This command resumes app execution (and advances the debugger) until the current method or function returns.

    You should be back in the for loop in the main method, paused at the SendMessage method call.

  4. Press F11 several times until you get back to the SendMessage method call again.

  5. While paused at the method call, press F10 (or choose Debug > Step Over) once.

    Notice this time that the debugger does not step into the SendMessage method. F10 advances the debugger without stepping into functions or methods in your app code (the code still executes). By pressing F10 on the SendMessage method call (instead of F11), we skipped over the implementation code for SendMessage (which maybe we're not interested in right now). For more information on different ways to move through your code, see Navigate code in the debugger.

Navigate code using Run to Click

  1. Press F5 to advance to the breakpoint.

  2. In the code editor, scroll down and hover over the std::wcout function in the SendMessage method until the green Run to Click button appears on the left. The tooltip for the button shows 'Run execution to here'.

    Note

    The Run to Click button is new in Visual Studio 2017. (If you don't see the green arrow button, use F11 in this example instead to advance the debugger to the right place.)

  3. Click the Run to Click button .

    The debugger advances to the std::wcout function.

    Using this button is similar to setting a temporary breakpoint. Run to Click is handy for getting around quickly within a visible region of app code (you can click in any open file).

Restart your app quickly

Breakpoints Visual Studio

Click the Restart button in the Debug Toolbar (Ctrl + Shift + F5).

When you press Restart, it saves time versus stopping the app and restarting the debugger. The debugger pauses at the first breakpoint that is hit by executing code.

The debugger stops again at the breakpoint you previously set inside the for loop.

Inspect variables with data tips

Features that allow you to inspect variables are one of the most useful features of the debugger, and there are different ways to do it. Often, when you try to debug an issue, you are attempting to find out whether variables are storing the values that you expect them to have at a particular time.

  1. While paused on the name += letters[i] statement, hover over the letters variable and you see it's default value, size={10}.

  2. Expand the letters variable to see its properties, which include all the elements that the variable contains.

  3. Next, hover over the name variable, and you see its current value, an empty string.

  4. Press F5 (or Debug > Continue) a few times to iterate several times through the for loop, pausing again at the breakpoint, and hovering over the name variable each time to check its value.

    The value of the variable changes with each iteration of the for loop, showing values of f, then fr, then fre, and so on.

    Often, when debugging, you want a quick way to check property values on variables, to see whether they are storing the values that you expect them to store, and the data tips are a good way to do it.

Inspect variables with the Autos and Locals windows

C++ Breakpoint In Code

  1. Look at the Autos window at the bottom of the code editor.

    If it is closed, open it while paused in the debugger by choosing Debug > Windows > Autos.

    In the Autos window, you see variables and their current value. The Autos window shows all variables used on the current line or the preceding line (Check documentation for language-specific behavior).

  2. Next, look at the Locals window, in a tab next to the Autos window.

  3. Expand the letters variable to show the elements that it contains.

    The Locals window shows you the variables that are in the current scope, that is, the current execution context.

Set a watch

  1. In the main code editor window, right-click the name variable and choose Add Watch.

    The Watch window opens at the bottom of the code editor. You can use a Watch window to specify a variable (or an expression) that you want to keep an eye on.

    Now, you have a watch set on the name variable, and you can see its value change as you move through the debugger. Unlike the other variable windows, the Watch window always shows the variables that you are watching (they're grayed out when out of scope).

Examine the call stack

Visual Studio Disable All Breakpoints

  1. While paused in the for loop, click the Call Stack window, which is by default open in the lower right pane.

    If it is closed, open it while paused in the debugger by choosing Debug > Windows > Call Stack.

  2. Click F11 a few times until you see the debugger pause in the SendMessage method. Look at the Call Stack window.

    The Call Stack window shows the order in which methods and functions are getting called. The top line shows the current function (the SendMessage method in this app). The second line shows that SendMessage was called from the main method, and so on.

    Note

    The Call Stack window is similar to the Debug perspective in some IDEs like Eclipse.

    The call stack is a good way to examine and understand the execution flow of an app.

    You can double-click a line of code to go look at that source code and that also changes the current scope being inspected by the debugger. This action does not advance the debugger.

    You can also use right-click menus from the Call Stack window to do other things. For example, you can insert breakpoints into specified functions, advance the debugger using Run to Cursor, and go examine source code. For more information, see How to: Examine the Call Stack.

Show All Breakpoints Visual Studio

Change the execution flow

Dev-c++ Breakpoints Not Working

  1. Press F11 twice to run the std::wcout function.

  2. With the debugger paused in the SendMessage method call, use the mouse to grab the yellow arrow (the execution pointer) on the left and move the yellow arrow up one line, back to std::wcout.

  3. Press F11.

    The debugger reruns the std::wcout function (you see this in the console window output).

    By changing the execution flow, you can do things like test different code execution paths or rerun code without restarting the debugger.

    Warning

    Often you need to be careful with this feature, and you see a warning in the tooltip. You may see other warnings, too. Moving the pointer cannot revert your application to an earlier app state.

  4. Press F5 to continue running the app.

    Congratulations on completing this tutorial!

Next steps

In this tutorial, you've learned how to start the debugger, step through code, and inspect variables. You may want to get a high-level look at debugger features along with links to more information.

-->

Breakpoint Warnings

Dev-c++ Breakpoints Not Working

When debugging, a breakpoint has two possible visual states: a solid red circle and a hollow (white filled) circle. If the debugger is able to successfully set a breakpoint in the target process, it will stay a solid red circle. If the breakpoint is a hollow circle, either the breakpoint is disabled or warning occurred when trying to set the breakpoint. To determine the difference, hover over the breakpoint and see if there is a warning.

The following two sections describe prominent warnings and how to fix them.

'No Symbols have been loaded for this document'

Go to the Modules window (Debug > Windows > Modules) and check whether your module is loaded.

Devc++ Breakpoints Not Working Capital

  • If your module is loaded, check the Symbol Status column to see whether symbols have been loaded.

    • If symbols are not loaded, check the symbol status to diagnose the issue. From the context menu on a module in the Modules window, click Symbol Load Information... to see where the debugger looked to try and load symbols. For more information about loading symbols, see Specify Symbol (.pdb) and Source Files.
    • If symbols are loaded, the PDB does not contain information about your source files. These are a few possible causes:
      • If your source files were recently added, confirm that an up-to-date version of the module is being loaded.
      • It is possible to create stripped PDBs using the /PDBSTRIPPED linker option. Stripped PDBs do not contain source file information. Confirm you are working with a full PDB and not a stripped PDB.
      • The PDB file is partially corrupted. Delete the file and perform a clean build of the module to try to resolve the issue.
  • If your module is not loaded, check the following to find the cause:

    • Confirm that you are debugging the right process.
    • Check to see that you are debugging the right kind of code. You can find out what type of code the debugger is configured to debug in the Processes window (Debug > Windows > Processes). For example, if you are trying to debug C# code, confirm that your debugger is configured for the appropriate type and version of .NET (for example, Managed (v4*) versus Managed (v2*/v3*) versus Managed (CoreCLR)).

'… the current source code is different from the version built into...'

If a source file has changed and the source no longer matches the code you are debugging, the debugger will not set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn’t rebuilt. To fix this issue, rebuild the project. If the build system thinks the project is already up-to-date even though it isn’t, you can force the project system to rebuild either by saving the source file again or by cleaning the project’s build output before building.

In rare scenarios, you may want to debug without having matching source code. Debugging without matching source code can lead to a confusing debugging experience, so make sure that this is how you want to proceed.

To disable these safety checks, do one of the following:

Devc++ Breakpoints Not Working Skills

  • To modify a single breakpoint, hover over the breakpoint icon in the editor and click the settings (gear) icon. A peek window is added to the editor. At the top of the peek window, there is a hyperlink that indicates the location of the breakpoint. Click the hyperlink to allow modification of the breakpoint location and check Allow the source code to be different from the original.
  • To modify this setting for all breakpoints, go to Debug > Options and Settings. On the Debugging/General page, clear the Require source files that exactly match the original version option. Make sure to reenable this option when you are finished debugging.

The breakpoint was successfully set (no warning), but didn’t hit

This section provides information to troubleshoot issues when the debugger isn’t displaying any warnings – the breakpoint is a solid red circle while actively debugging, yet the breakpoint isn’t being hit.

Devc++ Breakpoints Not Working Principle

Here are a few things to check:

  1. If your code runs in more than one process or more than one computer, make sure that you are debugging the right process or computer.
  2. Confirm that your code is running. To test that your code is running, add a call to System.Diagnostics.Debugger.Break (C#/VB) or __debugbreak (C++) to the line of code where you are trying to set the breakpoint and then rebuild your project.
  3. If you are debugging optimized code, make sure the function where your breakpoint is set isn’t being inlined into another function. The Debugger.Break test described in the previous check can work to test this issue as well.

Devc++ Breakpoints Not Working Remotely

I deleted a breakpoint, but I continue to hit it when I start debugging again

If you deleted a breakpoint while debugging, you may hit the breakpoint again the next time you start debugging. To stop hitting this breakpoint, make sure all the instances of the breakpoint are removed from the Breakpoints window.