aboutsummaryrefslogtreecommitdiff
path: root/gdb/common/print-utils.h
AgeCommit message (Collapse)AuthorFilesLines
2016-01-13Centralize thread ID printingPedro Alves1-0/+8
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-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-10-27Make host_address_to_string/gdb_print_host_address cast parameter to 'void *'Pedro Alves1-1/+5
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-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-02-12share "cell" codeTom Tromey1-0/+70
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.