Breakpoint installation failed: Interrupt failed - c++

I'm using Eclipse Mars and trying to debug a C++ file. I'm adding a breakpoint to a line, but after a few seconds I get the warning:
Breakpoint installation failed: Interrupt failed.
And the debugger doesn't stop at that point even though I know for sure that the code does reach the line with the breakpoint.
What can be done to solve this issue?

This messages indicates that the source file where you set the breakpoint does not belong to the actual binary you are debugging

The error message says: "interrupt failed". This does not seems to be a problem with matching binary with source file, it is rather a problem with GDB not being able to interrupt the process. My suggestion is to restart the debugger and set the breakpoint before the program actually starts.
I have this error sometimes when I debug a C++ multithreaded program in Eclipse.

Although I hadn't encountered such a problem with Eclipse, my suggestion is to look to Eclipse forum following these links:
https://www.eclipse.org/forums/index.php?t=tree&th=201329#page_top
https://bugs.eclipse.org/bugs/show_bug.cgi?id=331833

Make sure that "Skip All Breakpoints" is not enabled!
skip breakpoints button

I've had this warning on Eclipse TrueStudio Atollic. It didn't hamper at all my debugging. I rebuilt, checked breakpoint properties unsuccesfully. Then I remained in Eclipse ide, closed the project, reopened it and the warning had disappeared.

Related

Strange behavior of Eclipse Neon

I use Eclipse with CDT plugin for my C/C++ development. And I use MinGW compiler. Environment Path set properly. All the setting done properly in Eclipse. While editing the source code its working fine but after compilation when I try to execute the source code sometimes it says it cannot open the .exe file or sometimes doesn't show anything when there is some input to take. When I stop the execution pressing the red button program gets executed completely with default values.
But everything is fine if I compile and run the same source code using notepad and the command prompt. Please help.
A common problem is that if the program is currently executing, the program file is opened by the system and cannot be reopened for writing by the compiler (or more exactly by the linker). This problem can be easily reproduced by starting the program in debug mode and stop it at a breakpoint. Then, while the process is active, change a line in source and ask for a new build: you will get the error saying that the exe file cannot be opened.
How to fix: ensure to close any possible execution of the program when the error happens and rebuild

Visual Studio 2012 Release only error

There are a number of errors going on here but I'm sure they are all linked, so first off I'm getting Access violation reading location exceptions at locations (generally near 0x00000000)
but I only get these exceptions in release and not in debug, even if i setup debugging to do so. Also I found where the error happens but when I step over that it goes in to a complete unrelated function that is not called in the line or in any of the functions in that line of code. But when similar code is called it still goes to this unrelated function but doesn't fail. This all only happens in release versions. I know which piece of code is causing the error as if I comment it out its all fine. Also in the watch window in release all the numbers are wrong most of the time, which has never been a problem but it could help also a added some code to it to output the values of variables to a file and the variables are all fine, the pointers are sensible, but when the exception happens it always says their 0x00000020 but when I look at the log they are fine. This is in 32 bit , but on 64 bit windows 7 in c++. Please any help would be good!
Visual Studio's debugger will cause the program to use a debug heap that can hide uninitialized memory if you use the option "Start with Debugging" to start your program, in release or debug. You can try to run your program built in the Debug configuration without the debugger attached, and then use the Attach to Process... option in the debug menu to attach to your executable.
If this doesn't help, I recommend using windbg to debug your program. For help getting started with windbg, take a look at the answers on this question.
Once windbg is configured and symbol paths are set up, you can use the "!analyze -v" option once the program crashes to get a lot of information about the crash automatically.

VS2010 Remote debugger stopping where is no breakpoint

I am remotely debugging a dll (C++, unmanaged) for Microsoft FSX (I do not know whether this matters). The dll is compiled as "Multi-threaded-dll", since it does not work as "Multi-threaded-dll debug". My dll currently just contains a DllStart and DllStop function, this is standard in FSX.
I general debugging works (it stops at my breakpoints), but somehow the debugger also stops in places where I did not place a breakpoint. First the issue came up in the "NO Source available" flavor. After checking
Suppress "No Source Available" pane in 2010 and
No Source available
the only solution working for me was to install the mentioned extension. Now I do not get the "No source" tab anymore, but debugger still stops somewhere outside my code. I have cleaned all breakpoints as recommended in " Debugger stops when there is no breakpoint VS2010 ".
bglmanx.dll is another dll, also started by FSX. I was thinking, OK, maybe there is some ambiguity about the symbols and have renamed my functions to DllStartFSXM and DllStopFSXM (and hence being unique). No improvement.
Any ideas, hints?
It could be caused by having __asm int 3 or a DebugBreak in the other code?
Perhaps there is some way of disabling these commands or reimplmenting the DebugBreak function?

Dubugging a program not run within the debugger and without a crash

I left a program running last night, it worked fine for about 5 hours and then one of its built-in self-diagnostic tests detected a problem and brought up a dialog box telling me the issue. The program was built with debug information (/Zi). Is it possible to somehow get the debugger started so I can examine the value of some variables within the program? Or is it too late?
You can attach the debugger to the running process:
Debug > Attach to Process...
Just open up the program's solution first.
Assuming you've still got the error dialog on the screen you can break into the program and work back up the call stack examining variables etc.
For the future crashes ... if you have windbg or Visual Studio Professional, you can debug crash dumps, even when program isn't running. It is quite useful sometimes. See "MiniDumpWriteDump" on MSDN for more info.
Other than that it is "Attach to process".
Professional edition of Visual Studio have Just-in-Time debugger, that will kick in as soon as anything crashes, even if MSVC wasn't running. It will also locate source code (if debug info and source code are available) and open/create solution for you.
There is an option in the Debug menu to attach the debugger to a running process, IIRC.

can I use breakpoints with try catch statements with qt creator?

if an exception is thrown inside a try/catch, can i put a breakpoint there to get into debu mode before the program exits?
Tested here with a simple code, were I called a function that always throw. The breakpoints inside de catch block not ignored, and the debug mode started normally.
Anyway, qtCreator uses GDB for debugging (At least on my machine). You can find out more about how GDB handle exceptions debugging here http://www.caf.dk/cafonly/gnu/gdb/gdb_31.html
I don't see why not, this can certainly be done with the C/C++ IDE in Eclipse just by clicking in the margin where you want to break and running in "debug mode". In Eclipse, there is a run and a run in debug mode separation - I assume that's the case also in Qt Creator. Try it?