[Cdt-l] finding a function's definition from a call

Doris Wolford prairiesky at yahoo.com
Wed Dec 16 15:27:06 CST 2009

Ha haaa!  I LOVE this group!  While I learn about the CDT (the kind you tramp on in your boots), I find I'm learning something about some CDT computer jargon!  Now who'd o' thunk it?  

By the way, I love the CDT-L.  I helps me stay motivated, inspired, and it teaches me that there are more things I need to do in the ways of preparing before I can hit the trail.  

About flip-flops ... being about 5'1", I am concerned about river crossings for reasons aside from fast water.  I am SHORT!  So at first, I had wanted to plan a sobo trip.  But when I realized that the waters may be running fast and deep, I wasn't sure that would be feasible for me.  So ... I decided to do a nobo.  I really want to walk through Montana, though, daggummit!  And I don't want to have to call my trip short at the very moment I reach the state I want most to visit (oh, I want to see 'em all, but to miss MT would be so disappointing!).  I know I could go back and do it the next year if I can plan well enough. So, I wonder about doing a nobo to the Basin, then driving north and flipping back south from Waterton?  Might that put me in the Winds at the treacherous time of year, do you think?  


From: Jonathan Ley <jonathan at phlumf.com>
To: cdt-l at backcountry.net
Cc: Nicolas Anquetil <anquetil.nicolas at gmail.com>
Sent: Wed, December 16, 2009 3:26:51 PM
Subject: Re: [Cdt-l] finding a function's definition from a call


To answer your question: Yes, you can analyze C programs using the CDT.
You’ll have lots of quiet time to contemplate such questions, and clear
your head of all the clutter that is probably obfuscating the answers
you seek. However, using the CDT for such a thing can take a while...
maybe up to 5 months to get an answer. And even when you're done, you
might have to use other tools like the AT and PCT to do some comparison
with the CDT results. To answer some other questions you might have…

-  Water is not as much of a problem as you might think, you just have
to plan…
-  Pick any route you want in southern NM, they’re all good.
-  Most people say the most dramatic scenery is in the Winds
-  The Big Sandy situation is a bummer… but if you make a reservation
to stay there, they’ll hold a package for you
-  You do need permits in Yellowstone & Glacier, but the process
isn’t so bad… as long as you can stand watching their “bear videos”.
-  It depends on the snowpack
-  June 15th

I haven't heard of the AST... where does that go? 

Good luck out there!


Nicolas Anquetil wrote: 
>This is certainly a basic question but I cannot seem to find clear
>information on the net.
>I want to analyse some C program using CDT.
>When I find in the AST an IASTExpression that I know is a function
>call (instanceof IASTFunctionCallExpression), how can I find where the
>function is defined (in what file) ?
>I am experimenting with a simple C project that has 2 files and one
>function in each file, one of the functions calls the other.
>I could access the name of the FunctionCall and from that the IBinding.
>What next?
>I tried expr.getTranslationUnit().getDefinitionsInAST(name.resolveBinding())
>with either file as translationUnit
>but that gave me an empty array :-(
>May be it comes from how I generate the AST?
>ICProject cproj = CoreModel.getDefault().create(proj);
>for (ICContainer folder : cproj.getSourceRoots()) {
> for (ITranslationUnit unit : folder.getTranslationUnits()) {
>   IASTTranslationUnit unitAST = unit.getAST();
>   [...then explore the AST 'unitAST' to find
>IASTFunctionCallExpression in it ... ]
>Can you help?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.backcountry.net/pipermail/cdt-l/attachments/20091216/036e9707/attachment.html 

More information about the Cdt-l mailing list