360 Appendix E. The GDB Agent Expression Mechanismof the agent, without confusing old versions of GDB, and it should contain a version number. It shouldcontain at least the following information:• whether floating point is supported• whether long long is supported• maximum acceptable size of bytecode stack• maximum acceptable length of bytecode expressions• which registers are actually available for collection• whether the target supports disabled tracepointsE.5. Tracing on SymmetrixThis section documents the API used by the GDB agent to collect data on Symmetrix systems.Cygnus originally implemented these tracing features to help EMC Corporation debug their Sym-metrix high-availability disk drives. The Symmetrix application code already includes substantial trac-ing facilities; the GDB agent for the Symmetrix system uses those facilities for its own data collection,via the API described here.DTC_RESPONSEadbg_find_memory_in_frame (FRAME_DEF *frame, char *address, char**buffer, unsigned int *size) Search the trace frame frame for memory saved from address. Ifthe memory is available, provide the address of the buffer holding it; otherwise, provide the addressof the next saved area.• If the memory at address was saved in frame, set *buffer to point to the buffer in which thatmemory was saved, set *size to the number of bytes from address that are saved at *buffer, andreturn OK_TARGET_RESPONSE. (Clearly, in this case, the function will always set *size to a valuegreater than zero.)• If frame does not record any memory at address, set *size to the distance from address to thestart of the saved region with the lowest address higher than address. If there is no memory savedfrom any higher address, set *size to zero. Return NOT_FOUND_TARGET_RESPONSE.These two possibilities allow the caller to either retrieve the data, or walk the address space to the nextsaved area.This function allows the GDB agent to map the regions of memory saved in a particular frame, andretrieve their contents efficiently.This function also provides a clean interface between the GDB agent and the Symmetrix tracingstructures, making it easier to adapt the GDB agent to future versions of the Symmetrix system, andvice versa. This function searches all data saved in frame, whether the data is there at the request of abytecode expression, or because it falls in one of the format’s memory ranges, or because it was savedfrom the top of the stack. EMC can arbitrarily change and enhance the tracing mechanism, but as longas this function works properly, all collected memory is visible to GDB.The function itself is straightforward to implement. A single pass over the trace frame’s stack area,memory ranges, and expression blocks can yield the address of the buffer (if the requested addresswas saved), and also note the address of the next higher range of memory, to be returned when thesearch fails.As an example, suppose the trace frame f has saved sixteen bytes from address 0x8000 in a bufferat 0x1000, and thirty-two bytes from address 0xc000 in a buffer at 0x1010. Here are some samplecalls, and the effect each would have: