aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/debug.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-08-19Introduce common-debug.hGary Benson1-7/+4
This introduces common-debug.h. This holds the functions debug_printf and debug_vprintf, two functions that the common code can use to print debugging messages. Clients of the common code are expected to implement debug_vprintf; a debug_vprintf function is written from scratch for GDB, and gdbserver's existing debug_printf is repurposed as debug_vprintf. common/agent.c is changed to use debug_vprintf rather than defining the macro DEBUG_AGENT depending on GDBSERVER. nat/i386-dregs.c is changed to use the externally-implemented debug_printf, rather than defining it itself. gdb/ChangeLog: * common/common-debug.h: New file. * common/common-debug.c: Likewise. * debug.c: Likewise. * Makefile.in (SFILES): Add common/common-debug.c. (HFILES_NO_SRCDIR): Add common/common-debug.h. (COMMON_OBS): Add common-debug.o and debug.o. (common-debug.o): New rule. * common/common-defs.h: Include common-debug.h. * common/agent.c (debug_agent_printf): New function. (DEBUG_AGENT): Redefine. * nat/i386-dregs.c (debug_printf): Undefine. gdb/gdbserver/ChangeLog: * Makefile.in (SFILES): Add common/common-debug.c. (OBS): Add common-debug.o. (common-debug.o): New rule. * debug.h (debug_printf): Don't declare. * debug.c (debug_printf): Renamed and rewritten as... (debug_vprintf): New function.
2014-06-12link gdbserver against libibertyTom Tromey1-2/+2
This builds a libiberty just for gdbserver and arranges for gdbserver to use it. I've tripped across the lack of libiberty in gdbserver at least once, and I have seen other threads where it would have been useful. 2014-06-12 Tom Tromey <tromey@redhat.com> * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks. * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check. (parse_debug_format_options): Likewise. (gdbserver_usage): Likewise. * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables. (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty. (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link against libiberty. ($(LIBGNU)): Depend on libiberty. (all-lib): Recurse into all subdirs. (install-only): Invoke "install" target in subdirs. (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove targets. * configure: Rebuild. * configure.ac: Add ACX_CONFIGURE_DIR for libiberty. Don't check for vasprintf, vsnprintf, or gettimeofday. * configure.srv: Don't add safe-ctype.o or lbasename.o to srv_tgtobj.
2014-01-22 New gdbserver option --debug-format=timestamp.Doug Evans1-0/+98
* 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".