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

gdb_stdlog.
This commit is contained in:
Pedro Alves
2009-10-31 14:56:26 +00:00
parent 08bca2595a
commit 07b7cff327
2 changed files with 49 additions and 43 deletions

View File

@ -1,3 +1,8 @@
2009-10-31 Pedro Alves <pedro@codesourcery.com>
* record.c (record_restore, cmd_record_save): Debug output goes to
gdb_stdlog.
2009-10-31 Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com> 2009-10-31 Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
* breakpoint.c (catch_syscall_split_args): Remove unecessary warning * breakpoint.c (catch_syscall_split_args): Remove unecessary warning

View File

@ -2005,18 +2005,18 @@ record_restore (void)
gdb_assert (record_first.next == NULL); gdb_assert (record_first.next == NULL);
if (record_debug) 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. */ /* Now need to find our special note section. */
osec = bfd_get_section_by_name (core_bfd, "null0"); osec = bfd_get_section_by_name (core_bfd, "null0");
osec_size = bfd_section_size (core_bfd, osec); osec_size = bfd_section_size (core_bfd, osec);
if (record_debug) if (record_debug)
printf_filtered ("Find precord section %s.\n", fprintf_unfiltered (gdb_stdlog, "Find precord section %s.\n",
osec ? "succeeded" : "failed"); osec ? "succeeded" : "failed");
if (!osec) if (osec == NULL)
return; return;
if (record_debug) 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. */ /* Check the magic code. */
bfdcore_read (core_bfd, osec, &magic, sizeof (magic), &bfd_offset); bfdcore_read (core_bfd, osec, &magic, sizeof (magic), &bfd_offset);
@ -2024,7 +2024,7 @@ record_restore (void)
error (_("Version mis-match or file format error in core file %s."), error (_("Version mis-match or file format error in core file %s."),
bfd_get_filename (core_bfd)); bfd_get_filename (core_bfd));
if (record_debug) if (record_debug)
printf_filtered ("\ fprintf_unfiltered (gdb_stdlog, "\
Reading 4-byte magic cookie RECORD_FILE_MAGIC (0x%s)\n", Reading 4-byte magic cookie RECORD_FILE_MAGIC (0x%s)\n",
phex_nz (netorder32 (magic), 4)); phex_nz (netorder32 (magic), 4));
@ -2063,7 +2063,7 @@ record_restore (void)
rec->u.reg.len, &bfd_offset); rec->u.reg.len, &bfd_offset);
if (record_debug) if (record_debug)
printf_filtered ("\ fprintf_unfiltered (gdb_stdlog, "\
Reading register %d (1 plus %lu plus %d bytes)\n", Reading register %d (1 plus %lu plus %d bytes)\n",
rec->u.reg.num, rec->u.reg.num,
(unsigned long) sizeof (regnum), (unsigned long) sizeof (regnum),
@ -2088,7 +2088,7 @@ record_restore (void)
rec->u.mem.len, &bfd_offset); rec->u.mem.len, &bfd_offset);
if (record_debug) if (record_debug)
printf_filtered ("\ fprintf_unfiltered (gdb_stdlog, "\
Reading memory %s (1 plus %lu plus %lu plus %d bytes)\n", Reading memory %s (1 plus %lu plus %lu plus %d bytes)\n",
paddress (get_current_arch (), paddress (get_current_arch (),
rec->u.mem.addr), rec->u.mem.addr),
@ -2114,7 +2114,7 @@ record_restore (void)
rec->u.end.insn_num = count; rec->u.end.insn_num = count;
record_insn_count = count + 1; record_insn_count = count + 1;
if (record_debug) if (record_debug)
printf_filtered ("\ fprintf_unfiltered (gdb_stdlog, "\
Reading record_end (1 + %lu + %lu bytes), offset == %s\n", Reading record_end (1 + %lu + %lu bytes), offset == %s\n",
(unsigned long) sizeof (signal), (unsigned long) sizeof (signal),
(unsigned long) sizeof (count), (unsigned long) sizeof (count),
@ -2225,7 +2225,8 @@ cmd_record_save (char *args, int from_tty)
/* Open the save file. */ /* Open the save file. */
if (record_debug) 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. */ /* Open the output file. */
obfd = create_gcore_bfd (recfilename); obfd = create_gcore_bfd (recfilename);
@ -2291,7 +2292,7 @@ cmd_record_save (char *args, int from_tty)
/* Write the magic code. */ /* Write the magic code. */
magic = RECORD_FILE_MAGIC; magic = RECORD_FILE_MAGIC;
if (record_debug) if (record_debug)
printf_filtered ("\ fprintf_unfiltered (gdb_stdlog, "\
Writing 4-byte magic cookie RECORD_FILE_MAGIC (0x%s)\n", 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); bfdcore_write (obfd, osec, &magic, sizeof (magic), &bfd_offset);
@ -2315,7 +2316,7 @@ cmd_record_save (char *args, int from_tty)
{ {
case record_reg: /* reg */ case record_reg: /* reg */
if (record_debug) if (record_debug)
printf_filtered ("\ fprintf_unfiltered (gdb_stdlog, "\
Writing register %d (1 plus %lu plus %d bytes)\n", Writing register %d (1 plus %lu plus %d bytes)\n",
record_list->u.reg.num, record_list->u.reg.num,
(unsigned long) sizeof (regnum), (unsigned long) sizeof (regnum),
@ -2333,7 +2334,7 @@ cmd_record_save (char *args, int from_tty)
case record_mem: /* mem */ case record_mem: /* mem */
if (record_debug) if (record_debug)
printf_filtered ("\ fprintf_unfiltered (gdb_stdlog, "\
Writing memory %s (1 plus %lu plus %lu plus %d bytes)\n", Writing memory %s (1 plus %lu plus %lu plus %d bytes)\n",
paddress (gdbarch, paddress (gdbarch,
record_list->u.mem.addr), record_list->u.mem.addr),
@ -2357,7 +2358,7 @@ cmd_record_save (char *args, int from_tty)
case record_end: case record_end:
if (record_debug) if (record_debug)
printf_filtered ("\ fprintf_unfiltered (gdb_stdlog, "\
Writing record_end (1 + %lu + %lu bytes)\n", Writing record_end (1 + %lu + %lu bytes)\n",
(unsigned long) sizeof (signal), (unsigned long) sizeof (signal),
(unsigned long) sizeof (count)); (unsigned long) sizeof (count));