]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - binutils/cxxfilt.c
* addr2line.c (main): Likewise.
[thirdparty/binutils-gdb.git] / binutils / cxxfilt.c
index f41493b74edd45c4fdd3b0d0afb3cb10dafd1a1a..f0a3a9e5ba375b1ef1d1374944aa51f993e22660 100644 (file)
@@ -19,8 +19,8 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 #include "config.h"
 #include "bfd.h"
@@ -73,7 +73,8 @@ static void
 usage (FILE *stream, int status)
 {
   fprintf (stream, "\
-Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",
+Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores]\n\
+       [-p] [--no-params]\n",
           program_name);
 
   fprintf (stream, "\
@@ -91,8 +92,7 @@ Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",
   exit (status);
 }
 
-#define MBUF_SIZE 32767
-char mbuffer[MBUF_SIZE];
+static char mbuffer[32767];
 
 int strip_underscore = 0;
 
@@ -100,6 +100,7 @@ static const struct option long_options[] = {
   {"strip-underscores", no_argument, 0, '_'},
   {"format", required_argument, 0, 's'},
   {"help", no_argument, 0, 'h'},
+  {"no-params", no_argument, 0, 'p'},
   {"no-strip-underscores", no_argument, 0, 'n'},
   {"version", no_argument, 0, 'v'},
   {0, no_argument, 0, 0}
@@ -169,9 +170,11 @@ main (int argc, char **argv)
   program_name = argv[0];
   xmalloc_set_program_name (program_name);
 
+  expandargv (&argc, &argv);
+
   strip_underscore = TARGET_PREPENDS_UNDERSCORE;
 
-  while ((c = getopt_long (argc, argv, "_ns:", long_options, (int *) 0)) != EOF)
+  while ((c = getopt_long (argc, argv, "_nps:", long_options, (int *) 0)) != EOF)
     {
       switch (c)
        {
@@ -183,6 +186,9 @@ main (int argc, char **argv)
        case 'n':
          strip_underscore = 0;
          break;
+       case 'p':
+         flags &= ~ DMGL_PARAMS;
+         break;
        case 'v':
          print_version ("c++filt");
          return (0);
@@ -238,19 +244,19 @@ main (int argc, char **argv)
 
       for (;;)
        {
-         int i = 0;
+         unsigned i = 0;
          c = getchar ();
          /* Try to read a label.  */
          while (c != EOF && (ISALNUM (c) || strchr (valid_symbols, c)))
            {
-             if (i >= MBUF_SIZE-1)
+             if (i >= sizeof (mbuffer) - 1)
                break;
              mbuffer[i++] = c;
              c = getchar ();
            }
          if (i > 0)
            {
-             int skip_first = 0;
+             unsigned skip_first = 0;
 
              mbuffer[i] = 0;
              if (mbuffer[0] == '.' || mbuffer[0] == '$')