3

I have used Postsharp a few years ago to trace program flow during execution without needing to manually add trace statements to the methods.

Is there any other new ways to trace execution to to debug output in a similar way?

(Preferably a way that doesn't need to instrument the built assemblies. Maybe not possible?)

Carl R
  • 8,104
  • 5
  • 48
  • 80
  • From what I understand, [aspect-orientated programming](http://en.wikipedia.org/wiki/Aspect-oriented_programming) in C# _always_ requires post-processing of your compiled code. – Uwe Keim Dec 23 '11 at 09:31

2 Answers2

4

If you only want this ability at debug time, there's Microsoft IntelliTrace that's a part of Visual Studio 2010 Ultimate, and there's Sergey Vlasov's RunTime Flow. The former makes your program run very slow. Haven't tried the latter.

Omer Raviv
  • 11,409
  • 5
  • 43
  • 82
  • I use the ultimate edition so IntelliTrace is definitely interesting. Thanks! – Carl R Dec 23 '11 at 10:21
  • Intellitrace feels a little difficult to navigate but fits perfectly since it's available on all developer computers here. Great! Thanks a lot! :) – Carl R Dec 23 '11 at 14:15
3

Gibraltar uses PostSharp, but provides you with a very powerful client for visualizing your program flow. You can also compare snapshots, view statistics, etc.. Unfortunately it's not free :)

Moreover, most dependency injection frameworks (Unity, Windsor, Ninject, ...) provide method interception. In most cases, you can define traced methods within the app.config file. However, I prefer PostSharp :)

Matthias
  • 15,919
  • 5
  • 39
  • 84
  • Do you have any experience in how much overhead Gibraltar adds to instrumented programs? – Carl R Dec 23 '11 at 10:25
  • No :\ But due to the fact, that PostSharp transforms the assemblies, there should be a minimum of overhead. I guess they use a Tcp/UdpClient in an async manner for data transfer. – Matthias Dec 23 '11 at 12:31
  • The Gibraltar concept seems very interesting. I'll make sure we'll try it for some fitting project in the near future. Thank you! :) – Carl R Dec 23 '11 at 14:17
  • Gibraltar is designed for use in production - we have guidance on how to inject a lot of information without dragging down your application. Give us a try and we're happy to work with you to find the sweet spot for your situation! – Kendall Miller Sep 13 '12 at 14:46