I am a beginner for debugging windows process and still learning process analysis and debuging . I have choosed to use Debug Diagnostic Tool [v2.0] and planning to automate the process analysis/debug using this tool. Is there any good tutorial for this tool usage ?
thanks in advance...
I don't think it's possible to automate the process analysis/debug using Debug Diagnostic Tool [v2.0] because it's a WinForms app and wrapper over ClrMD :
a set of advanced APIs for programmatically inspecting a crash dump of
a .NET program much in the same way that the SOS Debugging Extensions
(SOS) do
Read the introduction post here.
So assuming, you already have a dump, it's better to automate analysis using ClrMD.
Related
The only way I know how to debug an arduino is usen the SerialPort which is like using a odd tool after trying vsCode in my job. Could someone show me how is it the prefered way to acomplish it?
SerialPort is just too slow and if I want to know what is happening in a critical section is not the best way to do it.
Arduino doesn’t come with a custom debugging tool. I`m sorry to tell you that unlike most other IDEs, there is no official Arduino debugging feature inside the arduino IDE.
However, thanks to the community we have access to unofficial tools like using Arduino simulators and emulators or and external software debuggin tool.
Personally I prefer simulator. Once you get use of it is simpler.
More about this here: https://www.circuito.io/blog/arduino-debugging/
I wonder how to watch new processes that are running or terminated. Can I do it with Windows 7 APIs? How?
I'm using Visual C++ in Windows 7 and don't want to use .Net Framework.
Whilst you can do this using polling (i.e. EnumProcesses), the best way to do it is an event driven approach. And to do that you need to use WMI. This MSDN page gives sample code.
Update Apparently you can use Event Tracing for Windows as an alternative, but I personally know nothing about that.
You may use Process32First and Process32Next from Tool Help library. This MSDN article has an example how to obtain the list of running processes.
An alternative is EnumProcesses function.
I have a custom CLI debugger for which I'm interested in a GUI. The debugger exposes an API with simple functions such as GetMemory(), SetMemory(), GetRegister(), Run(), Stop(), Address2Line() etc. through a TCP socket using a very simple protocol.
I'm looking for the easiest, fastest way of connecting it to a GUI. It seems there are many very good graphical debuggers, so after some research I think these are my best options:
Write a GDB translator - that will act as a gdbserver on one hand, translating all requests for the debugger, and also translate all events from the debugger to gdb compatible events. Then I can use any of the many gdb front-ends.
Write a Visual Studio Debug Engine
Write a plug-in for Eclipse (or some other open IDE)
Write a fresh GUI myself
So which will take the least effort / time ? Is there another way? Is there maybe a graphical debugger where I can easily define custom functions for debugging?
I would write an adapter so you can interact with something standard like GDB or Eclipse. Writing custom GUI code would be a waste of effort
After Google the issue i found that it was reported already but nothing useful yet from MS. I wonder if any one found a work around it?
Another option is to use windbg. You'll have to do a lot of commands by hand, but it's the best debugger out there. It handles mixed mode without any major issues. It has a bit of a learning curve, but it's very versatile.
Visual Studio's debugger is really not reliable when debugging mixed mode applications. Taken from my answer here #5965771:
If you're trying to debug a piece of native code try to use a native project as the debugger start-up application. Under the project settings, "Debugging" tab set the "Debugger Type" to "Mixed", for us this helped sometimes (the native project can be a DLL for example, simply set your main Exe as debugging target in the project settings);
OR, as already mentioned in another answer: Use WinDbg! With it you can debug both managed/unmanaged mixed code applications much more reliably.
use a different debugger, or don't use the debugger at all, just trace to a file or insert breakpoints in the code with inline assembly language.
I am new in in Visual Studio Win32 (C++) Applications
In java where I work, logging is easy using log4j for instance.
How is the logging done in a Win32 app?
I have seen some code using macros to write to files.
Am I responsible to create some logging mechanism?
Is there a standard way to log in win32?
Thanks
Use the Event Log API to write to Windows Event Log
http://msdn.microsoft.com/en-us/library/aa385772(v=vs.85).aspx
Another way is using log4net since you have experience of log4j, there are very similar.
"Windows application" doesn't mean much of anything, Java apps can also run on Windows. There's log4net to adding logging to a .NET application. Log4cxx to do so for an app written in C++. Exact same approach as log4j. The project's home page is here.
It depends on who is going to be using your software's logging facility:
The Windows Event Log API is best if you are writing a service or "system" type task that needs to be supported by an IT support department. Support tools for Windows support remote access of system event logs to create system health alerts and so on.
Other than that, Windows does not have a convenient Logging API. So you need to roll-your own if the system event log is inappropriate.
For developers / debugging purposes theres OutputDebugString that will emit text to your debuggers "Output" window.
It is convenient when writing GUI apps, to make the debug build a console application, so that a console window is displayed in addition to the GUI. printf() can display messages to the console.
Otherwise, some OSS projects I built on windows did include a variant of log4c that had been ported to windows. So log4c can be coerced into working on windows if you really need it.