Eclipse log debug windows function calls - eclipse

I was wondering if there's an option where I can print out the entire content of the debug window in Eclipse.
You see, if I pause the MCU, the debug window shows the current functions called on the stack. What I need, is to log into file every function that has been called since system start.
Do you guys have any idea how to make it happen?
Thanks!

when you pause, you may call /jdk1.8/bin/jstack.exe -l 111111 > dump.txt where 111111 is process id of the application (jvm). when you look at dump.txt you will see the thread dump of the jvm, which also contains what you see at eclipse's debug view

Related

Eclipse Debugger - how to display suspended threads only

When debugging a J2EE application, in Eclipse, I do see hundreds of Threads.
However, I am interested in a single thread, in which my breakpoint hit.
Going up and forth to find it everytime is a pain.
How do I filter out the unsuspended threads?
As far as I know there is not an easy way to do this. One workaround would be like this:
Get a focus on the Debug view
Ctrl + F (in order to get the find dialog)
Enter something like *Suspended
Click OK

Eclipse Run History

Does eclipse remember when a program was executed last time? I know there is run configurations, but that doesn't keep track of past executions and their order of execution.
When a program is executed at the shell, then shell keeps tracks of the order of their executions? I want similar utility in eclipse along with the time of execution.
You can see in the debug view or in the console view (click the arrow near screen icon) the program that have run and the start time.
Edit : In Preferences/(Run/Debug)/Launching uncheck the "Remove termined launches when a new launch is created".
This list is reset if you clear hit or if you close Eclipse.
If you want a more permanent information, I think your programs should log that info in files.
you can execute your previous most recent program with ctrl+f11. For detail you can go to run->run history.
If you need the time when your program was executed, make your program output the time by itself. There is nothing in Eclipse that can do exactly what you need.

eclipse - class find editor - source not find

I have a problem with eclipse debugging. I had a proper working code and few hours ago I add one more external library to do something new. When I run the program now it works properly, but when I want to debug it, it stopped on the first line of a new part of the code (the one using the newest external library). It shows the info:
"Class File Editor
Source not found
The source attachment does not contain the source for the file ModelBuilder.class"
When I try to step over I just receive the same information but connected with other files. After stepping over a multiple times I finally get back to my code and can debug the rest of the program normally.
Of course I can do it always but does anybody know the solution to that problem, not to click step over multiple times but debug normally?
It should not enter the external library code unless you step into it, or there's an exception in that code. If you find yourself stepping through code you don't have source to, use Step Return, which jumps to the end of whatever method you're in.
If it is caused by an exception in the library code and you want to ignore it, go to Window > Preferences > Java > Debug and uncheck "Suspend execution on uncaught exceptions".
If you know what exception is causing the execution to suspend, then you could also try this:
Go to the Debug perspective
Open the Breakpoints view
Click the J with the exclamation point by it (J!)
Search for the exception that triggers the debug suspend
Uncheck the two check boxes
Say OK

Why sometimes no detail info when debugging java code on eclipse?

Sometimes when I debug in eclipse, move the mouse on the parameter, no debug info like value and something else displayed but description of the parameter like the pic follow:
Sample is the aspectJ .aj source code I debugged.
Anyone can tell me why sometimes no detail info and how to fix it?
This could be an AspectJ specific issue: try installing the AspectJ Development Tools for Eclipse and see if that helps.
I think I found the solution. Whenever you run into this issue, Go to debug perspective. You will see thread will selected as parent process. Change the thread selection. Assign it to the thread which says Suspended as has your breakpoint line number. By doing you will get back all your debug values and debug commands like step into , step over etc.

OutputDebugString() does not work on Windows 7x64

My program works great with windows xp. I am trying to add some more functionality and using OutputDebugString() to show some debug information. works flawlessly on XP. Now when i want to use the same program on windows 7x64. I dont see any output in DebugView.
F1! F1! F1!
Sorry for reviving an old question, but we spent a good couple of days searching the internet to answer this one and eventually ended up logging a connect call. I am posting here to help anyone else in the same situation. Our specific problem was getting the output from OutputDebugString, MFC TRACE etc in the debug output window when debugging an x64, mixed mode application.
According to Microsoft, apparently for debugging x64 mixed mode applications the debugger type of 'auto' (set in the Debugging->Debugger Type property page) defaults to managed rather than mixed. This will need to be explicitly set to 'Mixed' for both managed and native debug output to be seen when debugging a 64 bit build.
There are a number of reasons why this may or may not work. I accidentally disabled this -- here are all the things you need to check to get this working:
Is the debug output text getting redirected from the Output pane to the Immediate pane, thus you are not seeing it? To turn this off:
Debug
Options and Settings
[ ] Redirect all Output Windows text to the Immediate Window
Is the Output pane visible?
Debug
Windows
Output
In the Output pane do you have Program Output enabled?
Debug
Windows
Output
Right-Click anywhere inside the pane
[x] Program Output
Do you have the right Debugging Type selected?
In the Solution Explorer (View > Solution Explorer) pane
Right-click on your project
Properties
Debugging
Debugging Type: change from Auto to either Native or Mixed
Is the debugger tried to get attached before the program has started? To turn Attach off:
In the Solution Explorer (View > Solution Explorer) pane
Right-click on your project,
Properties
Debugging
Attach: change to No
Are you using OutputDebugStringW()? Try using OutputDebugStringA() instead.
Lastly, did you start the program in debugging mode? :-) Hey, you never know!
Debug
Start Debugging (F5)
I hadn't seen a comprehensive list before so the above are all the things I had to verify were set correctly.
3 small suggestions:
make sure you are actually capturing events (top menu -> capture -> capture win32 is marked)
if you program is running in low integrity (does it give a security warning when you are running it) you need to run debug view in low integrity as well. to do that you need to change the integrity level of dbgview.exe before running it.
if you are using visual studio and running with debugger (pressed F5) then the debug output is actually captured by visual studio (in the output window). try running your program with ctrl f5.