scripts: coredump: fix crashing on non-existent memory region
get_mem_region() may return None for a non-existent memory region so we need to check first before looking at its properties. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
e932a1537c
commit
1387e7c7c2
|
@ -139,13 +139,14 @@ class GdbStub(abc.ABC):
|
|||
barray = b''
|
||||
r = get_mem_region(addr)
|
||||
while remaining > 0:
|
||||
if addr > r['end']:
|
||||
r = get_mem_region(addr)
|
||||
|
||||
if r is None:
|
||||
barray = None
|
||||
break
|
||||
|
||||
if addr > r['end']:
|
||||
r = get_mem_region(addr)
|
||||
continue
|
||||
|
||||
offset = addr - r['start']
|
||||
barray += r['data'][offset:offset+1]
|
||||
|
||||
|
|
Loading…
Reference in New Issue