From 14327c1acf60d41c2bd2fa3e482063f5bbaf88ab Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 31 Jan 2019 12:16:15 -0800 Subject: Fix sending memory-map for 64-bit targets. (#348) See #202. I don't have a proper target with >32-bit flash and memory location, so I've been unable to properly test this. However, if I hack the fespi driver to not do anything and run the 64-bit spike tests I can see that the memory map OpenOCD sends now includes the full 64-bit address space: Debug: 3443 975 gdb_server.c:400 gdb_put_packet_inner(): sending packet '$l It will also do this when the target is 32-bit, but that doesn't seem to have any ill effects on gdb. Change-Id: I0fd070ab7366188ff0259d90386f5e1f6985ce21 --- src/server/gdb_server.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/server') diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 3548f16..435195e 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -96,7 +96,7 @@ struct gdb_connection { char *thread_list; }; -#if 0 +#if 1 #define _DEBUG_GDB_IO_ #endif @@ -1919,11 +1919,10 @@ static int gdb_memory_map(struct connection *connection, if (ram_start != 0) xml_printf(&retval, &xml, &pos, &size, "\n", - ram_start, 0-ram_start); - /* ELSE a flash chip could be at the very end of the 32 bit address - * space, in which case ram_start will be precisely 0 - */ + "length=\"" TARGET_ADDR_FMT "\"/>\n", + ram_start, TARGET_ADDR_MAX - ram_start + 1); + /* ELSE a flash chip could be at the very end of the address space, in + * which case ram_start will be precisely 0 */ free(banks); -- cgit v1.1