LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
pblase

subroutine trace tool in editor

Status: New

When working with large programs, especially those with involved user interfaces and the pernicious CallControlCallback or CallPanelCallback functions, it becomes very difficult to follow the program flow when trying to trace a program through all of the various levels of subroutines.

A tool for leaving breadcrumbs, in the order visited, could be very helpful. Right now I use the "breakpoints" as a sort of hyper-bookmark, since the breakpoint facility in LabWindows shows the line number and has the "go to breakpoint" capability in the dialog box. However, this is of limited utility since the dialog box sorts the breakpoints by line number and file, not in order of placement. The bookmark facility doesn't show line numbers nor does it have the goto capability.

 

What is needed is a way of showing the program flow, through routines, in the order visited, in a way similar to the "stack trace" window, except that it needs to be able to show multiple levels simultaneously. This could be done using the existing bookmark facility with the addition of a few items. 1) show file names and line numbers in the bookmark display; 2) allow them to be shown in the order that they were entered, not sorted by line number; 3) add the go-to capability so that I can jump to the location of any bookmark directly.

 

For instance, right now I'm trying to solve a memory problem. A dynamically allocated buffer is being de-allocated before being used, or at least when the error pops up the routine is trying to write to a NULL pointer. I've got to trace through from the starting point and try to understand where in the flow the buffer is being freed and why it's being freed before being written to. Since there are about a half-dozen levels of subroutines, trying to remember what the program flow is and where I'm coming from in trying to trace it can be difficult.

     

2 Comments
Wolfgang
Trusted Enthusiast

If I understand you correctly, you are asking for the capability to log the sequence of function calls with the respective line number? This indeed would be very useful!

pblase
Active Participant

Yes. I'm not talking about during debugging, but rather while reviewing and editing the program. I start in subroutine A, and find a call to B(). I can right-click on B and go to the definition. While exploring B I find a call to subroutine C(). I explore C and now wish to go back to B, where I left to explore C. Regular book marks work for about 3 levels, but any deeper and you start to forget where you were 2 or 3 levels up.