]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Index: opcodes/ChangeLog
authorAndrew Cagney <cagney@redhat.com>
Wed, 3 Sep 2003 23:43:18 +0000 (23:43 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 3 Sep 2003 23:43:18 +0000 (23:43 +0000)
2003-09-03  Andrew Cagney  <cagney@redhat.com>

* dis-init.c (init_disassemble_info): New file and function.
* Makefile.am (CFILES): Add "dis-init.c".
(libopcodes_la_SOURCES): Add "dis-init.c".
(dis-init.lo): Specify dependencies.
* Makefile.in: Regenerate.

Index: include/ChangeLog
2003-08-27  Andrew Cagney  <cagney@redhat.com>

* dis-asm.h (init_disassemble_info): Declare.
(INIT_DISASSEMBLE_INFO): Redefine as a call to
init_disassemble_info.
(INIT_DISASSEMBLE_INFO_NO_ARCH): Ditto.

Index: binutils/ChangeLog
2003-09-03  Andrew Cagney  <cagney@redhat.com>

* objdump.c: Refer to init_disassemble_info in comments.
(disassemble_data): Replace INIT_DISASSEMBLE_INFO with
init_disassemble_info.

binutils/ChangeLog
binutils/objdump.c
include/ChangeLog
include/dis-asm.h
opcodes/ChangeLog
opcodes/Makefile.am
opcodes/Makefile.in
opcodes/dis-init.c [new file with mode: 0644]

index d63b02a24a6d2624ed9c19c11003c44241d62738..f863d980801ecef1432959f277b3eb4cea4dcc93 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-03  Andrew Cagney  <cagney@redhat.com>
+
+       * objdump.c: Refer to init_disassemble_info in comments.
+       (disassemble_data): Replace INIT_DISASSEMBLE_INFO with
+       init_disassemble_info.
+
 2003-09-03  Nick Clifton  <nickc@redhat.com>
 
        * objdump.c (struct objdump_disasm_info): Add new fields
index 9ef5d610ad5710a301fea9781b54d6dc757c4a19..358d3196122757e27cb2f7b7e16422cf8ee10b44 100644 (file)
@@ -66,7 +66,7 @@
 #include "aout/aout64.h"
 
 #ifdef NEED_DECLARATION_FPRINTF
-/* This is needed by INIT_DISASSEMBLE_INFO.  */
+/* This is needed by init_disassemble_info().  */
 extern int fprintf (FILE *, const char *, ...);
 #endif
 
@@ -1789,7 +1789,7 @@ disassemble_data (bfd *abfd)
   /* Sort the symbols into section and symbol order.  */
   qsort (sorted_syms, sorted_symcount, sizeof (asymbol *), compare_symbols);
 
-  INIT_DISASSEMBLE_INFO (disasm_info, stdout, fprintf);
+  init_disassemble_info (&disasm_info, stdout, fprintf);
 
   disasm_info.application_data = (void *) &aux;
   aux.abfd = abfd;
index 971de5060a9bf31d7d43aad513236b7ebf295c71..3852e7d7ba73012b21045be476672bb65d0b271c 100644 (file)
@@ -1,3 +1,10 @@
+2003-08-27  Andrew Cagney  <cagney@redhat.com>
+
+       * dis-asm.h (init_disassemble_info): Declare.
+       (INIT_DISASSEMBLE_INFO): Redefine as a call to
+       init_disassemble_info.
+       (INIT_DISASSEMBLE_INFO_NO_ARCH): Ditto.
+
 2003-08-20  Nick Clifton  <nickc@redhat.com>
 
        * bfdlink.h (enum report_method): New enum.  Describes how to
index 1d67ae414a10e972fa65e18fb5403a7702249b9c..6bdd7517de537d51611534cf9b1823a5a8e59de2 100644 (file)
@@ -284,42 +284,17 @@ extern void generic_print_address
 extern int generic_symbol_at_address
   (bfd_vma, struct disassemble_info *);
 
-/* Macro to initialize a disassemble_info struct.  This should be called
-   by all applications creating such a struct.  */
-#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
-  (INFO).flavour = bfd_target_unknown_flavour, \
-  (INFO).arch = bfd_arch_unknown, \
-  (INFO).mach = 0, \
-  (INFO).insn_sets = 0, \
-  (INFO).endian = BFD_ENDIAN_UNKNOWN, \
-  (INFO).octets_per_byte = 1, \
-  INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC)
-
-/* Call this macro to initialize only the internal variables for the
-   disassembler.  Architecture dependent things such as byte order, or machine
-   variant are not touched by this macro.  This makes things much easier for
-   GDB which must initialize these things separately.  */
+/* Method to initialize a disassemble_info struct.  This should be
+   called by all applications creating such a struct.  */
+extern void init_disassemble_info (struct disassemble_info *info, void *stream,
+                                  fprintf_ftype fprintf_func);
 
+/* For compatibility with existing code.  */
+#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
+  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
 #define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
