views:

92

answers:

7

What rarely used debugging tools you found useful ? My recent debugging situation on Visual Studio required trapping the breakpoint on fresh built 32-bit DLL, which was loaded by GUI-less executable, which was spawned by COM+ server on remote x64 machine, which was called through RPC from actual GUI. As usual, all worked well on all 32 bit machine, but kept failing on "machine other than development one". So remote debugging was inevitable.

So after scratching the head beaten against wall for 2 days, I have added 10 sec delay into DLL attach entry point and used Microsoft Remote Debugger wich I never used before. It saved my day.

Another favorite: Java JMX console as a performance "debugging" tool. You can see all threads, memory chart, have a snapshot of any thread stack any time you click. Clicking several times helps to find what exactly is slow in J2EE application.

+2  A: 

A logic analyzer plugged to CPU pins and able to disassemble executed code. I tracked a bug in the boot sequence of an embedded system.

mouviciel
Nice example. I bet it is rarest or all debuggers
RocketSurgeon
+2  A: 

I find printf to be the most useful.

dsimcha
It may just be how long I have been programming... but I often find this type of debugging much more useful then unit tests.
Matthew Whited
Agree. This what one my teammate always recommends to do first. And sometimes this technique is "rare" as well
RocketSurgeon
+2  A: 

These - in my experience at least - do not seem to be the intuitive first choice for many when debugging apps accessing a database (i.e. the majority), that perhaps they should be :

  • SQL Profiler (SQL Server)
  • TKPROF (Oracle)

Another interesting combination was using eclipse running in a virtual machine, accessing a remote server, attaching to the Tomcat process there; and doing it from two different machines to debug two different packages simultaneously.

davek
Nice find. Multiple debuggers. I thought its only possible for separate processes, not packages in single process
RocketSurgeon
Sorry, I realise I didn't make it clear: it was actually 2 different processes on the server side(and two different listeners), but due to the setup (latency, apache - not really sure)I could only latch onto one of these processes from a single eclipse setup, so we just doubled up and used two machines.
davek
+1  A: 

For Windows/.Net development I am always using Debugview and Ildasm.

Matthew Whited
Thank you for sharing. Debugview ! must to learn it
RocketSurgeon
Pretty handly especially when used with Debug.WriteLine and Trace Source/Listeners. http://www.codeproject.com/KB/dotnet/customnettracelisteners.aspx
Matthew Whited
+2  A: 

All time favorite is depends.exe, for finding out why a dll or exe is not starting http://dependencywalker.com/

For performance, at my former job we used to have really simple to use C++ macro's that did statistics on runtime function calls. This is so much better than a profiler, because you can use it from your regular IDE, and it allows you to zoom in on the code you are optimizing.

In my new job, I wrote a C# version of the same idea.

jdv
Dependencywalker is my other favorite gem
RocketSurgeon