Embedded Systems Firmware Demystified

Adding Symbolic Capabilities

Though I won t go into the coding details here, it is relatively straightforward to give the monitor some symbolic capabilities. The CLI already has the plumbing necessary to recognize and evaluate script variables. It doesn t take much to extend this mechanism so that it also searches a special file for otherwise undefined symbols.

For example, if I have a file called symtbl in flash memory and it has the following lines in it:

main
0x123456
func1
0x123600
func2
0x123808
varA
0x128000
varB
0x128004
varC
0x12800c

Then I execute a script with the following two lines in it:

echo The address of main() is %mainecho The variable 'varA' is located at %varA

The output

The address of main() is 0x123456

The variable varA is located at 0x128000

MicroMonitor even allows me to change the previous at command from

at ADDR_1 0x1234()==1 BREAK

to

at ADDR_1 %{func_name}()==1 BREAK

because I can replace 0x1234 with the real function name. The only thing I need is the ability to generate, from an application, the symtbl file. This ability to generate the symtbl file is dependent on the tool set (compiler/linker) that you re using, but it should be a simple process regardless.

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Circular Variable Filters
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.