Problem in porting GDB

Jim Blandy jimb@red-bean.com
Tue Dec 20 19:58:00 GMT 2005


In cases like this, you will need your address size (as used in Dwarf
information) to be three bytes, or perhaps four.  This is a GCC
change.  Then, your foo_gdbarch_init function should call
set_gdbarch_addr_bit (..., 24), but since your pointers are 16 bits
long, it should then call set_gdbarch_ptr_bit (..., 16).

In GDB, an "address" is something that indexes all memory available on
the target.  Even if you have separate code and data spaces, you
assign each of them distinct ranges in some larger, imaginary, unified
address space.  This allows functions like read_memory to access any
memory on the system.  In contrast, a "pointer" is a value that uses
the same representation that pointers use in your program.  You can
define ADDRESS_TO_POINTER and POINTER_TO_ADDRESS methods to convert
between the two.  CORE_ADDR holds an address; we use 'struct value' to
store pointers.

This terminology isn't strictly followed in all comments; GDB is old
code.  But that's the discipline that I think our embedded support
tends to favor.



More information about the Gdb mailing list