aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2016-11-26Remove verbosity from ui_out_message and friendsSimon Marchi15-68/+69
That concept is never actually used, so it's just a burden. Removing it facilitates the refactoring in upcoming patches. gdb/ChangeLog: * mi/mi-out.c (mi_message): Remove verbosity argument. * ada-tasks.c (print_ada_task_info, info_task, task_command): Update call. * auto-load.c (auto_load_info_scripts): Likewise. * breakpoint.c (breakpoint_1, watchpoints_info, tracepoints_info): Likewise. * cli-out.c (cli_message): Remove verbosity argument. * inferior.c (print_inferior): Update call. * linux-thread-db.c (info_auto_load_libthread_db): Likewise. * probe.c (info_probes_for_ops): Likewise. * skip.c (skip_info): Likewise. * solib.c (info_sharedlibrary_command): Likewise. * symfile.c (load_progress): Likewise. * thread.c (print_thread_info_1): Likewise. * ui-out.c (uo_message, ui_out_message): Remove verbosity argument. (ui_out_get_verblvl): Remove. * ui-out.h (ui_out_message): Remove verbosity argument. (ui_out_get_verblvl): Remove. (message_ftype): Remove verbosity argument.
2016-11-26Constify wrap_here/wrap_hint code pathSimon Marchi7-11/+21
Constify the data path between ui_out_wrap_hint and the wrap_indent global, because we can. It's clearer that the argument passed to wrap_hint is not intended to be modified by the ui_out implementation. gdb/ChangeLog: * mi/mi-out.c (mi_wrap_hint): Constify argument. * cli-out.c (cli_wrap_hint): Likewise. * ui-out.c (ui_out_wrap_hint, uo_wrap_hint): Likewise. * ui-out.h (ui_out_wrap_hint, wrap_hint_ftype): Likewise. * utils.c (wrap_here): Likewise. (wrap_indent): Constify. * utils.h (wrap_here): Constify argument.
2016-11-26Fix return value of uo_redirectSimon Marchi2-2/+6
The wrapper uo_redirect seems like it should return the return value from of implementation function, since callers rely on it, but it doesn't. gdb/ChangeLog: * ui-out.c (uo_redirect): Return the return value from the implementation function.
2016-11-26Remove ui_out_destroySimon Marchi3-36/+5
It's not actually used, and removing it simplifies the upcoming patches a bit. After the whole series, destroying an ui_out object will be simply "delete uiout", which will call the default destructor. gdb/ChangeLog: * ui-out.c (ui_out_destroy, uo_data_destroy): Remove. * ui-out.h (ui_out_destroy): Remove.
2016-11-26Rename ui_out_data to mi_ui_out_dataSimon Marchi2-2/+7
Just a little cleanup, so the name is more consistent with the naming of the equivalent structures of cli and tui. It goes away in subsequent patches anyway, but it might help follow the changes in those patches... gdb/ChangeLog: * mi/mi-out.c (ui_out_data): Rename to ... (mi_ui_out_data): ... this.
2016-11-26Remove unused functions and declarationsSimon Marchi5-50/+13
gdb/ChangeLog: * ui-out.c (_initialize_ui_out): Remove. (ui_out_set_flags): Remove. (ui_out_clear_flags): Remove. * ui-out.h (ui_out_begin_cleanup_end): Remove. (ui_out_begin_cleanup_end): Remove. (ui_out_set_flags): Remove. (ui_out_clear_flags): Remove. * mi/mi-out.c (_initialize_mi_out): Remove. (mi_out_buffered): Remove. * mi/mi-out.h (mi_out_buffered): Remove.
2016-11-26Remove stale commentsSimon Marchi3-5/+5
The default ui_out is gone since commit 23ff98d2fed4a1eaeb815e18cd4169e5aa7aaa60. gdb/ChangeLog: * ui-out.h (struct ui_out_impl): Remove comment. * ui-out.c (struct ui_out): Remove comment.
2016-11-25Remove check requiring void argument to functions with no parameters.John Baldwin2-10/+4
C++ treats an empty parameter list as no parameters unlike C. gdb/ChangeLog: * contrib/ari/gdb_ari.sh (no parameter function): Remove check.
2016-11-25Fix typo in MakefileSimon Marchi2-1/+5
Fix a typo I made in my previous Makefile cleanup series. Thanks to Patrick Monnerat for reporting. gdb/ChangeLog: * Makefile.in: Fix typo.
2016-11-25Fix typos in commentSimon Marchi2-1/+5
gdb/ChangeLog: * record-full.c (record_full_resume): Fix typos in comment.
2016-11-25Fix typo in commentSimon Marchi2-1/+5
gdb/ChangeLog: * infcmd.c (interrupt_command): Fix typo in comment.
2016-11-24Do not use std::move when assigning an anonymous object to a unique_ptr.John Baldwin6-14/+23
Using std::move forces an extra copy of the object. These changes fix -Wpessimizing-move warnings from clang. gdb/ChangeLog: * ada-lang.c (create_excep_cond_exprs): Do not use 'std::move'. * ax-gdb.c (agent_eval_command_one): Likewise. (agent_eval_command_one): Likewise. * breakpoint.c (parse_cond_to_aexpr): Likewise. (parse_cmd_to_aexpr): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * parse.c (parse_expression_for_completion): Likewise.
2016-11-24Add noexcept to custom non-throwing new operators.John Baldwin2-2/+7
Both libc++ and libstdc++ declare non-throwing new operators as noexcept and overloads must also be noexcept. This fixes a -Wmissing-exception-spec warning with clang. gdb/ChangeLog: * common/new-op.c (operator new): Mark 'noexcept'. (operator new[]): Likewise.
2016-11-24Optimize byte-aligned copies in copy_bitwise()Andreas Arnez2-4/+28
The function copy_bitwise used for copying DWARF pieces can potentially be invoked for large chunks of data. For instance, consider a large struct one of whose members is currently located in a register. In this case copy_bitwise would still copy the data bitwise in a loop, which is much slower than necessary. This change uses memcpy for the large part instead, if possible. gdb/ChangeLog: * dwarf2loc.c (copy_bitwise): Use memcpy for the middle part, if it is byte-aligned.
2016-11-24Add unit test for copy_bitwiseAndreas Arnez3-2/+151
This adds a unit test for the copy_bitwise function in dwarf2loc.c. With the old (broken) version of copy_bitwise this test would generate the following failure message: (gdb) maintenance selftest Self test failed: copy_bitwise 11000000 != 10000000 (7+2 -> 0) gdb/ChangeLog: 2016-11-24 Andreas Arnez <arnez@linux.vnet.ibm.com> Pedro Alves <palves@redhat.com> * dwarf2loc.c (bits_to_str, check_copy_bitwise) (copy_bitwise_tests): New functions. (_initialize_dwarf2loc): Register the new function copy_bitwise_tests as a unit test. * selftest.c (run_self_tests): Improve the failure message's wording and formatting.
2016-11-24Fix copy_bitwise()Andreas Arnez4-149/+96
When the user writes or reads a variable whose location is described with DWARF pieces (DW_OP_piece or DW_OP_bit_piece), GDB's helper function copy_bitwise is invoked for each piece. The implementation of this function has a bug that may result in a corrupted copy, depending on alignment and bit size. (Full-byte copies are not affected.) This rewrites copy_bitwise, replacing its algorithm by a fixed version, and adding an appropriate test case. Without the fix the new test case fails, e.g.: print def_t $2 = {a = 0, b = 4177919} (gdb) FAIL: gdb.dwarf2/nonvar-access.exp: print def_t Written in binary, the wrong result above looks like this: 01111111011111111111111 Which means that two zero bits have sneaked into the copy of the original all-one bit pattern. The test uses this simple all-one value in order to avoid another GDB bug that causes the DWARF piece of a DW_OP_stack_value to be taken from the wrong end on big-endian architectures. gdb/ChangeLog: * dwarf2loc.c (extract_bits_primitive): Remove. (extract_bits): Remove. (copy_bitwise): Rewrite. Fixes a possible corruption that may occur for non-byte-aligned copies. gdb/testsuite/ChangeLog: * gdb.dwarf2/nonvar-access.exp: Add a test for accessing non-byte-aligned bit fields.
2016-11-24Fix PR12616 - gdb does not implement DW_AT_data_bit_offsetAndreas Arnez4-0/+119
The DW_AT_data_bit_offset attribute was introduced by DWARF V4 and allows specifying the offset of a data member within its containing entity. But although the new attribute was intended to replace DW_AT_bit_offset for this purpose, GDB ignores it, and thus GCC still emits DW_AT_bit_offset instead. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71669. This change fixes GDB's lack of support for DW_AT_data_bit_offset and adds an appropriate test case. gdb/ChangeLog: PR gdb/12616 * dwarf2read.c (dwarf2_add_field): Handle the DWARF V4 attribute DW_AT_data_bit_offset. gdb/testsuite/ChangeLog: PR gdb/12616 * gdb.dwarf2/nonvar-access.exp: New testcase. Check that GDB respects the DW_AT_data_bit_offset attribute.
2016-11-23gdb: Use C++11 std::chronoPedro Alves16-210/+358
This patch fixes a few problems with GDB's time handling. #1 - It avoids problems with gnulib's C++ namespace support On MinGW, the struct timeval that should be passed to gnulib's gettimeofday replacement is incompatible with libiberty's timeval_sub/timeval_add. That's because gnulib also replaces "struct timeval" with its own definition, while libiberty expects the system's. E.g., in code like this: gettimeofday (&prompt_ended, NULL); timeval_sub (&prompt_delta, &prompt_ended, &prompt_started); timeval_add (&prompt_for_continue_wait_time, &prompt_for_continue_wait_time, &prompt_delta); That's currently handled in gdb by not using gnulib's gettimeofday at all (see common/gdb_sys_time.h), but that #undef hack won't work with if/when we enable gnulib's C++ namespace support, because that mode adds compile time warnings for uses of ::gettimeofday, which are hard errors with -Werror. #2 - But there's an elephant in the room: gettimeofday is not monotonic... We're using it to: a) check how long functions take, for performance analysis b) compute when in the future to fire events in the event-loop c) print debug timestamps But that's exactly what gettimeofday is NOT meant for. Straight from the man page: ~~~ The time returned by gettimeofday() is affected by discontinuous jumps in the system time (e.g., if the system administrator manually changes the system time). If you need a monotonically increasing clock, see clock_gettime(2). ~~~ std::chrono (part of the C++11 standard library) has a monotonic clock exactly for such purposes (std::chrono::steady_clock). This commit switches to use that instead of gettimeofday, fixing all the issues mentioned above. gdb/ChangeLog: 2016-11-23 Pedro Alves <palves@redhat.com> * Makefile.in (SFILES): Add common/run-time-clock.c. (HFILES_NO_SRCDIR): Add common/run-time-clock.h. (COMMON_OBS): Add run-time-clock.o. * common/run-time-clock.c, common/run-time-clock.h: New files. * defs.h (struct timeval, print_transfer_performance): Delete declarations. * event-loop.c (struct gdb_timer) <when>: Now a std::chrono::steady_clock::time_point. (create_timer): use std::chrono::steady_clock instead of gettimeofday. Use new instead of malloc. (delete_timer): Use delete instead of xfree. (duration_cast_timeval): New. (update_wait_timeout): Use std::chrono::steady_clock instead of gettimeofday. * maint.c: Include <chrono> instead of "gdb_sys_time.h", <time.h> and "timeval-utils.h". (scoped_command_stats::~scoped_command_stats) (scoped_command_stats::scoped_command_stats): Use std::chrono::steady_clock instead of gettimeofday. Use user_cpu_time_clock instead of get_run_time. * maint.h: Include "run-time-clock.h" and <chrono>. (scoped_command_stats): <m_start_cpu_time>: Now a user_cpu_time_clock::time_point. <m_start_wall_time>: Now a std::chrono::steady_clock::time_point. * mi/mi-main.c: Include "run-time-clock.h" and <chrono> instead of "gdb_sys_time.h" and <sys/resource.h>. (rusage): Delete. (mi_execute_command): Use new instead of XNEW. (mi_load_progress): Use std::chrono::steady_clock instead of gettimeofday. (timestamp): Rewrite in terms of std::chrono::steady_clock, user_cpu_time_clock and system_cpu_time_clock. (timeval_diff): Delete. (print_diff): Adjust to use std::chrono::steady_clock, user_cpu_time_clock and system_cpu_time_clock. * mi/mi-parse.h: Include "run-time-clock.h" and <chrono> instead of "gdb_sys_time.h". (struct mi_timestamp): Change fields types to std::chrono::steady_clock::time_point, user_cpu_time_clock::time and system_cpu_time_clock::time_point, instead of struct timeval. * symfile.c: Include <chrono> instead of <time.h> and "gdb_sys_time.h". (struct time_range): New. (generic_load): Use std::chrono::steady_clock instead of gettimeofday. (print_transfer_performance): Replace timeval parameters with a std::chrono::steady_clock::duration parameter. Adjust. * utils.c: Include <chrono> instead of "timeval-utils.h", "gdb_sys_time.h", and <time.h>. (prompt_for_continue_wait_time): Now a std::chrono::steady_clock::duration. (defaulted_query, prompt_for_continue): Use std::chrono::steady_clock instead of gettimeofday/timeval_sub/timeval_add. (reset_prompt_for_continue_wait_time): Use std::chrono::steady_clock::duration instead of struct timeval. (get_prompt_for_continue_wait_time): Return a std::chrono::steady_clock::duration instead of struct timeval. (vfprintf_unfiltered): Use std::chrono::steady_clock instead of gettimeofday. Use std::string. Use '.' instead of ':'. * utils.h: Include <chrono>. (get_prompt_for_continue_wait_time): Return a std::chrono::steady_clock::duration instead of struct timeval. gdb/gdbserver/ChangeLog: 2016-11-23 Pedro Alves <palves@redhat.com> * debug.c: Include <chrono> instead of "gdb_sys_time.h". (debug_vprintf): Use std::chrono::steady_clock instead of gettimeofday. Use '.' instead of ':'. * tracepoint.c: Include <chrono> instead of "gdb_sys_time.h". (get_timestamp): Use std::chrono::steady_clock instead of gettimeofday.
2016-11-23Minor formatting fixups in MakefilesSimon Marchi4-48/+55
Mostly some whitespace changes to make things a bit more consistent. gdb/ChangeLog: * Makefile.in: Fix whitespace formatting. gdb/gdbserver/ChangeLog: * Makefile.in: Fix whitespace formatting.
2016-11-23Normalize names of some source filesSimon Marchi110-287/+471
Most tdep/nat files are named: <cpu>-<os>-tdep.c <cpu>-<os>-nat.c A few files do not respect this scheme. This patch renames them so that they are consistent with the rest of the files. It builds fine with --enable-targets=all, but that doesn't test the nat files. I can only hope that my grep skill is good enough. gdb/ChangeLog: * Makefile.in (ALL_64_TARGET_OBS, ALL_TARGET_OBS, HFILES_NO_SRCDIR, ALLDEPFILES): Rename files. * alphabsd-nat.c: Rename to ... * alpha-bsd-nat.c: ... this, adjust include. * alphabsd-tdep.c: Rename to ... * alpha-bsd-tdep.c: ... this, adjust include. * alphabsd-tdep.h: Rename to ... * alpha-bsd-tdep.h: ... this, adjust include barrier and comment. * alphafbsd-tdep.c: Rename to ... * alpha-fbsd-tdep.c: ... this. * alphanbsd-tdep.c: Rename to ... * alpha-nbsd-tdep.c: ... this, adjust include. * alphaobsd-tdep.c: Rename to ... * alpha-obsd-tdep.c: ... this, adjust include. * amd64bsd-nat.c: Rename to ... * amd64-bsd-nat.c: ... this, adjust include. * amd64fbsd-nat.c: Rename to ... * amd64-fbsd-nat.c: ... this, adjust include. * amd64fbsd-tdep.c: Rename to ... * amd64-fbsd-tdep.c: ... this, adjust include. * amd64nbsd-nat.c: Rename to ... * amd64-nbsd-nat.c: ... this. * amd64nbsd-tdep.c: Rename to ... * amd64-nbsd-tdep.c: ... this. * amd64obsd-nat.c: Rename to ... * amd64-obsd-nat.c: ... this. * amd64obsd-tdep.c: Rename to ... * amd64-obsd-tdep.c: ... this. * amd64-tdep.h: Update comments. * armbsd-tdep.c: Rename to ... * arm-bsd-tdep.c: ... this. * armnbsd-nat.c: Rename to ... * arm-nbsd-nat.c: ... this. * armnbsd-tdep.c: Rename to ... * arm-nbsd-tdep.c: ... this. * armobsd-tdep.c: Rename to ... * arm-obsd-tdep.c: ... this. * arm-tdep.h: Update comments. * hppabsd-tdep.c: Rename to ... * hppa-bsd-tdep.c: ... this, adjust include. * hppabsd-tdep.h: Rename to ... * hppa-bsd-tdep.h: ... this, adjust include barrier and comment. * hppanbsd-nat.c: Rename to ... * hppa-nbsd-nat.c: ... this. * hppanbsd-tdep.c: Rename to ... * hppa-nbsd-tdep.c: ... this, adjust include. * hppaobsd-nat.c: Rename to ... * hppa-obsd-nat.c: ... this. * hppaobsd-tdep.c: Rename to ... * hppa-obsd-tdep.c: ... this, adjust include. * i386bsd-nat.c: Rename to ... * i386-bsd-nat.c: ... this, adjust include. * i386bsd-nat.h: Rename to ... * i386-bsd-nat.h: ... this, adjust include barrier and comment. * i386bsd-tdep.c: Rename to ... * i386-bsd-tdep.c: ... this. * i386fbsd-nat.c: Rename to ... * i386-fbsd-nat.c: ... this, adjust include. * i386fbsd-tdep.c: Rename to ... * i386-fbsd-tdep.c: ... this, adjust include. * i386fbsd-tdep.h: Rename to ... * i386-fbsd-tdep.h: ... this, adjust include barrier and comment. * i386gnu-nat.c: Rename to ... * i386-gnu-nat.c: ... this. * i386gnu-tdep.c: Rename to ... * i386-gnu-tdep.c: ... this. * i386nbsd-nat.c: Rename to ... * i386-nbsd-nat.c: ... this, adjust include. * i386nbsd-tdep.c: Rename to ... * i386-nbsd-tdep.c: ... this. * i386obsd-nat.c: Rename to ... * i386-obsd-nat.c: ... this, adjust include. * i386obsd-tdep.c: Rename to ... * i386-obsd-tdep.c: ... this. * i386v4-nat.c: Rename to ... * i386-v4-nat.c: ... this. * i386-tdep.h: Update comments. * m68k-tdep.h: Update comments. * m68kbsd-nat.c: Rename to ... * m68k-bsd-nat.c: ... this. * m68kbsd-tdep.c: Rename to ... * m68k-bsd-tdep.c: ... this. * m68klinux-nat.c: Rename to ... * m68k-linux-nat.c: ... this. * m68klinux-tdep.c: Rename to ... * m68k-linux-tdep.c: ... this. * m88kbsd-nat.c: Rename to ... * m88k-bsd-nat.c: ... this. * mipsnbsd-nat.c: Rename to ... * mips-nbsd-nat.c: ... this, adjust include. * mipsnbsd-tdep.c: Rename to ... * mips-nbsd-tdep.c: ... this, adjust include. * mipsnbsd-tdep.h: Rename to ... * mips-nbsd-tdep.h: ... this, adjust include barrier and comment. * mips64obsd-nat.c: Rename to ... * mips64-obsd-nat.c: ... this. * mips64obsd-tdep.c: Rename to ... * mips64-obsd-tdep.c: ... this. * ppcfbsd-nat.c: Rename to ... * ppc-fbsd-nat.c: ... this, adjust include. * ppcfbsd-tdep.c: Rename to ... * ppc-fbsd-tdep.c: ... this, adjust include. * ppcfbsd-tdep.h: Rename to ... * ppc-fbsd-tdep.h: ... this, adjust include barrier and comment. * ppcnbsd-nat.c: Rename to ... * ppc-nbsd-nat.c: ... this, adjust include. * ppcnbsd-tdep.c: Rename to ... * ppc-nbsd-tdep.c: ... this, adjust include. * ppcnbsd-tdep.h: Rename to ... * ppc-nbsd-tdep.h: ... this, adjust include barrier and comment. * ppcobsd-nat.c: Rename to ... * ppc-obsd-nat.c: ... this, adjust include. * ppcobsd-tdep.c: Rename to ... * ppc-obsd-tdep.c: ... this, adjust include. * ppcobsd-tdep.h: Rename to ... * ppc-obsd-tdep.h: ... this, adjust include barrier and comment. * shnbsd-nat.c: Rename to ... * sh-nbsd-nat.c: ... this. * shnbsd-tdep.c: Rename to ... * sh-nbsd-tdep.c: ... this. * sparcnbsd-nat.c: Rename to ... * sparc-nbsd-nat.c: ... this. * sparcnbsd-tdep.c: Rename to ... * sparc-nbsd-tdep.c: ... this. * sparcobsd-tdep.c: Rename to ... * sparc-obsd-tdep.c: ... this. * sparc64fbsd-nat.c: Rename to ... * sparc64-fbsd-nat.c: ... this. * sparc64fbsd-tdep.c: Rename to ... * sparc64-fbsd-tdep.c: ... this. * sparc64nbsd-nat.c: Rename to ... * sparc64-nbsd-nat.c: ... this. * sparc64nbsd-tdep.c: Rename to ... * sparc64-nbsd-tdep.c: ... this. * sparc64obsd-nat.c: Rename to ... * sparc64-obsd-nat.c: ... this. * sparc64obsd-tdep.c: Rename to ... * sparc64-obsd-tdep.c: ... this. * sparc64-tdep.h: Update comments. * vaxbsd-nat.c: Rename to ... * vax-bsd-nat.c: ... this. * vaxnbsd-tdep.c: Rename to ... * vax-nbsd-tdep.c: ... this. * vaxobsd-tdep.c: Rename to ... * vax-obsd-tdep.c: ... this. * x86bsd-nat.h: Rename to ... * x86-bsd-nat.h: ... this, adjust include barrier and comment. * x86bsd-nat.c: Rename to ... * x86-bsd-nat.c: ... this, adjust include. * configure.tgt: Update renamed files. * config/alpha/fbsd.mh: Update renamed files. * config/alpha/nbsd.mh: Update renamed files. * config/arm/nbsdelf.mh: Update renamed files. * config/djgpp/fnchange.lst: Update renamed files. * config/i386/fbsd.mh: Update renamed files. * config/i386/fbsd64.mh: Update renamed files. * config/i386/i386gnu.mh: Update renamed files. * config/i386/i386sol2.mh: Update renamed files. * config/i386/nbsd64.mh: Update renamed files. * config/i386/nbsdelf.mh: Update renamed files. * config/i386/obsd.mh: Update renamed files. * config/i386/obsd64.mh: Update renamed files. * config/i386/sol2-64.mh: Update renamed files. * config/m68k/linux.mh: Update renamed files. * config/m68k/nbsdelf.mh: Update renamed files. * config/m68k/obsd.mh: Update renamed files. * config/m88k/obsd.mh: Update renamed files. * config/mips/nbsd.mh: Update renamed files. * config/mips/obsd64.mh: Update renamed files. * config/pa/nbsd.mh: Update renamed files. * config/pa/obsd.mh: Update renamed files. * config/powerpc/fbsd.mh: Update renamed files. * config/powerpc/nbsd.mh: Update renamed files. * config/powerpc/obsd.mh: Update renamed files. * config/sh/nbsd.mh: Update renamed files. * config/sparc/fbsd.mh: Update renamed files. * config/sparc/nbsd64.mh: Update renamed files. * config/sparc/nbsdelf.mh: Update renamed files. * config/sparc/obsd64.mh: Update renamed files. * config/vax/nbsdelf.mh: Update renamed files. * config/vax/obsd.mh: Update renamed files.
2016-11-23Makefiles: Flatten and sort file listsSimon Marchi7-426/+1347
I find the big file lists in the Makefiles a bit ugly and not very practical. Since there are multiple filenames on each line (as much as fits in 80 columns), it's not easy to add, remove or change a name in the middle. As a result, we have a mix of long and short lines in no particular order (ALL_TARGET_OBS is a good example). I therefore suggest flattening the lists (one name per line) and keeping them in alphabetical order. The diffs will be much clearer and merge conflicts will be easier to resolve. A nice (IMO) side-effect I observed is that the files are compiled alphabetically by make, so it gives a rough idea of the progress of the build. I added a comment in gdb/Makefile.in to mention to keep the file lists ordered, and gave the general guidelines on what order to respect. I added a comment in other Makefiles which refers to gdb/Makefile.in, to avoid duplication. Running the patch through the buildbot found that gdb.base/default.exp started to fail. The languages in the error message shown when typing "set language" have changed order. We could probably improve gdb so that it prints them in a stable order, regardless of the order of the object list passed to the linked, but just fixing the test is easier for now. New in v2: - Change ordering style, directories go at the end. - Cleanup gdbserver's and data-directory's Makefile as well. - Add comments at top of Makefiles about the ordering. - Remove wrong trailing backslahes. - Fix test gdb.base/default.exp. gdb/ChangeLog: * Makefile.in: Add comment about file lists ordering. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_MI_OBS, SUBDIR_MI_SRCS, SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS, SUBDIR_GCC_COMPILE_OBS, SUBDIR_GCC_COMPILE_SRCS, SUBDIR_GUILE_OBS, SUBDIR_GUILE_SRCS, SUBDIR_PYTHON_OBS, SUBDIR_PYTHON_SRCS, SUBDIR_GDBTK_OBS, SUBDIR_GDBTK_SRCS, XMLFILES, REMOTE_OBS, ALL_64_TARGET_OBS, ALL_TARGET_OBS, SFILES, HFILES_NO_SRCDIR, HFILES_WITH_SRCDIR, COMMON_OBS, YYFILES, YYOBJ, generated_files, ALLDEPFILES): Flatten list and order alphabetically. * data-directory/Makefile.in: Add comment about file lists ordering. (GEN_SYSCALLS_FILES, PYTHON_FILE_LIST): Flatten list and order alphabetically. gdb/gdbserver/ChangeLog: * Makefile.in (SFILES, OBS): Flatten list and order alphabetically. gdb/testsuite/ChangeLog: * gdb.base/default.exp: Fix output of "set language".
2016-11-23gdbserver: Use warning for warningsPedro Alves4-8/+13
gdb/gdbserver/ChangeLog: 2016-11-23 Pedro Alves <palves@redhat.com> * event-loop.c (handle_file_event): Use warning. * linux-low.c (linux_resume_one_lwp_throw): Use warning. * mem-break.c (add_breakpoint_condition, add_breakpoint_commands): Use warning.
2016-11-23gdbserver: Use debug_printf for debug outputPedro Alves6-35/+43
gdb/gdbserver/ChangeLog: 2016-11-23 Pedro Alves <palves@redhat.com> * linux-low.c (check_zombie_leaders): Use debug_printf for debug output. * notif.c (handle_notif_ack, notif_event_enque): Likewise. * remote-utils.c (putpkt_binary_1, readchar, getpkt): Use debug_printf and debug_flush for debug output. * server.c (handle_general_set): Likewise. * thread-db.c (try_thread_db_load): Use debug_printf for debug output.
2016-11-22Fix spelling mistakes in comments in shell scriptsAmbrogino Modigliani4-4/+10
gdb/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * contrib/expect-read1.sh: Fix spelling in comments. * gdb_buildall.sh: Fix spelling in comments. * gdb_mbuild.sh: Fix spelling in comments.
2016-11-22Fix spelling mistakes in comments in configure scriptsAmbrogino Modigliani3-2/+7
All changes are limited to comments, and no run-time behavior is affected. bfd/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * warning.m4: Fix spelling in comments. * configure.ac: Fix spelling in comments. * configure: Regenerate. binutils/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gdb/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure.ac: Fix spelling in comments. * configure: Regenerate. gas/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gold/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gprof/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. ld/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. opcodes/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate.
2016-11-22Change gdbarch software_single_step frame_info to regcacheYao Qi23-42/+57
This patch changes gdbarch method software_single_step's parameter from "struct frame_info *" to "struct regcache *, IOW, software_single_step starts to use current regcache rather than current frame for software single. gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * gdbarch.sh (software_single_step): Change parameter from frame_info to regcache. * gdbarch.c, gdbarch.h: Regenerated. * aarch64-tdep.c (aarch64_software_single_step): Change parameter from frame_info to regcache. Don't call get_current_regcache. * alpha-tdep.c (alpha_deal_with_atomic_sequence): Likewise. (alpha_software_single_step): Likewise. * alpha-tdep.h (alpha_software_single_step): Update declaration. * arm-linux-tdep.c (arm_linux_software_single_step): Likewise. * arm-tdep.c (arm_software_single_step): Likewise. * arm-tdep.h (arm_software_single_step): Likewise. * breakpoint.c (insert_single_step_breakpoint): Pass regcache to gdbarch_software_single_step. * cris-tdep.c (cris_software_single_step): Change parameter from frame_info to regcache. Don't call get_current_regcache. * mips-tdep.c (mips_software_single_step): Likewise. * mips-tdep.h (mips_software_single_step): Update declaration. * moxie-tdep.c (moxie_software_single_step): Likewise. * nios2-tdep.c (nios2_software_single_step): Likewise. * ppc-tdep.h (ppc_deal_with_atomic_sequence): Update declaration. * rs6000-aix-tdep.c (rs6000_software_single_step): Likewise. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Likewise. * s390-linux-tdep.c (s390_software_single_step): Likewise. * sparc-tdep.c (sparc_software_single_step): Likewise. * spu-tdep.c (spu_software_single_step): Likewise. * tic6x-tdep.c (tic6x_software_single_step): Likewise.
2016-11-22gdbarch software_single_step frame_info to regcache: spuYao Qi2-4/+12
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * spu-tdep.c (spu_software_single_step): Call get_regcache_arch instead of get_frame_arch. Call regcache_read_pc instead of get_frame_pc. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned.
2016-11-22gdbarch software_single_step frame_info to regcache: tic6xYao Qi2-11/+19
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * tic6x-tdep.c (tic6x_condition_true): Replace frame with regcache. Call regcache_raw_get_signed instead of get_frame_register_signed. (tic6x_get_next_pc): Likewise. Caller updated.
2016-11-22gdbarch software_single_step frame_info to regcache: rs6000Yao Qi3-17/+32
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * rs6000-aix-tdep.c (branch_dest): Replace parameter frame with regcache. Call get_regcache_arch instead of get_frame_arch. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned. (rs6000_software_single_step): Likewise. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Call get_regcache_arch instead of get_frame_arch. Call regcache_read_pc instead of get_frame_pc.
2016-11-22gdbarch software_single_step frame_info to regcache: s390Yao Qi2-3/+9
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * s390-linux-tdep.c (s390_software_single_step): Call get_regcache_arch instead of get_frame_arch. Call regcache_read_pc instead of get_frame_pc.
2016-11-22gdbarch software_single_step frame_info to regcache: sparcYao Qi2-7/+18
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * sparc-tdep.c (sparc_analyze_control_transfer): Replace parameter frame with regcache. Call get_current_frame. (sparc_software_single_step): Call get_regcache_arch instead of get_frame_arch. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned.
2016-11-22gdbarch software_single_step frame_info to regcache: nios2Yao Qi2-12/+21
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * nios2-tdep.c (nios2_get_next_pc): Replace parameter frame with regcache. Call regcache_raw_get_signed instead of get_frame_register_unsigned. (nios2_software_single_step): Call get_regcache_arch instead of get_frame_arch.
2016-11-22gdbarch software_single_step frame_info to regcache: moxieYao Qi2-3/+9
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * moxie-tdep.c (moxie_software_single_step): Call get_regcache_arch instead of get_frame_arch. Call regcache_read_pc instead of get_frame_pc.
2016-11-22gdbarch software_single_step frame_info to regcache: mipsYao Qi2-69/+85
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * mips-tdep.c (mips32_bc1_pc): Replace parameter frame with regcache. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned. (mips32_next_pc): Likewise. (micromips_bc1_pc): Likewise. (micromips_next_pc): Likewise. (extended_mips16_next_pc): Likewise. (mips16_next_pc): Likewise. (mips_next_pc): Likewise. (mips_software_single_step): Call get_regcache_arch instead of get_frame_arch.
2016-11-22gdbarch software_single_step frame_info to regcache: crisYao Qi2-6/+16
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * cris-tdep.c (find_step_target): Replace parameter frame with regcache. Call get_regcache_arch instead of get_frame_arch. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned. (cris_software_single_step): Call get_regcache_arch instead of get_frame_arch.
2016-11-22gdbarch software_single_step frame_info to regcache: alphaYao Qi2-9/+20
gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * alpha-tdep.c (alpha_deal_with_atomic_sequence): Call get_regcache_arch instead of get_frame_arch. Call regcache_read_pc instead of get_frame_pc. (alpha_next_pc): Replace parameter frame with regcache. Call regcache_raw_get_unsigned instead of get_frame_register_unsigned.
2016-11-22gdbarch software_single_step frame_info to regcache: aarch64Yao Qi2-2/+9
Use regcache in software_single_step. gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_software_single_step): Call get_regcache_arch instead of get_frame_arch. Call regcache_read_pc instead of get_frame_pc.
2016-11-22New regcache_raw_get_signedYao Qi3-0/+24
This patch adds a new regcache api regcache_raw_get_signed. gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache_raw_get_signed): New function. * regcache.h (regcache_raw_get_signed): Declare.
2016-11-22Use VALUE_NEXT_FRAME_ID in value_from_componentYao Qi2-1/+6
We renamed VALUE_FRAME_ID to VALUE_NEXT_FRAME_ID recently, https://sourceware.org/ml/gdb-patches/2016-11/msg00018.html and we should use VALUE_NEXT_FRAME_ID in value_from_component too. gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * value.c (value_from_component): Use VALUE_NEXT_FRAME_ID instead of VALUE_FROM_ID.
2016-11-21Add missing POSTCOMPILE step to mi/ file generation rulesSimon Marchi2-0/+6
A little oversight from my part, it caused the Makefile not to track the dependencies from mi/*.c files. gdb/ChangeLog: * Makefile.in (%o: $(srcdir)/mi/%.c): Add missing POSTCOMPILE step.
2016-11-21Create subobject value in pretty printerYao Qi6-36/+42
Nowadays, we create a value of subobject in pretty printer with 'address' being used, value = value_from_contents_and_address (type, valaddr + embedded_offset, address + embedded_offset); set_value_component_location (value, val); /* set_value_component_location resets the address, so we may need to set it again. */ if (VALUE_LVAL (value) != lval_internalvar && VALUE_LVAL (value) != lval_internalvar_component && VALUE_LVAL (value) != lval_computed) set_value_address (value, address + embedded_offset); value_from_contents_and_address creates a value from memory, but the value we are pretty-printing may not from memory at all. Instead of using value_from_contents_and_address, we create a value of subobject with the same location as object's but different offset. We avoid using address in this way. As a result, parameter 'address' in apply_val_pretty_printer is no longer needed, we can remove it in next step. We've already had the location of the 'whole' value, so it is safe to assume we can create a value of 'component' or 'suboject' value at the same location but with different offset. gdb: 2016-11-21 Yao Qi <yao.qi@linaro.org> * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Don't call value_from_contents_and_address and set_value_address. Call value_from_component. * python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Likewise. * value.c (value_from_component): New function. * value.h (value_from_component): Likewise. * valarith.c (value_subscripted_rvalue): Call value_from_component.
2016-11-19ARI: Add detection of printf_vma and sprintf_vmaJoel Brobecker2-0/+21
We shouldn't be using these, since their output goes straight to stdout, which doesn't allow redirection. So this patch updates the ARI to detect any such use. gdb/ChangeLog: * contrib/ari/gdb_ari.sh: Add detection of printf_vma and sprintf_vma.
2016-11-18Makefile: fix typoSimon Marchi2-1/+5
Thanks to Patrick Monnerat for reporting this typo. gdb/ChangeLog: * Makefile.in (%.o: $(srcdir)/gdbtk/generic/%.c): Fix typo.
2016-11-18gdb/doc: Add missing comma after xrefAndreas Arnez2-1/+6
Get rid of a warning for missing punctuation after xref. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Async Records): Add missing comma after xref.
2016-11-17Makefile: Replace explicit subdir rules with pattern rulesSimon Marchi2-733/+236
When adding a .c file in subdirectory (e.g. mi/), the current practice is to add an explicit rule, such as: mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(COMPILE) $(srcdir)/mi/mi-cmd-break.c $(POSTCOMPILE) I find it a bit verbose and cumbersome. Since we now require GNU make, we can change those rules with pattern rules, one for each subdirectory. For example, the following rule works for all files under mi: %.o: $(srcdir)/mi/%.c $(COMPILE) $< $(POSTCOMPILE) Those pattern rules assume that the source and target files have the same stem (foo.c and foo.o). In one case, common-agent.o is generated from common/agent.c, to avoid a conflict with the agent.o in gdb/. In this case, I kept the explicit rule, which takes precedence over the pattern rule. We could also rename common/agent.c to common/common-agent.c to get rid of the special case and still avoid the clash, as it is done with common/common-regcache.c, for example. This strategy was the least intrusive I found, as it only requires changing the rules, not the target names. I also considered two other solutions, which I did not like because I would have had to change target names a bit everywhere. - Replicate the source directory structure in the build directory, which would generate common/agent.o from common/agent.c. However, something was not right with the dependency tracking (the .deps directory). It's probably not hard to fix, but I did not investigate further. - Name the object files after the directory they are in, so that common/agent.c would generate common_agent.c. GDBserver can benefit from the same treatment, but I'll do it in another patch. Built-tested with --enable-targets=all. New in v2: - Regroup pattern rules for .c -> .o compilation in a single place. - Add comment about common-agent.o. gdb/ChangeLog: (PYTHON_CFLAGS): Move up. (%.o: $(srcdir)/arch/%.c): New rule. (%.o: $(srcdir)/cli/%.c): New rule. (%.o: $(srcdir)/common/%.c): New rule. (%.o: $(srcdir)/compile/%.c): New rule. (%.o: $(srcdir)/gdbtk/generic/%.c): New rule. (%.o: $(srcdir)/guile/%.c): New rule. (%.o: $(srcdir)/mi/%.c): New rule. (%.o: $(srcdir)/nat/%.c): New rule. (%.o: $(srcdir)/python/%.c): New rule. (%.o: $(srcdir)/target/%.c): New rule. (%.o: $(srcdir)/tui/%.c): New rule. (cli-cmds.o): Remove. (cli-decode.o): Likewise. (cli-dump.o): Likewise. (cli-interp.o): Likewise. (cli-logging.o): Likewise. (cli-script.o): Likewise. (cli-setshow.o): Likewise. (cli-utils.o): Likewise. (compile.o): Likewise. (compile-c-types.o): Likewise. (compile-c-symbols.o): Likewise. (compile-object-load.o): Likewise. (compile-object-run.o): Likewise. (compile-loc2c.o): Likewise. (compile-c-support.o): Likewise. (gdbtk.o): Likewise. (gdbtk-bp.o): Likewise. (gdbtk-cmds.o): Likewise. (gdbtk-hooks.o): Likewise. (gdbtk-interp.o): Likewise. (gdbtk-main.o): Likewise. (gdbtk-register.o): Likewise. (gdbtk-stack.o): Likewise. (gdbtk-varobj.o): Likewise. (gdbtk-wrapper.o): Likewise. (mi-cmd-break.o): Likewise. (mi-cmd-catch.o): Likewise. (mi-cmd-disas.o): Likewise. (mi-cmd-env.o): Likewise. (mi-cmd-file.o): Likewise. (mi-cmd-info.o): Likewise. (mi-cmds.o): Likewise. (mi-cmd-stack.o): Likewise. (mi-cmd-target.o): Likewise. (mi-cmd-var.o): Likewise. (mi-console.o): Likewise. (mi-getopt.o): Likewise. (mi-interp.o): Likewise. (mi-main.o): Likewise. (mi-out.o): Likewise. (mi-parse.o): Likewise. (mi-symbol-cmds.o): Likewise. (mi-common.o): Likewise. (signals.o): Likewise. (common-utils.o): Likewise. (gdb_vecs.o): Likewise. (xml-utils.o): Likewise. (ptid.o): Likewise. (buffer.o): Likewise. (filestuff.o): Likewise. (format.o): Likewise. (vec.o): Likewise. (print-utils.o): Likewise. (rsp-low.o): Likewise. (errors.o): Likewise. (common-debug.o): Likewise. (cleanups.o): Likewise. (common-exceptions.o (posix-strerror.o): Likewise. (mingw-strerror.o): Likewise. (btrace-common.o): Likewise. (fileio.o): Likewise. (common-regcache.o): Likewise. (signals-state-save-restore.o): Likewise. (new-op.o): Likewise. (waitstatus.o): Likewise. (arm.o): Likewise. (arm-linux.o): Likewise. (arm-get-next-pcs.o): Likewise. (x86-dregs.o): Likewise. (linux-btrace.o): Likewise. (linux-osdata.o): Likewise. (linux-procfs.o): Likewise. (linux-ptrace.o): Likewise. (linux-waitpid.o): Likewise. (mips-linux-watch.o): Likewise. (ppc-linux.o): Likewise. (linux-personality.o): Likewise. (x86-linux.o): Likewise. (x86-linux-dregs.o): Likewise. (amd64-linux-siginfo.o): Likewise. (linux-namespaces.o): Likewise. (aarch64-linux-hw-point.o): Likewise. (aarch64-linux.o): Likewise. (aarch64-insn.o): Likewise. (tui.o): Likewise. (tui-command.o): Likewise. (tui-data.o): Likewise. (tui-disasm.o): Likewise. (tui-file.o): Likewise. (tui-hooks.o): Likewise. (tui-interp.o): Likewise. (tui-io.o): Likewise. (tui-layout.o): Likewise. (tui-out.o): Likewise. (tui-regs.o): Likewise. (tui-source.o): Likewise. (tui-stack.o): Likewise. (tui-win.o): Likewise. (tui-windata.o): Likewise. (tui-wingeneral.o): Likewise. (tui-winsource.o): Likewise. (guile.o): Likewise. (scm-arch.o): Likewise. (scm-auto-load.o): Likewise. (scm-block.o): Likewise. (scm-breakpoint.o): Likewise. (scm-cmd.o): Likewise. (scm-disasm.o): Likewise. (scm-exception.o): Likewise. (scm-frame.o): Likewise. (scm-gsmob.o): Likewise. (scm-iterator.o): Likewise. (scm-lazy-string.o): Likewise. (scm-math.o): Likewise. (scm-objfile.o): Likewise. (scm-param.o): Likewise. (scm-ports.o): Likewise. (scm-pretty-print.o): Likewise. (scm-progspace.o): Likewise. (scm-safe-call.o): Likewise. (scm-string.o): Likewise. (scm-symbol.o): Likewise. (scm-symtab.o): Likewise. (scm-type.o): Likewise. (scm-utils.o): Likewise. (scm-value.o): Likewise. (python.o): Likewise. (py-arch.o): Likewise. (py-auto-load.o): Likewise. (py-block.o): Likewise. (py-bpevent.o): Likewise. (py-breakpoint.o): Likewise. (py-cmd.o): Likewise. (py-continueevent.o): Likewise. (py-xmethods.o): Likewise. (py-event.o): Likewise. (py-evtregistry.o): Likewise. (py-evts.o): Likewise. (py-exitedevent.o): Likewise. (py-finishbreakpoint.o): Likewise. (py-frame.o): Likewise. (py-framefilter.o): Likewise. (py-function.o): Likewise. (py-gdb-readline.o): Likewise. (py-inferior.o): Likewise. (py-infevents.o): Likewise. (py-infthread.o): Likewise. (py-lazy-string.o): Likewise. (py-linetable.o): Likewise. (py-newobjfileevent.o): Likewise. (py-objfile.o): Likewise. (py-param.o): Likewise. (py-prettyprint.o): Likewise. (py-progspace.o): Likewise. (py-signalevent.o): Likewise. (py-stopevent.o): Likewise. (py-symbol.o): Likewise. (py-symtab.o): Likewise. (py-threadevent.o): Likewise. (py-type.o): Likewise. (py-unwind.o): Likewise. (py-utils.o): Likewise. (py-value.o): Likewise. (py-varobj.o): Likewise.
2016-11-17Makefile: Replace old suffix rules with pattern rulesSimon Marchi4-8/+25
As mentioned here [1], suffix rules are obsolete and have been superseeded with pattern rules. People (myself included, before writing this patch) are more likely to know what pattern rules are than suffix rules. AFAIK, .SUFFIXES targets are only used for those rules, and can be removed as well. New in v2: - Replace rule in gdbserver/Makefile.in as well. [1] https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html gdb/ChangeLog: * Makefile.in (.c.o): Replace rule with ... (%.o: %.c): ... this one. (.po.gmo): Replace rule with ... (%.gmo: %.po): ... this one. (.po.pox): Replace rule with ... (%.pox: %.po): ... this one. (.y.c): Replace rule with ... (%.c: %.y): ... this one. (.l.c): Replace rule with ... (%.c: %.l): ... this one. (.SUFFIXES): Remove all instances. gdb/gdbserver/ChangeLog: * Makefile.in (.c.o): Replace rule with ... (%.o: %.c): ... this one.
2016-11-17Remove code that checks for GNU/non-GNU makeSimon Marchi12-408/+98
Since GNU make is now required to build GDB, we can remove everything that checks whether the current make implemention is the GNU one or not. I simply removed the @GMAKE_TRUE@ prefixes and removed the whole lines that were prefixed with @GMAKE_FALSE@. I removed the code in the configure scripts that set those variables. I also removed the following bits from the configure scripts: AC_CHECK_PROGS(MAKE, make): GNU make already defines a MAKE variable internally to be used when invoking Makefiles recursively. I don't see this variable being used anywhere else (in scripts for example), so I think it's safe for removal. AC_PROG_MAKE_SET: This macro defines a SET_MAKE output variable, which is meant to be used in Makefiles to define the MAKE variable when using an implementation of make that doesn't already define it. Since we are now requiring GNU make, we don't need it anymore. Plus, I don't see SET_MAKE being used anywhere, so I don't think it was actually doing anything... gdb/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate. gdb/gdbserver/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate. gdb/testsuite/ChangeLog: * Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines prefixed with @GMAKE_FALSE@. Update comment related to non-GNU make. * configure.ac: Remove checks for the make program. * configure: Re-generate.
2016-11-17Document new hard requirement on GNU makeSimon Marchi2-0/+9
As discussed in [1], it would be benificial for the GDB project to start requiring GNU make to build its software. It would allow using useful GNU-specific constructs, such as pattern rules. It would also allow removing the alternative code paths in the Makefiles (guarded by GMAKE_TRUE/GMAKE_FALSE), simplifying the Makefile code. [1] https://sourceware.org/ml/gdb-patches/2016-11/msg00331.html gdb/ChangeLog: * NEWS: Mention requirement of GNU make.
2016-11-17gdb/c-exp.y: fprintf -> parser_fprintfPedro Alves2-14/+18
Switching GDB to make use of gnulib's C++ namespace support mode revealed these direct uses of fprintf in the C parser, where parser_fprintf should be used to handle rewiring stderr to gdb_stderr: ..../src/gdb/c-exp.y: In function ‘void c_print_token(FILE*, int, YYSTYPE)’: ..../src/gdb/c-exp.y:3220:45: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] pulongest (value.typed_val_int.val)); ^ ..../src/gdb/c-exp.y:3231:62: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] fprintf (file, "tsval<type=%d, %s>", value.tsval.type, copy); ^ ..../src/gdb/c-exp.y:3237:57: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] fprintf (file, "sval<%s>", copy_name (value.sval)); ^ ..../src/gdb/c-exp.y:3243:39: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] copy_name (value.tsym.stoken)); ^ ..../src/gdb/c-exp.y:3254:39: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] value.ssym.is_a_field_of_this); ^ ..../src/gdb/c-exp.y:3258:70: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror] fprintf (file, "bval<%s>", host_address_to_string (value.bval)); ^ gdb/ChangeLog: 2016-11-17 Pedro Alves <palves@redhat.com> * c-exp.y (c_print_token): Use parser_fprintf instead of fprintf.
2016-11-17gdb/ctf.c: Get rid of mkdir redefinitionPedro Alves2-5/+4
Making GDB use gnulib's C++ namespace support shows this build error on mingw: ../../src/gdb/ctf.c: In function 'void ctf_start(trace_file_writer*, const char*)': ../../src/gdb/ctf.c:309:46: error: no match for call to '(const gnulib::_gl_mkdir_wrapper) (const char*&)' #define mkdir(pathname, mode) mkdir (pathname) ^ ../../src/gdb/ctf.c:327:15: note: in expansion of macro 'mkdir' if (gnulib::mkdir (dirname, hmode) && errno != EEXIST) ^ ../../src/gdb/ctf.c:309:46: note: candidate: gnulib::_gl_mkdir_wrapper::type {aka int (*)(const char*, short unsigned int)} <conversion> #define mkdir(pathname, mode) mkdir (pathname) ^ ../../src/gdb/ctf.c:327:15: note: in expansion of macro 'mkdir' if (gnulib::mkdir (dirname, hmode) && errno != EEXIST) ^ ../../src/gdb/ctf.c:309:46: note: candidate expects 3 arguments, 2 provided #define mkdir(pathname, mode) mkdir (pathname) ^ ../../src/gdb/ctf.c:327:15: note: in expansion of macro 'mkdir' if (gnulib::mkdir (dirname, hmode) && errno != EEXIST) ^ The problem is the '#define mkdir ...' Fortunately, we can just remove it, since gnulib's sys/stat.h replacement already takes care of the Windows mkdir prototype quirk: ~~~ /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. Additionally, it declares _mkdir (and depending on compile flags, an alias mkdir), only in the nonstandard includes <direct.h> and <io.h>, which are included above. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ # if !GNULIB_defined_rpl_mkdir static int rpl_mkdir (char const *name, mode_t mode) { return _mkdir (name); } ~~~ That's sys_stat.in.h, part of the sys_stat module, which we explictly pull in nowadays. It wasn't being pulled when this macro was added: https://sourceware.org/ml/gdb-patches/2013-03/msg00736.html That patch was partially reverted meanwhile here: https://sourceware.org/ml/gdb-patches/2013-12/msg00023.html But the mkdir macro had been left behind unnoticed. gdb/ChangeLog: 2016-11-17 Pedro Alves <palves@redhat.com> * ctf.c [USE_WIN32API] (mkdir): Delete.