hello,
first of all, i'm using VS2005 and my question is about logging the
stack or how to see the what function calls the other.
i'm aware of the call stack window when the project (in debug/run
mode) stopped at a breakpoint but i want to log it. I want to see what
function calls the other because i think some triggers act strange (or
not as i expect).
my current sollution is this (but i can't imagine that VS2005 doesn't
have a build in functionality something like this )
my question is, is there a build in functionality for this so i don't
have to do this in my whole project if i want to see the flow of my
functions
My current solution for this problem:
(code is in VB)
--------------------------------------------------------------------------------
dim intDebugIndent as integer = 0 'global variable
Private Sub writeDebugLog(ByVal ex As Exception)
Try
Dim strFunction As String = ex.StackTrace
If intDebugIndent > 0 Then
For i As Integer = 0 To intDebugIndent
strFunction = " " & strFunction
Next
End If
Console.WriteLine(strFunction)
Catch exx As Exception
End Try
Return
End Sub
private sub a ()
Try
Try
Throw New Exception()
Catch ex As Exception
writeDebugLog(ex)
intDebugIndent += 1
End Try
'call function b
b()
Catch ex as exception
'handle exception
Finally
intDebugIndent -= 1
End Try
End Sub
private sub b ()
Try
Try
Throw New Exception()
Catch ex As Exception
writeDebugLog(ex)
intDebugIndent += 1
End Try
'do something here
Catch ex as exception
'handle exception
Finally
intDebugIndent -= 1
End Try
End Sub
Igor Solodovnikov - 25 Apr 2007 14:21 GMT
There is some information and source code here:
http://www.codeproject.com/tools/visualleakdetector.asp
> hello,
>
[quoted text clipped - 72 lines]
> End Try
> End Sub