Commit Graph

6 Commits

Author SHA1 Message Date
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Pedro Alves 43792cf0de Centralize thread ID printing
Add a new function to print a thread ID, in the style of paddress,
plongest, etc. and adjust all CLI-reachable paths to use it.

This gives us a single place to tweak to print inferior-qualified
thread IDs later:

 - [Switching to thread 1 (Thread 0x7ffff7fc2740 (LWP 8155))]
 + [Switching to thread 1.1 (Thread 0x7ffff7fc2740 (LWP 8155))]

etc., though for now, this has no user-visible change.

No regressions on x86_64 Fedora 20.

gdb/ChangeLog:
2016-01-13  Pedro Alves  <palves@redhat.com>

	* breakpoint.c (remove_threaded_breakpoints)
	(print_one_breakpoint_location): Use print_thread_id.
	* btrace.c (btrace_enable, btrace_disable, btrace_teardown)
	(btrace_fetch, btrace_clear): Use print_thread_id.
	* common/print-utils.c (CELLSIZE): Delete.
	(get_cell): Rename to ...
	(get_print_cell): ... this and made extern.  Adjust call callers.
	Adjust to use PRINT_CELL_SIZE.
	* common/print-utils.h (get_print_cell): Declare.
	(PRINT_CELL_SIZE): New.
	* gdbthread.h (print_thread_id): Declare.
	* infcmd.c (signal_command): Use print_thread_id.
	* inferior.c (print_inferior): Use print_thread_id.
	* infrun.c (handle_signal_stop)
	(insert_exception_resume_breakpoint)
	(insert_exception_resume_from_probe)
	(print_signal_received_reason): Use print_thread_id.
	* record-btrace.c (record_btrace_info)
	(record_btrace_resume_thread, record_btrace_cancel_resume)
	(record_btrace_step_thread, record_btrace_wait): Use
	print_thread_id.
	* thread.c (thread_apply_all_command): Use print_thread_id.
	(print_thread_id): New function.
	(thread_apply_command): Use print_thread_id.
	(thread_command, thread_find_command, do_captured_thread_select):
	Use print_thread_id.
2016-01-13 10:59:14 +00:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Pedro Alves b80c305316 Make host_address_to_string/gdb_print_host_address cast parameter to 'void *'
Fixes a set of errors like:

 ../../src/gdb/symfile-debug.c: In function ‘int debug_qf_map_symtabs_matching_filename(objfile*, const char*, const char*, int (*)(symtab*, void*), void*)’:
 ../../src/gdb/symfile-debug.c:137:39: error: invalid conversion from ‘int (*)(symtab*, void*)’ to ‘const void*’ [-fpermissive]
	host_address_to_string (callback),
					^

Note this has to work with data and function pointers.  In C++11 we
may perhaps do something a bit safer, but we're not there yet, and I
don't think it really matters.  For now just always do a simple
C-style cast in host_address_to_string itself.  No point in adding a
void * cast to each and every caller.

gdb/ChangeLog:
2015-10-27  Pedro Alves  <palves@redhat.com>

	* common/print-utils.c (host_address_to_string): Rename to ...
	(host_address_to_string_1): ... this.
	* common/print-utils.h (host_address_to_string): Reimplement as
	wrapper around host_address_to_string_1.
	* utils.c (gdb_print_host_address): Rename to ...
	(gdb_print_host_address_1): ... this.
	* utils.h (gdb_print_host_address): Reimplement as wrapper macro
	around	host_address_to_string_1.
2015-10-27 17:33:01 +00:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Tom Tromey 01fd3ea573 share "cell" code
The "cell"-based printing code, like phex, was duplicated in both gdb
and gdbserver.  This patch merges the two implementations into a new
file in common/.

2014-02-12  Tom Tromey  <tromey@redhat.com>

	* utils.h: Include print-utils.h.
	(host_address_to_string, plongest, pulongest, phex, phex_nz)
	(int_string, core_addr_to_string, core_addr_to_string_nz)
	(hex_string, hex_string_custom): Don't declare.
	* utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
	(plongest, thirty_two, phex, phex_nz, octal2str, hex_string)
	(hex_string_custom, int_string, core_addr_to_string)
	(core_addr_to_string_nz, host_address_to_string): Move to
	common/print-utils.c.
	* common/print-utils.h: New file.
	* common/print-utils.c: New file
	* Makefile.in (SFILES): Add common/print-utils.c.
	(HFILES_NO_SRCDIR): Add common/print-utils.h.
	(COMMON_OBS): Add print-utils.o.
	(print-utils.o): New target.

2014-02-12  Tom Tromey  <tromey@redhat.com>

	* utils.h (pulongest, plongest, phex_nz): Don't declare.
	Include print-utils.h.
	* utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
	(plongest, thirty_two, phex_nz): Remove.
	* Makefile.in (SFILES): Add common/print-utils.c.
	(OBS): Add print-utils.o.
	(print-utils-ipa.o): New target.
	(print-utils.o): New target.
	(IPA_OBJS): Add print-utils-ipa.o.
2014-02-12 09:59:13 -07:00