diff options
Diffstat (limited to 'gdb/target-memory.c')
-rw-r--r-- | gdb/target-memory.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/target-memory.c b/gdb/target-memory.c index 8479353..b864d50 100644 --- a/gdb/target-memory.c +++ b/gdb/target-memory.c @@ -84,6 +84,7 @@ claim_memory (VEC(memory_write_request_s) *blocks, { struct memory_write_request *n = VEC_safe_push (memory_write_request_s, *result, NULL); + *n = *r; n->begin = claimed_begin; n->end = claimed_end; @@ -116,8 +117,8 @@ split_regular_and_flash_blocks (VEC(memory_write_request_s) *blocks, while (1) { VEC(memory_write_request_s) **r; - region = lookup_mem_region (cur_address); + region = lookup_mem_region (cur_address); r = region->attrib.mode == MEM_FLASH ? flash_blocks : regular_blocks; cur_address = region->hi; claim_memory (blocks, r, region->lo, region->hi); @@ -175,6 +176,7 @@ blocks_to_erase (VEC(memory_write_request_s) *written) { struct memory_write_request *n = VEC_safe_push (memory_write_request_s, result, NULL); + memset (n, 0, sizeof (struct memory_write_request)); n->begin = begin; n->end = end; @@ -255,6 +257,7 @@ compute_garbled_blocks (VEC(memory_write_request_s) *erased_blocks, { struct memory_write_request *n = VEC_safe_push (memory_write_request_s, result, NULL); + memset (n, 0, sizeof (struct memory_write_request)); n->begin = erased.begin; n->end = written->begin; @@ -300,6 +303,7 @@ static void cleanup_write_requests_vector (void *p) { VEC(memory_write_request_s) **v = p; + VEC_free (memory_write_request_s, *v); } |