Logo




Subscribe:
RSS 2.0 | Atom 1.0
Categories:

Sign In


[Giagnocavo]Michael::Write()

# Tuesday, April 05, 2005
Visual Studio 2005 Call Browser

I just used the coolest feature in a while: VS2005's Call Browser.

I'm currently working on some firmware for IP phones and adapters. The chip is the Intel 8051, as used by Centrality Communications in the PA168. It's actually quite fun, programming for an 8-bit system. Apart from writing in C (instead of such high-level things like C#), writing for embedded systems like this adds its own interesting things, like having to decide where a variable will be stored (I think there is 3 different storage locations a variable can have with the 8051). Oh yea, and having to keep things really small, and really fast.

At any rate, I am not that familiar with the entire design of the system, and I just want to focus on adding features to the IAX2 implementation (cause SIP sucks!). A large part of my work is to figure out how things work. Having the Goto Definition (F12) is great for finding specific symbols, but doesn't help with the flow. Up until now, I've been Finding in Files for a specific method, then chasing things down by recursively Finding in Files until I figured out how things are called. This happens a lot, since these devices support 5 protocols and use #ifdefs and generic calls to interface with the different protocols. Add to that 8MB of source, and it's no small task.

This morning, I remembered I had seen a “Call Browser” window in Visual Studio 2005 a while ago. Edit: Apparently this isn't a new feature and has been around since VC6 (at least). Well, it's new to ME, and it's still very cool.

Here's an example. Let's say I want to add attended transfer (where you have a call, press transfer, dial a number, talk to the new call, then hangup to connect the two). I'm looking in the source I'm familar with (the IAX protocol area), and see iax2_hangup(). That's a packet-level call, so when someone physically hangs up, that, somehow, gets called. Where? Well... right click the function, Call Browser -> Show Calls To:


Click... click... click... bingo. Now I've got a complete grasp on the call flow that would send a IAX_COMMAND_HANGUP. My old way (which makes me feel stupid now) of browsing source doesn't even come close. A lot of programming these days is managing complexity. It's all about making the best use of our limited brainspace (some more limited than others). 17 lines/1 small diagram. That's all it takes for me to see this complete flow. How much mental capacity does that require versus browsing multiple locations in 4 different source code files?

Code
Tuesday, April 05, 2005 5:08:28 PM UTC  #    Comments [5]  |  Trackback

Wednesday, April 06, 2005 1:38:44 AM UTC
In VC6 most projects don't have browse info by default so the first time you right click on a function it will prompt you and ask if you want to generate browse info for the project. It takes a while for it to build especially if the source is large but it's worth it. In VC6 you have three option "References", "Calls" and "Called By". To replicate what you are using it for you want "Called By". I work with a library at work that has easily 100+ .c and .h file pairs and often the definition and part of the implementation are in the .h and the rest is in the .c. Having browse info for the project makes it so much faster and more productive. I mean it could take days to track through all those files trying to track a call path. It has become indespensable to me. However "find in files" works great for finding where constants are declared in the windows headers so it's very handy as well.
Friday, June 17, 2005 9:20:34 PM UTC
I'm constantly amused by people that find all these "new" features in their IDE. Of course this "new" feature has existed in Smalltalk for at least 20 years now. And in the Unix world cxref did the same thing outside of an IDE for at least the last 15 years.

I seem to rememeber that VC also used to reference entries in .tld (?) files. Sorry, my memory is a little vague about this since the project I did this on was back in 2003. I don't use VC unless the client requires it, and they provide it. I was using the facility to document the processes in a C application so that I could convert the app to an OO one.
Friday, June 17, 2005 9:50:20 PM UTC
Yea, this turned out to be a post showing off how little I know :). But... all the same, it's still nice.
Tuesday, July 18, 2006 6:11:41 AM UTC
Hi Mike,

I wanted to email you directly, but can't seem to find your email address (I just shot off an email to your dad to find it, but maybe this will be faster ;) .

How did the PA168 programming go? Did you get it to do what you needed?
Thursday, October 12, 2006 8:13:48 AM UTC
PLEASE SEND ME CODE SOURCE FORM EMPLEMENTATION OF SIP AND RTP PAYLOAD FOR DTMF DIGITS.
OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview