projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[ARC] Add ldbit for nps
[binutils-gdb.git]
/
opcodes
/
dis-buf.c
diff --git
a/opcodes/dis-buf.c
b/opcodes/dis-buf.c
index c2589ba03f1b935f756620d2dd28f9d5c0e67a33..d46c7720a0aeb83e29822164bd24be0d217a8845 100644
(file)
--- a/
opcodes/dis-buf.c
+++ b/
opcodes/dis-buf.c
@@
-1,16
+1,17
@@
/* Disassemble from a buffer, for GNU.
/* Disassemble from a buffer, for GNU.
- Copyright 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2016 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ This file is part of the GNU opcodes library.
+
+ This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2 of the License, or
-
(at your option)
any later version.
+ the Free Software Foundation; either version
3, or (at your option)
+ any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
GNU General Public
License for more details.
+ It is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the 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
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
@@
-32,11
+33,14
@@
buffer_read_memory (bfd_vma memaddr,
{
unsigned int opb = info->octets_per_byte;
unsigned int end_addr_offset = length / opb;
{
unsigned int opb = info->octets_per_byte;
unsigned int end_addr_offset = length / opb;
- unsigned int max_addr_offset = info->buffer_length / opb;
+ unsigned int max_addr_offset = info->buffer_length / opb;
unsigned int octets = (memaddr - info->buffer_vma) * opb;
if (memaddr < info->buffer_vma
unsigned int octets = (memaddr - info->buffer_vma) * opb;
if (memaddr < info->buffer_vma
- || memaddr - info->buffer_vma + end_addr_offset > max_addr_offset)
+ || memaddr - info->buffer_vma > max_addr_offset
+ || memaddr - info->buffer_vma + end_addr_offset > max_addr_offset
+ || (info->stop_vma && (memaddr >= info->stop_vma
+ || memaddr + end_addr_offset > info->stop_vma)))
/* Out of bounds. Use EIO because GDB uses it. */
return EIO;
memcpy (myaddr, info->buffer + octets, length);
/* Out of bounds. Use EIO because GDB uses it. */
return EIO;
memcpy (myaddr, info->buffer + octets, length);