-  (INFO).fprintf_func = (fprintf_ftype)(FPRINTF_FUNC), \
-  (INFO).stream = (STREAM), \
-  (INFO).section = NULL, \
-  (INFO).symbols = NULL, \
-  (INFO).num_symbols = 0, \
-  (INFO).private_data = NULL, \
-  (INFO).buffer = NULL, \
-  (INFO).buffer_vma = 0, \
-  (INFO).buffer_length = 0, \
-  (INFO).read_memory_func = buffer_read_memory, \
-  (INFO).memory_error_func = perror_memory, \
-  (INFO).print_address_func = generic_print_address, \
-  (INFO).symbol_at_address_func = generic_symbol_at_address, \
-  (INFO).flags = 0, \
-  (INFO).bytes_per_line = 0, \
-  (INFO).bytes_per_chunk = 0, \
-  (INFO).display_endian = BFD_ENDIAN_UNKNOWN, \
-  (INFO).disassembler_options = NULL, \
-  (INFO).insn_info_valid = 0
+  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
+
 
 #ifdef __cplusplus
 }
index 813e2841066e0496a4ee12f21e70ce88a881f09d..bde6e507272aef20c8fa27b02cd3aabe60f51a3d 100644 (file)
@@ -1,3 +1,11 @@
+2003-09-03  Andrew Cagney  <cagney@redhat.com>
+
+       * dis-init.c (init_disassemble_info): New file and function.
+       * Makefile.am (CFILES): Add "dis-init.c".
+       (libopcodes_la_SOURCES): Add "dis-init.c".
+       (dis-init.lo): Specify dependencies.
+       * Makefile.in: Regenerate.
+
 2003-09-03  Dave Brolley  <brolley@redhat.com>
 
        * frv-*: Regenerated.
index 0bb7fd200450739346907aa114e431f538d6fa61..9adf2efcbd7f430c50a532442231d5c45000d593 100644 (file)
@@ -63,6 +63,7 @@ CFILES = \
        d30v-opc.c \
        dlx-dis.c \
        dis-buf.c \
+       dis-init.c \
        disassemble.c \
        fr30-asm.c \
        fr30-desc.c \
@@ -281,7 +282,7 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFI
 disassemble.lo: disassemble.c $(INCDIR)/dis-asm.h
        $(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $(srcdir)/disassemble.c
 
-libopcodes_la_SOURCES =  dis-buf.c disassemble.c
+libopcodes_la_SOURCES =  dis-buf.c disassemble.c dis-init.c
 libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
 libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
 libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
@@ -553,6 +554,8 @@ dlx-dis.lo: dlx-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/dlx.h
 dis-buf.lo: dis-buf.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h
+dis-init.lo: dis-init.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+  $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h
 disassemble.lo: disassemble.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h
 fr30-asm.lo: fr30-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
index 0c51eb1a779d59928dd6159a79af8a7a0629f232..a78ba4f4ac6ad813e6c7efd8a8d662cc96f874ef 100644 (file)
@@ -174,6 +174,7 @@ CFILES = \
        d30v-opc.c \
        dlx-dis.c \
        dis-buf.c \
+       dis-init.c \
        disassemble.c \
        fr30-asm.c \
        fr30-desc.c \
@@ -391,7 +392,7 @@ OFILES = @BFD_MACHINES@
 
 INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl
 
-libopcodes_la_SOURCES = dis-buf.c disassemble.c
+libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
 libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
 libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
 libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
@@ -455,7 +456,7 @@ libopcodes_a_SOURCES = libopcodes.a.c
 libopcodes_a_OBJECTS =  libopcodes.a.$(OBJEXT)
 LTLIBRARIES =  $(bfdlib_LTLIBRARIES)
 
-libopcodes_la_OBJECTS =  dis-buf.lo disassemble.lo
+libopcodes_la_OBJECTS =  dis-buf.lo disassemble.lo dis-init.lo
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -1049,6 +1050,8 @@ dlx-dis.lo: dlx-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/dlx.h
 dis-buf.lo: dis-buf.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h
+dis-init.lo: dis-init.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+  $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h
 disassemble.lo: disassemble.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h
 fr30-asm.lo: fr30-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
diff --git a/opcodes/dis-init.c b/opcodes/dis-init.c
new file mode 100644 (file)
index 0000000..4c3e36e
--- /dev/null
@@ -0,0 +1,41 @@
+/* Initialize "struct disassemble_info".
+
+   Copyright 2003 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 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.  */
+
+#include "sysdep.h"
+#include "dis-asm.h"
+#include "bfd.h"
+
+void
+init_disassemble_info (struct disassemble_info *info, void *stream,
+                      fprintf_ftype fprintf_func)
+{
+  memset (info, 0, sizeof (*info));
+  info->flavour = bfd_target_unknown_flavour;
+  info->arch = bfd_arch_unknown;
+  info->endian = BFD_ENDIAN_UNKNOWN;
+  info->octets_per_byte = 1;
+  info->fprintf_func = fprintf_func;
+  info->stream = stream;
+  info->read_memory_func = buffer_read_memory;
+  info->memory_error_func = perror_memory;
+  info->print_address_func = generic_print_address;
+  info->symbol_at_address_func = generic_symbol_at_address;
+  info->display_endian = BFD_ENDIAN_UNKNOWN;
+}
+