www.delorie.com/gnu/docs/gdb/gdbint_7.html   search  
 
Buy the book!


GDB Internals

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Frames

A frame is a construct that GDB uses to keep track of calling and called functions.

FRAME_FP in the machine description has no meaning to the machine-independent part of GDB, except that it is used when setting up a new frame from scratch, as follows:

 
create_new_frame (read_register (FP_REGNUM), read_pc ()));

Other than that, all the meaning imparted to FP_REGNUM is imparted by the machine-dependent code. So, FP_REGNUM can have any value that is convenient for the code that creates new frames. (create_new_frame calls INIT_EXTRA_FRAME_INFO if it is defined; that is where you should use the FP_REGNUM value, if your frames are nonstandard.)

Given a GDB frame, define FRAME_CHAIN to determine the address of the calling function's frame. This will be used to create a new GDB frame struct, and then INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003