This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Problem in porting GDB
- From: Jim Blandy <jimb at red-bean dot com>
- To: Shrirang Khishti <shrirangk at kpitcummins dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 20 Dec 2005 11:58:34 -0800
- Subject: Re: Problem in porting GDB
- References: <4A1BE23A7B777442B60F4B4916AE0F1309474C26@sohm.kpit.com>
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.