This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem in porting GDB


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]