"Offline Debugging" (hardware trace)

Questions about YourKit Java Profiler
Post Reply
rblasch
Posts: 64
Joined: Mon Jan 10, 2005 7:13 pm

"Offline Debugging" (hardware trace)

Post by rblasch »

This is just a wild thought, maybe not even feasable, maybe out of scope, related to http://forums.yourkit.com/viewtopic.php?t=113, but here goes: How about a kind of "offline debugger," which can store and replay executions.

That is, you open a recorded snapshot, select a thread and a time and then you can step into, step over, inspect parameters, etc, just like you would in an "online" debugger. (Probably just a subset of operations available to online debuggers)
On error, people would turn on recording and submit the snapshot as part of the bug report.

I think the official name for such a beast is "hardware trace."
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Hello,

I personally think that recording of all operations would take too much resources and slow down application very much.

Anyway, implementations of similar ideas already exist. E.g. "Back in time" debugger http://www.omnicore.com/debugger.htm . I never used it myself.

And I saw a presentation of another debugger that recorded all operations and allowed to return to the past to see e.g. who assigned a particular variable to an illegal value.

Theoretically, this would be a killer tool. But in the reality, it makes application tooo heavy, even toy examples...

Best regards,
Anton
rblasch
Posts: 64
Joined: Mon Jan 10, 2005 7:13 pm

Post by rblasch »

How about a heavily simplified version, like the following. Don't know if people would like it or find is useful, though.

The cpu tracing profile could get melded into the IDE. I am thinking here specifically of IntelliJ IDEA.

To the left of the method signature, the total method time would get printed, at each method invocation in the body their respective times.

Single invocations of the method could be selected, and only the times (and invocations) from this run would get printed. It should be possible to select invocation by system time. In this view, you'd see a number to the left of each method, how often it was called. It would look similar to the output of a code coverage tool.

One could infere quite a bit from these hints. Say, you have got a loop that calls some method to work on a data item. If there's a method call in the loop, you'd see its number of invocations, so you know how many times the loop ran.
Or if you got an if(), both branches calling a method. The one having an invocation count of 1 was actually called.

It would be some sort of primitive trace. Probably useful if no other, more detailed information, is available. On the other hand, it might not. I might as well stop wasting your time... :wink:
Post Reply