gdb_server, target: Add target_address_bits()

Targets can use this to expose how many address bits there are.
gdb_server uses this to send gdb the appropriate upper limit in the
memory-map. (Before this change the upper limit would only be correct
for 32-bit targets.)

Change-Id: Idb0933255ed53951fcfb05e040674bcdf19441e1
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/4947
Tested-by: jenkins
Reviewed-by: Peter Mamonov <pmamonov@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Tim Newsome
2019-02-25 14:02:30 -08:00
committed by Matthias Welwarsky
parent 85ba2dc4c6
commit 57e30102ea
5 changed files with 43 additions and 6 deletions

View File

@@ -641,7 +641,17 @@ int target_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fi
*/
int target_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c);
/**
* Return the highest accessible address for this target.
*/
target_addr_t target_address_max(struct target *target);
/**
* Return the number of address bits this target supports.
*
* This routine is a wrapper for target->type->address_bits.
*/
unsigned target_address_bits(struct target *target);
/** Return the *name* of this targets current state */
const char *target_state_name(struct target *target);