From 9d04d6183d792349aaab84ecb1338b9445c0981b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 22 Apr 1998 05:32:22 +0000 Subject: * Many files: Added gettext invocations around user-visible strings. * bucomm.h: Added gettext-related includes and defines. * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, HAVE_LC_MESSAGES): Define. * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and po/Makefile. Use AM_PROG_LEX. * Makefile.am (SUBDIRS): New macro. (POTFILES): Likewise. (po/POTFILES.in): New target. (LDADD): Added INTLLIBS. (objdump_LDADD): Likewise. (c__filt_LDADD): Likewise. (ar_LDADD): Likewise. (ranlib_LDADD): Likewise. (dlltool_LDADD): Likewise. (windres_LDADD): Likewise. * po/Make-in, po/POTFILES.in, po/binutils.pot: New files. --- binutils/sysdump.c | 100 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 34 deletions(-) (limited to 'binutils/sysdump.c') diff --git a/binutils/sysdump.c b/binutils/sysdump.c index 891ce13..ed365b4 100644 --- a/binutils/sysdump.c +++ b/binutils/sysdump.c @@ -1,21 +1,22 @@ /* Sysroff object format dumper. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 1998 Free Software Foundation, Inc. -This file is part of GNU Binutils. + This file is part of GNU Binutils. -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., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ /* Written by Steve Chamberlain . @@ -23,19 +24,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ This program reads a SYSROFF object file and prints it in an almost human readable form to stdout. */ +#include "bfd.h" +#include "bucomm.h" + #include #include #include #include #include "sysroff.h" -#include -#include "sysdep.h" + #define PROGRAM_VERSION "1.0" -static int h8300; -static int sh; + static int dump = 1; static int segmented_p; static int code; +static int addrsize = 4; static FILE *file; static char * @@ -43,7 +46,7 @@ xcalloc (a, b) int a; int b; { - char *r = xmalloc (a, b); + char *r = xmalloc (a * b); memset (r, 0, a * b); return r; } @@ -130,7 +133,8 @@ fillup (ptr) } if (dump) dh (ptr, size); - return size; + + return size - 1; } barray @@ -168,7 +172,7 @@ getINT (ptr, idx, size, max) return 0; } if (size == -2) - size = 4; + size = addrsize; if (size == -1) size = 0; switch (size) @@ -192,14 +196,17 @@ getINT (ptr, idx, size, max) } int -getBITS (ptr, idx, size) +getBITS (ptr, idx, size, max) char *ptr; int *idx; - int size; + int size, max; { int byte = *idx / 8; int bit = *idx % 8; + if (byte >= max) + return 0; + *idx += size; return (ptr[byte] >> (8 - bit - size)) & ((1 << size) - 1); @@ -305,6 +312,7 @@ getone (type) { struct IT_hd dummy; sysroff_swap_hd_in (&dummy); + addrsize = dummy.afl; sysroff_print_hd_out (&dummy); } break; @@ -484,6 +492,10 @@ opt (x) return getone (x); } +#if 0 + +/* This is no longer used. */ + static void unit_info_list () { @@ -502,6 +514,12 @@ unit_info_list () } } +#endif + +#if 0 + +/* This is no longer used. */ + static void object_body_list () { @@ -514,6 +532,8 @@ object_body_list () } } +#endif + static void must (x) int x; @@ -541,7 +561,7 @@ tab (i, s) static void derived_type (); static void -symbol_info () +dump_symbol_info () { tab (1, "SYMBOL INFO"); while (opt (IT_dsy_CODE)) @@ -564,27 +584,27 @@ derived_type () { if (opt (IT_dpp_CODE)) { - symbol_info (); + dump_symbol_info (); must (IT_dpp_CODE); } else if (opt (IT_dfp_CODE)) { - symbol_info (); + dump_symbol_info (); must (IT_dfp_CODE); } else if (opt (IT_den_CODE)) { - symbol_info (); + dump_symbol_info (); must (IT_den_CODE); } else if (opt (IT_den_CODE)) { - symbol_info (); + dump_symbol_info (); must (IT_den_CODE); } else if (opt (IT_dds_CODE)) { - symbol_info (); + dump_symbol_info (); must (IT_dds_CODE); } else if (opt (IT_dar_CODE)) @@ -609,6 +629,10 @@ derived_type () tab (-1, ""); } +#if 0 + +/* This is no longer used. */ + static void program_structure () { @@ -617,12 +641,18 @@ program_structure () { must (IT_dso_CODE); opt (IT_dss_CODE); - symbol_info (); + dump_symbol_info (); must (IT_dps_CODE); } tab (-1, ""); } +#endif + +#if 0 + +/* This is no longer used. */ + static void debug_list () { @@ -636,6 +666,8 @@ debug_list () tab (-1, ""); } +#endif + static void module () { @@ -687,14 +719,14 @@ show_usage (file, status) FILE *file; int status; { - fprintf (file, "Usage: %s [-hV] in-file\n", program_name); + fprintf (file, _("Usage: %s [-hV] in-file\n"), program_name); exit (status); } static void show_help () { - printf ("%s: Print a human readable interpretation of a SYSROFF object file\n", + printf (_("%s: Print a human readable interpretation of a SYSROFF object file\n"), program_name); show_usage (stdout, 0); } @@ -724,7 +756,7 @@ main (ac, av) show_help (); /*NOTREACHED*/ case 'V': - printf ("GNU %s version %s\n", program_name, PROGRAM_VERSION); + printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION); exit (0); /*NOTREACHED*/ case 0: @@ -744,7 +776,7 @@ main (ac, av) if (!input_file) { - fprintf (stderr, "%s: no input file specified\n", + fprintf (stderr, _("%s: no input file specified\n"), program_name); exit (1); } @@ -752,7 +784,7 @@ main (ac, av) file = fopen (input_file, FOPEN_RB); if (!file) { - fprintf (stderr, "%s: cannot open input file %s\n", + fprintf (stderr, _("%s: cannot open input file %s\n"), program_name, input_file); exit (1); } -- cgit v1.1