X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ftarget-memory.c;h=b33b24b613a908ca5d4a341a82aaa20e351a9f9e;hb=07e059b5a9cbdeab8bf2980e07e79f892a2da854;hp=64c16e1ac0597cb97d490fbe97956c1cb195e948;hpb=a76d924dffcb040b44a2bb5be026f0c974590c30;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/target-memory.c b/gdb/target-memory.c index 64c16e1ac0..b33b24b613 100644 --- a/gdb/target-memory.c +++ b/gdb/target-memory.c @@ -1,14 +1,13 @@ /* Parts of target interface that deal with accessing memory and memory-like objects. - Copyright (C) 2006 - Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -17,9 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include "defs.h" #include "vec.h" @@ -87,10 +84,10 @@ claim_memory (VEC(memory_write_request_s) *blocks, { struct memory_write_request *n = VEC_safe_push (memory_write_request_s, *result, NULL); - memset (n, 0, sizeof (struct memory_write_request)); + *n = *r; n->begin = claimed_begin; n->end = claimed_end; - n->data = r->data + (claimed_begin - r->begin); + n->data += claimed_begin - r->begin; } } } @@ -167,7 +164,7 @@ blocks_to_erase (VEC(memory_write_request_s) *written) CORE_ADDR begin, end; block_boundaries (ptr->begin, &begin, 0); - block_boundaries (ptr->end, 0, &end); + block_boundaries (ptr->end - 1, 0, &end); if (!VEC_empty (memory_write_request_s, result) && VEC_last (memory_write_request_s, result)->end >= begin)