This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] symm-nat.c: remove printf and fprintf (stderr.. use



In the same spirit as my last RFAs...

As this is a native file and as I don't have 
access to 
# Host: Sequent Symmetry running ptx 1.3, with Weitek 1167 or i387
or
# Host: Sequent Symmetry running Dynix 3.0, with Weitek 1167 or i387.
which are the only configurations that use this file,
thus I am again unable to compile this file to test it....

ChangeLog entry:

2002-04-26  Pierre Muller  <ics.u-strasbg.fr>

	* symm-nat.c (child_wait): Replace printf by printf_unfiltered
	and fprintf (stderr,...) by fprintf_unfiltered (gdb_stderr,...).
	(print_fpu_status, child_wait): Split long lines.

Index: symm-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/symm-nat.c,v
retrieving revision 1.11
diff -u -p -r1.11 symm-nat.c
--- symm-nat.c  8 Jan 2002 00:59:31 -0000       1.11
+++ symm-nat.c  26 Apr 2002 09:37:41 -0000
@@ -156,7 +156,8 @@ print_fpu_status (struct pt_regset ep)
    printf_unfiltered ("last exception: ");
    printf_unfiltered ("opcode 0x%x; ", ep.pr_fpu.fpu_rsvd4);
    printf_unfiltered ("pc 0x%x:0x%x; ", ep.pr_fpu.fpu_cs, ep.pr_fpu.fpu_ip);
-  printf_unfiltered ("operand 0x%x:0x%x\n", ep.pr_fpu.fpu_data_offset, ep.pr_fpu.fpu_op_sel);
+  printf_unfiltered ("operand 0x%x:0x%x\n", ep.pr_fpu.fpu_data_offset,
+                    ep.pr_fpu.fpu_op_sel);

    top = (ep.pr_fpu.fpu_status >> 11) & 7;

@@ -459,7 +460,7 @@ child_wait (ptid_t ptid, struct target_w
        rv = mptrace (XPT_STOPSTAT, 0, (char *) &pt, 0);
        if (-1 == rv)
         {
-         printf ("XPT_STOPSTAT: errno %d\n", errno);   /* DEBUG */
+         printf_unfiltered ("XPT_STOPSTAT: errno %d\n", errno); /* DEBUG */
           continue;
         }

@@ -475,8 +476,8 @@ child_wait (ptid_t ptid, struct target_w
           rv = mptrace (XPT_UNDEBUG, pid, 0, 0);
           if (-1 == rv)
             {
-             printf ("child_wait: XPT_UNDEBUG: pid %d: %s\n", pid,
-                     safe_strerror (errno));
+             printf_unfiltered ("child_wait: XPT_UNDEBUG: pid %d: %s\n", pid,
+                                safe_strerror (errno));
             }
           continue;
         }
@@ -492,7 +493,7 @@ child_wait (ptid_t ptid, struct target_w
           rv = ptrace (PT_CONTSIG, pid, 1, 0);
           if (-1 == rv)
             {
-             printf ("PTS_FORK: PT_CONTSIG: error %d\n", errno);
+             printf_unfiltered ("PTS_FORK: PT_CONTSIG: error %d\n", errno);
             }
           continue;
         case PTS_EXEC:
@@ -530,8 +531,9 @@ child_wait (ptid_t ptid, struct target_w
           rv = mptrace (XPT_UNDEBUG, pid, 0, 0);
           if (-1 == rv)
             {
-             printf ("child_wait: PTS_EXIT: XPT_UNDEBUG: pid %d error %d\n", pid,
-                     errno);
+             printf_unfiltered ("child_wait: PTS_EXIT: XPT_UNDEBUG: "
+                                "pid %d error %d\n", pid,
+                                errno);
             }
           break;
         case PTS_WATCHPT_HIT:
@@ -556,8 +558,8 @@ child_wait (ptid_t ptid, struct target_w
                    pt.ps_reason, safe_strerror (errno));
           if (pstatus.pr_cursig != pt.ps_reason)
             {
-             printf ("pstatus signal %d, pt signal %d\n",
-                     pstatus.pr_cursig, pt.ps_reason);
+             printf_unfiltered ("pstatus signal %d, pt signal %d\n",
+                                pstatus.pr_cursig, pt.ps_reason);
             }
           sa_hand = (int) pstatus.pr_action.sa_handler;
  #else
@@ -604,14 +606,15 @@ child_wait (ptid_t ptid, struct target_w
         {
           if (save_errno == EINTR)
             continue;
-         fprintf (stderr, "Child process unexpectedly missing: %s.\n",
-                  safe_strerror (save_errno));
+         fprintf_unfiltered (gdb_stderr,
+                             "Child process unexpectedly missing: %s.\n",
+                             safe_strerror (save_errno));
           ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
           ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
           return pid_to_ptid (-1);
         }
      }
-  while (pid != PIDGET (inferior_ptid));       /* Some other child died or stopped */
+  while (pid != PIDGET (inferior_ptid)); /* Some other child died or stopped */

    store_waitstatus (ourstatus, status);
    return pid_to_ptid (pid);
  }




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


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