Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: gdb@sources.redhat.com
Subject: [RFA] remove fprintf (stderr, ...) from dwarf2read.c
Date: Thu, 14 Feb 2002 04:04:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20020214123916.019a6840@ics.u-strasbg.fr> (raw)

Probably the obvious rule could apply here, 
but since my last "obvious fix" was a total fiasco,
I prefer to ask once again for permission here.

There are several other files that use
   fprintf (stderr,...)

Here is the complete list I found:
arm-tdep.c
f-lang.c
hpread.c
i386-stub.c
m68k-stub.c
remote-array.c
remote-es.c
remote-os9k.c
remote-st.c
stop-gdb.c
symm-nat.c
gdbserver/gdbreplay.c
gdbserver/linux-low.c
gdbserver/low-hppabsd.c
gdbserver/low-lynx.c
gdbserver/low-nbsd.c
gdbserver/low-sim.c
gdbserver/low-sparc.c
gdbserver/low-sun3.c
gdbserver/remote-utils.c
gdbserver/server.c
gdbserver/utils.c
nindy-share/Onindy.c
nindy-share/nindy.c
nlm/gdbserve.c
rdi-share/devsw.c
rdi-share/etherdrv.c
rdi-share/hsys.c


Some of these files, like i386-stub.c and m68k-stub.c don't even use defs.h
(which contains the declaration of fprintf_unfiltered)
and thus should not be changed but for most  others (at least at gdb dir level)
should be changed, no ?


2002-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
          dwarf2read.c: Replace fprintf (stderr, ...) by fprintf_unfiltered (gdb_stderr, ...)


Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.47
diff -u -p -r1.47 dwarf2read.c
--- dwarf2read.c        2002/01/20 19:42:04     1.47
+++ dwarf2read.c        2002/02/14 11:39:21
@@ -5617,29 +5617,29 @@ dump_die (struct die_info *die)
  {
    unsigned int i;

-  fprintf (stderr, "Die: %s (abbrev = %d, offset = %d)\n",
+  fprintf_unfiltered (gdb_stderr, "Die: %s (abbrev = %d, offset = %d)\n",
            dwarf_tag_name (die->tag), die->abbrev, die->offset);
-  fprintf (stderr, "\thas children: %s\n",
+  fprintf_unfiltered (gdb_stderr, "\thas children: %s\n",
            dwarf_bool_name (die->has_children));

-  fprintf (stderr, "\tattributes:\n");
+  fprintf_unfiltered (gdb_stderr, "\tattributes:\n");
    for (i = 0; i < die->num_attrs; ++i)
      {
-      fprintf (stderr, "\t\t%s (%s) ",
+      fprintf_unfiltered (gdb_stderr, "\t\t%s (%s) ",
                dwarf_attr_name (die->attrs[i].name),
                dwarf_form_name (die->attrs[i].form));
        switch (die->attrs[i].form)
         {
         case DW_FORM_ref_addr:
         case DW_FORM_addr:
-         fprintf (stderr, "address: ");
+         fprintf_unfiltered (gdb_stderr, "address: ");
           print_address_numeric (DW_ADDR (&die->attrs[i]), 1, gdb_stderr);
           break;
         case DW_FORM_block2:
         case DW_FORM_block4:
         case DW_FORM_block:
         case DW_FORM_block1:
-         fprintf (stderr, "block: size %d", DW_BLOCK (&die->attrs[i])->size);
+         fprintf_unfiltered (gdb_stderr, "block: size %d", DW_BLOCK (&die->attr
s[i])->size);
           break;
         case DW_FORM_data1:
         case DW_FORM_data2:
@@ -5650,30 +5650,30 @@ dump_die (struct die_info *die)
         case DW_FORM_ref4:
         case DW_FORM_udata:
         case DW_FORM_sdata:
-         fprintf (stderr, "constant: %ld", DW_UNSND (&die->attrs[i]));
+         fprintf_unfiltered (gdb_stderr, "constant: %ld", DW_UNSND (&die->attrs
[i]));
           break;
         case DW_FORM_string:
         case DW_FORM_strp:
-         fprintf (stderr, "string: \"%s\"",
+         fprintf_unfiltered (gdb_stderr, "string: \"%s\"",
                    DW_STRING (&die->attrs[i])
                    ? DW_STRING (&die->attrs[i]) : "");
           break;
         case DW_FORM_flag:
           if (DW_UNSND (&die->attrs[i]))
-           fprintf (stderr, "flag: TRUE");
+           fprintf_unfiltered (gdb_stderr, "flag: TRUE");
           else
-           fprintf (stderr, "flag: FALSE");
+           fprintf_unfiltered (gdb_stderr, "flag: FALSE");
           break;
         case DW_FORM_indirect:
           /* the reader will have reduced the indirect form to
              the "base form" so this form should not occur */
-         fprintf (stderr, "unexpected attribute form: DW_FORM_indirect");
+         fprintf_unfiltered (gdb_stderr, "unexpected attribute form: DW_FORM_in
direct");
           break;
         default:
-         fprintf (stderr, "unsupported attribute form: %d.",
+         fprintf_unfiltered (gdb_stderr, "unsupported attribute form: %d.",
                    die->attrs[i].form);
         }
-      fprintf (stderr, "\n");
+      fprintf_unfiltered (gdb_stderr, "\n");
      }
  }


Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


             reply	other threads:[~2002-02-14 12:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-14  4:04 Pierre Muller [this message]
2002-02-14  6:41 ` Daniel Jacobowitz
2002-02-15 13:04 ` Jim Blandy
2002-02-15 23:20   ` muller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.2.0.58.20020214123916.019a6840@ics.u-strasbg.fr \
    --to=muller@cerbere.u-strasbg.fr \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox