Navigate to line of code where event was generated

Code profiling for .NET Developers

Moderators: Luke Jefferson, StephenC, Alex.Davies, AndrewH, melvyn.harbour, Laura Morley

Navigate to line of code where event was generated

Postby adkamdar » Thu Sep 30, 2010 4:58 pm

Hello,

Is there a way to navigate from an event marker displayed in the events bar to the line of code which generated the event?

Assuming the method source is available, I have noticed that clicking on an event in the event bar highlights the method from which the event was generated, and also displays the method source code in the source code pane. But I haven't yet been able to figure out how to get to the specific line of code in that method that caused the event, even when profiling with line level timings.

Thanks.

Ajay
adkamdar
 
Posts: 2
Joined: Thu Sep 30, 2010 4:42 pm

Postby StephenC » Thu Sep 30, 2010 5:38 pm

If I've understood correctly the only way you can sort of achieve what you are looking for is when you put the .SignalEvent("my message") into your code you simply read what the message is from the tooltip placed on the event bar.

Apart from marking key signal events with a different message to act as unique identifiers there's no other way to jump to a line of code, only methods.

Regards,

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Postby adkamdar » Thu Sep 30, 2010 5:48 pm

Hi Stephen,

In my case the event is actually an invalid operation exception that gets thrown very sporadically, and could possibly be coming from a couple of different places in the same method. So I was hoping to jump straight to the line of code that caused it without having to instrument the code. But in any case, thanks for your quick response.

Regards,

Ajay
adkamdar
 
Posts: 2
Joined: Thu Sep 30, 2010 4:42 pm

Postby StephenC » Thu Sep 30, 2010 6:04 pm

You might want to give our exception hunter tool a try,

http://www.red-gate.com/products/Except ... /index.htm

Take a look at the walkthrough and demo to see if might help.

It can identify lines where particular exceptions can be thrown. You might be able to identify the problem or at least narrow the problem down.

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Postby simon.jackson » Fri Oct 01, 2010 9:02 am

Another option is to attach the Visual Studio debugger and put exception catch on only for InvalidOperationException.

[Ctrl + Alt E]
simon.jackson
 
Posts: 45
Joined: Thu Jan 08, 2009 10:42 am


Return to ANTS Performance Profiler 6

Who is online

Users browsing this forum: No registered users and 0 guests