3

I need something like this Eclipse - showing full call stack (like when it hits breakpoint in debugger) without putting in breakpoints? : Need to show all code calls that have been performed without breakpoints at present. But for C# .Net. I use MS VS, but if you know other tools with such features - I will be glad.

ADDED: I want something like log of all calls but without implementing logger or introducing everywhere code Debug.WriteLine("StackTrace: '{0}'", Environment.StackTrace);

user1175338
  • 79
  • 3
  • 11
  • You want to get this call stack at which locations? The description is not exactly clear, and there is little information to be gleaned from that linked question unless you already know how Eclipse works (and I don't). What would you propose to *do* with this information? Are you just trying to build a call graph? – Cody Gray - on strike Dec 11 '16 at 18:31
  • See http://stackoverflow.com/questions/8614157/current-possibilities-for-tracing-program-flow-in-c – Sergey Vlasov Dec 12 '16 at 01:18
  • @user1175338, what about this issue? Is the Resharper tool helpful for you? – Jack Zhai Dec 13 '16 at 10:50

2 Answers2

2

One tool Resharper has the Stack Trace Explorer window which can display stack traces information:

https://www.jetbrains.com/help/resharper/2016.2/Reference__Windows__Stack_Trace_Explorer.html

Jack Zhai
  • 6,230
  • 1
  • 12
  • 20
1

Environment stack trace does what you're looking for

https://msdn.microsoft.com/en-us/library/system.environment.stacktrace(v=vs.110).aspx

TigOldBitties
  • 1,331
  • 9
  • 15
  • Thanks for the answer. I may be poorly expressed, but I need all performed calls from a code(log of calls). It means that this code will be everywhere at all finite points of calls: Debug.WriteLine("StackTrace: '{0}'", Environment.StackTrace); – user1175338 Dec 11 '16 at 12:52
  • Sorry, don't understand what you mean. You can use it in a condition if you don't want to call it every time, or use only at points you want it called with an appropriate condition. – TigOldBitties Dec 11 '16 at 12:55
  • I worked with project with legacy code and I don't know this code. I want to see history of all performed calls at current moment. – user1175338 Dec 11 '16 at 13:01