Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Hui Zhu <teawater@gmail.com>,  msnyder@vmware.com
Subject: Re: [RFA, 3 of 3] save/restore process record, part 3 (save/restore)
Date: Sat, 31 Oct 2009 14:57:00 -0000	[thread overview]
Message-ID: <200910311457.58034.pedro@codesourcery.com> (raw)
In-Reply-To: <200910231554.12387.pedro@codesourcery.com>

On Friday 23 October 2009 15:54:11, Pedro Alves wrote:
> On Friday 23 October 2009 15:42:00, Hui Zhu wrote:
> >    if (record_debug)
> >      printf_filtered ("\
> 
> All debug output should go to fprintf_unfiltered (gdb_stdlog, ...
> not printf_filtered.
> 

Applied.

-- 
Pedro Alves

2009-10-31  Pedro Alves  <pedro@codesourcery.com>

	* record.c (record_restore, cmd_record_save): Debug output goes to
	gdb_stdlog.

---
 gdb/record.c |   87 +++++++++++++++++++++++++++++------------------------------
 1 file changed, 44 insertions(+), 43 deletions(-)

Index: src/gdb/record.c
===================================================================
--- src.orig/gdb/record.c	2009-10-26 17:09:38.000000000 +0000
+++ src/gdb/record.c	2009-10-31 14:45:19.000000000 +0000
@@ -2005,18 +2005,18 @@ record_restore (void)
   gdb_assert (record_first.next == NULL);
  
   if (record_debug)
-    printf_filtered ("Restoring recording from core file.\n");
+    fprintf_unfiltered (gdb_stdlog, "Restoring recording from core file.\n");
 
   /* Now need to find our special note section.  */
   osec = bfd_get_section_by_name (core_bfd, "null0");
   osec_size = bfd_section_size (core_bfd, osec);
   if (record_debug)
-    printf_filtered ("Find precord section %s.\n",
-		     osec ? "succeeded" : "failed");
-  if (!osec)
+    fprintf_unfiltered (gdb_stdlog, "Find precord section %s.\n",
+			osec ? "succeeded" : "failed");
+  if (osec == NULL)
     return;
   if (record_debug)
-    printf_filtered ("%s", bfd_section_name (core_bfd, osec));
+    fprintf_unfiltered (gdb_stdlog, "%s", bfd_section_name (core_bfd, osec));
 
   /* Check the magic code.  */
   bfdcore_read (core_bfd, osec, &magic, sizeof (magic), &bfd_offset);
@@ -2024,9 +2024,9 @@ record_restore (void)
     error (_("Version mis-match or file format error in core file %s."),
 	   bfd_get_filename (core_bfd));
   if (record_debug)
-    printf_filtered ("\
+    fprintf_unfiltered (gdb_stdlog, "\
   Reading 4-byte magic cookie RECORD_FILE_MAGIC (0x%s)\n",
-		     phex_nz (netorder32 (magic), 4));
+			phex_nz (netorder32 (magic), 4));
 
   /* Restore the entries in recfd into record_arch_list_head and
      record_arch_list_tail.  */
@@ -2062,12 +2062,12 @@ record_restore (void)
           bfdcore_read (core_bfd, osec, record_get_loc (rec),
 			rec->u.reg.len, &bfd_offset);
 
-          if (record_debug)
-            printf_filtered ("\
+	  if (record_debug)
+	    fprintf_unfiltered (gdb_stdlog, "\
   Reading register %d (1 plus %lu plus %d bytes)\n",
-			     rec->u.reg.num,
-			     (unsigned long) sizeof (regnum),
-			     rec->u.reg.len);
+				rec->u.reg.num,
+				(unsigned long) sizeof (regnum),
+				rec->u.reg.len);
           break;
 
         case record_mem: /* mem */
@@ -2087,14 +2087,14 @@ record_restore (void)
           bfdcore_read (core_bfd, osec, record_get_loc (rec),
 			rec->u.mem.len, &bfd_offset);
 
-          if (record_debug)
-            printf_filtered ("\
+	  if (record_debug)
+	    fprintf_unfiltered (gdb_stdlog, "\
   Reading memory %s (1 plus %lu plus %lu plus %d bytes)\n",
-			     paddress (get_current_arch (),
-				       rec->u.mem.addr),
-			     (unsigned long) sizeof (addr),
-			     (unsigned long) sizeof (len),
-			     rec->u.mem.len);
+				paddress (get_current_arch (),
+					  rec->u.mem.addr),
+				(unsigned long) sizeof (addr),
+				(unsigned long) sizeof (len),
+				rec->u.mem.len);
           break;
 
         case record_end: /* end */
@@ -2113,13 +2113,13 @@ record_restore (void)
 	  count = netorder32 (count);
 	  rec->u.end.insn_num = count;
 	  record_insn_count = count + 1;
-          if (record_debug)
-            printf_filtered ("\
+	  if (record_debug)
+	    fprintf_unfiltered (gdb_stdlog, "\
   Reading record_end (1 + %lu + %lu bytes), offset == %s\n",
-			     (unsigned long) sizeof (signal),
-			     (unsigned long) sizeof (count),
-			     paddress (get_current_arch (),
-				       bfd_offset));
+				(unsigned long) sizeof (signal),
+				(unsigned long) sizeof (count),
+				paddress (get_current_arch (),
+					  bfd_offset));
           break;
 
         default:
@@ -2225,7 +2225,8 @@ cmd_record_save (char *args, int from_tt
 
   /* Open the save file.  */
   if (record_debug)
-    printf_filtered ("Saving execution log to core file '%s'\n", recfilename);
+    fprintf_unfiltered (gdb_stdlog, "Saving execution log to core file '%s'\n",
+			recfilename);
 
   /* Open the output file.  */
   obfd = create_gcore_bfd (recfilename);
@@ -2291,9 +2292,9 @@ cmd_record_save (char *args, int from_tt
   /* Write the magic code.  */
   magic = RECORD_FILE_MAGIC;
   if (record_debug)
-    printf_filtered ("\
+    fprintf_unfiltered (gdb_stdlog, "\
   Writing 4-byte magic cookie RECORD_FILE_MAGIC (0x%s)\n",
-		     phex_nz (magic, 4));
+		      phex_nz (magic, 4));
   bfdcore_write (obfd, osec, &magic, sizeof (magic), &bfd_offset);
 
   /* Save the entries to recfd and forward execute to the end of
@@ -2314,12 +2315,12 @@ cmd_record_save (char *args, int from_tt
           switch (record_list->type)
             {
             case record_reg: /* reg */
-              if (record_debug)
-		printf_filtered ("\
+	      if (record_debug)
+		fprintf_unfiltered (gdb_stdlog, "\
   Writing register %d (1 plus %lu plus %d bytes)\n",
-				 record_list->u.reg.num,
-				 (unsigned long) sizeof (regnum),
-				 record_list->u.reg.len);
+				    record_list->u.reg.num,
+				    (unsigned long) sizeof (regnum),
+				    record_list->u.reg.len);
 
               /* Write regnum.  */
               regnum = netorder32 (record_list->u.reg.num);
@@ -2333,13 +2334,13 @@ cmd_record_save (char *args, int from_tt
 
             case record_mem: /* mem */
 	      if (record_debug)
-		printf_filtered ("\
+		fprintf_unfiltered (gdb_stdlog, "\
   Writing memory %s (1 plus %lu plus %lu plus %d bytes)\n",
-				 paddress (gdbarch,
-					   record_list->u.mem.addr),
-				 (unsigned long) sizeof (addr),
-				 (unsigned long) sizeof (len),
-				 record_list->u.mem.len);
+				    paddress (gdbarch,
+					      record_list->u.mem.addr),
+				    (unsigned long) sizeof (addr),
+				    (unsigned long) sizeof (len),
+				    record_list->u.mem.len);
 
 	      /* Write memlen.  */
 	      len = netorder32 (record_list->u.mem.len);
@@ -2356,11 +2357,11 @@ cmd_record_save (char *args, int from_tt
               break;
 
               case record_end:
-                if (record_debug)
-                  printf_filtered ("\
+		if (record_debug)
+		  fprintf_unfiltered (gdb_stdlog, "\
   Writing record_end (1 + %lu + %lu bytes)\n", 
-				   (unsigned long) sizeof (signal),
-				   (unsigned long) sizeof (count));
+				      (unsigned long) sizeof (signal),
+				      (unsigned long) sizeof (count));
 		/* Write signal value.  */
 		signal = netorder32 (record_list->u.end.sigval);
 		bfdcore_write (obfd, osec, &signal,


  reply	other threads:[~2009-10-31 14:57 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-17  1:32 Michael Snyder
2009-10-17  8:31 ` Eli Zaretskii
2009-10-17 18:42   ` Michael Snyder
2009-10-17 20:11     ` Eli Zaretskii
2009-10-17 22:19       ` Michael Snyder
2009-10-18  2:23         ` Hui Zhu
2009-10-18  3:59           ` Michael Snyder
2009-10-18  4:06         ` Eli Zaretskii
2009-10-18  4:10           ` Michael Snyder
2009-10-19  4:34             ` Hui Zhu
2009-10-19 18:00               ` Michael Snyder
2009-10-20  2:47                 ` Hui Zhu
2009-10-20 20:03                   ` Michael Snyder
2009-10-20 20:05                     ` Michael Snyder
2009-10-21  2:36                       ` Hui Zhu
2009-10-22 19:42                         ` Michael Snyder
2009-10-22 20:40                           ` Paul Pluzhnikov
2009-10-22 21:00                             ` Michael Snyder
2009-10-22 21:25                               ` Paul Pluzhnikov
2009-10-23  0:45                                 ` Paul Pluzhnikov
2009-10-23  1:05                                   ` Paul Pluzhnikov
2009-10-23  5:35                                     ` Hui Zhu
2009-10-23  8:52                                     ` Pierre Muller
2009-10-23 10:08                                       ` Eli Zaretskii
2009-10-23 14:42                                         ` Hui Zhu
2009-10-23 14:54                                           ` Pedro Alves
2009-10-31 14:57                                             ` Pedro Alves [this message]
2009-11-01  9:54                                               ` Hui Zhu
2009-10-23 14:58                                           ` Pedro Alves
2009-10-23 14:46                                         ` Andreas Schwab
2009-10-23 14:55                                           ` Eli Zaretskii
2009-10-23 15:35                                             ` Andreas Schwab
2009-10-23 15:48                                               ` Eli Zaretskii
2009-10-23 16:31                                                 ` Andreas Schwab
2009-10-23 15:09                                         ` Pierre Muller
2009-10-23  5:35                           ` Hui Zhu
2009-10-23 15:56                             ` Michael Snyder
2009-10-23 16:01                               ` Michael Snyder

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=200910311457.58034.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=teawater@gmail.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