When i drag and drop a node with GMFappilication nothing is comes - eclipse-emf

When i drag and drop a node with GMF application nothing is drawn and i have this exception
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:206)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:169)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
Any help is highly appreciated.

It just means that exception occurred during the command execution. Command is usually executed at the drop time. There should be a nested cause exception in your stack trace i think and it'd be interesting to see what that exception is.
In any case you should debug it and see what kind of command is being executed at the drop and see what exactly throws the exception.

Related

Is it possible to continue debugging past an unhandled exception in Visual Studio?

A variety of other questions hint that it is possible to continue debugging past an "Exception Unhandled" popup like this:
This is the popup from Visual Studio 2019, but VS 2015 gives similar behaviour. In both cases, for all combos of Win32/x64 and Debug/Release I have tried, the debugger refuses to go past the point that throws the unhandled exception - the same popup pops up again on each attempt to continue. I would like to push past this point and continue into the code I have set up via SetUnhandledExceptionFilter(). Is that possible?
This strongly upvoted answer suggests that it might be, via an option under Tools -> Options then Debugging -> General regarding unwinding the stack... but a comment on the answer suggests the option may have disappeared from VS2017. I found the option in VS 2015, but it does not have the desired effect. Is the accepted answer to that question therefore correct despite fewer votes - that continuing to debug past an unhandled exception is not possible by design?
Yes - it's possible. If you get to that pop up repeatedly, and the exception settings are such that the exception is NOT intercepted by the debugger (and therefore passed to the application's own exception handling), then it could be that your "unhandled" exception handling has already run, or does not exist in the form you think it does. Double-check where you have set breakpoints and make sure they are ones that stand to be hit.
Note also that if you have something like this to catch SEH exceptions (such as integer divide by zero):
__try
{
// set up and run the application
}
__except( RecordUnhandledException( GetExceptionInfo() ) )
{
}
... then the debugger can hide RecordUnhandledException() from you. That is, if you set a breakpoint on the line where the exception is (deliberately) thrown, and try to step into it, the debugger may step straight back to that point by executing the handling code in a single step that makes it invisible to you. However, if it produces other output, you should be able to see that output. If not, it may take an explicit breakpoint within RecordUnhandledException() to reveal that it exists and step through its logic.

Can I view an unhandled exception in the Visual Studio 2017 Debugger?

A library I am using (zmq) throws an exception. The debugger breaks and informs me.
How, if possible, can I see this exception. Specifically the what() message?
Without having to place try/catch around it and printing to the output stream.
It does not appear in the Autos or Locals watch lists. I have searched the stack frames around the point at which it occured.
Adding $exception to a manual watch list simply returns a value of "identifier $exception is undefined"
Using memory explorer to interrogate the exception's location does not show anything useful.
I have read this can be done when using the CLR - can I do it in regular C++?
Referencing this answer:
You'll get a window when the exception is thrown with the option to break/continue/ignore. Copy and paste the hex address this dialog reports, then click the break button. Now in a watch window, enter something like:
(std::exception*)0xXXXXXXXX
(1) Please check that whether the Exception messages was enabled in the output window under Tools->Options->Debugging->Output window.
(2)If it still no exception messages, one possible reason is that zmq really doesn't support the Exception throw feature of VS. Of course, you could write a general app like C# or VC++ which can prove it. If other apps have no this issue, we would think about the specific zmq.
Step 1. Identify the exception (it would be logged in the output window in VS)
Step 2. Put an exception breakpoint with the exception you saw from the output.
If this is ZeroMQ, I'd wager you're Sending 2 requests on a REQ socket without waiting for a reply.
your output window
(View/Output or click CTRL + ALT + O)
is where you should see the message, but you may need to check the exceptions option:
Look here for more detail
As far as I'm aware, this isn't currently possible. I've added a User Voice suggestion here but I'm not sure when, if ever, Microsoft will implement this feature.
For now, what you can do is take the Type and Location of the exception (from the message 'Exception thrown at Address in Module: Microsoft C++ exception: Type at memory location Location.', and then add to the Watch window the expression '(Type*)Location'. If Type is some internal exception type that you don't have access to, then you can hope it derives from std::exception and cast to that instead.

Getting data about an anonymous exception during debug session

So, here's the problem I have.
void * something = ???;
void (*fun)(void*) = ???;
try
{
fun(something);
}
catch (...)
{
assert(false);
}
I've been tasked with establishing why the assert is getting fired. Unfortunately I don't get to change the above code. Furthermore this is in a multi-threaded environment and it's during shutdown of the program. The part that does the try/catch is unlocked quite purposefully in the real world code. When I try to step through the program it suddenly just disappears on me...I can't even step TO the right fun() call, let alone into it.
My only recourse seems to be to put a breakpoint in the catch(...) and examine whatever is there. Unfortunately this tells me nothing as I don't know what fun really is nor what something is.
My only hope at this point is that I can somehow talk the Visual Studio debugger into telling me what ... is and I'd be overjoyed if I could find out where it was thrown. It's not in the auto list at least...might it be elsewhere? Is there any way for me to make progress here or am I screwed? I feel screwed...
====
Update: There was an external program killing mine when it didn't shut down in time. That's why stepping made it disappear. Had nothing to do with threads.
Once I realized that I was able to turn on exceptions as suggested. Unfortunately there was no place that throws one...it was an access violation. The function being stored gets pounded somehow.
Try to use Visual Studio functionality that breaks execution when an exception is thrown. Go to Visual Studio main menu Debug -> Exceptions and tick all exceptions.
This way visual studio will stop when your exception is thrown and you will know what it was.
Can you just go to menu: Debug|Exceptions and mark the exceptions that you suspect is thrown ?
If you can step/attach to a running program that should be possible. This will cause the debugger to break when a specific exception(s) are thrown.
I usually mark the whole subtree 'Win32 Exceptions' in the Debug|Exceptions dialog box. I assume the your program does not throw and silently ignore other (Win32) exceptions (in this case you would have a lot of 'false' alarms).
I hope that helps.

can we get the penultimate exception that occurred from an mdmp or hdmp in windbg

I got a crash dump (both mdmp and hdmp) for my application (written in C++) captured using dr. watson.
After analyzing the dumps through windbg, I concluded that the crash had occurred in the catch() itself :)
What I need to know is what exception caused the the failure in the first place i.e. I need that penultimate(last but one th) exception that had occurred.
I know I could get the same by some other ways, but is there a specific command with which we could get the list of errors\exceptions occurring from the dump file.
Thanks.
--Samrat Patil
what i usually do is issue the search command looking for specific CONTEXT flags:
s-d esp l10000 1003f
the search is usually performed with the current value of esp as a starting point.
Once you're lucky you get back a bunch of addresses on stack you can further use as parameters for .cxr. The addresses (if several) can be followed to trace the exception flow.
Once the new context is set, it is usually trivial to see where a particular exception is thrown.
isn't !analyze -v working for you?

