summaryrefslogtreecommitdiff
path: root/opcodes/s12z-dis.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-10-07 17:48:28 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-10-11 14:07:03 +0100
commitba7c18a48457d949df1f817c46482c5a09ac627d (patch)
treed2f450f6f5f9eded15a3206138e945cd821cc1c3 /opcodes/s12z-dis.c
parentc2c8a427888192f3f438cd3b23cfb372df846270 (diff)
downloadbinutils-gdb-ba7c18a48457d949df1f817c46482c5a09ac627d.tar.gz
s12z/disassembler: call memory_error_func when appropriate
If a call to the read_memory_func fails then we should call the memory_error_func to notify the user of the disassembler of the address that was a problem. Without this GDB will report all memory errors as being at address 0x0. opcodes/ChangeLog: * s12z-disc.c (abstract_read_memory): Call memory_error_func if the read_memory_func call fails.
Diffstat (limited to 'opcodes/s12z-dis.c')
-rw-r--r--opcodes/s12z-dis.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/opcodes/s12z-dis.c b/opcodes/s12z-dis.c
index ec8f4f70883..24125574b78 100644
--- a/opcodes/s12z-dis.c
+++ b/opcodes/s12z-dis.c
@@ -61,6 +61,9 @@ abstract_read_memory (struct mem_read_abstraction_base *b,
int status = (*mra->info->read_memory_func) (mra->memaddr + offset,
bytes, n, mra->info);
+ if (status != 0)
+ (*mra->info->memory_error_func) (status, mra->memaddr + offset,
+ mra->info);
return status != 0 ? -1 : 0;
}