diff options
author | dim <dim@FreeBSD.org> | 2010-10-21 19:11:14 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-10-21 19:11:14 +0000 |
commit | 844d5c9852c83cc56dccdc017c27f2bfc0928f05 (patch) | |
tree | 506464413c40d2c6a4a46d04892a9415cb886522 /contrib/binutils/opcodes/dis-buf.c | |
parent | acc1b913a3297e19f9ffe7d2b7b8a3142926d3b4 (diff) | |
parent | 0acbbeece75076693a5c54ce4d376aa9f021b4e3 (diff) | |
download | FreeBSD-src-844d5c9852c83cc56dccdc017c27f2bfc0928f05.zip FreeBSD-src-844d5c9852c83cc56dccdc017c27f2bfc0928f05.tar.gz |
Merge ^vendor/binutils/dist@214082 into contrib/binutils.
Diffstat (limited to 'contrib/binutils/opcodes/dis-buf.c')
-rw-r--r-- | contrib/binutils/opcodes/dis-buf.c | 91 |
1 files changed, 33 insertions, 58 deletions
diff --git a/contrib/binutils/opcodes/dis-buf.c b/contrib/binutils/opcodes/dis-buf.c index 83fbfbd..c2589ba 100644 --- a/contrib/binutils/opcodes/dis-buf.c +++ b/contrib/binutils/opcodes/dis-buf.c @@ -1,20 +1,21 @@ /* Disassemble from a buffer, for GNU. - Copyright 1993, 1994, 1996, 1997, 1998, 1999, 2000 + Copyright 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc. -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 -(at your option) any later version. + 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 + (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. + 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. -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + 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. */ #include "sysdep.h" #include "dis-asm.h" @@ -24,11 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Get LENGTH bytes from info's buffer, at target address memaddr. Transfer them to myaddr. */ int -buffer_read_memory (memaddr, myaddr, length, info) - bfd_vma memaddr; - bfd_byte *myaddr; - unsigned int length; - struct disassemble_info *info; +buffer_read_memory (bfd_vma memaddr, + bfd_byte *myaddr, + unsigned int length, + struct disassemble_info *info) { unsigned int opb = info->octets_per_byte; unsigned int end_addr_offset = length / opb; @@ -46,20 +46,25 @@ buffer_read_memory (memaddr, myaddr, length, info) /* Print an error message. We can assume that this is in response to an error return from buffer_read_memory. */ + void -perror_memory (status, memaddr, info) - int status; - bfd_vma memaddr; - struct disassemble_info *info; +perror_memory (int status, + bfd_vma memaddr, + struct disassemble_info *info) { if (status != EIO) /* Can't happen. */ info->fprintf_func (info->stream, _("Unknown error %d\n"), status); else - /* Actually, address between memaddr and memaddr + len was - out of bounds. */ - info->fprintf_func (info->stream, - _("Address 0x%x is out of bounds.\n"), memaddr); + { + char buf[30]; + + /* Actually, address between memaddr and memaddr + len was + out of bounds. */ + sprintf_vma (buf, memaddr); + info->fprintf_func (info->stream, + _("Address 0x%s is out of bounds.\n"), buf); + } } /* This could be in a separate file, to save miniscule amounts of space @@ -70,9 +75,7 @@ perror_memory (status, memaddr, info) addresses). */ void -generic_print_address (addr, info) - bfd_vma addr; - struct disassemble_info *info; +generic_print_address (bfd_vma addr, struct disassemble_info *info) { char buf[30]; @@ -80,39 +83,11 @@ generic_print_address (addr, info) (*info->fprintf_func) (info->stream, "0x%s", buf); } -#if 0 -/* Just concatenate the address as hex. This is included for - completeness even though both GDB and objdump provide their own (to - print symbolic addresses). */ - -void generic_strcat_address PARAMS ((bfd_vma, char *, int)); - -void -generic_strcat_address (addr, buf, len) - bfd_vma addr; - char *buf; - int len; -{ - if (buf != (char *)NULL && len > 0) - { - char tmpBuf[30]; - - sprintf_vma (tmpBuf, addr); - if ((strlen (buf) + strlen (tmpBuf)) <= (unsigned int) len) - strcat (buf, tmpBuf); - else - strncat (buf, tmpBuf, (len - strlen(buf))); - } - return; -} -#endif - /* Just return true. */ int -generic_symbol_at_address (addr, info) - bfd_vma addr ATTRIBUTE_UNUSED; - struct disassemble_info *info ATTRIBUTE_UNUSED; +generic_symbol_at_address (bfd_vma addr ATTRIBUTE_UNUSED, + struct disassemble_info *info ATTRIBUTE_UNUSED) { return 1; } |