This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] objdump architecture list


Hi!

As I recently had some trouble finding out the various supported 
architectures in objdump (which are neither in the manpage nor in the
command line help) I wrote the appended patch which displays them along 
with the supported targets for "objdump --help".

Greetings

Matthias

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/binutils/ChangeLog,v
retrieving revision 1.313
diff -u -r1.313 ChangeLog
--- ChangeLog	2001/07/25 15:25:11	1.313
+++ ChangeLog	2001/07/28 21:13:47
@@ -1,3 +1,9 @@
+2001-07-28  Matthias Kramm  <kramm@quiss.org>
+
+	* objdump.c: (usage) Show supported architectures along with 
+	                     supported targets
+	* bucomm.c, bucomm.h: Introduce function list_supported_architectures
+
 2001-07-25  Dave Brolley  <brolley@redhat.com>
 
 	* objdump.c (SKIP_ZEROES): Only define it if it is not already defined.
Index: bucomm.c
===================================================================
RCS file: /cvs/src/src/binutils/bucomm.c,v
retrieving revision 1.8
diff -u -r1.8 bucomm.c
--- bucomm.c	2001/03/13 06:43:57	1.8
+++ bucomm.c	2001/07/28 21:13:47
@@ -168,6 +168,27 @@
     fprintf (f, " %s", bfd_target_vector[t]->name);
   fprintf (f, "\n");
 }
+
+/* List the supported architectures.  */
+
+void
+list_supported_architectures (name, f)
+     const char *name;
+     FILE *f;
+{
+  const char** arch;
+
+  if (name == NULL)
+    fprintf (f, _("Supported architectures:"));
+  else
+    fprintf (f, _("%s: supported architectures:"), name);
+
+  for (arch = bfd_arch_list(); *arch; arch++)
+  {
+    fprintf (f, " %s", *arch);
+  }
+  fprintf (f, "\n");
+}
 
 /* Display the archive header for an element as if it were an ls -l listing:
 
Index: bucomm.h
===================================================================
RCS file: /cvs/src/src/binutils/bucomm.h,v
retrieving revision 1.5
diff -u -r1.5 bucomm.h
--- bucomm.h	2001/03/13 06:43:57	1.5
+++ bucomm.h	2001/07/28 21:13:47
@@ -164,6 +164,8 @@
 
 void list_supported_targets PARAMS ((const char *, FILE *));
 
+void list_supported_architectures PARAMS ((const char *, FILE *));
+
 void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose));
 
 char *make_tempname PARAMS ((char *));
Index: objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.36
diff -u -r1.36 objdump.c
--- objdump.c	2001/07/25 15:25:11	1.36
+++ objdump.c	2001/07/28 21:13:50
@@ -268,6 +268,7 @@
       --adjust-vma=OFFSET        Add OFFSET to all displayed section addresses\n\
 \n"));
       list_supported_targets (program_name, stream);
+      list_supported_architectures (program_name, stream);
 
       disassembler_usage (stream);
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]