How to get list of local variables with respect to each functions.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get list of local variables with respect to each functions.

588 Views
hareeshakoratik
Contributor II

Dear All,

 

                From .map file I can see,

  • DEPENDENCY TREE: Shows, in a tree format, all detected dependencies between functions. Also displays overlapping Locals displayed at their defining function.
  • OBJECT DEPENDENCY: Lists every function and variable that uses other global objects and the names of these global objects.
  • OBJECT ALLOCATION: Contains list of variables and function in each c file.


But I want know local variable list with respect to each function. I mean how many and which are all local variables belongs to each function. May I know  where I can find these information in my project.

I am using (S9S12G128F0MLF - LQFO48) Controller and Code Warrior IDE Version 5.9.0

 

Thanks & Regards,

Hareesha.

Labels (1)
3 Replies

485 Views
trytohelp
NXP Employee
NXP Employee

Hi,

I've tried with CW for HC12 v5.1 which is probably the version you're using.

The local variables are using stack.

I've tried to find a way to extract the information your request via map file and decoder tool without success.

The information is delivered for the global variables only.

Now the information is provided in the Inspector component.

You must launch the debugger to have access to this feature.

Under Component + Open ...  select Inspect.

A new component will appear: Inspect.

Under Symbol Table you could check for each module, function the variables associated and other information.

This is the right way to check it.

pastedImage_0.png


Have a great day,
Pascal Irrle

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

485 Views
hareeshakoratik
Contributor II

Hi Pascal,

                Thanks for the information. I have verified according to your suggestion.

                I am able to get the information as follow:

  • Ø Inspect
  • Symbol Table
  • .c file Name
  • Function Names
    • Local Variables
    • Static Variables
  • Global Variables

But I want see ONLY local variables with respect to each functions. I have many .c files and functions in our project.

And how I can extract these information into a file, so that it is easy to  filter, verify, analyze etc.

Thanks in advance.

Regards,

Hareesha.

485 Views
trytohelp
NXP Employee
NXP Employee

Hareesha,

The linker can generate a statistic file but it includes global variables only:

main.c.o    main    2129920    15    2    .text        

main.c.o    test_function_1    2129935    38    2    .text        

main.c.o    val    2304    2    4    .data        

Start12.c.o    Init    2129973    41    2    .text        

Start12.c.o    _Startup    49152    11    0    .init        

The Burner can not generate this type of doc too.

Unfortunately with the Inspect component can not export something.

For me there is not way to create the document you're looking for.


Have a great day,
Pascal Irrle

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos