Embedded Systems Firmware Demystified

Overlaying a C Structure onto Memory

Wouldn t it be nice to be able to display memory as structures and linked lists? The problem with doing this action at the monitor level is that the monitor doesn t usually have access to the information that the compiler/linker provides regarding the format of a structure. Because I am now assuming I have a file system, one might think that I could put the tool set-generated data in a file and allow the monitor to parse through it. I could, but parsing this data (the symbol table generated by the compiler) can be complicated, especially when you consider the fact that the format of this file could be very different from one compiler to the next. Even if I limit myself to a particular file format (say, ELF), the symbol table format might not be the same from one compiler to the next. A simpler approach is to create a command in the monitor that can look to a structure-definition file in the file system to determine how to overlay a structured display on top of a block of memory on the target. This approach eliminates all dependency on some external file format; hence, it works regardless of CPU type or toolset.

The structure definition file is an ASCII file that contains structure definitions almost as they would be seen within a C header file. The command in the monitor, called cast, can then use this file as a reference when asked to...

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: File Compression Software
Finish!
Privacy Policy

This is embarrasing...

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