EmbeddedRelated.com
Forums
Memfault State of IoT Report

Re: map "C" variables into INFO data memory

Started by Paul Curtis April 14, 2006
Hi Paul,


> I suggest you look at the CrossWorks output again.
 Both x's are named
> 'x' in the module, but they have no external names.

I'll try again, but I have a feeling I mucked it up anyhow, I simply added
'x' in a watch window. 
'x' doesn't come up (and shouldn't) come up as a Global in
the debugger.

It's of course also a matter of scope, the 2 variables shouldn't
"see" each
other since they're locals - static or not - I thought.

> > 2. Does the order of functions make a
difference to their names?
> 
> It should, but from the debugger's view it wouldn't ?

> Usually the external names of statics, if they
exist, are formed from a
> combination of file name, function name, line number, or instance
> number, or special prefix such as @ or $ or a suffix of the same form.
> I've come across all of them, but one thing is certain, if the
function
> in which the static is defined moves, or is renamed, or an additional
> static of the same name is introduced lexicly before, the external name
> of the static changes.

So basically the answer would be that the order of functions _does_ matter ?

What I meant above, was that the symbol name "x" will pop up in the
Locals window
as 'x' when you're in the foo() func, and also as 'x'
when you're in the bar() func...
Does that make better sense ?

B rgds
Kris


Beginning Microcontrollers with the MSP430

Hi Paul,

>> (CW430 uses the same address when the
functions are in the 
>> same module, CWARM uses different) Both seem right ??? (but 
>> only one can be ?)

> I suggest you look at the CrossWorks output again.
 Both x's are named
> 'x' in the module, but they have no external names.

That is correct.
Sorry, I did bugger it up, too quick a test.
In my test 0x200-0x201 is _x, and 0x202-0x203 is _x
They're tracked properly in the Locals window.

I presume the object was to illustrate the difference between Linker and
Debugger
information ?

It's a bit like the question, 
"What's the difference between a global variable and a static local to
main()"

-- Kris




Memfault State of IoT Report