Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / April 2007

Tip: Looking for answers? Try searching our database.

VS2005 - howto logging stack

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
unknown; - 25 Apr 2007 10:17 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.