| ||
Though I wont 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 doesnt 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 %main echo 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 youre using, but it should be a simple process regardless.
| ||