aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/mem-break.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2014-01-22 14:17:39 -0800
committerDoug Evans <dje@google.com>2014-01-22 14:17:39 -0800
commit87ce2a04c53fa7bb4fff50a41e45c0b29af06dae (patch)
treea4c1b772d0b6e7d24277a843efadf522400c1c5d /gdb/gdbserver/mem-break.c
parent96b961024c796c5a609fd4d6a772b060eb3b6197 (diff)
downloadgdb-87ce2a04c53fa7bb4fff50a41e45c0b29af06dae.zip
gdb-87ce2a04c53fa7bb4fff50a41e45c0b29af06dae.tar.gz
gdb-87ce2a04c53fa7bb4fff50a41e45c0b29af06dae.tar.bz2
New gdbserver option --debug-format=timestamp.
* NEWS: Mention it. gdbserver/ * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday. * configure: Regenerate. * config.in: Regenerate. * Makefile.in (SFILES): Add debug.c. (OBS): Add debug.o. * debug.c: New file. * debug.h: New file. * linux-aarch64-low.c (*): Update all debugging printfs to use debug_printf instead of fprintf. * linux-arm-low.c (*): Ditto. * linux-cris-low.c (*): Ditto. * linux-crisv32-low.c (*): Ditto. * linux-m32r-low.c (*): Ditto. * linux-sparc-low.c (*): Ditto. * linux-x86.c (*): Ditto. * linux-low.c (*): Ditto. (linux_wait_1): Add calls to debug_enter, debug_exit. (linux_wait): Remove redundant debugging printf. (stop_all_lwps): Add calls to debug_enter, debug_exit. (linux_resume, unstop_all_lwps): Ditto. * mem-break.c (*): Update all debugging printfs to use debug_printf instead of fprintf. * remote-utils.c (*): Ditto. * thread-db.c (*): Ditto. * server.c #include <ctype.h>, "gdb_vecs.h". (debug_threads): Moved to debug.c. (*): Update all debugging printfs to use debug_printf instead of fprintf. (start_inferior): Replace call to fflush with call to debug_flush. (monitor_show_help): Mention set debug-format. (parse_debug_format_options): New function. (handle_monitor_command): Handle "monitor set debug-format". (gdbserver_usage): Mention --debug-format. (main): Parse --debug-format. * server.h (debug_threads): Declaration moved to debug.h. #include "debug.h". * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of trace_debug_1 that uses debug_printf. (tracepoint_look_up_symbols): Update all debugging printfs to use debug_printf instead of fprintf. doc/ * gdb.texinfo (Server): Mention --debug-format=all|none|timestamp. (gdbserver man): Ditto. testsuite/ * gdb.server/server-mon.exp: Add tests for "set debug-format".
Diffstat (limited to 'gdb/gdbserver/mem-break.c')
-rw-r--r--gdb/gdbserver/mem-break.c94
1 files changed, 41 insertions, 53 deletions
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
index fd706e9..b77ce10 100644
--- a/gdb/gdbserver/mem-break.c
+++ b/gdb/gdbserver/mem-break.c
@@ -197,10 +197,9 @@ set_raw_breakpoint_at (CORE_ADDR where)
if (err != 0)
{
if (debug_threads)
- fprintf (stderr,
- "Failed to read shadow memory of"
- " breakpoint at 0x%s (%s).\n",
- paddress (where), strerror (err));
+ debug_printf ("Failed to read shadow memory of"
+ " breakpoint at 0x%s (%s).\n",
+ paddress (where), strerror (err));
free (bp);
return NULL;
}
@@ -211,9 +210,8 @@ set_raw_breakpoint_at (CORE_ADDR where)
if (err != 0)
{
if (debug_threads)
- fprintf (stderr,
- "Failed to insert breakpoint at 0x%s (%s).\n",
- paddress (where), strerror (err));
+ debug_printf ("Failed to insert breakpoint at 0x%s (%s).\n",
+ paddress (where), strerror (err));
free (bp);
return NULL;
}
@@ -334,10 +332,9 @@ delete_fast_tracepoint_jump (struct fast_tracepoint_jump *todel)
*bp_link = prev_bp_link;
if (debug_threads)
- fprintf (stderr,
- "Failed to uninsert fast tracepoint jump "
- "at 0x%s (%s) while deleting it.\n",
- paddress (bp->pc), strerror (ret));
+ debug_printf ("Failed to uninsert fast tracepoint jump "
+ "at 0x%s (%s) while deleting it.\n",
+ paddress (bp->pc), strerror (ret));
return ret;
}
@@ -398,10 +395,9 @@ set_fast_tracepoint_jump (CORE_ADDR where,
if (err != 0)
{
if (debug_threads)
- fprintf (stderr,
- "Failed to read shadow memory of"
- " fast tracepoint at 0x%s (%s).\n",
- paddress (where), strerror (err));
+ debug_printf ("Failed to read shadow memory of"
+ " fast tracepoint at 0x%s (%s).\n",
+ paddress (where), strerror (err));
free (jp);
return NULL;
}
@@ -424,9 +420,8 @@ set_fast_tracepoint_jump (CORE_ADDR where,
if (err != 0)
{
if (debug_threads)
- fprintf (stderr,
- "Failed to insert fast tracepoint jump at 0x%s (%s).\n",
- paddress (where), strerror (err));
+ debug_printf ("Failed to insert fast tracepoint jump at 0x%s (%s).\n",
+ paddress (where), strerror (err));
/* Unlink it. */
proc->fast_tracepoint_jumps = jp->next;
@@ -450,10 +445,9 @@ uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc)
/* This can happen when we remove all breakpoints while handling
a step-over. */
if (debug_threads)
- fprintf (stderr,
- "Could not find fast tracepoint jump at 0x%s "
- "in list (uninserting).\n",
- paddress (pc));
+ debug_printf ("Could not find fast tracepoint jump at 0x%s "
+ "in list (uninserting).\n",
+ paddress (pc));
return;
}
@@ -480,9 +474,9 @@ uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc)
jp->inserted = 1;
if (debug_threads)
- fprintf (stderr,
- "Failed to uninsert fast tracepoint jump at 0x%s (%s).\n",
- paddress (pc), strerror (err));
+ debug_printf ("Failed to uninsert fast tracepoint jump at"
+ " 0x%s (%s).\n",
+ paddress (pc), strerror (err));
}
}
}
@@ -500,10 +494,9 @@ reinsert_fast_tracepoint_jumps_at (CORE_ADDR where)
/* This can happen when we remove breakpoints when a tracepoint
hit causes a tracing stop, while handling a step-over. */
if (debug_threads)
- fprintf (stderr,
- "Could not find fast tracepoint jump at 0x%s "
- "in list (reinserting).\n",
- paddress (where));
+ debug_printf ("Could not find fast tracepoint jump at 0x%s "
+ "in list (reinserting).\n",
+ paddress (where));
return;
}
@@ -528,9 +521,9 @@ reinsert_fast_tracepoint_jumps_at (CORE_ADDR where)
jp->inserted = 0;
if (debug_threads)
- fprintf (stderr,
- "Failed to reinsert fast tracepoint jump at 0x%s (%s).\n",
- paddress (where), strerror (err));
+ debug_printf ("Failed to reinsert fast tracepoint jump at"
+ " 0x%s (%s).\n",
+ paddress (where), strerror (err));
}
}
@@ -598,10 +591,9 @@ delete_raw_breakpoint (struct process_info *proc, struct raw_breakpoint *todel)
*bp_link = prev_bp_link;
if (debug_threads)
- fprintf (stderr,
- "Failed to uninsert raw breakpoint "
- "at 0x%s (%s) while deleting it.\n",
- paddress (bp->pc), strerror (ret));
+ debug_printf ("Failed to uninsert raw breakpoint "
+ "at 0x%s (%s) while deleting it.\n",
+ paddress (bp->pc), strerror (ret));
return ret;
}
@@ -932,9 +924,9 @@ gdb_no_commands_at_breakpoint (CORE_ADDR where)
return 0;
if (debug_threads)
- fprintf (stderr, "at 0x%s, bp command_list is 0x%s\n",
- paddress (where),
- phex_nz ((uintptr_t) bp->command_list, 0));
+ debug_printf ("at 0x%s, bp command_list is 0x%s\n",
+ paddress (where),
+ phex_nz ((uintptr_t) bp->command_list, 0));
return (bp->command_list == NULL);
}
@@ -1034,9 +1026,8 @@ uninsert_raw_breakpoint (struct raw_breakpoint *bp)
bp->inserted = 1;
if (debug_threads)
- fprintf (stderr,
- "Failed to uninsert raw breakpoint at 0x%s (%s).\n",
- paddress (bp->pc), strerror (err));
+ debug_printf ("Failed to uninsert raw breakpoint at 0x%s (%s).\n",
+ paddress (bp->pc), strerror (err));
}
}
}
@@ -1052,10 +1043,9 @@ uninsert_breakpoints_at (CORE_ADDR pc)
/* This can happen when we remove all breakpoints while handling
a step-over. */
if (debug_threads)
- fprintf (stderr,
- "Could not find breakpoint at 0x%s "
- "in list (uninserting).\n",
- paddress (pc));
+ debug_printf ("Could not find breakpoint at 0x%s "
+ "in list (uninserting).\n",
+ paddress (pc));
return;
}
@@ -1087,9 +1077,8 @@ reinsert_raw_breakpoint (struct raw_breakpoint *bp)
if (err == 0)
bp->inserted = 1;
else if (debug_threads)
- fprintf (stderr,
- "Failed to reinsert breakpoint at 0x%s (%s).\n",
- paddress (bp->pc), strerror (err));
+ debug_printf ("Failed to reinsert breakpoint at 0x%s (%s).\n",
+ paddress (bp->pc), strerror (err));
}
void
@@ -1103,10 +1092,9 @@ reinsert_breakpoints_at (CORE_ADDR pc)
/* This can happen when we remove all breakpoints while handling
a step-over. */
if (debug_threads)
- fprintf (stderr,
- "Could not find raw breakpoint at 0x%s "
- "in list (reinserting).\n",
- paddress (pc));
+ debug_printf ("Could not find raw breakpoint at 0x%s "
+ "in list (reinserting).\n",
+ paddress (pc));
return;
}