How can I debug a win32 process that unexpectedly terminates silently?

I have a Windows application written in C++ that occasionally evaporates. I use the word evaporate because there is nothing left behind: no "we're sorry" message from Windows, no crash dump from the Dr. Watson facility...
On the one occasion the crash occurred under the debugger, the debugger did not break---it showed the application still running. When I manually paused execution, I found that my process no longer had any threads.
How can I capture the reason this process is terminating?
You could try using the adplus utility in the windows debugging tool package.
adplus -crash -p yourprocessid
The auto dump tool provides mini dumps for exceptions and a full dump if the application crashes.
If you are using Visual Studio 2003 or later, you should enable the debuggers "First Chance Exception" handler feature by turning on ALL the Debug Exception Break options found under the Debug Menu | Exceptions Dialog. Turn on EVERY option before starting the debug build of the process within the debugger.
By default most of these First Chance Exception handlers in the debugger are turned off, so if Windows or your code throws an exception, the debugger expects your application to handle it.
The First Chance Exception system allows debuggers to intercept EVERY possible exception thrown by the Process and/or System.
http://support.microsoft.com/kb/105675
All the other ideas posted are good.
But it also sounds like the application is calling abort() or terminate().
If you run it in the debugger set a breakpoint on both these methods and exit() just for good measure.
Here is a list of situations that will cause terminate to be called because of exceptions going wrong.
See also:
Why destructor is not called on exception?
This shows that an application will terminate() if an exceptions is not caught. So stick a catch block in main() that reports the error (to a log file) then re-throw.
int main()
{
try
{
// Do your code here.
}
catch(...)
{
// Log Error;
throw; // re-throw the error for the de-bugger.
}
}
Well, the problem is you are getting an access violation. You may want to attach with WinDBG and turn on all of the exception filters. It may still not help - my guess is you are getting memory corruption that isn't throwing an exception.
You may want to look at enabling full pageheap checking
You might also want to check out this older question about heap corruption for some ideas on tools.
The most common cause for this kind of sudden disappearance is a stack overflow, usually caused by some kind of infinite recursion (which may, of course, involve a chain of several functions calling each other).
Is that a possibility in your app?
You could check the Windows Logs in Event Viewer on Windows.
First of all I want to say that I've only a moderate experience on windows development.
After that I think this is a typical case where a log may help.
Normally debugging and logging supply orthogonal info. If your debugger is useless probably the log will help you.
This could be a call to _exit() or some Windows equivalent. Try setting a breakpoint on _exit...
Have you tried PC Lint etc and run it over your code?
Try compiling with maximum warnings
If this is a .NET app - use FX Cop.
Possible causes come to mind.
TerminateProcess()
Stack overflow exception
Exception while handling an exception
The last one in particular results in immediate failure of the application.
The stack overflow - you may get a notification of this, but unlikely.
Drop into the debugger, change all exception notifications to "stop always" rather than "stop if not handled" then do what you do to cause the program failure. The debugger will stop if you get an exception and you can decide if this is the exception you are looking for.
I spent a couple hours trying to dig into this on Visual Studio 2017 running a 64-bit application on Windows 7. I ended up having to set a breakpoint on the RtlReportSilentProcessExit function, which lives in the ntdll.dll file. Just the base function name was enough for Visual Studio to find it.
That said, after I let Visual Studio automatically download symbols for the C standard library, it also automatically stopped on the runtime exception that caused the problem.