binutils-gdb/gdbserver/ChangeLog

22272 lines
807 KiB
Plaintext
Raw Permalink Normal View History

2020-06-29 Tom de Vries <tdevries@suse.de>
* ax.h: Include gdbsupport/debug_agent.h.
gdb: Print compatible information within print_xml_feature The gdbsupport directory contains a helper class print_xml_feature that is shared between gdb and gdbserver. This class is used for printing an XML representation of a target_desc object. Currently this class doesn't have the ability to print the <compatible> entities that can appear within a target description, I guess no targets have needed that functionality yet. The print_xml_feature classes API is based around operating on the target_desc class, however, the sharing between gdb and gdbserver is purely textural, we rely on their being a class called target_desc in both gdb and gdbserver, but there is no shared implementation. We then have a set of functions declared that operate on an object of type target_desc, and again these functions have completely separate implementations. Currently then the gdb version of target_desc contains a vector of bfd_arch_info pointers which represents the compatible entries from a target description. The gdbserver version of target_desc has no such information. Further, the gdbserver code doesn't seem to include the bfd headers, and so doesn't know about the bfd types. I was reluctant to include the bfd headers into gdbserver just so I can reference the compatible information, which isn't (currently) even needed in gdbserver. So, the approach I take in this patch is to wrap the compatible information into a new helper class. This class is declared in the gdbsupport library, but implemented separately in both gdb and gdbserver. In gdbserver the class is empty. The compatible information within the gdbserver is an empty list, of empty classes. In gdb the class contains a pointer to the bfd_arch_info object. With this in place we can now add support to print_xml_feature for printing the compatible information if it is present. In the gdbserver code this will never happen, as the gdbserver never has any compatible information. But in gdb, this code will trigger when appropriate. gdb/ChangeLog: * target-descriptions.c (class tdesc_compatible_info): New class. (struct target_desc): Change type of compatible vector. (tdesc_compatible_p): Update for change in type of target_desc::compatible. (tdesc_compatible_info_list): New function. (tdesc_compatible_info_arch_name): New function. (tdesc_add_compatible): Update for change in type of target_desc::compatible. (print_c_tdesc::visit_pre): Likewise. gdbserver/ChangeLog: * tdesc.cc (struct tdesc_compatible_info): New struct. (tdesc_compatible_info_list): New function. (tdesc_compatible_info_arch_name): New function. gdbsupport/ChangeLog: * tdesc.cc (print_xml_feature::visit_pre): Print compatible information. * tdesc.h (struct tdesc_compatible_info): Declare new struct. (tdesc_compatible_info_up): New typedef. (tdesc_compatible_info_list): Declare new function. (tdesc_compatible_info_arch_name): Declare new function.
2020-06-11 23:36:29 +02:00
2020-06-23 Andrew Burgess <andrew.burgess@embecosm.com>
* tdesc.cc (struct tdesc_compatible_info): New struct.
(tdesc_compatible_info_list): New function.
(tdesc_compatible_info_arch_name): New function.
gdbserver/linux-low: use std::list to store pending signals Use std::list to store pending signals instead of a manually-managed linked list. This is a refactoring. In the existing code, pending signals are kept in a manually-created linked list with "prev" pointers. A new pending signal is thus inserted to the beginning of the list. When consuming, GDB goes until the end of the list, following the "prev" pointers, and processes the final item. With this patch, a new item is added to the end of the list and the item at the front of the list is consumed. In other words, the list elements used to be stored in reverse order; with this patch, they are stored in their order of arrival. This causes a change in the debug messages that print the pending signals. Otherwise, no behavioral change is expected. gdbserver/ChangeLog: 2020-06-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Use std::list to stop pending signal instead of manually-created linked list. * linux-low.h: Include <list>. (struct pending_signal): Move here from linux-low.cc. (struct lwp_info) <pending_signals> <pending_signals_to_report>: Update the type. * linux-low.cc (struct pending_signals): Remove. (linux_process_target::delete_lwp) (linux_process_target::add_lwp) (enqueue_one_deferred_signal) (dequeue_one_deferred_signal) (enqueue_pending_signal) (linux_process_target::resume_one_lwp_throw) (linux_process_target::thread_needs_step_over) (linux_process_target::resume_one_thread) (linux_process_target::proceed_one_lwp): Update the use of pending signal list.
2020-06-22 14:13:48 +02:00
2020-06-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Use std::list to stop pending signal instead of manually-created
linked list.
* linux-low.h: Include <list>.
(struct pending_signal): Move here from linux-low.cc.
(struct lwp_info) <pending_signals>
<pending_signals_to_report>: Update the type.
* linux-low.cc (struct pending_signals): Remove.
(linux_process_target::delete_lwp)
(linux_process_target::add_lwp)
(enqueue_one_deferred_signal)
(dequeue_one_deferred_signal)
(enqueue_pending_signal)
(linux_process_target::resume_one_lwp_throw)
(linux_process_target::thread_needs_step_over)
(linux_process_target::resume_one_thread)
(linux_process_target::proceed_one_lwp): Update the use of pending
signal list.
2020-06-17 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in (%-generated.cc: ../gdb/regformats/arm/%.dat):
Remove.
2020-06-12 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in (SFILES): Remove win32-arm-low.cc, wincecompat.cc.
* configure.srv: Remove mingw32ce cases.
* server.h, win32-low.cc: Remove __MINGW32CE__-guarded code.
* win32-low.h (to_back_slashes): Remove.
* win32-arm-low.cc, wincecompat.cc, wincecompat.h: Remove.
2020-06-12 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in (SFILES): linux-tile-low.cc.
* configure.srv: Remove tilegx case.
* linux-tile-low.cc: Remove.
2020-06-12 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in (SFILES): Remove linux-m32r-low.cc.
* configure.srv: Remove m32r case.
* linux-m32r-low.cc: Remove.
2020-06-12 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in (SFILES): Remove linux-cris-low.c.
* configure.srv: Remove cris cases.
* linux-cris-low.cc, linux-crisv32-low.cc: Remove.
2020-06-12 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in (SFILES): Remove linux-bfin-low.c.
* configure.srv: Remove bfin case.
* linux-bfin-low.cc: Remove.
* linux-low.cc: Remove BFIN-conditional code.
2020-06-12 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
* configure.ac: Remove srv_qnx test.
* configure.srv: Remove nto case.
* nto-low.cc, nto-low.h, nto-x86-low.cc: Remove.
* remote-utils.c: Remove __QNX__-guarded code.
2020-06-12 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
* configure.ac: Remove srv_lynxos test.
* configure.srv: Remove lynxos cases.
* lynx-i386-low.cc, lynx-low.cc, lynx-low.h, lynx-ppc-low.c:
Remove.
2020-06-12 Simon Marchi <simon.marchi@efficios.com>
* README: Fix a few outdated or incoherent things.
2020-05-27 Hannes Domani <ssbssa@yahoo.de>
* win32-low.cc (do_initial_child_stuff): Set open_process_used.
(win32_clear_inferiors): Use open_process_used.
(get_child_debug_event): Likewise.
Use construct_inferior_arguments which handles special chars Use the construct_inferior_arguments function instead of stringify_argv to construct a string from the program arguments in those places where that one is then passed to fork_inferior (linux-low, lyn-low), since construct_inferior_arguments properly takes care of special characters, while stringify_argv does not. Using construct_inferior_arguments seems "natural", since its documentation also mentions that it "does the same shell processing as fork_inferior". Since construct_inferior_args has been extended to do proper quoting for Windows shells in commit 5d60742e2dd3c9b475dce54b56043a358751bbb8 ("Fix quoting of special characters for the MinGW build.", 2012-06-12), use it for the Windows case as well. (I could not test that case myself, though.) Adapt handling of empty args in function 'handle_v_run' in gdbserver/server.cc to just insert an empty string for an empty arg, since that one is now properly handled in 'construct_inferior_arguments' already (and inserting a "''" string in 'handle_v_run' would otherwise cause that one to be treated as a string literally containing two quote characters, which 'construct_inferior_args' would preserve by adding extra escaping). This makes gdbserver properly handle program args containing special characters (like spaces), e.g. (example from PR25893) $ gdbserver localhost:50505 myprogram "hello world" now properly handles "hello world" as a single arg, not two separate ones ("hello", "world"). gdbserver/ChangeLog: PR gdbserver/25893 * linux-low.cc (linux_process_target::create_inferior), lynx-low.cc (lynx_process_target::create_inferior), win32-low.cc (win32_process_target::create_inferior): Use construct_inferior_arguments instead of stringify_argv to get string representation which properly escapes special characters. * server.cc (handle_v_run): Just pass empty program arg as such, since any further processing is now handled via construct_inferior_arguments. Change-Id: Ibf963fcd51415c948840fb463289516b3479b0c3
2020-05-25 17:39:43 +02:00
2020-05-25 Michael Weghorn <m.weghorn@posteo.de>
PR gdbserver/25893
* linux-low.cc (linux_process_target::create_inferior),
lynx-low.cc (lynx_process_target::create_inferior),
win32-low.cc (win32_process_target::create_inferior): Use
construct_inferior_arguments instead of stringify_argv
to get string representation which properly escapes
special characters.
* server.cc (handle_v_run): Just pass empty program arg
as such, since any further processing is now handled via
construct_inferior_arguments.
2020-05-25 Michael Weghorn <m.weghorn@posteo.de>
* nto-low.cc (nto_process_target::create_inferior): Pass
argv to spawnp function as char **.
2020-05-25 Michael Weghorn <m.weghorn@posteo.de>
* server.cc (captured_main), (handle_v_run): No longer
insert extra NULL element to args vector.
Use safe-ctype.h (ISSPACE etc.) in symbol parsing & comparison This patch avoids depending on the current locale when parsing & comparing symbol names, by using libiberty's safe-ctype.h uppercase TOLOWER, ISXDIGIT, etc. macros instead of the standard ctype.h tolower, isxdigit, etc. macros/functions. This commit: commit b1b60145aedb8adcb0b9dcf43a5ae735c2f03b51 Author: Pedro Alves <palves@redhat.com> AuthorDate: Tue May 22 17:35:38 2018 +0100 Support UTF-8 identifiers in C/C++ expressions (PR gdb/22973) did something similar, except in the expression parser. This can improve GDB's symbol loading performance significantly. Currently strcmp_iw_ordered can show up high on profiles (called from sort_pst_symbols -> std::sort) because of the isspace and tolower functions. Hannes mentions seeing it as high as in ~24% of the profiling samples on Windows (https://sourceware.org/pipermail/gdb-patches/2020-May/168858.html). I tested GDB's performance (built with "-g -O2") loading a "-g -O0" build of gdb. I ran GDB 10 times like: /bin/time -f %e \ ./gdb/gdb --data-directory ./gdb/data-directory -nx \ -batch /tmp/gdb-g-O0 Then I computed the mean time. The baseline mean time was gdb 2.515 This patch brings the number down to gdb 2.096 Which is an around 16% improvement. gdb/ChangeLog: 2020-05-23 Pedro Alves <palves@redhat.com> * utils.c: Include "gdbsupport/gdb-safe-ctype.h". (parse_escape): Use ISDIGIT instead of isdigit. (puts_debug): Use gdb_isprint instead of isprint. (fprintf_symbol_filtered): Use ISALNUM instead of isalnum. (cp_skip_operator_token, skip_ws, strncmp_iw_with_mode): Use ISSPACE instead of isspace. (strncmp_iw_with_mode): Use TOLOWER instead of tolower and ISSPACE instead of isspace. (strcmp_iw_ordered): Use ISSPACE instead of isspace. (string_to_core_addr): Use TOLOWER instead of tolower, ISXDIGIT instead of isxdigit and ISDIGIT instead of isdigit. gdbsupport/ChangeLog: 2020-05-23 Pedro Alves <palves@redhat.com> * gdb-safe-ctype.h: New.
2020-05-23 13:46:37 +02:00
2020-05-23 Pedro Alves <palves@redhat.com>
* gdb-safe-ctype.h: New.
2020-05-16 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* linux-ia64-low.cc (ia64_target::sw_breakpoint_from_kind):
Fix incorrect 'gdb_assert_no_reached' to 'gdb_assert_not_reached'.
(ia64_target::low_breakpoint_at): Ditto.
2020-05-15 Hannes Domani <ssbssa@yahoo.de>
* win32-i386-low.cc (i386_supports_z_point_type): Handle
Z_PACKET_HW_BP z_type.
(i386_insert_point): Handle raw_bkpt_type type.
(i386_remove_point): Likewise.
2020-04-30 Hannes Domani <ssbssa@yahoo.de>
* configure.srv <x86_64-*-mingw*, x86_64-*-cygwin*> (srv_tgtobj):
Add arch/i386.o.
* win32-arm-low.cc (arm_num_regs): New function.
(struct win32_target_ops): Use arm_num_regs.
* win32-i386-low.cc (win32_get_current_dr): Adapt for WOW64
processes.
(i386_get_thread_context): Likewise.
(i386_prepare_to_resume): Likewise.
(i386_thread_added): Likewise.
(i386_single_step): Likewise.
(i386_fetch_inferior_register): Likewise.
(i386_store_inferior_register): Likewise.
(i386_arch_setup): Likewise.
(i386_win32_num_regs): New function.
(struct win32_target_ops): Use i386_win32_num_regs.
* win32-low.cc (win32_get_thread_context): Adapt for WOW64
processes.
(win32_require_context): Likewise.
(child_add_thread): Likewise.
(do_initial_child_stuff): Likewise.
(continue_one_thread): Likewise.
(win32_process_target::resume): Likewise.
(load_psapi): Likewise.
(win32_add_all_dlls): Likewise.
(maybe_adjust_pc): Likewise.
(win32_process_target::qxfer_siginfo): Likewise.
(initialize_low): Likewise.
* win32-low.h (struct win32_target_ops): Change num_regs to
callback function.
gdb, gdbserver: remove configure check for fs_base/gs_base in user_regs_struct I recently stumbled on this code mentioning Linux kernel 2.6.25, and thought it could be time for some spring cleaning (newer GDBs probably don't need to supports 12-year old kernels). I then found that the "legacy" case is probably broken anyway, which gives an even better motivation for its removal. In short, this patch removes the configure checks that check if user_regs_struct contains the fs_base/gs_base fields and adjusts all uses of the HAVE_STRUCT_USER_REGS_STRUCT_{FS,GS}_BASE macros. The longer explanation/rationale follows. Apparently, Linux kernels since 2.6.25 (that's from 2008) have been reliably providing fs_base and gs_base as part of user_regs_struct. Commit df5d438e33d7 in the Linux kernel [1] seems related. This means that we can get these values by reading registers with PTRACE_GETREGS. Previously, these values were obtained using a separate PTRACE_ARCH_PRCTL ptrace call. First, I'm not even sure the configure check was really right in the first place. The user_regs_struct used by GDB comes from /usr/include/x86_64-linux-gnu/sys/user.h (or equivalent on other distros) and is provided by glibc. glibc has had the fs_base/gs_base fields in there for a very long time, at least since this commit from 2001 [2]. The Linux kernel also has its version of user_regs_struct, which I think was exported to user-space at some point. It included the fs_base/gs_base fields since at least this 2002 commit [3]. In any case, my conclusion is that the fields were there long before the aforementioned Linux kernel commit. The kernel commit didn't add these fields, it only made sure that they have reliable values when obtained with PTRACE_GETREGS. So, checking for the presence of the fs_base/gs_base fields in struct user_regs_struct doesn't sound like a good way of knowing if we can reliably get the fs_base/gs_base values from PTRACE_GETREGS. My guess is that if we were using that strategy on a < 2.6.25 kernel, things would not work correctly: - configure would find that the user_regs_struct has the fs_base/gs_base fields (which are probided by glibc anyway) - we would be reading the fs_base/gs_base values using PTRACE_GETREGS, for which the kernel would provide unreliable values Second, I have tried to see how things worked by forcing GDB to not use fs_base/gs_base from PTRACE_GETREGS (forcing it to use the "legacy" code, by configuring with ac_cv_member_struct_user_regs_struct_gs_base=no ac_cv_member_struct_user_regs_struct_fs_base=no Doing so breaks writing registers back to the inferior. For example, calling an inferior functions gives an internal error: (gdb) p malloc(10) /home/smarchi/src/binutils-gdb/gdb/i387-tdep.c:1408: internal-error: invalid i387 regnum 152 The relevant last frames where this error happens are: #8 0x0000563123d262fc in internal_error (file=0x563123e93fd8 "/home/smarchi/src/binutils-gdb/gdb/i387-tdep.c", line=1408, fmt=0x563123e94482 "invalid i387 regnum %d") at /home/smarchi/src/binutils-gdb/gdbsupport/errors.cc:55 #9 0x0000563123047d0d in i387_collect_xsave (regcache=0x5631269453f0, regnum=152, xsave=0x7ffd38402a20, gcore=0) at /home/smarchi/src/binutils-gdb/gdb/i387-tdep.c:1408 #10 0x0000563122c69e8a in amd64_collect_xsave (regcache=0x5631269453f0, regnum=152, xsave=0x7ffd38402a20, gcore=0) at /home/smarchi/src/binutils-gdb/gdb/amd64-tdep.c:3448 #11 0x0000563122c5e94c in amd64_linux_nat_target::store_registers (this=0x56312515fd10 <the_amd64_linux_nat_target>, regcache=0x5631269453f0, regnum=152) at /home/smarchi/src/binutils-gdb/gdb/amd64-linux-nat.c:335 #12 0x00005631234c8c80 in target_store_registers (regcache=0x5631269453f0, regno=152) at /home/smarchi/src/binutils-gdb/gdb/target.c:3485 #13 0x00005631232e8df7 in regcache::raw_write (this=0x5631269453f0, regnum=152, buf=0x56312759e468 "@\225\372\367\377\177") at /home/smarchi/src/binutils-gdb/gdb/regcache.c:765 #14 0x00005631232e8f0c in regcache::cooked_write (this=0x5631269453f0, regnum=152, buf=0x56312759e468 "@\225\372\367\377\177") at /home/smarchi/src/binutils-gdb/gdb/regcache.c:778 #15 0x00005631232e75ec in regcache::restore (this=0x5631269453f0, src=0x5631275eb130) at /home/smarchi/src/binutils-gdb/gdb/regcache.c:283 #16 0x0000563123083fc4 in infcall_suspend_state::restore (this=0x5631273ed930, gdbarch=0x56312718cf20, tp=0x5631270bca90, regcache=0x5631269453f0) at /home/smarchi/src/binutils-gdb/gdb/infrun.c:9103 #17 0x0000563123081eed in restore_infcall_suspend_state (inf_state=0x5631273ed930) at /home/smarchi/src/binutils-gdb/gdb/infrun.c:9151 The problem seems to be that amd64_linux_nat_target::store_registers calls amd64_native_gregset_supplies_p to know whether gregset provides fs_base. When !HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE, amd64_native_gregset_supplies_p returns false. store_registers therefore assumes that it must be an "xstate" register. This is of course wrong, and that leads to the failed assertion when i387_collect_xsave doesn't recognize the register. amd64_linux_nat_target::store_registers could probably be fixed to handle this case, but I don't think it's worth it, given that it would only be to support very old kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=df5d438e33d7fc914ba9b6e0d6b019a8966c5fcc [2] https://sourceware.org/git/?p=glibc.git;a=commit;h=c9cf6ddeebb7bb [3] https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=88e4bc32686ebd0b1111a94f93eba2d334241f68 gdb/ChangeLog: * configure.ac: Remove check for fs_base/gs_base in user_regs_struct. * configure: Re-generate. * config.in: Re-generate. * amd64-nat.c (amd64_native_gregset_reg_offset): Adjust. * amd64-linux-nat.c (amd64_linux_nat_target::fetch_registers, amd64_linux_nat_target::store_registers, ps_get_thread_area, ): Adjust. gdbserver/ChangeLog: * configure.ac: Remove check for fs_base/gs_base in user_regs_struct. * configure: Re-generate. * config.in: Re-generate. * linux-x86-low.cc (x86_64_regmap, x86_fill_gregset, x86_store_gregset): Adjust.
2020-04-27 16:46:51 +02:00
2020-04-27 Simon Marchi <simon.marchi@efficios.com>
* configure.ac: Remove check for fs_base/gs_base in
user_regs_struct.
* configure: Re-generate.
* config.in: Re-generate.
* linux-x86-low.cc (x86_64_regmap, x86_fill_gregset,
x86_store_gregset): Adjust.
2020-04-22 Hannes Domani <ssbssa@yahoo.de>
* server.cc (handle_search_memory_1): Fix gdb_read_memory return value
comparison.
2020-04-16 Tom Tromey <tromey@adacore.com>
* win32-low.cc (windows_nat::handle_access_violation): New
function.
2020-04-15 Simon Marchi <simon.marchi@polymtl.ca>
* win32-low.cc (get_child_debug_event): Fix format string warning.
2020-04-13 Tom Tromey <tom@tromey.com>
* server.h (gdb_fildes_t): Remove typedef.
* remote-utils.c (remote_desc, list_desc): Now int.
(INVALID_DESCRIPTOR): Remove.
(gdb_connected, remote_close)
(check_remote_input_interrupt_request): Update.
* utils.h (pfildes): Don't declare.
* utils.c (pfildes): Remove.
2020-04-13 Tom Tromey <tom@tromey.com>
* server.h (handle_serial_event, handle_target_event): Update.
* server.c: Don't call initialize_event_loop.
(keep_processing_events): New global.
(handle_serial_event): Return void. Set keep_processing_events.
(handle_target_event): Return void.
(start_event_loop): Move from event-loop.c. Rewrite.
* remote-utils.c (handle_accept_event): Return void.
(reset_readchar): Use delete_timer.
(process_remaining): Return void.
(reschedule): Use create_timer.
* event-loop.h: Remove.
* event-loop.cc: Remove.
* Makefile.in (OBS): Use gdbsupport/event-loop.o, not event-loop.o.
2020-04-13 Tom Tromey <tom@tromey.com>
* server.c (invoke_async_signal_handlers)
(check_async_event_handlers, flush_streams, gdb_select): New
functions.
2020-04-13 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* config.in: Rebuild.
2020-04-08 Tom Tromey <tromey@adacore.com>
PR gdb/22992
* win32-low.c (child_continue): Call matching_pending_stop.
(get_child_debug_event): Call fetch_pending_stop. Push pending
stop when needed.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.h (win32_process_target::stopped_by_sw_breakpoint)
(win32_process_target::supports_stopped_by_sw_breakpoint):
Declare.
* win32-low.c (win32_supports_z_point_type): Always handle
Z_PACKET_SW_BP.
(win32_insert_point): Call insert_memory_breakpoint when needed.
(win32_remove_point): Call remove_memory_breakpoint when needed.
(win32_process_target::stopped_by_sw_breakpoint)
(win32_process_target::supports_stopped_by_sw_breakpoint): New
methods.
(win32_target_ops): Update.
(maybe_adjust_pc): New function.
(win32_wait): Call maybe_adjust_pc.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.h (struct win32_target_ops) <decr_pc_after_break>: New
field.
* win32-i386-low.c (the_low_target): Update.
* win32-arm-low.c (the_low_target): Update.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.h (win32_process_target::read_pc)
(win32_process_target::write_pc): Declare.
* win32-low.c (win32_process_target::read_pc)
(win32_process_target::write_pc): New methods.
* win32-i386-low.c (i386_win32_get_pc, i386_win32_set_pc): New
functions.
(the_low_target): Update.
* win32-arm-low.c (arm_win32_get_pc, arm_win32_set_pc): New
functions.
(the_low_target): Update.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (win32_kill, get_child_debug_event): Use
wait_for_debug_event.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (child_continue): Call continue_last_debug_event.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (handle_exception): Remove.
(windows_nat::handle_ms_vc_exception): New function.
(get_child_debug_event): Add "continue_status" parameter.
Update.
(win32_wait): Update.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (windows_nat::handle_load_dll): Rename from
handle_load_dll. No longer static.
(windows_nat::handle_unload_dll): Rename from handle_unload_dll.
No longer static.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (handle_output_debug_string): Add parameter. Change
return type.
(win32_kill, get_child_debug_event): Update.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (current_process_handle, current_process_id)
(main_thread_id, last_sig, current_event, siginfo_er): Move to
nat/windows-nat.c.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (get_image_name): Remove.
(handle_load_dll): Update.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (windows_nat::thread_rec): Rename from thread_rec.
No longer static. Change parameters.
(child_add_thread, child_fetch_inferior_registers)
(child_store_inferior_registers, win32_resume)
(win32_get_tib_address): Update.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.h (struct win32_target_ops): Use qualified names where
needed.
* win32-i386-low.c: Add "using namespace".
* win32-low.c: Add "using namespace".
* win32-arm-low.c: Add "using namespace".
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (delete_thread_info): Don't call CloseHandle.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (win32_require_context, suspend_one_thread): Use
windows_thread_info::suspend.
(continue_one_thread): Use windows_thread_info::resume.
* configure.srv (srv_tgtobj): Add windows-nat.o when needed.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-i386-low.c (update_debug_registers)
(i386_prepare_to_resume, i386_thread_added): Update.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (child_add_thread): Use new.
(delete_thread_info): Use delete.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.h (struct windows_thread_info): Remove.
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.h (struct windows_thread_info): Rename from
win32_thread_info. Remove typedef.
(struct win32_target_ops, win32_require_context): Update.
* win32-low.c (win32_get_thread_context)
(win32_set_thread_context, win32_prepare_to_resume)
(win32_require_context, thread_rec, child_add_thread)
(delete_thread_info, continue_one_thread)
(child_fetch_inferior_registers, child_store_inferior_registers)
(win32_resume, suspend_one_thread, win32_get_tib_address):
Update.
* win32-i386-low.c (update_debug_registers)
(win32_get_current_dr, i386_get_thread_context)
(i386_prepare_to_resume, i386_thread_added, i386_single_step)
(i386_fetch_inferior_register, i386_store_inferior_register):
Update.
* win32-arm-low.c (arm_get_thread_context)
(arm_fetch_inferior_register, arm_store_inferior_register):
Update.
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* linux-low.h (struct linux_target_ops): Remove.
(the_low_target): Remove.
* linux-x86-low.cc (the_low_target): Remove.
* linux-aarch64-low.cc (the_low_target): Ditto.
* linux-arm-low.cc (the_low_target): Ditto.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-cris-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-ia64-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-mips-low.cc (the_low_target): Ditto.
* linux-nios2-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-riscv-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-sparc-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'get_ipa_tdesc_idx' linux target op and let a concrete
linux target define the op by overriding the declaration in
process_stratum_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <get_ipa_tdesc_idx>: Remove.
* linux-low.cc (linux_process_target::get_ipa_tdesc_idx): Remove.
* linux-x86-low.cc (class x86_target) <get_ipa_tdesc_idx>: Declare.
(x86_get_ipa_tdesc_idx): Turn into...
(x86_target::get_ipa_tdesc_idx): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <get_ipa_tdesc_idx>: Declare.
(ppc_get_ipa_tdesc_idx): Turn into...
(ppc_target::get_ipa_tdesc_idx): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <get_ipa_tdesc_idx>: Declare.
(s390_get_ipa_tdesc_idx): Turn into...
(s390_target::get_ipa_tdesc_idx): ...this.
(the_low_target): Remove the op field.
gdbserver/linux-low: turn 'get_syscall_trapinfo' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'get_syscall_trapinfo' linux target op into a method of process_stratum_target. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <get_syscall_trapinfo> <gdb_catch_this_syscall> <low_supports_catch_syscall> <low_get_syscall_trapinfo>: Declare. * linux-low.cc (get_syscall_trapinfo): Turn into... (linux_process_target::get_syscall_trapinfo): ...this. (linux_process_target::low_get_syscall_trapinfo): Define. (gdb_catch_this_syscall_p): Turn into... (linux_process_target::gdb_catch_this_syscall): ...this. (linux_process_target::low_supports_catch_syscall): Define. Update the callers below. (linux_process_target::wait_1) (linux_process_target::supports_catch_syscall) * linux-x86-low.cc (class x86_target) <low_supports_catch_syscall> <low_get_syscall_trapinfo>: Declare. (x86_target::low_supports_catch_syscall): Define. (x86_get_syscall_trapinfo): Turn into... (x86_target::low_get_syscall_trapinfo): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <low_supports_catch_syscall> <low_get_syscall_trapinfo>: Declare. (aarch64_target::low_supports_catch_syscall): Define. (aarch64_get_syscall_trapinfo): Turn into... (aarch64_target::low_get_syscall_trapinfo): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) <low_supports_catch_syscall> <low_get_syscall_trapinfo>: Declare. (arm_target::low_supports_catch_syscall): Define. (arm_get_syscall_trapinfo): Turn into... (arm_target::low_get_syscall_trapinfo): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (the_low_target): Remove the op field. * linux-s390-low.cc (the_low_target): Remove the op field.
2020-04-02 15:11:31 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'get_syscall_trapinfo' linux target op into a method
of process_stratum_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <get_syscall_trapinfo>
<gdb_catch_this_syscall>
<low_supports_catch_syscall>
<low_get_syscall_trapinfo>: Declare.
* linux-low.cc (get_syscall_trapinfo): Turn into...
(linux_process_target::get_syscall_trapinfo): ...this.
(linux_process_target::low_get_syscall_trapinfo): Define.
(gdb_catch_this_syscall_p): Turn into...
(linux_process_target::gdb_catch_this_syscall): ...this.
(linux_process_target::low_supports_catch_syscall): Define.
Update the callers below.
(linux_process_target::wait_1)
(linux_process_target::supports_catch_syscall)
* linux-x86-low.cc (class x86_target) <low_supports_catch_syscall>
<low_get_syscall_trapinfo>: Declare.
(x86_target::low_supports_catch_syscall): Define.
(x86_get_syscall_trapinfo): Turn into...
(x86_target::low_get_syscall_trapinfo): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<low_supports_catch_syscall>
<low_get_syscall_trapinfo>: Declare.
(aarch64_target::low_supports_catch_syscall): Define.
(aarch64_get_syscall_trapinfo): Turn into...
(aarch64_target::low_get_syscall_trapinfo): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target) <low_supports_catch_syscall>
<low_get_syscall_trapinfo>: Declare.
(arm_target::low_supports_catch_syscall): Define.
(arm_get_syscall_trapinfo): Turn into...
(arm_target::low_get_syscall_trapinfo): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (the_low_target): Remove the op field.
* linux-s390-low.cc (the_low_target): Remove the op field.
gdbserver/linux-low: turn 'supports_hardware_single_step' into a method All the linux low targets except arm define the 'supports_hardware_single_step' op to return true. Hence, we override the method to return true in linux_process_target, and remove the definitions in all the linux low targets but arm. gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Remove the 'supports_hardware_single_step' linux target op and override the process_stratum_target's op definition in linux_process_target to return true. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <finish_step_over> <maybe_hw_step>: Declare. * linux-low.cc (can_hardware_single_step): Remove. (maybe_hw_step): Turn into... (linux_process_target::maybe_hw_step): ...this. (finish_step_over): Turn into... (linux_process_target::finish_step_over): ...this. (linux_process_target::supports_hardware_single_step): Update to return true. Update the callers below. (linux_process_target::single_step) (linux_process_target::resume_one_lwp_throw) * linux-arm-low.cc (class arm_target) <supports_hardware_single_step>: Declare. (arm_supports_hardware_single_step): Turn into... (arm_target::supports_hardware_single_step): ...this. (the_low_target): Remove the op field. * linux-x86-low.cc (x86_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-aarch64-low.cc (aarch64_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-bfin-low.cc (bfin_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-crisv32-low.cc (cris_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-m32r-low.cc (m32r_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-m68k-low.cc (m68k_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-ppc-low.cc (ppc_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-s390-low.cc (s390_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-sh-low.cc (sh_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-tic6x-low.cc (tic6x_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-tile-low.cc (tile_supports_hardware_single_step): Remove. (the_low_target): Remove the op field. * linux-xtensa-low.cc (xtensa_supports_hardware_single_step): Remove. (the_low_target): Remove the op field.
2020-04-02 15:11:31 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'supports_hardware_single_step' linux target op and
override the process_stratum_target's op definition in
linux_process_target to return true.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <finish_step_over>
<maybe_hw_step>: Declare.
* linux-low.cc (can_hardware_single_step): Remove.
(maybe_hw_step): Turn into...
(linux_process_target::maybe_hw_step): ...this.
(finish_step_over): Turn into...
(linux_process_target::finish_step_over): ...this.
(linux_process_target::supports_hardware_single_step): Update
to return true.
Update the callers below.
(linux_process_target::single_step)
(linux_process_target::resume_one_lwp_throw)
* linux-arm-low.cc (class arm_target)
<supports_hardware_single_step>: Declare.
(arm_supports_hardware_single_step): Turn into...
(arm_target::supports_hardware_single_step): ...this.
(the_low_target): Remove the op field.
* linux-x86-low.cc (x86_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (aarch64_supports_hardware_single_step):
Remove.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (bfin_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (cris_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-m32r-low.cc (m32r_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-m68k-low.cc (m68k_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (ppc_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-s390-low.cc (s390_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-sh-low.cc (sh_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-tic6x-low.cc (tic6x_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-tile-low.cc (tile_supports_hardware_single_step): Remove.
(the_low_target): Remove the op field.
* linux-xtensa-low.cc (xtensa_supports_hardware_single_step):
Remove.
(the_low_target): Remove the op field.
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'supports_range_stepping' linux target op into a method
of linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <low_supports_range_stepping>: Declare.
* linux-low.cc (linux_process_target::low_supports_range_stepping):
Define.
(linux_process_target::supports_range_stepping): Update the call
site.
* linux-x86-low.cc (class x86_target)
<low_supports_range_stepping>: Declare.
(x86_supports_range_stepping): Turn into...
(x86_target::low_supports_range_stepping): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<low_supports_range_stepping>: Declare.
(aarch64_supports_range_stepping): Turn into...
(aarch64_target::low_supports_range_stepping): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (the_low_target): Remove the op field.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn 'emit_ops' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Remove the 'emit_ops' linux target ops and let the concrete linux target define the op by overriding the declaration of process_stratum_target. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <emit_ops>: Remove. * linux-low.cc (linux_process_target::emit_ops): Remove. * linux-x86-low.cc (class x86_target) <emit_ops>: Declare. (x86_emit_ops): Turn into... (x86_target::emit_ops): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <emit_ops>: Declare. (aarch64_emit_ops): Turn into... (aarch64_target::emit_ops): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) <emit_ops>: Declare. (ppc_emit_ops): Turn into... (ppc_target::emit_ops): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) <emit_ops>: Declare. (s390_emit_ops): Turn into... (s390_target::emit_ops): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (the_low_target): Remove the op field. * linux-bfin-low.cc (the_low_target): Ditto. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:30 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'emit_ops' linux target ops and let the concrete
linux target define the op by overriding the declaration of
process_stratum_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <emit_ops>: Remove.
* linux-low.cc (linux_process_target::emit_ops): Remove.
* linux-x86-low.cc (class x86_target) <emit_ops>: Declare.
(x86_emit_ops): Turn into...
(x86_target::emit_ops): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target) <emit_ops>: Declare.
(aarch64_emit_ops): Turn into...
(aarch64_target::emit_ops): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <emit_ops>: Declare.
(ppc_emit_ops): Turn into...
(ppc_target::emit_ops): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <emit_ops>: Declare.
(s390_emit_ops): Turn into...
(s390_target::emit_ops): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (the_low_target): Remove the op field.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn fast tracepoint ops into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Remove the 'install_fast_tracepoint_jump_pad' and 'get_min_fast_tracepoint_insn_len' linux target ops to let the concrete linux target define the ops by overriding the declarations of process_stratum_target. * linux-low.h (struct linux_target_ops): Remove the ops. (class linux_process_target) <supports_fast_tracepoints> <install_fast_tracepoint_jump_pad> <get_min_fast_tracepoint_insn_len>: Remove. * linux-low.cc (linux_process_target::supports_fast_tracepoints) (linux_process_target::install_fast_tracepoint_jump_pad) (linux_process_target::get_min_fast_tracepoint_insn_len): Remove. * linux-x86-low.cc (class x86_target) <supports_fast_tracepoints> <install_fast_tracepoint_jump_pad> <get_min_fast_tracepoint_insn_len>: Declare. (x86_target::supports_fast_tracepoints): Define. (x86_install_fast_tracepoint_jump_pad): Turn into... (x86_target::install_fast_tracepoint_jump_pad): ...this. (x86_get_min_fast_tracepoint_insn_len): Turn into... (x86_target::get_min_fast_tracepoint_insn_len): ...this. (the_low_target): Remove the op fields. * linux-aarch64-low.cc (class aarch64_target) <supports_fast_tracepoints> <install_fast_tracepoint_jump_pad> <get_min_fast_tracepoint_insn_len>: Declare. (aarch64_target::supports_fast_tracepoints): Define. (aarch64_install_fast_tracepoint_jump_pad): Turn into... (aarch64_target::install_fast_tracepoint_jump_pad): ...this. (aarch64_get_min_fast_tracepoint_insn_len): Turn into... (aarch64_target::get_min_fast_tracepoint_insn_len): ...this. (the_low_target): Remove the op fields. * linux-ppc-low.cc (class ppc_target) <supports_fast_tracepoints> <install_fast_tracepoint_jump_pad> <get_min_fast_tracepoint_insn_len>: Declare. (ppc_target::supports_fast_tracepoints): Define. (ppc_install_fast_tracepoint_jump_pad): Turn into... (ppc_target::install_fast_tracepoint_jump_pad): ...this. (ppc_get_min_fast_tracepoint_insn_len): Turn into... (ppc_target::get_min_fast_tracepoint_insn_len): ...this. (the_low_target): Remove the op fields. * linux-s390-low.cc (class s390_target) <supports_fast_tracepoints> <install_fast_tracepoint_jump_pad> <get_min_fast_tracepoint_insn_len>: Declare. (s390_target::supports_fast_tracepoints): Define. (s390_install_fast_tracepoint_jump_pad): Turn into... (s390_target::install_fast_tracepoint_jump_pad): ...this. (s390_get_min_fast_tracepoint_insn_len): Turn into... (s390_target::get_min_fast_tracepoint_insn_len): ...this. (the_low_target): Remove the op fields. * linux-arm-low.cc (the_low_target): Remove the op fields. * linux-bfin-low.cc (the_low_target): Ditto. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:30 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'install_fast_tracepoint_jump_pad' and
'get_min_fast_tracepoint_insn_len' linux target ops to let the
concrete linux target define the ops by overriding the declarations
of process_stratum_target.
* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Remove.
* linux-low.cc (linux_process_target::supports_fast_tracepoints)
(linux_process_target::install_fast_tracepoint_jump_pad)
(linux_process_target::get_min_fast_tracepoint_insn_len): Remove.
* linux-x86-low.cc (class x86_target) <supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Declare.
(x86_target::supports_fast_tracepoints): Define.
(x86_install_fast_tracepoint_jump_pad): Turn into...
(x86_target::install_fast_tracepoint_jump_pad): ...this.
(x86_get_min_fast_tracepoint_insn_len): Turn into...
(x86_target::get_min_fast_tracepoint_insn_len): ...this.
(the_low_target): Remove the op fields.
* linux-aarch64-low.cc (class aarch64_target)
<supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Declare.
(aarch64_target::supports_fast_tracepoints): Define.
(aarch64_install_fast_tracepoint_jump_pad): Turn into...
(aarch64_target::install_fast_tracepoint_jump_pad): ...this.
(aarch64_get_min_fast_tracepoint_insn_len): Turn into...
(aarch64_target::get_min_fast_tracepoint_insn_len): ...this.
(the_low_target): Remove the op fields.
* linux-ppc-low.cc (class ppc_target) <supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Declare.
(ppc_target::supports_fast_tracepoints): Define.
(ppc_install_fast_tracepoint_jump_pad): Turn into...
(ppc_target::install_fast_tracepoint_jump_pad): ...this.
(ppc_get_min_fast_tracepoint_insn_len): Turn into...
(ppc_target::get_min_fast_tracepoint_insn_len): ...this.
(the_low_target): Remove the op fields.
* linux-s390-low.cc (class s390_target) <supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Declare.
(s390_target::supports_fast_tracepoints): Define.
(s390_install_fast_tracepoint_jump_pad): Turn into...
(s390_target::install_fast_tracepoint_jump_pad): ...this.
(s390_get_min_fast_tracepoint_insn_len): Turn into...
(s390_target::get_min_fast_tracepoint_insn_len): ...this.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (the_low_target): Remove the op fields.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn 'get_thread_area' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'get_thread_area' linux target op into a method of process_stratum_target. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <stuck_in_jump_pad> <linux_fast_tracepoint_collecting> <low_get_thread_area>: Declare. * linux-low.cc (supports_fast_tracepoints): Remove. (linux_fast_tracepoint_collecting): Turn into... (linux_process_target::linux_fast_tracepoint_collecting): ...this. (linux_process_target::low_get_thread_area): Define. (stuck_in_jump_pad_callback): Turn into... (linux_process_target::stuck_in_jump_pad): ...this. Update the caller below. (linux_process_target::stabilize_threads) * linux-x86-low.cc (class x86_target) <low_get_thread_area>: Declare. (x86_get_thread_area): Turn into... (x86_target::low_get_thread_area): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <low_get_thread_area>: Declare. (aarch64_get_thread_area): Turn into... (aarch64_target::low_get_thread_area): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) <low_get_thread_area>: Declare. (ppc_get_thread_area): Turn into... (ppc_target::low_get_thread_area): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) <low_get_thread_area>: Declare. (s390_get_thread_area): Turn into... (s390_target::low_get_thread_area): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (the_low_target): Remove the op field. * linux-bfin-low.cc (the_low_target): Ditto. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:30 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'get_thread_area' linux target op into a method of
process_stratum_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <stuck_in_jump_pad>
<linux_fast_tracepoint_collecting>
<low_get_thread_area>: Declare.
* linux-low.cc (supports_fast_tracepoints): Remove.
(linux_fast_tracepoint_collecting): Turn into...
(linux_process_target::linux_fast_tracepoint_collecting): ...this.
(linux_process_target::low_get_thread_area): Define.
(stuck_in_jump_pad_callback): Turn into...
(linux_process_target::stuck_in_jump_pad): ...this.
Update the caller below.
(linux_process_target::stabilize_threads)
* linux-x86-low.cc (class x86_target) <low_get_thread_area>:
Declare.
(x86_get_thread_area): Turn into...
(x86_target::low_get_thread_area): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target) <low_get_thread_area>:
Declare.
(aarch64_get_thread_area): Turn into...
(aarch64_target::low_get_thread_area): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <low_get_thread_area>:
Declare.
(ppc_get_thread_area): Turn into...
(ppc_target::low_get_thread_area): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <low_get_thread_area>:
Declare.
(s390_get_thread_area): Turn into...
(s390_target::low_get_thread_area): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (the_low_target): Remove the op field.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn 'supports_tracepoints' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Remote the 'supports_tracepoints' linux target op and let the concrete linux target define it by overriding the op declared in process_stratum_target. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <supports_tracepoints>: Remove. * linux-low.cc (linux_process_target::supports_tracepoints): Remove. * linux-x86-low.cc (class x86_target) <supports_tracepoints>: Declare. (x86_supports_tracepoints): Turn into... (x86_target::supports_tracepoints): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <supports_tracepoints>: Declare. (aarch64_supports_tracepoints): Turn into... (aarch64_target::supports_tracepoints): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) <supports_tracepoints>: Declare. (ppc_supports_tracepoints): Turn into... (ppc_target::supports_tracepoints): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) <supports_tracepoints>: Declare. (s390_supports_tracepoints): Turn into... (s390_target::supports_tracepoints): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (the_low_target): Remove the op field. * linux-bfin-low.cc (the_low_target): Ditto. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:29 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remote the 'supports_tracepoints' linux target op and let the
concrete linux target define it by overriding the op declared in
process_stratum_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <supports_tracepoints>: Remove.
* linux-low.cc (linux_process_target::supports_tracepoints): Remove.
* linux-x86-low.cc (class x86_target) <supports_tracepoints>:
Declare.
(x86_supports_tracepoints): Turn into...
(x86_target::supports_tracepoints): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<supports_tracepoints>: Declare.
(aarch64_supports_tracepoints): Turn into...
(aarch64_target::supports_tracepoints): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <supports_tracepoints>:
Declare.
(ppc_supports_tracepoints): Turn into...
(ppc_target::supports_tracepoints): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <supports_tracepoints>:
Declare.
(s390_supports_tracepoints): Turn into...
(s390_target::supports_tracepoints): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (the_low_target): Remove the op field.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'process_qsupported' linux target op and let a concrete
linux target define the op by overriding the op declaration in
process_stratum_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <process_qsupported>: Remove.
* linux-low.cc (linux_process_target::process_qsupported): Remove.
* linux-x86-low.cc (class x86_target) <process_qsupported>: Declare.
(x86_linux_process_qsupported): Turn into...
(x86_target::process_qsupported): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (the_low_target): Remove the op
field.
* linux-arm-low.cc (the_low_target): Ditto.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn 'prepare_to_resume' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'prepare_to_resume' linux target op into a method of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <low_prepare_to_resume>: Declare. * linux-low.cc (linux_process_target::low_prepare_to_resume): Define. Update the callers below: (linux_process_target::resume_one_lwp_throw) (linux_process_target::low_prepare_to_resume) * linux-x86-low.cc (class x86_target) <low_prepare_to_resume>: Declare. (x86_target::low_prepare_to_resume): Define. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <low_prepare_to_resume>: Declare. (aarch64_target::low_prepare_to_resume): Define. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) <low_prepare_to_resume>: Declare. (arm_prepare_to_resume): Turn into... (arm_target::low_prepare_to_resume): ...this. (the_low_target): Remove the op field. * linux-mips-low.cc (class mips_target) <low_prepare_to_resume>: Declare. (mips_linux_prepare_to_resume): Turn into... (mips_target::low_prepare_to_resume): ...this. (the_low_target): Remove the op field. * linux-bfin-low.cc (the_low_target): Remove the op field. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-ppc-low.cc (the_low_target): Ditto. * linux-s390-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:29 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'prepare_to_resume' linux target op into a method of
linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <low_prepare_to_resume>: Declare.
* linux-low.cc (linux_process_target::low_prepare_to_resume):
Define.
Update the callers below:
(linux_process_target::resume_one_lwp_throw)
(linux_process_target::low_prepare_to_resume)
* linux-x86-low.cc (class x86_target) <low_prepare_to_resume>:
Declare.
(x86_target::low_prepare_to_resume): Define.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<low_prepare_to_resume>: Declare.
(aarch64_target::low_prepare_to_resume): Define.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target) <low_prepare_to_resume>:
Declare.
(arm_prepare_to_resume): Turn into...
(arm_target::low_prepare_to_resume): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target) <low_prepare_to_resume>:
Declare.
(mips_linux_prepare_to_resume): Turn into...
(mips_target::low_prepare_to_resume): ...this.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (the_low_target): Remove the op field.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn process/thread addition/deletion ops into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'new_process', 'delete_process', 'new_thread', 'delete_thread', and 'new_fork' linux target ops into methods of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the ops. (class linux_process_target) <add_linux_process> <add_lwp> <delete_lwp> <attach_lwp> <detach_one_lwp> <check_zombie_leaders> <filter_exit_event> <low_new_process> <low_delete_process> <low_new_thread> <low_delete_thread> <low_new_fork>: Declare. * linux-low.cc (delete_lwp): Turn into... (linux_process_target::delete_lwp): ...this. (linux_process_target::low_delete_thread): Define. (linux_add_process): Turn into... (linux_process_target::add_linux_process): ...this. (linux_process_target::low_new_process): Define. (linux_process_target::low_delete_process): Define. (linux_process_target::low_new_fork): Define. (add_lwp): Turn into... (linux_process_target::add_lwp): ...this. (linux_process_target::low_new_thread): Define. (linux_attach_lwp): Turn into... (linux_process_target::attach_lwp): ...this. (linux_detach_one_lwp): Turn into... (linux_process_target::detach_one_lwp): ...this. (linux_detach_lwp_callback): Remove and inline... (linux_process_target::detach): ...here. (check_zombie_leaders): Turn into... (linux_process_target::check_zombie_leaders): ...this. (filter_exit_event): Turn into... (linux_process_target::filter_exit_event): ...this. Update the callers below. (linux_process_target::handle_extended_wait) (linux_process_target::create_inferior) (attach_proc_task_lwp_callback) (linux_process_target::attach) (linux_process_target::detach) (linux_process_target::mourn) * thread-db.cc (attach_thread) * linux-x86-low.cc (class x86_target) <low_new_process> <low_delete_process> <low_new_thread> <low_delete_thread> <low_new_fork>: Declare. (x86_linux_new_process): Turn into... (x86_target::low_new_process): ...this. (x86_linux_delete_process): Turn into... (x86_target::low_delete_process): ...this. (x86_target::low_new_thread): Define. (x86_target::low_delete_thread): Define. (x86_linux_new_fork): Turn into... (x86_target::low_new_fork): ...this. (the_low_target): Remove the op fields. * linux-aarch64-low.cc (class aarch64_target) <low_new_process> <low_delete_process> <low_new_thread> <low_delete_thread> <low_new_fork>: Declare. (aarch64_linux_new_process): Turn into... (aarch64_target::low_new_process): ...this. (aarch64_linux_delete_process): Turn into... (aarch64_target::low_delete_process): ...this. (aarch64_target::low_new_thread): Define. (aarch64_target::low_delete_thread): Define. (aarch64_linux_new_fork): Turn into... (aarch64_target::low_new_fork): ...this. (the_low_target): Remove the op fields. * linux-arm-low.cc (class arm_target) <low_new_process> <low_delete_process> <low_new_thread> <low_delete_thread> <low_new_fork>: Declare. (arm_new_process): Turn into... (arm_target::low_new_process): ...this. (arm_delete_process): Turn into... (arm_target::low_delete_process): ...this. (arm_new_thread): Turn into... (arm_target::low_new_thread): ...this. (arm_delete_thread): Turn into... (arm_target::low_delete_thread): ...this. (arm_new_fork): Turn into... (arm_target::low_new_fork): ...this. (the_low_target): Remove the op fields. * linux-mips-low.cc (class mips_target) <low_new_process> <low_delete_process> <low_new_thread> <low_delete_thread> <low_new_fork>: Declare. (mips_linux_new_process): Turn into... (mips_target::low_new_process): ...this. (mips_linux_delete_process): Turn into... (mips_target::low_delete_process): ...this. (mips_linux_new_thread): Turn into... (mips_target::low_new_thread): ...this. (mips_linux_delete_thread): Turn into... (mips_target::low_delete_thread): ...this. (mips_linux_new_fork): Turn into... (mips_target::low_new_fork): ...this. (the_low_target): Remove the op fields. * linux-bfin-low.cc (the_low_target): Remove the op fields. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-ppc-low.cc (the_low_target): Ditto. * linux-s390-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:28 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'new_process', 'delete_process', 'new_thread',
'delete_thread', and 'new_fork' linux target ops into methods
of linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <add_linux_process>
<add_lwp>
<delete_lwp>
<attach_lwp>
<detach_one_lwp>
<check_zombie_leaders>
<filter_exit_event>
<low_new_process>
<low_delete_process>
<low_new_thread>
<low_delete_thread>
<low_new_fork>: Declare.
* linux-low.cc (delete_lwp): Turn into...
(linux_process_target::delete_lwp): ...this.
(linux_process_target::low_delete_thread): Define.
(linux_add_process): Turn into...
(linux_process_target::add_linux_process): ...this.
(linux_process_target::low_new_process): Define.
(linux_process_target::low_delete_process): Define.
(linux_process_target::low_new_fork): Define.
(add_lwp): Turn into...
(linux_process_target::add_lwp): ...this.
(linux_process_target::low_new_thread): Define.
(linux_attach_lwp): Turn into...
(linux_process_target::attach_lwp): ...this.
(linux_detach_one_lwp): Turn into...
(linux_process_target::detach_one_lwp): ...this.
(linux_detach_lwp_callback): Remove and inline...
(linux_process_target::detach): ...here.
(check_zombie_leaders): Turn into...
(linux_process_target::check_zombie_leaders): ...this.
(filter_exit_event): Turn into...
(linux_process_target::filter_exit_event): ...this.
Update the callers below.
(linux_process_target::handle_extended_wait)
(linux_process_target::create_inferior)
(attach_proc_task_lwp_callback)
(linux_process_target::attach)
(linux_process_target::detach)
(linux_process_target::mourn)
* thread-db.cc (attach_thread)
* linux-x86-low.cc (class x86_target) <low_new_process>
<low_delete_process>
<low_new_thread>
<low_delete_thread>
<low_new_fork>: Declare.
(x86_linux_new_process): Turn into...
(x86_target::low_new_process): ...this.
(x86_linux_delete_process): Turn into...
(x86_target::low_delete_process): ...this.
(x86_target::low_new_thread): Define.
(x86_target::low_delete_thread): Define.
(x86_linux_new_fork): Turn into...
(x86_target::low_new_fork): ...this.
(the_low_target): Remove the op fields.
* linux-aarch64-low.cc (class aarch64_target) <low_new_process>
<low_delete_process>
<low_new_thread>
<low_delete_thread>
<low_new_fork>: Declare.
(aarch64_linux_new_process): Turn into...
(aarch64_target::low_new_process): ...this.
(aarch64_linux_delete_process): Turn into...
(aarch64_target::low_delete_process): ...this.
(aarch64_target::low_new_thread): Define.
(aarch64_target::low_delete_thread): Define.
(aarch64_linux_new_fork): Turn into...
(aarch64_target::low_new_fork): ...this.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (class arm_target) <low_new_process>
<low_delete_process>
<low_new_thread>
<low_delete_thread>
<low_new_fork>: Declare.
(arm_new_process): Turn into...
(arm_target::low_new_process): ...this.
(arm_delete_process): Turn into...
(arm_target::low_delete_process): ...this.
(arm_new_thread): Turn into...
(arm_target::low_new_thread): ...this.
(arm_delete_thread): Turn into...
(arm_target::low_delete_thread): ...this.
(arm_new_fork): Turn into...
(arm_target::low_new_fork): ...this.
(the_low_target): Remove the op fields.
* linux-mips-low.cc (class mips_target) <low_new_process>
<low_delete_process>
<low_new_thread>
<low_delete_thread>
<low_new_fork>: Declare.
(mips_linux_new_process): Turn into...
(mips_target::low_new_process): ...this.
(mips_linux_delete_process): Turn into...
(mips_target::low_delete_process): ...this.
(mips_linux_new_thread): Turn into...
(mips_target::low_new_thread): ...this.
(mips_linux_delete_thread): Turn into...
(mips_target::low_delete_thread): ...this.
(mips_linux_new_fork): Turn into...
(mips_target::low_new_fork): ...this.
(the_low_target): Remove the op fields.
* linux-bfin-low.cc (the_low_target): Remove the op fields.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'siginfo_fixup' linux target op into a method of
linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <siginfo_fixup>
<low_siginfo_fixup>: Declare.
* linux-low.cc (siginfo_fixup): Turn into...
(linux_process_target::siginfo_fixup): ...this.
(linux_process_target::low_siginfo_fixup): Define.
* linux-x86-low.cc (class x86_target) <low_siginfo_fixup>: Declare.
(x86_siginfo_fixup): Turn into...
(x86_target::low_siginfo_fixup): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target):
<low_siginfo_fixup>: Declare.
(aarch64_linux_siginfo_fixup): Turn into...
(aarch64_target::low_siginfo_fixup): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (the_low_target): Remove the op field.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-mips-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn '{collect, supply}_ptrace_register' into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'collect_ptrace_register' and 'supply_ptrace_register' linux target ops into methods of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the ops. (class linux_process_target) <low_collect_ptrace_register> <low_store_ptrace_register>: Declare. * linux-low.cc (linux_process_target::low_collect_ptrace_register) (linux_process_target::low_supply_ptrace_register): Define. Update the callers below. (linux_process_target::fetch_register) (linux_process_target::store_register) * linux-x86-low.cc (the_low_target): Remove the op fields. * linux-aarch64-low.cc (the_low_target): Ditto. * linux-arm-low.cc (the_low_target): Ditto. * linux-bfin-low.cc (the_low_target): Ditto. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-sparc-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto. * linux-mips-low.cc (class mips_target) <low_collect_ptrace_register> <low_supply_ptrace_register>: Declare. (mips_collect_ptrace_register): Turn into ... (mips_target::low_collect_ptrace_register): ...this. (mips_supply_ptrace_register): Turn into... (mips_target::low_supply_ptrace_register): ...this. (the_low_target): Remove the op fields. * linux-ppc-low.cc (class ppc_target) <low_collect_ptrace_register> <low_supply_ptrace_register>: Declare. (ppc_collect_ptrace_register): Turn into ... (ppc_target::low_collect_ptrace_register): ...this. (ppc_supply_ptrace_register): Turn into ... (ppc_target::low_supply_ptrace_register): ...this. (ppc_fill_gregset): Update for the calls to low_collect_ptrace_register. (the_low_target): Remove the op fields. * linux-s390-low.cc (class s390_target) <low_collect_ptrace_register> <low_supply_ptrace_register>: Declare. (s390_collect_ptrace_register): Turn into ... (s390_target::low_collect_ptrace_register): ...this. (s390_supply_ptrace_register): Turn into ... (s390_target::low_supply_ptrace_register): ...this. (s390_fill_gregset): Update for the calls to low_collect_ptrace_register. (the_low_target): Remove the op fields.
2020-04-02 15:11:28 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'collect_ptrace_register' and 'supply_ptrace_register'
linux target ops into methods of linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <low_collect_ptrace_register>
<low_store_ptrace_register>: Declare.
* linux-low.cc (linux_process_target::low_collect_ptrace_register)
(linux_process_target::low_supply_ptrace_register): Define.
Update the callers below.
(linux_process_target::fetch_register)
(linux_process_target::store_register)
* linux-x86-low.cc (the_low_target): Remove the op fields.
* linux-aarch64-low.cc (the_low_target): Ditto.
* linux-arm-low.cc (the_low_target): Ditto.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-sparc-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
* linux-mips-low.cc (class mips_target)
<low_collect_ptrace_register>
<low_supply_ptrace_register>: Declare.
(mips_collect_ptrace_register): Turn into ...
(mips_target::low_collect_ptrace_register): ...this.
(mips_supply_ptrace_register): Turn into...
(mips_target::low_supply_ptrace_register): ...this.
(the_low_target): Remove the op fields.
* linux-ppc-low.cc (class ppc_target)
<low_collect_ptrace_register>
<low_supply_ptrace_register>: Declare.
(ppc_collect_ptrace_register): Turn into ...
(ppc_target::low_collect_ptrace_register): ...this.
(ppc_supply_ptrace_register): Turn into ...
(ppc_target::low_supply_ptrace_register): ...this.
(ppc_fill_gregset): Update for the calls to
low_collect_ptrace_register.
(the_low_target): Remove the op fields.
* linux-s390-low.cc (class s390_target)
<low_collect_ptrace_register>
<low_supply_ptrace_register>: Declare.
(s390_collect_ptrace_register): Turn into ...
(s390_target::low_collect_ptrace_register): ...this.
(s390_supply_ptrace_register): Turn into ...
(s390_target::low_supply_ptrace_register): ...this.
(s390_fill_gregset): Update for the calls to
low_collect_ptrace_register.
(the_low_target): Remove the op fields.
gdbserver/linux-low: turn watchpoint ops into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'stopped_by_watchpoint' and 'stopped_data_address' linux target ops into methods of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the ops. (class linux_process_target) <check_stopped_by_watchpoint> <low_stopped_by_watchpoint> <low_stopped_data_address>: Declare. * linux-low.cc (check_stopped_by_watchpoint): Turn into... (linux_process_target::check_stopped_by_watchpoint): ...this. (linux_process_target::low_stopped_by_watchpoint): Define. (linux_process_target::low_stopped_data_address): Define. * linux-x86-low.cc (class x86_target) <low_stopped_by_watchpoint> <low_stopped_data_address>: Declare. (x86_stopped_by_watchpoint): Turn into... (x86_target::low_stopped_by_watchpoint): ...this. (x86_stopped_data_address): Turn into... (x86_target::low_stopped_data_address): ...this. (the_low_target): Remove the op fields. * linux-aarch64-low.cc (class aarch64_target) <low_stopped_by_watchpoint> <low_stopped_data_address>: Declare. (aarch64_stopped_by_watchpoint): Turn into... (aarch64_target::low_stopped_by_watchpoint): ...this. (aarch64_stopped_data_address): Turn into... (aarch64_target::low_stopped_data_address): ...this. (the_low_target): Remove the op fields. * linux-arm-low.cc (class arm_target) <low_stopped_by_watchpoint> <low_stopped_data_address>: Declare. (arm_stopped_by_watchpoint): Turn into... (arm_target::low_stopped_by_watchpoint): ...this. (arm_stopped_data_address): Turn into... (arm_target::low_stopped_data_address): ...this. (the_low_target): Remove the op fields. * linux-crisv32-low.cc (class crisv32_target) <low_stopped_by_watchpoint> <low_stopped_data_address>: Declare. (cris_stopped_by_watchpoint): Turn into... (crisv32_target::low_stopped_by_watchpoint): ...this. (cris_stopped_data_address): Turn into... (crisv32_target::low_stopped_data_address): ...this. (the_low_target): Remove the op fields. * linux-mips-low.cc (class mips_target) <low_stopped_by_watchpoint> <low_stopped_data_address>: Declare. (mips_stopped_by_watchpoint): Turn into... (mips_target::low_stopped_by_watchpoint): ...this. (mips_stopped_data_address): Turn into... (mips_target::low_stopped_data_address): ...this. (the_low_target): Remove the op fields. * linux-bfin-low.cc (the_low_target): Remove the op fields. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-ppc-low.cc (the_low_target): Ditto. * linux-s390-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-sparc-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:27 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'stopped_by_watchpoint' and 'stopped_data_address' linux
target ops into methods of linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <check_stopped_by_watchpoint>
<low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
* linux-low.cc (check_stopped_by_watchpoint): Turn into...
(linux_process_target::check_stopped_by_watchpoint): ...this.
(linux_process_target::low_stopped_by_watchpoint): Define.
(linux_process_target::low_stopped_data_address): Define.
* linux-x86-low.cc (class x86_target) <low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(x86_stopped_by_watchpoint): Turn into...
(x86_target::low_stopped_by_watchpoint): ...this.
(x86_stopped_data_address): Turn into...
(x86_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-aarch64-low.cc (class aarch64_target)
<low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(aarch64_stopped_by_watchpoint): Turn into...
(aarch64_target::low_stopped_by_watchpoint): ...this.
(aarch64_stopped_data_address): Turn into...
(aarch64_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (class arm_target) <low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(arm_stopped_by_watchpoint): Turn into...
(arm_target::low_stopped_by_watchpoint): ...this.
(arm_stopped_data_address): Turn into...
(arm_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-crisv32-low.cc (class crisv32_target)
<low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(cris_stopped_by_watchpoint): Turn into...
(crisv32_target::low_stopped_by_watchpoint): ...this.
(cris_stopped_data_address): Turn into...
(crisv32_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-mips-low.cc (class mips_target) <low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(mips_stopped_by_watchpoint): Turn into...
(mips_target::low_stopped_by_watchpoint): ...this.
(mips_stopped_data_address): Turn into...
(mips_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-bfin-low.cc (the_low_target): Remove the op fields.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-sparc-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn 'insert_point' and 'remove_point' into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'insert_point' and 'remove_point' linux target ops into methods of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the ops. (class linux_process_target) <low_insert_point> <low_remove_point>: Declare. * linux-low.cc (linux_process_target::low_insert_point) (linux_process_target::low_remove_point): Define. (linux_process_target::insert_point) (linux_process_target::remove_point): Update for calls to low_insert_point and low_remove_point. * linux-x86-low.cc (class x86_target) <low_insert_point> <low_remove_point>: Declare. (x86_insert_point): Turn into... (x86_target::low_insert_point): ...this. (x86_remove_point): Turn into... (x86_target::low_remove_point): ...this. (the_low_target): Remove the op fields. * linux-aarch64-low.cc (class aarch64_target) <low_insert_point> <low_remove_point>: Declare. (aarch64_insert_point): Turn into... (aarch64_target::low_insert_point): ...this. (aarch64_remove_point): Turn into... (aarch64_target::low_remove_point): ...this. (the_low_target): Remove the op fields. * linux-arm-low.cc (class arm_target) <low_insert_point> <low_remove_point>: Declare. (arm_insert_point): Turn into... (arm_target::low_insert_point): ...this. (arm_remove_point): Turn into... (arm_target::low_remove_point): ...this. (the_low_target): Remove the op fields. * linux-crisv32-low.cc (class crisv32_target) <low_insert_point> <low_remove_point>: Declare. (crisv32_insert_point): Turn into... (crisv32_target::low_insert_point): ...this. (crisv32_remove_point): Turn into... (crisv32_target::low_remove_point): ...this. (the_low_target): Remove the op fields. * linux-mips-low.cc (class mips_target) <low_insert_point> <low_remove_point>: Declare. (mips_insert_point): Turn into... (mips_target::low_insert_point): ...this. (mips_remove_point): Turn into... (mips_target::low_remove_point): ...this. (the_low_target): Remove the op fields. * linux-ppc-low.cc (class ppc_target) <low_insert_point> <low_remove_point>: Declare. (ppc_insert_point): Turn into... (ppc_target::low_insert_point): ...this. (ppc_remove_point): Turn into... (ppc_target::low_remove_point): ...this. (the_low_target): Remove the op fields. * linux-bfin-low.cc (the_low_target): Remove the op fields. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-s390-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-sparc-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:27 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'insert_point' and 'remove_point' linux target ops into
methods of linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <low_insert_point>
<low_remove_point>: Declare.
* linux-low.cc (linux_process_target::low_insert_point)
(linux_process_target::low_remove_point): Define.
(linux_process_target::insert_point)
(linux_process_target::remove_point): Update for calls to
low_insert_point and low_remove_point.
* linux-x86-low.cc (class x86_target) <low_insert_point>
<low_remove_point>: Declare.
(x86_insert_point): Turn into...
(x86_target::low_insert_point): ...this.
(x86_remove_point): Turn into...
(x86_target::low_remove_point): ...this.
(the_low_target): Remove the op fields.
* linux-aarch64-low.cc (class aarch64_target) <low_insert_point>
<low_remove_point>: Declare.
(aarch64_insert_point): Turn into...
(aarch64_target::low_insert_point): ...this.
(aarch64_remove_point): Turn into...
(aarch64_target::low_remove_point): ...this.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (class arm_target) <low_insert_point>
<low_remove_point>: Declare.
(arm_insert_point): Turn into...
(arm_target::low_insert_point): ...this.
(arm_remove_point): Turn into...
(arm_target::low_remove_point): ...this.
(the_low_target): Remove the op fields.
* linux-crisv32-low.cc (class crisv32_target) <low_insert_point>
<low_remove_point>: Declare.
(crisv32_insert_point): Turn into...
(crisv32_target::low_insert_point): ...this.
(crisv32_remove_point): Turn into...
(crisv32_target::low_remove_point): ...this.
(the_low_target): Remove the op fields.
* linux-mips-low.cc (class mips_target) <low_insert_point>
<low_remove_point>: Declare.
(mips_insert_point): Turn into...
(mips_target::low_insert_point): ...this.
(mips_remove_point): Turn into...
(mips_target::low_remove_point): ...this.
(the_low_target): Remove the op fields.
* linux-ppc-low.cc (class ppc_target) <low_insert_point>
<low_remove_point>: Declare.
(ppc_insert_point): Turn into...
(ppc_target::low_insert_point): ...this.
(ppc_remove_point): Turn into...
(ppc_target::low_remove_point): ...this.
(the_low_target): Remove the op fields.
* linux-bfin-low.cc (the_low_target): Remove the op fields.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-sparc-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn 'supports_z_point_type' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Remove the 'supports_z_point_type' linux target op and let the concrete linux target define it by overriding the op declared in process_stratum_target. * linux-low.cc (linux_process_target::supports_z_point_type): Remove. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <supports_z_point_type>: Remove. * linux-x86-low.cc (class x86_target) <supports_z_point_type>: Declare. (x86_supports_z_point_type): Turn into... (x86_target::supports_z_point_type): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <supports_z_point_type>: Declare. (aarch64_supports_z_point_type): Turn into... (aarch64_target::supports_z_point_type): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) <supports_z_point_type>: Declare. (arm_supports_z_point_type): Turn into... (arm_target::supports_z_point_type): ...this. (the_low_target): Remove the op field. * linux-crisv32-low.cc (class crisv32_target) <supports_z_point_type>: Declare. (cris_supports_z_point_type): Turn into... (crisv32_target::supports_z_point_type): ...this. (the_low_target): Remove the op field. * linux-mips-low.cc (class mips_target) <supports_z_point_type>: Declare. (mips_supports_z_point_type): Turn into... (mips_target::supports_z_point_type): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) <supports_z_point_type>: Declare. (ppc_supports_z_point_type): Turn into... (ppc_target::supports_z_point_type): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) <supports_z_point_type>: Declare. (s390_supports_z_point_type): Turn into... (s390_target::supports_z_point_type): ...this. (the_low_target): Remove the op field. * linux-bfin-low.cc (the_low_target): Remove the op field. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-sparc-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto.
2020-04-02 15:11:27 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'supports_z_point_type' linux target op and let the
concrete linux target define it by overriding the op declared in
process_stratum_target.
* linux-low.cc (linux_process_target::supports_z_point_type):
Remove.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <supports_z_point_type>: Remove.
* linux-x86-low.cc (class x86_target) <supports_z_point_type>:
Declare.
(x86_supports_z_point_type): Turn into...
(x86_target::supports_z_point_type): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<supports_z_point_type>: Declare.
(aarch64_supports_z_point_type): Turn into...
(aarch64_target::supports_z_point_type): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target) <supports_z_point_type>:
Declare.
(arm_supports_z_point_type): Turn into...
(arm_target::supports_z_point_type): ...this.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (class crisv32_target)
<supports_z_point_type>: Declare.
(cris_supports_z_point_type): Turn into...
(crisv32_target::supports_z_point_type): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target) <supports_z_point_type>:
Declare.
(mips_supports_z_point_type): Turn into...
(mips_target::supports_z_point_type): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <supports_z_point_type>:
Declare.
(ppc_supports_z_point_type): Turn into...
(ppc_target::supports_z_point_type): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <supports_z_point_type>:
Declare.
(s390_supports_z_point_type): Turn into...
(s390_target::supports_z_point_type): ...this.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (the_low_target): Remove the op field.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-sparc-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
gdbserver/linux-low: turn 'breakpoint_at' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'breakpoint_at' linux target op into a method of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <low_breakpoint_at>: Declare. Update the callers below: * linux-low.cc (linux_process_target::save_stop_reason) (linux_process_target::thread_still_has_status_pending) (linux_process_target::wait_1) * linux-x86-low.cc (class x86_target) <low_breakpoint_at>: Declare. (x86_breakpoint_at): Turn into... (x86_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <low_breakpoint_at>: Declare. (aarch64_breakpoint_at): Turn into... (aarch64_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) <low_breakpoint_at>: Declare. (arm_target::low_breakpoint_at): Define. (the_low_target): Remove the op field. * linux-bfin-low.cc (class bfin_target) <low_breakpoint_at>: Declare. (bfin_breakpoint_at): Turn into... (bfin_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-cris-low.cc (class cris_target) <low_breakpoint_at>: Declare. (cris_breakpoint_at): Turn into... (cris_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-crisv32-low.cc (class crisv32_target) <low_breakpoint_at>: Declare. (crisv32_breakpoint_at): Turn into... (crisv32_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-ia64-low.cc (class ia64_target) <low_breakpoint_at>: Declare. (ia64_target::low_breakpoint_at): Define. * linux-m32r-low.cc (class m32r_target) <low_breakpoint_at>: Declare. (m32r_breakpoint_at): Turn into... (m32r_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-m68k-low.cc (class m68k_target) <low_breakpoint_at>: Declare. (m68k_breakpoint_at): Turn into... (m68k_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-mips-low.cc (class mips_target) <low_breakpoint_at>: Declare. (mips_breakpoint_at): Turn into... (mips_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-nios2-low.cc (class nios2_target) <low_breakpoint_at>: Declare. (nios2_breakpoint_at): Turn into... (nios2_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) <low_breakpoint_at>: Declare. (ppc_breakpoint_at): Turn into... (ppc_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-riscv-low.cc (class riscv_target) <low_breakpoint_at>: Declare. (riscv_breakpoint_at): Turn into... (riscv_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) <low_breakpoint_at>: Declare. (s390_breakpoint_at): Turn into... (s390_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-sh-low.cc (class sh_target) <low_breakpoint_at>: Declare. (sh_breakpoint_at): Turn into... (sh_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-sparc-low.cc (class sparc_target) <low_breakpoint_at>: Declare. (sparc_breakpoint_at): Turn into... (sparc_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-tic6x-low.cc (class tic6x_target) <low_breakpoint_at>: Declare. (tic6x_breakpoint_at): Turn into... (tic6x_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-tile-low.cc (class tile_target) <low_breakpoint_at>: Declare. (tile_breakpoint_at): Turn into... (tile_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field. * linux-xtensa-low.cc (class xtensa_target) <low_breakpoint_at>: Declare. (xtensa_breakpoint_at): Turn into... (xtensa_target::low_breakpoint_at): ...this. (the_low_target): Remove the op field.
2020-04-02 15:11:26 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'breakpoint_at' linux target op into a method of
linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <low_breakpoint_at>: Declare.
Update the callers below:
* linux-low.cc (linux_process_target::save_stop_reason)
(linux_process_target::thread_still_has_status_pending)
(linux_process_target::wait_1)
* linux-x86-low.cc (class x86_target)
<low_breakpoint_at>: Declare.
(x86_breakpoint_at): Turn into...
(x86_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<low_breakpoint_at>: Declare.
(aarch64_breakpoint_at): Turn into...
(aarch64_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target)
<low_breakpoint_at>: Declare.
(arm_target::low_breakpoint_at): Define.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (class bfin_target)
<low_breakpoint_at>: Declare.
(bfin_breakpoint_at): Turn into...
(bfin_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-cris-low.cc (class cris_target)
<low_breakpoint_at>: Declare.
(cris_breakpoint_at): Turn into...
(cris_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (class crisv32_target)
<low_breakpoint_at>: Declare.
(crisv32_breakpoint_at): Turn into...
(crisv32_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-ia64-low.cc (class ia64_target)
<low_breakpoint_at>: Declare.
(ia64_target::low_breakpoint_at): Define.
* linux-m32r-low.cc (class m32r_target)
<low_breakpoint_at>: Declare.
(m32r_breakpoint_at): Turn into...
(m32r_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-m68k-low.cc (class m68k_target)
<low_breakpoint_at>: Declare.
(m68k_breakpoint_at): Turn into...
(m68k_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target)
<low_breakpoint_at>: Declare.
(mips_breakpoint_at): Turn into...
(mips_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-nios2-low.cc (class nios2_target)
<low_breakpoint_at>: Declare.
(nios2_breakpoint_at): Turn into...
(nios2_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target)
<low_breakpoint_at>: Declare.
(ppc_breakpoint_at): Turn into...
(ppc_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-riscv-low.cc (class riscv_target)
<low_breakpoint_at>: Declare.
(riscv_breakpoint_at): Turn into...
(riscv_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target)
<low_breakpoint_at>: Declare.
(s390_breakpoint_at): Turn into...
(s390_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-sh-low.cc (class sh_target)
<low_breakpoint_at>: Declare.
(sh_breakpoint_at): Turn into...
(sh_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-sparc-low.cc (class sparc_target)
<low_breakpoint_at>: Declare.
(sparc_breakpoint_at): Turn into...
(sparc_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-tic6x-low.cc (class tic6x_target)
<low_breakpoint_at>: Declare.
(tic6x_breakpoint_at): Turn into...
(tic6x_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-tile-low.cc (class tile_target)
<low_breakpoint_at>: Declare.
(tile_breakpoint_at): Turn into...
(tile_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-xtensa-low.cc (class xtensa_target)
<low_breakpoint_at>: Declare.
(xtensa_breakpoint_at): Turn into...
(xtensa_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
gdbserver/linux-low: turn the 'decr_pc_after_break' field into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'decr_pc_after_break' linux_target_ops field into a method of linux_process_target. * linux-low.h (struct linux_target_ops) <decr_pc_after_break>: Remove. (class linux_process_target) <low_decr_pc_after_break>: New method declaration. * linux-low.cc (linux_process_target::low_decr_pc_after_break): New method implementation. Update the users below. (linux_process_target::save_stop_reason) (linux_process_target::wait_1) * linux-x86-low.cc (class x86_target) <low_decr_pc_after_break>: New declaration. (x86_target::low_decr_pc_after_break): New method implementation. (the_low_target): Remove the field. * linux-bfin-low.cc (class bfin_target) <low_decr_pc_after_break>: New declaration. (bfin_target::low_decr_pc_after_break): New method implementation. (the_low_target): Remove the field. * linux-m68k-low.cc (class m68k_target) <low_decr_pc_after_break>: New declaration. (m68k_target::low_decr_pc_after_break): New method implementation. (the_low_target): Remove the field. * linux-s390-low.cc (class s390_target) <low_decr_pc_after_break>: New declaration. (s390_target::low_decr_pc_after_break): New method implementation. (the_low_target): Remove the field. * linux-aarch64-low.cc (the_low_target): Remove the field. * linux-arm-low.cc (the_low_target): Remove the field. * linux-cris-low.cc (the_low_target): Remove the field. * linux-crisv32-low.cc (the_low_target): Remove the field. * linux-m32r-low.cc (the_low_target): Remove the field. * linux-mips-low.cc (the_low_target): Remove the field. * linux-nios2-low.cc (the_low_target): Remove the field. * linux-ppc-low.cc (the_low_target): Remove the field. * linux-riscv-low.cc (the_low_target): Remove the field. * linux-sh-low.cc (the_low_target): Remove the field. * linux-sparc-low.cc (the_low_target): Remove the field. * linux-tic6x-low.cc (the_low_target): Remove the field. * linux-tile-low.cc (the_low_target): Remove the field. * linux-xtensa-low.cc (the_low_target): Remove the field.
2020-04-02 15:11:26 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'decr_pc_after_break' linux_target_ops field into
a method of linux_process_target.
* linux-low.h (struct linux_target_ops)
<decr_pc_after_break>: Remove.
(class linux_process_target) <low_decr_pc_after_break>: New method
declaration.
* linux-low.cc (linux_process_target::low_decr_pc_after_break):
New method implementation.
Update the users below.
(linux_process_target::save_stop_reason)
(linux_process_target::wait_1)
* linux-x86-low.cc (class x86_target) <low_decr_pc_after_break>:
New declaration.
(x86_target::low_decr_pc_after_break): New method implementation.
(the_low_target): Remove the field.
* linux-bfin-low.cc (class bfin_target) <low_decr_pc_after_break>:
New declaration.
(bfin_target::low_decr_pc_after_break): New method implementation.
(the_low_target): Remove the field.
* linux-m68k-low.cc (class m68k_target) <low_decr_pc_after_break>:
New declaration.
(m68k_target::low_decr_pc_after_break): New method implementation.
(the_low_target): Remove the field.
* linux-s390-low.cc (class s390_target) <low_decr_pc_after_break>:
New declaration.
(s390_target::low_decr_pc_after_break): New method implementation.
(the_low_target): Remove the field.
* linux-aarch64-low.cc (the_low_target): Remove the field.
* linux-arm-low.cc (the_low_target): Remove the field.
* linux-cris-low.cc (the_low_target): Remove the field.
* linux-crisv32-low.cc (the_low_target): Remove the field.
* linux-m32r-low.cc (the_low_target): Remove the field.
* linux-mips-low.cc (the_low_target): Remove the field.
* linux-nios2-low.cc (the_low_target): Remove the field.
* linux-ppc-low.cc (the_low_target): Remove the field.
* linux-riscv-low.cc (the_low_target): Remove the field.
* linux-sh-low.cc (the_low_target): Remove the field.
* linux-sparc-low.cc (the_low_target): Remove the field.
* linux-tic6x-low.cc (the_low_target): Remove the field.
* linux-tile-low.cc (the_low_target): Remove the field.
* linux-xtensa-low.cc (the_low_target): Remove the field.
gdbserver/linux-low: turn 'supports_software_single_step' and 'get_next_pcs' into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Remove the 'supports_software_single_step' linux target op and let the concrete linux target define it by overriding the op in process_stratum_target. Turn the 'get_next_pcs' linux target op into a method of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the ops. (class linux_process_target) <supports_software_single_step>: Remove. <low_get_next_pcs>: Declare. * linux-low.cc (can_software_single_step): Remove. (linux_process_target::low_get_next_pcs): Define. (linux_process_target::supports_software_single_step): Remove. Update the callers below. (linux_process_target::handle_extended_wait) (linux_process_target::wait_1) (linux_process_target::install_software_single_step_breakpoints) (linux_process_target::single_step) (linux_process_target::thread_needs_step_over) (linux_process_target::proceed_one_lwp) (linux_process_target::supports_range_stepping) * linux-x86-low.cc (the_low_target): Remove the op field. * linux-aarch64-low.cc (the_low_target): Ditto. * linux-bfin-low.cc (the_low_target): Ditto. * linux-cris-low.cc (the_low_target): Ditto. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-mips-low.cc (the_low_target): Ditto. * linux-nios2-low.cc (the_low_target): Ditto. * linux-ppc-low.cc (the_low_target): Ditto. * linux-riscv-low.cc (the_low_target): Ditto. * linux-s390-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-sparc-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto. * linux-arm-low.cc (class arm_target) <low_get_next_pcs> <supports_software_single_step>: Declare. (arm_target::supports_software_single_step): Define. (arm_gdbserver_get_next_pcs): Turn into... (arm_target::low_get_next_pcs): ...this. (the_low_target): Remove the op field.
2020-04-02 15:11:26 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'supports_software_single_step' linux target op and let
the concrete linux target define it by overriding the op in
process_stratum_target.
Turn the 'get_next_pcs' linux target op into a method of
linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <supports_software_single_step>:
Remove.
<low_get_next_pcs>: Declare.
* linux-low.cc (can_software_single_step): Remove.
(linux_process_target::low_get_next_pcs): Define.
(linux_process_target::supports_software_single_step): Remove.
Update the callers below.
(linux_process_target::handle_extended_wait)
(linux_process_target::wait_1)
(linux_process_target::install_software_single_step_breakpoints)
(linux_process_target::single_step)
(linux_process_target::thread_needs_step_over)
(linux_process_target::proceed_one_lwp)
(linux_process_target::supports_range_stepping)
* linux-x86-low.cc (the_low_target): Remove the op field.
* linux-aarch64-low.cc (the_low_target): Ditto.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-cris-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-mips-low.cc (the_low_target): Ditto.
* linux-nios2-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-riscv-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-sparc-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
* linux-arm-low.cc (class arm_target) <low_get_next_pcs>
<supports_software_single_step>: Declare.
(arm_target::supports_software_single_step): Define.
(arm_gdbserver_get_next_pcs): Turn into...
(arm_target::low_get_next_pcs): ...this.
(the_low_target): Remove the op field.
gdbserver/linux-low: turn 'sw_breakpoint_from_kind' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Remove the 'sw_breakpoint_from_kind' linux target op, and let the concrete linux target define it by overriding the op in process_stratum_target. * linux-low.cc (linux_process_target::sw_breakpoint_from_kind): Remove. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <sw_breakpoint_from_kind>: Remove. * linux-x86-low.cc (class x86_target) <sw_breakpoint_from_kind>: Declare. (x86_sw_breakpoint_from_kind): Turn into... (x86_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <sw_breakpoint_from_kind>: Declare. (aarch64_sw_breakpoint_from_kind): Turn into... (aarch64_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) <sw_breakpoint_from_kind>: Declare. (arm_target::sw_breakpoint_from_kind): Define. (the_low_target): Remove the op field. * linux-bfin-low.cc (class bfin_target) <sw_breakpoint_from_kind>: Declare. (bfin_sw_breakpoint_from_kind): Turn into... (bfin_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-cris-low.cc (class cris_target) <sw_breakpoint_from_kind>: Declare. (cris_sw_breakpoint_from_kind): Turn into... (cris_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-crisv32-low.cc (class crisv32_target) <sw_breakpoint_from_kind>: Declare. (cris_sw_breakpoint_from_kind): Turn into... (crisv32_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-ia64-low.cc (class ia64_target) <sw_breakpoint_from_kind>: Declare. (ia64_target::sw_breakpoint_from_kind): Define. * linux-m32r-low.cc (class m32r_target) <sw_breakpoint_from_kind>: Declare. (m32r_sw_breakpoint_from_kind): Turn into... (m32r_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-m68k-low.cc (class m68k_target) <sw_breakpoint_from_kind>: Declare. (m68k_sw_breakpoint_from_kind): Turn into... (m68k_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-mips-low.cc (class mips_target) <sw_breakpoint_from_kind>: Declare. (mips_sw_breakpoint_from_kind): Turn into... (mips_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-nios2-low.cc (class nios2_target) <sw_breakpoint_from_kind>: Declare. (nios2_sw_breakpoint_from_kind): Turn into... (nios2_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) <sw_breakpoint_from_kind>: Declare. (ppc_sw_breakpoint_from_kind): Turn into... (ppc_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-riscv-low.cc (class riscv_target) <sw_breakpoint_from_kind>: Declare. (riscv_sw_breakpoint_from_kind): Turn into... (riscv_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) <sw_breakpoint_from_kind>: Declare. (s390_sw_breakpoint_from_kind): Turn into... (s390_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-sh-low.cc (class sh_target) <sw_breakpoint_from_kind>: Declare. (sh_sw_breakpoint_from_kind): Turn into... (sh_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-sparc-low.cc (class sparc_target) <sw_breakpoint_from_kind>: Declare. (sparc_sw_breakpoint_from_kind): Turn into... (sparc_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-tic6x-low.cc (class tic6x_target) <sw_breakpoint_from_kind>: Declare. (tic6x_sw_breakpoint_from_kind): Turn into... (tic6x_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-tile-low.cc (class tile_target) <sw_breakpoint_from_kind>: Declare. (tile_sw_breakpoint_from_kind): Turn into... (tile_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-xtensa-low.cc (class xtensa_target) <sw_breakpoint_from_kind>: Declare. (xtensa_sw_breakpoint_from_kind): Turn into... (xtensa_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field.
2020-04-02 15:11:25 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'sw_breakpoint_from_kind' linux target op, and let
the concrete linux target define it by overriding the op
in process_stratum_target.
* linux-low.cc (linux_process_target::sw_breakpoint_from_kind):
Remove.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <sw_breakpoint_from_kind>: Remove.
* linux-x86-low.cc (class x86_target) <sw_breakpoint_from_kind>:
Declare.
(x86_sw_breakpoint_from_kind): Turn into...
(x86_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<sw_breakpoint_from_kind>: Declare.
(aarch64_sw_breakpoint_from_kind): Turn into...
(aarch64_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target) <sw_breakpoint_from_kind>:
Declare.
(arm_target::sw_breakpoint_from_kind): Define.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (class bfin_target) <sw_breakpoint_from_kind>:
Declare.
(bfin_sw_breakpoint_from_kind): Turn into...
(bfin_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-cris-low.cc (class cris_target) <sw_breakpoint_from_kind>:
Declare.
(cris_sw_breakpoint_from_kind): Turn into...
(cris_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (class crisv32_target)
<sw_breakpoint_from_kind>: Declare.
(cris_sw_breakpoint_from_kind): Turn into...
(crisv32_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-ia64-low.cc (class ia64_target) <sw_breakpoint_from_kind>:
Declare.
(ia64_target::sw_breakpoint_from_kind): Define.
* linux-m32r-low.cc (class m32r_target) <sw_breakpoint_from_kind>:
Declare.
(m32r_sw_breakpoint_from_kind): Turn into...
(m32r_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-m68k-low.cc (class m68k_target) <sw_breakpoint_from_kind>:
Declare.
(m68k_sw_breakpoint_from_kind): Turn into...
(m68k_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target) <sw_breakpoint_from_kind>:
Declare.
(mips_sw_breakpoint_from_kind): Turn into...
(mips_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-nios2-low.cc (class nios2_target) <sw_breakpoint_from_kind>:
Declare.
(nios2_sw_breakpoint_from_kind): Turn into...
(nios2_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <sw_breakpoint_from_kind>:
Declare.
(ppc_sw_breakpoint_from_kind): Turn into...
(ppc_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-riscv-low.cc (class riscv_target) <sw_breakpoint_from_kind>:
Declare.
(riscv_sw_breakpoint_from_kind): Turn into...
(riscv_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <sw_breakpoint_from_kind>:
Declare.
(s390_sw_breakpoint_from_kind): Turn into...
(s390_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-sh-low.cc (class sh_target) <sw_breakpoint_from_kind>:
Declare.
(sh_sw_breakpoint_from_kind): Turn into...
(sh_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-sparc-low.cc (class sparc_target) <sw_breakpoint_from_kind>:
Declare.
(sparc_sw_breakpoint_from_kind): Turn into...
(sparc_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-tic6x-low.cc (class tic6x_target) <sw_breakpoint_from_kind>:
Declare.
(tic6x_sw_breakpoint_from_kind): Turn into...
(tic6x_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-tile-low.cc (class tile_target) <sw_breakpoint_from_kind>:
Declare.
(tile_sw_breakpoint_from_kind): Turn into...
(tile_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-xtensa-low.cc (class xtensa_target)
<sw_breakpoint_from_kind>: Declare.
(xtensa_sw_breakpoint_from_kind): Turn into...
(xtensa_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
gdbserver/linux-low: turn 'breakpoint_kind_from_{pc, current_state}' into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Remove the 'breakpoint_kind_from_pc' and 'breakpoint_kind_from_current_state' linux target ops, and let the concrete linux target define them by overriding the ops of process_stratum_target. * linux-low.cc (linux_process_target::breakpoint_kind_from_pc): Remove. (linux_process_target::breakpoint_kind_from_current_state): Remove. * linux-low.h (struct linux_target_ops): Remove ops. (class linux_process_target) <breakpoint_kind_from_pc>: Remove. <breakpoint_kind_from_current_state>: Remove. * linux-x86-low.cc (the_low_target): Remove the op fields. * linux-bfin-low.cc (the_low_target): Ditto. * linux-cris-low.cc (the_low_target): Ditto. * linux-crisv32-low.cc (the_low_target): Ditto. * linux-m32r-low.cc (the_low_target): Ditto. * linux-m68k-low.cc (the_low_target): Ditto. * linux-mips-low.cc (the_low_target): Ditto. * linux-nios2-low.cc (the_low_target): Ditto. * linux-ppc-low.cc (the_low_target): Ditto. * linux-s390-low.cc (the_low_target): Ditto. * linux-sh-low.cc (the_low_target): Ditto. * linux-sparc-low.cc (the_low_target): Ditto. * linux-tic6x-low.cc (the_low_target): Ditto. * linux-tile-low.cc (the_low_target): Ditto. * linux-xtensa-low.cc (the_low_target): Ditto. * linux-aarch64-low.cc (class aarch64_target) <breakpoint_kind_from_pc> <breakpoint_kind_from_current_state>: Declare. (aarch64_breakpoint_kind_from_pc): Turn into... (aarch64_target::breakpoint_kind_from_pc): ...this. (aarch64_breakpoint_kind_from_current_state): Turn into... (aarch64_target::breakpoint_kind_from_current_state): ...this. (the_low_target): Remove the op fields. * linux-arm-low.cc (class arm_target): <breakpoint_kind_from_pc> <breakpoint_kind_from_current_state>: Declare. (arm_target::breakpoint_kind_from_pc): Define. (arm_target::breakpoint_kind_from_current_state): Define. (the_low_target): Remove the op fields. * linux-riscv-low.cc (class riscv_target): <breakpoint_kind_from_pc>: Declare. (riscv_breakpoint_kind_from_pc): Turn into... (riscv_target::breakpoint_kind_from_pc): ...this. (the_low_target): Remove the op fields.
2020-04-02 15:11:25 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Remove the 'breakpoint_kind_from_pc' and
'breakpoint_kind_from_current_state' linux target ops, and let the
concrete linux target define them by overriding the ops of
process_stratum_target.
* linux-low.cc (linux_process_target::breakpoint_kind_from_pc):
Remove.
(linux_process_target::breakpoint_kind_from_current_state): Remove.
* linux-low.h (struct linux_target_ops): Remove ops.
(class linux_process_target) <breakpoint_kind_from_pc>: Remove.
<breakpoint_kind_from_current_state>: Remove.
* linux-x86-low.cc (the_low_target): Remove the op fields.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-cris-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-mips-low.cc (the_low_target): Ditto.
* linux-nios2-low.cc (the_low_target): Ditto.
* linux-ppc-low.cc (the_low_target): Ditto.
* linux-s390-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-sparc-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.
* linux-aarch64-low.cc (class aarch64_target)
<breakpoint_kind_from_pc>
<breakpoint_kind_from_current_state>: Declare.
(aarch64_breakpoint_kind_from_pc): Turn into...
(aarch64_target::breakpoint_kind_from_pc): ...this.
(aarch64_breakpoint_kind_from_current_state): Turn into...
(aarch64_target::breakpoint_kind_from_current_state): ...this.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (class arm_target):
<breakpoint_kind_from_pc>
<breakpoint_kind_from_current_state>: Declare.
(arm_target::breakpoint_kind_from_pc): Define.
(arm_target::breakpoint_kind_from_current_state): Define.
(the_low_target): Remove the op fields.
* linux-riscv-low.cc (class riscv_target):
<breakpoint_kind_from_pc>: Declare.
(riscv_breakpoint_kind_from_pc): Turn into...
(riscv_target::breakpoint_kind_from_pc): ...this.
(the_low_target): Remove the op fields.
gdbserver/linux-low: turn 'get_pc' and 'set_pc' into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'get_pc' and 'set_pc' linux target ops into methods of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the ops. (class linux_process_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. * linux-low.cc (supports_breakpoints): Turn into... (linux_process_target::low_supports_breakpoints): ...this. (linux_process_target::low_get_pc): Define. (linux_process_target::low_set_pc): Define. Update the callers below. (linux_process_target::get_pc) (linux_process_target::save_stop_reason) (linux_process_target::maybe_move_out_of_jump_pad) (linux_process_target::wait_1) (linux_process_target::resume_one_lwp_throw) (linux_process_target::resume) (linux_process_target::proceed_all_lwps) (linux_process_target::read_pc) (linux_process_target::write_pc) * linux-x86-low.cc (class linux_process_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (x86_target::low_supports_breakpoints): Define. (x86_get_pc): Turn into... (x86_target::low_get_pc): ...this. (x86_set_pc): Turn into... (x86_target::low_set_pc): ...this. (the_low_target): Remove the op fields. * linux-arm-low.cc (class arm_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (arm_target::low_supports_breakpoints) (arm_target::low_get_pc) (arm_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-bfin-low.cc (class bfin_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (bfin_target::low_supports_breakpoints) (bfin_target::low_get_pc) (bfin_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-cris-low.cc (class cris_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (cris_target::low_supports_breakpoints) (cris_target::low_get_pc) (cris_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-crisv32-low.cc (class crisv32_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (crisv32_target::low_supports_breakpoints) (crisv32_target::low_get_pc) (crisv32_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-m32r-low.cc (class m32r_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (m32r_target::low_supports_breakpoints) (m32r_target::low_get_pc) (m32r_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-m68k-low.cc (class m68k_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (m68k_target::low_supports_breakpoints) (m68k_target::low_get_pc) (m68k_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-nios2-low.cc (class nios2_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (nios2_target::low_supports_breakpoints) (nios2_target::low_get_pc) (nios2_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-sh-low.cc (class sh_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (sh_target::low_supports_breakpoints) (sh_target::low_get_pc) (sh_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-xtensa-low.cc (class xtensa_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (xtensa_target::low_supports_breakpoints) (xtensa_target::low_get_pc) (xtensa_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-sparc-low.cc (class sparc_target) <low_supports_breakpoints> <low_get_pc>: Declare. (sparc_target::low_supports_breakpoints) (sparc_target::low_get_pc): Define. (the_low_target): Remove the op fields. * linux-tile-low.cc (class tile_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (tile_target::low_supports_breakpoints) (tile_target::low_get_pc) (tile_target::low_set_pc): Define. (the_low_target): Remove the op fields. * linux-aarch64-low.cc (class aarch64_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (aarch64_target::low_supports_breakpoints): Define. (aarch64_get_pc): Turn into... (aarch64_target::low_get_pc): ...this. (aarch64_set_pc): Turn into... (aarch64_target::low_set_pc): ...this. (the_low_target): Remove the op fields. * linux-mips-low.cc (class mips_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (mips_target::low_supports_breakpoints): Define. (mips_get_pc): Turn into... (mips_target::low_get_pc): ...this. (mips_set_pc): Turn into... (mips_target::low_set_pc): ...this. (the_low_target): Remove the op fields. * linux-ppc-low.cc (class ppc_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (ppc_target::low_supports_breakpoints): Define. (ppc_get_pc): Turn into... (ppc_target::low_get_pc): ...this. (ppc_set_pc): Turn into... (ppc_target::low_set_pc): ...this. (the_low_target): Remove the op fields. * linux-riscv-low.cc (class riscv_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (riscv_target::low_supports_breakpoints): Define. (riscv_get_pc): Turn into... (riscv_target::low_get_pc): ...this. (riscv_set_pc): Turn into... (riscv_target::low_set_pc): ...this. (the_low_target): Remove the op fields. * linux-s390-low.cc (class s390_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (s390_target::low_supports_breakpoints): Define. (s390_get_pc): Turn into... (s390_target::low_get_pc): ...this. (s390_set_pc): Turn into... (s390_target::low_set_pc): ...this. (the_low_target): Remove the op fields. * linux-tic6x-low.cc (class tic6x_target) <low_supports_breakpoints> <low_get_pc> <low_set_pc>: Declare. (tic6x_target::low_supports_breakpoints): Define. (tic6x_get_pc): Turn into... (tic6x_target::low_get_pc): ...this. (tic6x_set_pc): Turn into... (tic6x_target::low_set_pc): ...this. (the_low_target): Remove the op fields.
2020-04-02 15:11:24 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'get_pc' and 'set_pc' linux target ops into methods
of linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
* linux-low.cc (supports_breakpoints): Turn into...
(linux_process_target::low_supports_breakpoints): ...this.
(linux_process_target::low_get_pc): Define.
(linux_process_target::low_set_pc): Define.
Update the callers below.
(linux_process_target::get_pc)
(linux_process_target::save_stop_reason)
(linux_process_target::maybe_move_out_of_jump_pad)
(linux_process_target::wait_1)
(linux_process_target::resume_one_lwp_throw)
(linux_process_target::resume)
(linux_process_target::proceed_all_lwps)
(linux_process_target::read_pc)
(linux_process_target::write_pc)
* linux-x86-low.cc (class linux_process_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(x86_target::low_supports_breakpoints): Define.
(x86_get_pc): Turn into...
(x86_target::low_get_pc): ...this.
(x86_set_pc): Turn into...
(x86_target::low_set_pc): ...this.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (class arm_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(arm_target::low_supports_breakpoints)
(arm_target::low_get_pc)
(arm_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-bfin-low.cc (class bfin_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(bfin_target::low_supports_breakpoints)
(bfin_target::low_get_pc)
(bfin_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-cris-low.cc (class cris_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(cris_target::low_supports_breakpoints)
(cris_target::low_get_pc)
(cris_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-crisv32-low.cc (class crisv32_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(crisv32_target::low_supports_breakpoints)
(crisv32_target::low_get_pc)
(crisv32_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-m32r-low.cc (class m32r_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(m32r_target::low_supports_breakpoints)
(m32r_target::low_get_pc)
(m32r_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-m68k-low.cc (class m68k_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(m68k_target::low_supports_breakpoints)
(m68k_target::low_get_pc)
(m68k_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-nios2-low.cc (class nios2_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(nios2_target::low_supports_breakpoints)
(nios2_target::low_get_pc)
(nios2_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-sh-low.cc (class sh_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(sh_target::low_supports_breakpoints)
(sh_target::low_get_pc)
(sh_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-xtensa-low.cc (class xtensa_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(xtensa_target::low_supports_breakpoints)
(xtensa_target::low_get_pc)
(xtensa_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-sparc-low.cc (class sparc_target)
<low_supports_breakpoints>
<low_get_pc>: Declare.
(sparc_target::low_supports_breakpoints)
(sparc_target::low_get_pc): Define.
(the_low_target): Remove the op fields.
* linux-tile-low.cc (class tile_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(tile_target::low_supports_breakpoints)
(tile_target::low_get_pc)
(tile_target::low_set_pc): Define.
(the_low_target): Remove the op fields.
* linux-aarch64-low.cc (class aarch64_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(aarch64_target::low_supports_breakpoints): Define.
(aarch64_get_pc): Turn into...
(aarch64_target::low_get_pc): ...this.
(aarch64_set_pc): Turn into...
(aarch64_target::low_set_pc): ...this.
(the_low_target): Remove the op fields.
* linux-mips-low.cc (class mips_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(mips_target::low_supports_breakpoints): Define.
(mips_get_pc): Turn into...
(mips_target::low_get_pc): ...this.
(mips_set_pc): Turn into...
(mips_target::low_set_pc): ...this.
(the_low_target): Remove the op fields.
* linux-ppc-low.cc (class ppc_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(ppc_target::low_supports_breakpoints): Define.
(ppc_get_pc): Turn into...
(ppc_target::low_get_pc): ...this.
(ppc_set_pc): Turn into...
(ppc_target::low_set_pc): ...this.
(the_low_target): Remove the op fields.
* linux-riscv-low.cc (class riscv_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(riscv_target::low_supports_breakpoints): Define.
(riscv_get_pc): Turn into...
(riscv_target::low_get_pc): ...this.
(riscv_set_pc): Turn into...
(riscv_target::low_set_pc): ...this.
(the_low_target): Remove the op fields.
* linux-s390-low.cc (class s390_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(s390_target::low_supports_breakpoints): Define.
(s390_get_pc): Turn into...
(s390_target::low_get_pc): ...this.
(s390_set_pc): Turn into...
(s390_target::low_set_pc): ...this.
(the_low_target): Remove the op fields.
* linux-tic6x-low.cc (class tic6x_target)
<low_supports_breakpoints>
<low_get_pc>
<low_set_pc>: Declare.
(tic6x_target::low_supports_breakpoints): Define.
(tic6x_get_pc): Turn into...
(tic6x_target::low_get_pc): ...this.
(tic6x_set_pc): Turn into...
(tic6x_target::low_set_pc): ...this.
(the_low_target): Remove the op fields.
gdbserver/linux-low: turn some more static functions into private methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn some more static methods in linux-low into private methods of linux_process_target. * linux-low.cc (get_pc): Turn into... (linux_process_target::get_pc): ...this. (save_stop_reason): Turn into... (linux_process_target::save_stop_reason): ...this. (thread_still_has_status_pending_p): Turn into... (linux_process_target::thread_still_has_status_pending): ...this. (status_pending_p_callback): Turn into... (linux_process_target::status_pending_p_callback): ...this. (resume_stopped_resumed_lwps): Turn into... (linux_process_target::resume_stopped_resumed_lwps): ...this. (install_software_single_step_breakpoints): Turn into... (linux_process_target::install_software_single_step_breakpoints): ...this. (single_step): Turn into... (linux_process_target::single_step): ...this. (linux_resume_one_lwp_throw): Turn into... (linux_process_target::resume_one_lwp_throw): ...this. (linux_resume_one_lwp): Turn into... (linux_process_target::resume_one_lwp): ...this. (resume_status_pending_p): Turn into... (linux_process_target::resume_status_pending): ...this. (need_step_over_p): Turn into... (linux_process_target::thread_needs_step_over): ...this. (linux_resume_one_thread): Turn into... (linux_process_target::resume_one_thread): ...this. (proceed_one_lwp): Turn into... (linux_process_target::proceed_one_lwp): ...this. (unsuspend_and_proceed_one_lwp): Turn into... (linux_process_target::unsuspend_and_proceed_one_lwp): ...this. Update the calls/references to the above functions below. (linux_process_target::handle_extended_wait) (linux_process_target::filter_event) (linux_process_target::wait_for_event_filtered) (linux_process_target::wait_1) (linux_process_target::move_out_of_jump_pad) (linux_process_target::start_step_over) (linux_process_target::resume) (linux_process_target::proceed_all_lwps) (regsets_store_inferior_registers) (linux_process_target::store_register) * linux-low.h (class linux_process_target) <get_pc> <save_stop_reason> <thread_still_has_status_pending> <status_pending_p_callback> <resume_stopped_resumed_lwps> <install_software_single_step_breakpoints> <single_step> <resume_one_lwp_throw> <resume_one_lwp> <resume_status_pending> <thread_needs_step_over> <resume_one_thread> <proceed_one_lwp> <unsuspend_and_proceed_one_lwp>: Declare.
2020-04-02 15:11:24 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn some more static methods in linux-low into private methods
of linux_process_target.
* linux-low.cc (get_pc): Turn into...
(linux_process_target::get_pc): ...this.
(save_stop_reason): Turn into...
(linux_process_target::save_stop_reason): ...this.
(thread_still_has_status_pending_p): Turn into...
(linux_process_target::thread_still_has_status_pending): ...this.
(status_pending_p_callback): Turn into...
(linux_process_target::status_pending_p_callback): ...this.
(resume_stopped_resumed_lwps): Turn into...
(linux_process_target::resume_stopped_resumed_lwps): ...this.
(install_software_single_step_breakpoints): Turn into...
(linux_process_target::install_software_single_step_breakpoints):
...this.
(single_step): Turn into...
(linux_process_target::single_step): ...this.
(linux_resume_one_lwp_throw): Turn into...
(linux_process_target::resume_one_lwp_throw): ...this.
(linux_resume_one_lwp): Turn into...
(linux_process_target::resume_one_lwp): ...this.
(resume_status_pending_p): Turn into...
(linux_process_target::resume_status_pending): ...this.
(need_step_over_p): Turn into...
(linux_process_target::thread_needs_step_over): ...this.
(linux_resume_one_thread): Turn into...
(linux_process_target::resume_one_thread): ...this.
(proceed_one_lwp): Turn into...
(linux_process_target::proceed_one_lwp): ...this.
(unsuspend_and_proceed_one_lwp): Turn into...
(linux_process_target::unsuspend_and_proceed_one_lwp): ...this.
Update the calls/references to the above functions below.
(linux_process_target::handle_extended_wait)
(linux_process_target::filter_event)
(linux_process_target::wait_for_event_filtered)
(linux_process_target::wait_1)
(linux_process_target::move_out_of_jump_pad)
(linux_process_target::start_step_over)
(linux_process_target::resume)
(linux_process_target::proceed_all_lwps)
(regsets_store_inferior_registers)
(linux_process_target::store_register)
* linux-low.h (class linux_process_target)
<get_pc>
<save_stop_reason>
<thread_still_has_status_pending>
<status_pending_p_callback>
<resume_stopped_resumed_lwps>
<install_software_single_step_breakpoints>
<single_step>
<resume_one_lwp_throw>
<resume_one_lwp>
<resume_status_pending>
<thread_needs_step_over>
<resume_one_thread>
<proceed_one_lwp>
<unsuspend_and_proceed_one_lwp>: Declare.
gdbserver/linux-low: turn 'fetch_register' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'fetch_register' linux target op into a method of linux_process_target. * linux-low.h (struct linux_target_ops) <fetch_register>: Remove. (class linux_process_target) <low_fetch_register>: Declare. * linux-x86-low.cc (the_low_target) * linux-aarch64-low.cc (the_low_target) * linux-arm-low.cc (the_low_target) * linux-bfin-low.cc (the_low_target) * linux-cris-low.cc (the_low_target) * linux-crisv32-low.cc (the_low_target) * linux-m32r-low.cc (the_low_target) * linux-m68k-low.cc (the_low_target) * linux-nios2-low.cc (the_low_target) * linux-ppc-low.cc (the_low_target) * linux-s390-low.cc (the_low_target) * linux-sh-low.cc (the_low_target) * linux-sparc-low.cc (the_low_target) * linux-tic6x-low.cc (the_low_target) * linux-tile-low.cc (the_low_target) * linux-xtensa-low.cc (the_low_target): Remove the op field. * linux-ia64-low.cc (class ia64_target) <low_fetch_register>: Declare. (ia64_fetch_register): Turn into... (ia64_target::low_fetch_register): ...this. (the_low_target): Remove the op field. * linux-mips-low.cc (class mips_target) <low_fetch_register>: Declare. (mips_fetch_register): Turn into... (mips_target::low_fetch_register): ...this. (the_low_target): Remove the op field. * linux-riscv-low.cc (class riscv_target) <low_fetch_register>: Declare. (riscv_fetch_register): Turn into... (riscv_target::low_fetch_register): ...this. (the_low_target): Remove the op field. Update the callers below. * linux-low.cc (linux_process_target::fetch_registers) (linux_process_target::low_fetch_register)
2020-04-02 15:11:24 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'fetch_register' linux target op into a method of
linux_process_target.
* linux-low.h (struct linux_target_ops) <fetch_register>: Remove.
(class linux_process_target) <low_fetch_register>: Declare.
* linux-x86-low.cc (the_low_target)
* linux-aarch64-low.cc (the_low_target)
* linux-arm-low.cc (the_low_target)
* linux-bfin-low.cc (the_low_target)
* linux-cris-low.cc (the_low_target)
* linux-crisv32-low.cc (the_low_target)
* linux-m32r-low.cc (the_low_target)
* linux-m68k-low.cc (the_low_target)
* linux-nios2-low.cc (the_low_target)
* linux-ppc-low.cc (the_low_target)
* linux-s390-low.cc (the_low_target)
* linux-sh-low.cc (the_low_target)
* linux-sparc-low.cc (the_low_target)
* linux-tic6x-low.cc (the_low_target)
* linux-tile-low.cc (the_low_target)
* linux-xtensa-low.cc (the_low_target): Remove the op field.
* linux-ia64-low.cc (class ia64_target) <low_fetch_register>:
Declare.
(ia64_fetch_register): Turn into...
(ia64_target::low_fetch_register): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target) <low_fetch_register>:
Declare.
(mips_fetch_register): Turn into...
(mips_target::low_fetch_register): ...this.
(the_low_target): Remove the op field.
* linux-riscv-low.cc (class riscv_target) <low_fetch_register>:
Declare.
(riscv_fetch_register): Turn into...
(riscv_target::low_fetch_register): ...this.
(the_low_target): Remove the op field.
Update the callers below.
* linux-low.cc (linux_process_target::fetch_registers)
(linux_process_target::low_fetch_register)
gdbserver/linux-low: turn 'cannot_{fetch/store}_register' into methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'cannot_fetch_register' and 'cannot_store_register' linux target ops into methods of linux_process_target. * linux-low.h (struct linux_target_ops): Remove the low target ops. (class linux_process_target) <fetch_register> <store_register> <usr_fetch_inferior_registers> <usr_store_inferior_registers> <low_cannot_fetch_register> <low_cannot_fetch_register> Declare. * linux-low.cc (fetch_register): Turn into... (linux_process_target::fetch_register): ...this. (store_register): Turn into ... (linux_process_target::store_register): ...this. (usr_fetch_inferior_registers): Turn into... (linux_process_target::usr_fetch_inferior_registers): ...this. (usr_store_inferior_registers): Turn into... (linux_process_target::usr_store_inferior_registers): ...this. * linux-x86-low.cc (class x86_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (x86_cannot_store_register): Turn into... (x86_target::low_cannot_store_register): ...this. (x86_cannot_fetch_register): Turn into... (x86_target::low_cannot_fetch_register): ...this. (the_low_target): Remove the target op fields. * linux-aarch64-low.cc (class aarch64_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (aarch64_target::low_cannot_fetch_register) (aarch64_target::low_cannot_store_register): Define. (the_low_target): Remove the op fields. * linux-arm-low.cc (class arm_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (arm_cannot_fetch_register): Turn into... (arm_target::low_cannot_fetch_register): ...this. (arm_cannot_store_register): Turn into... (arm_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-bfin-low.cc (class bfin_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (bfin_cannot_fetch_register): Turn into... (bfin_target::low_cannot_fetch_register): ...this. (bfin_cannot_store_register): Turn into... (bfin_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-cris-low.cc (class cris_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (cris_cannot_fetch_register): Turn into... (cris_target::low_cannot_fetch_register): ...this. (cris_cannot_store_register): Turn into... (cris_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-crisv32-low.cc (class crisv32_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (crisv32_target::low_cannot_fetch_register) (crisv32_target::low_cannot_store_register): Define. (the_low_target): Remove the op fields. * linux-ia64-low.cc (class ia64_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (ia64_cannot_fetch_register): Turn into... (ia64_target::low_cannot_fetch_register): ...this. (ia64_cannot_store_register): Turn into... (ia64_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-m32r-low.cc (class m32r_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (m32r_cannot_fetch_register): Turn into... (m32r_target::low_cannot_fetch_register): ...this. (m32r_cannot_store_register): Turn into... (m32r_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-m68k-low.cc (class m68k_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (m68k_cannot_fetch_register): Turn into... (m68k_target::low_cannot_fetch_register): ...this. (m68k_cannot_store_register): Turn into... (m68k_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-mips-low.cc (class mips_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (mips_cannot_fetch_register): Turn into... (mips_target::low_cannot_fetch_register): ...this. (mips_cannot_store_register): Turn into... (mips_target::low_cannot_store_register): ...this. (get_usrregs_info): Inline at the call sites in low_cannot_fetch_register and low_cannot_store_register, and remove. (the_low_target): Remove the op fields. * linux-nios2-low.cc (class nios2_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (nios2_cannot_fetch_register): Turn into... (nios2_target::low_cannot_fetch_register): ...this. (nios2_cannot_store_register): Turn into... (nios2_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-ppc-low.cc (class ppc_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (ppc_cannot_fetch_register): Turn into... (ppc_target::low_cannot_fetch_register): ...this. (ppc_cannot_store_register): Turn into... (ppc_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-riscv-low.cc (class riscv_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (riscv_target::low_cannot_fetch_register) (riscv_target::low_cannot_store_register): Define. (the_low_target): Remove the op fields. * linux-s390-low.cc (class s390_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (s390_cannot_fetch_register): Turn into... (s390_target::low_cannot_fetch_register): ...this. (s390_cannot_store_register): Turn into... (s390_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-sh-low.cc (class sh_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (sh_cannot_fetch_register): Turn into... (sh_target::low_cannot_fetch_register): ...this. (sh_cannot_store_register): Turn into... (sh_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-sparc-low.cc (class sparc_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (sparc_cannot_fetch_register): Turn into... (sparc_target::low_cannot_fetch_register): ...this. (sparc_cannot_store_register): Turn into... (sparc_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-tic6x-low.cc (class tic6x_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (tic6x_cannot_fetch_register): Turn into... (tic6x_target::low_cannot_fetch_register): ...this. (tic6x_cannot_store_register): Turn into... (tic6x_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-tile-low.cc (class tile_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (tile_cannot_fetch_register): Turn into... (tile_target::low_cannot_fetch_register): ...this. (tile_cannot_store_register): Turn into... (tile_target::low_cannot_store_register): ...this. (the_low_target): Remove the op fields. * linux-xtensa-low.cc (class xtensa_target) <low_cannot_fetch_register> <low_cannot_store_register>: Declare. (xtensa_target::low_cannot_fetch_register) (xtensa_target::low_cannot_store_register): Define. (the_low_target): Remove the op fields.
2020-04-02 15:11:24 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'cannot_fetch_register' and 'cannot_store_register'
linux target ops into methods of linux_process_target.
* linux-low.h (struct linux_target_ops): Remove the low target ops.
(class linux_process_target) <fetch_register>
<store_register>
<usr_fetch_inferior_registers>
<usr_store_inferior_registers>
<low_cannot_fetch_register>
<low_cannot_fetch_register> Declare.
* linux-low.cc (fetch_register): Turn into...
(linux_process_target::fetch_register): ...this.
(store_register): Turn into ...
(linux_process_target::store_register): ...this.
(usr_fetch_inferior_registers): Turn into...
(linux_process_target::usr_fetch_inferior_registers): ...this.
(usr_store_inferior_registers): Turn into...
(linux_process_target::usr_store_inferior_registers): ...this.
* linux-x86-low.cc (class x86_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(x86_cannot_store_register): Turn into...
(x86_target::low_cannot_store_register): ...this.
(x86_cannot_fetch_register): Turn into...
(x86_target::low_cannot_fetch_register): ...this.
(the_low_target): Remove the target op fields.
* linux-aarch64-low.cc (class aarch64_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(aarch64_target::low_cannot_fetch_register)
(aarch64_target::low_cannot_store_register): Define.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (class arm_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(arm_cannot_fetch_register): Turn into...
(arm_target::low_cannot_fetch_register): ...this.
(arm_cannot_store_register): Turn into...
(arm_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-bfin-low.cc (class bfin_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(bfin_cannot_fetch_register): Turn into...
(bfin_target::low_cannot_fetch_register): ...this.
(bfin_cannot_store_register): Turn into...
(bfin_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-cris-low.cc (class cris_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(cris_cannot_fetch_register): Turn into...
(cris_target::low_cannot_fetch_register): ...this.
(cris_cannot_store_register): Turn into...
(cris_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-crisv32-low.cc (class crisv32_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(crisv32_target::low_cannot_fetch_register)
(crisv32_target::low_cannot_store_register): Define.
(the_low_target): Remove the op fields.
* linux-ia64-low.cc (class ia64_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(ia64_cannot_fetch_register): Turn into...
(ia64_target::low_cannot_fetch_register): ...this.
(ia64_cannot_store_register): Turn into...
(ia64_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-m32r-low.cc (class m32r_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(m32r_cannot_fetch_register): Turn into...
(m32r_target::low_cannot_fetch_register): ...this.
(m32r_cannot_store_register): Turn into...
(m32r_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-m68k-low.cc (class m68k_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(m68k_cannot_fetch_register): Turn into...
(m68k_target::low_cannot_fetch_register): ...this.
(m68k_cannot_store_register): Turn into...
(m68k_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-mips-low.cc (class mips_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(mips_cannot_fetch_register): Turn into...
(mips_target::low_cannot_fetch_register): ...this.
(mips_cannot_store_register): Turn into...
(mips_target::low_cannot_store_register): ...this.
(get_usrregs_info): Inline at the call sites in
low_cannot_fetch_register and low_cannot_store_register,
and remove.
(the_low_target): Remove the op fields.
* linux-nios2-low.cc (class nios2_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(nios2_cannot_fetch_register): Turn into...
(nios2_target::low_cannot_fetch_register): ...this.
(nios2_cannot_store_register): Turn into...
(nios2_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-ppc-low.cc (class ppc_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(ppc_cannot_fetch_register): Turn into...
(ppc_target::low_cannot_fetch_register): ...this.
(ppc_cannot_store_register): Turn into...
(ppc_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-riscv-low.cc (class riscv_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(riscv_target::low_cannot_fetch_register)
(riscv_target::low_cannot_store_register): Define.
(the_low_target): Remove the op fields.
* linux-s390-low.cc (class s390_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(s390_cannot_fetch_register): Turn into...
(s390_target::low_cannot_fetch_register): ...this.
(s390_cannot_store_register): Turn into...
(s390_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-sh-low.cc (class sh_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(sh_cannot_fetch_register): Turn into...
(sh_target::low_cannot_fetch_register): ...this.
(sh_cannot_store_register): Turn into...
(sh_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-sparc-low.cc (class sparc_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(sparc_cannot_fetch_register): Turn into...
(sparc_target::low_cannot_fetch_register): ...this.
(sparc_cannot_store_register): Turn into...
(sparc_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-tic6x-low.cc (class tic6x_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(tic6x_cannot_fetch_register): Turn into...
(tic6x_target::low_cannot_fetch_register): ...this.
(tic6x_cannot_store_register): Turn into...
(tic6x_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-tile-low.cc (class tile_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(tile_cannot_fetch_register): Turn into...
(tile_target::low_cannot_fetch_register): ...this.
(tile_cannot_store_register): Turn into...
(tile_target::low_cannot_store_register): ...this.
(the_low_target): Remove the op fields.
* linux-xtensa-low.cc (class xtensa_target)
<low_cannot_fetch_register>
<low_cannot_store_register>: Declare.
(xtensa_target::low_cannot_fetch_register)
(xtensa_target::low_cannot_store_register): Define.
(the_low_target): Remove the op fields.
gdbserver/linux-low: turn 'regs_info' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'regs_info' linux target op into a method of linux_process_target. * linux-low.h (struct linux_target_ops) <regs_info>: Remove. (class linux_process_target) <get_regs_info>: Define. Update the callers below. * linux-low.cc (linux_process_target::fetch_registers) (linux_process_target::store_registers) * proc-service.cc (gregset_info) * linux-x86-low.cc (class x86_target) <get_regs_info>: Declare. (x86_linux_regs_info): Turn into ... (x86_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <get_regs_info>: Declare. (aarch64_regs_info): Turn into ... (aarch64_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) <get_regs_info>: Declare. (arm_regs_info): Turn into ... (arm_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-bfin-low.cc (class bfin_target) <get_regs_info>: Declare. (bfin_regs_info): Turn into ... (bfin_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-cris-low.cc (class cris_target) <get_regs_info>: Declare. (cris_regs_info): Turn into ... (cris_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-crisv32-low.cc (class crisv32_target) <get_regs_info>: Declare. (crisv32_regs_info): Turn into ... (crisv32_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-ia64-low.cc (class ia64_target) <get_regs_info>: Declare. (ia64_regs_info): Turn into ... (ia64_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-m32r-low.cc (class m32r_target) <get_regs_info>: Declare. (m32r_regs_info): Turn into ... (m32r_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-m68k-low.cc (class m68k_target) <get_regs_info>: Declare. (m68k_regs_info): Turn into ... (m68k_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-mips-low.cc (class mips_target) <get_regs_info>: Declare. (mips_regs_info): Turn into ... (mips_target::get_regs_info): ...this. (the_low_target): Remove the op field. (get_usrregs_info): Update the call to the op. * linux-nios2-low.cc (class nios2_target) <get_regs_info>: Declare. (nios2_regs_info): Turn into ... (nios2_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) <get_regs_info>: Declare. (ppc_regs_info): Turn into ... (ppc_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-riscv-low.cc (class riscv_target) <get_regs_info>: Declare. (riscv_regs_info): Turn into ... (riscv_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) <get_regs_info>: Declare. (s390_regs_info): Turn into ... (s390_target::get_regs_info): ...this. (the_low_target): Remove the op field. (s390_collect_ptrace_register) (s390_supply_ptrace_register) (s390_fill_gregset): Update the call to the op. * linux-sh-low.cc (class sh_target) <get_regs_info>: Declare. (sh_regs_info): Turn into ... (sh_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-sparc-low.cc (class sparc_target) <get_regs_info>: Declare. (sparc_regs_info): Turn into ... (sparc_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-tic6x-low.cc (class tic6x_target) <get_regs_info>: Declare. (tic6x_regs_info): Turn into ... (tic6x_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-tile-low.cc (class tile_target) <get_regs_info>: Declare. (tile_regs_info): Turn into ... (tile_target::get_regs_info): ...this. (the_low_target): Remove the op field. * linux-xtensa-low.cc (class xtensa_target) <get_regs_info>: Declare. (xtensa_regs_info): Turn into ... (xtensa_target::get_regs_info): ...this. (the_low_target): Remove the op field.
2020-04-02 15:11:23 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'regs_info' linux target op into a method of
linux_process_target.
* linux-low.h (struct linux_target_ops) <regs_info>: Remove.
(class linux_process_target) <get_regs_info>: Define.
Update the callers below.
* linux-low.cc (linux_process_target::fetch_registers)
(linux_process_target::store_registers)
* proc-service.cc (gregset_info)
* linux-x86-low.cc (class x86_target) <get_regs_info>: Declare.
(x86_linux_regs_info): Turn into ...
(x86_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target) <get_regs_info>:
Declare.
(aarch64_regs_info): Turn into ...
(aarch64_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target) <get_regs_info>: Declare.
(arm_regs_info): Turn into ...
(arm_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (class bfin_target) <get_regs_info>: Declare.
(bfin_regs_info): Turn into ...
(bfin_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-cris-low.cc (class cris_target) <get_regs_info>: Declare.
(cris_regs_info): Turn into ...
(cris_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (class crisv32_target) <get_regs_info>:
Declare.
(crisv32_regs_info): Turn into ...
(crisv32_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-ia64-low.cc (class ia64_target) <get_regs_info>: Declare.
(ia64_regs_info): Turn into ...
(ia64_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-m32r-low.cc (class m32r_target) <get_regs_info>: Declare.
(m32r_regs_info): Turn into ...
(m32r_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-m68k-low.cc (class m68k_target) <get_regs_info>: Declare.
(m68k_regs_info): Turn into ...
(m68k_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target) <get_regs_info>: Declare.
(mips_regs_info): Turn into ...
(mips_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
(get_usrregs_info): Update the call to the op.
* linux-nios2-low.cc (class nios2_target) <get_regs_info>: Declare.
(nios2_regs_info): Turn into ...
(nios2_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <get_regs_info>: Declare.
(ppc_regs_info): Turn into ...
(ppc_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-riscv-low.cc (class riscv_target) <get_regs_info>: Declare.
(riscv_regs_info): Turn into ...
(riscv_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <get_regs_info>: Declare.
(s390_regs_info): Turn into ...
(s390_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
(s390_collect_ptrace_register)
(s390_supply_ptrace_register)
(s390_fill_gregset): Update the call to the op.
* linux-sh-low.cc (class sh_target) <get_regs_info>: Declare.
(sh_regs_info): Turn into ...
(sh_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-sparc-low.cc (class sparc_target) <get_regs_info>: Declare.
(sparc_regs_info): Turn into ...
(sparc_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-tic6x-low.cc (class tic6x_target) <get_regs_info>: Declare.
(tic6x_regs_info): Turn into ...
(tic6x_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-tile-low.cc (class tile_target) <get_regs_info>: Declare.
(tile_regs_info): Turn into ...
(tile_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-xtensa-low.cc (class xtensa_target) <get_regs_info>:
Declare.
(xtensa_regs_info): Turn into ...
(xtensa_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
gdbserver/linux-low: turn 'arch_setup' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'arch_setup' linux target op into a method of linux_process_target. * linux-low.h (struct linux_target_ops) <arch_setup>: Delete. (class linux_process_target) <arch_setup_thread> <low_arch_setup>: New declarations. * linux-low.cc (linux_arch_setup): Delete. (linux_arch_setup_thread): Turn into... (linux_process_target::arch_setup_thread): ... this. Update the callers below. (linux_process_target::handle_extended_wait) (linux_process_target::post_create_inferior) (linux_process_target::filter_event) * linux-x86-low.cc (class x86_target) <low_arch_setup>: New declaration. (x86_linux_update_xmltarget): Turn into... (x86_target::update_xmltarget): ...this. (x86_linux_process_qsupported): Update the call to x86_linux_update_xmltarget. (x86_arch_setup): Turn into ... (x86_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <low_arch_setup>: New declaration. (aarch64_arch_setup): Turn into ... (aarch64_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) <low_arch_setup>: New declaration. (arm_arch_setup): Turn into ... (arm_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-bfin-low.cc (class bfin_target) <low_arch_setup>: New declaration. (bfin_arch_setup): Turn into ... (bfin_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-cris-low.cc (class cris_target) <low_arch_setup>: New declaration. (cris_arch_setup): Turn into ... (cris_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-crisv32-low.cc (class crisv32_target) <low_arch_setup>: New declaration. (crisv32_arch_setup): Turn into ... (crisv32_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-ia64-low.cc (class ia64_target) <low_arch_setup>: New declaration. (ia64_arch_setup): Turn into ... (ia64_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-m32r-low.cc (class m32r_target) <low_arch_setup>: New declaration. (m32r_arch_setup): Turn into ... (m32r_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-m68k-low.cc (class m68k_target) <low_arch_setup>: New declaration. (m68k_arch_setup): Turn into ... (m68k_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-mips-low.cc (class mips_target) <low_arch_setup>: New declaration. (mips_arch_setup): Turn into ... (mips_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-nios2-low.cc (class nios2_target) <low_arch_setup>: New declaration. (nios2_arch_setup): Turn into ... (nios2_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) <low_arch_setup>: New declaration. (ppc_arch_setup): Turn into ... (ppc_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-riscv-low.cc (class riscv_target) <low_arch_setup>: New declaration. (riscv_arch_setup): Turn into ... (riscv_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) <low_arch_setup>: New declaration. (s390_arch_setup): Turn into ... (s390_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-sh-low.cc (class sh_target) <low_arch_setup>: New declaration. (sh_arch_setup): Turn into ... (sh_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-sparc-low.cc (class sparc_target) <low_arch_setup>: New declaration. (sparc_arch_setup): Turn into ... (sparc_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-tic6x-low.cc (class tic6x_target) <low_arch_setup>: New declaration. (tic6x_arch_setup): Turn into ... (tic6x_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-tile-low.cc (class tile_target) <low_arch_setup>: New declaration. (tile_arch_setup): Turn into ... (tile_target::low_arch_setup): ...this. (the_low_target): Remove the op field. * linux-xtensa-low.cc (class xtensa_target) <low_arch_setup>: New declaration. (xtensa_arch_setup): Turn into ... (xtensa_target::low_arch_setup): ...this. (the_low_target): Remove the op field.
2020-04-02 15:11:23 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn the 'arch_setup' linux target op into a method of
linux_process_target.
* linux-low.h (struct linux_target_ops) <arch_setup>: Delete.
(class linux_process_target) <arch_setup_thread>
<low_arch_setup>: New declarations.
* linux-low.cc (linux_arch_setup): Delete.
(linux_arch_setup_thread): Turn into...
(linux_process_target::arch_setup_thread): ... this.
Update the callers below.
(linux_process_target::handle_extended_wait)
(linux_process_target::post_create_inferior)
(linux_process_target::filter_event)
* linux-x86-low.cc (class x86_target) <low_arch_setup>: New
declaration.
(x86_linux_update_xmltarget): Turn into...
(x86_target::update_xmltarget): ...this.
(x86_linux_process_qsupported): Update the call to
x86_linux_update_xmltarget.
(x86_arch_setup): Turn into ...
(x86_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target) <low_arch_setup>: New
declaration.
(aarch64_arch_setup): Turn into ...
(aarch64_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target) <low_arch_setup>: New
declaration.
(arm_arch_setup): Turn into ...
(arm_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (class bfin_target) <low_arch_setup>: New
declaration.
(bfin_arch_setup): Turn into ...
(bfin_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-cris-low.cc (class cris_target) <low_arch_setup>: New
declaration.
(cris_arch_setup): Turn into ...
(cris_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (class crisv32_target) <low_arch_setup>: New
declaration.
(crisv32_arch_setup): Turn into ...
(crisv32_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-ia64-low.cc (class ia64_target) <low_arch_setup>: New
declaration.
(ia64_arch_setup): Turn into ...
(ia64_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-m32r-low.cc (class m32r_target) <low_arch_setup>: New
declaration.
(m32r_arch_setup): Turn into ...
(m32r_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-m68k-low.cc (class m68k_target) <low_arch_setup>: New
declaration.
(m68k_arch_setup): Turn into ...
(m68k_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target) <low_arch_setup>: New
declaration.
(mips_arch_setup): Turn into ...
(mips_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-nios2-low.cc (class nios2_target) <low_arch_setup>: New
declaration.
(nios2_arch_setup): Turn into ...
(nios2_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <low_arch_setup>: New
declaration.
(ppc_arch_setup): Turn into ...
(ppc_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-riscv-low.cc (class riscv_target) <low_arch_setup>: New
declaration.
(riscv_arch_setup): Turn into ...
(riscv_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <low_arch_setup>: New
declaration.
(s390_arch_setup): Turn into ...
(s390_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-sh-low.cc (class sh_target) <low_arch_setup>: New
declaration.
(sh_arch_setup): Turn into ...
(sh_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-sparc-low.cc (class sparc_target) <low_arch_setup>: New
declaration.
(sparc_arch_setup): Turn into ...
(sparc_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-tic6x-low.cc (class tic6x_target) <low_arch_setup>: New
declaration.
(tic6x_arch_setup): Turn into ...
(tic6x_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-tile-low.cc (class tile_target) <low_arch_setup>: New
declaration.
(tile_arch_setup): Turn into ...
(tile_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
* linux-xtensa-low.cc (class xtensa_target) <low_arch_setup>: New
declaration.
(xtensa_arch_setup): Turn into ...
(xtensa_target::low_arch_setup): ...this.
(the_low_target): Remove the op field.
gdbserver/linux-low: start turning linux target ops into methods This is the beginning of a series of patches that convert the linux low targets into classes derived from linux_process_target. At the end of the series we obtain a class hierarchy that looks like this: process_stratum_target ^ | |-- linux_process_target ^ | |-- x86_target (defined in linux-x86-low) |-- aarch64_target (defined in linux-aarch64-low) |-- ppc_target (defined in linux-ppc-low) |-- ... In several cases, linux_process_target simply forwards a target op request to a corresponding linux_target_ops function. For these cases, the definition in linux_process_target will be removed and the definition will be left to the deriving linux low target class; using inheritance provides a nice and natural, object-oriented simplification in these cases. The series converts linux_target_ops into protected methods of linux_process_target one by one. Throughout the series, based on the needs, static functions defined in linux-low.cc are converted to private methods of linux_process_target as well. This is done either as separate patches or as integrated into a patch that convert a particular linux_target_op into a method. The series ends with the patch titled "gdbserver/linux-low: delete 'linux_target_ops' and 'the_low_target'". Built and regression-tested on x86_64-linux. The following linux low targets have been built (but not tested) via cross-compilation: aarch64, arm, m68k, mips, ppc, riscv, s390, sh, sparc. The other targets (bfin, cris, crisv32, ia64, m32r, nios2, tic6x, tile, xtensa) were neither built nor tested. gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * linux-low.h (the_linux_target): New extern declaration. * linux-low.cc (initialize_low): Use 'the_linux_target' to set 'the_target'. (the_linux_target): Remove. * linux-x86-low.cc (class x86_target): New class. (the_x86_target): New static object. (the_linux_target): Define as pointer to the_x86_target. * linux-aarch64-low.cc (class aarch64_target): New class. (the_aarch64_target): New static object. (the_linux_target): Define as pointer to the_aarch64_target. * linux-arm-low.cc (class arm_target): New class. (the_arm_target): New static object. (the_linux_target): Define as pointer to the_arm_target. * linux-bfin-low.cc (class bfin_target): New class. (the_bfin_target): New static object. (the_linux_target): Define as pointer to the_bfin_target. * linux-cris-low.cc (class cris_target): New class. (the_cris_target): New static object. (the_linux_target): Define as pointer to the_cris_target. * linux-crisv32-low.cc (class crisv32_target): New class. (the_crisv32_target): New static object. (the_linux_target): Define as pointer to the_crisv32_target. * linux-ia64-low.cc (class ia64_target): New class. (the_ia64_target): New static object. (the_linux_target): Define as pointer to the_ia64_target. * linux-m32r-low.cc (class m32r_target): New class. (the_m32r_target): New static object. (the_linux_target): Define as pointer to the_m32r_target. * linux-m68k-low.cc (class m68k_target): New class. (the_m68k_target): New static object. (the_linux_target): Define as pointer to the_m68k_target. * linux-mips-low.cc (class mips_target): New class. (the_mips_target): New static object. (the_linux_target): Define as pointer to the_mips_target. * linux-nios2-low.cc (class nios2_target): New class. (the_nios2_target): New static object. (the_linux_target): Define as pointer to the_nios2_target. * linux-ppc-low.cc (class ppc_target): New class. (the_ppc_target): New static object. (the_linux_target): Define as pointer to the_ppc_target. * linux-riscv-low.cc (class riscv_target): New class. (the_riscv_target): New static object. (the_linux_target): Define as pointer to the_riscv_target. * linux-s390-low.cc (class s390_target): New class. (the_s390_target): New static object. (the_linux_target): Define as pointer to the_s390_target. * linux-sh-low.cc (class sh_target): New class. (the_sh_target): New static object. (the_linux_target): Define as pointer to the_sh_target. * linux-sparc-low.cc (class sparc_target): New class. (the_sparc_target): New static object. (the_linux_target): Define as pointer to the_sparc_target. * linux-tic6x-low.cc (class tic6x_target): New class. (the_tic6x_target): New static object. (the_linux_target): Define as pointer to the_tic6x_target. * linux-tile-low.cc (class tile_target): New class. (the_tile_target): New static object. (the_linux_target): Define as pointer to the_tile_target. * linux-xtensa-low.cc (class xtensa_target): New class. (the_xtensa_target): New static object. (the_linux_target): Define as pointer to the_xtensa_target.
2020-04-02 15:11:23 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* linux-low.h (the_linux_target): New extern declaration.
* linux-low.cc (initialize_low): Use 'the_linux_target' to set
'the_target'.
(the_linux_target): Remove.
* linux-x86-low.cc (class x86_target): New class.
(the_x86_target): New static object.
(the_linux_target): Define as pointer to the_x86_target.
* linux-aarch64-low.cc (class aarch64_target): New class.
(the_aarch64_target): New static object.
(the_linux_target): Define as pointer to the_aarch64_target.
* linux-arm-low.cc (class arm_target): New class.
(the_arm_target): New static object.
(the_linux_target): Define as pointer to the_arm_target.
* linux-bfin-low.cc (class bfin_target): New class.
(the_bfin_target): New static object.
(the_linux_target): Define as pointer to the_bfin_target.
* linux-cris-low.cc (class cris_target): New class.
(the_cris_target): New static object.
(the_linux_target): Define as pointer to the_cris_target.
* linux-crisv32-low.cc (class crisv32_target): New class.
(the_crisv32_target): New static object.
(the_linux_target): Define as pointer to the_crisv32_target.
* linux-ia64-low.cc (class ia64_target): New class.
(the_ia64_target): New static object.
(the_linux_target): Define as pointer to the_ia64_target.
* linux-m32r-low.cc (class m32r_target): New class.
(the_m32r_target): New static object.
(the_linux_target): Define as pointer to the_m32r_target.
* linux-m68k-low.cc (class m68k_target): New class.
(the_m68k_target): New static object.
(the_linux_target): Define as pointer to the_m68k_target.
* linux-mips-low.cc (class mips_target): New class.
(the_mips_target): New static object.
(the_linux_target): Define as pointer to the_mips_target.
* linux-nios2-low.cc (class nios2_target): New class.
(the_nios2_target): New static object.
(the_linux_target): Define as pointer to the_nios2_target.
* linux-ppc-low.cc (class ppc_target): New class.
(the_ppc_target): New static object.
(the_linux_target): Define as pointer to the_ppc_target.
* linux-riscv-low.cc (class riscv_target): New class.
(the_riscv_target): New static object.
(the_linux_target): Define as pointer to the_riscv_target.
* linux-s390-low.cc (class s390_target): New class.
(the_s390_target): New static object.
(the_linux_target): Define as pointer to the_s390_target.
* linux-sh-low.cc (class sh_target): New class.
(the_sh_target): New static object.
(the_linux_target): Define as pointer to the_sh_target.
* linux-sparc-low.cc (class sparc_target): New class.
(the_sparc_target): New static object.
(the_linux_target): Define as pointer to the_sparc_target.
* linux-tic6x-low.cc (class tic6x_target): New class.
(the_tic6x_target): New static object.
(the_linux_target): Define as pointer to the_tic6x_target.
* linux-tile-low.cc (class tile_target): New class.
(the_tile_target): New static object.
(the_linux_target): Define as pointer to the_tile_target.
* linux-xtensa-low.cc (class xtensa_target): New class.
(the_xtensa_target): New static object.
(the_linux_target): Define as pointer to the_xtensa_target.
gdbserver/linux-low: turn some static functions into private methods gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn some static functions in linux-low.cc into private methods of linux_process_target. * linux-low.cc (handle_extended_wait): Turn into ... (linux_process_target::handle_extended_wait): ...this. Call 'mourn' on 'this' object instead of 'the_target'. (maybe_move_out_of_jump_pad): Turn into... (linux_process_target::maybe_move_out_of_jump_pad): ...this. (linux_low_filter_event): Turn into... (linux_process_target::filter_event): ...this. (linux_wait_for_event_filtered): Turn into... (linux_process_target::wait_for_event_filtered): ...this. (linux_wait_for_event): Turn into... (linux_process_target::wait_for_event): ...this. (linux_wait_1): Turn into... (linux_process_target::wait_1): ...this. (wait_for_sigstop): Turn into... (linux_process_target::wait_for_sigstop): ...this. (move_out_of_jump_pad_callback): Turn into... (linux_process_target::move_out_of_jump_pad): ...this. (stop_all_lwps): Turn into... (linux_process_target::stop_all_lwps): ...this. (start_step_over): Turn into... (linux_process_target::start_step_over): ...this. (complete_ongoing_step_over): Turn into... (linux_process_target::complete_ongoing_step_over): ...this. (proceed_all_lwps): Turn into... (linux_process_target::proceed_all_lwps): ...this. (unstop_all_lwps): Turn into... (linux_process_target::unstop_all_lwps): ...this. * linux-low.h (class linux_process_target) <handle_extended_wait> <maybe_move_out_of_jump_pad> filter_event> <wait_for_event_filtered> <wait_for_event> <wait_1> <wait_for_sigstop> <move_out_of_jump_pad> <stop_all_lwps> <start_step_over> <complete_ongoing_step_over> <proceed_all_lwps> <unstop_all_lwps>: Declare. Update the callers below. * linux-low.cc (linux_process_target::attach): Update. (linux_process_target::stabilize_threads): Ditto. (linux_process_target::wait): Ditto.
2020-04-02 15:11:22 +02:00
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn some static functions in linux-low.cc into private methods of
linux_process_target.
* linux-low.cc (handle_extended_wait): Turn into ...
(linux_process_target::handle_extended_wait): ...this. Call
'mourn' on 'this' object instead of 'the_target'.
(maybe_move_out_of_jump_pad): Turn into...
(linux_process_target::maybe_move_out_of_jump_pad): ...this.
(linux_low_filter_event): Turn into...
(linux_process_target::filter_event): ...this.
(linux_wait_for_event_filtered): Turn into...
(linux_process_target::wait_for_event_filtered): ...this.
(linux_wait_for_event): Turn into...
(linux_process_target::wait_for_event): ...this.
(linux_wait_1): Turn into...
(linux_process_target::wait_1): ...this.
(wait_for_sigstop): Turn into...
(linux_process_target::wait_for_sigstop): ...this.
(move_out_of_jump_pad_callback): Turn into...
(linux_process_target::move_out_of_jump_pad): ...this.
(stop_all_lwps): Turn into...
(linux_process_target::stop_all_lwps): ...this.
(start_step_over): Turn into...
(linux_process_target::start_step_over): ...this.
(complete_ongoing_step_over): Turn into...
(linux_process_target::complete_ongoing_step_over): ...this.
(proceed_all_lwps): Turn into...
(linux_process_target::proceed_all_lwps): ...this.
(unstop_all_lwps): Turn into...
(linux_process_target::unstop_all_lwps): ...this.
* linux-low.h (class linux_process_target)
<handle_extended_wait>
<maybe_move_out_of_jump_pad>
filter_event>
<wait_for_event_filtered>
<wait_for_event>
<wait_1>
<wait_for_sigstop>
<move_out_of_jump_pad>
<stop_all_lwps>
<start_step_over>
<complete_ongoing_step_over>
<proceed_all_lwps>
<unstop_all_lwps>: Declare.
Update the callers below.
* linux-low.cc (linux_process_target::attach): Update.
(linux_process_target::stabilize_threads): Ditto.
(linux_process_target::wait): Ditto.
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* linux-low.h (struct linux_target_ops): Update the comment for
'cannot_store_register' to return 0 or 1.
* linux-ppc-low.cc (ppc_cannot_store_register): Return 1 instead
of 2.
2020-03-20 Simon Marchi <simon.marchi@efficios.com>
* config.in: Re-generate.
* configure: Re-generate.
2020-03-17 Kamil Rytarowski <n54@gmx.com>
* regcache.cc (find_register_by_number): Update.
* tdesc.cc (init_target_desc): Likewise.
* tdesc.h (target_desc::reg_defs): Likewise.
2020-03-12 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac (GDBSERVER_DEPFILES): Remove srv_selftest_objs.
(WIN32APILIBS): New subst.
* Makefile.in (SFILES, OBS, TAGS, GDBREPLAY_OBS): Remove
gdbsupport files.
(gdbsupport/%.o): Remove target.
(GDBSUPPORT_BUILDDIR, GDBSUPPORT): New variables.
(gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Add GDBSUPPORT.
(WIN32APILIBS): New variable.
(gdbserver$(EXEEXT)): Add WIN32APILIBS.
(gdbreplay$(EXEEXT)): Likewise.
2020-03-12 Tom Tromey <tom@tromey.com>
* config.in, configure: Rebuild.
* configure.ac: Call ZW_GNU_GETTEXT_SISTER_DIR.
* acinclude.m4: Include gettext-sister.m4.
* Makefile.in (top_builddir, INTL, INTL_DEPS, INTL_CFLAGS): New
variables.
(INCLUDE_CFLAGS): Add INTL_CFLAGS.
(gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Use INTL_DEPS, INTL.
2020-03-12 Simon Marchi <simon.marchi@efficios.com>
* acinclude.m4: Update path to selftest.m4.
2020-03-12 Simon Marchi <simon.marchi@efficios.com>
* configure.ac: Don't source bfd/development.sh, move
GDB_AC_COMMON higher.
* configure: Re-generate.
2020-03-12 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
2020-03-11 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
gdbserver/gdbsupport: Add .dir-locals.el file Copy the .dir-locls.el file from gdb/ to gdbserver/ and gdbsupport/ so that we get the GNU/GDB style when editing these files in Emacs. I initially wanted to remove the (c-mode . ((mode . c++))) that switches c-mode files into c++-mode as we store C++ code in *.cc files in the gdbserver/ directory, unlike gdb/ where we use *.c, however, I was forgetting about the header files - we still use *.h for our C++ header files, so for now I left the settings in place to open all C files in c++-mode. We now have three copies of this file, which are all identical. It would be nice if we could remove this duplication, however, for now we haven't found a good way to do this. Some options considered were: 1. Use symlinks to only have one copy of the file. This was rejected as not all targets support symlinks in the way. 2. Have two of the .dir-locals.el files contain some mechanism by which the third copy of the file is sourced. Though this would, in theory, be possible, it would involve some advanced Emacs scripting, would be fragile, and a maintenance burdon. 3. Move the .dir-locals up into top level src/ directory, then use Emacs dir-locals directory pattern matching to only apply the rules for the three directories we care about. The problem is that each directory has to be listed separately, so we still end up having to duplicate all the rules. In the end, it was decided that having three copies of the file, though not ideal, is probably easiest for now. This was all discussed in this mailing list thread: https://sourceware.org/ml/gdb-patches/2020-03/msg00024.html The copyright date in the new files is left as for gdb/.dir-locals.el, as the new files are a copy of the old, this is inline with this rule: https://sourceware.org/gdb/wiki/ContributionChecklist#Copyright_Header gdb/ChangeLog: * .dir-locals.el: Add a comment referencing the other copies of this file. gdbserver/ChangeLog: * .dir-locals.el: New file. gdbsupport/ChangeLog: * .dir-locals.el: New file.
2020-02-28 19:08:08 +01:00
2020-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* .dir-locals.el: New file.
gdb, gdbserver, gdbsupport: add .gitattributes files Create .gitattributes files in gdb/, gdbserver/, and gdbsupport/. The files specify cpp-style diffs for .h and .c files. This is particularly helpful if a class in a header file is modified. For instance, if the `stop_requested` field of `thread_info` in gdb/gdbthread.h is modified, we get the following diff with 'git diff' (using git version 2.17.1): @@ -379,7 +379,7 @@ public: struct target_waitstatus pending_follow; /* True if this thread has been explicitly requested to stop. */ - int stop_requested = 0; + bool stop_requested = 0; /* The initiating frame of a nexting operation, used for deciding which exceptions to intercept. If it is null_frame_id no Note that the context of the change shows up as 'public:'; not so useful. With the .gitattributes file, we get: @@ -379,7 +379,7 @@ class thread_info : public refcounted_object struct target_waitstatus pending_follow; /* True if this thread has been explicitly requested to stop. */ - int stop_requested = 0; + bool stop_requested = 0; /* The initiating frame of a nexting operation, used for deciding which exceptions to intercept. If it is null_frame_id no The context is successfully shown as 'class thread_info'. This patch creates a .gitattributes file per each of gdb, gdbserver, and gdbsupport folders. An alternative would be to define the attributes in the root folder -- this would impact all the top-level folders, though. I opted for the more conservative approach. gdb/ChangeLog: 2020-03-05 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * .gitattributes: New file. gdbserver/ChangeLog: 2020-03-05 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * .gitattributes: New file. gdbsupport/ChangeLog: 2020-03-05 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * .gitattributes: New file.
2020-03-05 15:59:22 +01:00
2020-03-05 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* .gitattributes: New file.
2020-03-02 Andrew Burgess <andrew.burgess@embecosm.com>
* remote-utils.cc (prepare_resume_reply): Add ability to convert T
reply into an S reply.
* server.cc (disable_packet_T): New global.
(captured_main): Set new global when appropriate.
* server.h (disable_packet_T): Declare.
2020-02-21 Tom Tromey <tom@tromey.com>
* Makefile.in (mostlyclean): New target.
gdbserver: finish turning the target ops vector into a class Now that 'process_stratum_target' has a single field left, namely 'pt' of type 'process_target', and that all the requests to a 'process_stratum_target' are forwarded to 'pt', meld the 'process_target' class into 'process_stratum_target'. This essentially means 1. All the references of the form 'the_target->pt' become 'the_target'. 2. All the uses of the name 'process_target' become 'process_stratum_target'. 3. The platform-specific target op vectors (e.g. linux_target_ops) are removed and instances of their "process target" classes are used instead. gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * target.h (struct process_stratum_target): Remove. (class process_target): Rename to ... (class process_stratum_target): ... this. * linux-low.h (class linux_process_target): Derive from 'process_stratum_target'. * linux-low.cc (linux_target_ops): Remove. (initialize_low): Set the_target to the singleton instance of linux_process_target. * lynx-low.h (class lynx_process_target): Derive from 'process_stratum_target'. * lynx-low.cc (lynx_target_ops): Remove. (initialize_low): Set the_target to the singleton instance of lynx_process_target. * nto-low.h (class nto_process_target): Derive from 'process_stratum_target'. * nto-low.cc (nto_target_ops): Remove. (initialize_low): Set the_target to the singleton instance of nto_process_target. * win32-low.h (class win32_process_target): Derive from 'process_stratum_target'. * win32-low.cc (win32_target_ops): Remove. (initialize_low): Set the_target to the singleton instance of win32_process_target. Replace 'the_target->pt' with 'the_target' in the uses below. * hostio.cc (hostio_error) (handle_setfs) (handle_open) (handle_unlink) (handle_readlink) * linux-aarch32-low.cc (arm_breakpoint_at) * linux-aarch64-low.cc (aarch64_breakpoint_at) * linux-arm-low.cc (arm_sigreturn_next_pc) (arm_get_hwcap) (arm_get_syscall_trapinfo) * linux-cris-low.cc (cris_breakpoint_at) * linux-crisv32-low.cc (cris_breakpoint_at) * linux-low.cc (handle_extended_wait) (linux_wait_1) (linux_read_memory) (linux_process_target::breakpoint_kind_from_pc) (linux_get_auxv) * linux-m32r-low.cc (m32r_breakpoint_at) * linux-mips-low.cc (mips_breakpoint_at) * linux-nios2-low.cc (nios2_breakpoint_at) * linux-ppc-low.cc (ppc_breakpoint_at) * linux-s390-low.cc (s390_get_hwcap) * linux-sh-low.cc (sh_breakpoint_at) * linux-sparc-low.cc (sparc_fill_gregset_to_stack) (sparc_store_gregset_from_stack) (sparc_breakpoint_at) * linux-tic6x-low.cc (tic6x_breakpoint_at) * linux-tile-low.cc (tile_breakpoint_at) * linux-x86-low.cc (x86_breakpoint_at) * linux-xtensa-low.cc (xtensa_breakpoint_at) * mem-break.cc (bp_size) (bp_opcode) (insert_memory_breakpoint) (set_raw_breakpoint_at) (delete_raw_breakpoint) (z_type_supported) (uninsert_raw_breakpoint) (reinsert_raw_breakpoint) (validate_inserted_breakpoint) * regcache.cc (regcache_read_pc) (regcache_write_pc) * remote-utils.cc (putpkt_binary_1) (input_interrupt) (getpkt) (prepare_resume_reply) * server.cc (handle_general_set) (handle_detach) (handle_qxfer_auxv) (handle_qxfer_exec_file) (handle_qxfer_libraries_svr4) (handle_qxfer_osdata) (handle_qxfer_siginfo) (handle_qxfer_fdpic) (handle_query) (resume) (handle_v_requests) (queue_stop_reply_callback) (captured_main) * target.cc (prepare_to_access_memory) (done_accessing_memory) (read_inferior_memory) (target_write_memory) (target_stop_and_wait) (target_wait) (target_mourn_inferior) (target_continue_no_signal) (target_continue) (target_supports_multi_process) (kill_inferior) * target.h (target_create_inferior) (target_post_create_inferior) (myattach) (target_supports_fork_events) (target_supports_vfork_events) (target_supports_exec_events) (target_handle_new_gdb_connection) (detach_inferior) (mythread_alive) (fetch_inferior_registers) (store_inferior_registers) (join_inferior) (target_supports_non_stop) (target_async) (target_process_qsupported) (target_supports_catch_syscall) (target_get_ipa_tdesc_idx) (target_supports_tracepoints) (target_supports_fast_tracepoints) (target_get_min_fast_tracepoint_insn_len) (target_thread_stopped) (target_pause_all) (target_unpause_all) (target_stabilize_threads) (target_install_fast_tracepoint_jump_pad) (target_emit_ops) (target_supports_disable_randomization) (target_supports_agent) (target_enable_btrace) (target_disable_btrace) (target_read_btrace) (target_read_btrace_conf) (target_supports_range_stepping) (target_supports_stopped_by_sw_breakpoint) (target_stopped_by_sw_breakpoint) (target_supports_stopped_by_hw_breakpoint) (target_supports_hardware_single_step) (target_stopped_by_hw_breakpoint) (target_breakpoint_kind_from_pc) (target_breakpoint_kind_from_current_state) (target_supports_software_single_step) (target_core_of_thread) (target_thread_name) (target_thread_handle) * win32-low.cc (do_initial_child_stuff) Rename target op default definitions listed below. * target.cc (process_target::post_create_inferior): Rename as ... (process_stratum_target::post_create_inferior): ... this. (process_target::prepare_to_access_memory): Rename as ... (process_stratum_target::prepare_to_access_memory): ... this. (process_target::done_accessing_memory): Rename as ... (process_stratum_target::done_accessing_memory): ... this. (process_target::look_up_symbols): Rename as ... (process_stratum_target::look_up_symbols): ... this. (process_target::supports_read_auxv): Rename as ... (process_stratum_target::supports_read_auxv): ... this. (process_target::read_auxv): Rename as ... (process_stratum_target::read_auxv): ... this. (process_target::supports_z_point_type): Rename as ... (process_stratum_target::supports_z_point_type): ... this. (process_target::insert_point): Rename as ... (process_stratum_target::insert_point): ... this. (process_target::remove_point): Rename as ... (process_stratum_target::remove_point): ... this. (process_target::stopped_by_sw_breakpoint): Rename as ... (process_stratum_target::stopped_by_sw_breakpoint): ... this. (process_target::supports_stopped_by_sw_breakpoint): Rename as ... (process_stratum_target::supports_stopped_by_sw_breakpoint): ... this. (process_target::stopped_by_hw_breakpoint): Rename as ... (process_stratum_target::stopped_by_hw_breakpoint): ... this. (process_target::supports_stopped_by_hw_breakpoint): Rename as ... (process_stratum_target::supports_stopped_by_hw_breakpoint): ... this. (process_target::supports_hardware_single_step): Rename as ... (process_stratum_target::supports_hardware_single_step): ... this. (process_target::stopped_by_watchpoint): Rename as ... (process_stratum_target::stopped_by_watchpoint): ... this. (process_target::stopped_data_address): Rename as ... (process_stratum_target::stopped_data_address): ... this. (process_target::supports_read_offsets): Rename as ... (process_stratum_target::supports_read_offsets): ... this. (process_target::read_offsets): Rename as ... (process_stratum_target::read_offsets): ... this. (process_target::supports_get_tls_address): Rename as ... (process_stratum_target::supports_get_tls_address): ... this. (process_target::get_tls_address): Rename as ... (process_stratum_target::get_tls_address): ... this. (process_target::hostio_last_error): Rename as ... (process_stratum_target::hostio_last_error): ... this. (process_target::supports_qxfer_osdata): Rename as ... (process_stratum_target::supports_qxfer_osdata): ... this. (process_target::qxfer_osdata): Rename as ... (process_stratum_target::qxfer_osdata): ... this. (process_target::supports_qxfer_siginfo): Rename as ... (process_stratum_target::supports_qxfer_siginfo): ... this. (process_target::qxfer_siginfo): Rename as ... (process_stratum_target::qxfer_siginfo): ... this. (process_target::supports_non_stop): Rename as ... (process_stratum_target::supports_non_stop): ... this. (process_target::async): Rename as ... (process_stratum_target::async): ... this. (process_target::start_non_stop): Rename as ... (process_stratum_target::start_non_stop): ... this. (process_target::supports_multi_process): Rename as ... (process_stratum_target::supports_multi_process): ... this. (process_target::supports_fork_events): Rename as ... (process_stratum_target::supports_fork_events): ... this. (process_target::supports_vfork_events): Rename as ... (process_stratum_target::supports_vfork_events): ... this. (process_target::supports_exec_events): Rename as ... (process_stratum_target::supports_exec_events): ... this. (process_target::handle_new_gdb_connection): Rename as ... (process_stratum_target::handle_new_gdb_connection): ... this. (process_target::handle_monitor_command): Rename as ... (process_stratum_target::handle_monitor_command): ... this. (process_target::core_of_thread): Rename as ... (process_stratum_target::core_of_thread): ... this. (process_target::supports_read_loadmap): Rename as ... (process_stratum_target::supports_read_loadmap): ... this. (process_target::read_loadmap): Rename as ... (process_stratum_target::read_loadmap): ... this. (process_target::process_qsupported): Rename as ... (process_stratum_target::process_qsupported): ... this. (process_target::supports_tracepoints): Rename as ... (process_stratum_target::supports_tracepoints): ... this. (process_target::read_pc): Rename as ... (process_stratum_target::read_pc): ... this. (process_target::write_pc): Rename as ... (process_stratum_target::write_pc): ... this. (process_target::supports_thread_stopped): Rename as ... (process_stratum_target::supports_thread_stopped): ... this. (process_target::thread_stopped): Rename as ... (process_stratum_target::thread_stopped): ... this. (process_target::supports_get_tib_address): Rename as ... (process_stratum_target::supports_get_tib_address): ... this. (process_target::get_tib_address): Rename as ... (process_stratum_target::get_tib_address): ... this. (process_target::pause_all): Rename as ... (process_stratum_target::pause_all): ... this. (process_target::unpause_all): Rename as ... (process_stratum_target::unpause_all): ... this. (process_target::stabilize_threads): Rename as ... (process_stratum_target::stabilize_threads): ... this. (process_target::supports_fast_tracepoints): Rename as ... (process_stratum_target::supports_fast_tracepoints): ... this. (process_target::get_min_fast_tracepoint_insn_len): Rename as ... (process_stratum_target::get_min_fast_tracepoint_insn_len): ... this. (process_target::emit_ops): Rename as ... (process_stratum_target::emit_ops): ... this. (process_target::supports_disable_randomization): Rename as ... (process_stratum_target::supports_disable_randomization): ... this. (process_target::supports_qxfer_libraries_svr4): Rename as ... (process_stratum_target::supports_qxfer_libraries_svr4): ... this. (process_target::qxfer_libraries_svr4): Rename as ... (process_stratum_target::qxfer_libraries_svr4): ... this. (process_target::supports_agent): Rename as ... (process_stratum_target::supports_agent): ... this. (process_target::enable_btrace): Rename as ... (process_stratum_target::enable_btrace): ... this. (process_target::disable_btrace): Rename as ... (process_stratum_target::disable_btrace): ... this. (process_target::read_btrace): Rename as ... (process_stratum_target::read_btrace): ... this. (process_target::read_btrace_conf): Rename as ... (process_stratum_target::read_btrace_conf): ... this. (process_target::supports_range_stepping): Rename as ... (process_stratum_target::supports_range_stepping): ... this. (process_target::supports_pid_to_exec_file): Rename as ... (process_stratum_target::supports_pid_to_exec_file): ... this. (process_target::pid_to_exec_file): Rename as ... (process_stratum_target::pid_to_exec_file): ... this. (process_target::supports_multifs): Rename as ... (process_stratum_target::supports_multifs): ... this. (process_target::multifs_open): Rename as ... (process_stratum_target::multifs_open): ... this. (process_target::multifs_unlink): Rename as ... (process_stratum_target::multifs_unlink): ... this. (process_target::multifs_readlink): Rename as ... (process_stratum_target::multifs_readlink): ... this. (process_target::breakpoint_kind_from_pc): Rename as ... (process_stratum_target::breakpoint_kind_from_pc): ... this. (process_target::breakpoint_kind_from_current_state): Rename as ... (process_stratum_target::breakpoint_kind_from_current_state): ... this. (process_target::thread_name): Rename as ... (process_stratum_target::thread_name): ... this. (process_target::thread_handle): Rename as ... (process_stratum_target::thread_handle): ... this. (process_target::supports_software_single_step): Rename as ... (process_stratum_target::supports_software_single_step): ... this. (process_target::supports_catch_syscall): Rename as ... (process_stratum_target::supports_catch_syscall): ... this. (process_target::get_ipa_tdesc_idx): Rename as ... (process_stratum_target::get_ipa_tdesc_idx): ... this.
2020-02-17 16:12:04 +01:00
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* target.h (struct process_stratum_target): Remove.
(class process_target): Rename to ...
(class process_stratum_target): ... this.
* linux-low.h (class linux_process_target): Derive from
'process_stratum_target'.
* linux-low.cc (linux_target_ops): Remove.
(initialize_low): Set the_target to the singleton instance of
linux_process_target.
* lynx-low.h (class lynx_process_target): Derive from
'process_stratum_target'.
* lynx-low.cc (lynx_target_ops): Remove.
(initialize_low): Set the_target to the singleton instance of
lynx_process_target.
* nto-low.h (class nto_process_target): Derive from
'process_stratum_target'.
* nto-low.cc (nto_target_ops): Remove.
(initialize_low): Set the_target to the singleton instance of
nto_process_target.
* win32-low.h (class win32_process_target): Derive from
'process_stratum_target'.
* win32-low.cc (win32_target_ops): Remove.
(initialize_low): Set the_target to the singleton instance of
win32_process_target.
Replace 'the_target->pt' with 'the_target' in the uses below.
* hostio.cc (hostio_error)
(handle_setfs)
(handle_open)
(handle_unlink)
(handle_readlink)
* linux-aarch32-low.cc (arm_breakpoint_at)
* linux-aarch64-low.cc (aarch64_breakpoint_at)
* linux-arm-low.cc (arm_sigreturn_next_pc)
(arm_get_hwcap)
(arm_get_syscall_trapinfo)
* linux-cris-low.cc (cris_breakpoint_at)
* linux-crisv32-low.cc (cris_breakpoint_at)
* linux-low.cc (handle_extended_wait)
(linux_wait_1)
(linux_read_memory)
(linux_process_target::breakpoint_kind_from_pc)
(linux_get_auxv)
* linux-m32r-low.cc (m32r_breakpoint_at)
* linux-mips-low.cc (mips_breakpoint_at)
* linux-nios2-low.cc (nios2_breakpoint_at)
* linux-ppc-low.cc (ppc_breakpoint_at)
* linux-s390-low.cc (s390_get_hwcap)
* linux-sh-low.cc (sh_breakpoint_at)
* linux-sparc-low.cc (sparc_fill_gregset_to_stack)
(sparc_store_gregset_from_stack)
(sparc_breakpoint_at)
* linux-tic6x-low.cc (tic6x_breakpoint_at)
* linux-tile-low.cc (tile_breakpoint_at)
* linux-x86-low.cc (x86_breakpoint_at)
* linux-xtensa-low.cc (xtensa_breakpoint_at)
* mem-break.cc (bp_size)
(bp_opcode)
(insert_memory_breakpoint)
(set_raw_breakpoint_at)
(delete_raw_breakpoint)
(z_type_supported)
(uninsert_raw_breakpoint)
(reinsert_raw_breakpoint)
(validate_inserted_breakpoint)
* regcache.cc (regcache_read_pc)
(regcache_write_pc)
* remote-utils.cc (putpkt_binary_1)
(input_interrupt)
(getpkt)
(prepare_resume_reply)
* server.cc (handle_general_set)
(handle_detach)
(handle_qxfer_auxv)
(handle_qxfer_exec_file)
(handle_qxfer_libraries_svr4)
(handle_qxfer_osdata)
(handle_qxfer_siginfo)
(handle_qxfer_fdpic)
(handle_query)
(resume)
(handle_v_requests)
(queue_stop_reply_callback)
(captured_main)
* target.cc (prepare_to_access_memory)
(done_accessing_memory)
(read_inferior_memory)
(target_write_memory)
(target_stop_and_wait)
(target_wait)
(target_mourn_inferior)
(target_continue_no_signal)
(target_continue)
(target_supports_multi_process)
(kill_inferior)
* target.h
(target_create_inferior)
(target_post_create_inferior)
(myattach)
(target_supports_fork_events)
(target_supports_vfork_events)
(target_supports_exec_events)
(target_handle_new_gdb_connection)
(detach_inferior)
(mythread_alive)
(fetch_inferior_registers)
(store_inferior_registers)
(join_inferior)
(target_supports_non_stop)
(target_async)
(target_process_qsupported)
(target_supports_catch_syscall)
(target_get_ipa_tdesc_idx)
(target_supports_tracepoints)
(target_supports_fast_tracepoints)
(target_get_min_fast_tracepoint_insn_len)
(target_thread_stopped)
(target_pause_all)
(target_unpause_all)
(target_stabilize_threads)
(target_install_fast_tracepoint_jump_pad)
(target_emit_ops)
(target_supports_disable_randomization)
(target_supports_agent)
(target_enable_btrace)
(target_disable_btrace)
(target_read_btrace)
(target_read_btrace_conf)
(target_supports_range_stepping)
(target_supports_stopped_by_sw_breakpoint)
(target_stopped_by_sw_breakpoint)
(target_supports_stopped_by_hw_breakpoint)
(target_supports_hardware_single_step)
(target_stopped_by_hw_breakpoint)
(target_breakpoint_kind_from_pc)
(target_breakpoint_kind_from_current_state)
(target_supports_software_single_step)
(target_core_of_thread)
(target_thread_name)
(target_thread_handle)
* win32-low.cc (do_initial_child_stuff)
Rename target op default definitions listed below.
* target.cc (process_target::post_create_inferior): Rename as ...
(process_stratum_target::post_create_inferior): ... this.
(process_target::prepare_to_access_memory): Rename as ...
(process_stratum_target::prepare_to_access_memory): ... this.
(process_target::done_accessing_memory): Rename as ...
(process_stratum_target::done_accessing_memory): ... this.
(process_target::look_up_symbols): Rename as ...
(process_stratum_target::look_up_symbols): ... this.
(process_target::supports_read_auxv): Rename as ...
(process_stratum_target::supports_read_auxv): ... this.
(process_target::read_auxv): Rename as ...
(process_stratum_target::read_auxv): ... this.
(process_target::supports_z_point_type): Rename as ...
(process_stratum_target::supports_z_point_type): ... this.
(process_target::insert_point): Rename as ...
(process_stratum_target::insert_point): ... this.
(process_target::remove_point): Rename as ...
(process_stratum_target::remove_point): ... this.
(process_target::stopped_by_sw_breakpoint): Rename as ...
(process_stratum_target::stopped_by_sw_breakpoint): ... this.
(process_target::supports_stopped_by_sw_breakpoint): Rename as ...
(process_stratum_target::supports_stopped_by_sw_breakpoint): ... this.
(process_target::stopped_by_hw_breakpoint): Rename as ...
(process_stratum_target::stopped_by_hw_breakpoint): ... this.
(process_target::supports_stopped_by_hw_breakpoint): Rename as ...
(process_stratum_target::supports_stopped_by_hw_breakpoint): ... this.
(process_target::supports_hardware_single_step): Rename as ...
(process_stratum_target::supports_hardware_single_step): ... this.
(process_target::stopped_by_watchpoint): Rename as ...
(process_stratum_target::stopped_by_watchpoint): ... this.
(process_target::stopped_data_address): Rename as ...
(process_stratum_target::stopped_data_address): ... this.
(process_target::supports_read_offsets): Rename as ...
(process_stratum_target::supports_read_offsets): ... this.
(process_target::read_offsets): Rename as ...
(process_stratum_target::read_offsets): ... this.
(process_target::supports_get_tls_address): Rename as ...
(process_stratum_target::supports_get_tls_address): ... this.
(process_target::get_tls_address): Rename as ...
(process_stratum_target::get_tls_address): ... this.
(process_target::hostio_last_error): Rename as ...
(process_stratum_target::hostio_last_error): ... this.
(process_target::supports_qxfer_osdata): Rename as ...
(process_stratum_target::supports_qxfer_osdata): ... this.
(process_target::qxfer_osdata): Rename as ...
(process_stratum_target::qxfer_osdata): ... this.
(process_target::supports_qxfer_siginfo): Rename as ...
(process_stratum_target::supports_qxfer_siginfo): ... this.
(process_target::qxfer_siginfo): Rename as ...
(process_stratum_target::qxfer_siginfo): ... this.
(process_target::supports_non_stop): Rename as ...
(process_stratum_target::supports_non_stop): ... this.
(process_target::async): Rename as ...
(process_stratum_target::async): ... this.
(process_target::start_non_stop): Rename as ...
(process_stratum_target::start_non_stop): ... this.
(process_target::supports_multi_process): Rename as ...
(process_stratum_target::supports_multi_process): ... this.
(process_target::supports_fork_events): Rename as ...
(process_stratum_target::supports_fork_events): ... this.
(process_target::supports_vfork_events): Rename as ...
(process_stratum_target::supports_vfork_events): ... this.
(process_target::supports_exec_events): Rename as ...
(process_stratum_target::supports_exec_events): ... this.
(process_target::handle_new_gdb_connection): Rename as ...
(process_stratum_target::handle_new_gdb_connection): ... this.
(process_target::handle_monitor_command): Rename as ...
(process_stratum_target::handle_monitor_command): ... this.
(process_target::core_of_thread): Rename as ...
(process_stratum_target::core_of_thread): ... this.
(process_target::supports_read_loadmap): Rename as ...
(process_stratum_target::supports_read_loadmap): ... this.
(process_target::read_loadmap): Rename as ...
(process_stratum_target::read_loadmap): ... this.
(process_target::process_qsupported): Rename as ...
(process_stratum_target::process_qsupported): ... this.
(process_target::supports_tracepoints): Rename as ...
(process_stratum_target::supports_tracepoints): ... this.
(process_target::read_pc): Rename as ...
(process_stratum_target::read_pc): ... this.
(process_target::write_pc): Rename as ...
(process_stratum_target::write_pc): ... this.
(process_target::supports_thread_stopped): Rename as ...
(process_stratum_target::supports_thread_stopped): ... this.
(process_target::thread_stopped): Rename as ...
(process_stratum_target::thread_stopped): ... this.
(process_target::supports_get_tib_address): Rename as ...
(process_stratum_target::supports_get_tib_address): ... this.
(process_target::get_tib_address): Rename as ...
(process_stratum_target::get_tib_address): ... this.
(process_target::pause_all): Rename as ...
(process_stratum_target::pause_all): ... this.
(process_target::unpause_all): Rename as ...
(process_stratum_target::unpause_all): ... this.
(process_target::stabilize_threads): Rename as ...
(process_stratum_target::stabilize_threads): ... this.
(process_target::supports_fast_tracepoints): Rename as ...
(process_stratum_target::supports_fast_tracepoints): ... this.
(process_target::get_min_fast_tracepoint_insn_len): Rename as ...
(process_stratum_target::get_min_fast_tracepoint_insn_len): ... this.
(process_target::emit_ops): Rename as ...
(process_stratum_target::emit_ops): ... this.
(process_target::supports_disable_randomization): Rename as ...
(process_stratum_target::supports_disable_randomization): ... this.
(process_target::supports_qxfer_libraries_svr4): Rename as ...
(process_stratum_target::supports_qxfer_libraries_svr4): ... this.
(process_target::qxfer_libraries_svr4): Rename as ...
(process_stratum_target::qxfer_libraries_svr4): ... this.
(process_target::supports_agent): Rename as ...
(process_stratum_target::supports_agent): ... this.
(process_target::enable_btrace): Rename as ...
(process_stratum_target::enable_btrace): ... this.
(process_target::disable_btrace): Rename as ...
(process_stratum_target::disable_btrace): ... this.
(process_target::read_btrace): Rename as ...
(process_stratum_target::read_btrace): ... this.
(process_target::read_btrace_conf): Rename as ...
(process_stratum_target::read_btrace_conf): ... this.
(process_target::supports_range_stepping): Rename as ...
(process_stratum_target::supports_range_stepping): ... this.
(process_target::supports_pid_to_exec_file): Rename as ...
(process_stratum_target::supports_pid_to_exec_file): ... this.
(process_target::pid_to_exec_file): Rename as ...
(process_stratum_target::pid_to_exec_file): ... this.
(process_target::supports_multifs): Rename as ...
(process_stratum_target::supports_multifs): ... this.
(process_target::multifs_open): Rename as ...
(process_stratum_target::multifs_open): ... this.
(process_target::multifs_unlink): Rename as ...
(process_stratum_target::multifs_unlink): ... this.
(process_target::multifs_readlink): Rename as ...
(process_stratum_target::multifs_readlink): ... this.
(process_target::breakpoint_kind_from_pc): Rename as ...
(process_stratum_target::breakpoint_kind_from_pc): ... this.
(process_target::breakpoint_kind_from_current_state): Rename as ...
(process_stratum_target::breakpoint_kind_from_current_state): ... this.
(process_target::thread_name): Rename as ...
(process_stratum_target::thread_name): ... this.
(process_target::thread_handle): Rename as ...
(process_stratum_target::thread_handle): ... this.
(process_target::supports_software_single_step): Rename as ...
(process_stratum_target::supports_software_single_step): ... this.
(process_target::supports_catch_syscall): Rename as ...
(process_stratum_target::supports_catch_syscall): ... this.
(process_target::get_ipa_tdesc_idx): Rename as ...
(process_stratum_target::get_ipa_tdesc_idx): ... this.
2020-02-20 Pedro Alves <palves@redhat.com>
* target.cc (set_target_ops): Simply copy the given target pointer
instead of creating a copy of the pointed object.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's get_ipa_tdesc_idx op into a method
of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_get_ipa_tdesc_idx): Update the macro.
* target.cc (process_target::get_ipa_tdesc_idx): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_get_ipa_tdesc_idx): Turn into ...
(linux_process_target::get_ipa_tdesc_idx): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_catch_syscall op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_supports_catch_syscall): Update the macro.
* target.cc (process_target::supports_catch_syscall): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_catch_syscall): Turn into ...
(linux_process_target::supports_catch_syscall): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_software_single_step op
into a method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_supports_software_single_step): Update the macro.
* target.cc (process_target::supports_software_single_step): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_software_single_step): Turn into ...
(linux_process_target::supports_software_single_step): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's thread_name and thread_handle ops
into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(target_thread_name): Update the macro.
(target_thread_handle): Update the macro.
* target.cc (process_target::thread_name): Define.
(process_target::thread_handle): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::thread_name): Define.
(linux_process_target::thread_handle): Define.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
gdbserver: turn breakpoint kind-related target ops into methods gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn process_stratum_target's breakpoint_kind_from_pc, sw_breakpoint_from_kind, and breakpoint_kind_from_current_state ops into methods of process_target. * target.h (struct process_stratum_target): Remove the target op. (class process_target): Add the target op. (target_breakpoint_kind_from_pc): Update the macro. (target_breakpoint_kind_from_current_state): Update the macro. (default_breakpoint_kind_from_pc): Remove declaration. * target.cc (default_breakpoint_kind_from_pc): Turn into ... (process_target::breakpoint_kind_from_pc): ... this. (process_target::breakpoint_kind_from_current_state): Define. Update the derived classes and callers below. * mem-break.cc (bp_size): Update. (bp_opcode): Update. * linux-low.cc (linux_target_ops): Update. (linux_wait_1): Update. (linux_breakpoint_kind_from_pc): Turn into ... (linux_process_target::breakpoint_kind_from_pc): ... this. (linux_sw_breakpoint_from_kind): Turn into ... (linux_process_target::sw_breakpoint_from_kind): ... this. (linux_breakpoint_kind_from_current_state): Turn into ... (linux_process_target::breakpoint_kind_from_current_state): ... this. * linux-low.h (class linux_process_target): Update. * lynx-low.cc (lynx_target_ops): Update. (lynx_process_target::sw_breakpoint_from_kind): Define. * lynx-low.h (class lynx_process_target): Update. * nto-low.cc (nto_target_ops): Update. (nto_sw_breakpoint_from_kind): Turn into ... (nto_process_target::sw_breakpoint_from_kind): ... this. * nto-low.h (class nto_process_target): Update. * win32-low.cc (win32_target_ops): Update. (win32_sw_breakpoint_from_kind): Turn into ... (win32_process_target::sw_breakpoint_from_kind): ... this. * win32-low.h (class win32_process_target): Update.
2020-02-17 16:12:02 +01:00
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's breakpoint_kind_from_pc,
sw_breakpoint_from_kind, and breakpoint_kind_from_current_state
ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_breakpoint_kind_from_pc): Update the macro.
(target_breakpoint_kind_from_current_state): Update the macro.
(default_breakpoint_kind_from_pc): Remove declaration.
* target.cc (default_breakpoint_kind_from_pc): Turn into ...
(process_target::breakpoint_kind_from_pc): ... this.
(process_target::breakpoint_kind_from_current_state): Define.
Update the derived classes and callers below.
* mem-break.cc (bp_size): Update.
(bp_opcode): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_wait_1): Update.
(linux_breakpoint_kind_from_pc): Turn into ...
(linux_process_target::breakpoint_kind_from_pc): ... this.
(linux_sw_breakpoint_from_kind): Turn into ...
(linux_process_target::sw_breakpoint_from_kind): ... this.
(linux_breakpoint_kind_from_current_state): Turn into ...
(linux_process_target::breakpoint_kind_from_current_state): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_process_target::sw_breakpoint_from_kind): Define.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_sw_breakpoint_from_kind): Turn into ...
(nto_process_target::sw_breakpoint_from_kind): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_sw_breakpoint_from_kind): Turn into ...
(win32_process_target::sw_breakpoint_from_kind): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's multifs_open, multifs_readlink,
multifs_unlink ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops. Also add
'supports_multifs'.
* target.cc: Include "fcntl.h", "unistd.h", "sys/types.h", and
"sys/stat.h".
(process_target::supports_multifs): Define.
(process_target::multifs_open): Define.
(process_target::multifs_readlink): Define.
(process_target::multifs_unlink): Define.
Update the derived classes and callers below.
* hostio.cc (handle_setfs): Update.
(handle_open): Update.
(handle_unlink): Update.
(handle_readlink): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_multifs): Define.
(linux_process_target::multifs_open): Define.
(linux_process_target::multifs_readlink): Define.
(linux_process_target::multifs_unlink): Define.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's pid_to_exec_file op into a method
of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_pid_to_exec_file'.
* target.cc (process_target::pid_to_exec_file): Define.
(process_target::supports_pid_to_exec_file): Define.
Update the derived classes and callers below.
* server.cc (handle_qxfer_exec_file): Update.
(handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_pid_to_exec_file): Define.
(linux_process_target::pid_to_exec_file): Define.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_range_stepping op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_supports_range_stepping): Update the macro.
* target.cc (process_target::supports_range_stepping): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_range_stepping): Turn into ...
(linux_process_target::supports_range_stepping): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's btrace-related ops (enable_btrace,
disable_btrace, read_btrace, read_btrace_conf) into methods of
process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(target_enable_btrace): Update.
(target_disable_btrace): Update.
(target_read_btrace): Update.
(target_read_btrace_conf): Update.
* target.cc (process_target::enable_btrace): Define.
(process_target::disable_btrace): Define.
(process_target::read_btrace): Define.
(process_target::read_btrace_conf): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target:enable_btrace): Define as a wrapper around
linux_enable_btrace.
(linux_low_disable_btrace): Turn into ...
(linux_process_target::disable_btrace): ... this.
(linux_low_read_btrace): Turn into ...
(linux_process_target::read_btrace): ... this.
(linux_low_btrace_conf): Turn into ...
(linux_process_target::read_btrace_conf): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_agent op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_supports_agent): Update the macro.
* target.cc (process_target::supports_agent): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_agent): Turn into ...
(linux_process_target::supports_agent): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's qxfer_libraries_svr4 op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_qxfer_libraries_svr4'.
* target.cc (process_target::qxfer_libraries_svr4): Define.
(process_target::supports_qxfer_libraries_svr4): Define.
Update the derived classes and callers below.
* server.cc (handle_qxfer_libraries_svr4): Update.
(handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_qxfer_libraries_svr4): Define.
(linux_qxfer_libraries_svr4): Turn into ...
(linux_process_target::qxfer_libraries_svr4): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_disable_randomization op
into a method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_supports_disable_randomization): Update the macro.
* target.cc (process_target::supports_disable_randomization): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_disable_randomization): Turn into ...
(linux_process_target::supports_disable_randomization): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's emit_ops op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_emit_ops): Update the macro.
* target.cc (process_target::emit_ops): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_emit_ops): Turn into ...
(linux_process_target::emit_ops): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-17 16:12:00 +01:00
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's install_fast_tracepoint_jump_pad
and get_min_fast_tracepoint_insn_len ops into methods of
process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops. Also add
'supports_fast_tracepoints'.
(target_supports_fast_tracepoints): Update the macro.
(target_get_min_fast_tracepoint_insn_len): Update the macro.
(install_fast_tracepoint_jump_pad): Update and rename the macro
to ...
(target_install_fast_tracepoint_jump_pad): ... this.
* target.cc (process_target::supports_fast_tracepoints): Define.
(process_target::install_fast_tracepoint_jump_pad): Define.
(process_target::get_min_fast_tracepoint_insn_len): Define.
Update the derived classes and callers below.
* tracepoint.cc (install_fast_tracepoint): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_fast_tracepoints): Define.
(linux_install_fast_tracepoint_jump_pad): Turn into ...
(linux_process_target::install_fast_tracepoint_jump_pad): ... this.
(linux_get_min_fast_tracepoint_insn_len): Turn into ...
(linux_process_target::get_min_fast_tracepoint_insn_len): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's stabilize_threads op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_stabilize_threads): Update the macro.
* target.cc (process_target::stabilize_threads): Define.
Update the derived classes and callers below.
* server.cc (handle_status): Update.
* tracepoint.cc (cmd_qtdp): Update.
(cmd_qtstart): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_stabilize_threads): Turn into ...
(linux_process_target::stabilize_threads): ... this.
(linux_wait_1): Update.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's pause_all and unpause_all ops
into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(pause_all): Update the macro and rename to...
(target_pause_all): ... this.
(unpause_all): Update the macro and rename to...
(target_unpause_all): ... this.
* target.cc (process_target::pause_all): Define.
(process_target::unpause_all): Define.
Update the derived classes and callers below.
* server.cc (handle_status): Update.
* tracepoint.cc (clear_installed_tracepoints): Update.
(cmd_qtdp): Update.
(cmd_qtstart): Update.
(stop_tracing): Update.
(cmd_qtstatus): Update.
(upload_fast_traceframes): Update.
(run_inferior_command): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_pause_all): Turn into ...
(linux_process_target::pause_all): ... this.
(linux_unpause_all): Turn into ...
(linux_process_target::unpause_all): ... this.
(linux_process_target::prepare_to_access_memory): Update.
(linux_process_target::done_accessing_memory): Update.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's get_tib_address op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_get_tib_address'.
* target.cc (process_target::get_tib_address): Define.
(process_target::supports_get_tib_address): Define.
Update the derived classes and callers below.
* server.cc (handle_query): Update.
* linux-low.cc (win32_target_ops): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_process_target::supports_get_tib_address): Define.
(win32_get_tib_address): Turn into ...
(win32_process_target::get_tib_address): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's thread_stopped op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_thread_stopped'.
(target_thread_stopped): Update the macro.
* target.cc (process_target::thread_stopped): Define.
(process_target::supports_thread_stopped): Define.
(prepare_to_access_memory): Update.
Update the derived classes and callers below.
* server.cc (queue_stop_reply_callback): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_thread_stopped): Define.
(linux_thread_stopped): Turn into ...
(linux_process_target::thread_stopped): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's read_pc and write_pc ops into
methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
* target.cc (process_target::read_pc): Define.
(process_target::write_pc): Define.
Update the derived classes and callers below.
* regcache.cc (regcache_read_pc): Update.
(regcache_write_pc): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_read_pc): Turn into ...
(linux_process_target::read_pc): ... this.
(linux_write_pc): Turn into ...
(linux_process_target::write_pc): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_tracepoints op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_supports_tracepoints): Update the macro.
* target.cc (process_target::supports_tracepoints): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_tracepoints): Turn into ...
(linux_process_target::supports_tracepoints): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's process_qsupported op into a method
of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_process_qsupported): Update the macro.
* target.cc (process_target::process_qsupported): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_process_qsupported): Turn into ...
(linux_process_target::process_qsupported): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's read_loadmap op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_read_loadmap'.
* target.cc (process_target::read_loadmap): Define.
(process_target::supports_read_loadmap): Define.
Update the derived classes and callers below.
* server.cc (handle_qxfer_fdpic): Update.
(handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_read_loadmap): Define.
(linux_read_loadmap): Turn into ...
(linux_process_target::read_loadmap): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's core_of_thread op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_core_of_thread): Update the macro.
* target.cc (process_target::core_of_thread): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::core_of_thread): Define.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's handle_monitor_command op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_handle_monitor_command): Update the macro.
* target.cc (process_target::handle_monitor_command): Define.
Update the derived classes and callers below.
* server.cc (handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::handle_monitor_command): Define.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's handle_new_gdb_connection op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_handle_new_gdb_connection): Update the macro.
* target.cc (process_target::handle_new_gdb_connection): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_handle_new_gdb_connection): Turn into ...
(linux_process_target::handle_new_gdb_connection): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_fork_events,
supports_vfork_events, and supports_exec_events ops into methods
of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(target_supports_fork_events): Update the macro.
(target_supports_vfork_events): Update the macro.
(target_supports_exec_events): Update the macro.
* target.cc (process_target::supports_fork_events): Define.
(process_target::supports_vfork_events): Define.
(process_target::supports_exec_events): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_fork_events): Turn into ...
(linux_process_target::supports_fork_events): ... this.
(linux_supports_vfork_events): Turn into ...
(linux_process_target::supports_vfork_events): ... this.
(linux_supports_exec_events): Turn into ...
(linux_process_target::supports_exec_events): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_multi_process op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
* target.cc (process_target::supports_multi_process): Define.
(target_supports_multi_process): Update.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_multi_process): Turn into ...
(linux_process_target::supports_multi_process): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_non_stop, async, and
start_non_stop ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(target_supports_non_stop): Update the macro.
(target_async): Update the macro.
(start_non_stop): Remove declaration.
* target.cc (process_target::supports_non_stop): Define.
(process_target::async): Define.
(process_target::start_non_stop): Define.
(start_non_stop): Remove.
Update the derived classes and callers below.
* server.cc (handle_qxfer_siginfo): Update.
(handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_non_stop): Turn into ...
(linux_process_target::supports_non_stop): ... this.
(linux_async): Turn into ...
(linux_process_target::async): ... this.
(linux_start_non_stop): Turn into ...
(linux_process_target::start_non_stop): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_supports_non_stop): Remove; rely on the default behavior
instead.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's qxfer_siginfo op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_qxfer_siginfo'.
* target.cc (process_target::qxfer_siginfo): Define.
(process_target::supports_qxfer_siginfo): Define.
Update the derived classes and callers below.
* server.cc (handle_qxfer_siginfo): Update.
(handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_qxfer_siginfo): Define.
(linux_xfer_siginfo): Turn into ...
(linux_process_target::qxfer_siginfo): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's qxfer_osdata op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_qxfer_osdata'.
* target.cc (process_target::qxfer_osdata): Define.
(process_target::supports_qxfer_osdata): Define.
Update the derived classes and callers below.
* server.cc (handle_qxfer_osdata): Update.
(handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_qxfer_osdata): Define.
(linux_qxfer_osdata): Turn into ...
(linux_process_target::qxfer_osdata): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's hostio_last_error op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
* target.cc: Add "hostio.h" to includes.
(process_target::hostio_last_error): Define.
Update the derived classes and callers below.
* hostio.cc (hostio_error): Update.
* linux-low.cc: Remove "hostio.h" from includes.
(linux_target_ops): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.h (class win32_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(wince_hostio_last_error): Turn into ...
(win32_process_target::hostio_last_error): ... this.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's get_tls_address op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_get_tls_address'.
* target.cc (process_target::get_tls_address): Define.
(process_target::supports_get_tls_address): Define.
Update the derived classes and callers below.
* server.cc (handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_get_tls_address): Define.
(linux_process_target::get_tls_address): Define.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's read_offsets op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op. Also add
'supports_read_offsets'.
* target.cc (process_target::read_offsets): Define.
(process_target::supports_read_offsets): Define.
Update the derived classes and callers below.
* server.cc (handle_query): Update.
* linux-low.cc (SUPPORTS_READ_OFFSETS): New #define directive.
(linux_target_ops): Update.
(linux_process_target::supports_read_offsets): Define.
(linux_read_offsets): Turn into ...
(linux_process_target::read_offsets): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
gdbserver: turn target ops 'stopped_by_watchpoint' and 'stopped_data_address' into methods gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn process_stratum_target's stopped_by_watchpoint and stopped_data_address ops into methods of process_target. * target.h (struct process_stratum_target): Remove the target ops. (class process_target): Add the target ops. * target.cc (process_target::stopped_by_watchpoint): Define. (process_target::stopped_data_address): Define. Update the derived classes and callers below. * remote-utils.cc (prepare_resume_reply): Update. * linux-low.cc (linux_target_ops): Update. (linux_stopped_by_watchpoint): Turn into ... (linux_process_target::stopped_by_watchpoint): ... this. (linux_stopped_data_address): Turn into ... (linux_process_target::stopped_data_address): ... this. * linux-low.h (class linux_process_target): Update. * lynx-low.cc (lynx_target_ops): Update. * nto-low.cc (nto_target_ops): Update. (nto_stopped_by_watchpoint): Turn into ... (nto_process_target::stopped_by_watchpoint): ... this. (nto_stopped_data_address): Turn into ... (nto_process_target::stopped_data_address): ... this. * nto-low.h (class nto_process_target): Update. * win32-low.cc (win32_target_ops): Update. (win32_stopped_by_watchpoint): Turn into ... (win32_process_target::stopped_by_watchpoint): ... this. (win32_stopped_data_address): Turn into ... (win32_process_target::stopped_data_address): ... this. * win32-low.h (class win32_process_target): Update.
2020-02-17 16:11:55 +01:00
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's stopped_by_watchpoint and
stopped_data_address ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
* target.cc (process_target::stopped_by_watchpoint): Define.
(process_target::stopped_data_address): Define.
Update the derived classes and callers below.
* remote-utils.cc (prepare_resume_reply): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_stopped_by_watchpoint): Turn into ...
(linux_process_target::stopped_by_watchpoint): ... this.
(linux_stopped_data_address): Turn into ...
(linux_process_target::stopped_data_address): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_stopped_by_watchpoint): Turn into ...
(nto_process_target::stopped_by_watchpoint): ... this.
(nto_stopped_data_address): Turn into ...
(nto_process_target::stopped_data_address): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_stopped_by_watchpoint): Turn into ...
(win32_process_target::stopped_by_watchpoint): ... this.
(win32_stopped_data_address): Turn into ...
(win32_process_target::stopped_data_address): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_hardware_single_step op into
a method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_supports_hardware_single_step): Update the macro.
(target_can_do_hardware_single_step): Remove declaration.
* target.cc (process_target::supports_hardware_single_step): Define.
(target_can_do_hardware_single_step): Remove.
Update the derived classes and callers below.
* linux-low.h (class linux_process_target): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_hardware_single_step): Turn into ...
(linux_process_target::supports_hardware_single_step): ... this.
* lynx-low.h (class lynx_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_process_target::supports_hardware_single_step): Define.
* nto-low.h (class nto_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_process_target::supports_hardware_single_step): Define.
* win32-low.h (class win32_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_process_target::supports_hardware_single_step): Define.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's {supports_}stopped_by_hw_breakpoint
ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(target_stopped_by_hw_breakpoint): Update the macro.
(target_supports_stopped_by_hw_breakpoint): Update the macro.
* target.cc (process_target::stopped_by_hw_breakpoint): Define.
(process_target::supports_stopped_by_hw_breakpoint): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_stopped_by_hw_breakpoint): Turn into ...
(linux_process_target::stopped_by_hw_breakpoint): ... this.
(linux_supports_stopped_by_hw_breakpoint): Turn into ...
(linux_process_target::supports_stopped_by_hw_breakpoint): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's {supports_}stopped_by_sw_breakpoint
ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(target_stopped_by_sw_breakpoint): Update the macro.
(target_supports_stopped_by_sw_breakpoint): Update the macro.
* target.cc (process_target::stopped_by_sw_breakpoint): Define.
(process_target::supports_stopped_by_sw_breakpoint): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_stopped_by_sw_breakpoint): Turn into ...
(linux_process_target::stopped_by_sw_breakpoint): ... this.
(linux_supports_stopped_by_sw_breakpoint): Turn into ...
(linux_process_target::supports_stopped_by_sw_breakpoint): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's insert_point and remove_point ops
into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
* target.cc (process_target::insert_point): Define.
(process_target::remove_point): Define.
Update the derived classes and callers below.
* mem-break.cc (set_raw_breakpoint_at): Update.
(delete_raw_breakpoint): Update.
(uninsert_raw_breakpoint): Update.
(reinsert_raw_breakpoint): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_insert_point): Turn into ...
(linux_process_target::insert_point): ... this.
(linux_remove_point): Turn into ...
(linux_process_target::remove_point): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_insert_point): Turn into ...
(nto_process_target::insert_point): ... this.
(nto_remove_point): Turn into ...
(nto_process_target::remove_point): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_insert_point): Turn into ...
(win32_process_target::insert_point): ... this.
(win32_remove_point): Turn into ...
(win32_process_target::remove_point): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's supports_z_point_type op into a
method of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
* target.cc (process_target::supports_z_point_type): Define.
Update the derived classes and callers below.
* mem-break.cc (z_type_supported): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_supports_z_point_type): Turn into ...
(linux_process_target::supports_z_point_type): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_supports_z_point_type): Turn into ...
(nto_process_target::supports_z_point_type): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_supports_z_point_type): Turn into ...
(win32_process_target::supports_z_point_type): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's read_auxv op into a method of
process_target.
* target.h (class process_stratum_target): Remove the target op.
(struct process_target): Add the target op. Also add
'supports_read_auxv'.
* target.cc (process_target::read_auxv): Define.
(process_target::supports_read_auxv): Define.
Update the derived classes and callers below.
* server.cc (handle_qxfer_auxv): Update.
(handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_process_target::supports_read_auxv): Define.
(linux_read_auxv): Turn into ...
(linux_process_target::read_auxv): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_process_target::supports_read_auxv): Define.
(nto_read_auxv): Turn into ...
(nto_process_target::read_auxv): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's request_interrupt op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
Update the derived classes and callers below.
* remote-utils.cc (putpkt_binary_1): Update.
(input_interrupt): Update.
(getpkt): Update.
* server.cc (handle_v_requests): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_request_interrupt): Turn into ...
(linux_process_target::request_interrupt): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_request_interrupt): Turn into ...
(lynx_process_target::request_interrupt): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_request_interrupt): Turn into ...
(nto_process_target::request_interrupt): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_request_interrupt): Turn into ...
(win32_process_target::request_interrupt): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's look_up_symbols op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
* target.cc (process_target::look_up_symbols): Define.
Update the derived classes and callers below.
* server.cc (handle_query): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_look_up_symbols): Turn into ...
(linux_process_target::look_up_symbols): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
gdbserver: turn target ops 'read_memory' and 'write_memory' into methods gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn process_stratum_target's read_memory and write_memory ops into methods of process_target. * target.h (struct process_stratum_target): Remove the target ops. (class process_target): Add the target ops. Update the derived classes and callers below. * linux-aarch32-low.cc (arm_breakpoint_at): Update. * linux-aarch64-low.cc (aarch64_breakpoint_at): Update. * linux-arm-low.cc (arm_sigreturn_next_pc): Update. (arm_get_syscall_trapinfo): Update. * linux-cris-low.cc (cris_breakpoint_at): Update. * linux-crisv32-low.cc (cris_breakpoint_at): Update. * linux-m32r-low.cc (m32r_breakpoint_at): Update. * linux-mips-low.cc (mips_breakpoint_at): Update. * linux-nios2-low.cc (nios2_breakpoint_at): Update. * linux-ppc-low.cc (ppc_breakpoint_at): Update. * linux-sh-low.cc (sh_breakpoint_at): Update. * linux-sparc-low.cc (sparc_fill_gregset_to_stack): Update. (sparc_store_gregset_from_stack): Update. (sparc_breakpoint_at): Update. * linux-tic6x-low.cc (tic6x_breakpoint_at): Update. * linux-tile-low.cc (tile_breakpoint_at): Update. * linux-x86-low.cc (x86_breakpoint_at): Update. * linux-xtensa-low.cc (xtensa_breakpoint_at): Update. * mem-brea.cc (insert_memory_breakpoint): Update. (validate_inserted_breakpoint): Update. * target.cc (read_inferior_memory): Update. (target_write_memory): Update. * linux-low.cc (linux_target_ops): Update. (linux_read_memory): Make a wrapper around the read_memory target op call. (linux_process_target::read_memory): Rename from linux_read_memory. (linux_write_memory): Turn into ... (linux_process_target::write_memory): ... this. * linux-low.h (class linux_process_target): Update. * lynx-low.cc (lynx_target_ops): Update. (lynx_read_memory): Turn into ... (lynx_process_target::read_memory): ... this. (lynx_write_memory): Turn into ... (lynx_process_target::write_memory): ... this. * lynx-low.h (class lynx_process_target): Update. * nto-low.cc (nto_target_ops): Update. (nto_read_memory): Turn into ... (nto_process_target::read_memory): ... this. (nto_write_memory): Turn into ... (nto_process_target::write_memory): ... this. * nto-low.h (class nto_process_target): Update. * win32-low.cc (win32_target_ops): Update. (win32_read_inferior_memory): Turn into ... (win32_process_target::read_memory): ... this. (win32_write_inferior_memory): Turn into ... (win32_process_target::write_memory): ... this. * win32-low.h (class win32_process_target): Update.
2020-02-17 16:11:53 +01:00
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's read_memory and write_memory
ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
Update the derived classes and callers below.
* linux-aarch32-low.cc (arm_breakpoint_at): Update.
* linux-aarch64-low.cc (aarch64_breakpoint_at): Update.
* linux-arm-low.cc (arm_sigreturn_next_pc): Update.
(arm_get_syscall_trapinfo): Update.
* linux-cris-low.cc (cris_breakpoint_at): Update.
* linux-crisv32-low.cc (cris_breakpoint_at): Update.
* linux-m32r-low.cc (m32r_breakpoint_at): Update.
* linux-mips-low.cc (mips_breakpoint_at): Update.
* linux-nios2-low.cc (nios2_breakpoint_at): Update.
* linux-ppc-low.cc (ppc_breakpoint_at): Update.
* linux-sh-low.cc (sh_breakpoint_at): Update.
* linux-sparc-low.cc (sparc_fill_gregset_to_stack): Update.
(sparc_store_gregset_from_stack): Update.
(sparc_breakpoint_at): Update.
* linux-tic6x-low.cc (tic6x_breakpoint_at): Update.
* linux-tile-low.cc (tile_breakpoint_at): Update.
* linux-x86-low.cc (x86_breakpoint_at): Update.
* linux-xtensa-low.cc (xtensa_breakpoint_at): Update.
* mem-brea.cc (insert_memory_breakpoint): Update.
(validate_inserted_breakpoint): Update.
* target.cc (read_inferior_memory): Update.
(target_write_memory): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_read_memory): Make a wrapper around the read_memory target
op call.
(linux_process_target::read_memory): Rename from linux_read_memory.
(linux_write_memory): Turn into ...
(linux_process_target::write_memory): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_read_memory): Turn into ...
(lynx_process_target::read_memory): ... this.
(lynx_write_memory): Turn into ...
(lynx_process_target::write_memory): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_read_memory): Turn into ...
(nto_process_target::read_memory): ... this.
(nto_write_memory): Turn into ...
(nto_process_target::write_memory): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_read_inferior_memory): Turn into ...
(win32_process_target::read_memory): ... this.
(win32_write_inferior_memory): Turn into ...
(win32_process_target::write_memory): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's prepare_to_access_memory and
done_accessing_memory ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
* target.cc (process_target::prepare_to_access_memory): Define.
(process_target::done_accessing_memory): Define.
(prepare_to_access_memory): Update.
(done_accessing_memory): Update.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_prepare_to_access_memory): Turn into ...
(linux_process_target::prepare_to_access_memory): ... this.
(linux_done_accessing_memory): Turn into ...
(linux_process_target::done_accessing_memory): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
gdbserver: turn target ops 'fetch_registers' and 'store_registers' into methods gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn process_stratum_target's fetch_registers and store_registers ops into methods of process_target. * target.h (struct process_stratum_target): Remove the target ops. (class process_target): Add the target ops. (fetch_inferior_registers): Update the macro. (store_inferior_registers): Update the macro. Update the derived classes and callers below. * linux-low.cc (linux_target_ops): Update. (linux_fetch_registers): Turn into ... (linux_process_target::fetch_registers): ... this. (linux_store_registers): Turn into ... (linux_process_target::store_registers): ... this. * linux-low.h (class linux_process_target): Update. * lynx-low.cc (lynx_target_ops): Update. (lynx_fetch_registers): Turn into ... (lynx_process_target::fetch_registers): ... this. (lynx_store_registers): Turn into ... (lynx_process_target::store_registers): ... this. * lynx-low.h (class lynx_process_target): Update. * nto-low.cc (nto_target_ops): Update. (nto_fetch_registers): Turn into ... (nto_process_target::fetch_registers): ... this. (nto_store_registers): Turn into ... (nto_process_target::store_registers): ... this. * nto-low.h (class nto_process_target): Update. * win32-low.cc (win32_target_ops): Update. (win32_fetch_inferior_registers): Turn into ... (win32_process_target::fetch_registers): ... this. (win32_store_inferior_registers): Turn into ... (win32_process_target::store_registers): ... this. * win32-low.h (class win32_process_target): Update.
2020-02-17 16:11:53 +01:00
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's fetch_registers and store_registers
ops into methods of process_target.
* target.h (struct process_stratum_target): Remove the target ops.
(class process_target): Add the target ops.
(fetch_inferior_registers): Update the macro.
(store_inferior_registers): Update the macro.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_fetch_registers): Turn into ...
(linux_process_target::fetch_registers): ... this.
(linux_store_registers): Turn into ...
(linux_process_target::store_registers): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_fetch_registers): Turn into ...
(lynx_process_target::fetch_registers): ... this.
(lynx_store_registers): Turn into ...
(lynx_process_target::store_registers): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_fetch_registers): Turn into ...
(nto_process_target::fetch_registers): ... this.
(nto_store_registers): Turn into ...
(nto_process_target::store_registers): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_fetch_inferior_registers): Turn into ...
(win32_process_target::fetch_registers): ... this.
(win32_store_inferior_registers): Turn into ...
(win32_process_target::store_registers): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's wait op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
Update the derived classes and callers below.
* target.cc (target_wait): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_wait): Turn into ...
(linux_process_target::wait): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_wait): Turn into ...
(lynx_process_target::wait): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_wait): Turn into ...
(nto_process_target::wait): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_wait): Turn into ...
(win32_process_target::wait): ... this.
(do_initial_child_stuff): Update.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's resume op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
Update the derived classes and callers below.
* server.cc (resume): Update.
* target.cc (target_stop_and_wait): Update.
(target_continue_no_signal): Update.
(target_continue): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_resume): Turn into ...
(linux_process_target::resume): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_resume): Turn into ...
(lynx_process_target::resume): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_resume): Turn into ...
(nto_process_target::resume): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_resume): Turn into ...
(win32_process_target::resume): ... this.
(win32_process_target::detach): Update.
(do_initial_child_stuff): Update.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's thread_alive op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(mythread_alive): Update the macro.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_thread_alive): Turn into ...
(linux_process_target::thread_alive): ... this.
(wait_for_sigstop): Update.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_thread_alive): Turn into ...
(lynx_process_target::thread_alive): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_thread_alive): Turn into ...
(nto_process_target::thread_alive): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_thread_alive): Turn into ...
(win32_process_target::thread_alive): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's join op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(join_inferior): Update the macro.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_join): Turn into ...
(linux_process_target::join): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_join): Turn into ...
(lynx_process_target::join): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_process_target::join): Define.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_join): Turn into ...
(win32_process_target::join): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's mourn op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
Update the derived classes and callers below.
* target.cc (target_mourn_inferior): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_mourn): Turn into ...
(linux_process_target::mourn): ... this.
(handle_extended_wait): Update.
(linux_process_target::kill): Update.
(linux_process_target::detach): Update.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_mourn): Turn into ...
(lynx_process_target::mourn): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_mourn): Turn into ...
(nto_process_target::mourn): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_mourn): Turn into ...
(win32_process_target::mourn): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's detach op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(detach_inferior): Update the macro.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_detach): Turn into ...
(linux_process_target::detach): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_detach): Turn into ...
(lynx_process_target::detach): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_detach): Turn into ...
(nto_process_target::detach): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_detach): Turn into ...
(win32_process_target::detach): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's kill op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
Update the derived classes and callers below.
* target.cc (kill_inferior): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_kill): Turn into ...
(linux_process_target::kill): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_kill): Turn into ...
(lynx_process_target::kill): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_kill): Turn into ...
(nto_process_target::kill): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_kill): Turn into ...
(win32_process_target::kill): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's attach op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(myattach): Update the macro.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_attach): Turn into ...
(linux_process_target::attach): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_attach): Turn into ...
(lynx_process_target::attach): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_attach): Turn into ...
(nto_process_target::attach): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_attach): Turn into ...
(win32_process_target::attach): ... this.
* win32-low.h (class win32_process_target): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's post_create_inferior op into a method
of process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(target_post_create_inferior): Update the macro.
* target.cc (process_target::post_create_inferior): Define.
Update the derived classes and callers below.
* linux-low.cc (linux_target_ops): Update.
(linux_post_create_inferior): Turn into ...
(linux_process_target::post_create_inferior): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
* nto-low.cc (nto_target_ops): Update.
* win32-low.cc (win32_target_ops): Update.
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's create_inferior op into a method of
process_target.
* target.h (struct process_stratum_target): Remove the target op.
(class process_target): Add the target op.
(create_inferior): Rename the macro to ...
(target_create_inferior): ... this.
Update the derived classes and callers below.
* server.cc (handle_v_run): Update.
(captured_main): Update.
(process_serial_event): Update.
* linux-low.cc (linux_target_ops): Update.
(linux_create_inferior): Turn into ...
(linux_process_target::create_inferior): ... this.
* linux-low.h (class linux_process_target): Update.
* lynx-low.cc (lynx_target_ops): Update.
(lynx_create_inferior): Turn into ...
(lynx_process_target::create_inferior): ... this.
* lynx-low.h (class lynx_process_target): Update.
* nto-low.cc (nto_target_ops): Update.
(nto_create_inferior): Turn into ...
(nto_process_target::create_inferior): ... this.
* nto-low.h (class nto_process_target): Update.
* win32-low.cc (win32_target_ops): Update.
(win32_create_inferior): Turn into ...
(win32_process_target::create_inferior): ... this.
* win32-low.h (class win32_process_target): Update.
gdbserver: start turning the target ops vector into a class This is the beginning of a series of patches where the goal is to turn the target ops vector into a class and all the target op function pointers into methods of this class. Currently, the target ops is a struct of function pointers. At the end of the series, it becomes a class with methods, and the existing low target definitions become subclasses. That is, we end up with the following class hierarchy: process_stratum_target ^ |-- linux-low |-- lynx-low |-- nto-low |-- win32-low process_stratum_target either defines the default behavior for the target ops or leaves them as pure virtual for the subclasses to override. The transformation is done by first introducing a helper class, called 'process_target', that is initially empty. An instance of this class is added to the end of the current target ops vector. This new field is called 'pt'. We will gradually carry target ops to the new class, one by one, whereas the invocation of the target op will be converted to a method call on 'pt'. For instance, target op 'attach' is currently invoked as (*the_target->attach) (args) After moving 'attach' as a method to 'process_target', it will be invoked as the_target->pt->attach (args) In this process, the concrete target vector definitions (e.g. linux-low, win32-low, nto-low, etc.) are turned into derived classes of 'process_target', so that they can either inherit the default behavior of the target ops or can override the method. We prefer to make this transition gradually rather than in a single giant patch, to yield bite-size patches. The goal is that after each patch gdbserver will still be buildable and testable. The general rule of thumb when converting a target op to a method is this: (1) If the function call is protected with a NULL-check with an obvious default behavior, simply implement that default behavior in the base class (e.g.: supports_non_stop). (2) If there is no NULL-check guard, the method becomes pure virtual, and the derived targets are required to implement the method (e.g.: attach). (3) If there is a NULL-check but no apparent default behavior, or if the NULL-check is utilized to populate a feature support packet, introduce a 'supports_XYZ' method (e.g.: pid_to_exec_file). The overall strategy is to preserve the existing behavior as much as possible. When we're done moving all the target ops into 'process_target', the target op vector will contain nothing but the field 'pt'. At that point, the auxiliary class 'process_target' will simply meld into 'process_stratum_target' and the method calls of the form 'the_target->pt->xyz' will be turned into 'the_target->xyz'. The "linux-low" target has been built and reg-tested on X86_64 Linux (Ubuntu). The "win32-low" target has been built (but not tested) via cross-compilation to a x86_64-w64-mingw32 target. The "lynx-low" and "nto-low" targets were neither built nor tested. gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * target.h (class process_target): New class definition. (struct process_stratum_target) <pt>: New field with type 'process_target*'. * linux-low.h (class linux_process_target): Define as a derived class of 'process_target'. * linux-low.cc (linux_target_ops): Add a linux_process_target* as the 'pt' field. * lynx-low.h (class lynx_process_target): Define as a derived class of 'process_target'. * lynx-low.cc (lynx_target_ops): Add a lynx_process_target* as the 'pt' field. * nto-low.h (class nto_process_target): Define as a derived class of 'process_target'. * nto-low.cc (nto_target_ops): Add an nto_process_target* as the 'pt' field. * win32-low.h (class win32_process_target): Define as a derived class of 'process_target'. * win32-low.cc (win32_target_ops): Add a win32_process_target* as the 'pt' field.
2020-02-17 16:11:50 +01:00
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* target.h (class process_target): New class definition.
(struct process_stratum_target) <pt>: New field with type
'process_target*'.
* linux-low.h (class linux_process_target): Define as a derived
class of 'process_target'.
* linux-low.cc (linux_target_ops): Add a linux_process_target*
as the 'pt' field.
* lynx-low.h (class lynx_process_target): Define as a derived
class of 'process_target'.
* lynx-low.cc (lynx_target_ops): Add a lynx_process_target*
as the 'pt' field.
* nto-low.h (class nto_process_target): Define as a derived
class of 'process_target'.
* nto-low.cc (nto_target_ops): Add an nto_process_target*
as the 'pt' field.
* win32-low.h (class win32_process_target): Define as a derived
class of 'process_target'.
* win32-low.cc (win32_target_ops): Add a win32_process_target*
as the 'pt' field.
Merge changes from GCC for the config/ directory GCC's config/ChangeLog since the last time this merge was done (in the binutils-gdb commit 0b4d000cc4e8e77c823) is included at the end of this commit message. It is worth noting that the binutils-gdb commit 301a9420d947da1458 added the file config/debuginfod.m4 which is not present in GCC's config/ directory. This file is preserved, unmodified, after this commit. In order to regenerate all of the configure files, I configured with --enable-maintainer-mode, and built the 'all' target. I then did the same thing on a source tree without this patch, and only committed those files that changed when this patch was added. GCC's config/ChangeLog entries: 2020-02-12 Sandra Loosemore <sandra@codesourcery.com> PR libstdc++/79193 PR libstdc++/88999 * no-executables.m4: Use a non-empty program to test for linker support. 2020-02-01 Andrew Burgess <andrew.burgess@embecosm.com> * lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Update shell syntax. 2020-01-27 Andrew Burgess <andrew.burgess@embecosm.com> * lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Add new --with-libXXX-type=... option. Use this to guide the selection of either a shared library or a static library. 2020-01-24 Maciej W. Rozycki <macro@wdc.com> * toolexeclibdir.m4: New file. 2019-09-10 Christophe Lyon <christophe.lyon@st.com> * futex.m4: Handle *-uclinux*. * tls.m4 (GCC_CHECK_TLS): Likewise. 2019-09-06 Florian Weimer <fweimer@redhat.com> * futex.m4 (GCC_LINUX_FUTEX): Include <unistd.h> for the syscall function. 2019-07-08 Richard Sandiford <richard.sandiford@arm.com> * bootstrap-Og.mk: New file. 2019-06-25 Kwok Cheung Yeung <kcy@codesourcery.com> Andrew Stubbs <ams@codesourcery.com> * gthr.m4 (GCC_AC_THREAD_HEADER): Add case for gcn. 2019-05-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * ax_count_cpus.m4: New file. 2019-05-02 Richard Biener <rguenther@suse.de> PR bootstrap/85574 * bootstrap-lto.mk (extra-compare): Set to gcc/lto1$(exeext). 2019-04-16 Martin Liska <mliska@suse.cz> * bootstrap-lto-lean.mk: Filter out -flto in STAGEtrain_CFLAGS. 2019-04-09 Martin Liska <mliska@suse.cz> * bootstrap-lto-lean.mk: New file. 2019-03-02 Johannes Pfau <johannespfau@gmail.com> * mh-mingw: Also set __USE_MINGW_ACCESS flag for C++ code. 2018-10-31 Joseph Myers <joseph@codesourcery.com> PR bootstrap/82856 * math.m4, tls.m4: Use AC_LANG_SOURCE. Merge from binutils-gdb: 2018-06-19 Simon Marchi <simon.marchi@ericsson.com> * override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69. config/ChangeLog: * ax_count_cpus.m4: New file, backported from GCC. * bootstrap-Og.mk: New file, backported from GCC. * bootstrap-lto-lean.mk: New file, backported from GCC. * bootstrap-lto.mk: Changes backported from GCC. * futex.m4: Changes backported from GCC. * gthr.m4: Changes backported from GCC. * lib-link.m4: Changes backported from GCC. * mh-mingw: Changes backported from GCC. * no-executables.m4: Changes backported from GCC. * tls.m4: Changes backported from GCC. * toolexeclibdir.m4: New file, backported from GCC. binutils/ChangeLog: * configure: Regenerate. gdb/ChangeLog: * configure: Regenerate. gdbserver/ChangeLog: * configure: Regenerate. gdbsupport/ChangeLog: * configure: Regenerate. intl/ChangeLog: * configure: Regenerate. libiberty/ChangeLog: * configure: Regenerate. zlib/ChangeLog.bin-gdb: * configure: Regenerate.
2020-02-05 12:50:07 +01:00
2020-02-19 Andrew Burgess <andrew.burgess@embecosm.com>
* configure: Regenerate.
2020-02-19 Maciej W. Rozycki <macro@wdc.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* linux-riscv-low.cc: New file.
* Makefile.in (SFILES): Add linux-riscv-low.cc, arch/riscv.c,
and nat/riscv-linux-tdesc.c.
* configure.srv <riscv*-*-linux*> (srv_tgtobj)
(srv_linux_regsets, srv_linux_usrregs, srv_linux_thread_db):
Define.
2020-02-14 Tom Tromey <tom@tromey.com>
* acinclude.m4: Don't include acx_configure_dir.m4.
* Makefile.in (LIBIBERTY_BUILDDIR, GNULIB_BUILDDIR): Update.
(SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): Remove.
(all, install-only, uninstall, clean-info, clean)
(maintainer-clean): Don't recurse.
(subdir_do, all-lib): Remove.
($(LIBGNU) $(LIBIBERTY) $(GNULIB_H)): Remove rule.
(GNULIB_H): Remove.
(generated_files): Update.
($(GNULIB_BUILDDIR)/Makefile): Remove rule.
* configure: Rebuild.
* configure.ac: Don't configure gnulib or libiberty.
(GNULIB): Update.
2020-02-14 Eli Zaretskii <eliz@gnu.org>
* win32-low.c (create_process): Prepend PROGRAM to ARGS when
preparing the command line for CreateProcess.
(win32_create_inferior): Reflect the program name in debugging
output that shows the process and its command line.
2020-02-13 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in: Rename source files from .c to .cc.
* %.c: Rename to %.cc.
* configure.ac: Rename server.c to server.cc.
* configure: Re-generate.
2020-02-13 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in: Rename gdbsupport source files from .c to .cc.
2020-02-12 Hannes Domani <ssbssa@yahoo.de>
* win32-low.c (win32_create_inferior): Set signal_pid.
2020-02-12 Maciej W. Rozycki <macro@wdc.com>
Pedro Alves <palves@redhat.com>
Skip building gdbserver in a cross-configuration.
* configure.srv: Set $gdbserver_host depending on whether $target
is $host. Use $gdbserver_host instead of $host.
2020-02-11 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
2020-02-11 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
2020-02-11 Simon Marchi <simon.marchi@efficios.com>
* acinclude.m4: Update warning.m4 path.
Display ExceptionRecord for $_siginfo Uses the $_siginfo convenience variable to show the last exception. The type looks like this: (gdb) pt $_siginfo type = struct EXCEPTION_RECORD { DWORD ExceptionCode; DWORD ExceptionFlags; struct EXCEPTION_RECORD *ExceptionRecord; PVOID ExceptionAddress; DWORD NumberParameters; ULONG_PTR ExceptionInformation[15]; } EXCEPTION_RECORD is documented at [1]. Example: Program received signal SIGSEGV, Segmentation fault. main () at crasher.c:4 4 *(int*)0x123 = 0; (gdb) p $_siginfo $1 = { ExceptionCode = 3221225477, ExceptionFlags = 0, ExceptionRecord = 0x0, ExceptionAddress = 0x401632 <main+18>, NumberParameters = 2, ExceptionInformation = {1, 291, 0 <repeats 13 times>} } (gdb) p/x $_siginfo.ExceptionCode $2 = 0xc0000005 (gdb) p/x $_siginfo.ExceptionInformation[1] $3 = 0x123 And 0xc0000005 is the value of EXCEPTION_ACCESS_VIOLATION. [1] https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-exception_record gdb/ChangeLog: 2020-02-09 Hannes Domani <ssbssa@yahoo.de> * NEWS: Mention $_siginfo support for Windows. * windows-nat.c (handle_exception): Set siginfo_er. (windows_nat_target::mourn_inferior): Reset siginfo_er. (windows_xfer_siginfo): New function. (windows_nat_target::xfer_partial): Call windows_xfer_siginfo. * windows-tdep.c (struct windows_gdbarch_data): New struct. (init_windows_gdbarch_data): New function. (get_windows_gdbarch_data): New function. (windows_get_siginfo_type): New function. (windows_init_abi): Register windows_get_siginfo_type. (_initialize_windows_tdep): Register init_windows_gdbarch_data. gdbserver/ChangeLog: 2020-02-09 Hannes Domani <ssbssa@yahoo.de> * win32-low.c (win32_clear_inferiors): Reset siginfo_er. (handle_exception): Set siginfo_er. (win32_xfer_siginfo): New function.
2020-01-17 15:28:09 +01:00
2020-02-09 Hannes Domani <ssbssa@yahoo.de>
* win32-low.c (win32_clear_inferiors): Reset siginfo_er.
(handle_exception): Set siginfo_er.
(win32_xfer_siginfo): New function.
Move gdbserver to top level This patch moves gdbserver to the top level. This patch is as close to a pure move as possible -- gdbserver still builds its own variant of gnulib and gdbsupport. Changing this will be done in a separate patch. [v2] Note that, per Simon's review comment, this patch changes the tree so that gdbserver is not built for or1k or score. This makes sense, because there is apparently not actually a gdbserver port here. [v3] This version of the patch also splits out some configury into a new file, gdbserver/configure.host, so that the top-level configure script can simply rely on it in order to decide whether gdbserver should be built. [v4] This version adds documentation and removes some unnecessary top-level dependencies. [v5] Update docs to mention "make all-gdbserver" and change how top-level configure decides whether to build gdbserver, switching to a single, shared script. Tested by the buildbot. ChangeLog 2020-02-07 Tom Tromey <tom@tromey.com> Pedro Alves <palves@redhat.com> * src-release.sh (GDB_SUPPORT_DIRS): Add gdbserver. * gdbserver: New directory, moved from gdb/gdbserver. * configure.ac (host_tools): Add gdbserver. Only build gdbserver on certain systems. * Makefile.in, configure: Rebuild. * Makefile.def (host_modules, dependencies): Add gdbserver. * MAINTAINERS: Add gdbserver. gdb/ChangeLog 2020-02-07 Tom Tromey <tom@tromey.com> * README: Update gdbserver documentation. * gdbserver: Move to top level. * configure.tgt (build_gdbserver): Remove. * configure.ac: Remove --enable-gdbserver. * configure: Rebuild. * Makefile.in (distclean): Don't mention gdbserver. Change-Id: I826b7565b54604711dc7a11edea0499cd51ff39e
2019-12-15 15:37:06 +01:00
2020-02-07 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* README: Update build documentation.
* configure.srv: Set UNSUPPORTED if host is unsupported. Check
host, not target.
* configure.ac: Update paths.
* configure: Rebuild.
* acinclude.m4: Update paths.
* Makefile.in: Update include paths.
(depcomp, INCLUDE_DIR, INCGNU, INCSUPPORT, INCLUDE_CFLAGS)
(SFILES, XML_DIR, n, $(GNULIB_BUILDDIR)/Makefile, config.status)
(version-generated.c, stamp-xml, regdat_sh, arch/%-ipa.o)
(gdbsupport/%-ipa.o, %-ipa.o, arch/%.o, gdbsupport/%.o, %.o)
(%-generated.c): Update paths.
* Move entire directory from ../gdb/gdbserver.
2020-01-29 Maciej W. Rozycki <macro@wdc.com>
* configure.srv <i[34567]86-*-mingw*>: Fix whitespace damage.
2020-01-29 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* configure.srv (powerpc*-*-linux*): Use srv_tgtobj in second
assignment instead of srv_linux_obj.
2020-01-28 Hannes Domani <ssbssa@yahoo.de>
* server.c (handle_qxfer_libraries): Write segment-address with
paddress.
2020-01-24 Hannes Domani <ssbssa@yahoo.de>
* Makefile.in (install-strip): New target.
(install_sh, INSTALL_STRIP_PROGRAM, STRIP): New variables.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* configure.ac: Add AM_PROG_INSTALL_STRIP.
2020-01-24 Maciej W. Rozycki <macro@wdc.com>
* Makefile.in (SFILES): Adjust paths to point to real files.
(OBS): Move waitstatus.o to target/waitstatus.o.
(TAGS): Transform paths appropriately.
(%.o): Rename to...
(nat/%.o): ... this pattern rule.
(%.o): Rename to...
(target/%.o): ... this pattern rule.
* configure.srv: Adjust paths throughout to include nat/ prefix
with the revant files.
* configure.ac: Add `nat' and `target' to CONFIG_SRC_SUBDIR.
* configure: Regenerate.
2020-01-24 Maciej W. Rozycki <macro@wdc.com>
* Makefile.in (TAGS): Remove config files from the recipe.
2020-01-14 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Remove any checks that were added to common.m4.
* acinclude.m4: Include lib-ld.m4, lib-prefix.m4, and
lib-link.m4.
Move gdbsupport to the top level This patch moves the gdbsupport directory to the top level. This is the next step in the ongoing project to move gdbserver to the top level. The bulk of this patch was created by "git mv gdb/gdbsupport gdbsupport". This patch then adds a build system to gdbsupport and wires it into the top level. Then it changes gdb to use the top-level build. gdbserver, on the other hand, is not yet changed. It still does its own build of gdbsupport. ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport. * MAINTAINERS: Add gdbsupport. * configure: Rebuild. * configure.ac (configdirs): Add gdbsupport. * gdbsupport: New directory, move from gdb/gdbsupport. * Makefile.def (host_modules, dependencies): Add gnulib. * Makefile.in: Rebuild. gdb/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * nat/x86-linux-dregs.c: Include configh.h. * nat/linux-ptrace.c: Include configh.h. * nat/linux-btrace.c: Include configh.h. * defs.h: Include config.h, bfd.h. * configure.ac: Don't source common.host. (CONFIG_OBS, CONFIG_SRCS): Remove gdbsupport files. * configure: Rebuild. * acinclude.m4: Update path. * Makefile.in (SUPPORT, LIBSUPPORT, INCSUPPORT): New variables. (CONFIG_SRC_SUBDIR): Remove gdbsupport. (INTERNAL_CFLAGS_BASE): Add INCSUPPORT. (CLIBS): Add LIBSUPPORT. (CDEPS): Likewise. (COMMON_SFILES): Remove gdbsupport files. (HFILES_NO_SRCDIR): Likewise. (stamp-version): Update path to create-version.sh. (ALLDEPFILES): Remove gdbsupport files. gdb/gdbserver/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * server.h: Include config.h. * gdbreplay.c: Include config.h. * configure: Rebuild. * configure.ac: Don't source common.host. * acinclude.m4: Update path. * Makefile.in (INCSUPPORT): New variable. (INCLUDE_CFLAGS): Add INCSUPPORT. (SFILES): Update paths. (version-generated.c): Update path to create-version.sh. (gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths. gdbsupport/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * common-defs.h: Add GDBSERVER case. Update includes. * acinclude.m4, aclocal.m4, config.in, configure, configure.ac, Makefile.am, Makefile.in, README: New files. * Moved from ../gdb/gdbsupport/ Change-Id: I07632e7798635c1bab389bf885971e584fb4bb78
2019-07-09 16:06:39 +02:00
2020-01-14 Tom Tromey <tom@tromey.com>
* server.h: Include config.h.
* gdbreplay.c: Include config.h.
* configure: Rebuild.
* configure.ac: Don't source common.host.
* acinclude.m4: Update path.
* Makefile.in (INCSUPPORT): New variable.
(INCLUDE_CFLAGS): Add INCSUPPORT.
(SFILES): Update paths.
(version-generated.c): Update path to create-version.sh.
(gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths.
2020-01-14 Tom Tromey <tom@tromey.com>
* configure.ac (LIBS): Use WIN32APILIBS.
(USE_WIN32API): Don't define.
* configure: Rebuild.
2020-01-14 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
2020-01-13 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in (%-generated.c): Remove rule for files from
regformats/i386.
2020-01-13 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
2020-01-13 Simon Marchi <simon.marchi@efficios.com>
* tracepoint.h (IP_AGENT_EXPORT_FUNC) [!IN_PROCESS_AGENT]:
Define to static.
* tracepoint.c (stop_tracing, flush_trace_buffer,
about_to_request_buffer_space, get_trace_state_variable_value,
set_trace_state_variable_value, gdb_collect): Add declaration.
2020-01-13 Simon Marchi <simon.marchi@efficios.com>
* linux-x86-low.c (x86_linux_regs_info, amd64_emit_eq_goto,
amd64_emit_ne_goto, amd64_emit_lt_goto, amd64_emit_le_goto,
amd64_emit_gt_goto, amd64_emit_ge_goto, amd64_emit_ge_goto,
i386_emit_eq_goto, i386_emit_ne_goto, i386_emit_lt_goto,
i386_emit_le_goto, i386_emit_gt_goto, i386_emit_ge_goto): Make
static.
2020-01-13 Simon Marchi <simon.marchi@efficios.com>
* inferiors.c: Include gdbsupport/common-inferior.h.
2020-01-13 Simon Marchi <simon.marchi@efficios.com>
* hostio-errno.c: Include hostio.h.
2020-01-13 Simon Marchi <simon.marchi@efficios.com>
* Makefile.in (%-generated.c): Make $(regdat_sh) a regular
prerequisite.
2020-01-12 Simon Marchi <simon.marchi@polymtl.ca>
* linux-arm-tdesc.c: Include linux-arm-tdesc.h.
* linux-arm-tdesc.h: Include arch/arm.h.
2020-01-12 Simon Marchi <simon.marchi@polymtl.ca>
* linux-aarch64-low.c (aarch64_write_goto_address): Make static.
2020-01-12 Simon Marchi <simon.marchi@polymtl.ca>
* linux-aarch32-tdesc.c: Include linux-aarch32-tdesc.h.
* linux-aarch64-tdesc.c: Include linux-aarch64-tdesc.h.
Multi-target support This commit adds multi-target support to GDB. What this means is that with this commit, GDB can now be connected to different targets at the same time. E.g., you can debug a live native process and a core dump at the same time, connect to multiple gdbservers, etc. Actually, the word "target" is overloaded in gdb. We already have a target stack, with pushes several target_ops instances on top of one another. We also have "info target" already, which means something completely different to what this patch does. So from here on, I'll be using the "target connections" term, to mean an open process_stratum target, pushed on a target stack. This patch makes gdb have multiple target stacks, and multiple process_stratum targets open simultaneously. The user-visible changes / commands will also use this terminology, but of course it's all open to debate. User-interface-wise, not that much changes. The main difference is that each inferior may have its own target connection. A target connection (e.g., a target extended-remote connection) may support debugging multiple processes, just as before. Say you're debugging against gdbserver in extended-remote mode, and you do "add-inferior" to prepare to spawn a new process, like: (gdb) target extended-remote :9999 ... (gdb) start ... (gdb) add-inferior Added inferior 2 (gdb) inferior 2 [Switching to inferior 2 [<null>] (<noexec>)] (gdb) file a.out ... (gdb) start ... At this point, you have two inferiors connected to the same gdbserver. With this commit, GDB will maintain a target stack per inferior, instead of a global target stack. To preserve the behavior above, by default, "add-inferior" makes the new inferior inherit a copy of the target stack of the current inferior. Same across a fork - the child inherits a copy of the target stack of the parent. While the target stacks are copied, the targets themselves are not. Instead, target_ops is made a refcounted_object, which means that target_ops instances are refcounted, which each inferior counting for a reference. What if you want to create an inferior and connect it to some _other_ target? For that, this commit introduces a new "add-inferior -no-connection" option that makes the new inferior not share the current inferior's target. So you could do: (gdb) target extended-remote :9999 Remote debugging using :9999 ... (gdb) add-inferior -no-connection [New inferior 2] Added inferior 2 (gdb) inferior 2 [Switching to inferior 2 [<null>] (<noexec>)] (gdb) info inferiors Num Description Executable 1 process 18401 target:/home/pedro/tmp/main * 2 <null> (gdb) tar extended-remote :10000 Remote debugging using :10000 ... (gdb) info inferiors Num Description Executable 1 process 18401 target:/home/pedro/tmp/main * 2 process 18450 target:/home/pedro/tmp/main (gdb) A following patch will extended "info inferiors" to include a column indicating which connection an inferior is bound to, along with a couple other UI tweaks. Other than that, debugging is the same as before. Users interact with inferiors and threads as before. The only difference is that inferiors may be bound to processes running in different machines. That's pretty much all there is to it in terms of noticeable UI changes. On to implementation. Since we can be connected to different systems at the same time, a ptid_t is no longer a unique identifier. Instead a thread can be identified by a pair of ptid_t and 'process_stratum_target *', the later being the instance of the process_stratum target that owns the process/thread. Note that process_stratum_target inherits from target_ops, and all process_stratum targets inherit from process_stratum_target. In earlier patches, many places in gdb were converted to refer to threads by thread_info pointer instead of ptid_t, but there are still places in gdb where we start with a pid/tid and need to find the corresponding inferior or thread_info objects. So you'll see in the patch many places adding a process_stratum_target parameter to functions that used to take only a ptid_t. Since each inferior has its own target stack now, we can always find the process_stratum target for an inferior. That is done via a inf->process_target() convenience method. Since each inferior has its own target stack, we need to handle the "beneath" calls when servicing target calls. The solution I settled with is just to make sure to switch the current inferior to the inferior you want before making a target call. Not relying on global context is just not feasible in current GDB. Fortunately, there aren't that many places that need to do that, because generally most code that calls target methods already has the current context pointing to the right inferior/thread. Note, to emphasize -- there's no method to "switch to this target stack". Instead, you switch the current inferior, and that implicitly switches the target stack. In some spots, we need to iterate over all inferiors so that we reach all target stacks. Native targets are still singletons. There's always only a single instance of such targets. Remote targets however, we'll have one instance per remote connection. The exec target is still a singleton. There's only one instance. I did not see the point of instanciating more than one exec_target object. After vfork, we need to make sure to push the exec target on the new inferior. See exec_on_vfork. For type safety, functions that need a {target, ptid} pair to identify a thread, take a process_stratum_target pointer for target parameter instead of target_ops *. Some shared code in gdb/nat/ also need to gain a target pointer parameter. This poses an issue, since gdbserver doesn't have process_stratum_target, only target_ops. To fix this, this commit renames gdbserver's target_ops to process_stratum_target. I think this makes sense. There's no concept of target stack in gdbserver, and gdbserver's target_ops really implements a process_stratum-like target. The thread and inferior iterator functions also gain process_stratum_target parameters. These are used to be able to iterate over threads and inferiors of a given target. Following usual conventions, if the target pointer is null, then we iterate over threads and inferiors of all targets. I tried converting "add-inferior" to the gdb::option framework, as a preparatory patch, but that stumbled on the fact that gdb::option does not support file options yet, for "add-inferior -exec". I have a WIP patchset that adds that, but it's not a trivial patch, mainly due to need to integrate readline's filename completion, so I deferred that to some other time. In infrun.c/infcmd.c, the main change is that we need to poll events out of all targets. See do_target_wait. Right after collecting an event, we switch the current inferior to an inferior bound to the target that reported the event, so that target methods can be used while handling the event. This makes most of the code transparent to multi-targets. See fetch_inferior_event. infrun.c:stop_all_threads is interesting -- in this function we need to stop all threads of all targets. What the function does is send an asynchronous stop request to all threads, and then synchronously waits for events, with target_wait, rinse repeat, until all it finds are stopped threads. Now that we have multiple targets, it's not efficient to synchronously block in target_wait waiting for events out of one target. Instead, we implement a mini event loop, with interruptible_select, select'ing on one file descriptor per target. For this to work, we need to be able to ask the target for a waitable file descriptor. Such file descriptors already exist, they are the descriptors registered in the main event loop with add_file_handler, inside the target_async implementations. This commit adds a new target_async_wait_fd target method that just returns the file descriptor in question. See wait_one / stop_all_threads in infrun.c. The 'threads_executing' global is made a per-target variable. Since it is only relevant to process_stratum_target targets, this is where it is put, instead of in target_ops. You'll notice that remote.c includes some FIXME notes. These refer to the fact that the global arrays that hold data for the remote packets supported are still globals. For example, if we connect to two different servers/stubs, then each might support different remote protocol features. They might even be different architectures, like e.g., one ARM baremetal stub, and a x86 gdbserver, to debug a host/controller scenario as a single program. That isn't going to work correctly today, because of said globals. I'm leaving fixing that for another pass, since it does not appear to be trivial, and I'd rather land the base work first. It's already useful to be able to debug multiple instances of the same server (e.g., a distributed cluster, where you have full control over the servers installed), so I think as is it's already reasonable incremental progress. Current limitations: - You can only resume more that one target at the same time if all targets support asynchronous debugging, and support non-stop mode. It should be possible to support mixed all-stop + non-stop backends, but that is left for another time. This means that currently in order to do multi-target with gdbserver you need to issue "maint set target-non-stop on". I would like to make that mode be the default, but we're not there yet. Note that I'm talking about how the target backend works, only. User-visible all-stop mode works just fine. - As explained above, connecting to different remote servers at the same time is likely to produce bad results if they don't support the exact set of RSP features. FreeBSD updates courtesy of John Baldwin. gdb/ChangeLog: 2020-01-10 Pedro Alves <palves@redhat.com> John Baldwin <jhb@FreeBSD.org> * aarch64-linux-nat.c (aarch64_linux_nat_target::thread_architecture): Adjust. * ada-tasks.c (print_ada_task_info): Adjust find_thread_ptid call. (task_command_1): Likewise. * aix-thread.c (sync_threadlists, aix_thread_target::resume) (aix_thread_target::wait, aix_thread_target::fetch_registers) (aix_thread_target::store_registers) (aix_thread_target::thread_alive): Adjust. * amd64-fbsd-tdep.c: Include "inferior.h". (amd64fbsd_get_thread_local_address): Pass down target. * amd64-linux-nat.c (ps_get_thread_area): Use ps_prochandle thread's gdbarch instead of target_gdbarch. * break-catch-sig.c (signal_catchpoint_print_it): Adjust call to get_last_target_status. * break-catch-syscall.c (print_it_catch_syscall): Likewise. * breakpoint.c (breakpoints_should_be_inserted_now): Consider all inferiors. (update_inserted_breakpoint_locations): Skip if inferiors with no execution. (update_global_location_list): When handling moribund locations, find representative inferior for location's pspace, and use thread count of its process_stratum target. * bsd-kvm.c (bsd_kvm_target_open): Pass target down. * bsd-uthread.c (bsd_uthread_target::wait): Use as_process_stratum_target and adjust thread_change_ptid and add_thread calls. (bsd_uthread_target::update_thread_list): Use as_process_stratum_target and adjust find_thread_ptid, thread_change_ptid and add_thread calls. * btrace.c (maint_btrace_packet_history_cmd): Adjust find_thread_ptid call. * corelow.c (add_to_thread_list): Adjust add_thread call. (core_target_open): Adjust add_thread_silent and thread_count calls. (core_target::pid_to_str): Adjust find_inferior_ptid call. * ctf.c (ctf_target_open): Adjust add_thread_silent call. * event-top.c (async_disconnect): Pop targets from all inferiors. * exec.c (add_target_sections): Push exec target on all inferiors sharing the program space. (remove_target_sections): Remove the exec target from all inferiors sharing the program space. (exec_on_vfork): New. * exec.h (exec_on_vfork): Declare. * fbsd-nat.c (fbsd_add_threads): Add fbsd_nat_target parameter. Pass it down. (fbsd_nat_target::update_thread_list): Adjust. (fbsd_nat_target::resume): Adjust. (fbsd_handle_debug_trap): Add fbsd_nat_target parameter. Pass it down. (fbsd_nat_target::wait, fbsd_nat_target::post_attach): Adjust. * fbsd-tdep.c (fbsd_corefile_thread): Adjust get_thread_arch_regcache call. * fork-child.c (gdb_startup_inferior): Pass target down to startup_inferior and set_executing. * gdbthread.h (struct process_stratum_target): Forward declare. (add_thread, add_thread_silent, add_thread_with_info) (in_thread_list): Add process_stratum_target parameter. (find_thread_ptid(inferior*, ptid_t)): New overload. (find_thread_ptid, thread_change_ptid): Add process_stratum_target parameter. (all_threads()): Delete overload. (all_threads, all_non_exited_threads): Add process_stratum_target parameter. (all_threads_safe): Use brace initialization. (thread_count): Add process_stratum_target parameter. (set_resumed, set_running, set_stop_requested, set_executing) (threads_are_executing, finish_thread_state): Add process_stratum_target parameter. (switch_to_thread): Use is_current_thread. * i386-fbsd-tdep.c: Include "inferior.h". (i386fbsd_get_thread_local_address): Pass down target. * i386-linux-nat.c (i386_linux_nat_target::low_resume): Adjust. * inf-child.c (inf_child_target::maybe_unpush_target): Remove have_inferiors check. * inf-ptrace.c (inf_ptrace_target::create_inferior) (inf_ptrace_target::attach): Adjust. * infcall.c (run_inferior_call): Adjust. * infcmd.c (run_command_1): Pass target to scoped_finish_thread_state. (proceed_thread_callback): Skip inferiors with no execution. (continue_command): Rename 'all_threads' local to avoid hiding 'all_threads' function. Adjust get_last_target_status call. (prepare_one_step): Adjust set_running call. (signal_command): Use user_visible_resume_target. Compare thread pointers instead of inferior_ptid. (info_program_command): Adjust to pass down target. (attach_command): Mark target's 'thread_executing' flag. (stop_current_target_threads_ns): New, factored out from ... (interrupt_target_1): ... this. Switch inferior before making target calls. * inferior-iter.h (struct all_inferiors_iterator, struct all_inferiors_range) (struct all_inferiors_safe_range) (struct all_non_exited_inferiors_range): Filter on process_stratum_target too. Remove explicit. * inferior.c (inferior::inferior): Push dummy target on target stack. (find_inferior_pid, find_inferior_ptid, number_of_live_inferiors): Add process_stratum_target parameter, and pass it down. (have_live_inferiors): Adjust. (switch_to_inferior_and_push_target): New. (add_inferior_command, clone_inferior_command): Handle "-no-connection" parameter. Use switch_to_inferior_and_push_target. (_initialize_inferior): Mention "-no-connection" option in the help of "add-inferior" and "clone-inferior" commands. * inferior.h: Include "process-stratum-target.h". (interrupt_target_1): Use bool. (struct inferior) <push_target, unpush_target, target_is_pushed, find_target_beneath, top_target, process_target, target_at, m_stack>: New. (discard_all_inferiors): Delete. (find_inferior_pid, find_inferior_ptid, number_of_live_inferiors) (all_inferiors, all_non_exited_inferiors): Add process_stratum_target parameter. * infrun.c: Include "gdb_select.h" and <unordered_map>. (target_last_proc_target): New global. (follow_fork_inferior): Push target on new inferior. Pass target to add_thread_silent. Call exec_on_vfork. Handle target's reference count. (follow_fork): Adjust get_last_target_status call. Also consider target. (follow_exec): Push target on new inferior. (struct execution_control_state) <target>: New field. (user_visible_resume_target): New. (do_target_resume): Call target_async. (resume_1): Set target's threads_executing flag. Consider resume target. (commit_resume_all_targets): New. (proceed): Also consider resume target. Skip threads of inferiors with no execution. Commit resumtion in all targets. (start_remote): Pass current inferior to wait_for_inferior. (infrun_thread_stop_requested): Consider target as well. Pass thread_info pointer to clear_inline_frame_state instead of ptid. (infrun_thread_thread_exit): Consider target as well. (random_pending_event_thread): New inferior parameter. Use it. (do_target_wait): Rename to ... (do_target_wait_1): ... this. Add inferior parameter, and pass it down. (threads_are_resumed_pending_p, do_target_wait): New. (prepare_for_detach): Adjust calls. (wait_for_inferior): New inferior parameter. Handle it. Use do_target_wait_1 instead of do_target_wait. (fetch_inferior_event): Adjust. Switch to representative inferior. Pass target down. (set_last_target_status): Add process_stratum_target parameter. Save target in global. (get_last_target_status): Add process_stratum_target parameter and handle it. (nullify_last_target_wait_ptid): Clear 'target_last_proc_target'. (context_switch): Check inferior_ptid == null_ptid before calling inferior_thread(). (get_inferior_stop_soon): Pass down target. (wait_one): Rename to ... (poll_one_curr_target): ... this. (struct wait_one_event): New. (wait_one): New. (stop_all_threads): Adjust. (handle_no_resumed, handle_inferior_event): Adjust to consider the event's target. (switch_back_to_stepped_thread): Also consider target. (print_stop_event): Update. (normal_stop): Update. Also consider the resume target. * infrun.h (wait_for_inferior): Remove declaration. (user_visible_resume_target): New declaration. (get_last_target_status, set_last_target_status): New process_stratum_target parameter. * inline-frame.c (clear_inline_frame_state(ptid_t)): Add process_stratum_target parameter, and use it. (clear_inline_frame_state (thread_info*)): New. * inline-frame.c (clear_inline_frame_state(ptid_t)): Add process_stratum_target parameter. (clear_inline_frame_state (thread_info*)): Declare. * linux-fork.c (delete_checkpoint_command): Pass target down to find_thread_ptid. (checkpoint_command): Adjust. * linux-nat.c (linux_nat_target::follow_fork): Switch to thread instead of just tweaking inferior_ptid. (linux_nat_switch_fork): Pass target down to thread_change_ptid. (exit_lwp): Pass target down to find_thread_ptid. (attach_proc_task_lwp_callback): Pass target down to add_thread/set_running/set_executing. (linux_nat_target::attach): Pass target down to thread_change_ptid. (get_detach_signal): Pass target down to find_thread_ptid. Consider last target status's target. (linux_resume_one_lwp_throw, resume_lwp) (linux_handle_syscall_trap, linux_handle_extended_wait, wait_lwp) (stop_wait_callback, save_stop_reason, linux_nat_filter_event) (linux_nat_wait_1, resume_stopped_resumed_lwps): Pass target down. (linux_nat_target::async_wait_fd): New. (linux_nat_stop_lwp, linux_nat_target::thread_address_space): Pass target down. * linux-nat.h (linux_nat_target::async_wait_fd): Declare. * linux-tdep.c (get_thread_arch_regcache): Pass target down. * linux-thread-db.c (struct thread_db_info::process_target): New field. (add_thread_db_info): Save target. (get_thread_db_info): New process_stratum_target parameter. Also match target. (delete_thread_db_info): New process_stratum_target parameter. Also match target. (thread_from_lwp): Adjust to pass down target. (thread_db_notice_clone): Pass down target. (check_thread_db_callback): Pass down target. (try_thread_db_load_1): Always push the thread_db target. (try_thread_db_load, record_thread): Pass target down. (thread_db_target::detach): Pass target down. Always unpush the thread_db target. (thread_db_target::wait, thread_db_target::mourn_inferior): Pass target down. Always unpush the thread_db target. (find_new_threads_callback, thread_db_find_new_threads_2) (thread_db_target::update_thread_list): Pass target down. (thread_db_target::pid_to_str): Pass current inferior down. (thread_db_target::get_thread_local_address): Pass target down. (thread_db_target::resume, maintenance_check_libthread_db): Pass target down. * nto-procfs.c (nto_procfs_target::update_thread_list): Adjust. * procfs.c (procfs_target::procfs_init_inferior): Declare. (proc_set_current_signal, do_attach, procfs_target::wait): Adjust. (procfs_init_inferior): Rename to ... (procfs_target::procfs_init_inferior): ... this and adjust. (procfs_target::create_inferior, procfs_notice_thread) (procfs_do_thread_registers): Adjust. * ppc-fbsd-tdep.c: Include "inferior.h". (ppcfbsd_get_thread_local_address): Pass down target. * proc-service.c (ps_xfer_memory): Switch current inferior and program space as well. (get_ps_regcache): Pass target down. * process-stratum-target.c (process_stratum_target::thread_address_space) (process_stratum_target::thread_architecture): Pass target down. * process-stratum-target.h (process_stratum_target::threads_executing): New field. (as_process_stratum_target): New. * ravenscar-thread.c (ravenscar_thread_target::update_inferior_ptid): Pass target down. (ravenscar_thread_target::wait, ravenscar_add_thread): Pass target down. * record-btrace.c (record_btrace_target::info_record): Adjust. (record_btrace_target::record_method) (record_btrace_target::record_is_replaying) (record_btrace_target::fetch_registers) (get_thread_current_frame_id, record_btrace_target::resume) (record_btrace_target::wait, record_btrace_target::stop): Pass target down. * record-full.c (record_full_wait_1): Switch to event thread. Pass target down. * regcache.c (regcache::regcache) (get_thread_arch_aspace_regcache, get_thread_arch_regcache): Add process_stratum_target parameter and handle it. (current_thread_target): New global. (get_thread_regcache): Add process_stratum_target parameter and handle it. Switch inferior before calling target method. (get_thread_regcache): Pass target down. (get_thread_regcache_for_ptid): Pass target down. (registers_changed_ptid): Add process_stratum_target parameter and handle it. (registers_changed_thread, registers_changed): Pass target down. (test_get_thread_arch_aspace_regcache): New. (current_regcache_test): Define a couple local test_target_ops instances and use them for testing. (readwrite_regcache): Pass process_stratum_target parameter. (cooked_read_test, cooked_write_test): Pass mock_target down. * regcache.h (get_thread_regcache, get_thread_arch_regcache) (get_thread_arch_aspace_regcache): Add process_stratum_target parameter. (regcache::target): New method. (regcache::regcache, regcache::get_thread_arch_aspace_regcache) (regcache::registers_changed_ptid): Add process_stratum_target parameter. (regcache::m_target): New field. (registers_changed_ptid): Add process_stratum_target parameter. * remote.c (remote_state::supports_vCont_probed): New field. (remote_target::async_wait_fd): New method. (remote_unpush_and_throw): Add remote_target parameter. (get_current_remote_target): Adjust. (remote_target::remote_add_inferior): Push target. (remote_target::remote_add_thread) (remote_target::remote_notice_new_inferior) (get_remote_thread_info): Pass target down. (remote_target::update_thread_list): Skip threads of inferiors bound to other targets. (remote_target::close): Don't discard inferiors. (remote_target::add_current_inferior_and_thread) (remote_target::process_initial_stop_replies) (remote_target::start_remote) (remote_target::remote_serial_quit_handler): Pass down target. (remote_target::remote_unpush_target): New remote_target parameter. Unpush the target from all inferiors. (remote_target::remote_unpush_and_throw): New remote_target parameter. Pass it down. (remote_target::open_1): Check whether the current inferior has execution instead of checking whether any inferior is live. Pass target down. (remote_target::remote_detach_1): Pass down target. Use remote_unpush_target. (extended_remote_target::attach): Pass down target. (remote_target::remote_vcont_probe): Set supports_vCont_probed. (remote_target::append_resumption): Pass down target. (remote_target::append_pending_thread_resumptions) (remote_target::remote_resume_with_hc, remote_target::resume) (remote_target::commit_resume): Pass down target. (remote_target::remote_stop_ns): Check supports_vCont_probed. (remote_target::interrupt_query) (remote_target::remove_new_fork_children) (remote_target::check_pending_events_prevent_wildcard_vcont) (remote_target::remote_parse_stop_reply) (remote_target::process_stop_reply): Pass down target. (first_remote_resumed_thread): New remote_target parameter. Pass it down. (remote_target::wait_as): Pass down target. (unpush_and_perror): New remote_target parameter. Pass it down. (remote_target::readchar, remote_target::remote_serial_write) (remote_target::getpkt_or_notif_sane_1) (remote_target::kill_new_fork_children, remote_target::kill): Pass down target. (remote_target::mourn_inferior): Pass down target. Use remote_unpush_target. (remote_target::core_of_thread) (remote_target::remote_btrace_maybe_reopen): Pass down target. (remote_target::pid_to_exec_file) (remote_target::thread_handle_to_thread_info): Pass down target. (remote_target::async_wait_fd): New. * riscv-fbsd-tdep.c: Include "inferior.h". (riscv_fbsd_get_thread_local_address): Pass down target. * sol2-tdep.c (sol2_core_pid_to_str): Pass down target. * sol-thread.c (sol_thread_target::wait, ps_lgetregs, ps_lsetregs) (ps_lgetfpregs, ps_lsetfpregs, sol_update_thread_list_callback): Adjust. * solib-spu.c (spu_skip_standalone_loader): Pass down target. * solib-svr4.c (enable_break): Pass down target. * spu-multiarch.c (parse_spufs_run): Pass down target. * spu-tdep.c (spu2ppu_sniffer): Pass down target. * target-delegates.c: Regenerate. * target.c (g_target_stack): Delete. (current_top_target): Return the current inferior's top target. (target_has_execution_1): Refer to the passed-in inferior's top target. (target_supports_terminal_ours): Check whether the initial inferior was already created. (decref_target): New. (target_stack::push): Incref/decref the target. (push_target, push_target, unpush_target): Adjust. (target_stack::unpush): Defref target. (target_is_pushed): Return bool. Adjust to refer to the current inferior's target stack. (dispose_inferior): Delete, and inline parts ... (target_preopen): ... here. Only dispose of the current inferior. (target_detach): Hold strong target reference while detaching. Pass target down. (target_thread_name): Add assertion. (target_resume): Pass down target. (target_ops::beneath, find_target_at): Adjust to refer to the current inferior's target stack. (get_dummy_target): New. (target_pass_ctrlc): Pass the Ctrl-C to the first inferior that has a thread running. (initialize_targets): Rename to ... (_initialize_target): ... this. * target.h: Include "gdbsupport/refcounted-object.h". (struct target_ops): Inherit refcounted_object. (target_ops::shortname, target_ops::longname): Make const. (target_ops::async_wait_fd): New method. (decref_target): Declare. (struct target_ops_ref_policy): New. (target_ops_ref): New typedef. (get_dummy_target): Declare function. (target_is_pushed): Return bool. * thread-iter.c (all_matching_threads_iterator::m_inf_matches) (all_matching_threads_iterator::all_matching_threads_iterator): Handle filter target. * thread-iter.h (struct all_matching_threads_iterator, struct all_matching_threads_range, class all_non_exited_threads_range): Filter by target too. Remove explicit. * thread.c (threads_executing): Delete. (inferior_thread): Pass down current inferior. (clear_thread_inferior_resources): Pass down thread pointer instead of ptid_t. (add_thread_silent, add_thread_with_info, add_thread): Add process_stratum_target parameter. Use it for thread and inferior searches. (is_current_thread): New. (thread_info::deletable): Use it. (find_thread_ptid, thread_count, in_thread_list) (thread_change_ptid, set_resumed, set_running): New process_stratum_target parameter. Pass it down. (set_executing): New process_stratum_target parameter. Pass it down. Adjust reference to 'threads_executing'. (threads_are_executing): New process_stratum_target parameter. Adjust reference to 'threads_executing'. (set_stop_requested, finish_thread_state): New process_stratum_target parameter. Pass it down. (switch_to_thread): Also match inferior. (switch_to_thread): New process_stratum_target parameter. Pass it down. (update_threads_executing): Reimplement. * top.c (quit_force): Pop targets from all inferior. (gdb_init): Don't call initialize_targets. * windows-nat.c (windows_nat_target) <get_windows_debug_event>: Declare. (windows_add_thread, windows_delete_thread): Adjust. (get_windows_debug_event): Rename to ... (windows_nat_target::get_windows_debug_event): ... this. Adjust. * tracefile-tfile.c (tfile_target_open): Pass down target. * gdbsupport/common-gdbthread.h (struct process_stratum_target): Forward declare. (switch_to_thread): Add process_stratum_target parameter. * mi/mi-interp.c (mi_on_resume_1): Add process_stratum_target parameter. Use it. (mi_on_resume): Pass target down. * nat/fork-inferior.c (startup_inferior): Add process_stratum_target parameter. Pass it down. * nat/fork-inferior.h (startup_inferior): Add process_stratum_target parameter. * python/py-threadevent.c (py_get_event_thread): Pass target down. gdb/gdbserver/ChangeLog: 2020-01-10 Pedro Alves <palves@redhat.com> * fork-child.c (post_fork_inferior): Pass target down to startup_inferior. * inferiors.c (switch_to_thread): Add process_stratum_target parameter. * lynx-low.c (lynx_target_ops): Now a process_stratum_target. * nto-low.c (nto_target_ops): Now a process_stratum_target. * linux-low.c (linux_target_ops): Now a process_stratum_target. * remote-utils.c (prepare_resume_reply): Pass the target to switch_to_thread. * target.c (the_target): Now a process_stratum_target. (done_accessing_memory): Pass the target to switch_to_thread. (set_target_ops): Ajust to use process_stratum_target. * target.h (struct target_ops): Rename to ... (struct process_stratum_target): ... this. (the_target, set_target_ops): Adjust. (prepare_to_access_memory): Adjust comment. * win32-low.c (child_xfer_memory): Adjust to use process_stratum_target. (win32_target_ops): Now a process_stratum_target.
2020-01-10 21:06:08 +01:00
2020-01-10 Pedro Alves <palves@redhat.com>
* fork-child.c (post_fork_inferior): Pass target down to
startup_inferior.
* inferiors.c (switch_to_thread): Add process_stratum_target
parameter.
* lynx-low.c (lynx_target_ops): Now a process_stratum_target.
* nto-low.c (nto_target_ops): Now a process_stratum_target.
* linux-low.c (linux_target_ops): Now a process_stratum_target.
* remote-utils.c (prepare_resume_reply): Pass the target to
switch_to_thread.
* target.c (the_target): Now a process_stratum_target.
(done_accessing_memory): Pass the target to switch_to_thread.
(set_target_ops): Ajust to use process_stratum_target.
* target.h (struct target_ops): Rename to ...
(struct process_stratum_target): ... this.
(the_target, set_target_ops): Adjust.
(prepare_to_access_memory): Adjust comment.
* win32-low.c (child_xfer_memory): Adjust to use
process_stratum_target.
(win32_target_ops): Now a process_stratum_target.
Improve process exit status macros on MinGW When a Windows program is terminated by a fatal exception, its exit code is the value of that exception, as defined by the various EXCEPTION_* symbols in the Windows API headers. This commit emulates WTERMSIG etc. by translating the fatal exception codes to more-or-less equivalent Posix signals. gdb/ChangeLog: 2020-01-06 Eli Zaretskii <eliz@gnu.org> Pedro Alves <palves@redhat.com> * Makefile.in (COMMON_SFILES): Add gdbsupport/gdb_wait.c. * windows-tdep.c: New enumeration of WINDOWS_SIG* signals. (windows_gdb_signal_to_target): New function, uses the above enumeration to convert GDB internal signal codes to equivalent Windows codes. (windows_init_abi): Call set_gdbarch_gdb_signal_to_target. * windows-nat.c: Include "gdb_wait.h". (get_windows_debug_event): Extract the fatal exception from the exit status and convert to the equivalent Posix signal number. * cli/cli-cmds.c (exit_status_set_internal_vars): Account for the possibility that WTERMSIG returns GDB_SIGNAL_UNKNOWN. * gdbsupport/gdb_wait.c: New file, implements windows_status_to_termsig. * gdbsupport/gdb_wait.h (WIFEXITED, WIFSIGNALED, WEXITSTATUS) (WTERMSIG) [__MINGW32__]: Separate definitions for MinGW. gdb/gdbserver/ChangeLog: 2020-01-06 Eli Zaretskii <eliz@gnu.org> Pedro Alves <palves@redhat.com> * win32-low.c (get_child_debug_event): Extract the fatal exception from the exit status and convert to the equivalent Posix signal number. (win32_wait): Allow TARGET_WAITKIND_SIGNALLED status as well. * Makefile.in (OBS, SFILES): Add gdb_wait.[co].
2020-01-06 12:51:54 +01:00
2020-01-06 Eli Zaretskii <eliz@gnu.org>
Pedro Alves <palves@redhat.com>
* win32-low.c (get_child_debug_event): Extract the fatal exception
from the exit status and convert to the equivalent Posix signal
number.
(win32_wait): Allow TARGET_WAITKIND_SIGNALLED status as well.
* Makefile.in (OBS, SFILES): Add gdb_wait.[co].
2020-01-01 Hannes Domani <ssbssa@yahoo.de>
* Makefile.in: Use INSTALL_PROGRAM_ENV.
2020-01-01 Joel Brobecker <brobecker@adacore.com>
* server.c (gdbserver_version): Change copyright year to 2020.
* gdbreplay.c (gdbreplay_version): Likewise.
2019-12-19 Christian Biesinger <cbiesinger@google.com>
* configure: Regenerate.
* configure.ac: Quote variable arguments of test.
2019-12-16 Bernd Edlinger <bernd.edlinger@hotmail.de>
* Makefile.in: Fix build with GNU Make 3.81
2019-12-16 Tom Tromey <tromey@adacore.com>
* server.c (get_exec_file): Constify result.
2019-12-10 Christian Biesinger <cbiesinger@google.com>
* Makefile.in: Add safe-strerror.c to gdbreplay and IPA, and change
UNDO_GNULIB_CFLAGS to undo strerror_r instead of strerror.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Don't check for strerror.
* linux-i386-ipa.c (initialize_fast_tracepoint_trampoline_buffer):
Call safe_strerror instead of strerror.
* server.h (strerror): Remove this now-unnecessary declaration.
* tracepoint.c (init_named_socket): Call safe_strerror instead of
strerror.
(gdb_agent_helper_thread): Likewise.
* utils.c (perror_with_name): Likewise.
2019-11-26 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
Add RAII class for blocking gdb signals This adds configury support and an RAII class that can be used to temporarily block signals that are used by gdb. (This class is not used in this patch, but it split out for easier review.) The idea of this patch is that these signals should only be delivered to the main thread. So, when creating a background thread, they are temporarily blocked; the blocked state is inherited by the new thread. The sigprocmask man page says: The use of sigprocmask() is unspecified in a multithreaded process; see pthread_sigmask(3). This patch changes gdb to use pthread_sigmask when appropriate, by introducing a convenience define. I've updated gdbserver as well, because I had to touch gdbsupport, and because the threading patches will make it link against the thread library. I chose not to touch the NTO code, because I don't know anything about that platform and because I cannot test it. Finally, this modifies an existing spot in the Guile layer to use the new facility. gdb/ChangeLog 2019-11-26 Tom Tromey <tom@tromey.com> * gdbsupport/signals-state-save-restore.c (original_signal_mask): Remove comment. (save_original_signals_state, restore_original_signals_state): Use gdb_sigmask. * linux-nat.c (block_child_signals, restore_child_signals_mask) (_initialize_linux_nat): Use gdb_sigmask. * guile/guile.c (_initialize_guile): Use block_signals. * Makefile.in (HFILES_NO_SRCDIR): Add gdb-sigmask.h. * gdbsupport/gdb-sigmask.h: New file. * event-top.c (async_sigtstp_handler): Use gdb_sigmask. * cp-support.c (gdb_demangle): Use gdb_sigmask. * gdbsupport/common.m4 (GDB_AC_COMMON): Check for pthread_sigmask. * configure, config.in: Rebuild. * gdbsupport/block-signals.h: New file. gdb/gdbserver/ChangeLog 2019-11-26 Tom Tromey <tom@tromey.com> * remote-utils.c (block_unblock_async_io): Use gdb_sigmask. * linux-low.c (linux_wait_for_event_filtered, linux_async): Use gdb_sigmask. * configure, config.in: Rebuild. Change-Id: If3f37dc57dd859c226e9e4d79458a0514746e8c6
2019-09-29 16:50:15 +02:00
2019-11-26 Tom Tromey <tom@tromey.com>
* remote-utils.c (block_unblock_async_io): Use gdb_sigmask.
* linux-low.c (linux_wait_for_event_filtered, linux_async): Use
gdb_sigmask.
* configure, config.in: Rebuild.
2019-11-26 Tom Tromey <tom@tromey.com>
* Makefile.in (PTHREAD_CFLAGS, PTHREAD_LIBS): New variables.
(INTERNAL_CFLAGS_BASE): Use PTHREAD_CFLAGS.
(GDBSERVER_LIBS): Use PTHREAD_LIBS.
* acinclude.m4: Include ax_pthread.m4.
* config.in, configure: Rebuild.
2019-11-26 Christian Biesinger <cbiesinger@google.com>
* debug.c (debug_set_output): Call safe_strerror instead of
strerror.
* linux-low.c (attach_proc_task_lwp_callback): Likewise.
(linux_kill_one_lwp): Likewise.
(linux_detach_one_lwp): Likewise.
(linux_wait_for_event_filtered): Likewise.
(store_register): Likewise.
* lynx-low.c (lynx_attach): Likewise.
* mem-break.c (insert_memory_breakpoint): Likewise.
(remove_memory_breakpoint): Likewise.
(delete_fast_tracepoint_jump): Likewise.
(set_fast_tracepoint_jump): Likewise.
(uninsert_fast_tracepoint_jumps_at): Likewise.
(reinsert_fast_tracepoint_jumps_at): Likewise.
* nto-low.c (nto_xfer_memory): Likewise.
(nto_resume): Likewise.
2019-11-20 Luis Machado <luis.machado@linaro.org>
* linux-aarch64-low.c (is_sve_tdesc): Check against target feature
instead of register count.
* tdesc.c (tdesc_contains_feature): New function.
* tdesc.h (tdesc_contains_feature): New prototype.
2019-11-15 Christian Biesinger <cbiesinger@google.com>
* Makefile.in: Add safe-strerror.c.
* configure: Regenerate.
* configure.ac: Don't source common.host.
2019-11-15 Christian Biesinger <cbiesinger@google.com>
* config.in: Regenerate.
* configure: Regenerate.
2019-11-05 15:24:17 +01:00
2019-11-12 Andrew Burgess <andrew.burgess@embecosm.com>
* ax.c (ax_printf): Handle size_t_arg.
2019-11-06 Christian Biesinger <cbiesinger@google.com>
* linux-tdep.c (linux_info_proc): Use strtok_r instead of strtok.
* mi/mi-main.c (output_cores): Likewise.
* nat/linux-osdata.c (linux_xfer_osdata_cpus): Likewise.
(linux_xfer_osdata_modules): Likewise.
* remote.c (register_remote_support_xml): Likewise.
* sparc64-tdep.c (adi_is_addr_mapped): Likewise.
* xml-syscall.c (syscall_create_syscall_desc): Likewise.
2019-11-01 Christian Biesinger <cbiesinger@google.com>
* configure: Regenerate.
* configure.ac: Remove check for strerror_r.
2019-10-31 Christian Biesinger <cbiesinger@google.com>
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Also check for strerror_r.
2019-10-31 Christian Biesinger <cbiesinger@google.com>
* ax.h (debug_agent): Remove duplicate declaration.
[gdb] Fix more typos in comments (2) Fix typos in comments. NFC. Tested on x86_64-linux. gdb/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * aarch64-linux-tdep.c: Fix typos in comments. * aarch64-tdep.c: Same. * ada-lang.c: Same. * amd64-nat.c: Same. * arc-tdep.c: Same. * arch/aarch64-insn.c: Same. * block.c: Same. * breakpoint.h: Same. * btrace.h: Same. * c-varobj.c: Same. * cli/cli-decode.c: Same. * cli/cli-script.c: Same. * cli/cli-utils.h: Same. * coff-pe-read.c: Same. * coffread.c: Same. * compile/compile-cplus-symbols.c: Same. * compile/compile-object-run.c: Same. * completer.c: Same. * corelow.c: Same. * cp-support.c: Same. * demangle.c: Same. * dwarf-index-write.c: Same. * dwarf2-frame.c: Same. * dwarf2-frame.h: Same. * eval.c: Same. * frame-base.h: Same. * frame.h: Same. * gdbcmd.h: Same. * gdbtypes.h: Same. * gnu-nat.c: Same. * guile/scm-objfile.c: Same. * i386-tdep.c: Same. * i386-tdep.h: Same. * infcall.c: Same. * infcall.h: Same. * linux-nat.c: Same. * m68k-tdep.c: Same. * macroexp.c: Same. * memattr.c: Same. * mi/mi-cmd-disas.c: Same. * mi/mi-getopt.h: Same. * mi/mi-main.c: Same. * minsyms.c: Same. * nat/aarch64-sve-linux-sigcontext.h: Same. * objfiles.h: Same. * ppc-linux-nat.c: Same. * ppc-linux-tdep.c: Same. * ppc-tdep.h: Same. * progspace.h: Same. * prologue-value.h: Same. * python/py-evtregistry.c: Same. * python/py-instruction.h: Same. * record-btrace.c: Same. * record-full.c: Same. * remote.c: Same. * rs6000-tdep.c: Same. * ser-tcp.c: Same. * sol-thread.c: Same. * sparc-sol2-tdep.c: Same. * sparc64-tdep.c: Same. * stabsread.c: Same. * symfile.c: Same. * symtab.h: Same. * target.c: Same. * tracepoint.c: Same. * tui/tui-data.h: Same. * tui/tui-io.c: Same. * tui/tui-win.c: Same. * tui/tui.c: Same. * unittests/rsp-low-selftests.c: Same. * user-regs.h: Same. * utils.c: Same. * utils.h: Same. * valarith.c: Same. * valops.c: Same. * valprint.c: Same. * valprint.h: Same. * value.c: Same. * value.h: Same. * varobj.c: Same. * x86-nat.h: Same. * xtensa-tdep.c: Same. gdb/gdbserver/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * linux-aarch64-low.c: Fix typos in comments. * linux-arm-low.c: Same. * linux-low.c: Same. * linux-ppc-low.c: Same. * proc-service.c: Same. * regcache.h: Same. * server.c: Same. * tracepoint.c: Same. * win32-low.c: Same. gdb/stubs/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * ia64vms-stub.c: Fix typos in comments. * m32r-stub.c: Same. * m68k-stub.c: Same. * sh-stub.c: Same. gdb/testsuite/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * gdb.base/bigcore.c: Fix typos in comments. * gdb.base/ctf-ptype.c: Same. * gdb.base/long_long.c: Same. * gdb.dwarf2/dw2-op-out-param.S: Same. * gdb.python/py-evthreads.c: Same. * gdb.reverse/i387-stack-reverse.c: Same. * gdb.trace/tfile.c: Same. * lib/compiler.c: Same. * lib/compiler.cc: Same. Change-Id: I8573d84a577894270179ae30f46c48d806fc1beb
2019-10-26 09:55:32 +02:00
2019-10-26 Tom de Vries <tdevries@suse.de>
* linux-aarch64-low.c: Fix typos in comments.
* linux-arm-low.c: Same.
* linux-low.c: Same.
* linux-ppc-low.c: Same.
* proc-service.c: Same.
* regcache.h: Same.
* server.c: Same.
* tracepoint.c: Same.
* win32-low.c: Same.
2019-10-25 Tom Tromey <tromey@adacore.com>
* utils.c (xstrdup): Remove.
2019-10-23 Tom Tromey <tom@tromey.com>
* configure, config.in: Rebuild.
2019-10-23 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* acinclude.m4: Use m4_include, not sinclude.
2019-10-17 Tom Tromey <tromey@adacore.com>
* configure: Rebuild.
* configure.ac: Use AC_CONFIG_HEADERS. Create stamp-h there, not
in AC_CONFIG_FILES invocation.
* Makefile.in (stamp-h, Makefile): Use new-style config.status
invocation.
2019-10-16 Christian Biesinger <cbiesinger@google.com>
* server.c: Include xml-builtin.h.
(get_xml_features): Don't declare xml_builtins here.
2019-10-15 Andrew Burgess <andrew.burgess@embecosm.com>
* Makefile.in: Remove references to vec-ipa.o.
gdb: Remove vec.{c,h} and update code to not include vec.h Removes vec.c and vec.h from the source tree, and remove all the remaining includes of vec.h. There should be no user visible changes after this commit. I did have a few issues rebuilding GDB after applying this patch due to cached dependencies, I found that running this command in the build directory resolved my build issues without requiring a 'make clean': rm -fr gdb/gdbserver/gdbsupport/.deps/ gdb/ChangeLog: * Makefile.in: Remove references to vec.h and vec.c. * aarch64-tdep.c: No longer include vec.h. * ada-lang.c: Likewise. * ada-lang.h: Likewise. * arm-tdep.c: Likewise. * ax.h: Likewise. * breakpoint.h: Likewise. * charset.c: Likewise. * cp-support.h: Likewise. * dtrace-probe.c: Likewise. * dwarf2read.c: Likewise. * extension.h: Likewise. * gdb_bfd.c: Likewise. * gdbsupport/gdb_vecs.h: Likewise. * gdbsupport/vec.c: Remove. * gdbsupport/vec.h: Remove. * gdbthread.h: Likewise. * guile/scm-type.c: Likewise. * inline-frame.c: Likewise. * machoread.c: Likewise. * memattr.c: Likewise. * memrange.h: Likewise. * namespace.h: Likewise. * nat/linux-btrace.h: Likewise. * osdata.c: Likewise. * parser-defs.h: Likewise. * progspace.h: Likewise. * python/py-type.c: Likewise. * record-btrace.c: Likewise. * rust-exp.y: Likewise. * solib-target.c: Likewise. * stap-probe.c: Likewise. * target-descriptions.c: Likewise. * target-memory.c: Likewise. * target.h: Likewise. * varobj.c: Likewise. * varobj.h: Likewise. * xml-support.h: Likewise. gdb/gdbserver/ChangeLog: * Makefile.in: Remove references to vec.c. Change-Id: I0c91d7170bf1b5e992a387fcd9fe4f2abe343bb5
2019-10-07 17:38:53 +02:00
2019-10-15 Andrew Burgess <andrew.burgess@embecosm.com>
* Makefile.in: Remove references to vec.c.
2019-10-02 Christian Biesinger <cbiesinger@google.com>
* server.c (server_waiting): Change to bool.
(extended_protocol): Likewise.
(response_needed): Likewise.
(exit_requested): Likewise.
(run_once): Likewise.
(report_no_resumed): Likewise.
(non_stop): Likewise.
(disable_packet_vCont): Likewise.
(disable_packet_Tthread): Likewise.
(disable_packet_qC): Likewise.
(disable_packet_qfThreadInfo): Likewise.
(handle_general_set): Update.
(handle_detach): Update.
(handle_monitor_command): Update.
(handle_query): Update.
(captured_main): Update.
(process_serial_event): Update.
* server.h (server_waiting): Change to bool.
(disable_packet_vCont): Likewise.
(disable_packet_Tthread): Likewise.
(disable_packet_qC): Likewise.
(disable_packet_qfThreadInfo): Likewise.
(run_once): Likewise.
(non_stop): Likewise.
* target.c (target_stop_and_wait): Update.
2019-10-02 Tom Tromey <tromey@adacore.com>
* Makefile.in (SFILES): Add common-inferior.c.
(OBS): Add common-inferior.o.
* server.c (startup_with_shell): Don't define.
2019-10-02 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-low.c (linux_low_read_btrace): Update for change to
std::vector.
2019-09-20 Christian Biesinger <cbiesinger@google.com>
* debug.c (debug_threads): Remove comment in favor of the header.
* debug.h (using_threads): Add declaration.
(debug_threads): Add comment.
* linux-aarch64-low.c: Include debug.h and remove declaration of
debug_threads.
* nto-low.c: Likewise.
* remote-utils.c: Likewise.
* thread-db.c: Likewise.
Remove Cell Broadband Engine debugging support This patch implements removal of Cell/B.E. support, including - Support for the spu-*-* target - Support for native stand-alone SPU debugging - Support for integrated debugging of combined PPU/SPU applications - Remote debugging (gdbserver) support for all the above. The patch also removes the TARGET_OBJECT_SPU target object type, as this is available only on Cell/B.E. targets, including - Native Linux support - Core file support (including core file generation) - Remote target support, including removal of the qXfer:spu:read and qXfer:spu:write remote protocal packets and associated support in gdbserver. gdb/ChangeLog 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * NEWS: Mention that Cell/B.E. debugging support was removed. * MAINTAINERS: Remove spu target. * config/djgpp/fnchange.lst: Remove entries for removed files. * Makefile.in (ALL_TARGET_OBS): Remove solib-spu.o, spu-multiarch.o, and spu-tdep.o. (HFILES_NO_SRCDIR): Remove solib-spu.h and spu-tdep.h. (ALLDEPFILES): Remove solib-spu.c, spu-linux-nat.c, spu-multiarch.c, and spu-tdep.c. * spu-linux-nat.c: Remove file. * spu-multiarch.c: Remove file. * spu-tdep.c: Remove file. * spu-tdep.h: Remove file. * solib-spu.c: Remove file. * solib-spu.h: Remove file. * configure.host (powerpc64*-*-linux*): Remove Cell/B.E. support. * configure.nat (spu-linux): Remove. * configure.tgt (powerpc*-*-linux*): Remove solib-spu.o and solib-multiarch.o from gdb_target_obs. (spu*-*-*): Remove. * arch/ppc-linux-common.h (struct ppc_linux_features): Remove "cell" feature flag. (ppc_linux_no_features): Update. * arch/ppc-linux-common.c (ppc_linux_match_description): Remove Cell/B.E. support. * arch/ppc-linux-tdesc.h (tdesc_powerpc_cell32l): Remove declaration. (tdesc_powerpc_cell64l): Likewise. * nat/ppc-linux.h (PPC_FEATURE_CELL): Remove. * ppc-linux-nat.c (ppc_linux_nat_target::read_description): Remove Cell/B.E. support. * ppc-linux-tdep.h: Do not include "solib-spu.h" or "spu-tdep.h". Do not include "features/rs6000/powerpc-cell32l.c" or "features/rs6000/powerpc-cell64l.c". (ppc_linux_spu_section): Remove. (ppc_linux_core_read_description): Remove Cell/B.E. support. (spe_context_objfile, spe_context_lm_addr, spe_context_offset, spe_context_cache_ptid, spe_context_cache_ptid): Remove. (ppc_linux_spe_context_lookup): Remove. (ppc_linux_spe_context_inferior_created): Remove. (ppc_linux_spe_context_solib_loaded): Remove. (ppc_linux_spe_context_solib_unloaded): Remove. (ppc_linux_spe_context): Remove. (struct ppu2spu_cache): Remove. (ppu2spu_prev_arch, ppu2spu_this_id, ppu2spu_prev_register): Remove. (struct ppu2spu_data): Remove. (ppu2spu_unwind_register, ppu2spu_sniffer, ppu2spu_dealloc_cache, ppu2spu_unwind): Remove. (ppc_linux_init_abi): Remove Cell/B.E. support. * rs6000-tdep.h (rs6000_gdbarch_init): Remove Cell/B.E. support. * features/Makefile (rs6000/powerpc-cell32l-expedite): Remove. (rs6000/powerpc-cell64l-expedite): Likewise (WHICH): Remove rs6000/powerpc-cell32l and rs6000/powerpc-cell64l. (XMLTOC): Remove rs6000/powerpc-cell32l.xml and rs6000/powerpc-cell64l.xml. * features/rs6000/powerpc-cell32l.xml: Remove. * features/rs6000/powerpc-cell64l.xml: Likewise. * features/rs6000/powerpc-cell32l.c: Remove generated file. * features/rs6000/powerpc-cell64l.c: Likewise. * regformats/rs6000/powerpc-cell32l.dat: Remove generated file. * regformats/rs6000/powerpc-cell64l.dat: Likewise. * regformats/reg-spu.dat: Remove. * target.h (enum target_object): Remove TARGET_OBJECT_SPU. * corelow.c (struct spuid_list): Remove. (add_to_spuid_list): Remove. (core_target::xfer_partial): Remove support for TARGET_OBJECT_SPU. * remote.c (PACKET_qXfer_spu_read, PACKET_qXfer_spu_write): Remove. (remote_protocol_features): Remove associated entries. (_initialize_remote): No longer initialize them. (remote_target::xfer_partial): Remove support for TARGET_OBJECT_SPU. * linux-nat.c (SPUFS_MAGIC): Remove. (linux_proc_xfer_spu): Remove. (spu_enumerate_spu_ids): Remove. (linux_nat_target::xfer_partial): Remove support for TARGET_OBJECT_SPU. * linux-tdep.c (-linux_spu_make_corefile_notes): Remove. (linux_make_corefile_notes): No longer call it. * regcache.c (cooked_read_test): Remove bfd_arch_spu special case. (cooked_write_test): Likewise. gdb/doc/ChangeLog 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * doc/gdb.texinfo (Remote Configuration): Remove documentation for qXfer:spu:read and qXfer:spu:write. (General Query Packets): Likewise. (Cell Broadband Engine SPU architecture): Remove subsection. gdb/gdbserver/ChangeLog 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * configure.srv (ipa_ppc_linux_regobj): Remove powerpc-cell32l-ipa.o and powerpc-cell64l-ipa.o. (powerpc*-*-linux*): Remove powerpc-cell32l.o and powerpc-cell64l.o from srv_regobj. Remove rs6000/powerpc-cell32l.xml and rs6000/powerpc-cell64l.xml from srv_xmlfiles. (spu*-*-*): Remove. * spu-low.c: Remove file. * linux-ppc-low.c (INSTR_SC, NR_spu_run): Remove. (parse_spufs_run): Remove. (ppc_get_pc): Remove Cell/B.E. support. (ppc_set_pc): Likewise. (ppc_breakpoint_at): Likewise. (ppc_arch_setup): Likewise. (ppc_get_ipa_tdesc_idx): Do not handle tdesc_powerpc_cell64l or tdesc_powerpc_cell32l. (initialize_low_arch): Do not call init_registers_powerpc_cell64l or init_registers_powerpc_cell32l. * linux-ppc-ipa.c (get_ipa_tdesc): Do not handle PPC_TDESC_CELL. (initialize_low_tracepoint): Do not call init_registers_powerpc_cell64l or init_registers_powerpc_cell32l. * linux-ppc-tdesc-init.h (PPC_TDESC_CELL): Mark as unused. (init_registers_powerpc_cell32l): Remove prototype. (init_registers_powerpc_cell64l): Likewise. * target.h (struct target_ops): Remove qxfer_spu member. * server.c (handle_qxfer_spu): Remove. (qxfer_packets): Remove entry for "spu". (handle_query): No longer support qXfer:spu:read or qXfer:spu:write. * linux-low.c (SPUFS_MAGIC): Remove. (spu_enumerate_spu_ids): Remove. (linux_qxfer_spu): Remove. (linux_target_ops): Remove qxfer_spu member. * lynx-low.c (lynx_target_ops): Remove qxfer_spu member. * nto-low.c (nto_target_ops): Remove qxfer_spu member. * win32-low.c (win32_target_ops): Remove qxfer_spu member. gdb/testsuite/ChangeLog 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * gdb.arch/spu-info.exp: Remove file. * gdb.arch/spu-info.c: Remove file. * gdb.arch/spu-ls.exp: Remove file. * gdb.arch/spu-ls.c: Remove file. * gdb.asm/asm-source.exp: Remove support for spu*-*-*. * gdb.asm/spu.inc: Remove file. * gdb.base/dump.exp: Remove support for spu*-*-*. * gdb.base/stack-checking.exp: Likewise. * gdb.base/overlays.exp: Likewise. * gdb.base/ovlymgr.c: Likewise. * gdb.base/spu.ld: Remove file. * gdb.cp/bs15503.exp: Remove support for spu*-*-*. * gdb.cp/cpexprs.exp: Likewise. * gdb.cp/exception.exp: Likewise. * gdb.cp/gdb2495.exp: Likewise. * gdb.cp/mb-templates.exp: Likewise. * gdb.cp/pr9167.exp: Likewise. * gdb.cp/userdef.exp: Likewise. * gdb.xml/tdesc-regs.exp: Remove support for spu*-*-*. * gdb.cell: Remove directory. * lib/cell.exp: Remove file.
2019-09-20 23:06:57 +02:00
2019-09-20 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv (ipa_ppc_linux_regobj): Remove powerpc-cell32l-ipa.o
and powerpc-cell64l-ipa.o.
(powerpc*-*-linux*): Remove powerpc-cell32l.o and powerpc-cell64l.o
from srv_regobj. Remove rs6000/powerpc-cell32l.xml and
rs6000/powerpc-cell64l.xml from srv_xmlfiles.
(spu*-*-*): Remove.
* spu-low.c: Remove file.
* linux-ppc-low.c (INSTR_SC, NR_spu_run): Remove.
(parse_spufs_run): Remove.
(ppc_get_pc): Remove Cell/B.E. support.
(ppc_set_pc): Likewise.
(ppc_breakpoint_at): Likewise.
(ppc_arch_setup): Likewise.
(ppc_get_ipa_tdesc_idx): Do not handle tdesc_powerpc_cell64l or
tdesc_powerpc_cell32l.
(initialize_low_arch): Do not call init_registers_powerpc_cell64l
or init_registers_powerpc_cell32l.
* linux-ppc-ipa.c (get_ipa_tdesc): Do not handle PPC_TDESC_CELL.
(initialize_low_tracepoint): Do not call init_registers_powerpc_cell64l
or init_registers_powerpc_cell32l.
* linux-ppc-tdesc-init.h (PPC_TDESC_CELL): Mark as unused.
(init_registers_powerpc_cell32l): Remove prototype.
(init_registers_powerpc_cell64l): Likewise.
* target.h (struct target_ops): Remove qxfer_spu member.
* server.c (handle_qxfer_spu): Remove.
(qxfer_packets): Remove entry for "spu".
(handle_query): No longer support qXfer:spu:read or qXfer:spu:write.
* linux-low.c (SPUFS_MAGIC): Remove.
(spu_enumerate_spu_ids): Remove.
(linux_qxfer_spu): Remove.
(linux_target_ops): Remove qxfer_spu member.
* lynx-low.c (lynx_target_ops): Remove qxfer_spu member.
* nto-low.c (nto_target_ops): Remove qxfer_spu member.
* win32-low.c (win32_target_ops): Remove qxfer_spu member.
2019-08-23 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (SFILES): Add 'gdbsupport/gdb-dlfcn.c'.
(OBS): Add 'gdbsupport/gdb-dlfcn.o'.
* config.in: Regenerate.
* configure: Regenerate.
2019-08-15 Tom Tromey <tromey@adacore.com>
* target.c (target_write_memory): Use gdb::byte_vector.
Replace write_inferior_memory with target_write_memory target_write_memory is just a simple wrapper for write_inferior_memory. Because target_write_memory is needed for gdbsupport, and because gdb uses the name "target_write_memory" everywhere, this patch renames write_inferior_memory and removes the wrapper. I think this brings gdb and gdbserver slightly more in sync. gdb/gdbserver/ChangeLog 2019-08-15 Tom Tromey <tromey@adacore.com> * tracepoint.c (write_inferior_data_pointer) (write_inferior_integer, write_inferior_int8) (write_inferior_uinteger, m_tracepoint_action_download) (r_tracepoint_action_download, x_tracepoint_action_download) (l_tracepoint_action_download, clear_inferior_trace_buffer) (download_agent_expr, download_tracepoint_1) (download_trace_state_variables, upload_fast_traceframes): Update. * server.c (gdb_write_memory): Update. * remote-utils.c (relocate_instruction): Update. * proc-service.c (ps_pdwrite): Update. * mem-break.c (remove_memory_breakpoint) (delete_fast_tracepoint_jump, set_fast_tracepoint_jump) (uninsert_fast_tracepoint_jumps_at) (reinsert_fast_tracepoint_jumps_at): Update. * linux-x86-low.c (append_insns) (i386_install_fast_tracepoint_jump_pad) (amd64_write_goto_address, i386_write_goto_address): Update. * linux-s390-low.c (append_insns, s390_write_goto_address): Update. * linux-ppc-low.c (ppc_relocate_instruction) (ppc_install_fast_tracepoint_jump_pad, emit_insns) (ppc_write_goto_address): Update. * linux-aarch64-low.c (append_insns): Update. * target.h (struct target_ops): Update. (write_inferior_memory): Don't declare. * target.c (target_write_memory): Rename from write_inferior_memory. Remove old target_write_memory.
2019-08-14 17:18:21 +02:00
2019-08-15 Tom Tromey <tromey@adacore.com>
* tracepoint.c (write_inferior_data_pointer)
(write_inferior_integer, write_inferior_int8)
(write_inferior_uinteger, m_tracepoint_action_download)
(r_tracepoint_action_download, x_tracepoint_action_download)
(l_tracepoint_action_download, clear_inferior_trace_buffer)
(download_agent_expr, download_tracepoint_1)
(download_trace_state_variables, upload_fast_traceframes): Update.
* server.c (gdb_write_memory): Update.
* remote-utils.c (relocate_instruction): Update.
* proc-service.c (ps_pdwrite): Update.
* mem-break.c (remove_memory_breakpoint)
(delete_fast_tracepoint_jump, set_fast_tracepoint_jump)
(uninsert_fast_tracepoint_jumps_at)
(reinsert_fast_tracepoint_jumps_at): Update.
* linux-x86-low.c (append_insns)
(i386_install_fast_tracepoint_jump_pad)
(amd64_write_goto_address, i386_write_goto_address): Update.
* linux-s390-low.c (append_insns, s390_write_goto_address):
Update.
* linux-ppc-low.c (ppc_relocate_instruction)
(ppc_install_fast_tracepoint_jump_pad, emit_insns)
(ppc_write_goto_address): Update.
* linux-aarch64-low.c (append_insns): Update.
* target.h (struct target_ops): Update.
(write_inferior_memory): Don't declare.
* target.c (target_write_memory): Rename from
write_inferior_memory. Remove old target_write_memory.
2019-08-15 Tom Tromey <tromey@adacore.com>
* target.c (write_inferior_memory): Use std::vector.
2019-08-06 Frank Ch. Eigler <fche@redhat.com>
PR build/24886
* configure.ac: Drop enable-libmcheck support.
* configure, config.in: Rebuild.
* acinclude.m4: Don't include it.
2019-07-19 Alan Hayward <alan.hayward@arm.com>
* configure.srv: Remove Arm xml files.
2019-07-19 Alan Hayward <alan.hayward@arm.com>
* configure.srv: Add new files. Remove xml generated files.
* linux-aarch32-low.c (initialize_low_arch_aarch32): Don't init
registers.
* linux-aarch32-low.h (tdesc_arm_with_neon): Remove.
* linux-aarch32-tdesc.c: New file.
* linux-aarch32-tdesc.h: New file.
* linux-aarch64-low.c (aarch64_arch_setup): Call aarch32_linux_read_description.
* linux-arm-low.c (init_registers_arm, tdesc_arm)
(init_registers_arm_with_iwmmxt, tdesc_arm_with_iwmmxt)
(init_registers_arm_with_vfpv2, tdesc_arm_with_vfpv2)
(init_registers_arm_with_vfpv3, tdesc_arm_with_vfpv3): Remove.
(arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
(arm_store_vfpregset): Call arm_linux_get_tdesc_fp_type.
(arm_read_description): Call arm_linux_read_description.
(initialize_low_arch): Don't init registers.
* linux-arm-tdesc.c: New file.
* linux-arm-tdesc.h: New file.
2019-07-10 Alan Hayward <alan.hayward@arm.com>
* linux-arm-low.c (arm_fill_wmmxregset, arm_store_wmmxregset):
Move counter inside for.
(arm_read_description): Check ptrace earlier.
(arm_arch_setup): Call arm_linux_init_hwbp_cap here.
Rename common to gdbsupport This is the next patch in the ongoing series to move gdbsever to the top level. This patch just renames the "common" directory. The idea is to do this move in two parts: first rename the directory (this patch), then move the directory to the top. This approach makes the patches a bit more tractable. I chose the name "gdbsupport" for the directory. However, as this patch was largely written by sed, we could pick a new name without too much difficulty. Tested by the buildbot. gdb/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * contrib/ari/gdb_ari.sh: Change common to gdbsupport. * configure: Rebuild. * configure.ac: Change common to gdbsupport. * gdbsupport: Rename from common. * acinclude.m4: Change common to gdbsupport. * Makefile.in (CONFIG_SRC_SUBDIR, COMMON_SFILES) (HFILES_NO_SRCDIR, stamp-version, ALLDEPFILES): Change common to gdbsupport. * aarch64-tdep.c, ada-lang.c, ada-lang.h, agent.c, alloc.c, amd64-darwin-tdep.c, amd64-dicos-tdep.c, amd64-fbsd-nat.c, amd64-fbsd-tdep.c, amd64-linux-nat.c, amd64-linux-tdep.c, amd64-nbsd-tdep.c, amd64-obsd-tdep.c, amd64-sol2-tdep.c, amd64-tdep.c, amd64-windows-tdep.c, arch-utils.c, arch/aarch64-insn.c, arch/aarch64.c, arch/aarch64.h, arch/amd64.c, arch/amd64.h, arch/arm-get-next-pcs.c, arch/arm-linux.c, arch/arm.c, arch/i386.c, arch/i386.h, arch/ppc-linux-common.c, arch/riscv.c, arch/riscv.h, arch/tic6x.c, arm-tdep.c, auto-load.c, auxv.c, ax-gdb.c, ax-general.c, ax.h, breakpoint.c, breakpoint.h, btrace.c, btrace.h, build-id.c, build-id.h, c-lang.h, charset.c, charset.h, cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c, cli/cli-dump.c, cli/cli-option.h, cli/cli-script.c, coff-pe-read.c, command.h, compile/compile-c-support.c, compile/compile-c.h, compile/compile-cplus-symbols.c, compile/compile-cplus-types.c, compile/compile-cplus.h, compile/compile-loc2c.c, compile/compile.c, completer.c, completer.h, contrib/ari/gdb_ari.sh, corefile.c, corelow.c, cp-support.c, cp-support.h, cp-valprint.c, csky-tdep.c, ctf.c, darwin-nat.c, debug.c, defs.h, disasm-selftests.c, disasm.c, disasm.h, dtrace-probe.c, dwarf-index-cache.c, dwarf-index-cache.h, dwarf-index-write.c, dwarf2-frame.c, dwarf2expr.c, dwarf2loc.c, dwarf2read.c, event-loop.c, event-top.c, exceptions.c, exec.c, extension.h, fbsd-nat.c, features/aarch64-core.c, features/aarch64-fpu.c, features/aarch64-pauth.c, features/aarch64-sve.c, features/i386/32bit-avx.c, features/i386/32bit-avx512.c, features/i386/32bit-core.c, features/i386/32bit-linux.c, features/i386/32bit-mpx.c, features/i386/32bit-pkeys.c, features/i386/32bit-segments.c, features/i386/32bit-sse.c, features/i386/64bit-avx.c, features/i386/64bit-avx512.c, features/i386/64bit-core.c, features/i386/64bit-linux.c, features/i386/64bit-mpx.c, features/i386/64bit-pkeys.c, features/i386/64bit-segments.c, features/i386/64bit-sse.c, features/i386/x32-core.c, features/riscv/32bit-cpu.c, features/riscv/32bit-csr.c, features/riscv/32bit-fpu.c, features/riscv/64bit-cpu.c, features/riscv/64bit-csr.c, features/riscv/64bit-fpu.c, features/tic6x-c6xp.c, features/tic6x-core.c, features/tic6x-gp.c, filename-seen-cache.h, findcmd.c, findvar.c, fork-child.c, gcore.c, gdb_bfd.c, gdb_bfd.h, gdb_proc_service.h, gdb_regex.c, gdb_select.h, gdb_usleep.c, gdbarch-selftests.c, gdbthread.h, gdbtypes.h, gnu-nat.c, go32-nat.c, guile/guile.c, guile/scm-ports.c, guile/scm-safe-call.c, guile/scm-type.c, i386-fbsd-nat.c, i386-fbsd-tdep.c, i386-go32-tdep.c, i386-linux-nat.c, i386-linux-tdep.c, i386-tdep.c, i387-tdep.c, ia64-libunwind-tdep.c, ia64-linux-nat.c, inf-child.c, inf-ptrace.c, infcall.c, infcall.h, infcmd.c, inferior-iter.h, inferior.c, inferior.h, inflow.c, inflow.h, infrun.c, infrun.h, inline-frame.c, language.h, linespec.c, linux-fork.c, linux-nat.c, linux-tdep.c, linux-thread-db.c, location.c, machoread.c, macrotab.h, main.c, maint.c, maint.h, memattr.c, memrange.h, mi/mi-cmd-break.h, mi/mi-cmd-env.c, mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-interp.c, mi/mi-main.c, mi/mi-parse.h, minsyms.c, mips-linux-tdep.c, namespace.h, nat/aarch64-linux-hw-point.c, nat/aarch64-linux-hw-point.h, nat/aarch64-linux.c, nat/aarch64-sve-linux-ptrace.c, nat/amd64-linux-siginfo.c, nat/fork-inferior.c, nat/linux-btrace.c, nat/linux-btrace.h, nat/linux-namespaces.c, nat/linux-nat.h, nat/linux-osdata.c, nat/linux-personality.c, nat/linux-procfs.c, nat/linux-ptrace.c, nat/linux-ptrace.h, nat/linux-waitpid.c, nat/mips-linux-watch.c, nat/mips-linux-watch.h, nat/ppc-linux.c, nat/x86-dregs.c, nat/x86-dregs.h, nat/x86-linux-dregs.c, nat/x86-linux.c, nto-procfs.c, nto-tdep.c, objfile-flags.h, objfiles.c, objfiles.h, obsd-nat.c, observable.h, osdata.c, p-valprint.c, parse.c, parser-defs.h, ppc-linux-nat.c, printcmd.c, probe.c, proc-api.c, procfs.c, producer.c, progspace.h, psymtab.h, python/py-framefilter.c, python/py-inferior.c, python/py-ref.h, python/py-type.c, python/python.c, record-btrace.c, record-full.c, record.c, record.h, regcache-dump.c, regcache.c, regcache.h, remote-fileio.c, remote-fileio.h, remote-sim.c, remote.c, riscv-tdep.c, rs6000-aix-tdep.c, rust-exp.y, s12z-tdep.c, selftest-arch.c, ser-base.c, ser-event.c, ser-pipe.c, ser-tcp.c, ser-unix.c, skip.c, solib-aix.c, solib-target.c, solib.c, source-cache.c, source.c, source.h, sparc-nat.c, spu-linux-nat.c, stack.c, stap-probe.c, symfile-add-flags.h, symfile.c, symfile.h, symtab.c, symtab.h, target-descriptions.c, target-descriptions.h, target-memory.c, target.c, target.h, target/waitstatus.c, target/waitstatus.h, thread-iter.h, thread.c, tilegx-tdep.c, top.c, top.h, tracefile-tfile.c, tracefile.c, tracepoint.c, tracepoint.h, tui/tui-io.c, ui-file.c, ui-out.h, unittests/array-view-selftests.c, unittests/child-path-selftests.c, unittests/cli-utils-selftests.c, unittests/common-utils-selftests.c, unittests/copy_bitwise-selftests.c, unittests/environ-selftests.c, unittests/format_pieces-selftests.c, unittests/function-view-selftests.c, unittests/lookup_name_info-selftests.c, unittests/memory-map-selftests.c, unittests/memrange-selftests.c, unittests/mkdir-recursive-selftests.c, unittests/observable-selftests.c, unittests/offset-type-selftests.c, unittests/optional-selftests.c, unittests/parse-connection-spec-selftests.c, unittests/ptid-selftests.c, unittests/rsp-low-selftests.c, unittests/scoped_fd-selftests.c, unittests/scoped_mmap-selftests.c, unittests/scoped_restore-selftests.c, unittests/string_view-selftests.c, unittests/style-selftests.c, unittests/tracepoint-selftests.c, unittests/unpack-selftests.c, unittests/utils-selftests.c, unittests/xml-utils-selftests.c, utils.c, utils.h, valarith.c, valops.c, valprint.c, value.c, value.h, varobj.c, varobj.h, windows-nat.c, x86-linux-nat.c, xml-support.c, xml-support.h, xml-tdesc.h, xstormy16-tdep.c, xtensa-linux-nat.c, dwarf2read.h: Change common to gdbsupport. gdb/gdbserver/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac: Change common to gdbsupport. * acinclude.m4: Change common to gdbsupport. * Makefile.in (SFILES, OBS, GDBREPLAY_OBS, IPA_OBJS) (version-generated.c, gdbsupport/%-ipa.o, gdbsupport/%.o): Change common to gdbsupport. * ax.c, event-loop.c, fork-child.c, gdb_proc_service.h, gdbreplay.c, gdbthread.h, hostio-errno.c, hostio.c, i387-fp.c, inferiors.c, inferiors.h, linux-aarch64-tdesc-selftest.c, linux-amd64-ipa.c, linux-i386-ipa.c, linux-low.c, linux-tic6x-low.c, linux-x86-low.c, linux-x86-tdesc-selftest.c, linux-x86-tdesc.c, lynx-i386-low.c, lynx-low.c, mem-break.h, nto-x86-low.c, regcache.c, regcache.h, remote-utils.c, server.c, server.h, spu-low.c, symbol.c, target.h, tdesc.c, tdesc.h, thread-db.c, tracepoint.c, win32-i386-low.c, win32-low.c: Change common to gdbsupport.
2019-05-06 04:29:24 +02:00
2019-07-09 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Change common to gdbsupport.
* acinclude.m4: Change common to gdbsupport.
* Makefile.in (SFILES, OBS, GDBREPLAY_OBS, IPA_OBJS)
(version-generated.c, gdbsupport/%-ipa.o, gdbsupport/%.o): Change
common to gdbsupport.
* ax.c, event-loop.c, fork-child.c, gdb_proc_service.h,
gdbreplay.c, gdbthread.h, hostio-errno.c, hostio.c, i387-fp.c,
inferiors.c, inferiors.h, linux-aarch64-tdesc-selftest.c,
linux-amd64-ipa.c, linux-i386-ipa.c, linux-low.c,
linux-tic6x-low.c, linux-x86-low.c, linux-x86-tdesc-selftest.c,
linux-x86-tdesc.c, lynx-i386-low.c, lynx-low.c, mem-break.h,
nto-x86-low.c, regcache.c, regcache.h, remote-utils.c, server.c,
server.h, spu-low.c, symbol.c, target.h, tdesc.c, tdesc.h,
thread-db.c, tracepoint.c, win32-i386-low.c, win32-low.c: Change
common to gdbsupport.
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* linux-aarch32-low.c (arm_read_description, arm_regsets): Use new
defines.
* linux-arm-low.c (arm_read_description, arm_regsets): Likewise.
i386/AArch64: Remove old xml tests Both the i386, X86_64 and AArch64 builds of gdbserver include a bunch of legacy xml files, dat files and auto generated C files, when building for unit test. These tests exists back from when feature target descriptions were added to prove that the new target descriptions were identical to the original older versions. The old files are not used for anything other than these tests. Now that this has been proven, we are not gaining anything by keeping the original files and tests. Should new functionality be added, it would break the tests, unless the functionality was backported to the xml. There is no requirement that we must match the exact xml from N releases ago. It adds obfuscation, where as the feature target descriptions were meant to simplify the code. In addition, there are a bunch of xml and dat files which are completely unused. This patch removes the selftests and the target descriptions from gdbserver. Update the unittest to allow 0 tests (note, this failed on other targets that never had any tests). gdb/ChangeLog: * aarch64-tdep.c: Remove xml self tests. * amd64-linux-tdep.c: Likewise. * amd64-tdep.c: Likewise. * i386-linux-tdep.c: Likewise. * i386-tdep.c: Likewise. gdb/gdbserver/ChangeLog: * configure.srv: Remove legacy xml. * linux-aarch64-low.c (initialize_low_arch): Remove initialize_low_tdesc call. * linux-aarch64-tdesc-selftest.c: Remove file. * linux-aarch64-tdesc.h (initialize_low_tdesc): Remove. * linux-x86-low.c (initialize_low_arch): Remove initialize_low_tdesc call. * linux-x86-tdesc-selftest.c: Remove file. * linux-x86-tdesc.h (initialize_low_tdesc): Remove. gdb/testsuite/ChangeLog: * gdb.server/unittest.exp: Allow 0 unit tests to run.
2019-07-04 12:48:16 +02:00
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* configure.srv: Remove legacy xml.
* linux-aarch64-low.c (initialize_low_arch): Remove
initialize_low_tdesc call.
* linux-aarch64-tdesc-selftest.c: Remove file.
* linux-aarch64-tdesc.h (initialize_low_tdesc): Remove.
* linux-x86-low.c (initialize_low_arch): Remove
initialize_low_tdesc call.
* linux-x86-tdesc-selftest.c: Remove file.
* linux-x86-tdesc.h (initialize_low_tdesc): Remove.
[gdbserver] Fix s390x -m31 gdbserver build When building gdb on s390x with -m31, we run into this error: ... gdb/gdbserver/linux-s390-ipa.c: \ In function 'const target_desc* get_ipa_tdesc(int)': gdb/gdbserver/linux-s390-ipa.c:371:18: error: 's390_te_ft_collect_regmap' \ was not declared in this scope SET_REGMAP(s390_te_ft_collect_regmap, 0); The offending line is part of this code snippet: ... case S390_TDESC_GS: SET_REGMAP(s390_te_ft_collect_regmap, 0); return tdesc_s390_gs_linux64; ... introduced in commit ce29f8439f "S390: Make IPA recognize tdescs with guarded storage". The snippet is part of an #ifdef __s390x__ construct, in the false branch, and in the true branch we find a snippet introduced by the same commit: ... case S390_TDESC_GS: SET_REGMAP(s390x_te_ft_collect_regmap, 0); return tdesc_s390x_gs_linux64; ... which is paired with a comment update for s390x_te_ft_collect_regmap: ... -/* Used for s390x-te-linux64, s390x-tevx-linux64. */ +/* Used for s390x-te-linux64, s390x-tevx-linux64, and + s390x-gs-linux64. */ static const int s390x_te_ft_collect_regmap[] = { ... A similar comment update is added in the same commit for s390_te_linux64_ft_collect_regmap: ... -/* Used for s390-te-linux64, s390-tevx-linux64. */ +/* Used for s390-te-linux64, s390-tevx-linux64, and s390-gs-linux64. */ static const int s390_te_linux64_ft_collect_regmap[] = { ... but not paired with any update. Fix the build breaker by making the offending SET_REGMAP use the regmap indicated by the comment. ... - SET_REGMAP(s390_te_ft_collect_regmap, 0); + SET_REGMAP(s390_te_linux64_ft_collect_regmap, 0); ... Build on s390x-linux with -m31. gdb/gdbserver/ChangeLog: 2019-06-20 Tom de Vries <tdevries@suse.de> * linux-s390-ipa.c (get_ipa_tdesc)[!__s390x__]: Use s390_te_linux64_ft_collect_regmap for S390_TDESC_GS.
2019-06-20 11:31:36 +02:00
2019-06-20 Tom de Vries <tdevries@suse.de>
* linux-s390-ipa.c (get_ipa_tdesc)[!__s390x__]: Use
s390_te_linux64_ft_collect_regmap for S390_TDESC_GS.
2019-06-19 Tom de Vries <tdevries@suse.de>
* debug.h (debug_write): Change return type to ssize_t.
* debug.c (debug_write): Same.
Move gnulib to top level This patch moves the gdb/gnulib subdirectory to the top level. It adjusts the top-level build system to build gnulib when necessary, and changes gdb to use this. However, gdbserver still builds its own copy of gnulib, just from the new source location. A small hack was needed to ensure that gnulib is only built when gdb is enabled. The Makefile only provides an ordering -- the directory must be mentioned in configdirs to actually be compiled at all. Most of the patch is just a "git mv" of gnulib, though a few minor path adjustments were needed in some files there. Tested by the buildbot. ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * MAINTAINERS: Add gnulib. * gnulib: New directory, move from gdb/gnulib. * configure.ac (host_libs): Add gnulib. * configure: Rebuild. * Makefile.def (host_modules, dependencies): Add gnulib. * Makefile.in: Rebuild. gdb/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * gnulib: Move directory to top-level. * configure.ac: Don't configure gnulib. * configure: Rebuild. * common/common-defs.h: Use new path to gnulib. * Makefile.in (GNULIB_BUILDDIR): Now ../gnulib. (GNULIB_H): Remove. (INCGNU): Look in new gnulib location. (HFILES_NO_SRCDIR): Remove gnulib files. (SUBDIR, REQUIRED_SUBDIRS): Remove gnulib. (generated_files): Remove GNULIB_H. ($(LIBGNU), all-lib): Remove targets. (distclean): Don't mention GNULIB_BUILDDIR. ($(GNULIB_BUILDDIR)/Makefile): Remove target. gdb/gdbserver/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * configure.ac: Use new path to gnulib. * configure: Rebuild. * Makefile.in (INCGNU, $(GNULIB_BUILDDIR)/Makefile): Use new path to gnulib. gnulib/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * update-gnulib.sh: Adjust paths. * Makefile.in: Adjust paths. * configure.ac: Adjust paths. Use ACX_LARGEFILE. * configure: Rebuild.
2019-05-06 01:35:20 +02:00
2019-06-14 Tom Tromey <tom@tromey.com>
* configure.ac: Use new path to gnulib.
* configure: Rebuild.
* Makefile.in (INCGNU, $(GNULIB_BUILDDIR)/Makefile): Use new path
to gnulib.
2019-06-11 Tom Tromey <tom@tromey.com>
* Makefile.in (SFILES): Add alloc.c.
(OBS): Add alloc.o.
(IPA_OBJS): Add alloc-ipa.o.
(alloc-ipa.o): New target.
(%.o: ../%.c): New pattern rule.
Remove newlines from warnings ARI pointed out that a recent patch introduced a call to "warning" with a string that ended in a newline: https://sourceware.org/ml/gdb-patches/2019-06/msg00000.html This is generally forbidden, I believe, because warning adds its own newline. This patch removes all of the trailing newlines I was able to find. I searched for 'warning (.*\\n"' and then fixed the ones where the newline appeared at the end of the string (some had internal newlines). Tested on x86-64 Fedora 29. gdb/ChangeLog 2019-06-10 Tom Tromey <tromey@adacore.com> * m32c-tdep.c (m32c_m16c_address_to_pointer): Don't end warning with a newline. * guile/guile.c (handle_boot_error): Don't end warning with a newline. * cli/cli-cmds.c (exit_status_set_internal_vars): Don't end warning with a newline. * s12z-tdep.c (s12z_skip_prologue): Don't end warning with a newline. (s12z_frame_cache): Likewise. * dwarf-index-cache.c (index_cache::store): Don't end warning with a newline. * solib-svr4.c (disable_probes_interface): Don't end warning with a newline. * nat/fork-inferior.c (fork_inferior): Don't end warning with a newline. * python/python.c (do_finish_initialization): Don't end warning with a newline. gdb/gdbserver/ChangeLog 2019-06-10 Tom Tromey <tromey@adacore.com> * remote-utils.c (look_up_one_symbol, relocate_instruction): Don't end warning with a newline. * linux-s390-low.c (s390_get_wordsize): Don't end warning with a newline. * thread-db.c (attach_thread): Don't end warning with a newline. (thread_db_notice_clone): Likewise. * tracepoint.c (gdb_agent_helper_thread): Don't end warning with a newline. * linux-x86-low.c (x86_get_min_fast_tracepoint_insn_len): Don't end warning with a newline.
2019-06-03 16:07:29 +02:00
2019-06-10 Tom Tromey <tromey@adacore.com>
* remote-utils.c (look_up_one_symbol, relocate_instruction): Don't
end warning with a newline.
* linux-s390-low.c (s390_get_wordsize): Don't end warning with a
newline.
* thread-db.c (attach_thread): Don't end warning with a newline.
(thread_db_notice_clone): Likewise.
* tracepoint.c (gdb_agent_helper_thread): Don't end warning with a
newline.
* linux-x86-low.c (x86_get_min_fast_tracepoint_insn_len): Don't
end warning with a newline.
Introduce and use make_unique_xstrdup Adds an utility function to make it shorter to write the common case of wrapping an xstrdup with a unique_xmalloc_ptr, and uses it throughout. Note: I tried to put this in common/common-utils.h near skip_spaces, etc. but that is included in common/common-defs.h before common/gdb_unique_ptr.h is included, so it would fail to compile because gdb::unique_xmalloc_ptr isn't defined at that point yet. I tried moving the gdb_unique_ptr.h inclusion before common-utils.h, but that doesn't work because gdb_unique_ptr.h depends on common-utils.h for xfree. gdb/ChangeLog: 2019-06-04 Pedro Alves <palves@redhat.com> * common/gdb_unique_ptr.h (make_unique_xstrdup): New. * ada-lang.c (catch_ada_completer): Use make_unique_xstrdup. * breakpoint.c (condition_completer): Likewise. * cli/cli-dump.c (scan_expression): Likewise. * common/filestuff.c (mkdir_recursive): Likewise. * common/gdb_tilde_expand.c (gdb_tilde_expand_up) * common/pathstuff.c (gdb_realpath, gdb_realpath_keepfile) (gdb_abspath): Likewise. * compile/compile-cplus-types.c (compile_cplus_instance::decl_name): Likewise. * completer.c (complete_explicit_location): (signal_completer, reg_or_group_completer_1): Likewise. * cp-support.c (cp_remove_params_if_any): Likewise. * fbsd-tdep.c (fbsd_core_vnode_path): Likewise. * guile/scm-safe-call.c (gdbscm_safe_eval_string): Likewise. * infcmd.c (strip_bg_char): Likewise. * linespec.c (copy_token_string): Likewise. * mi/mi-main.c (output_cores): Likewise. * psymtab.c (psymtab_search_name): * symfile.c (test_set_ext_lang_command): Likewise. * target.c (target_fileio_read_stralloc): Likewise. * tui/tui-regs.c (tui_reggroup_completer): Likewise. * value.c (complete_internalvar): Likewise. gdb/gdbserver/ChangeLog: 2019-06-04 Pedro Alves <palves@redhat.com> * server.c (captured_main): Use make_unique_xstrdup.
2019-06-04 23:40:54 +02:00
2019-06-04 Pedro Alves <palves@redhat.com>
* server.c (captured_main): Use make_unique_xstrdup.
2019-06-02 Tom Tromey <tom@tromey.com>
* gdbreplay.c (fromhex): Remove.
* Makefile.in (GDBREPLAY_OBS): Add rsp-low.o.
2019-05-29 Tom Tromey <tromey@adacore.com>
* configure: Rebuild.
Fix regression caused by recently added syscall restart code This line of code... *(int64_t *) ptr = *(int32_t *) ptr; ...in linux-x86-low.c is not needed (and does not work correctly) within a 32-bit executable. I added an __x86_64__ ifdef (which is used extensively elsewhere in the file for like purposes) to prevent this code from being included in 32-bit builds. It fixes the following regressions when running on native i686-pc-linux-gnu: FAIL: gdb.server/abspath.exp: continue to main FAIL: gdb.server/connect-without-multi-process.exp: multiprocess=auto: continue to main FAIL: gdb.server/connect-without-multi-process.exp: multiprocess=off: continue to main FAIL: gdb.server/ext-restart.exp: restart: run to main FAIL: gdb.server/ext-restart.exp: run to main FAIL: gdb.server/ext-run.exp: continue to main FAIL: gdb.server/ext-wrapper.exp: print d FAIL: gdb.server/ext-wrapper.exp: restart: print d FAIL: gdb.server/ext-wrapper.exp: restart: run to marker FAIL: gdb.server/ext-wrapper.exp: run to marker FAIL: gdb.server/no-thread-db.exp: continue to breakpoint: after tls assignment FAIL: gdb.server/reconnect-ctrl-c.exp: first: stop with control-c FAIL: gdb.server/reconnect-ctrl-c.exp: second: stop with control-c FAIL: gdb.server/run-without-local-binary.exp: run test program until the end FAIL: gdb.server/server-kill.exp: continue to breakpoint: after server_pid assignment FAIL: gdb.server/server-kill.exp: tstatus FAIL: gdb.server/server-run.exp: continue to main gdb/gdbserver/ChangeLog: * linux-x86-low.c (x86_fill_gregset): Don't compile 64-bit sign extension code on 32-bit builds.
2019-05-06 19:28:44 +02:00
2019-05-06 Kevin Buettner <kevinb@redhat.com>
* linux-x86-low.c (x86_fill_gregset): Don't compile 64-bit
sign extension code on 32-bit builds.
2019-05-03 Eli Zaretskii <eliz@gnu.org>
* remote-utils.c:
* gdbreplay.c [USE_WIN32API]: Remove the _WIN32_WINNT override.
2019-04-19 Tom Tromey <tom@tromey.com>
* server.c (struct vstop_notif): Derive from notif_event.
<base>: Remove.
(queue_stop_reply): Update.
(remove_all_on_match_ptid): Change type. Rewrite.
(discard_queued_stop_replies): Rewrite.
(in_queued_stop_replies_ptid): Change type.
(in_queued_stop_replies): Rewrite.
(notif_stop): Update.
(queue_stop_reply_callback): Update.
(captured_main): Don't call initialize_notif.
(push_stop_notification): Update.
* notif.c (notif_write_event, handle_notif_ack)
(notif_event_enque, notif_push): Update.
(notif_event_xfree, initialize_notif): Remove.
* notif.h (struct notif_event): Include <list>, not
"common/queue.h".
(struct notif_server) <queue>: Now a std::list.
(notif_event_p): Remove typedef.
(initialize_notif): Don't declare.
(struct notif_event): Add virtual destructor.
2019-04-17 Alan Hayward <alan.hayward@arm.com>
* ax.c (ax_vdebug): Call debug_printf.
* debug.c (debug_write): New function.
* debug.h (debug_write): New declaration.
* linux-low.c (sigchld_handler): Call debug_write.
2019-04-17 Alan Hayward <alan.hayward@arm.com>
* debug.c (debug_set_output): New function.
(debug_vprintf): Send output to debug_file.
(debug_flush): Likewise.
* debug.h (debug_set_output): New declaration.
* server.c (handle_monitor_command): Add debug-file option.
(captured_main): Likewise.
2019-04-17 Alan Hayward <alan.hayward@arm.com>
* debug.c (remote_debug): Add definition.
* debug.h (remote_debug): Add declaration.
* hostio.c (remote_debug): Remove declaration.
* remote-utils.c (struct ui_file): Likewise.
(remote_debug): Likewise.
* remote-utils.h (remote_debug): Likewise,
* server.c (remote_debug): Remove definition.
Fix amd64->i386 linux syscall restart problem This commit fixes some failures in gdb.base/interrupt.exp when debugging a 32-bit i386 linux inferior from an amd64 host. When running the following test... make check RUNTESTFLAGS="--target_board unix/-m32 interrupt.exp" ... without this commit, I see the following output: FAIL: gdb.base/interrupt.exp: continue (the program exited) FAIL: gdb.base/interrupt.exp: echo data FAIL: gdb.base/interrupt.exp: Send Control-C, second time FAIL: gdb.base/interrupt.exp: signal SIGINT (the program is no longer running) ERROR: Undefined command "". ERROR: GDB process no longer exists === gdb Summary === When the test is run with this commit in place, we see 12 passes instead. This is the desired behavior. Analysis: On Linux, when a syscall is interrupted by a signal, the syscall may return -ERESTARTSYS when a signal occurs. Doing so indicates that the syscall is restartable. Then, depending on settings associated with the signal handler, and after the signal handler is called, the kernel can then either return -EINTR or can cause the syscall to be restarted. In this discussion, we are concerned with the latter case. On i386, the kernel returns this status via the EAX register. When debugging a 32-bit (i386) process from a 64-bit (amd64) GDB, the debugger fetches 64-bit registers even though the process being debugged is 32-bit. Since we're debugging a 32-bit target, only 32 bits are being saved in the register cache. Now, ideally, GDB would save all 64-bits in the regcache and then would be able to restore those same values when it comes time to continue the target. I've looked into doing this, but it's not easy and I don't see many benefits to doing so. One benefit, however, would be that EAX would appear as a negative value for doing syscall restarts. At the moment, GDB is setting the high 32 bits of RAX (and other registers too) to 0. So, when GDB restores EAX just prior to a syscall restart, the high 32 bits of RAX are zeroed, thus making it look like a positive value. For this particular purpose, we need to sign extend EAX so that RAX will appear as a negative value when EAX is set to -ERESTARTSYS. This in turn will cause the signal handling code in the kernel to recognize -ERESTARTSYS which will in turn cause the syscall to be restarted. This commit is based on work by Jan Kratochvil from 2009: https://sourceware.org/ml/gdb-patches/2009-11/msg00592.html Jan's patch had the sign extension code in amd64-nat.c. Several other native targets make use of this code, so it seemed better to move the sign extension code to a linux specific file. I also added similar code to gdbserver. Another approach is to fix the problem in the kernel. Hui Zhu tried to get a fix into the kernel back in 2014, but it was not accepted. Discussion regarding this approach may be found here: https://lore.kernel.org/patchwork/patch/457841/ Even if a fix were to be put into the kernel, we'd still need some kind of fix in GDB in order to support older kernels. Finally, I'll note that Fedora has been carrying a similar patch for at least nine years. Other distributions, including RHEL and CentOS have picked up this change and have been using it too. gdb/ChangeLog: * amd64-linux-nat.c (amd64_linux_collect_native_gregset): New function. (fill_gregset): Call amd64_linux_collect_native_gregset instead of amd64_collect_native_gregset. (amd64_linux_nat_target::store_registers): Likewise. gdb/gdbserver/ChangeLog: * linux-x86-low.c (x86_fill_gregset): Sign extend EAX value when using a 64-bit gdbserver.
2019-03-16 20:40:01 +01:00
2019-04-10 Kevin Buettner <kevinb@redhat.com>
* linux-x86-low.c (x86_fill_gregset): Sign extend EAX value
when using a 64-bit gdbserver.
2019-04-09 Tom Tromey <tromey@adacore.com>
* linux-low.c (select_event_lwp): Use find_thread_in_random.
Replace throw_exception with throw in some cases This replaces throw_exception with "throw;" when possible. This was written by script. The rule that is followed is that uses of the form: catch (... &name) { ... throw_exception (name); } ... can be rewritten. This should always be safe, because exceptions are caught by const reference, and therefore can't be modified in the body of the catch. gdb/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * valops.c (value_rtti_indirect_type): Replace throw_exception with throw. * tracefile-tfile.c (tfile_target_open): Replace throw_exception with throw. * thread.c (thr_try_catch_cmd): Replace throw_exception with throw. * target.c (target_translate_tls_address): Replace throw_exception with throw. * stack.c (frame_apply_command_count): Replace throw_exception with throw. * solib-spu.c (append_ocl_sos): Replace throw_exception with throw. * s390-tdep.c (s390_frame_unwind_cache): Replace throw_exception with throw. * rs6000-tdep.c (rs6000_frame_cache) (rs6000_epilogue_frame_cache): Replace throw_exception with throw. * remote.c: Replace throw_exception with throw. * record-full.c (record_full_message, record_full_wait_1) (record_full_restore): Replace throw_exception with throw. * record-btrace.c: (get_thread_current_frame_id, record_btrace_start_replaying) (cmd_record_btrace_bts_start, cmd_record_btrace_pt_start) (cmd_record_btrace_start): Replace throw_exception with throw. * parse.c (parse_exp_in_context_1): Replace throw_exception with throw. * linux-nat.c (detach_one_lwp, linux_resume_one_lwp) (resume_stopped_resumed_lwps): Replace throw_exception with throw. * linespec.c: (find_linespec_symbols): Replace throw_exception with throw. * infrun.c (displaced_step_prepare, resume): Replace throw_exception with throw. * infcmd.c (post_create_inferior): Replace throw_exception with throw. * inf-loop.c (inferior_event_handler): Replace throw_exception with throw. * i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache) (i386_sigtramp_frame_cache): Replace throw_exception with throw. * frame.c (frame_unwind_pc, get_prev_frame_if_no_cycle) (get_prev_frame_always, get_frame_pc_if_available) (get_frame_address_in_block_if_available, get_frame_language): Replace throw_exception with throw. * frame-unwind.c (frame_unwind_try_unwinder): Replace throw_exception with throw. * eval.c (fetch_subexp_value, evaluate_var_value) (evaluate_funcall, evaluate_subexp_standard): Replace throw_exception with throw. * dwarf2loc.c (call_site_find_chain) (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval): Replace throw_exception with throw. * dwarf2-frame.c (dwarf2_frame_cache): Replace throw_exception with throw. * darwin-nat.c (darwin_attach_pid): Replace throw_exception with throw. * cp-abi.c (baseclass_offset): Replace throw_exception with throw. * completer.c (complete_line_internal): Replace throw_exception with throw. * compile/compile-object-run.c (compile_object_run): Replace throw_exception with throw. * cli/cli-script.c (process_next_line): Replace throw_exception with throw. * btrace.c (btrace_compute_ftrace_pt, btrace_compute_ftrace) (btrace_enable, btrace_maint_update_pt_packets): Replace throw_exception with throw. * breakpoint.c (create_breakpoint, save_breakpoints): Replace throw_exception with throw. * break-catch-throw.c (re_set_exception_catchpoint): Replace throw_exception with throw. * amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache) (amd64_epilogue_frame_cache): Replace throw_exception with throw. * aarch64-tdep.c (aarch64_make_prologue_cache) (aarch64_make_stub_cache): Replace throw_exception with throw. gdb/gdbserver/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * linux-low.c (linux_detach_one_lwp): Replace throw_exception with throw. (linux_resume_one_lwp): Likewise.
2019-01-28 18:45:45 +01:00
2019-04-08 Tom Tromey <tom@tromey.com>
* linux-low.c (linux_detach_one_lwp): Replace throw_exception with
throw.
(linux_resume_one_lwp): Likewise.
Rename gdb exception types This renames the gdb exception types. The old types were only needed due to the macros in common-exception.h that are now gone. The intermediate layer of gdb_exception_RETURN_MASK_ALL did not seem needed, so this patch removes it entirely. gdb/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * common/common-exceptions.h (gdb_exception_RETURN_MASK_ALL): Remove. (gdb_exception_error): Rename from gdb_exception_RETURN_MASK_ERROR. (gdb_exception_quit): Rename from gdb_exception_RETURN_MASK_QUIT. (gdb_quit_bad_alloc): Update. * aarch64-tdep.c: Update. * ada-lang.c: Update. * ada-typeprint.c: Update. * ada-valprint.c: Update. * amd64-tdep.c: Update. * arch-utils.c: Update. * break-catch-throw.c: Update. * breakpoint.c: Update. * btrace.c: Update. * c-varobj.c: Update. * cli/cli-cmds.c: Update. * cli/cli-interp.c: Update. * cli/cli-script.c: Update. * common/common-exceptions.c: Update. * common/new-op.c: Update. * common/selftest.c: Update. * compile/compile-c-symbols.c: Update. * compile/compile-cplus-symbols.c: Update. * compile/compile-object-load.c: Update. * compile/compile-object-run.c: Update. * completer.c: Update. * corelow.c: Update. * cp-abi.c: Update. * cp-support.c: Update. * cp-valprint.c: Update. * darwin-nat.c: Update. * disasm-selftests.c: Update. * dtrace-probe.c: Update. * dwarf-index-cache.c: Update. * dwarf-index-write.c: Update. * dwarf2-frame-tailcall.c: Update. * dwarf2-frame.c: Update. * dwarf2loc.c: Update. * dwarf2read.c: Update. * eval.c: Update. * event-loop.c: Update. * event-top.c: Update. * exec.c: Update. * f-valprint.c: Update. * fbsd-tdep.c: Update. * frame-unwind.c: Update. * frame.c: Update. * gdbtypes.c: Update. * gnu-v3-abi.c: Update. * guile/guile-internal.h: Update. * guile/scm-block.c: Update. * guile/scm-breakpoint.c: Update. * guile/scm-cmd.c: Update. * guile/scm-disasm.c: Update. * guile/scm-frame.c: Update. * guile/scm-lazy-string.c: Update. * guile/scm-math.c: Update. * guile/scm-param.c: Update. * guile/scm-ports.c: Update. * guile/scm-pretty-print.c: Update. * guile/scm-symbol.c: Update. * guile/scm-symtab.c: Update. * guile/scm-type.c: Update. * guile/scm-value.c: Update. * i386-linux-tdep.c: Update. * i386-tdep.c: Update. * inf-loop.c: Update. * infcall.c: Update. * infcmd.c: Update. * infrun.c: Update. * jit.c: Update. * language.c: Update. * linespec.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-tdep.c: Update. * linux-thread-db.c: Update. * main.c: Update. * mi/mi-cmd-break.c: Update. * mi/mi-cmd-stack.c: Update. * mi/mi-interp.c: Update. * mi/mi-main.c: Update. * objc-lang.c: Update. * p-valprint.c: Update. * parse.c: Update. * ppc-linux-tdep.c: Update. * printcmd.c: Update. * python/py-arch.c: Update. * python/py-breakpoint.c: Update. * python/py-cmd.c: Update. * python/py-finishbreakpoint.c: Update. * python/py-frame.c: Update. * python/py-framefilter.c: Update. * python/py-gdb-readline.c: Update. * python/py-inferior.c: Update. * python/py-infthread.c: Update. * python/py-lazy-string.c: Update. * python/py-linetable.c: Update. * python/py-objfile.c: Update. * python/py-param.c: Update. * python/py-prettyprint.c: Update. * python/py-progspace.c: Update. * python/py-record-btrace.c: Update. * python/py-record.c: Update. * python/py-symbol.c: Update. * python/py-type.c: Update. * python/py-unwind.c: Update. * python/py-utils.c: Update. * python/py-value.c: Update. * python/python.c: Update. * record-btrace.c: Update. * record-full.c: Update. * remote-fileio.c: Update. * remote.c: Update. * riscv-tdep.c: Update. * rs6000-aix-tdep.c: Update. * rs6000-tdep.c: Update. * rust-exp.y: Update. * rust-lang.c: Update. * s390-tdep.c: Update. * selftest-arch.c: Update. * solib-dsbt.c: Update. * solib-frv.c: Update. * solib-spu.c: Update. * solib-svr4.c: Update. * solib.c: Update. * sparc64-linux-tdep.c: Update. * stack.c: Update. * symfile-mem.c: Update. * symmisc.c: Update. * target.c: Update. * thread.c: Update. * top.c: Update. * tracefile-tfile.c: Update. * tui/tui.c: Update. * typeprint.c: Update. * unittests/cli-utils-selftests.c: Update. * unittests/parse-connection-spec-selftests.c: Update. * valops.c: Update. * valprint.c: Update. * value.c: Update. * varobj.c: Update. * windows-nat.c: Update. * x86-linux-nat.c: Update. * xml-support.c: Update. gdb/gdbserver/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * gdbreplay.c: Update. * linux-low.c: Update. * server.c: Update.
2019-04-03 23:59:07 +02:00
2019-04-08 Tom Tromey <tom@tromey.com>
* gdbreplay.c: Update.
* linux-low.c: Update.
* server.c: Update.
Rewrite TRY/CATCH This rewrites gdb's TRY/CATCH to plain C++ try/catch. The patch was largely written by script, though one change (to a comment in common-exceptions.h) was reverted by hand. gdb/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * xml-support.c: Use C++ exception handling. * x86-linux-nat.c: Use C++ exception handling. * windows-nat.c: Use C++ exception handling. * varobj.c: Use C++ exception handling. * value.c: Use C++ exception handling. * valprint.c: Use C++ exception handling. * valops.c: Use C++ exception handling. * unittests/parse-connection-spec-selftests.c: Use C++ exception handling. * unittests/cli-utils-selftests.c: Use C++ exception handling. * typeprint.c: Use C++ exception handling. * tui/tui.c: Use C++ exception handling. * tracefile-tfile.c: Use C++ exception handling. * top.c: Use C++ exception handling. * thread.c: Use C++ exception handling. * target.c: Use C++ exception handling. * symmisc.c: Use C++ exception handling. * symfile-mem.c: Use C++ exception handling. * stack.c: Use C++ exception handling. * sparc64-linux-tdep.c: Use C++ exception handling. * solib.c: Use C++ exception handling. * solib-svr4.c: Use C++ exception handling. * solib-spu.c: Use C++ exception handling. * solib-frv.c: Use C++ exception handling. * solib-dsbt.c: Use C++ exception handling. * selftest-arch.c: Use C++ exception handling. * s390-tdep.c: Use C++ exception handling. * rust-lang.c: Use C++ exception handling. * rust-exp.y: Use C++ exception handling. * rs6000-tdep.c: Use C++ exception handling. * rs6000-aix-tdep.c: Use C++ exception handling. * riscv-tdep.c: Use C++ exception handling. * remote.c: Use C++ exception handling. * remote-fileio.c: Use C++ exception handling. * record-full.c: Use C++ exception handling. * record-btrace.c: Use C++ exception handling. * python/python.c: Use C++ exception handling. * python/py-value.c: Use C++ exception handling. * python/py-utils.c: Use C++ exception handling. * python/py-unwind.c: Use C++ exception handling. * python/py-type.c: Use C++ exception handling. * python/py-symbol.c: Use C++ exception handling. * python/py-record.c: Use C++ exception handling. * python/py-record-btrace.c: Use C++ exception handling. * python/py-progspace.c: Use C++ exception handling. * python/py-prettyprint.c: Use C++ exception handling. * python/py-param.c: Use C++ exception handling. * python/py-objfile.c: Use C++ exception handling. * python/py-linetable.c: Use C++ exception handling. * python/py-lazy-string.c: Use C++ exception handling. * python/py-infthread.c: Use C++ exception handling. * python/py-inferior.c: Use C++ exception handling. * python/py-gdb-readline.c: Use C++ exception handling. * python/py-framefilter.c: Use C++ exception handling. * python/py-frame.c: Use C++ exception handling. * python/py-finishbreakpoint.c: Use C++ exception handling. * python/py-cmd.c: Use C++ exception handling. * python/py-breakpoint.c: Use C++ exception handling. * python/py-arch.c: Use C++ exception handling. * printcmd.c: Use C++ exception handling. * ppc-linux-tdep.c: Use C++ exception handling. * parse.c: Use C++ exception handling. * p-valprint.c: Use C++ exception handling. * objc-lang.c: Use C++ exception handling. * mi/mi-main.c: Use C++ exception handling. * mi/mi-interp.c: Use C++ exception handling. * mi/mi-cmd-stack.c: Use C++ exception handling. * mi/mi-cmd-break.c: Use C++ exception handling. * main.c: Use C++ exception handling. * linux-thread-db.c: Use C++ exception handling. * linux-tdep.c: Use C++ exception handling. * linux-nat.c: Use C++ exception handling. * linux-fork.c: Use C++ exception handling. * linespec.c: Use C++ exception handling. * language.c: Use C++ exception handling. * jit.c: Use C++ exception handling. * infrun.c: Use C++ exception handling. * infcmd.c: Use C++ exception handling. * infcall.c: Use C++ exception handling. * inf-loop.c: Use C++ exception handling. * i386-tdep.c: Use C++ exception handling. * i386-linux-tdep.c: Use C++ exception handling. * guile/scm-value.c: Use C++ exception handling. * guile/scm-type.c: Use C++ exception handling. * guile/scm-symtab.c: Use C++ exception handling. * guile/scm-symbol.c: Use C++ exception handling. * guile/scm-pretty-print.c: Use C++ exception handling. * guile/scm-ports.c: Use C++ exception handling. * guile/scm-param.c: Use C++ exception handling. * guile/scm-math.c: Use C++ exception handling. * guile/scm-lazy-string.c: Use C++ exception handling. * guile/scm-frame.c: Use C++ exception handling. * guile/scm-disasm.c: Use C++ exception handling. * guile/scm-cmd.c: Use C++ exception handling. * guile/scm-breakpoint.c: Use C++ exception handling. * guile/scm-block.c: Use C++ exception handling. * guile/guile-internal.h: Use C++ exception handling. * gnu-v3-abi.c: Use C++ exception handling. * gdbtypes.c: Use C++ exception handling. * frame.c: Use C++ exception handling. * frame-unwind.c: Use C++ exception handling. * fbsd-tdep.c: Use C++ exception handling. * f-valprint.c: Use C++ exception handling. * exec.c: Use C++ exception handling. * event-top.c: Use C++ exception handling. * event-loop.c: Use C++ exception handling. * eval.c: Use C++ exception handling. * dwarf2read.c: Use C++ exception handling. * dwarf2loc.c: Use C++ exception handling. * dwarf2-frame.c: Use C++ exception handling. * dwarf2-frame-tailcall.c: Use C++ exception handling. * dwarf-index-write.c: Use C++ exception handling. * dwarf-index-cache.c: Use C++ exception handling. * dtrace-probe.c: Use C++ exception handling. * disasm-selftests.c: Use C++ exception handling. * darwin-nat.c: Use C++ exception handling. * cp-valprint.c: Use C++ exception handling. * cp-support.c: Use C++ exception handling. * cp-abi.c: Use C++ exception handling. * corelow.c: Use C++ exception handling. * completer.c: Use C++ exception handling. * compile/compile-object-run.c: Use C++ exception handling. * compile/compile-object-load.c: Use C++ exception handling. * compile/compile-cplus-symbols.c: Use C++ exception handling. * compile/compile-c-symbols.c: Use C++ exception handling. * common/selftest.c: Use C++ exception handling. * common/new-op.c: Use C++ exception handling. * cli/cli-script.c: Use C++ exception handling. * cli/cli-interp.c: Use C++ exception handling. * cli/cli-cmds.c: Use C++ exception handling. * c-varobj.c: Use C++ exception handling. * btrace.c: Use C++ exception handling. * breakpoint.c: Use C++ exception handling. * break-catch-throw.c: Use C++ exception handling. * arch-utils.c: Use C++ exception handling. * amd64-tdep.c: Use C++ exception handling. * ada-valprint.c: Use C++ exception handling. * ada-typeprint.c: Use C++ exception handling. * ada-lang.c: Use C++ exception handling. * aarch64-tdep.c: Use C++ exception handling. gdb/gdbserver/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * server.c: Use C++ exception handling. * linux-low.c: Use C++ exception handling. * gdbreplay.c: Use C++ exception handling.
2019-04-04 00:02:42 +02:00
2019-04-08 Tom Tromey <tom@tromey.com>
* server.c: Use C++ exception handling.
* linux-low.c: Use C++ exception handling.
* gdbreplay.c: Use C++ exception handling.
Make exceptions use std::string and be self-managing This changes the exception's "message" member to be a shared_ptr wrapping a std::string. This allows removing the stack of exception messages, because now exceptions will self-destruct when needed. This also adds a noexcept copy constructor and operator= to gdb_exception, plus a "what" method. gdb/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * xml-support.c (gdb_xml_parser::parse): Update. * x86-linux-nat.c (x86_linux_nat_target::enable_btrace): Update. * value.c (show_convenience): Update. * unittests/cli-utils-selftests.c (test_number_or_range_parser) (test_parse_flags_qcs): Update. * thread.c (thr_try_catch_cmd): Update. * target.c (target_translate_tls_address): Update. * stack.c (print_frame_arg, read_frame_local, read_frame_arg) (info_frame_command_core, frame_apply_command_count): Update. * rust-exp.y (rust_lex_exception_test): Update. * riscv-tdep.c (riscv_print_one_register_info): Update. * remote.c (remote_target::enable_btrace): Update. * record-btrace.c (record_btrace_enable_warn): Update. * python/py-utils.c (gdbpy_convert_exception): Update. * printcmd.c (do_one_display, print_variable_and_value): Update. * mi/mi-main.c (mi_print_exception): Update. * mi/mi-interp.c (mi_cmd_interpreter_exec): Use SCOPE_EXIT. * mi/mi-cmd-stack.c (list_arg_or_local): Update. * linux-nat.c (linux_nat_target::attach): Update. * linux-fork.c (class scoped_switch_fork_info): Update. * infrun.c (displaced_step_prepare): Update. * infcall.c (call_function_by_hand_dummy): Update. * guile/scm-exception.c (gdbscm_scm_from_gdb_exception): Update. * gnu-v3-abi.c (print_one_vtable): Update. * frame.c (get_prev_frame_always): Update. * f-valprint.c (info_common_command_for_block): Update. * exec.c (try_open_exec_file): Update. * exceptions.c (print_exception, exception_print) (exception_fprintf, exception_print_same): Update. * dwarf2-frame.c (dwarf2_build_frame_info): Update. * dwarf-index-cache.c (index_cache::store) (index_cache::lookup_gdb_index): Update. * darwin-nat.c (maybe_cache_shell): Update. * cp-valprint.c (cp_print_value_fields): Update. * compile/compile-cplus-symbols.c (gcc_cplus_convert_symbol) (gcc_cplus_symbol_address): Update. * compile/compile-c-symbols.c (gcc_convert_symbol) (gcc_symbol_address, generate_c_for_for_one_variable): Update. * common/selftest.c: Update. * common/common-exceptions.h (struct gdb_exception) <message>: Now a std::string. (exception_try_scope_entry, exception_try_scope_exit): Don't declare. (struct exception_try_scope): Remove. (TRY): Don't use exception_try_scope. (struct gdb_exception): Add constructor, operator=. <what>: New method. (struct gdb_exception_RETURN_MASK_ALL) (struct gdb_exception_RETURN_MASK_ERROR) (struct gdb_exception_RETURN_MASK_QUIT): Add constructor. (struct gdb_quit_bad_alloc): Update. * common/common-exceptions.c (exception_none): Change initializer. (struct catcher) <state, exception>: Initialize inline. <prev>: Remove member. (current_catcher): Remove. (catchers): New global. (exceptions_state_mc_init): Simplify. (catcher_pop): Remove. (exceptions_state_mc, exceptions_state_mc_catch): Update. (try_scope_depth, exception_try_scope_entry) (exception_try_scope_exit): Remove. (throw_exception_sjlj): Update. (exception_messages, exception_messages_size): Remove. (throw_it): Simplify. (gdb_exception_sliced_copy): Remove. (throw_exception_cxx): Update. * cli/cli-script.c (script_from_file): Update. * breakpoint.c (insert_bp_location, update_breakpoint_locations): Update. * ada-valprint.c (ada_val_print): Update. * ada-lang.c (ada_to_fixed_type_1, ada_exception_name_addr) (create_excep_cond_exprs): Update. gdb/gdbserver/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * server.c (handle_btrace_general_set, handle_qxfer_btrace) (handle_qxfer_btrace_conf, detach_or_kill_for_exit_cleanup) (captured_main, main): Update. * gdbreplay.c (main): Update.
2019-01-28 18:11:10 +01:00
2019-04-08 Tom Tromey <tom@tromey.com>
* server.c (handle_btrace_general_set, handle_qxfer_btrace)
(handle_qxfer_btrace_conf, detach_or_kill_for_exit_cleanup)
(captured_main, main): Update.
* gdbreplay.c (main): Update.
2019-04-05 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* linux-low.c (linux_get_auxv): Remove static. Return auxv entry
value in argument pointer, return 1 if the entry is found and 0
otherwise. Move comment.
(linux_get_hwcap, linux_get_hwcap2): Use modified linux_get_auxv.
* linux-low.h (linux_get_auxv): Declare.
* linux-ppc-low.c (is_elfv2_inferior): Use linux_get_auxv.
2019-04-05 Tom Tromey <tromey@adacore.com>
* server.c (gdbserver_usage): Use upper-case for metasyntactic
variables.
2019-03-28 Alan Hayward <alan.hayward@arm.com>
* linux-low.c (AT_HWCAP2): Add define if not already included.
2019-03-26 Alan Hayward <alan.hayward@arm.com>
* linux-aarch64-low.c (aarch64_get_hwcap): Remove function.
(aarch64_arch_setup): Call linux_get_hwcap.
* linux-arm-low.c (arm_get_hwcap): Remove function.
(arm_read_description): Call linux_get_hwcap.
* linux-low.c (linux_get_auxv): New function.
(linux_get_hwcap): Likewise.
(linux_get_hwcap2): Likewise.
* linux-low.h (linux_get_hwcap): New declaration.
(linux_get_hwcap2): Likewise.
* linux-ppc-low.c (ppc_get_auxv): Remove function.
(ppc_arch_setup): Call linux_get_hwcap.
* linux-s390-low.c (s390_get_hwcap): Remove function.
(s390_arch_setup): Call linux_get_hwcap.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* linux-aarch64-low.c (aarch64_store_pauthregset): New function.
* linux-low.c (regsets_store_inferior_registers): Allow optional reads
to fail.
* linux-low.h (enum regset_type): Add OPTIONAL_REGS.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* linux-aarch64-low.c (AARCH64_HWCAP_PACA): New define.
(aarch64_get_hwcap): New function.
(aarch64_arch_setup): Read APIA hwcap.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* linux-aarch64-ipa.c (get_ipa_tdesc): Add pauth param.
(initialize_low_tracepoint): Likewise.
* linux-aarch64-low.c (aarch64_arch_setup): Likewise.
* linux-aarch64-tdesc-selftest.c (aarch64_tdesc_test): Likewise.
* linux-aarch64-tdesc.c (struct target_desc): Likewise.
(aarch64_linux_read_description): Likewise.
* linux-aarch64-tdesc.h (aarch64_linux_read_description): Likewise.
Support the fs_base and gs_base registers on i386. As on amd64, these registers hold the base address of the fs and gs segments, respectively. For i386 these two registers are 32 bits. gdb/ChangeLog: * amd64-fbsd-nat.c (amd64_fbsd_nat_target::read_description): Update calls to i386_target_description to add 'segments' parameter. * amd64-tdep.c (amd64_init_abi): Set tdep->fsbase_regnum. Don't add segment base registers. * arch/i386.c (i386_create_target_description): Add 'segments' parameter to enable segment base registers. * arch/i386.h (i386_create_target_description): Likewise. * features/i386/32bit-segments.xml: New file. * features/i386/32bit-segments.c: Generate. * i386-fbsd-nat.c (i386_fbsd_nat_target::read_description): Update call to i386_target_description to add 'segments' parameter. * i386-fbsd-tdep.c (i386fbsd_core_read_description): Likewise. * i386-go32-tdep.c (i386_go32_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_read_description): Likewise. * i386-tdep.c (i386_validate_tdesc_p): Add segment base registers if feature is present. (i386_gdbarch_init): Pass I386_NUM_REGS to set_gdbarch_num_regs. Add 'segments' parameter to call to i386_target_description. (i386_target_description): Add 'segments' parameter to enable segment base registers. (_initialize_i386_tdep) [GDB_SELF_TEST]: Add 'segments' parameter to call to i386_target_description. * i386-tdep.h (struct gdbarch_tdep): Add 'fsbase_regnum'. (enum i386_regnum): Add I386_FSBASE_REGNUM and I386_GSBASE_REGNUM. Define I386_NUM_REGS. (i386_target_description): Add 'segments' parameter to enable segment base registers. gdb/gdbserver/ChangeLog: * linux-x86-tdesc.c (i386_linux_read_description): Update call to i386_create_target_description for 'segments' parameter. * lynx-i386-low.c (lynx_i386_arch_setup): Likewise. * nto-x86-low.c (nto_x86_arch_setup): Likewise. * win32-i386-low.c (i386_arch_setup): Likewise.
2019-03-12 21:39:02 +01:00
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* linux-x86-tdesc.c (i386_linux_read_description): Update call to
i386_create_target_description for 'segments' parameter.
* lynx-i386-low.c (lynx_i386_arch_setup): Likewise.
* nto-x86-low.c (nto_x86_arch_setup): Likewise.
* win32-i386-low.c (i386_arch_setup): Likewise.
Change iterate_over_lwps to take a gdb::function_view This changes iterate_over_lwps to use a gdb::function_view. This was needed in order to make null_ptid and minus_one_ptid 'const'. gdb/ChangeLog 2019-03-12 Tom Tromey <tromey@adacore.com> * linux-nat.c (iterate_over_lwps): Update. (stop_callback): Remove parameter. (stop_wait_callback, detach_callback, resume_set_callback) (select_singlestep_lwp_callback, set_ignore_sigint) (status_callback, resumed_callback, resume_clear_callback) (kill_callback, kill_wait_callback, linux_nat_stop_lwp): Remove data parameter. (linux_nat_target::detach, linux_nat_target::resume) (linux_stop_and_wait_all_lwps, select_event_lwp) (linux_nat_filter_event, linux_nat_wait_1) (linux_nat_target::kill, linux_nat_target::stop) (linux_nat_target::stop): Update. (linux_nat_resume_callback): Change type. (resume_stopped_resumed_lwps, count_events_callback) (select_event_lwp_callback): Likewise. (linux_stop_lwp, linux_nat_stop_lwp): Update. * arm-linux-nat.c (struct update_registers_data): Remove. (update_registers_callback): Change type. (arm_linux_insert_hw_breakpoint1): Update. * nat/x86-linux-dregs.c (update_debug_registers_callback): Remove parameter. (x86_linux_dr_set_addr): Update. (x86_linux_dr_set_control): Update. * nat/linux-nat.h (iterate_over_lwps_ftype): Remove parameter. (iterate_over_lwps): Use gdb::function_view. * nat/aarch64-linux-hw-point.c (struct aarch64_dr_update_callback_param): Remove. (debug_reg_change_callback): Change type. (aarch64_notify_debug_reg_change): Update. * s390-linux-nat.c (s390_refresh_per_info): Update. gdb/gdbserver/ChangeLog 2019-03-12 Tom Tromey <tromey@adacore.com> * linux-low.c (iterate_over_lwps): Update.
2019-03-04 20:05:03 +01:00
2019-03-12 Tom Tromey <tromey@adacore.com>
* linux-low.c (iterate_over_lwps): Update.
2019-03-06 Tom Tromey <tom@tromey.com>
* server.c (detach_or_kill_for_exit_cleanup): Remove parameter.
(captured_main): Use SCOPE_EXIT.
2019-03-04 Sergio Durigan Junior <sergiodj@redhat.com>
* configure.srv: Use '$enable_unittest' instead of '$development'
when checking whether to fill 'srv_regobj' on 'aarch64*-*-linux*'
case.
2019-02-27 Tom Tromey <tromey@adacore.com>
* gdbreplay.c (logchar): Handle \r\n.
2019-02-07 Alan Hayward <alan.hayward@arm.com>
* linux-low.c (linux_attach): Add process before lwp.
* server.c (attach_inferior): Check if already attached.
Normalize include guards in gdb While working on my other scripts to deal with gdb headers, I noticed that some files were missing include guards. I wrote a script to add the missing ones, but found that using the obvious names for the guards ran into clashes -- for example, gdb/nat/linux-nat.h used "LINUX_NAT_H", but this was also the script's choice for gdb/linux-nat.h. So, I changed the script to normalize all include guards in gdb. This patch is the result. As usual the script is available here: https://github.com/tromey/gdb-refactoring-scripts Tested by rebuilding; I also ran it through "Fedora-x86_64-m64" on the buildbot. gdb/ChangeLog 2019-02-07 Tom Tromey <tom@tromey.com> * yy-remap.h: Add include guard. * xtensa-tdep.h: Add include guard. * xcoffread.h: Rename include guard. * varobj-iter.h: Add include guard. * tui/tui.h: Rename include guard. * tui/tui-winsource.h: Rename include guard. * tui/tui-wingeneral.h: Rename include guard. * tui/tui-windata.h: Rename include guard. * tui/tui-win.h: Rename include guard. * tui/tui-stack.h: Rename include guard. * tui/tui-source.h: Rename include guard. * tui/tui-regs.h: Rename include guard. * tui/tui-out.h: Rename include guard. * tui/tui-layout.h: Rename include guard. * tui/tui-io.h: Rename include guard. * tui/tui-hooks.h: Rename include guard. * tui/tui-file.h: Rename include guard. * tui/tui-disasm.h: Rename include guard. * tui/tui-data.h: Rename include guard. * tui/tui-command.h: Rename include guard. * tic6x-tdep.h: Add include guard. * target/waitstatus.h: Rename include guard. * target/wait.h: Rename include guard. * target/target.h: Rename include guard. * target/resume.h: Rename include guard. * target-float.h: Rename include guard. * stabsread.h: Add include guard. * rs6000-tdep.h: Add include guard. * riscv-fbsd-tdep.h: Add include guard. * regformats/regdef.h: Rename include guard. * record.h: Rename include guard. * python/python.h: Rename include guard. * python/python-internal.h: Rename include guard. * python/py-stopevent.h: Rename include guard. * python/py-ref.h: Rename include guard. * python/py-record.h: Rename include guard. * python/py-record-full.h: Rename include guard. * python/py-record-btrace.h: Rename include guard. * python/py-instruction.h: Rename include guard. * python/py-events.h: Rename include guard. * python/py-event.h: Rename include guard. * procfs.h: Add include guard. * proc-utils.h: Add include guard. * p-lang.h: Add include guard. * or1k-tdep.h: Rename include guard. * observable.h: Rename include guard. * nto-tdep.h: Rename include guard. * nat/x86-linux.h: Rename include guard. * nat/x86-linux-dregs.h: Rename include guard. * nat/x86-gcc-cpuid.h: Add include guard. * nat/x86-dregs.h: Rename include guard. * nat/x86-cpuid.h: Rename include guard. * nat/ppc-linux.h: Rename include guard. * nat/mips-linux-watch.h: Rename include guard. * nat/linux-waitpid.h: Rename include guard. * nat/linux-ptrace.h: Rename include guard. * nat/linux-procfs.h: Rename include guard. * nat/linux-osdata.h: Rename include guard. * nat/linux-nat.h: Rename include guard. * nat/linux-namespaces.h: Rename include guard. * nat/linux-btrace.h: Rename include guard. * nat/glibc_thread_db.h: Rename include guard. * nat/gdb_thread_db.h: Rename include guard. * nat/gdb_ptrace.h: Rename include guard. * nat/fork-inferior.h: Rename include guard. * nat/amd64-linux-siginfo.h: Rename include guard. * nat/aarch64-sve-linux-sigcontext.h: Rename include guard. * nat/aarch64-sve-linux-ptrace.h: Rename include guard. * nat/aarch64-linux.h: Rename include guard. * nat/aarch64-linux-hw-point.h: Rename include guard. * mn10300-tdep.h: Add include guard. * mips-linux-tdep.h: Add include guard. * mi/mi-parse.h: Rename include guard. * mi/mi-out.h: Rename include guard. * mi/mi-main.h: Rename include guard. * mi/mi-interp.h: Rename include guard. * mi/mi-getopt.h: Rename include guard. * mi/mi-console.h: Rename include guard. * mi/mi-common.h: Rename include guard. * mi/mi-cmds.h: Rename include guard. * mi/mi-cmd-break.h: Rename include guard. * m2-lang.h: Add include guard. * location.h: Rename include guard. * linux-record.h: Rename include guard. * linux-nat.h: Add include guard. * linux-fork.h: Add include guard. * i386-darwin-tdep.h: Rename include guard. * hppa-linux-offsets.h: Add include guard. * guile/guile.h: Rename include guard. * guile/guile-internal.h: Rename include guard. * gnu-nat.h: Rename include guard. * gdb-stabs.h: Rename include guard. * frv-tdep.h: Add include guard. * f-lang.h: Add include guard. * event-loop.h: Add include guard. * darwin-nat.h: Rename include guard. * cp-abi.h: Rename include guard. * config/sparc/nm-sol2.h: Rename include guard. * config/nm-nto.h: Rename include guard. * config/nm-linux.h: Add include guard. * config/i386/nm-i386gnu.h: Rename include guard. * config/djgpp/nl_types.h: Rename include guard. * config/djgpp/langinfo.h: Rename include guard. * compile/gcc-cp-plugin.h: Add include guard. * compile/gcc-c-plugin.h: Add include guard. * compile/compile.h: Rename include guard. * compile/compile-object-run.h: Rename include guard. * compile/compile-object-load.h: Rename include guard. * compile/compile-internal.h: Rename include guard. * compile/compile-cplus.h: Rename include guard. * compile/compile-c.h: Rename include guard. * common/xml-utils.h: Rename include guard. * common/x86-xstate.h: Rename include guard. * common/version.h: Rename include guard. * common/vec.h: Rename include guard. * common/tdesc.h: Rename include guard. * common/selftest.h: Rename include guard. * common/scoped_restore.h: Rename include guard. * common/scoped_mmap.h: Rename include guard. * common/scoped_fd.h: Rename include guard. * common/safe-iterator.h: Rename include guard. * common/run-time-clock.h: Rename include guard. * common/refcounted-object.h: Rename include guard. * common/queue.h: Rename include guard. * common/ptid.h: Rename include guard. * common/print-utils.h: Rename include guard. * common/preprocessor.h: Rename include guard. * common/pathstuff.h: Rename include guard. * common/observable.h: Rename include guard. * common/netstuff.h: Rename include guard. * common/job-control.h: Rename include guard. * common/host-defs.h: Rename include guard. * common/gdb_wait.h: Rename include guard. * common/gdb_vecs.h: Rename include guard. * common/gdb_unlinker.h: Rename include guard. * common/gdb_unique_ptr.h: Rename include guard. * common/gdb_tilde_expand.h: Rename include guard. * common/gdb_sys_time.h: Rename include guard. * common/gdb_string_view.h: Rename include guard. * common/gdb_splay_tree.h: Rename include guard. * common/gdb_setjmp.h: Rename include guard. * common/gdb_ref_ptr.h: Rename include guard. * common/gdb_optional.h: Rename include guard. * common/gdb_locale.h: Rename include guard. * common/gdb_assert.h: Rename include guard. * common/filtered-iterator.h: Rename include guard. * common/filestuff.h: Rename include guard. * common/fileio.h: Rename include guard. * common/environ.h: Rename include guard. * common/common-utils.h: Rename include guard. * common/common-types.h: Rename include guard. * common/common-regcache.h: Rename include guard. * common/common-inferior.h: Rename include guard. * common/common-gdbthread.h: Rename include guard. * common/common-exceptions.h: Rename include guard. * common/common-defs.h: Rename include guard. * common/common-debug.h: Rename include guard. * common/cleanups.h: Rename include guard. * common/buffer.h: Rename include guard. * common/btrace-common.h: Rename include guard. * common/break-common.h: Rename include guard. * cli/cli-utils.h: Rename include guard. * cli/cli-style.h: Rename include guard. * cli/cli-setshow.h: Rename include guard. * cli/cli-script.h: Rename include guard. * cli/cli-interp.h: Rename include guard. * cli/cli-decode.h: Rename include guard. * cli/cli-cmds.h: Rename include guard. * charset-list.h: Add include guard. * buildsym-legacy.h: Rename include guard. * bfin-tdep.h: Add include guard. * ax.h: Rename include guard. * arm-linux-tdep.h: Add include guard. * arm-fbsd-tdep.h: Add include guard. * arch/xtensa.h: Rename include guard. * arch/tic6x.h: Add include guard. * arch/i386.h: Add include guard. * arch/arm.h: Rename include guard. * arch/arm-linux.h: Rename include guard. * arch/arm-get-next-pcs.h: Rename include guard. * arch/amd64.h: Add include guard. * arch/aarch64-insn.h: Rename include guard. * arch-utils.h: Rename include guard. * annotate.h: Add include guard. * amd64-darwin-tdep.h: Rename include guard. * aarch64-linux-tdep.h: Add include guard. * aarch64-fbsd-tdep.h: Add include guard. * aarch32-linux-nat.h: Add include guard. gdb/gdbserver/ChangeLog 2019-02-07 Tom Tromey <tom@tromey.com> * x86-tdesc.h: Rename include guard. * x86-low.h: Add include guard. * wincecompat.h: Rename include guard. * win32-low.h: Add include guard. * utils.h: Rename include guard. * tracepoint.h: Rename include guard. * tdesc.h: Rename include guard. * target.h: Rename include guard. * server.h: Rename include guard. * remote-utils.h: Rename include guard. * regcache.h: Rename include guard. * nto-low.h: Rename include guard. * notif.h: Add include guard. * mem-break.h: Rename include guard. * lynx-low.h: Add include guard. * linux-x86-tdesc.h: Add include guard. * linux-s390-tdesc.h: Add include guard. * linux-ppc-tdesc-init.h: Add include guard. * linux-low.h: Add include guard. * linux-aarch64-tdesc.h: Add include guard. * linux-aarch32-low.h: Add include guard. * inferiors.h: Rename include guard. * i387-fp.h: Rename include guard. * hostio.h: Rename include guard. * gdbthread.h: Rename include guard. * gdb_proc_service.h: Rename include guard. * event-loop.h: Rename include guard. * dll.h: Rename include guard. * debug.h: Rename include guard. * ax.h: Rename include guard.
2019-01-27 20:51:36 +01:00
2019-02-07 Tom Tromey <tom@tromey.com>
* x86-tdesc.h: Rename include guard.
* x86-low.h: Add include guard.
* wincecompat.h: Rename include guard.
* win32-low.h: Add include guard.
* utils.h: Rename include guard.
* tracepoint.h: Rename include guard.
* tdesc.h: Rename include guard.
* target.h: Rename include guard.
* server.h: Rename include guard.
* remote-utils.h: Rename include guard.
* regcache.h: Rename include guard.
* nto-low.h: Rename include guard.
* notif.h: Add include guard.
* mem-break.h: Rename include guard.
* lynx-low.h: Add include guard.
* linux-x86-tdesc.h: Add include guard.
* linux-s390-tdesc.h: Add include guard.
* linux-ppc-tdesc-init.h: Add include guard.
* linux-low.h: Add include guard.
* linux-aarch64-tdesc.h: Add include guard.
* linux-aarch32-low.h: Add include guard.
* inferiors.h: Rename include guard.
* i387-fp.h: Rename include guard.
* hostio.h: Rename include guard.
* gdbthread.h: Rename include guard.
* gdb_proc_service.h: Rename include guard.
* event-loop.h: Rename include guard.
* dll.h: Rename include guard.
* debug.h: Rename include guard.
* ax.h: Rename include guard.
2018-01-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR gdb/23985
* Makefile.in (IPAGENT_CFLAGS): Add UNDO_GNULIB_CFLAGS.
(UNDO_GNULIB_CFLAGS): Undo gnulib replacements.
2019-01-25 Tom Tromey <tom@tromey.com>
* Makefile.in (INCLUDE_CFLAGS): Don't add -I for common.
Normalize includes to use common/ This changes all includes to use the form "common/filename.h" rather than just "filename.h". This was written by a script. gdb/ChangeLog 2019-01-25 Tom Tromey <tom@tromey.com> * xtensa-linux-nat.c: Fix common/ includes. * xml-support.h: Fix common/ includes. * xml-support.c: Fix common/ includes. * x86-linux-nat.c: Fix common/ includes. * windows-nat.c: Fix common/ includes. * varobj.h: Fix common/ includes. * varobj.c: Fix common/ includes. * value.c: Fix common/ includes. * valops.c: Fix common/ includes. * utils.c: Fix common/ includes. * unittests/xml-utils-selftests.c: Fix common/ includes. * unittests/utils-selftests.c: Fix common/ includes. * unittests/unpack-selftests.c: Fix common/ includes. * unittests/tracepoint-selftests.c: Fix common/ includes. * unittests/style-selftests.c: Fix common/ includes. * unittests/string_view-selftests.c: Fix common/ includes. * unittests/scoped_restore-selftests.c: Fix common/ includes. * unittests/scoped_mmap-selftests.c: Fix common/ includes. * unittests/scoped_fd-selftests.c: Fix common/ includes. * unittests/rsp-low-selftests.c: Fix common/ includes. * unittests/parse-connection-spec-selftests.c: Fix common/ includes. * unittests/optional-selftests.c: Fix common/ includes. * unittests/offset-type-selftests.c: Fix common/ includes. * unittests/observable-selftests.c: Fix common/ includes. * unittests/mkdir-recursive-selftests.c: Fix common/ includes. * unittests/memrange-selftests.c: Fix common/ includes. * unittests/memory-map-selftests.c: Fix common/ includes. * unittests/lookup_name_info-selftests.c: Fix common/ includes. * unittests/function-view-selftests.c: Fix common/ includes. * unittests/environ-selftests.c: Fix common/ includes. * unittests/copy_bitwise-selftests.c: Fix common/ includes. * unittests/common-utils-selftests.c: Fix common/ includes. * unittests/cli-utils-selftests.c: Fix common/ includes. * unittests/array-view-selftests.c: Fix common/ includes. * ui-file.c: Fix common/ includes. * tui/tui-io.c: Fix common/ includes. * tracepoint.h: Fix common/ includes. * tracepoint.c: Fix common/ includes. * tracefile-tfile.c: Fix common/ includes. * top.h: Fix common/ includes. * top.c: Fix common/ includes. * thread.c: Fix common/ includes. * target/waitstatus.h: Fix common/ includes. * target/waitstatus.c: Fix common/ includes. * target.h: Fix common/ includes. * target.c: Fix common/ includes. * target-memory.c: Fix common/ includes. * target-descriptions.c: Fix common/ includes. * symtab.h: Fix common/ includes. * symfile.c: Fix common/ includes. * stap-probe.c: Fix common/ includes. * spu-linux-nat.c: Fix common/ includes. * sparc-nat.c: Fix common/ includes. * source.c: Fix common/ includes. * solib.c: Fix common/ includes. * solib-target.c: Fix common/ includes. * ser-unix.c: Fix common/ includes. * ser-tcp.c: Fix common/ includes. * ser-pipe.c: Fix common/ includes. * ser-base.c: Fix common/ includes. * selftest-arch.c: Fix common/ includes. * s12z-tdep.c: Fix common/ includes. * rust-exp.y: Fix common/ includes. * rs6000-aix-tdep.c: Fix common/ includes. * riscv-tdep.c: Fix common/ includes. * remote.c: Fix common/ includes. * remote-notif.h: Fix common/ includes. * remote-fileio.h: Fix common/ includes. * remote-fileio.c: Fix common/ includes. * regcache.h: Fix common/ includes. * regcache.c: Fix common/ includes. * record-btrace.c: Fix common/ includes. * python/python.c: Fix common/ includes. * python/py-type.c: Fix common/ includes. * python/py-inferior.c: Fix common/ includes. * progspace.h: Fix common/ includes. * producer.c: Fix common/ includes. * procfs.c: Fix common/ includes. * proc-api.c: Fix common/ includes. * printcmd.c: Fix common/ includes. * ppc-linux-nat.c: Fix common/ includes. * parser-defs.h: Fix common/ includes. * osdata.c: Fix common/ includes. * obsd-nat.c: Fix common/ includes. * nat/x86-linux.c: Fix common/ includes. * nat/x86-linux-dregs.c: Fix common/ includes. * nat/x86-dregs.h: Fix common/ includes. * nat/x86-dregs.c: Fix common/ includes. * nat/ppc-linux.c: Fix common/ includes. * nat/mips-linux-watch.h: Fix common/ includes. * nat/mips-linux-watch.c: Fix common/ includes. * nat/linux-waitpid.c: Fix common/ includes. * nat/linux-ptrace.h: Fix common/ includes. * nat/linux-ptrace.c: Fix common/ includes. * nat/linux-procfs.c: Fix common/ includes. * nat/linux-personality.c: Fix common/ includes. * nat/linux-osdata.c: Fix common/ includes. * nat/linux-namespaces.c: Fix common/ includes. * nat/linux-btrace.h: Fix common/ includes. * nat/linux-btrace.c: Fix common/ includes. * nat/fork-inferior.c: Fix common/ includes. * nat/amd64-linux-siginfo.c: Fix common/ includes. * nat/aarch64-sve-linux-ptrace.c: Fix common/ includes. * nat/aarch64-linux.c: Fix common/ includes. * nat/aarch64-linux-hw-point.h: Fix common/ includes. * nat/aarch64-linux-hw-point.c: Fix common/ includes. * namespace.h: Fix common/ includes. * mips-linux-tdep.c: Fix common/ includes. * minsyms.c: Fix common/ includes. * mi/mi-parse.h: Fix common/ includes. * mi/mi-main.c: Fix common/ includes. * mi/mi-cmd-env.c: Fix common/ includes. * memrange.h: Fix common/ includes. * memattr.c: Fix common/ includes. * maint.h: Fix common/ includes. * maint.c: Fix common/ includes. * main.c: Fix common/ includes. * machoread.c: Fix common/ includes. * location.c: Fix common/ includes. * linux-thread-db.c: Fix common/ includes. * linux-nat.c: Fix common/ includes. * linux-fork.c: Fix common/ includes. * inline-frame.c: Fix common/ includes. * infrun.c: Fix common/ includes. * inflow.c: Fix common/ includes. * inferior.h: Fix common/ includes. * inferior.c: Fix common/ includes. * infcmd.c: Fix common/ includes. * inf-ptrace.c: Fix common/ includes. * inf-child.c: Fix common/ includes. * ia64-linux-nat.c: Fix common/ includes. * i387-tdep.c: Fix common/ includes. * i386-tdep.c: Fix common/ includes. * i386-linux-tdep.c: Fix common/ includes. * i386-linux-nat.c: Fix common/ includes. * i386-go32-tdep.c: Fix common/ includes. * i386-fbsd-tdep.c: Fix common/ includes. * i386-fbsd-nat.c: Fix common/ includes. * guile/scm-type.c: Fix common/ includes. * guile/guile.c: Fix common/ includes. * go32-nat.c: Fix common/ includes. * gnu-nat.c: Fix common/ includes. * gdbthread.h: Fix common/ includes. * gdbarch-selftests.c: Fix common/ includes. * gdb_usleep.c: Fix common/ includes. * gdb_select.h: Fix common/ includes. * gdb_bfd.c: Fix common/ includes. * gcore.c: Fix common/ includes. * fork-child.c: Fix common/ includes. * findvar.c: Fix common/ includes. * fbsd-nat.c: Fix common/ includes. * event-top.c: Fix common/ includes. * event-loop.c: Fix common/ includes. * dwarf2read.c: Fix common/ includes. * dwarf2loc.c: Fix common/ includes. * dwarf2-frame.c: Fix common/ includes. * dwarf-index-cache.c: Fix common/ includes. * dtrace-probe.c: Fix common/ includes. * disasm-selftests.c: Fix common/ includes. * defs.h: Fix common/ includes. * csky-tdep.c: Fix common/ includes. * cp-valprint.c: Fix common/ includes. * cp-support.h: Fix common/ includes. * cp-support.c: Fix common/ includes. * corelow.c: Fix common/ includes. * completer.h: Fix common/ includes. * completer.c: Fix common/ includes. * compile/compile.c: Fix common/ includes. * compile/compile-loc2c.c: Fix common/ includes. * compile/compile-cplus-types.c: Fix common/ includes. * compile/compile-cplus-symbols.c: Fix common/ includes. * command.h: Fix common/ includes. * cli/cli-dump.c: Fix common/ includes. * cli/cli-cmds.c: Fix common/ includes. * charset.c: Fix common/ includes. * build-id.c: Fix common/ includes. * btrace.h: Fix common/ includes. * btrace.c: Fix common/ includes. * breakpoint.h: Fix common/ includes. * breakpoint.c: Fix common/ includes. * ax.h: (enum agent_op): Fix common/ includes. * ax-general.c (struct aop_map): Fix common/ includes. * ax-gdb.c: Fix common/ includes. * auxv.c: Fix common/ includes. * auto-load.c: Fix common/ includes. * arm-tdep.c: Fix common/ includes. * arch/riscv.c: Fix common/ includes. * arch/ppc-linux-common.c: Fix common/ includes. * arch/i386.c: Fix common/ includes. * arch/arm.c: Fix common/ includes. * arch/arm-linux.c: Fix common/ includes. * arch/arm-get-next-pcs.c: Fix common/ includes. * arch/amd64.c: Fix common/ includes. * arch/aarch64.c: Fix common/ includes. * arch/aarch64-insn.c: Fix common/ includes. * arch-utils.c: Fix common/ includes. * amd64-windows-tdep.c: Fix common/ includes. * amd64-tdep.c: Fix common/ includes. * amd64-sol2-tdep.c: Fix common/ includes. * amd64-obsd-tdep.c: Fix common/ includes. * amd64-nbsd-tdep.c: Fix common/ includes. * amd64-linux-tdep.c: Fix common/ includes. * amd64-linux-nat.c: Fix common/ includes. * amd64-fbsd-tdep.c: Fix common/ includes. * amd64-fbsd-nat.c: Fix common/ includes. * amd64-dicos-tdep.c: Fix common/ includes. * amd64-darwin-tdep.c: Fix common/ includes. * agent.c: Fix common/ includes. * ada-lang.h: Fix common/ includes. * ada-lang.c: Fix common/ includes. * aarch64-tdep.c: Fix common/ includes. gdb/gdbserver/ChangeLog 2019-01-25 Tom Tromey <tom@tromey.com> * win32-low.c: Fix common/ includes. * win32-i386-low.c: Fix common/ includes. * tracepoint.c: Fix common/ includes. * thread-db.c: Fix common/ includes. * target.h: Fix common/ includes. * symbol.c: Fix common/ includes. * spu-low.c: Fix common/ includes. * server.h: Fix common/ includes. * server.c: Fix common/ includes. * remote-utils.c: Fix common/ includes. * regcache.h: Fix common/ includes. * regcache.c: Fix common/ includes. * nto-x86-low.c: Fix common/ includes. * notif.h: Fix common/ includes. * mem-break.h: Fix common/ includes. * lynx-low.c: Fix common/ includes. * lynx-i386-low.c: Fix common/ includes. * linux-x86-tdesc-selftest.c: Fix common/ includes. * linux-x86-low.c: Fix common/ includes. * linux-low.c: Fix common/ includes. * inferiors.h: Fix common/ includes. * i387-fp.c: Fix common/ includes. * hostio.c: Fix common/ includes. * hostio-errno.c: Fix common/ includes. * gdbthread.h: Fix common/ includes. * gdbreplay.c: Fix common/ includes. * fork-child.c: Fix common/ includes. * event-loop.c: Fix common/ includes. * ax.c: (enum gdb_agent_op): Fix common/ includes.
2019-01-23 18:21:39 +01:00
2019-01-25 Tom Tromey <tom@tromey.com>
* win32-low.c: Fix common/ includes.
* win32-i386-low.c: Fix common/ includes.
* tracepoint.c: Fix common/ includes.
* thread-db.c: Fix common/ includes.
* target.h: Fix common/ includes.
* symbol.c: Fix common/ includes.
* spu-low.c: Fix common/ includes.
* server.h: Fix common/ includes.
* server.c: Fix common/ includes.
* remote-utils.c: Fix common/ includes.
* regcache.h: Fix common/ includes.
* regcache.c: Fix common/ includes.
* nto-x86-low.c: Fix common/ includes.
* notif.h: Fix common/ includes.
* mem-break.h: Fix common/ includes.
* lynx-low.c: Fix common/ includes.
* lynx-i386-low.c: Fix common/ includes.
* linux-x86-tdesc-selftest.c: Fix common/ includes.
* linux-x86-low.c: Fix common/ includes.
* linux-low.c: Fix common/ includes.
* inferiors.h: Fix common/ includes.
* i387-fp.c: Fix common/ includes.
* hostio.c: Fix common/ includes.
* hostio-errno.c: Fix common/ includes.
* gdbthread.h: Fix common/ includes.
* gdbreplay.c: Fix common/ includes.
* fork-child.c: Fix common/ includes.
* event-loop.c: Fix common/ includes.
* ax.c:
(enum gdb_agent_op): Fix common/ includes.
2019-01-21 Tom Tromey <tom@tromey.com>
* tracepoint.c: Fix includes.
* remote-utils.c: Fix includes.
* linux-x86-low.c: Fix includes.
2019-01-01 Joel Brobecker <brobecker@adacore.com>
* gdbreplay.c (gdbreplay_version): Update copyright year in
version message.
* server.c (gdbserver_version): Likewise.
AArch64: Racy: Don't set empty set of hardware BPs/WPs on new thread On some heavily loaded AArch64 boxes, GDB will sometimes hang forever when the inferior creates a thread. This hang happens inside the kernel during the ptrace call to set hardware watchpoints or hardware breakpoints. Currently, GDB will always set hw wp/bp at the start of each thread even if there are none set in the process. This patch works around the issue by avoiding setting hw wp/bp if there are none set for the process. On an effected machine, this fix drastically reduces the racy nature of the gdb.threads test set. I ran the entire gdb test suite across all processors for 100 iterations, then ran the results through the racy tests script. Without the patch, 58 .exp files in gdb.threads were marked as racy. After the patch this reduced to the same ~14 tests as the non effected boxes. Clearly GDB will still be subject to hangs on an effect box if hw wp/bp's are used prior to creating inferior threads on a heavily loaded system. To enable this in gdbserver, the sequence in gdbserver add_lwp() is switched to the same as gdb order as gdb, to ensure the thread is registered before calling new_thread(). This allows aarch64_linux_new_thread() to read the ptid. gdb/ChangeLog: * nat/aarch64-linux-hw-point.c (aarch64_linux_any_set_debug_regs_state): New function. * nat/aarch64-linux-hw-point.h (aarch64_linux_any_set_debug_regs_state): New declaration. * nat/aarch64-linux.c (aarch64_linux_new_thread): Check if any BPs or WPs are set. gdb/gdbserver/ChangeLog: * linux-low.c (add_lwp): Switch ordering.
2018-12-05 11:34:54 +01:00
2018-12-05 Alan Hayward <alan.hayward@arm.com>
* linux-low.c (add_lwp): Switch ordering.
2018-11-29 Tom Tromey <tom@tromey.com>
* win32-low.c (win32_join): Take pid, not process.
* target.h (struct target_ops) <join>: Change argument type.
(join_inferior): Change argument name.
* spu-low.c (spu_join): Take pid, not process.
* server.c (handle_detach): Preserve pid before destroying
process.
* lynx-low.c (lynx_join): Take pid, not process.
* linux-low.c (linux_join): Take pid, not process.
2018-11-23 Alan Hayward <alan.hayward@arm.com>
* linux-aarch64-low.c (aarch64_cannot_store_register): Remove.
(aarch64_cannot_fetch_register): Likewise.
(struct linux_target_ops): Update references.
2018-10-31 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* linux-ppc-low.c: Include nat/linux-ptrace.h.
[PowerPC] Add support for HTM registers This patch adds support for Hardware Transactional Memory registers for the powerpc linux native and core file targets, and for the pwoerpc linux server stub. These registers include both the HTM special-purpose registers (TFHAR, TEXASR and TFIAR) as well as the set of registers that are checkpointed (saved) when a transaction is initiated, which the processor restores in the event of a transaction failure. The set of checkpointed general-purpose registers is returned by the linux kernel in the same format as the regular general-purpose registers, defined in struct pt_regs. However, the architecture specifies that only some of the registers present in pt_regs are checkpointed (GPRs 0-31, CR, XER, LR and CTR). The kernel fills the slots for MSR and NIP with other info. The other fields usually don't have meaningful values. GDB doesn't define registers that are not checkpointed in the architecture, but when generating a core file, GDB fills the slot for the checkpointed MSR with the regular MSR. These are usually similar, although some bits might be different, and in some cases the checkpointed MSR will have a value of 0 in a kernel-generated core-file. The checkpointed NIP is filled with TFHAR by GDB in the core-file, which is what the kernel does. The other fields are set to 0 by GDB. Core files generated by the kernel have a note section for checkpointed GPRs with the same size for both 32-bit and 64-bit threads, and the values for the registers of a 32-bit thread are squeezed in the first half, with no useful data in the second half. GDB generates a smaller note section for 32-bit threads, but can read both sizes. The checkpointed XER is required to be 32-bit in the target description documentation, even though the more recent ISAs define it as 64-bit wide, since the high-order 32-bits are reserved, and because in Linux there is no way to get a 64-bit checkpointed XER for 32-bit threads. If this changes in the future, the target description feature requirement can be relaxed to allow for a 64-bit checkpointed XER. Access to the checkpointed CR (condition register) can be confusing. The architecture only specifies that CR fields 1 to 7 (the 24 least significant bits) are checkpointed, but the kernel provides all 8 fields (32 bits). The value of field 0 is not masked by ptrace, so it will sometimes show the result of some kernel operation, probably treclaim., which sets this field. The checkpointed registers are marked not to be saved and restored. Inferior function calls during an active transaction don't work well, and it's unclear what should be done in this case. TEXASR and TFIAR can be altered asynchronously, during transaction failure recording, so they are also not saved and restored. For consistency neither is TFHAR. Record and replay also doesn't work well when transactions are involved. This patch doesn't address this, so the values of the HTM SPRs will sometimes be innacurate when the record/relay target is enabled. For instance, executing a "tbegin." alters TFHAR and TEXASR, but these changes are not currently recorded. Because the checkpointed registers are only available when a transaction is active (or suspended), ptrace can return ENODATA when gdb tries to read these registers and the inferior is not in a transactional state. The registers are set to the unavailable state when this happens. When gbd tries to write to one of these registers, and it is unavailable, an error is raised. The "fill" functions for checkpointed register sets in the server stub are not implemented for the same reason as for the EBB register set, since ptrace can also return ENODATA for checkpointed regsets. The same issues with 'G' packets apply here. Just like for the EBB registers, tracepoints will not mark the checkpointed registers as unavailable if the inferior was not in a transaction, so their content will also show 0 instead of <unavailable> when inspecting trace data. The new tests record the values of the regular registers before stepping the inferior through a "tbegin." instruction to start a transaction, then the checkpointed registers are checked against the recorded pre-transactional values. New values are written to the checkpointed registers and recorded, the inferior continues until the transaction aborts (which is usually immediately when it is resumed), and the regular registers are checked against the recorded values, because the abort should have reverted the registers to these values. Like for the EBB registers, target_store_registers will ignore the checkpointed registers when called with -1 as the regno argument (store all registers in one go). gdb/ChangeLog: 2018-10-26 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * arch/ppc-linux-tdesc.h (tdesc_powerpc_isa207_htm_vsx32l) (tdesc_powerpc_isa207_htm_vsx64l): Declare. * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_TM_SPRREGSET) (PPC32_LINUX_SIZEOF_CGPRREGSET, PPC64_LINUX_SIZEOF_CGPRREGSET) (PPC_LINUX_SIZEOF_CFPRREGSET, PPC_LINUX_SIZEOF_CVMXREGSET) (PPC_LINUX_SIZEOF_CVSXREGSET, PPC_LINUX_SIZEOF_CPPRREGSET) (PPC_LINUX_SIZEOF_CDSCRREGSET, PPC_LINUX_SIZEOF_CTARREGSET): Define. (struct ppc_linux_features) <htm>: New field. (ppc_linux_no_features): Add initializer for htm field. * arch/ppc-linux-common.c (ppc_linux_match_description): Return new tdescs. * nat/ppc-linux.h (PPC_FEATURE2_HTM, NT_PPC_TM_CGPR) (NT_PPC_TM_CFPR, NT_PPC_TM_CVMX, NT_PPC_TM_CVSX) (NT_PPC_TM_SPR, NT_PPC_TM_CTAR, NT_PPC_TM_CPPR, NT_PPC_TM_CDSCR): Define if not already defined. * features/Makefile (WHICH): Add rs6000/powerpc-isa207-htm-vsx32l and rs6000/powerpc-isa207-htm-vsx64l. (XMLTOC): Add rs6000/powerpc-isa207-htm-vsx32l.xml and rs6000/powerpc-isa207-htm-vsx64l.xml. * features/rs6000/power-htm-spr.xml: New file. * features/rs6000/power-htm-core.xml: New file. * features/rs6000/power64-htm-core.xml: New file. * features/rs6000/power-htm-fpu.xml: New file. * features/rs6000/power-htm-altivec.xml: New file. * features/rs6000/power-htm-vsx.xml: New file. * features/rs6000/power-htm-ppr.xml: New file. * features/rs6000/power-htm-dscr.xml: New file. * features/rs6000/power-htm-tar.xml: New file. * features/rs6000/powerpc-isa207-htm-vsx32l.xml: New file. * features/rs6000/powerpc-isa207-htm-vsx64l.xml: New file. * features/rs6000/powerpc-isa207-htm-vsx32l.c: Generate. * features/rs6000/powerpc-isa207-htm-vsx64l.c: Generate. * regformats/rs6000/powerpc-isa207-htm-vsx32l.dat: Generate. * regformats/rs6000/powerpc-isa207-htm-vsx64l.dat: Generate. * ppc-linux-nat.c (fetch_register, fetch_ppc_registers): Call fetch_regset with HTM regsets. (store_register, store_ppc_registers): Call store_regset with HTM regsets. (ppc_linux_nat_target::read_description): Set htm field in the features struct if needed. * ppc-linux-tdep.c: Include features/rs6000/powerpc-isa207-htm-vsx32l.c and features/rs6000/powerpc-isa207-htm-vsx64l.c. (ppc32_regmap_tm_spr, ppc32_regmap_cgpr, ppc64_le_regmap_cgpr) (ppc64_be_regmap_cgpr, ppc32_regmap_cfpr, ppc32_le_regmap_cvmx) (ppc32_be_regmap_cvmx, ppc32_regmap_cvsx, ppc32_regmap_cppr) (ppc32_regmap_cdscr, ppc32_regmap_ctar): New globals. (ppc32_linux_tm_sprregset, ppc32_linux_cgprregset) (ppc64_be_linux_cgprregset, ppc64_le_linux_cgprregset) (ppc32_linux_cfprregset, ppc32_le_linux_cvmxregset) (ppc32_be_linux_cvmxregset, ppc32_linux_cvsxregset) (ppc32_linux_cpprregset, ppc32_linux_cdscrregset) (ppc32_linux_ctarregset): New globals. (ppc_linux_cgprregset, ppc_linux_cvmxregset): New functions. (ppc_linux_collect_core_cpgrregset): New function. (ppc_linux_iterate_over_regset_sections): Call back with the htm regsets. (ppc_linux_core_read_description): Check if the tm spr section is present and set htm in the features struct. (_initialize_ppc_linux_tdep): Call initialize_tdesc_powerpc_isa207_htm_vsx32l and initialize_tdesc_powerpc_isa207_htm_vsx64l. * ppc-linux-tdep.h (ppc_linux_cgprregset, ppc_linux_cvmxregset): Declare. (ppc32_linux_tm_sprregset, ppc32_linux_cfprregset) (ppc32_linux_cvsxregset, ppc32_linux_cpprregset) (ppc32_linux_cdscrregset, ppc32_linux_ctarregset): Declare. * ppc-tdep.h (struct gdbarch_tdep) <have_htm_spr, have_htm_core>: New fields. <have_htm_fpu, have_htm_altivec, have_htm_vsx>: Likewise. <ppc_cppr_regnum, ppc_cdscr_regnum, ppc_ctar_regnum>: Likewise. <ppc_cdl0_regnum, ppc_cvsr0_regnum, ppc_cefpr0_regnum>: Likewise. (enum) <PPC_TFHAR_REGNUM, PPC_TEXASR_REGNUM, PPC_TFIAR_REGNUM>: New enum fields. <PPC_CR0_REGNUM, PPC_CCR_REGNUM, PPC_CXER_REGNUM>: Likewise. <PPC_CLR_REGNUM, PPC_CCTR_REGNUM, PPC_CF0_REGNUM>: Likewise. <PPC_CFPSCR_REGNUM, PPC_CVR0_REGNUM, PPC_CVSCR_REGNUM>: Likewise. <PPC_CVRSAVE_REGNUM, PPC_CVSR0_UPPER_REGNUM>: Likewise. <PPC_CPPR_REGNUM, PPC_CDSCR_REGNUM>: Likewise. <PPC_CTAR_REGNUM>: Likewise. (PPC_IS_TMSPR_REGNUM, PPC_IS_CKPTGP_REGNUM, PPC_IS_CKPTFP_REGNUM) (PPC_IS_CKPTVMX_REGNUM, PPC_IS_CKPTVSX_REGNUM): Define. * rs6000-tdep.c (IS_CDFP_PSEUDOREG, IS_CVSX_PSEUDOREG) (IS_CEFP_PSEUDOREG): Define. (rs6000_register_name): Hide the upper halves of checkpointed VSX registers. Return names for the checkpointed DFP, VSX, and EFP pseudo registers. (rs6000_pseudo_register_type): Remove initial assert and raise an internal error in the else clause instead. Return types for the checkpointed DFP, VSX, and EFP pseudo registers. (dfp_pseudo_register_read, dfp_pseudo_register_write): Handle checkpointed DFP pseudo registers. (vsx_pseudo_register_read, vsx_pseudo_register_write): Handle checkpointed VSX pseudo registers. (efp_pseudo_register_read, efp_pseudo_register_write): Rename from efpr_pseudo_register_read and efpr_pseudo_register_write. Handle checkpointed EFP pseudo registers. (rs6000_pseudo_register_read, rs6000_pseudo_register_write): Handle checkpointed DFP, VSX, and EFP registers. (dfp_ax_pseudo_register_collect, vsx_ax_pseudo_register_collect) (efp_ax_pseudo_register_collect): New functions. (rs6000_ax_pseudo_register_collect): Move DFP, VSX and EFP pseudo register logic to new functions. Handle checkpointed DFP, VSX, and EFP pseudo registers. (rs6000_gdbarch_init): Look for and validate the htm features. Include checkpointed DFP, VSX and EFP pseudo-registers. * NEWS: Mention access to PPR, DSCR, TAR, EBB/PMU registers and HTM registers. gdb/gdbserver/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * configure.srv (ipa_ppc_linux_regobj): Add powerpc-isa207-htm-vsx32l-ipa.o and powerpc-isa207-htm-vsx64l-ipa.o. (powerpc*-*-linux*): Add powerpc-isa207-htm-vsx32l.o and powerpc-isa207-htm-vsx64l.o to srv_regobj. Add rs6000/power-htm-spr.xml, rs6000/power-htm-core.xml, rs6000/power64-htm-core.xml, rs6000/power-htm-fpu.xml, rs6000/power-htm-altivec.xml, rs6000/power-htm-vsx.xml, rs6000/power-htm-ppr.xml, rs6000/power-htm-dscr.xml, rs6000/power-htm-tar.xml, rs6000/powerpc-isa207-htm-vsx32l.xml, and rs6000/powerpc-isa207-htm-vsx64l.xml to srv_xmlfiles. * linux-ppc-tdesc-init.h (enum ppc_linux_tdesc) <PPC_TDESC_ISA207_HTM_VSX>: New enum value. (init_registers_powerpc_isa207_htm_vsx32l) (init_registers_powerpc_isa207_htm_vsx64l): Declare. * linux-ppc-low.c (ppc_fill_tm_sprregset, ppc_store_tm_sprregset) (ppc_store_tm_cgprregset, ppc_store_tm_cfprregset) (ppc_store_tm_cvrregset, ppc_store_tm_cvsxregset) (ppc_store_tm_cpprregset, ppc_store_tm_cdscrregset) (ppc_store_tm_ctarregset): New functions. (ppc_regsets): Add entries for HTM regsets. (ppc_arch_setup): Set htm in features struct when needed. Set sizes for the HTM regsets. (ppc_get_ipa_tdesc_idx): Return PPC_TDESC_ISA207_HTM_VSX. (initialize_low_arch): Call init_registers_powerpc_isa207_htm_vsx32l and init_registers_powerpc_isa207_htm_vsx64l. * linux-ppc-ipa.c (get_ipa_tdesc): Handle PPC_TDESC_ISA207_HTM_VSX. (initialize_low_tracepoint): Call init_registers_powerpc_isa207_htm_vsx32l and init_registers_powerpc_isa207_htm_vsx64l. gdb/testsuite/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.arch/powerpc-htm-regs.c: New file. * gdb.arch/powerpc-htm-regs.exp: New file. gdb/doc/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.texinfo (PowerPC Features): Describe new features "org.gnu.gdb.power.htm.spr", "org.gnu.gdb.power.htm.core", "org.gnu.gdb.power.htm.fpu", "org.gnu.gdb.power.htm.altivec", "org.gnu.gdb.power.htm.vsx", "org.gnu.gdb.power.htm.ppr", "org.gnu.gdb.power.htm.dscr", "org.gnu.gdb.power.htm.tar".
2018-10-26 14:37:55 +02:00
2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* configure.srv (ipa_ppc_linux_regobj): Add
powerpc-isa207-htm-vsx32l-ipa.o and
powerpc-isa207-htm-vsx64l-ipa.o.
(powerpc*-*-linux*): Add powerpc-isa207-htm-vsx32l.o and
powerpc-isa207-htm-vsx64l.o to srv_regobj. Add
rs6000/power-htm-spr.xml, rs6000/power-htm-core.xml,
rs6000/power64-htm-core.xml, rs6000/power-htm-fpu.xml,
rs6000/power-htm-altivec.xml, rs6000/power-htm-vsx.xml,
rs6000/power-htm-ppr.xml, rs6000/power-htm-dscr.xml,
rs6000/power-htm-tar.xml, rs6000/powerpc-isa207-htm-vsx32l.xml,
and rs6000/powerpc-isa207-htm-vsx64l.xml to srv_xmlfiles.
* linux-ppc-tdesc-init.h (enum ppc_linux_tdesc)
<PPC_TDESC_ISA207_HTM_VSX>: New enum value.
(init_registers_powerpc_isa207_htm_vsx32l)
(init_registers_powerpc_isa207_htm_vsx64l): Declare.
* linux-ppc-low.c (ppc_fill_tm_sprregset, ppc_store_tm_sprregset)
(ppc_store_tm_cgprregset, ppc_store_tm_cfprregset)
(ppc_store_tm_cvrregset, ppc_store_tm_cvsxregset)
(ppc_store_tm_cpprregset, ppc_store_tm_cdscrregset)
(ppc_store_tm_ctarregset): New functions.
(ppc_regsets): Add entries for HTM regsets.
(ppc_arch_setup): Set htm in features struct when needed. Set
sizes for the HTM regsets.
(ppc_get_ipa_tdesc_idx): Return PPC_TDESC_ISA207_HTM_VSX.
(initialize_low_arch): Call
init_registers_powerpc_isa207_htm_vsx32l and
init_registers_powerpc_isa207_htm_vsx64l.
* linux-ppc-ipa.c (get_ipa_tdesc): Handle
PPC_TDESC_ISA207_HTM_VSX.
(initialize_low_tracepoint): Call
init_registers_powerpc_isa207_htm_vsx32l and
init_registers_powerpc_isa207_htm_vsx64l.
[PowerPC] Add support for EBB and PMU registers This patch adds support for registers of the Event Based Branching and Performance Monitoring Units for the powerpc linux native and core file targets, and for the powerpc linux server stub. All three EBB registers are accessible. Only a subset of the PMU registers can be accessed through ptrace. Because of this, the PMU registers are enumerated individually in gdbarch_tdep, as opposed to having a single "have_pmu" flag. This is intended to make it easier to add additional PMU registers in the future, since checking a "have_pmu" flag elsewhere in the code would no longer be correct. The tdesc feature is named org.gnu.gdb.power.linux.pmu because of this. It's unclear if it makes sense to save and restore these registers across function calls, since some of them can be modified asynchronously. They are also not tracked in record-replay mode. The kernel can return ENODATA when ptrace is used to get the EBB registers, unless a linux performance event that uses EBB is open in the inferior. For this reason, the "fill" functions in the server stub for the ebb register sets is not implemented. Since gdbserver writes all registers in one go before resuming the inferior, this error would not be detected at the time the user tries to write to one of the registers on the client side, and gdbserver would print out warnings every time it resumes the inferior when no ebb performance event is opened, so there is currently no straightforward way to handle this case. This means the ebb registers in the client-side regcache can become dirty when the user tries to write to them, until the inferior is resumed and stopped again. A related issue is that 'G' packets used to write to unrelated registers will include bad data for the EBB registers if they are unavailable, since no register status information is included in the 'G' packet. This data won't be written to the inferior by the gdbserver stub because the "fill" functions are not implemented, and currently the gdbserver stub doesn't change the status of the registers in its own regcache in response to 'G' packets. Another limitation for the ebb registers is that traceframes don't record if registers are available or not, so if these registers are collected when a tracepoint is hit and the inferior has no ebb event opened, the user will see zero values for all of them, instead of the usual <unavailable>. Because these registers are often unavailable, trying to store them with target_store_registers with -1 for the regno argument (all registers) would almost always fail, so they are ignored in this case. gdb/ChangeLog: 2018-10-26 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_EBBREGSET) (PPC_LINUX_SIZEOF_PMUREGSET): Declare. * nat/ppc-linux.h (PPC_FEATURE2_EBB, NT_PPC_EBB, NT_PPC_PMU): Define if not already defined. * features/rs6000/power-ebb.xml: New file. * features/rs6000/power-linux-pmu.xml: New file. * features/rs6000/powerpc-isa207-vsx32l.xml: Include ebb and pmu features. * features/rs6000/powerpc-isa207-vsx64l.xml: Likewise. * features/rs6000/powerpc-isa207-vsx32l.c: Re-generate. * features/rs6000/powerpc-isa207-vsx64l.c: Re-generate. * regformats/rs6000/powerpc-isa207-vsx32l.dat: Re-generate. * regformats/rs6000/powerpc-isa207-vsx64l.dat: Re-generate. * ppc-linux-nat.c (fetch_register, fetch_ppc_registers): Call fetch_regset with ebb and pmu regsets. (store_register, store_ppc_registers): Call store_regset with ebb and pmu regsets. (ppc_linux_nat_target::read_description): Set isa207 field in the features struct if ebb and pmu are avaiable. * ppc-linux-tdep.c (ppc32_regmap_ebb, ppc32_regmap_pmu) (ppc32_linux_ebbregset, ppc32_linux_pmuregset): New globals. (ppc_linux_iterate_over_regset_sections): Call back with the ebb and pmu regsets. (ppc_linux_core_read_description): Check if the pmu section is present and set isa207 in the features struct. * ppc-linux-tdep.h (ppc32_linux_ebbregset) (ppc32_linux_pmuregset): Declare. * ppc-tdep.h (struct gdbarch_tdep) <ppc_mmcr0_regnum>: New field. <ppc_mmcr2_regnum, ppc_siar_regnum, ppc_sdar_regnum>: New fields. <ppc_sier_regnum>: New field. (enum): <PPC_BESCR_REGNUM, PPC_EBBHR_REGNUM, PPC_EBBRR_REGNUM>: New enum values. <PPC_MMCR0_REGNUM, PPC_MMCR2_REGNUM, PPC_SIAR_REGNUM>: New enum values. <PPC_SDAR_REGNUM, PPC_SIER_REGNUM>: New enum values. (PPC_IS_EBB_REGNUM, PPC_IS_PMU_REGNUM): Define. * rs6000-tdep.c (rs6000_gdbarch_init): Look for and validate the ebb and pmu features. gdb/gdbserver/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * configure.srv (powerpc*-*-linux*): Add rs6000/power-ebb.xml and rs6000/power-linux-pmu.xml to srv_xmlfiles. * linux-ppc-low.c (ppc_store_ebbregset, ppc_fill_pmuregset) (ppc_store_pmuregset): New functions. (ppc_regsets): Add entries for ebb and pmu regsets. (ppc_arch_setup): Set isa207 in features struct if the ebb and pmu regsets are available. Set sizes for these regsets. gdb/doc/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.texinfo (PowerPC Features): Describe new features "org.gnu.gdb.power.ebb" and "org.gnu.gdb.power.linux.pmu".
2018-10-26 14:37:54 +02:00
2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* configure.srv (powerpc*-*-linux*): Add rs6000/power-ebb.xml and
rs6000/power-linux-pmu.xml to srv_xmlfiles.
* linux-ppc-low.c (ppc_store_ebbregset, ppc_fill_pmuregset)
(ppc_store_pmuregset): New functions.
(ppc_regsets): Add entries for ebb and pmu regsets.
(ppc_arch_setup): Set isa207 in features struct if the ebb and
pmu regsets are available. Set sizes for these regsets.
[PowerPC] Add support for TAR This patch adds support for the Target Address Register for powerpc linux native and core file targets, and in the powerpc linux server stub. gdb/ChangeLog: 2018-10-26 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * arch/ppc-linux-tdesc.h (tdesc_powerpc_isa207_vsx32l) (tdesc_powerpc_isa207_vsx64l): Declare. * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_TARREGSET): Define. (struct ppc_linux_features) <isa207>: New field. (ppc_linux_no_features): Add initializer for isa207 field. * arch/ppc-linux-common.c (ppc_linux_match_description): Return new tdescs. * nat/ppc-linux.h (PPC_FEATURE2_ARCH_2_07, PPC_FEATURE2_TAR) (NT_PPC_TAR): Define if not already defined. * features/Makefile (WHICH): Add rs6000/powerpc-isa207-vsx32l and rs6000/powerpc-isa207-vsx64l. (XMLTOC): Add rs6000/powerpc-isa207-vsx32l.xml and rs6000/powerpc-isa207-vsx64l.xml. * features/rs6000/power-tar.xml: New file. * features/rs6000/powerpc-isa207-vsx32l.xml: New file. * features/rs6000/powerpc-isa207-vsx64l.xml: New file. * features/rs6000/powerpc-isa207-vsx32l.c: Generate. * features/rs6000/powerpc-isa207-vsx64l.c: Generate. * regformats/rs6000/powerpc-isa207-vsx32l.dat: Generate. * regformats/rs6000/powerpc-isa207-vsx64l.dat: Generate. * ppc-linux-nat.c (fetch_register, fetch_ppc_registers): Call fetch_regset with the TAR regset. (store_register, store_ppc_registers): Call store_regset with the TAR regset. (ppc_linux_nat_target::read_description): Set isa207 field in the features struct if needed. * ppc-linux-tdep.c: Include features/rs6000/powerpc-isa207-vsx32l.c and features/rs6000/powerpc-isa207-vsx64l.c. (ppc32_regmap_tar, ppc32_linux_tarregset): New globals. (ppc_linux_iterate_over_regset_sections): Call back with the tar regset. (ppc_linux_core_read_description): Check if the tar section is present and set isa207 in the features struct. (_initialize_ppc_linux_tdep): Call initialize_tdesc_powerpc_isa207_vsx32l and initialize_tdesc_powerpc_isa207_vsx64l. * ppc-linux-tdep.h (ppc32_linux_tarregset): Declare. * ppc-tdep.h (gdbarch_tdep) <ppc_tar_regnum>: New field. (enum) <PPC_TAR_REGNUM>: New enum value. * rs6000-tdep.c (rs6000_gdbarch_init): Look for and validate tar feature. (ppc_process_record_op31): Record changes to TAR. gdb/gdbserver/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * configure.srv (ipa_ppc_linux_regobj): Add powerpc-isa207-vsx64l-ipa.o and powerpc-isa207-vsx32l-ipa.o. (powerpc*-*-linux*): Add powerpc-isa207-vsx32l.o and powerpc-isa207-vsx64l.o to srv_regobj, add rs6000/power-tar.xml, rs6000/powerpc-isa207-vsx32l.xml, and rs6000/powerpc-isa207-vsx64l.xml to srv_xmlfiles. * linux-ppc-tdesc-init.h (enum ppc_linux_tdesc) <PPC_TDESC_ISA207_VSX>: New enum value. (init_registers_powerpc_isa207_vsx32l): Declare. (init_registers_powerpc_isa207_vsx64l): Declare. * linux-ppc-low.c (ppc_fill_tarregset): New function. (ppc_store_tarregset): New function. (ppc_regsets): Add entry for the TAR regset. (ppc_arch_setup): Set isa207 in features struct when needed. Set size for the TAR regsets. (ppc_get_ipa_tdesc_idx): Return PPC_TDESC_ISA207_VSX. (initialize_low_arch): Call init_registers_powerpc_isa207_vsx32l and init_registers_powerpc_isa207_vsx64l. * linux-ppc-ipa.c (get_ipa_tdesc): Handle PPC_TDESC_ISA207_VSX. (initialize_low_tracepoint): Call init_registers_powerpc_isa207_vsx32l and init_registers_powerpc_isa207_vsx64l. gdb/testsuite/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.arch/powerpc-tar.c: New file. * gdb.arch/powerpc-tar.exp: New file. gdb/doc/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.texinfo (PowerPC Features): Describe new feature "org.gnu.gdb.power.tar".
2018-10-26 14:37:54 +02:00
2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* configure.srv (ipa_ppc_linux_regobj): Add
powerpc-isa207-vsx64l-ipa.o and powerpc-isa207-vsx32l-ipa.o.
(powerpc*-*-linux*): Add powerpc-isa207-vsx32l.o and
powerpc-isa207-vsx64l.o to srv_regobj, add rs6000/power-tar.xml,
rs6000/powerpc-isa207-vsx32l.xml, and
rs6000/powerpc-isa207-vsx64l.xml to srv_xmlfiles.
* linux-ppc-tdesc-init.h (enum ppc_linux_tdesc)
<PPC_TDESC_ISA207_VSX>: New enum value.
(init_registers_powerpc_isa207_vsx32l): Declare.
(init_registers_powerpc_isa207_vsx64l): Declare.
* linux-ppc-low.c (ppc_fill_tarregset): New function.
(ppc_store_tarregset): New function.
(ppc_regsets): Add entry for the TAR regset.
(ppc_arch_setup): Set isa207 in features struct when needed. Set
size for the TAR regsets.
(ppc_get_ipa_tdesc_idx): Return PPC_TDESC_ISA207_VSX.
(initialize_low_arch): Call init_registers_powerpc_isa207_vsx32l
and init_registers_powerpc_isa207_vsx64l.
* linux-ppc-ipa.c (get_ipa_tdesc): Handle PPC_TDESC_ISA207_VSX.
(initialize_low_tracepoint): Call
init_registers_powerpc_isa207_vsx32l and
init_registers_powerpc_isa207_vsx64l.
[PowerPC] Add support for PPR and DSCR This patch adds gdb support for the Program Priorty Register and the Data Stream Control Register, for the powerpc linux native and core file targets, and for the powerpc linux server stub. gdb/ChangeLog: 2018-10-26 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * arch/ppc-linux-tdesc.h (tdesc_powerpc_isa205_ppr_dscr_vsx32l) (tdesc_powerpc_isa205_ppr_dscr_vsx64l): Declare. * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_PPRREGSET) (PPC_LINUX_SIZEOF_DSCRREGSET): Define. (struct ppc_linux_features) <ppr_dscr>: New field. (ppc_linux_no_features): Add initializer for ppr_dscr field. * arch/ppc-linux-common.c (ppc_linux_match_description): Return new tdescs. * nat/ppc-linux.h (PPC_FEATURE2_DSCR, NT_PPC_PPR, NT_PPC_DSCR): Define if not already defined. * features/Makefile (WHICH): Add rs6000/powerpc-isa205-ppr-dscr-vsx32l and rs6000/powerpc-isa205-ppr-dscr-vsx64l. (XMLTOC): Add rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml and rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml. * features/rs6000/power-dscr.xml: New file. * features/rs6000/power-ppr.xml: New file. * features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml: New file. * features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml: New file. * features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c: Generate. * features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c: Generate. * regformats/rs6000/powerpc-isa205-ppr-dscr-vsx32l.dat: Generate. * regformats/rs6000/powerpc-isa205-ppr-dscr-vsx64l.dat: Generate. * ppc-linux-nat.c: Include <sys/uio.h>. (fetch_regset, store_regset, check_regset): New functions. (fetch_register, fetch_ppc_registers): Call fetch_regset with DSCR and PPR regsets. (store_register, store_ppc_registers): Call store_regset with DSCR and PPR regsets. (ppc_linux_get_hwcap2): New function. (ppc_linux_nat_target::read_description): Call ppc_linux_get_hwcap2 and check_regset, set ppr_dscr field in the features struct if needed. * ppc-linux-tdep.c: Include features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c and features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c. (ppc32_regmap_ppr, ppc32_regmap_dscr, ppc32_linux_pprregset) (ppc32_linux_dscrregset): New globals. (ppc_linux_iterate_over_regset_sections): Call back with the ppr and dscr regsets. (ppc_linux_core_read_description): Check if the ppr and dscr sections are present and set ppr_dscr in the features struct. (_initialize_ppc_linux_tdep): Call initialize_tdesc_powerpc_isa205_ppr_dscr_vsx32l and initialize_tdesc_powerpc_isa205_ppr_dscr_vsx64l. * ppc-linux-tdep.h (ppc32_linux_pprregset) (ppc32_linux_dscrregset): Declare. * ppc-tdep.h (struct gdbarch_tdep) <ppc_ppr_regnum>: New field. <ppc_dscr_regnum>: New field. (enum) <PPC_PPR_REGNUM, PPC_DSCR_REGNUM>: New enum values. * rs6000-tdep.c (rs6000_gdbarch_init): Look for and validate ppr and dscr features. (ppc_process_record_op31): Record changes to PPR and DSCR. gdb/gdbserver/ChangeLog: 2018-10-26 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * configure.srv (ipa_ppc_linux_regobj): Add powerpc-isa205-ppr-dscr-vsx32l-ipa.o and powerpc-isa205-ppr-dscr-vsx64l-ipa.o. (powerpc*-*-linux*): Add powerpc-isa205-ppr-dscr-vsx32l.o and powerpc-isa205-ppr-dscr-vsx64l.o to srv_regobj, add rs6000/power-dscr.xml, rs6000/power-ppr.xml, rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml and rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml to srv_xmlfiles. * linux-ppc-tdesc-init.h (enum ppc_linux_tdesc) <PPC_TDESC_ISA205_PPR_DSCR_VSX>: New enum value. (init_registers_powerpc_isa205_ppr_dscr_vsx32l) (init_registers_powerpc_isa205_ppr_dscr_vsx64l): Declare. * linux-ppc-low.c: Include "elf/common.h" and <sys/uio.h>. (ppc_hwcap): Add comment. (ppc_hwcap2): New global. (ppc_check_regset, ppc_fill_pprregset, ppc_store_pprregset) (ppc_fill_dscrregset, ppc_store_dscrregset): New functions. (ppc_regsets): Add entries for the DSCR and PPR regsets. (ppc_arch_setup): Get AT_HWCAP2. Set ppr_dscr in features struct when needed. Set sizes for the the DSCR and PPR regsets. (ppc_get_ipa_tdesc_idx): Return PPC_TDESC_ISA205_PPR_DSCR_VSX. (initialize_low_arch): Call init_registers_powerpc_isa205_ppr_dscr_vsx32l and init_registers_powerpc_isa205_ppr_dscr_vsx64l. * linux-ppc-ipa.c (get_ipa_tdesc): Handle PPC_TDESC_ISA205_PPR_DSCR_VSX. (initialize_low_tracepoint): Call init_registers_powerpc_isa205_ppr_dscr_vsx32l and init_registers_powerpc_isa205_ppr_dscr_vsx64l. gdb/testsuite/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.arch/powerpc-ppr-dscr.c: New file. * gdb.arch/powerpc-ppr-dscr.exp: New file. gdb/doc/ChangeLog: 2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.texinfo (PowerPC Features): Describe new features "org.gnu.gdb.power.ppr" and "org.gnu.gdb.power.dscr".
2018-10-26 14:37:54 +02:00
2018-10-26 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* configure.srv (ipa_ppc_linux_regobj): Add
powerpc-isa205-ppr-dscr-vsx32l-ipa.o and
powerpc-isa205-ppr-dscr-vsx64l-ipa.o.
(powerpc*-*-linux*): Add powerpc-isa205-ppr-dscr-vsx32l.o and
powerpc-isa205-ppr-dscr-vsx64l.o to srv_regobj, add
rs6000/power-dscr.xml, rs6000/power-ppr.xml,
rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml and
rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml to srv_xmlfiles.
* linux-ppc-tdesc-init.h (enum ppc_linux_tdesc)
<PPC_TDESC_ISA205_PPR_DSCR_VSX>: New enum value.
(init_registers_powerpc_isa205_ppr_dscr_vsx32l)
(init_registers_powerpc_isa205_ppr_dscr_vsx64l): Declare.
* linux-ppc-low.c: Include "elf/common.h" and <sys/uio.h>.
(ppc_hwcap): Add comment.
(ppc_hwcap2): New global.
(ppc_check_regset, ppc_fill_pprregset, ppc_store_pprregset)
(ppc_fill_dscrregset, ppc_store_dscrregset): New functions.
(ppc_regsets): Add entries for the DSCR and PPR regsets.
(ppc_arch_setup): Get AT_HWCAP2. Set ppr_dscr in features struct
when needed. Set sizes for the the DSCR and PPR regsets.
(ppc_get_ipa_tdesc_idx): Return PPC_TDESC_ISA205_PPR_DSCR_VSX.
(initialize_low_arch): Call
init_registers_powerpc_isa205_ppr_dscr_vsx32l and
init_registers_powerpc_isa205_ppr_dscr_vsx64l.
* linux-ppc-ipa.c (get_ipa_tdesc): Handle
PPC_TDESC_ISA205_PPR_DSCR_VSX.
(initialize_low_tracepoint): Call
init_registers_powerpc_isa205_ppr_dscr_vsx32l and
init_registers_powerpc_isa205_ppr_dscr_vsx64l.
2018-10-26 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* linux-ppc-low.c (ppc_fill_vrregset): Remove memset calls.
Add parameter to allow enabling/disabling selftests via configure This is a follow-up of: https://sourceware.org/ml/gdb-patches/2018-08/msg00347.html Instead of going throttle and always enabling our selftests (even in non-development builds), this patch is a bit more conservative and introduces a configure option ("--enable-unit-tests") that allows the user to choose whether she wants unit tests in the build or not. Note that the current behaviour is retained: if no option is provided, GDB will have selftests included in a development build, and will *not* have selftests included in a non-development build. The rationale for having this option is still the same: due to the many racy testcases and random failures we see when running the GDB testsuite, it is unfortunately not possible to perform a full test when one is building a downstream package. As the Fedora GDB maintainer and one of the Debian GDB uploaders, I feel like this situation could be improved by, at least, executing our selftests after the package has been built. This patch introduces no regressions to our build. OK? gdb/ChangeLog: 2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com> Simon Marchi <simark@simark.ca> * README (`configure' options): Add documentation for new "--enable-unit-tests" option. * acinclude.m4: Include "selftest.m4". * configure: Regenerate. * configure.ac: Use "GDB_AC_SELFTEST". * maint.c (maintenance_selftest): Update message informing that selftests have been disabled. (maintenance_info_selftests): Likewise. * selftest.m4: New file. gdb/gdbserver/ChangeLog: 2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com> Simon Marchi <simark@simark.ca> * acinclude.m4: Include "../selftest.m4". * configure: Regenerate. * configure.ac: Use "GDB_AC_SELFTEST". * configure.srv: Use "$enable_unittests" instead of "$development" when checking whether unit tests have been enabled. * server.c (captured_main): Update message informing that selftests have been disabled. gdb/testsuite/ChangeLog: 2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.gdb/unittest.exp: Update expected message informing that selftests have been disabled. * gdb.server/unittest.exp: Likewise. squash! Add parameter to allow enabling/disabling selftests via configure
2018-09-17 21:58:55 +02:00
2018-10-10 Sergio Durigan Junior <sergiodj@redhat.com>
Simon Marchi <simark@simark.ca>
* acinclude.m4: Include "../selftest.m4".
* configure: Regenerate.
* configure.ac: Use "GDB_AC_SELFTEST".
* configure.srv: Use "$enable_unittests" instead of
"$development" when checking whether unit tests have been
enabled.
* server.c (captured_main): Update message informing that
selftests have been disabled.
2018-10-04 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
2018-10-04 Tom Tromey <tom@tromey.com>
* server.c (handle_status): Rename inner "thread".
(process_serial_event): Declare "res" in 'm' case.
* linux-low.c (last_thread_of_process_p, find_lwp_pid)
(iterate_over_lwps): Rename inner "thread".
(linux_qxfer_libraries_svr4): Rename inner "len".
* gdbthread.h (find_thread_in_random): Rename inner "thread".
2018-10-01 Gary Benson <gbenson@redhat.com>
* gdb_proc_service.h: Moved common code to
common/gdb_proc_service.h.
2018-10-01 Gary Benson <gbenson@redhat.com>
* gdb_proc_service.h: Synchronize comments and whitespace with
GDB's version of this file.
2018-09-25 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac (WARN_CFLAGS): Don't remove -Wmissing-prototypes.
2018-09-16 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (gdbserver$(EXEEXT)): Sort OBS.
(gdbreplay$(EXEEXT)): Sort GDBREPLAY_OBS.
($(IPA_LIB)): Sort IPA_OBJS.
2018-09-16 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Remove references to $(ADD_DEPS).
2018-09-16 Tom Tromey <tom@tromey.com>
* remote-utils.c (remote_open): Use GNU style for metasyntactic
variables.
* gdbreplay.c (gdbreplay_usage): Use GNU style for metasyntactic
variables.
2018-09-05 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
2018-08-28 Simon Marchi <simon.marchi@polymtl.ca>
PR build/23399
* tracepoint.c (IPA_SYM_STRUCT_NAME): Define.
2018-08-27 Tom Tromey <tom@tromey.com>
PR build/23087:
* configure: Rebuild.
2018-08-27 Tom Tromey <tom@tromey.com>
* linux-s390-low.c (s390_emit_ext, s390_emit_litpool)
(s390_emit_const, s390_emit_reg, s390_emit_zero_ext)
(s390_emit_stack_adjust, s390_emit_set_r2, s390x_emit_ext)
(s390x_emit_const, s390x_emit_reg, s390x_emit_zero_ext)
(s390x_emit_stack_adjust): Add casts to unsigned char.
2018-08-22 Simon Marchi <simon.marchi@ericsson.com>
PR gdb/23374
PR gdb/23375
* server.h (struct client_state) <disable_randomization>:
Initialize to 1.
2018-07-22 Simon Marchi <simon.marchi@polymtl.ca>
* linux-mips-low.c (mips_collect_ptrace_register): Remove unused
variable.
(mips_supply_ptrace_register): Likewise.
2018-07-22 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
2018-07-22 Tom Tromey <tom@tromey.com>
* win32-low.c (win32_create_inferior): Remove unused variables.
* gdbreplay.c (remote_open): Remove unused variable.
* remote-utils.c (remote_prepare): Remove unused variable.
* x86-tdesc.h (X86_TDESC_H): Define.
(amd64_expedite_regs): Define conditionally.
(i386_expedite_regs): Mark ATTRIBUTE_UNUSED.
* linux-x86-tdesc.c (i386_tdescs): Move inside #if.
* remote-utils.c (readchar): Remove unused variable.
2018-07-13 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_kill): Change parameter to process_info
pointer instead of pid. Adjust.
* lynx-low.c (lynx_kill): Likewise.
* nto-low.c (nto_kill): Likewise.
* spu-low.c (spu_kill): Likewise.
* win32-low.c (win32_kill): Likewise.
* server.c (handle_v_kill, kill_inferior_callback)
(detach_or_kill_for_exit): Adjust.
* target.c (kill_inferior): Change parameter to process_info
pointer instead of pid. Adjust.
* target.h (struct target_ops) <kill>: Change parameter to
process_info pointer instead of pid. Adjust all implementations
and callers.
(kill_inferior): Likewise.
2018-07-13 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_detach, linux_join): Change parameter to
process_info pointer instead of pid. Adjust.
* lynx-low.c (lynx_detach, lynx_join): Likewise.
* nto-low.c (nto_detach): Likewise.
* spu-low.c (spu_detach, spu_join): Likewise.
* win32-low.c (win32_detach, win32_join): Likewise.
* server.c (handle_detach, detach_or_kill_for_exit): Adjust.
* target.h (struct target_ops) <detach, join>: Change parameter to
process_info pointer instead of pid. Adjust all implementations
and callers.
(detach_inferior, join_inferior): Rename 'pid' parameter to
'proc'.
Implement IPv6 support for GDB/gdbserver This patch implements IPv6 support for both GDB and gdbserver. Based on my research, it is the fourth attempt to do that since 2006. Since I used ideas from all of the previous patches, I also added their authors's names on the ChangeLogs as a way to recognize their efforts. For reference sake, you can find the previous attempts at: https://sourceware.org/ml/gdb-patches/2006-09/msg00192.html https://sourceware.org/ml/gdb-patches/2014-02/msg00248.html https://sourceware.org/ml/gdb-patches/2016-02/msg00226.html The basic idea behind the patch is to start using the new 'getaddrinfo'/'getnameinfo' calls, which are responsible for translating names and addresses in a protocol-independent way. This means that if we ever have a new version of the IP protocol, we won't need to change the code again (or, at least, won't have to change the majority of the code). The function 'getaddrinfo' returns a linked list of possible addresses to connect to. Dealing with multiple addresses proved to be a hard task with the current TCP auto-retry mechanism implemented on ser-tcp:net_open. For example, when gdbserver listened only on an IPv4 socket: $ ./gdbserver --once 127.0.0.1:1234 ./a.out and GDB was instructed to try to connect to both IPv6 and IPv4 sockets: $ ./gdb -ex 'target extended-remote localhost:1234' ./a.out the user would notice a somewhat big delay before GDB was able to connect to the IPv4 socket. This happened because GDB was trying to connect to the IPv6 socket first, and had to wait until the connection timed out before it tried to connect to the IPv4 socket. For that reason, I had to rewrite the main loop and implement a new method for handling multiple connections. After some discussion, Pedro and I agreed on the following algorithm: 1) For each entry returned by 'getaddrinfo', we try to open a socket and connect to it. 2.a) If we have a successful 'connect', we just use that connection. 2.b) If we don't have a successfull 'connect', but if we've got a ECONNREFUSED (meaning the the connection was refused), we keep track of this fact by using a flag. 2.c) If we don't have a successfull 'connect', but if we've got a EINPROGRESS (meaning that the connection is in progress), we perform a 'select' call on the socket until we have a result (either a successful connection, or an error on the socket). 3) If tcp_auto_retry is true, and we haven't gotten a successful connection, and at least one of our attempts failed with ECONNREFUSED, then we wait a little bit (i.e., call 'wait_for_connect'), check to see if there was a timeout/interruption (in which case we bail out), and then go back to (1). After multiple tests, I was able to connect without delay on the scenario described above, and was also able to connect in all other types of scenarios. I also implemented some hostname parsing functions (along with their corresponding unit tests) which are used to help GDB and gdbserver to parse hostname strings provided by the user. These new functions are living inside common/netstuff.[ch]. I've had to do that since IPv6 introduces a new URL scheme, which defines that square brackets can be used to enclose the host part and differentiate it from the port (e.g., "[::1]:1234" means "host ::1, port 1234"). I spent some time thinking about a reasonable way to interpret what the user wants, and I came up with the following: - If the user has provided a prefix that doesn't specify the protocol version (i.e., "tcp:" or "udp:"), or if the user has not provided any prefix, don't make any assumptions (i.e., assume AF_UNSPEC when dealing with 'getaddrinfo') *unless* the host starts with "[" (in which case, assume it's an IPv6 host). - If the user has provided a prefix that does specify the protocol version (i.e., "tcp4:", "tcp6:", "udp4:" or "udp6:"), then respect that. This method doesn't follow strictly what RFC 2732 proposes (that literal IPv6 addresses should be provided enclosed in "[" and "]") because IPv6 addresses still can be provided without square brackets in our case, but since we have prefixes to specify protocol versions I think this is not an issue. Another thing worth mentioning is the new 'GDB_TEST_SOCKETHOST' testcase parameter, which makes it possible to specify the hostname (without the port) to be used when testing GDB and gdbserver. For example, to run IPv6 tests: $ make check-gdb RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp6:[::1]' Or, to run IPv4 tests: $ make check-gdb RUNTESTFLAGS='GDB_TEST_SOCKETHOST=tcp4:127.0.0.1' This required a few changes on the gdbserver-base.exp, and also a minimal adjustment on gdb.server/run-without-local-binary.exp. Finally, I've implemented a new testcase, gdb.server/server-connect.exp, which is supposed to run on the native host and perform various "smoke tests" using different connection methods. This patch has been regression-tested on BuildBot and locally, and also built using a x86_64-w64-mingw32 GCC, and no problems were found. gdb/ChangeLog: 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> Tsutomu Seki <sekiriki@gmail.com> Pedro Alves <palves@redhat.com> * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add 'unittests/parse-connection-spec-selftests.c'. (COMMON_SFILES): Add 'common/netstuff.c'. (HFILES_NO_SRCDIR): Add 'common/netstuff.h'. * NEWS (Changes since GDB 8.2): Mention IPv6 support. * common/netstuff.c: New file. * common/netstuff.h: New file. * ser-tcp.c: Include 'netstuff.h' and 'wspiapi.h'. (wait_for_connect): Update comment. New parameter 'gdb::optional<int> sock' instead of 'struct serial *scb'. Use 'sock' directly instead of 'scb->fd'. (try_connect): New function, with code from 'net_open'. (net_open): Rewrite main loop to deal with multiple sockets/addresses. Handle IPv6-style hostnames; implement support for IPv6 connections. * unittests/parse-connection-spec-selftests.c: New file. gdb/gdbserver/ChangeLog: 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> Tsutomu Seki <sekiriki@gmail.com> * Makefile.in (SFILES): Add '$(srcdir)/common/netstuff.c'. (OBS): Add 'common/netstuff.o'. (GDBREPLAY_OBS): Likewise. * gdbreplay.c: Include 'wspiapi.h' and 'netstuff.h'. (remote_open): Implement support for IPv6 connections. * remote-utils.c: Include 'netstuff.h', 'filestuff.h' and 'wspiapi.h'. (handle_accept_event): Accept connections from IPv6 sources. (remote_prepare): Handle IPv6-style hostnames; implement support for IPv6 connections. (remote_open): Implement support for printing connections from IPv6 sources. gdb/testsuite/ChangeLog: 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> Tsutomu Seki <sekiriki@gmail.com> * README (Testsuite Parameters): Mention new 'GDB_TEST_SOCKETHOST' parameter. * boards/native-extended-gdbserver.exp: Do not set 'sockethost' by default. * boards/native-gdbserver.exp: Likewise. * gdb.server/run-without-local-binary.exp: Improve regexp used for detecting when a remote debugging connection succeeds. * gdb.server/server-connect.exp: New file. * lib/gdbserver-support.exp (gdbserver_default_get_comm_port): Do not prefix the port number with ":". (gdbserver_start): New global GDB_TEST_SOCKETHOST. Implement support for detecting and using it. Add '$debughost_gdbserver' to the list of arguments used to start gdbserver. Handle case when gdbserver cannot resolve a network name. gdb/doc/ChangeLog: 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> Tsutomu Seki <sekiriki@gmail.com> * gdb.texinfo (Remote Connection Commands): Add explanation about new IPv6 support. Add new connection prefixes.
2018-05-18 07:29:24 +02:00
2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Paul Fertser <fercerpav@gmail.com>
Tsutomu Seki <sekiriki@gmail.com>
* Makefile.in (SFILES): Add '$(srcdir)/common/netstuff.c'.
(OBS): Add 'common/netstuff.o'.
(GDBREPLAY_OBS): Likewise.
* gdbreplay.c: Include 'wspiapi.h' and 'netstuff.h'.
(remote_open): Implement support for IPv6
connections.
* remote-utils.c: Include 'netstuff.h', 'filestuff.h'
and 'wspiapi.h'.
(handle_accept_event): Accept connections from IPv6 sources.
(remote_prepare): Handle IPv6-style hostnames; implement
support for IPv6 connections.
(remote_open): Implement support for printing connections from
IPv6 sources.
GDBserver: Don't assume a current process in D;PID implementation (PR gdb/23377) This fixes a gdb.base/multi-forks.exp regression with GDBserver. Git commit f2ffa92bbce9 ("gdb: Eliminate the 'stop_pc' global") caused the regression by exposing a latent bug in gdbserver. The bug is that GDBserver's implementation of the D;PID packet incorrectly assumes that the selected thread points to the process being detached. This happens via the any_persistent_commands call, which calls current_process: (gdb) bt #0 0x000000000040a57e in internal_error(char const*, int, char const*, ...) (file=0x4a53c0 "src/gdb/gdbserver/inferiors.c", line=212, fmt=0x4a539e "%s: Assertion `%s' failed.") at src/gdb/gdbserver/../common/errors.c:54 #1 0x0000000000420acf in current_process() () at src/gdb/gdbserver/inferiors.c:212 #2 0x00000000004226a0 in any_persistent_commands() () at gdb/gdbserver/mem-break.c:308 #3 0x000000000042cb43 in handle_detach(char*) (own_buf=0x6f0280 "D;62ea") at src/gdb/gdbserver/server.c:1210 #4 0x0000000000433af3 in process_serial_event() () at src/gdb/gdbserver/server.c:4055 #5 0x0000000000434878 in handle_serial_event(int, void*) (err=0, client_data=0x0) The "eliminate stop_pc" commit exposes the problem because before that commit, GDB's switch_to_thread always read the newly-selected thread's PC, and that would end up forcing GDBserver's selected thread to change accordingly as side effect. After that commit, GDB no longer reads the thread's PC, and GDBserver does not switch the thread. Fix this by removing the assumption from GDBserver. gdb/gdbserver/ChangeLog: 2018-07-11 Pedro Alves <palves@redhat.com> PR gdb/23377 * mem-break.c (any_persistent_commands): Add process_info parameter and use it instead of relying on the current process. Change return type to bool. * mem-break.h (any_persistent_commands): Add process_info parameter and change return type to bool. * server.c (handle_detach): Remove require_running_or_return call. Look up the process_info for the process we're about to detach. If not found, return back error to GDB. Adjust any_persistent_commands call to pass down a process pointer.
2018-07-12 00:31:44 +02:00
2018-07-11 Pedro Alves <palves@redhat.com>
PR gdb/23377
* mem-break.c (any_persistent_commands): Add process_info
parameter and use it instead of relying on the current process.
Change return type to bool.
* mem-break.h (any_persistent_commands): Add process_info
parameter and change return type to bool.
* server.c (handle_detach): Remove require_running_or_return call.
Look up the process_info for the process we're about to detach.
If not found, return back error to GDB. Adjust
any_persistent_commands call to pass down a process pointer.
GDBserver: Fix "Cond. jump or move depends on uninit value" in x87 code Running gdbserver under Valgrind I get: ==26925== Conditional jump or move depends on uninitialised value(s) ==26925== at 0x473E7F: i387_cache_to_xsave(regcache*, void*) (i387-fp.c:579) ==26925== by 0x46E3ED: x86_fill_xstateregset(regcache*, void*) (linux-x86-low.c:418) ==26925== by 0x45E747: regsets_store_inferior_registers(regsets_info*, regcache*) (linux-low.c:5456) ==26925== by 0x45EEF8: linux_store_registers(regcache*, int) (linux-low.c:5731) ==26925== by 0x426441: regcache_invalidate_thread(thread_info*) (regcache.c:89) ==26925== by 0x45CCAF: linux_resume_one_lwp_throw(lwp_info*, int, int, siginfo_t*) (linux-low.c:4447) ==26925== by 0x45CE2A: linux_resume_one_lwp(lwp_info*, int, int, siginfo_t*) (linux-low.c:4519) ==26925== by 0x45E17C: proceed_one_lwp(thread_info*, lwp_info*) (linux-low.c:5216) ==26925== by 0x45DC81: linux_resume_one_thread(thread_info*, bool) (linux-low.c:5031) ==26925== by 0x45DD34: linux_resume(thread_resume*, unsigned long)::{lambda(thread_info*)#2}::operator()(thread_info*) const (linux-low.c:5095) ==26925== by 0x462907: void for_each_thread<linux_resume(thread_resume*, unsigned long)::{lambda(thread_info*)#2}>(linux_resume(thread_resume*, unsigned long)::{lambda(thread_info*)#2}) (gdbthread.h:150) ==26925== by 0x45DE62: linux_resume(thread_resume*, unsigned long) (linux-low.c:5093) ==26925== ==26925== Conditional jump or move depends on uninitialised value(s) ==26925== at 0x473EBD: i387_cache_to_xsave(regcache*, void*) (i387-fp.c:586) ==26925== by 0x46E3ED: x86_fill_xstateregset(regcache*, void*) (linux-x86-low.c:418) ==26925== by 0x45E747: regsets_store_inferior_registers(regsets_info*, regcache*) (linux-low.c:5456) ==26925== by 0x45EEF8: linux_store_registers(regcache*, int) (linux-low.c:5731) ==26925== by 0x426441: regcache_invalidate_thread(thread_info*) (regcache.c:89) ==26925== by 0x45CCAF: linux_resume_one_lwp_throw(lwp_info*, int, int, siginfo_t*) (linux-low.c:4447) ==26925== by 0x45CE2A: linux_resume_one_lwp(lwp_info*, int, int, siginfo_t*) (linux-low.c:4519) ==26925== by 0x45E17C: proceed_one_lwp(thread_info*, lwp_info*) (linux-low.c:5216) ==26925== by 0x45DC81: linux_resume_one_thread(thread_info*, bool) (linux-low.c:5031) ==26925== by 0x45DD34: linux_resume(thread_resume*, unsigned long)::{lambda(thread_info*)#2}::operator()(thread_info*) const (linux-low.c:5095) ==26925== by 0x462907: void for_each_thread<linux_resume(thread_resume*, unsigned long)::{lambda(thread_info*)#2}>(linux_resume(thread_resume*, unsigned long)::{lambda(thread_info*)#2}) (gdbthread.h:150) ==26925== by 0x45DE62: linux_resume(thread_resume*, unsigned long) (linux-low.c:5093) The problem is a type/width mismatch in code like this, in gdbserver/i387-fp.c: /* Some registers are 16-bit. */ collect_register_by_name (regcache, "fctrl", &val); fp->fctrl = val; In the above code: #1 - 'val' is a 64-bit unsigned long. #2 - "fctrl" is 32-bit in the register cache, thus half of 'val' is left uninitialized by collect_register_by_name, which works with an untyped raw buffer output (i.e., void*). #3 - fp->fctrl is an unsigned short (16-bit). For some such registers we're masking off the uninitialized bits with 0xffff, but not in all cases. We end up in such a fragile situation because collect_registers_by_name works with an untyped output buffer pointer, making it easy to pass a pointer to a variable of the wrong size. Fix this by using regcache_raw_get_unsigned instead (actually a new regcache_raw_get_unsigned_by_name wrapper), which always returns a zero-extended ULONGEST register value. It ends up simplifying the i387-tdep.c code a bit, even. gdb/gdbserver/ChangeLog: 2018-07-11 Pedro Alves <palves@redhat.com> * i387-fp.c (i387_cache_to_fsave, cache_to_fxsave) (i387_cache_to_xsave): Use regcache_raw_get_unsigned_by_name instead of collect_register_by_name. * regcache.c (regcache_raw_get_unsigned_by_name): New. * regcache.h (regcache_raw_get_unsigned_by_name): New.
2018-07-11 20:49:19 +02:00
2018-07-11 Pedro Alves <palves@redhat.com>
* i387-fp.c (i387_cache_to_fsave, cache_to_fxsave)
(i387_cache_to_xsave): Use regcache_raw_get_unsigned_by_name
instead of collect_register_by_name.
* regcache.c (regcache_raw_get_unsigned_by_name): New.
* regcache.h (regcache_raw_get_unsigned_by_name): New.
2018-07-04 Vyacheslav Barinov <v.barinov@samsung.com>
Pedro Alves <palves@redhat.com>
* linux-low.c (initialize_low): Call linux_proc_init_warnings.
2018-06-11 22:45:22 +02:00
2018-07-03 Tom Tromey <tom@tromey.com>
* linux-low.c: Update.
* lynx-low.c: Update.
* mem-break.c: Update.
* nto-low.c: Update.
* remote-utils.c: Update.
* server.c: Update.
* spu-low.c: Update.
* target.c: Update.
* win32-low.c: Update.
2018-07-03 Tom Tromey <tom@tromey.com>
* server.c: Update.
2018-07-03 Tom Tromey <tom@tromey.com>
* linux-low.c: Update.
2018-07-03 Tom Tromey <tom@tromey.com>
* target.c: Update.
Remove ptid_get_lwp This removes ptid_get_lwp in favor of calling the ptid_t::lwp method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_get_lwp): Remove. * common/ptid.h (ptid_get_lwp): Don't declare. * aarch64-linux-nat.c: Update. * ada-tasks.c: Update. * aix-thread.c: Update. * amd64-linux-nat.c: Update. * arm-linux-nat.c: Update. * corelow.c: Update. * fbsd-nat.c: Update. * fbsd-tdep.c: Update. * gnu-nat.c: Update. * i386-cygwin-tdep.c: Update. * i386-gnu-nat.c: Update. * i386-linux-nat.c: Update. * ia64-linux-nat.c: Update. * inf-ptrace.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-tdep.c: Update. * linux-thread-db.c: Update. * mips-linux-nat.c: Update. * nat/aarch64-linux-hw-point.c: Update. * nat/aarch64-linux.c: Update. * nat/linux-btrace.c: Update. * nat/linux-osdata.c: Update. * nat/linux-procfs.c: Update. * nat/x86-linux-dregs.c: Update. * obsd-nat.c: Update. * ppc-fbsd-nat.c: Update. * ppc-linux-nat.c: Update. * procfs.c: Update. * python/py-infthread.c: Update. * ravenscar-thread.c: Update. * remote.c: Update. * s390-linux-nat.c: Update. * sol-thread.c: Update. * sol2-tdep.c: Update. * spu-linux-nat.c: Update. * x86-linux-nat.c: Update. * xtensa-linux-nat.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * linux-mips-low.c: Update. * lynx-low.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * server.c: Update. * spu-low.c: Update. * target.c: Update. * thread-db.c: Update.
2018-06-11 20:10:09 +02:00
2018-07-03 Tom Tromey <tom@tromey.com>
* linux-low.c: Update.
* linux-mips-low.c: Update.
* lynx-low.c: Update.
* nto-low.c: Update.
* remote-utils.c: Update.
* server.c: Update.
* spu-low.c: Update.
* target.c: Update.
* thread-db.c: Update.
Remove ptid_get_pid This removes ptid_get_pid in favor of calling the ptid_t::pid method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_get_pid): Remove. * common/ptid.h (ptid_get_pid): Don't declare. * aarch64-linux-nat.c: Update. * ada-lang.c: Update. * aix-thread.c: Update. * alpha-bsd-nat.c: Update. * amd64-fbsd-nat.c: Update. * amd64-linux-nat.c: Update. * arm-linux-nat.c: Update. * arm-nbsd-nat.c: Update. * auxv.c: Update. * break-catch-syscall.c: Update. * breakpoint.c: Update. * bsd-uthread.c: Update. * corelow.c: Update. * ctf.c: Update. * darwin-nat.c: Update. * fbsd-nat.c: Update. * fbsd-tdep.c: Update. * gcore.c: Update. * gnu-nat.c: Update. * hppa-nbsd-nat.c: Update. * hppa-obsd-nat.c: Update. * i386-fbsd-nat.c: Update. * ia64-linux-nat.c: Update. * inf-ptrace.c: Update. * infcmd.c: Update. * inferior.c: Update. * inferior.h: Update. * inflow.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-tdep.c: Update. * linux-thread-db.c: Update. * m68k-bsd-nat.c: Update. * mi/mi-interp.c: Update. * mi/mi-main.c: Update. * mips-linux-nat.c: Update. * mips-nbsd-nat.c: Update. * mips64-obsd-nat.c: Update. * nat/aarch64-linux-hw-point.c: Update. * nat/aarch64-linux.c: Update. * nat/linux-btrace.c: Update. * nat/linux-osdata.c: Update. * nat/linux-procfs.c: Update. * nat/x86-linux-dregs.c: Update. * nto-procfs.c: Update. * obsd-nat.c: Update. * ppc-linux-nat.c: Update. * ppc-nbsd-nat.c: Update. * ppc-obsd-nat.c: Update. * proc-service.c: Update. * procfs.c: Update. * python/py-inferior.c: Update. * python/py-infthread.c: Update. * ravenscar-thread.c: Update. * record.c: Update. * remote-sim.c: Update. * remote.c: Update. * rs6000-nat.c: Update. * s390-linux-nat.c: Update. * sh-nbsd-nat.c: Update. * sol-thread.c: Update. * sparc-nat.c: Update. * sparc64-tdep.c: Update. * spu-linux-nat.c: Update. * spu-tdep.c: Update. * target-debug.h: Update. * target.c: Update. * thread.c: Update. * tid-parse.c: Update. * tracefile-tfile.c: Update. * vax-bsd-nat.c: Update. * windows-nat.c: Update. * x86-linux-nat.c: Update. * x86-nat.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * linux-mips-low.c: Update. * lynx-low.c: Update. * mem-break.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * server.c: Update. * spu-low.c: Update. * target.c: Update. * tracepoint.c: Update.
2018-06-11 20:05:27 +02:00
2018-07-03 Tom Tromey <tom@tromey.com>
* linux-low.c: Update.
* linux-mips-low.c: Update.
* lynx-low.c: Update.
* mem-break.c: Update.
* nto-low.c: Update.
* remote-utils.c: Update.
* server.c: Update.
* spu-low.c: Update.
* target.c: Update.
* tracepoint.c: Update.
2018-07-03 Tom Tromey <tom@tromey.com>
* linux-low.c: Update.
* linux-ppc-low.c: Update.
* linux-x86-low.c: Update.
* proc-service.c: Update.
* server.c: Update.
* spu-low.c: Update.
* thread-db.c: Update.
* win32-low.c: Update.
2018-07-03 Tom Tromey <tom@tromey.com>
* linux-low.c: Update.
* lynx-low.c: Update.
* nto-low.c: Update.
* remote-utils.c: Update.
* spu-low.c: Update.
* thread-db.c: Update.
* win32-low.c: Update.
Add missing parameter to 'amd64_create_target_description' (and unbreak build) While building gdbserver on GNU/Linux, the build failed with: ../../../binutils-gdb/gdb/gdbserver/linux-x86-tdesc.c: In function ‘const target_desc* amd64_linux_read_description(uint64_t, bool)’: ../../../binutils-gdb/gdb/gdbserver/linux-x86-tdesc.c:121:67: error: too few arguments to function ‘target_desc* amd64_create_target_description(uint64_t, bool, bool, bool)’ *tdesc = amd64_create_target_description (xcr0, is_x32, true); ^ In file included from ../../../binutils-gdb/gdb/gdbserver/linux-x86-tdesc.c:26:0: ../../../binutils-gdb/gdb/gdbserver/../arch/amd64.h:21:14: note: declared here target_desc *amd64_create_target_description (uint64_t xcr0, bool is_x32, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ According to Joel Brobecker: > I think the parameter should be set to "true". Otherwise, it will > not include the fs_base and gs_base register in the list of registers. > Although the name of the source file says x86, the code itself is > protected by... > > #ifdef __x86_64__ > > ... and is inside a function called amd64_linux_read_description. > I also verified that this file gets compiled on amd64-linux platforms. > See gdb/gdbserver/configure.srv: > > x86_64-*-linux*) srv_regobj="$srv_amd64_linux_regobj $srv_i386_linux_regobj" > > The last piece of confirmation is that setting the parameter to "true" > provides the behavior before the parameter was added; and the reason > for adding the parameter was to remove the {fs,gs}_base registers > from the list for Windows only. Therefore I'm pushing the patch to unbreak the build. gdb/gdbserver/ChangeLog: 2018-06-29 Joel Brobecker <brobecker@adacore.com> * linux-x86-tdesc.c (amd64_linux_read_description): Add missing parameter in call to 'amd64_create_target_description'.
2018-06-30 03:36:42 +02:00
2018-06-29 Joel Brobecker <brobecker@adacore.com>
* linux-x86-tdesc.c (amd64_linux_read_description): Add missing
parameter in call to 'amd64_create_target_description'.
2018-06-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* x86-tdesc.h: Remove executable permission flag.
Bump to autoconf 2.69 and automake 1.15.1 When trying to run the update-gnulib.sh script in gdb, I get this: Error: Wrong automake version (Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^ =:+{}]+)}/ at /opt/automake/1.11.1/bin/automake line 4113.), we need 1.11.1. Aborting. Apparently, it's an issue with a regex in automake that triggers a warning starting with Perl 5.22. It has been fixed in automake 1.15.1. So I think it's a good excuse to bump the versions of autoconf and automake used in the gnulib import. And to avoid requiring multiple builds of autoconf/automake, it was suggested that we bump the required version of those tools for all binutils-gdb. For autoconf, the 2.69 version is universally available, so it's an easy choice. For automake, different distros and distro versions have different automake versions. But 1.15.1 seems to be the most readily available as a package. In any case, it's easy to build it from source. I removed the version checks from AUTOMAKE_OPTIONS and AC_PREREQ, because I don't think they are useful in our case. They only specify a lower bound for the acceptable version of automake/autoconf. That's useful if you let the user choose the version of the tool they want to use, but want to set a minimum version (because you use a feature that was introduced in that version). In our case, we force people to use a specific version anyway. For the autoconf version, we have the check in config/override.m4 that enforces the version we want. It will be one less thing to update next time we change autotools version. I hit a few categories of problems that required some changes. They are described below along with the chosen solutions. Problem 1: configure.ac:17: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see: configure.ac:17: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation Solution 1: Adjust the code based on the example at that URL. Problem 2 (in zlib/): Makefile.am: error: required file './INSTALL' not found Makefile.am: 'automake --add-missing' can install 'INSTALL' Makefile.am: error: required file './NEWS' not found Makefile.am: error: required file './AUTHORS' not found Makefile.am: error: required file './COPYING' not found Makefile.am: 'automake --add-missing' can install 'COPYING' Solution 2: Add the foreign option to AUTOMAKE_OPTIONS. Problem 3: doc/Makefile.am:20: error: support for Cygnus-style trees has been removed Solution 3: Remove the cygnus options. Problem 4: Makefile.am:656: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') Solution 4: Rename "INCLUDES = " to "AM_CPPFLAGS += " (because AM_CPPFLAGS is already defined earlier). Problem 5: doc/Makefile.am:71: warning: suffix '.texinfo' for Texinfo files is discouraged; use '.texi' instead doc/Makefile.am: warning: Oops! doc/Makefile.am: It appears this file (or files included by it) are triggering doc/Makefile.am: an undocumented, soon-to-be-removed automake hack. doc/Makefile.am: Future automake versions will no longer place in the builddir doc/Makefile.am: (rather than in the srcdir) the generated '.info' files that doc/Makefile.am: appear to be cleaned, by e.g. being listed in CLEANFILES or doc/Makefile.am: DISTCLEANFILES. doc/Makefile.am: If you want your '.info' files to be placed in the builddir doc/Makefile.am: rather than in the srcdir, you have to use the shiny new doc/Makefile.am: 'info-in-builddir' automake option. Solution 5: Rename .texinfo files to .texi. Problem 6: doc/Makefile.am: warning: Oops! doc/Makefile.am: It appears this file (or files included by it) are triggering doc/Makefile.am: an undocumented, soon-to-be-removed automake hack. doc/Makefile.am: Future automake versions will no longer place in the builddir doc/Makefile.am: (rather than in the srcdir) the generated '.info' files that doc/Makefile.am: appear to be cleaned, by e.g. being listed in CLEANFILES or doc/Makefile.am: DISTCLEANFILES. doc/Makefile.am: If you want your '.info' files to be placed in the builddir doc/Makefile.am: rather than in the srcdir, you have to use the shiny new doc/Makefile.am: 'info-in-builddir' automake option. Solution 6: Remove the hack at the bottom of doc/Makefile.am and use the info-in-builddir automake option. Problem 7: doc/Makefile.am:35: error: required file '../texinfo.tex' not found doc/Makefile.am:35: 'automake --add-missing' can install 'texinfo.tex' Solution 7: Use the no-texinfo.tex automake option. We also have one in texinfo/texinfo.tex, not sure if we should point to that, or move it (or a newer version of it added with automake --add-missing) to top-level. Problem 8: Makefile.am:131: warning: source file 'config/tc-aarch64.c' is in a subdirectory, Makefile.am:131: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. Solution 8: Use subdir-objects, that means adjusting references to some .o that will now be in config/. Problem 9: configure.ac:375: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2601: _AC_COMPILE_IFELSE is expanded from... ../../lib/autoconf/general.m4:2617: AC_COMPILE_IFELSE is expanded from... ../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... ../../lib/autoconf/general.m4:2042: AC_CACHE_VAL is expanded from... ../../lib/autoconf/general.m4:2063: AC_CACHE_CHECK is expanded from... configure.ac:375: the top level Solution 9: Use AC_LANG_SOURCE, or use proper quoting. Problem 10 (in intl/): configure.ac:7: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS /usr/share/aclocal/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from... /usr/share/aclocal/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from... /usr/share/aclocal/threadlib.m4:318: gl_THREADLIB is expanded from... /usr/share/aclocal/lock.m4:9: gl_LOCK is expanded from... /usr/share/aclocal/intl.m4:211: gt_INTL_SUBDIR_CORE is expanded from... /usr/share/aclocal/intl.m4:25: AM_INTL_SUBDIR is expanded from... /usr/share/aclocal/gettext.m4:57: AM_GNU_GETTEXT is expanded from... configure.ac:7: the top level Solution 10: Add AC_USE_SYSTEM_EXTENSIONS in configure.ac. ChangeLog: * libtool.m4: Use AC_LANG_SOURCE. * configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE. * README-maintainer-mode: Update version requirements. * ar-lib: New file. * test-driver: New file. * configure: Re-generate. bfd/ChangeLog: * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11. (INCLUDES): Rename to ... (AM_CPPFLAGS): ... this. * configure.ac: Remove AC_PREREQ. * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add info-in-builddir no-texinfo.tex. (info_TEXINFOS): Rename bfd.texinfo to bfd.texi. * doc/bfd.texinfo: Rename to ... * doc/bfd.texi: ... this. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * config.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. binutils/ChangeLog: * configure.ac: Remove AC_PREREQ. * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, add info-in-builddir no-texinfo.tex. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * config.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. config/ChangeLog: * override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69. etc/ChangeLog: * configure.in: Remove AC_PREREQ. * configure: Re-generate. gas/ChangeLog: * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11, add subdir-objects. (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O): Add config/ prefix. * configure.ac (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O, emfiles, extra_objects): Add config/ prefix. * doc/as.texinfo: Rename to... * doc/as.texi: ... this. * doc/Makefile.am: Rename as.texinfo to as.texi throughout. Remove DISTCLEANFILES hack. (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add no-texinfo.tex and info-in-builddir. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * config.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. gdb/ChangeLog: * common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_STRING, PACKAGE_TARNAME): Undefine. * configure.ac: Remove AC_PREREQ, add missing quoting. * gnulib/configure.ac: Modernize usage of AC_INIT/AM_INIT_AUTOMAKE. Remove AC_PREREQ. * gnulib/update-gnulib.sh (AUTOCONF_VERSION): Bump to 2.69. (AUTOMAKE_VERSION): Bump to 1.15.1. * configure: Re-generate. * config.in: Re-generate. * aclocal.m4: Re-generate. * gnulib/aclocal.m4: Re-generate. * gnulib/config.in: Re-generate. * gnulib/configure: Re-generate. * gnulib/import/Makefile.in: Re-generate. gdb/gdbserver/ChangeLog: * configure.ac: Remove AC_PREREQ, add missing quoting. * configure: Re-generate. * config.in: Re-generate. * aclocal.m4: Re-generate. gdb/testsuite/ChangeLog: * configure.ac: Remove AC_PREREQ. * configure: Re-generate. gold/ChangeLog: * configure.ac: Remove AC_PREREQ, add missing quoting and usage of AC_LANG_SOURCE. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. * testsuite/Makefile.in: Re-generate. gprof/ChangeLog: * configure.ac: Remove AC_PREREQ. * Makefile.am: Remove DISTCLEANFILES hack. (AUTOMAKE_OPTIONS): Remove 1.11, add info-in-builddir. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. * gconfig.in: Re-generate. intl/ChangeLog: * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ. * configure: Re-generate. * config.h.in: Re-generate. * aclocal.m4: Re-generate. ld/ChangeLog: * configure.ac: Remove AC_PREREQ. * Makefile.am: Remove DISTCLEANFILES hack, rename ld.texinfo to ld.texi, ldint.texinfo to ldint.texi throughout. (AUTOMAKE_OPTIONS): Add info-in-builddir. * README: Rename ld.texinfo to ld.texi, ldint.texinfo to ldint.texi throughout. * gen-doc.texi: Likewise. * h8-doc.texi: Likewise. * ld.texinfo: Rename to ... * ld.texi: ... this. * ldint.texinfo: Rename to ... * ldint.texi: ... this. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * config.in: Re-generate. * configure: Re-generate. libdecnumber/ChangeLog: * configure.ac: Remove AC_PREREQ. * configure: Re-generate. * aclocal.m4. libiberty/ChangeLog: * configure.ac: Remove AC_PREREQ. * configure: Re-generate. * config.in: Re-generate. opcodes/ChangeLog: * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11. * configure.ac: Remove AC_PREREQ. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. readline/ChangeLog.gdb: * configure: Re-generate. * examples/rlfe/configure: Re-generate. sim/ChangeLog: * All configure.ac: Remove AC_PREREQ. * All configure: Re-generate. zlib/ChangeLog.bin-gdb: * configure.ac: Modernize AC_INIT call, remove AC_PREREQ. * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate.
2018-06-19 22:54:48 +02:00
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Remove AC_PREREQ, add missing quoting.
* configure: Re-generate.
* config.in: Re-generate.
* aclocal.m4: Re-generate.
2018-06-18 Simon Marchi <simon.marchi@ericsson.com>
* tracepoint.h (current_traceframe): Remove declaration.
2018-06-18 Alan Hayward <alan.hayward@arm.com>
* linux-aarch64-low.c (is_sve_tdesc): New function.
(aarch64_sve_regs_copy_to_regcache): Likewise.
(aarch64_sve_regs_copy_from_regcache): Likewise.
(aarch64_regs_info): Add SVE checks.
(initialize_low_arch): Initialize SVE.
Ptrace support for Aarch64 SVE Add support for reading and writing registers for Aarch64 SVE. We need to support the cases where the kernel only gives us a fpsimd structure. This occurs when there is no active SVE state in the kernel (for example, after starting a new process). Added checks to make sure the vector length has not changed whilst the process is running. gdb/ * aarch64-linux-nat.c (fetch_sveregs_from_thread): New function. (store_sveregs_to_thread): Likewise. (aarch64_linux_fetch_inferior_registers): Check for SVE. (aarch64_linux_store_inferior_registers): Likewise. * nat/aarch64-sve-linux-ptrace.c (aarch64_sve_get_sveregs): New function. (aarch64_sve_regs_copy_to_regcache): Likewise. (aarch64_sve_regs_copy_from_regcache): Likewise. * nat/aarch64-sve-linux-ptrace.h (aarch64_sve_get_sveregs): New declaration. (aarch64_sve_regs_copy_to_regcache): Likewise. (aarch64_sve_regs_copy_from_regcache): Likewise. (sve_context): Structure from Linux headers. (SVE_SIG_ZREGS_SIZE): Define from Linux headers. (SVE_SIG_ZREG_SIZE): Likewise. (SVE_SIG_PREG_SIZE): Likewise. (SVE_SIG_FFR_SIZE): Likewise. (SVE_SIG_REGS_OFFSET): Likewise. (SVE_SIG_ZREGS_OFFSET): Likewise. (SVE_SIG_ZREG_OFFSET): Likewise. (SVE_SIG_ZREGS_SIZE): Likewise. (SVE_SIG_PREGS_OFFSET): Likewise. (SVE_SIG_PREG_OFFSET): Likewise. (SVE_SIG_PREGS_SIZE): Likewise. (SVE_SIG_FFR_OFFSET): Likewise. (SVE_SIG_REGS_SIZE): Likewise. (SVE_SIG_CONTEXT_SIZE): Likewise. (SVE_PT_REGS_MASK): Likewise. (SVE_PT_REGS_FPSIMD): Likewise. (SVE_PT_REGS_SVE): Likewise. (SVE_PT_VL_INHERIT): Likewise. (SVE_PT_VL_ONEXEC): Likewise. (SVE_PT_REGS_OFFSET): Likewise. (SVE_PT_FPSIMD_OFFSET): Likewise. (SVE_PT_FPSIMD_SIZE): Likewise. (SVE_PT_SVE_ZREG_SIZE): Likewise. (SVE_PT_SVE_PREG_SIZE): Likewise. (SVE_PT_SVE_FFR_SIZE): Likewise. (SVE_PT_SVE_FPSR_SIZE): Likewise. (SVE_PT_SVE_FPCR_SIZE): Likewise. (__SVE_SIG_TO_PT): Likewise. (SVE_PT_SVE_OFFSET): Likewise. (SVE_PT_SVE_ZREGS_OFFSET): Likewise. (SVE_PT_SVE_ZREG_OFFSET): Likewise. (SVE_PT_SVE_ZREGS_SIZE): Likewise. (SVE_PT_SVE_PREGS_OFFSET): Likewise. (SVE_PT_SVE_PREG_OFFSET): Likewise. (SVE_PT_SVE_PREGS_SIZE): Likewise. (SVE_PT_SVE_FFR_OFFSET): Likewise. (SVE_PT_SVE_FPSR_OFFSET): Likewise. (SVE_PT_SVE_FPCR_OFFSET): Likewise. (SVE_PT_SVE_SIZE): Likewise. (SVE_PT_SIZE): Likewise. (HAS_SVE_STATE): New define. gdbserver/ * Makefile.in: Add aarch64-sve-linux-ptrace.c.
2018-06-15 13:21:31 +02:00
2018-06-18 Alan Hayward <alan.hayward@arm.com>
* Makefile.in: Add aarch64-sve-linux-ptrace.c.
2018-06-11 Alan Hayward <alan.hayward@arm.com>
* linux-aarch64-ipa.c (get_ipa_tdesc): Add null VQ param.
(initialize_low_tracepoint): Likewise
* linux-aarch64-low.c (aarch64_arch_setup): Get VQ.
* linux-aarch64-tdesc-selftest.c (aarch64_tdesc_test): Add null VQ
param.
* linux-aarch64-tdesc.c (aarch64_linux_read_description): Add VQ
checks.
* linux-aarch64-tdesc.h (aarch64_linux_read_description): Add VQ.
2018-06-11 Alan Hayward <alan.hayward@arm.com>
* server.h (PBUFSIZ): Increase size
2018-06-11 Alan Hayward <alan.hayward@arm.com>
* regcache.c (regcache::raw_compare): New function.
* regcache.h (regcache::raw_compare): New declaration.
2018-06-11 Alan Hayward <alan.hayward@arm.com>
* regcache.c (new_register_cache): Use new.
(free_register_cache): Use delete.
(register_data): Use const.
(supply_register): Move body inside regcache.
(regcache::raw_supply): New override function.
(collect_register): Move body inside regcache.
(regcache::raw_collect): New override function.
(regcache::get_register_status): New override function.
* regcache.h (struct regcache): Inherit from reg_buffer_common.
2018-06-09 Tom Tromey <tom@tromey.com>
* event-loop.c (gdb_event, gdb_event_p): Remove typedefs. Don't
declare queue.
(event_queue): Use std::queue.
(gdb_event_xfree): Remove.
(initialize_event_loop, process_event, wait_for_event): Update.
2018-06-08 Stan Cox <scox@redhat.com>
* win32-low.c (win32_create_inferior): last_ptid and last_status
moved to client_state.
2018-06-08 Pedro Alves <palves@redhat.com>
* Makefile.in (GDBREPLAY_OBS): Add common/cleanups.o,
common/common-exceptions.o, common/common-utils.o,
common/errors.o, common/print-utils.o and utils.o.
* gdbreplay.c: Include "common-defs.h" instead of the two
'config.h's here. Don't include stdio.h, errno.h, stdlib.h,
string.h or alloca.h.
(perror_with_name): Delete.
(remote_open): Use xstrdup instead of strdup.
(main): Rename to ...
(captured_main): ... this.
(main): New.
2018-06-08 Tom Tromey <tom@tromey.com>
* linux-low.c (linux_low_read_btrace): Update.
2018-06-04 Stan Cox <scox@redhat.com>
* server.h (struct client_state): New.
* server.c (cont_thread, general_thread, multi_process)
(report_fork_events, report_vfork_events, report_exec_events)
(report_thread_events, swbreak_feature, hwbreak_feature)
(vCont_supported, disable_randomization, pass_signals)
(program_signals, program_signals_p, last_status, last_ptid, own_buf):
Moved to client_state.
* remote-utils.c (remote_debug, noack_mode)
(transport_is_reliable): Moved to client_state.
* tracepoint.c (current_traceframe): Moved to client_state.
Update all callers.
* server.c, remote-utils.c, tracepoint.c, fork-child.c,
linux-low.c, remote-utils.h, target.c: Use client_state.
2018-05-31 Alan Hayward <alan.hayward@arm.com>
* configure.srv: Add new c/h file.
2018-05-31 Alan Hayward <alan.hayward@arm.com>
* linux-aarch64-tdesc.c (aarch64_linux_read_description): Add
null VQ.
MIPS/Linux: Correct o32 core file FGR interpretation Our interpretation of the layout of floating-point general registers (FGRs) in o32 MIPS/Linux core files is different from how the kernel makes them, affecting the CP0 Status.FR=0 aka FP32 mode (we don't currently support the CP0 Status.FR=1 aka FP64 mode with the o32 ABI). In the FP32 mode pairs of consecutive even/odd-numbered 32-bit registers are placed together as 64-bit values in even-indexed 64-bit slots corresponding to the even index, leaving the odd-indexed 64-bit slots unused. These 64-bit values are stored according to the endianness in effect, which is how the MIPS II SDC1 instruction would store them. It has always been like that with the Linux kernel for MIPS II and higher ISA processors, which are the vast majority ever supported, as it is indeed SDC1 that the kernel uses to store FGRs in a floating-point context. With MIPS I processors, which lack the SDC1 instruction, a layout that we expect used to be used long ago, but it was corrected for consistency with newer processors back in 2002, with `linux-mips.org' (LMO) commit 42533948caac ("Major pile of FP emulator changes."), the fix corrected with LMO commit 849fa7a50dff ("R3k FPU ptrace() handling fixes."), and then broken and fixed over and over again, until last time fixed with commit 80cbfad79096 ("MIPS: Correct MIPS I FP context layout"). Consequently the values we see in FP32 core files or produce with the `gcore' command are different from those obtained from the same FP context of a live process, e.g. with a big-endian configuration these live values: (gdb) info registers float f0: 0x4b5c6d7e flt: 14445950 dbl: 1.7446153562345001e-274 f1: 0x0718293a flt: 1.14473244e-34 f2: 0xc3d4e5f6 flt: -425.79657 dbl: -1.046160437414959e-233 f3: 0x8f90a1b2 flt: -1.42617791e-29 f4: 0x4c5d6e7f flt: 58046972 dbl: 1.1908587841220294e-269 f5: 0x08192a3b flt: 4.60914044e-34 f6: 0xc4d5e6f7 flt: -1711.21765 dbl: -6.2784661835068965e-306 f7: 0x8091a2b3 flt: -1.33745124e-38 f8: 0x45566778 flt: 3430.4668 dbl: 1.6530355595710607e-303 f9: 0x01122334 flt: 2.68412219e-38 f10: 0xcddeeff0 flt: -467533312 dbl: -2.1174864564135575e-262 f11: 0x899aabbc flt: -3.72356497e-33 f12: 0x46576879 flt: 13786.1182 dbl: 1.143296486773654e-298 f13: 0x02132435 flt: 1.08102453e-37 f14: 0xcedfe0f1 flt: -1.87803046e+09 dbl: -1.4399511533369862e-257 f15: 0x8a9bacbd flt: -1.4990934e-32 f16: 0x4758697a flt: 55401.4766 dbl: 7.8856820439568725e-294 f17: 0x03142536 flt: 4.3536007e-37 f18: 0xcfd0e1f2 flt: -7.00893696e+09 dbl: -9.7791926757340559e-253 f19: 0x8b9cadbe flt: -6.03504325e-32 f20: 0x48596a7b flt: 222633.922 dbl: 5.4255001483306113e-289 f21: 0x04152637 flt: 1.75324132e-36 f22: 0xc0d1e2f3 flt: -6.55895376 dbl: -6.6332401002310683e-248 f23: 0x8c9daebf flt: -2.42948516e-31 f24: 0x495a6b7c flt: 894647.75 dbl: 3.7244369058749787e-284 f25: 0x05162738 flt: 7.06016945e-36 f26: 0xc1d2e3f4 flt: -26.3613052 dbl: -4.4941535759306202e-243 f27: 0x8d9eafb0 flt: -9.77979703e-31 f28: 0x4a5b6c7d flt: 3595039.25 dbl: 2.5514593711161396e-279 f29: 0x06172839 flt: 2.84294945e-35 f30: 0xc2d3e4f5 flt: -105.947182 dbl: -3.035646690850097e-238 f31: 0x8e9fa0b1 flt: -3.93512664e-30 fcsr: 0x0 fir: 0xf30000 (gdb) show up in a core file as these: (gdb) info registers float f0: 0x0718293a flt: 1.14473244e-34 dbl: nan f1: 0x7ff80000 flt: nan f2: 0x8f90a1b2 flt: -1.42617791e-29 dbl: nan f3: 0x7ff80000 flt: nan f4: 0x08192a3b flt: 4.60914044e-34 dbl: nan f5: 0x7ff80000 flt: nan f6: 0x8091a2b3 flt: -1.33745124e-38 dbl: nan f7: 0x7ff80000 flt: nan f8: 0x01122334 flt: 2.68412219e-38 dbl: nan f9: 0x7ff80000 flt: nan f10: 0x899aabbc flt: -3.72356497e-33 dbl: nan f11: 0x7ff80000 flt: nan f12: 0x02132435 flt: 1.08102453e-37 dbl: nan f13: 0x7ff80000 flt: nan f14: 0x8a9bacbd flt: -1.4990934e-32 dbl: nan f15: 0x7ff80000 flt: nan f16: 0x03142536 flt: 4.3536007e-37 dbl: nan f17: 0x7ff80000 flt: nan f18: 0x8b9cadbe flt: -6.03504325e-32 dbl: nan f19: 0x7ff80000 flt: nan f20: 0x04152637 flt: 1.75324132e-36 dbl: nan f21: 0x7ff80000 flt: nan f22: 0x8c9daebf flt: -2.42948516e-31 dbl: nan f23: 0x7ff80000 flt: nan f24: 0x05162738 flt: 7.06016945e-36 dbl: nan f25: 0x7ff80000 flt: nan f26: 0x8d9eafb0 flt: -9.77979703e-31 dbl: nan f27: 0x7ff80000 flt: nan f28: 0x06172839 flt: 2.84294945e-35 dbl: nan f29: 0x7ff80000 flt: nan f30: 0x8e9fa0b1 flt: -3.93512664e-30 dbl: nan f31: 0x7ff80000 flt: nan (gdb) Notice how values from odd-numbered registers are shown in corresponding even-numbered registers and how dummy 0x7ff80000 NaN values, which the kernel places in unused slots, are reported in odd-numbered registers. Correct our intepretation then, to match the kernel's. As it happens the o32 FGR core file representation matches that used by the `ptrace' PTRACE_GETFPREGS request, which means our 64-bit handlers can be readily used, as they already correctly handle the differences between o32 FP32 mode vs n32/n64 representations. Adjust comments accordingly throughout, in particular remove a reference to the r3000/tx39 MIPS I processor peculiarity, long irrelevant. Add a test case to verify correctness. Avoid GCC bugs and limitations in the test case where possible; the test case still fails to build with GCC 8 and the o32 FP64 mode (i.e. with `-mips32r2 -mfp64' options) giving: mips-fpregset-core.c: In function 'main': mips-fpregset-core.c:66:3: error: inconsistent operand constraints in an 'asm' asm ( ^~~ (GCC PR target/85909), but that is not a concern for us as yet, because as noted above we do not currently support the o32 FP64 mode anyway. gdb/ * mips-linux-tdep.h (mips_supply_fpregset, mips_fill_fpregset): Remove prototypes. * mips-linux-nat.c (supply_fpregset): Always call `mips64_supply_fpregset' rather than `mips_supply_fpregset'. (fill_fpregset): Always call `mips64_fill_fpregset' rather than `mips_fill_fpregset'. * mips-linux-tdep.c (mips_supply_fpregset) (mips_supply_fpregset_wrapper, mips_fill_fpregset) (mips_fill_fpregset_wrapper): Remove functions. (mips64_supply_fpregset, mips64_fill_fpregset): Update comments. (mips_linux_fpregset): Remove variable. (mips_linux_iterate_over_regset_sections): Use `mips64_linux_fpregset' in place of `mips_linux_fpregset'. (mips_linux_o32_sigframe_init): Remove comment. gdb/testsuite/ * gdb.arch/mips-fpregset-core.exp: New test. * gdb.arch/mips-fpregset-core.c: New test source.
2018-05-25 13:37:45 +02:00
2018-05-25 Maciej W. Rozycki <macro@mips.com>
* gdb.arch/mips-fpregset-core.exp: New test.
* gdb.arch/mips-fpregset-core.c: New test source.
2018-05-23 Erik Kurzinger <ekurzinger@nvidia.com>
PR server/23198
* hostio.c (require_int): Do not report overflow for integers
between 0xfffffff and 0x7fffffff.
MIPS/gdbserver: Correctly handle narrow big-endian register transfers Fix an issue with `gdbserver' on big-endian n64 MIPS targets, where $dspctl is 32-bit while the `ptrace' transfer data type is 64-bit. Such register data is held in the low order 32 bits of the 64-bit data quantity exchanged with the buffer used by `fetch_register' and `store_register', however `supply_register' and `collect_register' access the same data as a 32-bit quantity. Consequently the register is presented and written as all-zeros held in the most-significant part of the big-endian 64-bit data quantity represented in the buffer: (gdb) info registers zero at v0 v1 R0 0000000000000000 0000000000000001 0000000000000001 0000000000000000 a0 a1 a2 a3 R4 00000001200212b0 0000000000000000 0000000000000021 000000012001a260 a4 a5 a6 a7 R8 000000012001a260 0000000000000004 800000010c60c000 fffffffffffffff8 t0 t1 t2 t3 R12 0000000000000000 000000fff7edab68 0000000000000001 0000000000000000 s0 s1 s2 s3 R16 000000fff7ee2068 0000000120008b80 0000000000000000 0000000000000000 s4 s5 s6 s7 R20 000000000052e5c8 000000000052f008 0000000000000000 0000000000000000 t8 t9 k0 k1 R24 0000000000000000 00000001200027c0 0000000000000000 0000000000000000 gp sp s8 ra R28 00000001200212b0 000000ffffffc850 000000ffffffc850 0000000120005ee8 status lo hi badvaddr 0000000000109cf3 0000000000943efe 000000000000000e 000000012001a008 cause pc 0000000000800024 0000000120005ee8 fcsr fir hi1 lo1 0e800000 00f30000 0000000000000000 0101010101010101 hi2 lo2 hi3 lo3 0202020202020202 0303030303030303 0404040404040404 0505050505050505 dspctl restart 00000000 0000000000000000 (gdb) Correct this problem then by using the `mips_supply_register' `mips_collect_register' accessors for 32-bit registers where the `ptrace' data type is 64-bit. These accessors already operate on 32-bit data quantities held in 64-bit containers: (gdb) info registers zero at v0 v1 R0 0000000000000000 0000000000000001 0000000000000001 0000000000000000 a0 a1 a2 a3 R4 00000001200212b0 0000000000000000 0000000000000021 000000012001a260 a4 a5 a6 a7 R8 000000012001a260 0000000000000004 800000010d82e900 fffffffffffffff8 t0 t1 t2 t3 R12 0000000000000000 000000fff7edab68 0000000000000001 0000000000000000 s0 s1 s2 s3 R16 000000fff7ee2068 0000000120008b80 0000000000000000 0000000000000000 s4 s5 s6 s7 R20 000000000052e5c8 000000000052f008 0000000000000000 0000000000000000 t8 t9 k0 k1 R24 0000000000000000 00000001200027c0 0000000000000000 0000000000000000 gp sp s8 ra R28 00000001200212b0 000000ffffffc850 000000ffffffc850 0000000120005ee8 status lo hi badvaddr 0000000000109cf3 0000000000943efe 000000000000000e 000000012001a008 cause pc 0000000000800024 0000000120005ee8 fcsr fir hi1 lo1 0e800000 00f30000 0000000000000000 0101010101010101 hi2 lo2 hi3 lo3 0202020202020202 0303030303030303 0404040404040404 0505050505050505 dspctl restart 55aa33cc 0000000000000000 (gdb) gdb/gdbserver/ * linux-mips-low.c [HAVE_PTRACE_GETREGS] (mips_collect_register) (mips_supply_register): Move outside HAVE_PTRACE_GETREGS. (mips_collect_ptrace_register, mips_supply_ptrace_register): New functions. (the_low_target): Wire them.
2018-05-22 23:52:14 +02:00
2018-05-22 Maciej W. Rozycki <macro@mips.com>
* linux-mips-low.c [HAVE_PTRACE_GETREGS] (mips_collect_register)
(mips_supply_register): Move outside HAVE_PTRACE_GETREGS.
(mips_collect_ptrace_register, mips_supply_ptrace_register): New
functions.
(the_low_target): Wire them.
[PowerPC] Fix access to VSCR in linux targets The 4-byte VSCR register is found inside a 16-byte field in the regset returned by ptrace and in core files. The position of VSCR depends on the endianess of the target, which was previously assumed to be big-endian for the purpose of getting VSCR. This patch removes this assumption to fix access to VSCR in little-endian mode. gdb/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * ppc-tdep.h (struct ppc_reg_offsets): Remove vector register offset fields. * ppc-fbsd-tdep.c (ppc32_fbsd_reg_offsets): Remove initializers for vector register offset fields. (ppc64_fbsd_reg_offsets): Likewise. * ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Remove assignment to vector register offset fields. * ppc-obsd-tdep.c (_initialize_ppcnbsd_tdep): Remove assignment to vector register offset fields. * ppc-obsd-nat.c (_initialize_ppcobsd_nat): Remove assignment to vector register offset fields. * rs6000-aix-tdep.c (rs6000_aix32_reg_offsets): Remove initializers for vector register offset fields. (rs6000_aix64_reg_offsets): Likewise. * rs6000-tdep.c (ppc_vrreg_offset): Remove. (ppc_supply_vrregset): Remove. (ppc_collect_vrregset): Remove. * ppc-linux-tdep.c (ppc_linux_collect_vrregset): New function. (ppc_linux_vrregset) : New function. (ppc32_le_linux_vrregmap, ppc32_be_linux_vrregmap) (ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): New globals. (ppc32_linux_vrregset): Remove. (ppc_linux_iterate_over_regset_sections): Call ppc_linux_vrregset and use result instead of ppc32_linux_vrregset. (ppc32_linux_reg_offsets): Remove initializers for vector register offset fields. (ppc64_linux_reg_offsets): Likewise. * ppc-linux-tdep.h (ppc_linux_vrregset): New declaration. * ppc-linux-nat.c: Include regset.h. (gdb_vrregset_t): Adjust comment to account for little-endian mode. (supply_vrregset, fill_vrregset): Remove. (fetch_altivec_register, store_altivec_register): Remove. (fetch_altivec_registers): Add regno parameter. Get regset using ppc_linux_vrregset. Use regset to supply registers. (store_altivec_registers): Add regno parameter. Get regset using ppc_linux_vrregset. Use regset to collect registers. (fetch_register): Call fetch_altivec_registers instead of fetch_altivec_register. (store_register): Call store_altivec_registers instead of store_altivec_register. (fetch_ppc_registers): Call fetch_altivec_registers with -1 for the new regno parameter. (store_ppc_registers): Call store_altivec_registers with -1 for the new regno parameter. gdb/gdbserver/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * linux-ppc-low.c (ppc_fill_vrregset): Add vscr_offset variable. Set vscr_offset to 0 in little-endian mode and 12 in big-endian mode. Call collect_register_by_name with vscr using vscr_offset. Zero-pad vscr and vrsave fields in collector buffer. (ppc_store_vrregset): Add and set vscr_offset variable as in ppc_fill_vrregset. Call supply_register_by_name with vscr using vscr_offset.
2018-05-22 16:09:05 +02:00
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* linux-ppc-low.c (ppc_fill_vrregset): Add vscr_offset variable.
Set vscr_offset to 0 in little-endian mode and 12 in big-endian
mode. Call collect_register_by_name with vscr using
vscr_offset. Zero-pad vscr and vrsave fields in collector buffer.
(ppc_store_vrregset): Add and set vscr_offset variable as in
ppc_fill_vrregset. Call supply_register_by_name with vscr using
vscr_offset.
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* linux-ppc-low.c (SIZEOF_VSXREGS, SIZEOF_VRREGS): Remove.
(ppc_arch_setup): Change SIZEOF_VRREGS and SIZEOF_VSXREGS to
PPC_LINUX_SIZEOF_VRREGSET and PPC_LINUX_SIZEOF_VSXREGSET.
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* linux-ppc-low.c (ppc_fill_vsxregset): Remove ppc_hwcap check.
(ppc_store_vsxregset): Likewise.
(ppc_fill_vrregset): Likewise.
(ppc_store_vrregset): Likewise.
(ppc_fill_evrregset): Likewise.
(ppc_store_evrregset): Likewise.
(ppc_regsets): Set VSX/VR/EVR regset sizes to 0.
(ppc_arch_setup): Iterate through ppc_regsets and set sizes when
needed.
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* linux-ppc-low.c (ppc_arch_setup): Remove code for getting the
wordsize of the inferior. Call ppc_linux_target_wordsize.
[PowerPC] Consolidate linux target description selection Share target description declarations and selection among ppc linux native targets, core files, gdbserver and IPA. To avoid complicated define guards, gdbserver and IPA now have declarations for all descriptions, including 64-bit generated descriptions when compiled in 32-bit mode. These have always been linked into the gdbserver and IPA binaries. Because they might be uninitialized, the selection function checks that the selected description is initialized. gdb/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * arch/ppc-linux-common.c: New file. * arch/ppc-linux-common.h: New file. * arch/ppc-linux-tdesc.h: New file. * configure.tgt (powerpc*-*-linux*): Add arch/ppc-linux-common.o. * Makefile.in (ALL_TARGET_OBS): Add arch/ppc-linux-common.o. (HFILES_NO_SRCDIR): Add arch/ppc-linux-common.h and arch/ppc-linux-tdesc.h. * ppc-linux-nat.c: Include arch/ppc-linux-common.h and arch/ppc-linux-tdesc.h. (ppc_linux_nat_target::read_description): Remove target description matching code. Fill a ppc_linux_features struct and call ppc_linux_match_description with it. Move comment about ISA 2.05 to ppc-linux-common.c. * ppc-linux-tdep.c: Include arch/ppc-linux-common.h and arch/ppc-linux-tdesc.h. (ppc_linux_core_read_description): Remove target description matching code. Fill a ppc_linux_features struct and call ppc_linux_match_description with it. * ppc-linux-tdep.h (tdesc_powerpc_32l, tdesc_powerpc_64l) (tdesc_powerpc_altivec32l, tdesc_powerpc_altivec64l) (tdesc_powerpc_cell32l, tdesc_powerpc_cell64l) (tdesc_powerpc_vsx32l, tdesc_powerpc_vsx64l) (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_64l) (tdesc_powerpc_isa205_altivec32l, tdesc_powerpc_isa205_altivec64l) (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_isa205_vsx64l) (tdesc_powerpc_e500l): Remove. gdb/gdbserver/ChangeLog: 2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com> * configure.srv (srv_tgtobj): Add arch/ppc-linux-common.o. * Makefile.in (SFILES): Add arch/ppc-linux-common.c. * linux-ppc-tdesc.h: Rename to linux-ppc-tdesc-init.h. * linux-ppc-tdesc-init.h (tdesc_powerpc_32l, tdesc_powerpc_64l) (tdesc_powerpc_altivec32l, tdesc_powerpc_altivec64l) (tdesc_powerpc_cell32l, tdesc_powerpc_cell64l) (tdesc_powerpc_vsx32l, tdesc_powerpc_vsx64l) (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_64l) (tdesc_powerpc_isa205_altivec32l, tdesc_powerpc_isa205_altivec64l) (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_isa205_vsx64l) (tdesc_powerpc_e500l): Remove. * linux-ppc-ipa.c: Include arch/ppc-linux-tdesc.h and linux-ppc-tdesc-init.h. Don't include linux-ppc-tdesc.h. * linux-ppc-low.c: Include arch/ppc-linux-common.h, arch/ppc-linux-tdesc.h, and linux-ppc-tdesc-init.h. Don't include linux-ppc-tdesc.h. (ppc_arch_setup): Remove target description matching code. Fill a ppc_linux_features struct and call ppc_linux_match_description with it.
2018-05-22 16:09:05 +02:00
2018-05-22 Pedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
* configure.srv (srv_tgtobj): Add arch/ppc-linux-common.o.
* Makefile.in (SFILES): Add arch/ppc-linux-common.c.
* linux-ppc-tdesc.h: Rename to linux-ppc-tdesc-init.h.
* linux-ppc-tdesc-init.h (tdesc_powerpc_32l, tdesc_powerpc_64l)
(tdesc_powerpc_altivec32l, tdesc_powerpc_altivec64l)
(tdesc_powerpc_cell32l, tdesc_powerpc_cell64l)
(tdesc_powerpc_vsx32l, tdesc_powerpc_vsx64l)
(tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_64l)
(tdesc_powerpc_isa205_altivec32l, tdesc_powerpc_isa205_altivec64l)
(tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_isa205_vsx64l)
(tdesc_powerpc_e500l): Remove.
* linux-ppc-ipa.c: Include arch/ppc-linux-tdesc.h and
linux-ppc-tdesc-init.h. Don't include linux-ppc-tdesc.h.
* linux-ppc-low.c: Include arch/ppc-linux-common.h,
arch/ppc-linux-tdesc.h, and linux-ppc-tdesc-init.h. Don't include
linux-ppc-tdesc.h.
(ppc_arch_setup): Remove target description matching code. Fill a
ppc_linux_features struct and call ppc_linux_match_description
with it.
MIPS/Linux: Disable n32 USR `ptrace' accesses to 64-bit registers On the MIPS target DSP ASE registers can only be accessed with the PTRACE_PEEKUSR and PTRACE_POKEUSR `ptrace' requests. With the n32 ABI these requests only pass 32-bit data quantities, which are narrower than the width of DSP accumulator registers, which are 64-bit. Generic code is prepared to transfer registers wider than the `ptrace' data type by offsetting into the USR address space, by the data width transferred. That however does not work with the MIPS target, because of how the API has been defined, where USR register addresses are actually indices rather than offsets. Consequently given address `a' using `a + 4' accesses the fourth next register rather than the upper half of the original register. With native debugging this causes clobbered register contents, as well as access failures as locations beyond the available USR space are addressed: (gdb) info registers zero at v0 v1 R0 0000000000000000 0000000000000001 0000000000000001 0000000000000000 a0 a1 a2 a3 R4 0000000010019158 0000000000000000 0000000000000011 0000000010019160 a4 a5 a6 a7 R8 0000000010019160 fffffffffff00000 fffffffffffffff8 0000000000000000 t0 t1 t2 t3 R12 0000000010019150 0000000000000001 0000000000000001 000000000000000f s0 s1 s2 s3 R16 0000000077ee6f20 0000000010007bb0 0000000000000000 0000000000000000 s4 s5 s6 s7 R20 000000000052e668 000000000052f008 0000000000000000 0000000000000000 t8 t9 k0 k1 R24 0000000000000001 0000000010019010 0000000000000000 0000000000000000 gp sp s8 ra R28 0000000010020280 000000007fff4c10 000000007fff4c10 0000000010004f48 status lo hi badvaddr 0000000000109cf3 0000000000943efe 000000000000000e 000000001001900c cause pc 0000000000800024 0000000010004f48 fcsr fir hi1 lo1 0e800000 00f30000 0000000004040404 0101010105050505 hi2 lo2 hi3 lo3 0202020255aa33cc Couldn't read register (#75): Input/output error. (gdb) With `gdbserver' this makes debugging impossible due to a fatal failure: (gdb) target remote :2346 Remote debugging using :2346 Reading symbols from .../sysroot/mips-r2-hard/lib32/ld.so.1...done. 0x77fc3d50 in __start () from .../sysroot/mips-r2-hard/lib32/ld.so.1 (gdb) continue Continuing. warning: Remote failure reply: E01 Remote communication error. Target disconnected.: Connection reset by peer. (gdb) Correct the problem by marking any register in the MIPS backend whose width exceeds the width of the `ptrace' data type unavailable for the purpose of PTRACE_PEEKUSR and PTRACE_POKEUSR requests: (gdb) info registers zero at v0 v1 R0 0000000000000000 0000000000000001 0000000000000001 0000000000000000 a0 a1 a2 a3 R4 0000000010019158 0000000000000000 0000000000000011 0000000010019160 a4 a5 a6 a7 R8 0000000010019160 fffffffffff00000 fffffffffffffff8 0000000000000000 t0 t1 t2 t3 R12 0000000010019150 0000000000000001 0000000000000001 000000000000000f s0 s1 s2 s3 R16 0000000077ee6f20 0000000010007bb0 0000000000000000 0000000000000000 s4 s5 s6 s7 R20 000000000052e5c8 000000000052f008 0000000000000000 0000000000000000 t8 t9 k0 k1 R24 0000000000000001 0000000010019010 0000000000000000 0000000000000000 gp sp s8 ra R28 0000000010020280 000000007fff4be0 000000007fff4be0 0000000010004f48 status lo hi badvaddr 0000000000109cf3 0000000000943efe 000000000000000e 000000001001900c cause pc 0000000000800024 0000000010004f48 fcsr fir hi1 lo1 0e800000 00f30000 <unavailable> <unavailable> hi2 lo2 hi3 lo3 <unavailable> <unavailable> <unavailable> <unavailable> dspctl restart 55aa33cc 0000000000000000 (gdb) as there is no way to access full contents of these registers with the limited API available anyway. This obviously does not affect general-purpose registers (which use the PTRACE_GETREGS and PTRACE_SETREGS requests for access) or floating-point general registers (which use PTRACE_GETFPREGS and PTRACE_SETFPREGS). And $dspctl, being 32-bit, remains accessible too, which is important for BPOSGE32 branch decoding in single-stepping. For DSP accumulator access with the n32 ABI a new `ptrace' API is required on the kernel side. gdb/ * mips-linux-nat.c (mips64_linux_register_addr): Return -1 if the width of the requested register exceeds the width of the `ptrace' data type. gdb/gdbserver/ * linux-mips-low.c (mips_cannot_fetch_register): Return 1 if the width of the requested register exceeds the width of the `ptrace' data type. (mips_cannot_store_register): Likewise.
2018-05-22 02:52:35 +02:00
2018-05-22 Maciej W. Rozycki <macro@mips.com>
* linux-mips-low.c (mips_cannot_fetch_register): Return 1 if the
width of the requested register exceeds the width of the
`ptrace' data type.
(mips_cannot_store_register): Likewise.
MIPS/gdbserver: Fix issues with $zero register reads Consistently supply hardwired $zero as a zeroed register, correcting issues with the PTRACE_GETREGS path that currently copies the value of $restart into $zero as illustrated by this program: $ cat read.c int main (void) { char buf[1024]; ssize_t size; size = read (0, buf, sizeof (buf)); return size; } $ and this corresponding debug session: (gdb) break main Breakpoint 1 at 0x120000970: file read.c, line 9. (gdb) target remote :2346 Remote debugging using :2346 Reading symbols from .../sysroot/mips-r2-hard/lib64/ld.so.1...done. 0x000000fff7fca5a0 in __start () from .../sysroot/mips-r2-hard/lib64/ld.so.1 (gdb) continue Continuing. Breakpoint 1, main () at read.c:9 9 size = read (0, buf, sizeof (buf)); (gdb) info registers zero at v0 v1 R0 0000000000000000 0000000000000001 000000fff7ffe710 0000000000000000 a0 a1 a2 a3 R4 0000000000000001 000000ffffffeb88 000000ffffffeb98 0000000000000000 a4 a5 a6 a7 R8 000000fff7fc8800 000000fff7fc38f0 000000ffffffeb80 2f2f2f2f2f2f2f2f t0 t1 t2 t3 R12 0000000000000437 0000000000000002 000000fff7ffd000 0000000120000a00 s0 s1 s2 s3 R16 000000fff7fc7068 0000000120000b90 0000000000000000 0000000000000000 s4 s5 s6 s7 R20 0000000000521d88 0000000000522608 0000000000000000 0000000000000000 t8 t9 k0 k1 R24 0000000000000000 0000000120000970 0000000000000000 0000000000000000 gp sp s8 ra R28 000000fff7fc8800 000000ffffffea50 0000000000000000 000000fff7e4088c status lo hi badvaddr 0000000000109cf3 0000000000005ea5 0000000000000211 000000fff7eadf00 cause pc 0000000000800024 0000000120000970 fcsr fir restart 00000000 00f30000 0000000000000000 (gdb) continue Continuing. ^C Program received signal SIGINT, Interrupt. 0x000000fff7f084ac in __GI___libc_read (fd=0, buf=0xffffffe640, nbytes=1024) at ../sysdeps/unix/sysv/linux/read.c:27 27 return SYSCALL_CANCEL (read, fd, buf, nbytes); (gdb) info registers zero at v0 v1 R0 0000000000001388 0000000000000001 0000000000000200 000000fff7ffe710 a0 a1 a2 a3 R4 0000000000000000 000000ffffffe640 0000000000000400 0000000000000001 a4 a5 a6 a7 R8 000000fff7fc8800 000000fff7fc38f0 000000ffffffeb80 2f2f2f2f2f2f2f2f t0 t1 t2 t3 R12 00000000000005e3 0000000000000002 000000fff7ffd000 000000012000099c s0 s1 s2 s3 R16 000000fff7fc7068 0000000120000b90 0000000000000000 0000000000000000 s4 s5 s6 s7 R20 0000000000521d88 0000000000522608 0000000000000000 0000000000000000 t8 t9 k0 k1 R24 0000000000000000 000000fff7f2da20 0000000000000000 0000000000000000 gp sp s8 ra R28 000000fff7fc8800 000000ffffffe600 0000000000000000 000000012000099c status lo hi badvaddr 0000000000109cf3 00000000000001e6 00000000000000be 000000fff7f08470 cause pc 0000000000800020 000000fff7f084ac fcsr fir restart 00000000 00f30000 0000000000001388 (gdb) and with the PTRACE_PEEKUSR path that does not supply this register at all, causing issues analogous to ones addressed for the native MIPS backend with commit 4e6ff0e1b86f ("MIPS/Linux/native: Supply $zero for the !PTRACE_GETREGS case"): (gdb) info registers zero at v0 v1 R0 <unavailable> 0000000000000001 0000000000000001 0000000000000000 a0 a1 a2 a3 R4 00000001200212b0 0000000000000000 0000000000000021 000000012001a260 a4 a5 a6 a7 R8 000000012001a260 0000000000000004 800000010cab1680 fffffffffffffff8 t0 t1 t2 t3 R12 0000000000000000 000000fff7edab68 0000000000000001 0000000000000000 s0 s1 s2 s3 R16 000000fff7ee2068 0000000120008b80 0000000000000000 0000000000000000 s4 s5 s6 s7 R20 000000000052e5c8 000000000052f008 0000000000000000 0000000000000000 t8 t9 k0 k1 R24 0000000000000000 00000001200027c0 0000000000000000 0000000000000000 gp sp s8 ra R28 00000001200212b0 000000ffffffc880 000000ffffffc880 0000000120005ee8 status lo hi badvaddr <unavailable> 0000000000943efe 000000000000000e 000000012001a008 cause pc 0000000000800024 0000000120005ee8 fcsr fir restart 0e800000 00f30000 0000000000000000 (gdb) and (under certain circumstances): (gdb) next Register 0 is not available (gdb) The problem with PTRACE_GETREGS happens because `mips_store_gregset' supplies the contents of register slot #0, occupied by $restart, to $zero. The problem with PTRACE_PEEKUSR happens because for $zero `mips_cannot_fetch_register' returns one, and no alternative way to supply that register has been defined. Correct `mips_store_gregset' then for the PTRACE_GETREGS case and add `mips_fetch_register' for the PTRACE_PEEKUSR case. gdb/gdbserver/ * linux-mips-low.c (mips_fetch_register): New function. Update preceding comment. (mips_store_gregset): Supply 0 rather than $restart for $zero. (the_low_target): Wire `mips_fetch_register'.
2018-05-22 01:55:08 +02:00
2018-05-21 Maciej W. Rozycki <macro@mips.com>
* linux-mips-low.c (mips_fetch_register): New function. Update
preceding comment.
(mips_store_gregset): Supply 0 rather than $restart for $zero.
(the_low_target): Wire `mips_fetch_register'.
2018-05-10 Joel Brobecker <brobecker@adacore.com>
* lynx-i386-low.c (LYNXOS_178): New macro.
[LYNXOS_178] (usr_fcontext_t): Provide a definition that matches
the layout on LynxOS-178.
(lynx_i386_fill_fpregset, lynx_i386_store_fpregset): Do not
handle floating point registers that are not supported by
LynxOS-178.
2018-05-10 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
gdbserver/Windows: crash during connection establishment phase On Windows, starting a new process with GDBserver seems to work, in the sense that the program does get started, and GDBserver confirms that it is listening for GDB to connect. However, as soon as GDB establishes the connection with GDBserver, and starts discussing with it, GDBserver crashes, with a SEGV. This SEGV occurs in remote-utils.c::prepare_resume_reply... | regp = current_target_desc ()->expedite_regs; | [...] | while (*regp) ... because, in our case, REGP is NULL. This patches fixes the issues by adding a parameter to init_target_desc, in order to make sure that we always provide the list of registers when we initialize a target description. gdb/ChangeLog: PR server/23158: * regformats/regdat.sh: Adjust script, following the addition of the new expedite_regs parameter to init_target_desc. gdb/gdbserver/ChangeLog: PR server/23158: * tdesc.h (init_target_desc) <expedite_regs>: New parameter. * tdesc.c (init_target_desc) <expedite_regs>: New parameter. Use it to set the expedite_regs field in the given tdesc. * x86-tdesc.h: New file. * linux-aarch64-tdesc.c (aarch64_linux_read_description): Adjust following the addition of the new expedite_regs parameter to init_target_desc. * linux-tic6x-low.c (tic6x_read_description): Likewise. * linux-x86-tdesc.c: #include "x86-tdesc.h". (i386_linux_read_description, amd64_linux_read_description): Adjust following the addition of the new expedite_regs parameter to init_target_desc. * lynx-i386-low.c: #include "x86-tdesc.h". (lynx_i386_arch_setup): Adjust following the addition of the new expedite_regs parameter to init_target_desc. * nto-x86-low.c: #include "x86-tdesc.h". (nto_x86_arch_setup): Adjust following the addition of the new expedite_regs parameter to init_target_desc. * win32-i386-low.c: #include "x86-tdesc.h". (i386_arch_setup): Adjust following the addition of the new expedite_regs parameter to init_target_desc.
2018-05-10 17:27:13 +02:00
2018-05-10 Joel Brobecker <brobecker@adacore.com>
PR server/23158:
* tdesc.h (init_target_desc) <expedite_regs>: New parameter.
* tdesc.c (init_target_desc) <expedite_regs>: New parameter.
Use it to set the expedite_regs field in the given tdesc.
* x86-tdesc.h: New file.
* linux-aarch64-tdesc.c (aarch64_linux_read_description):
Adjust following the addition of the new expedite_regs parameter
to init_target_desc.
* linux-tic6x-low.c (tic6x_read_description): Likewise.
* linux-x86-tdesc.c: #include "x86-tdesc.h".
(i386_linux_read_description, amd64_linux_read_description):
Adjust following the addition of the new expedite_regs parameter
to init_target_desc.
* lynx-i386-low.c: #include "x86-tdesc.h".
(lynx_i386_arch_setup): Adjust following the addition of the new
expedite_regs parameter to init_target_desc.
* nto-x86-low.c: #include "x86-tdesc.h".
(nto_x86_arch_setup): Adjust following the addition of the new
expedite_regs parameter to init_target_desc.
* win32-i386-low.c: #include "x86-tdesc.h".
(i386_arch_setup): Adjust following the addition of the new
expedite_regs parameter to init_target_desc.
gdbserver/Windows: Fix "no program to debug" error Trying to start a program with GDBserver on Windows yields the following error: $ gdbserver.exe --once :4444 simple_main.exe Killing process(es): 5008 No program to debug Exiting The error itself comes from the following code shortly after create_inferior gets called (in server.c::main): /* Wait till we are at first instruction in program. */ create_inferior (program_path.get (), program_args); [...] if (last_status.kind == TARGET_WAITKIND_EXITED || last_status.kind == TARGET_WAITKIND_SIGNALLED) was_running = 0; else was_running = 1; if (!was_running && !multi_mode) error ("No program to debug"); What happens is that the "last_status" global starts initialized as zeroes, which means last_status.kind == TARGET_WAITKIND_EXITED, and we expect create_inferior to be waiting for the inferior to start until reaching the SIGTRAP, and to set the "last_status" global to match that last event we received. I suspect this is an unintended side-effect of the following change... commit 2090129c36c7e582943b7d300968d19b46160d84 Date: Thu Dec 22 21:11:11 2016 -0500 Subject: Share fork_inferior et al with gdbserver ... which removes some code in server.c that was responsible for starting the inferior in a functin that was named start_inferior, and looked like this: signal_pid = create_inferior (new_argv[0], &new_argv[0]); [...] /* Wait till we are at 1st instruction in program, return new pid (assuming success). */ last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0); The code has been transitioned to using fork_inferior, but sadly, only for the targets that support it. On Windows, the calls to wait setting "last_status" simply disappeared. This patch adds it back in the Windows-specific implementation of create_inferior. gdb/gdbserver/ChangeLog: PR server/23158: * win32-low.c (win32_create_inferior): Add call to my_wait setting last_status global.
2018-05-10 17:24:33 +02:00
2018-05-10 Joel Brobecker <brobecker@adacore.com>
PR server/23158:
* win32-low.c (win32_create_inferior): Add call to my_wait
setting last_status global.
2018-05-10 Joel Brobecker <brobecker@adacore.com>
PR server/23158:
* win32-low.c (create_process): Only call gdb_tilde_expand if
inferior_cwd is not NULL.
gdb/x86: Handle kernels using compact xsave format For GNU/Linux on x86-64, if the target is using the xsave format for passing the floating-point information from the inferior then there currently exists a bug relating to the x87 control registers, and the mxcsr register. The xsave format allows different floating-point features to be lazily enabled, a bit in the xsave format tells GDB which floating-point features have been enabled, and which have not. Currently in GDB, when reading the floating point state, we check the xsave bit flags, if the feature is enabled then we read the feature from the xsave buffer, and if the feature is not enabled, then we supply the default value from within GDB. Within GDB, when writing the floating point state, we first fetch the xsave state from the target and then, for any feature that is not yet enabled, we write the default values into the xsave buffer. Next we compare the regcache value with the value in the xsave buffer, and, if the value has changed we update the value in the xsave buffer, and mark the feature enabled in the xsave bit flags. The problem then, is that the x87 control registers were not following this pattern. We assumed that these registers were always written out by the kernel, and we always wrote them out to the xsave buffer (but didn't enabled the feature). The result of this is that if the kernel had not yet enabled the x87 feature then within GDB we would see random values for the x87 floating point control registers, and if the user tried to modify one of these register, that modification would be lost. Finally, the mxcsr register was also broken in the same way as the x87 control registers. The added complexity with this case is that the mxcsr register is part of both the avx and sse floating point feature set. When reading or writing this register we need to check that at least one of these features is enabled. This bug was present in native GDB, and within gdbserver. Both are fixed with this commit. gdb/ChangeLog: * common/x86-xstate.h (I387_FCTRL_INIT_VAL): New constant. (I387_MXCSR_INIT_VAL): New constant. * amd64-tdep.c (amd64_supply_xsave): Only read state from xsave buffer if it was supplied by the inferior. * i387-tdep.c (i387_supply_fsave): Use I387_MXCSR_INIT_VAL. (i387_xsave_get_clear_bv): New function. (i387_supply_xsave): Only read x87 control registers from the xsave buffer if the feature is enabled, and the state will have been written, otherwise, provide a suitable default. (i387_collect_xsave): Pre-clear all registers in xsave buffer, including x87 control registers. Update control registers if they have changed from the default value, and mark features as enabled as required. * i387-tdep.h (i387_xsave_get_clear_bv): Declare. gdb/gdbserver/ChangeLog: * i387-fp.c (i387_cache_to_xsave): Only write x87 control registers to the cache if their values have changed. (i387_xsave_to_cache): Provide default values for x87 control registers when these features are available, but disabled. * regcache.c (supply_register_by_name_zeroed): New function. * regcache.h (supply_register_by_name_zeroed): Declare new function. gdb/testsuite/ChangeLog: * gdb.arch/amd64-init-x87-values.S: New file. * gdb.arch/amd64-init-x87-values.exp: New file.
2018-05-03 18:46:14 +02:00
2018-05-08 Andrew Burgess <andrew.burgess@embecosm.com>
* i387-fp.c (i387_cache_to_xsave): Only write x87 control
registers to the cache if their values have changed.
(i387_xsave_to_cache): Provide default values for x87 control
registers when these features are available, but disabled.
* regcache.c (supply_register_by_name_zeroed): New function.
* regcache.h (supply_register_by_name_zeroed): Declare new
function.
2018-05-07 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
2018-05-04 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
aarch64: PR 19806: watchpoints: false negatives + PR 20207 contiguous ones Some unaligned watchpoints were currently missed. On old kernels as specified in kernel RFE: aarch64: ptrace: BAS: Support any contiguous range (edit) https://sourceware.org/bugzilla/show_bug.cgi?id=20207 after this patch some other unaligned watchpoints will get reported as false positives. With new kernels all the watchpoints should work exactly. There may be a regresion that it now less merges watchpoints so that with multiple overlapping watchpoints it may run out of the 4 hardware watchpoint registers. But as discussed in the original thread GDB needs some generic watchpoints merging framework to be used by all the target specific code. Even current FSF GDB code does not merge it perfectly. Also with the more precise watchpoints one can technically merge them less. And I do not think it matters too much to improve mergeability only for old kernels. Still even on new kernels some better merging logic would make sense. There remains one issue: kernel-4.15.14-300.fc27.armv7hl FAIL: gdb.base/watchpoint-unaligned.exp: continue FAIL: gdb.base/watchpoint-unaligned.exp: continue (gdb) continue Continuing. Unexpected error setting watchpoint: Invalid argument. (gdb) FAIL: gdb.base/watchpoint-unaligned.exp: continue But that looks as a kernel bug to me. (1) It is not a regression by this patch. (2) It is unrelated to this patch. gdb/ChangeLog 2018-05-04 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> PR breakpoints/19806 and support for PR external/20207. * NEWS: Mention Aarch64 watchpoint improvements. * aarch64-linux-nat.c (aarch64_linux_stopped_data_address): Fix missed watchpoints and PR external/20207 watchpoints. * nat/aarch64-linux-hw-point.c (kernel_supports_any_contiguous_range): New. (aarch64_watchpoint_offset): New. (aarch64_watchpoint_length): Support PR external/20207 watchpoints. (aarch64_point_encode_ctrl_reg): New parameter offset, new asserts. (aarch64_point_is_aligned): Support PR external/20207 watchpoints. (aarch64_align_watchpoint): New parameters aligned_offset_p and next_addr_orig_p. Support PR external/20207 watchpoints. (aarch64_downgrade_regs): New. (aarch64_dr_state_insert_one_point): New parameters offset and addr_orig. (aarch64_dr_state_remove_one_point): Likewise. (aarch64_handle_breakpoint): Update caller. (aarch64_handle_aligned_watchpoint): Likewise. (aarch64_handle_unaligned_watchpoint): Support addr_orig and aligned_offset. (aarch64_linux_set_debug_regs): Remove const from state. Call aarch64_downgrade_regs. (aarch64_show_debug_reg_state): Print also dr_addr_orig_wp. * nat/aarch64-linux-hw-point.h (DR_CONTROL_LENGTH): Rename to ... (DR_CONTROL_MASK): ... this. (struct aarch64_debug_reg_state): New field dr_addr_orig_wp. (unsigned int aarch64_watchpoint_offset): New prototype. (aarch64_linux_set_debug_regs): Remove const from state. * utils.c (align_up, align_down): Move to ... * common/common-utils.c (align_up, align_down): ... here. * utils.h (align_up, align_down): Move to ... * common/common-utils.h (align_up, align_down): ... here. gdb/gdbserver/ChangeLog 2018-05-04 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * linux-aarch64-low.c (aarch64_stopped_data_address): Likewise. gdb/testsuite/ChangeLog 2018-05-04 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> PR breakpoints/19806 and support for PR external/20207. * gdb.base/watchpoint-unaligned.c: New file. * gdb.base/watchpoint-unaligned.exp: New file.
2018-05-04 22:22:04 +02:00
2018-05-04 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <palves@redhat.com>
* linux-aarch64-low.c (aarch64_stopped_data_address):
Likewise.
2018-04-27 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
2018-04-23 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
2018-04-19 Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (depcomp): Add "..".
(all_deps_files): New and use it.
2018-04-18 Alan Hayward <alan.hayward@arm.com>
* configure.srv (aarch64*-*-linux*): Don't include xml.
(i[34567]86-*-cygwin*): Likewise.
(i[34567]86-*-linux*): Likewise.
(i[34567]86-*-lynxos*): Likewise.
(i[34567]86-*-mingw32ce*): Likewise.
(i[34567]86-*-mingw*): Likewise.
(i[34567]86-*-nto*): Likewise.
(tic6x-*-uclinux): Likewise.
(x86_64-*-linux*): Likewise.
(x86_64-*-mingw*): Likewise.
(x86_64-*-cygwin*): Likewise.
Remove xml file references from target descriptions gdb/ * common/tdesc.h (tdesc_create_feature): Remove xml filename parameter. * features/aarch64-core.c (create_feature_aarch64_core): Regenerate. * features/aarch64-fpu.c (create_feature_aarch64_fpu): Likewise. * features/i386/32bit-avx.c (create_feature_i386_32bit_avx): Likewise. * features/i386/32bit-avx512.c (create_feature_i386_32bit_avx512): Likewise. * features/i386/32bit-core.c (create_feature_i386_32bit_core): Likewise. * features/i386/32bit-linux.c (create_feature_i386_32bit_linux): Likewise. * features/i386/32bit-mpx.c (create_feature_i386_32bit_mpx): Likewise. * features/i386/32bit-pkeys.c (create_feature_i386_32bit_pkeys): Likewise. * features/i386/32bit-sse.c (create_feature_i386_32bit_sse): Likewise. * features/i386/64bit-avx.c (create_feature_i386_64bit_avx): Likewise. * features/i386/64bit-avx512.c (create_feature_i386_64bit_avx512): Likewise. * features/i386/64bit-core.c (create_feature_i386_64bit_core): Likewise. * features/i386/64bit-linux.c (create_feature_i386_64bit_linux): Likewise. * features/i386/64bit-mpx.c (create_feature_i386_64bit_mpx): Likewise. * features/i386/64bit-pkeys.c (create_feature_i386_64bit_pkeys): Likewise. * features/i386/64bit-segments.c (create_feature_i386_64bit_segments): Likewise. * features/i386/64bit-sse.c (create_feature_i386_64bit_sse): Likewise. * features/i386/x32-core.c (create_feature_i386_x32_core): Likewise. * features/tic6x-c6xp.c (create_feature_tic6x_c6xp): Likewise. * features/tic6x-core.c (create_feature_tic6x_core): Likewise. * features/tic6x-gp.c (create_feature_tic6x_gp): Likewise. * target-descriptions.c: In generated code, don't pass xml filename. gdbserver/ * tdesc.c: Remove xml parameter.
2018-04-18 21:49:37 +02:00
2018-04-18 Alan Hayward <alan.hayward@arm.com>
* tdesc.c: Remove xml parameter.
2018-04-18 Alan Hayward <alan.hayward@arm.com>
* server.c (get_features_xml): Remove cast.
* tdesc.c (void target_desc::accept): Fill in function.
(tdesc_get_features_xml): Remove old xml creation.
(print_xml_feature::visit_pre): Add xml vistor.
* tdesc.h (struct target_desc): Make xmltarget mutable.
(tdesc_get_features_xml): Remove declaration.
2018-04-18 Alan Hayward <alan.hayward@arm.com>
* tdesc.c (tdesc_architecture_name): Add new function.
(tdesc_osabi_name): Likewise.
(tdesc_get_features_xml): Use new functions.
Commonise tdesc types and makes use of them in gdbserver tdesc gdb/ * common/tdesc.c (tdesc_predefined_type): Move to here. (tdesc_named_type): Likewise. (tdesc_create_vector): Likewise. (tdesc_create_struct): Likewise. (tdesc_set_struct_size): Likewise. (tdesc_create_union): Likewise. (tdesc_create_flags): Likewise. (tdesc_create_enum): Likewise. (tdesc_add_field): Likewise. (tdesc_add_typed_bitfield): Likewise. (tdesc_add_bitfield): Likewise. (tdesc_add_flag): Likewise. (tdesc_add_enum_value): Likewise. * common/tdesc.h (struct tdesc_type_builtin): Likewise. (struct tdesc_type_vector): Likewise. (struct tdesc_type_field): Likewise. (struct tdesc_type_with_fields): Likewise. (tdesc_create_enum): Add declaration. (tdesc_add_typed_bitfield): Likewise. (tdesc_add_enum_value): Likewise. * target-descriptions.c (tdesc_type_field): Move from here. (tdesc_type_builtin): Likewise. (tdesc_type_vector): Likewise. (tdesc_type_with_fields): Likewise. (tdesc_predefined_types): Likewise. (tdesc_named_type): Likewise. (tdesc_create_vector): Likewise. (tdesc_create_struct): Likewise. (tdesc_set_struct_size): Likewise. (tdesc_create_union): Likewise. (tdesc_create_flags): Likewise. (tdesc_create_enum): Likewise. (tdesc_add_field): Likewise. (tdesc_add_typed_bitfield): Likewise. (tdesc_add_bitfield): Likewise. (tdesc_add_flag): Likewise. (tdesc_add_enum_value): Likewise. * gdb/target-descriptions.h (tdesc_create_enum): Likewise. (tdesc_add_typed_bitfield): Likewise. (tdesc_add_enum_value): Likewise. gdbserver/ * tdesc.c (tdesc_create_flags): Remove. (tdesc_add_flag): Likewise. (tdesc_named_type): Likewise. (tdesc_create_union): Likewise. (tdesc_create_struct): Likewise. (tdesc_create_vector): Likewise. (tdesc_add_bitfield): Likewise. (tdesc_add_field): Likewise. (tdesc_set_struct_size): Likewise.
2018-04-18 12:47:55 +02:00
2018-04-18 Alan Hayward <alan.hayward@arm.com>
* tdesc.c (tdesc_create_flags): Remove.
(tdesc_add_flag): Likewise.
(tdesc_named_type): Likewise.
(tdesc_create_union): Likewise.
(tdesc_create_struct): Likewise.
(tdesc_create_vector): Likewise.
(tdesc_add_bitfield): Likewise.
(tdesc_add_field): Likewise.
(tdesc_set_struct_size): Likewise.
2018-04-18 Alan Hayward <alan.hayward@arm.com>
* tdesc.c (~target_desc): Remove implictly deleted items.
(init_target_desc): Iterate all features.
(tdesc_get_features_xml): Use vector.
(tdesc_create_feature): Create feature.
* tdesc.h (tdesc_feature) Remove
(target_desc): Add features.
2018-04-18 Alan Hayward <alan.hayward@arm.com>
* Makefile.in: Add common/tdesc.c
* tdesc.c (init_target_desc): init all reg_defs from register
vector.
(tdesc_create_reg): Create tdesc_reg.
* tdesc.h (tdesc_feature): Add register vector.
2018-03-30 Simon Marchi <simon.marchi@polymtl.ca>
* tdesc.h (struct target_desc) <features>: Change type to
std::vector<std::string>.
* tdesc.c (target_desc::~target_desc): Adjust to std::vector
changes.
(tdesc_get_features_xml): Likewise.
(tdesc_create_feature): Likewise.
2018-03-26 Alan Hayward <alan.hayward@arm.com>
* regcache.c (find_register_by_number): Return a ref.
(find_regno): Use references.
(register_size): Likewise.
(register_data): Likewise.
* tdesc.c (target_desc::~target_desc): Remove free calls.
(target_desc::operator==): Use std::vector compare.
(init_target_desc): Use reference.
(tdesc_create_reg): Use reg constructors.
* tdesc.h (struct target_desc): Replace pointer with object.
2018-03-23 Alan Hayward <alan.hayward@arm.com>
* regcache.c (find_register_by_number): Make static.
(find_regno): Use find_register_by_number
* regcache.h (struct reg): Remove declaration.
2018-03-23 Alan Hayward <alan.hayward@arm.com>
* tdesc.c (target_desc::~target_desc): Move to here.
(target_desc::operator==): Likewise.
* tdesc.h (target_desc::~target_desc): Move from here.
(target_desc::operator==): Likewise.
2018-03-22 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-s390-low.c (s390_get_wordsize): Correct brace style.
2018-03-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-s390-ipa.c (get_ipa_tdesc): Add handling for
S390_TDESC_GS.
* linux-s390-low.c (s390_get_ipa_tdesc_idx): Likewise.
(initialize_low_tracepoint): Call init_registers_s390x_gs_linux64
and init_registers_s390_gs_linux64.
2018-03-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-s390-low.c (s390_fill_gs): Remove function.
(s390_fill_gsbc): Remove function.
(s390_regsets): Set fill functions for the guarded storage regsets
to NULL.
2018-03-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-s390-low.c (s390_get_hwcap): Replace tdesc parameter by
the word size. Add comment.
(s390_get_wordsize): New function.
(s390_arch_setup): No longer select a temporary tdesc to fetch the
pswm with it. Instead, use s390_get_wordsize to determine the
word size first and derive the correct tdesc from that directly.
Add silent Makefile rules Many projects (e.g. the Linux kernel) and build systems use "silent" rules, which means that they'll only print a summary of what's being done instead of printing all the detailed command lines. While chatting on the #gdb IRC channel, I realized a few people (including me) thought it would be nice to have it in GDB too. The idea is that too much text is not useful, the important information gets lost. If there's only the essential information, it's more likely to be useful. Most of the time, when I look at the build output, it's to see how it's progressing. By just printing a brief summary of each operation, I can easily spot what's currently being compiled and therefore how the build progresses (with time you know the order in which files are compiled almost by heart). As with other projects (Linux, automake-based things, probably others), it's possible to print the complete command lines by passing V=1 to make (or any other non-zero value). I had one hesitation about this: when people report build failures, we are more likely to miss the full compile command line. We'll probably sometimes need to ask people to include the build log with "make V=1". I don't think it's a big downside, if other projects the size of the Linux kernel can live with it, I'm sure we can too. gdb/ChangeLog: * silent-rules.mk: New. * Makefile.in: Include silent-rules.mk (srcdir, VPATH, top_srcdir): Move up. (COMPILE): Add ECHO_CXX. (test-cp-name-parser$(EXEEXT)): Add ECHO_CXXLD. (init.c): Add ECHO_INIT_C. (gdb$(EXEEXT)): Add SILENCE and ECHO_CXXLD. (version.c): Add ECHO_GEN. (printcmd.o): Add ECHO_CXX. (target-float.o): Add ECHO_CXX. (ada-exp.o): Add ECHO_CXX. (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN. (insight$(EXEEXT)): Add ECHO_CXXLD. * gnulib/configure.ac: Add AM_SILENT_RULES. * gnulib/aclocal.m4: Re-generate. * gnulib/configure: Re-generate. * gnulib/import/Makefile.in: Re-generate. gdb/gdbserver/ChangeLog: * Makefile.in: Include silent-rules.mk. (srcdir, abs_top_srcdir, abs_srcdir, VPATH): Move up. (COMPILE): Add ECHO_CXX. (gdbserver$(EXEEXT)): Add SILENCE and ECHO_CXXLD. (gdbreplay$(EXEEXT)): Add SILENCE and ECHO_CXXLD. ($(IPA_LIB)): Add SILENCE and ECHO_CXXLD. (version-generated.c): Add ECHO_GEN. (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN_GENERATED. (IPAGENT_COMPILE): Add ECHO_CXX. (%-generated.c): Add ECHO_REGDAT.
2018-03-16 21:06:23 +01:00
2018-03-16 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Include silent-rules.mk.
(srcdir, abs_top_srcdir, abs_srcdir, VPATH): Move up.
(COMPILE): Add ECHO_CXX.
(gdbserver$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
(gdbreplay$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
($(IPA_LIB)): Add SILENCE and ECHO_CXXLD.
(version-generated.c): Add ECHO_GEN.
(stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN_GENERATED.
(IPAGENT_COMPILE): Add ECHO_CXX.
(%-generated.c): Add ECHO_REGDAT.
2018-03-14 Tom Tromey <tom@tromey.com>
PR cli/14977:
* ax.c (ax_printf): Special case for NULL.
2018-03-08 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (linux_qxfer_libraries_svr4): Use
xml_escape_text_append.
2018-03-08 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (linux_qxfer_libraries_svr4): Use std::string.
2018-03-02 Simon Marchi <simon.marchi@polymtl.ca>
* server.c (handle_general_set): Remove unnecessary xstrdup.
Make delim_string_to_char_ptr_vec return an std::vector This patch makes delim_string_to_char_ptr_vec and all related functions use std::vector of gdb::unique_xmalloc_ptr. This allows getting rid of make_cleanup_free_char_ptr_vec. Returning a vector of unique_xmalloc_ptr instead of std::string allows to minimize the impacts on the calling code. We can evaluate later whether we could/should return a vector of std::strings instead. gdb/ChangeLog: * common/gdb_vecs.h (make_cleanup_free_char_ptr_vec): Remove. (delim_string_to_char_ptr_vec): Return std::vector of gdb::unique_xmalloc_ptr. (dirnames_to_char_ptr_vec_append): Take std::vector of gdb::unique_xmalloc_ptr. (dirnames_to_char_ptr_vec): Return std::vector of gdb::unique_xmalloc_ptr. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Take std::vector of gdb::unique_xmalloc_ptr, adjust the code. (delim_string_to_char_ptr_vec): Return an std::vector of gdb::unique_xmalloc_ptr, adjust the code. (dirnames_to_char_ptr_vec_append): Take an std::vector of gdb::unique_xmalloc_ptr, adjust the code. (dirnames_to_char_ptr_vec): Return an std::vector of gdb::unique_xmalloc_ptr, adjust the code. * auto-load.c (auto_load_safe_path_vec): Change type to std::vector of gdb::unique_xmalloc_ptr. (auto_load_expand_dir_vars): Return an std::vector of gdb::unique_xmalloc_ptr, adjust the code. (auto_load_safe_path_vec_update): Adjust. (filename_is_in_auto_load_safe_path_vec): Adjust. (auto_load_objfile_script_1): Adjust. * build-id.c (build_id_to_debug_bfd): Adjust. * linux-thread-db.c (thread_db_load_search): Adjust. * source.c (add_path): Adjust. (openp): Adjust. * symfile.c (find_separate_debug_file): Adjust. * utils.c (do_free_char_ptr_vec): Remove. (make_cleanup_free_char_ptr_vec): Remove. gdb/gdbserver/ChangeLog: * server.c (parse_debug_format_options): Adjust to delim_string_to_char_ptr_vec changes. * thread-db.c (thread_db_load_search): Adjust to dirnames_to_char_ptr_vec changes.
2018-03-03 05:22:06 +01:00
2018-03-02 Simon Marchi <simon.marchi@polymtl.ca>
* server.c (parse_debug_format_options): Adjust to
delim_string_to_char_ptr_vec changes.
* thread-db.c (thread_db_load_search): Adjust to
dirnames_to_char_ptr_vec changes.
2018-03-01 Markus Metzger <markus.t.metzger@intel.com>
* target.h (target_enable_btrace, target_disable_btrace)
(target_read_btrace, target_read_btrace_conf): Turn macro into
inline function. Throw error if target method is not defined.
* server.c (handle_qxfer_btrace handle_qxfer_btrace_conf): Remove
check for btrace target method. Be prepared to handle exceptions
from btrace target methods.
2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com>
* server.c (captured_main): Change order of error message printed
when the current working directory cannot be found.
Make gdbserver work with filename-only binaries Simon mentioned on IRC that, after the startup-with-shell feature has been implemented on gdbserver, it is not possible to specify a filename-only binary, like: $ gdbserver :1234 a.out /bin/bash: line 0: exec: a.out: not found During startup program exited with code 127. Exiting This happens on systems where the current directory "." is not listed in the PATH environment variable. Although including "." in the PATH variable is a possible workaround, this can be considered a regression because before startup-with-shell it was possible to use only the filename (due to reason that gdbserver used "exec*" directly). The idea of the patch is to verify if the program path provided by the user (or by the remote protocol) contains a directory separator character. If it doesn't, it means we're dealing with a filename-only binary, so we call "gdb_abspath" to properly expand it and transform it into a full path. Otherwise, we leave the program path untouched. This mimicks the behaviour seen on GDB (look at "openp" and "attach_inferior", for example). I am also submitting a testcase which exercises the scenario described above. This test requires gdbserver to be executed in a different CWD than the original, so I also created a helper function, "with_cwd" (on testsuite/lib/gdb.exp), which takes care of cd'ing into and out of the specified dir. Built and regtested on BuildBot, without regressions. gdb/ChangeLog: 2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com> Simon Marchi <simon.marchi@polymtl.ca> * common/common-utils.c: Include "sys/stat.h". (is_regular_file): Move here from "source.c"; change return type to "bool". * common/common-utils.h (is_regular_file): New prototype. * common/pathstuff.c (contains_dir_separator): New function. * common/pathstuff.h (contains_dir_separator): New prototype. * source.c: Don't include "sys/stat.h". (is_regular_file): Move to "common/common-utils.c". gdb/gdbserver/ChangeLog: 2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com> * server.c: Include "filenames.h" and "pathstuff.h". (program_name): Delete variable. (program_path): New anonymous class. (get_exec_wrapper): Use "program_path" instead of "program_name". (handle_v_run): Likewise. (captured_main): Likewise. (process_serial_event): Likewise. gdb/testsuite/ChangeLog: 2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.server/abspath.exp: New file. * lib/gdb.exp (with_cwd): New procedure.
2018-02-10 00:54:41 +01:00
2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com>
* server.c: Include "filenames.h" and "pathstuff.h".
(program_name): Delete variable.
(program_path): New anonymous class.
(get_exec_wrapper): Use "program_path" instead of
"program_name".
(handle_v_run): Likewise.
(captured_main): Likewise.
(process_serial_event): Likewise.
Create new common/pathstuff.[ch] This commit moves the path manipulation routines found on utils.c to a new common/pathstuff.c, and updates the Makefile.in's accordingly. The routines moved are "gdb_realpath", "gdb_realpath_keepfile" and "gdb_abspath". This will be needed because gdbserver will have to call "gdb_abspath" on my next patch, which implements a way to expand the path of the inferior provided by the user in order to allow specifying just the binary name when starting gdbserver, like: $ gdbserver :1234 a.out With the recent addition of the startup-with-shell feature on gdbserver, this scenario doesn't work anymore if the user doesn't have the current directory listed in the PATH variable. I had to do a minor adjustment on "gdb_abspath" because we don't have access to "tilde_expand" on gdbserver, so now the function is using "gdb_tilde_expand" instead. Otherwise, the code is the same. Regression tested on the BuildBot, without regressions. gdb/ChangeLog: 2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (COMMON_SFILES): Add "common/pathstuff.c". (HFILES_NO_SRCDIR): Add "common/pathstuff.h". * auto-load.c: Include "common/pathstuff.h". * common/common-def.h (current_directory): Move here. * common/gdb_tilde_expand.c (gdb_tilde_expand_up): New function. * common/gdb_tilde_expand.h (gdb_tilde_expand_up): New prototype. * common/pathstuff.c: New file. * common/pathstuff.h: New file. * compile/compile.c: Include "common/pathstuff.h". * defs.h (current_directory): Move to "common/common-defs.h". * dwarf2read.c: Include "common/pathstuff.h". * exec.c: Likewise. * guile/scm-safe-call.c: Likewise. * linux-thread-db.c: Likewise. * main.c: Likewise. * nto-tdep.c: Likewise. * objfiles.c: Likewise. * source.c: Likewise. * symtab.c: Likewise. * utils.c: Include "common/pathstuff.h". (gdb_realpath): Move to "common/pathstuff.c". (gdb_realpath_keepfile): Likewise. (gdb_abspath): Likewise. * utils.h (gdb_realpath): Move to "common/pathstuff.h". (gdb_realpath_keepfile): Likewise. (gdb_abspath): Likewise. gdb/gdbserver/ChangeLog: 2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add "$(srcdir)/common/pathstuff.c". (OBJS): Add "pathstuff.o". * server.c (current_directory): New global variable. (captured_main): Initialize "current_directory".
2018-02-10 00:44:59 +01:00
2018-02-28 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (SFILES): Add "$(srcdir)/common/pathstuff.c".
(OBJS): Add "pathstuff.o".
* server.c (current_directory): New global variable.
(captured_main): Initialize "current_directory".
2018-02-26 Alan Hayward <alan.hayward@arm.com>
* tdesc.c: Use common/tdesc.h.
* tdesc.h: Likewise.
2018-02-20 Alan Hayward <alan.hayward@arm.com>
Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in: Switch order of make rules.
2018-02-19 Alan Hayward <alan.hayward@arm.com>
* Makefile.in: Add common directory in build.
* configure.ac: Add common reference.
* configure: Regenerate.
btrace, gdbserver: remove the to_supports_btrace target method Remove the to_supports_btrace target method and instead rely on detecting errors when trying to enable recording. This will also provide a suitable error message explaining why recording is not possible. For remote debugging, gdbserver will now always advertise branch tracing related packets. When talking to an older GDB, this will cause GDB to try to enable branch tracing and gdbserver to report a suitable error message every time. An older gdbserver will not advertise branch tracing related packets if the one-time check failed, so a newer GDB with this patch will fail to enable branch tracing at remote_enable_btrace() rather than at btrace_enable(). The error message is the same in both cases so there should be no user-visible change. gdb/ * btrace.c (btrace_enable): Remove target_supports_btrace call. * nat/linux-btrace.c (perf_event_pt_event_type): Move. (kernel_supports_bts, kernel_supports_pt, linux_supports_bts) (linux_supports_pt, linux_supports_btrace): Remove. (linux_enable_bts): Call cpu_supports_bts. * nat/linux-btrace.h (linux_supports_btrace): Remove. * remote.c (remote_supports_btrace): Remove. (init_remote_ops): Remove remote_supports_btrace. * target-delegates.c: Regenerated. * target.c (target_supports_btrace): Remove. * target.h (target_ops) <to_supports_btrace>: Remove (target_supports_btrace): Remove. * x86-linux-nat.c (x86_linux_create_target): Remove linux_supports_btrace. gdbserver/ * linux-low.c (linux_target_ops): Remove linux_supports_btrace. * nto-low.c (nto_target_ops): Remove NULL for supports_btrace. * spu-low.c (spu_target_ops): Likewise. * win32-low.c (win32_target_ops): Likewise. * server.c (supported_btrace_packets): Report packets unconditionally. * target.h (target_ops) <supports_btrace>: Remove. (target_supports_btrace): Remove.
2018-01-19 14:32:09 +01:00
2018-02-09 Markus Metzger <markus.t.metzger@intel.com>
* linux-low.c (linux_target_ops): Remove linux_supports_btrace.
* nto-low.c (nto_target_ops): Remove NULL for supports_btrace.
* spu-low.c (spu_target_ops): Likewise.
* win32-low.c (win32_target_ops): Likewise.
* server.c (supported_btrace_packets): Report packets unconditionally.
* target.h (target_ops) <supports_btrace>: Remove.
(target_supports_btrace): Remove.
2018-02-09 Markus Metzger <markus.t.metzger@intel.com>
* server.c (handle_btrace_enable_bts, handle_btrace_enable_pt)
(handle_btrace_disable): Change return type to void. Use exceptions
to report errors.
(handle_btrace_general_set): Catch exception and copy message to
return message.
2018-02-08 Tom Tromey <tom@tromey.com>
* linux-low.c (install_software_single_step_breakpoints): Use
make_scoped_restore.
* inferiors.c (make_cleanup_restore_current_thread): Remove.
(do_restore_current_thread_cleanup): Remove.
* gdbthread.h (make_cleanup_restore_current_thread): Don't
declare.
2018-02-08 Tom Tromey <tom@tromey.com>
* mem-break.c (set_raw_breakpoint_at): Use
gdb::unique_xmalloc_ptr.
Per-inferior target_terminal state, fix PR gdb/13211, more In my multi-target branch I ran into problems with GDB's terminal handling that exist in master as well, with multi-inferior debugging. This patch adds a testcase for said problems (gdb.multi/multi-term-settings.exp), fixes the problems, fixes PR gdb/13211 as well (and adds a testcase for that too, gdb.base/interrupt-daemon.exp). The basis of the problem I ran into is the following. Consider a scenario where you have: - inferior 1 - started with "attach", process is running on some other terminal. - inferior 2 - started with "run", process is sharing gdb's terminal. In this scenario, when you stop/resume both inferiors, you want GDB to save/restore the terminal settings of inferior 2, the one that is sharing GDB's terminal. I.e., you want inferior 2 to "own" the terminal (in target_terminal::is_ours/target_terminal::is_inferior sense). Unfortunately, that's not what you get currently. Because GDB doesn't know whether an attached inferior is actually sharing GDB's terminal, it tries to save/restore its settings anyway, ignoring errors. In this case, this is pointless, because inferior 1 is running on a different terminal, but GDB doesn't know better. And then, because it is only possible to have the terminal settings of a single inferior be in effect at a time, or make one inferior/pgrp be the terminal's foreground pgrp (aka, only one inferior can "own" the terminal, ignoring fork children here), if GDB happens to try to restore the terminal settings of inferior 1 first, then GDB never restores the terminal settings of inferior 2. This patch fixes that and a few things more along the way: - Moves enum target_terminal::terminal_state out of the target_terminal class (it's currently private) and makes it a scoped enum so that it can be easily used elsewhere. - Replaces the inflow.c:terminal_is_ours boolean with a target_terminal_state variable. This allows distinguishing is_ours and is_ours_for_output states. This allows finally making child_terminal_ours_1 do something with its "output_only" parameter. - Makes each inferior have its own copy of the is_ours/is_ours_for_output/is_inferior state. - Adds a way for GDB to tell whether the inferior is sharing GDB's terminal. Works best on Linux and Solaris; the fallback works just as well as currently. - With that, we can remove the inf->attach_flag tests from child_terminal_inferior/child_terminal_ours. - Currently target_ops.to_ours is responsible for both saving the current inferior's terminal state, and restoring gdb's state. Because each inferior has its own terminal state (possibly handled by different targets in a multi-target world, even), we need to split the inferior-saving part from the gdb-restoring part. The patch adds a new target_ops.to_save_inferior target method for that. - Adds a new target_terminal::save_inferior() function, so that sequences like: scoped_restore_terminal_state save_state; target_terminal::ours_for_output (); ... restore back inferiors that were target_terminal_state::is_inferior before back to is_inferior, and leaves inferiors that were is_ours alone. - Along the way, this adds a default implementation of target_pass_ctrlc to inflow.c (for inf-child.c), that handles passing the Ctrl-C to a process running on GDB's terminal or to some other process otherwise. - Similarly, adds a new target default implementation of target_interrupt, for the "interrupt" command. The current implementation of this hook in inf-ptrace.c kills the whole process group, but that's incorrect/undesirable because we may not be attached to all processes in the process group. And also, it's incorrect because inferior_process_group() doesn't really return the inferior's real process group id if the inferior is not a process group leader... This is the cause of PR gdb/13211 [1], which this patch fixes. While at it, that target method's "ptid" parameter is eliminated, because it's not really used. - A new test is included that exercises and fixes PR gdb/13211, and also fixes a GDB issue reported on stackoverflow that I ran into while working on this [2]. The problem is similar to PR gdb/13211, except that it also triggers with Ctrl-C. When debugging a daemon (i.e., a process that disconnects from the controlling terminal and is not a process group leader, then Ctrl-C doesn't work, you just can't interrupt the inferior at all, resulting in a hung debug session. The problem is that since the inferior is no longer associated with gdb's session / controlling terminal, then trying to put the inferior in the foreground fails. And so Ctrl-C never reaches the inferior directly. pass_signal is only used when the inferior is attached, but that is not the case here. This is fixed by the new child_pass_ctrlc. Without the fix, the new interrupt-daemon.exp testcase fails with timeout waiting for a SIGINT that never arrives. [1] PR gdb/13211 - Async / Process group and interrupt not working https://sourceware.org/bugzilla/show_bug.cgi?id=13211 [2] GDB not reacting Ctrl-C when after fork() and setsid() https://stackoverflow.com/questions/46101292/gdb-not-reacting-ctrl-c-when-after-fork-and-setsid Note this patch does _not_ fix: - PR gdb/14559 - The 'interrupt' command does not work if sigwait is in use https://sourceware.org/bugzilla/show_bug.cgi?id=14559 - PR gdb/9425 - When using "sigwait" GDB doesn't trap SIGINT. Ctrl+C terminates program when should break gdb. https://sourceware.org/bugzilla/show_bug.cgi?id=9425 The only way to fix that that I know of (without changing the kernel) is to make GDB put inferiors in a separate session (create a pseudo-tty master/slave pair, make the inferior run with the slave as its terminal, and have gdb pump output/input on the master end). gdb/ChangeLog: 2018-01-30 Pedro Alves <palves@redhat.com> PR gdb/13211 * config.in, configure: Regenerate. * configure.ac: Check for getpgid. * go32-nat.c (go32_pass_ctrlc): New. (go32_target): Install it. * inf-child.c (inf_child_target): Install child_terminal_save_inferior, child_pass_ctrlc and child_interrupt. * inf-ptrace.c (inf_ptrace_interrupt): Delete. (inf_ptrace_target): No longer install it. * infcmd.c (interrupt_target_1): Adjust. * inferior.h (child_terminal_save_inferior, child_pass_ctrlc) (child_interrupt): Declare. (inferior::terminal_state): New. * inflow.c (struct terminal_info): Update comments. (inferior_process_group): Delete. (terminal_is_ours): Delete. (gdb_tty_state): New. (child_terminal_init): Adjust. (is_gdb_terminal, sharing_input_terminal_1) (sharing_input_terminal): New functions. (child_terminal_inferior): Adjust. Use sharing_input_terminal. Set the process's actual process group in the foreground if possible. Handle is_ours_for_output/is_ours distinction. Don't mark terminal as the inferior's if not sharing GDB's terminal. Don't check attach_flag. (child_terminal_ours_for_output, child_terminal_ours): Adjust to pass down a target_terminal_state. (child_terminal_save_inferior): New, factored out from ... (child_terminal_ours_1): ... this. Handle target_terminal_state::is_ours_for_output. (child_interrupt, child_pass_ctrlc): New. (inflow_inferior_exit): Clear the inferior's terminal_state. (copy_terminal_info): Copy the inferior's terminal state. (_initialize_inflow): Remove reference to terminal_is_ours. * inflow.h (inferior_process_group): Delete. * nto-procfs.c (nto_handle_sigint, procfs_interrupt): Adjust. * procfs.c (procfs_target): Don't install procfs_interrupt. (procfs_interrupt): Delete. * remote.c (remote_serial_quit_handler): Adjust. (remote_interrupt): Remove ptid parameter. Adjust. * target-delegates.c: Regenerate. * target.c: Include "terminal.h". (target_terminal::terminal_state): Rename to ... (target_terminal::m_terminal_state): ... this. (target_terminal::init): Adjust. (target_terminal::inferior): Adjust to per-inferior terminal_state. (target_terminal::restore_inferior, target_terminal_is_ours_kind): New. (target_terminal::ours, target_terminal::ours_for_output): Use target_terminal_is_ours_kind. (target_interrupt): Remove ptid parameter. Adjust. (default_target_pass_ctrlc): Adjust. * target.h (target_ops::to_terminal_save_inferior): New field. (target_ops::to_interrupt): Remove ptid_t parameter. (target_interrupt): Remove ptid_t parameter. Update comment. (target_pass_ctrlc): Update comment. * target/target.h (target_terminal_state): New scoped enum, factored out of ... (target_terminal::terminal_state): ... here. (target_terminal::inferior): Update comments. (target_terminal::restore_inferior): New. (target_terminal::is_inferior, target_terminal::is_ours) (target_terminal::is_ours_for_output): Adjust. (target_terminal::scoped_restore_terminal_state): Adjust to rename, and call restore_inferior() instead of inferior(). (target_terminal::scoped_restore_terminal_state::m_state): Change type. (target_terminal::terminal_state): Rename to ... (target_terminal::m_terminal_state): ... this and change type. gdb/gdbserver/ChangeLog: 2018-01-30 Pedro Alves <palves@redhat.com> PR gdb/13211 * target.c (target_terminal::terminal_state): Rename to ... (target_terminal::m_terminal_state): ... this. gdb/testsuite/ChangeLog: 2018-01-30 Pedro Alves <palves@redhat.com> PR gdb/13211 * gdb.base/interrupt-daemon.c: New. * gdb.base/interrupt-daemon.exp: New. * gdb.multi/multi-term-settings.c: New. * gdb.multi/multi-term-settings.exp: New.
2018-01-30 15:23:51 +01:00
2018-01-30 Pedro Alves <palves@redhat.com>
PR gdb/13211
* target.c (target_terminal::terminal_state): Rename to ...
(target_terminal::m_terminal_state): ... this.
2018-01-19 James Clarke <jrtc27@jrtc27.com>
* linux-low.c (handle_extended_wait): Surround call to
thread_db_notice_clone with #ifdef USE_THREAD_DB.
2018-01-17 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (attach_proc_task_lwp_callback): Adjust to
linux_ptrace_attach_fail_reason_string now returning an
std::string.
(linux_attach): Likewise.
* thread-db.c (attach_thread): Likewise.
configure: Fix test for fs_base/gs_base in <sys/user.h> Make <sys/types.h> be included prior to including <sys/user.h>. glibc versions older than 2.14 use __uintNN_t types within certain structures defined in <sys/user.h> probably assuming these types are defined prior to including the header. This results in the following `configure` feature test compilation error that makes it think that `struct user_regs_struct` doesn't have `fs_base`/`gs_base` fields, althouh it does. configure:13617: checking for struct user_regs_struct.fs_base configure:13617: gcc -c -g -O2 -I/linux/include conftest.c >&5 In file included from conftest.c:158:0: /usr/include/sys/user.h:32:3: error: unknown type name '__uint16_t' __uint16_t cwd; ^ /usr/include/sys/user.h:33:3: error: unknown type name '__uint16_t' __uint16_t swd; ^ /usr/include/sys/user.h:34:3: error: unknown type name '__uint16_t' __uint16_t ftw; ^ /usr/include/sys/user.h:35:3: error: unknown type name '__uint16_t' __uint16_t fop; ^ /usr/include/sys/user.h:36:3: error: unknown type name '__uint64_t' __uint64_t rip; ^ /usr/include/sys/user.h:37:3: error: unknown type name '__uint64_t' __uint64_t rdp; ^ /usr/include/sys/user.h:38:3: error: unknown type name '__uint32_t' __uint32_t mxcsr; ^ /usr/include/sys/user.h:39:3: error: unknown type name '__uint32_t' __uint32_t mxcr_mask; ^ /usr/include/sys/user.h:40:3: error: unknown type name '__uint32_t' __uint32_t st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ ^ /usr/include/sys/user.h:41:3: error: unknown type name '__uint32_t' __uint32_t xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ ^ /usr/include/sys/user.h:42:3: error: unknown type name '__uint32_t' __uint32_t padding[24]; ^ configure:13617: $? = 1 configure: failed program was: | /* confdefs.h */ ... | /* end confdefs.h. */ | #include <sys/user.h> | | int | main () | { | static struct user_regs_struct ac_aggr; | if (ac_aggr.fs_base) | return 0; | ; | return 0; | } Recent glibc versions don't use typedef'ed int types in <sys/user.h>, thus allowing it to be included as is (glibc commit d79a9c949c84e7f0ba33e87447c47af833e9f11a). However there're still some distros alive that use older glibc, for instance, RHEL/CentOS 6 package glibc 2.12. Also affects PR gdb/21559: ../../gdb/regcache.c:1087: internal-error: void regcache_raw_supply(regcache, int, const void): Assertion `regnum >= 0 && regnum < regcache->descr->nr_raw_registers' failed. As noted by Andrew Paprocki, who submitted the PR (https://sourceware.org/bugzilla/show_bug.cgi?id=21559#c3): > It should be noted that modifying `configure` to force on > `HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE` and > `HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE` fixes this issue. For some > reason the `configure` tests for `fs_base` and `gs_base` fail > even though `sys/user.h` on RHEL5 has the fields defined in > `user_regs_struct`. Note that this patch does NOT fix the root cause of PR gdb/21559, although now that `configure` properly detects the presence of the fields and sets HAVE_XXX accordingly, the execution takes another path, which doesn't lead to the assertion failure in question. gdb/ChangeLog: 2018-01-17 Eldar Abusalimov <eldar.abusalimov@jetbrains.com> PR gdb/21559 * configure.ac: Include <sys/types.h> prior to <sys/user.h> when checking for fs_base/gs_base fields in struct user_regs_struct. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2018-01-17 Eldar Abusalimov <eldar.abusalimov@jetbrains.com> PR gdb/21559 * configure.ac: Include <sys/types.h> prior to <sys/user.h> when checking for fs_base/gs_base fields in struct user_regs_struct. * configure: Regenerate.
2018-01-15 14:57:42 +01:00
2018-01-17 Eldar Abusalimov <eldar.abusalimov@jetbrains.com>
PR gdb/21559
* configure.ac: Include <sys/types.h> prior to <sys/user.h> when
checking for fs_base/gs_base fields in struct user_regs_struct.
* configure: Regenerate.
2018-01-16 Yao Qi <yao.qi@linaro.org>
PR gdb/18749
* linux-low.c (fetch_register): Call supply_register instead of
error.
2018-01-08 Yao Qi <yao.qi@linaro.org>
Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (OBS): Remove selftest.o.
* configure.ac: Set srv_selftest_objs if $development is true.
(GDBSERVER_DEPFILES): Append $srv_selftest_objs.
* configure: Re-generated.
* server.c (captured_main): Wrap variable selftest_filter with
GDB_SELF_TEST.
2018-01-07 Simon Marchi <simon.marchi@polymtl.ca>
* server.c (parse_debug_format_options): Return std::string.
(handle_monitor_command, captured_main): Adjust.
Fix regression: cannot start with LD_PRELOAD=libSegFault.so (PR gdb/18653#c7) At https://sourceware.org/bugzilla/show_bug.cgi?id=18653#c7, Andrew reports that the fix for PR gdb/18653 made GDB useless if you preload libSegFault.so, because GDB internal-errors on startup: $ LD_PRELOAD=libSegFault.so gdb src/gdb/common/signals-state-save-restore.c:64: internal-error: unexpected signal handler A problem internal to GDB has been detected, further debugging may prove unreliable. Aborted (core dumped) $ The internal error comes from the code saving the signal dispositions inherited from gdb's parent: (top-gdb) bt #0 0x000000000056b001 in internal_error(char const*, int, char const*, ...) (file=0xaf5f38 "src/gdb/common/signals-state-save-restore.c", line=64, fmt=0xaf5f18 "unexpected signal handler") at src/gdb/common/errors.c:54 #1 0x00000000005752c9 in save_original_signals_state() () at src/gdb/common/signals-state-save-restore.c:64 #2 0x00000000007425de in captured_main_1(captured_main_args*) (context=0x7fffffffd860) at src/gdb/main.c:509 #3 0x0000000000743622 in captured_main(void*) (data=0x7fffffffd860) at src/gdb/main.c:1145 During symbol reading, cannot get low and high bounds for subprogram DIE at 24065. #4 0x00000000007436f9 in gdb_main(captured_main_args*) (args=0x7fffffffd860) at src/gdb/main.c:1171 #5 0x0000000000413acd in main(int, char**) (argc=1, argv=0x7fffffffd968) at src/gdb/gdb.c:32 This commit downgrades the internal error to a warning. You'll get instead: ~~~ $ LD_PRELOAD=libSegFault.so gdb warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 8.0.50.20171213-git Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... (gdb) ~~~ This also moves the location where save_original_signals_state is called a bit further below (to after option processing), so that "-q" disables the warning: ~~~ $ LD_PRELOAD=libSegFault.so gdb -q (gdb) ~~~ New testcase included. gdb/ChangeLog: 2018-01-05 Pedro Alves <palves@redhat.com> PR gdb/18653 * common/signals-state-save-restore.c (save_original_signals_state): New parameter 'quiet'. Warn if we find a custom handler preinstalled, instead of internal erroring. But only warn if !quiet. * common/signals-state-save-restore.h (save_original_signals_state): New parameter 'quiet'. * main.c (captured_main_1): Move save_original_signals_state call after option handling, and pass QUIET. gdb/gdbserver/ChangeLog: 2018-01-05 Pedro Alves <palves@redhat.com> PR gdb/18653 * server.c (captured_main): Pass quiet=false to save_original_signals_state. gdb/testsuite/ChangeLog: 2018-01-05 Pedro Alves <palves@redhat.com> PR gdb/18653 * gdb.base/libsegfault.exp: New.
2018-01-05 19:26:18 +01:00
2018-01-05 Pedro Alves <palves@redhat.com>
PR gdb/18653
* server.c (captured_main): Pass quiet=false to
save_original_signals_state.
2018-01-01 Joel Brobecker <brobecker@adacore.com>
* gdbreplay.c (gdbreplay_version): Update copyright year in
version message.
* server.c (gdbserver_version): Likewise.
2017-12-08 Tom Tromey <tom@tromey.com>
* ax.c (ax_printf): Update.
Initialize target description early in IPA Target descriptions are allocated lazily, that is fine in GDBserver, but it is not safe to call malloc in gdb_collect in IPA, because we can set a fast tracepoint in malloc, and when the tracepoint is hit, gdb_collect/malloc is called, deadlock or memory corruption may be triggered. #0 0xf7cfc200 in malloc () #1 0xf7efdc07 in operator new(unsigned int) () #2 0xf7ef7636 in allocate_target_description() () #3 0xf7efcbe1 in i386_create_target_description(unsigned long long, bool) () #4 0xf7efb474 in i386_linux_read_description(unsigned long long) () #5 0xf7efb190 in get_ipa_tdesc(int) () #6 0xf7ef9baa in gdb_collect () The fix is to initialize all target descriptions earlier, when the IPA is loaded. In order to guarantee malloc is not called in IPA in gdb_collect, I change the test to set a breakpoint on malloc, if IPA gdb_collect calls malloc, program will hit the breakpoint, and test fail. continue Continuing. Thread 1 "" hit Breakpoint 5, 0xf7cfc200 in malloc () (gdb) FAIL: gdb.trace/ftrace.exp: advance through tracing gdb/gdbserver: 2017-12-07 Yao Qi <yao.qi@linaro.org> * linux-aarch64-ipa.c (initialize_low_tracepoint): Call aarch64_linux_read_description. * linux-amd64-ipa.c (idx2mask): New array. (get_ipa_tdesc): Move idx2mask out. (initialize_low_tracepoint): Initialize target descriptions. * linux-i386-ipa.c (idx2mask): New array. (get_ipa_tdesc): Move idx2mask out. (initialize_low_tracepoint): Initialize target descriptions. gdb/testsuite: 2017-12-07 Yao Qi <yao.qi@linaro.org> * gdb.trace/ftrace.exp (run_trace_experiment): Set breakpoint on malloc and catch syscall.
2017-12-07 18:07:01 +01:00
2017-12-07 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-ipa.c (initialize_low_tracepoint): Call
aarch64_linux_read_description.
* linux-amd64-ipa.c (idx2mask): New array.
(get_ipa_tdesc): Move idx2mask out.
(initialize_low_tracepoint): Initialize target descriptions.
* linux-i386-ipa.c (idx2mask): New array.
(get_ipa_tdesc): Move idx2mask out.
(initialize_low_tracepoint): Initialize target descriptions.
Split tdesc_type into multiple classes This patch makes tdesc_type an abstract base class and creates three subclasses: - tdesc_type_builtin, for builtin types - tdesc_type_vector, for vector types - tdesc_type_with_fields, for struct, union, flag and enum types This allows getting rid of the union in tdesc_type and to not allow the std::vector separately. I tried to go further and create separate classes for struct, union, flag and enum, but it proved too difficult. One problem is that from the point of the of the target description code, the types tdesc_type_* are opaque (only forward-declared). Therefore, it doesn't know about inheritance relationship between those classes. This makes it impossible to make functions that accept a pointer to a base class and pass a pointer to a derived class, for example. I think this patch here is a good compromise, and if somebody wants to improve things further, the door is open. A make_gdb_type virtual pure method is added to tdesc_type, which replaces the current tdesc_gdb_type function. Calling this method on a tdesc_type returns the corresponding built gdb type. gdb/ChangeLog: * target-descriptions.c (struct tdesc_type): Use default destructor. <u>: Remove. <accept>: Remove. (struct tdesc_type_builtin): New. (struct tdesc_type_vector): New. (struct tdesc_type_with_fields): New. (tdesc_predefined_types): Change type to tdesc_type_builtin[]. (tdesc_gdb_type): Remove. (tdesc_register_type): Adjust. (tdesc_create_vector): Create tdesc_type_vector. (tdesc_create_struct): Create tdesc_type_with_fields. (tdesc_set_struct_size): Change parameter type. (tdesc_create_union): Create tdesc_type_with_fields. (tdesc_create_flags): Likewise. (tdesc_create_enum): Likewise. (tdesc_add_field): Change parameter type. (tdesc_add_typed_bitfield): Likewise. (tdesc_add_bitfield): Likewise. (tdesc_add_flag): Likewise. (tdesc_add_enum_value): Likewise. (print_c_tdesc) <visit>: Remove overload with tdesc_type parameter, add overloads for tdesc_type_builtin, tdesc_type_with_fields and tdesc_type_vector. <m_printed_type>: Remove. <m_printed_element_type, m_printed_type_with_fields>: Add. * target-descriptions.h (tdesc_create_enum): Change return type. (tdesc_add_typed_bitfield): Change parameter type. (tdesc_add_enum_value): Change parameter type. * xml-tdesc.c (struct tdesc_parsing_data) <current_type>: Change type to tdesc_type_with_fields. (tdesc_start_struct): Adjust. (tdesc_start_flags): Adjust. (tdesc_start_enum): Adjust. (tdesc_start_field): Adjust. * arch/tdesc.h (struct tdesc_type_builtin): Forward-declare. (struct tdesc_type_vector): Forward-declare. (struct tdesc_type_with_fields): Forward-declare. (tdesc_create_struct): Change return type. (tdesc_create_union): Likewise. (tdesc_create_flags): Likewise. (tdesc_add_field): Change parameter type. (tdesc_set_struct_size): Likewise. (tdesc_add_bitfield): Likewise. (tdesc_add_flag): Likewise. * features: Re-generate C files. gdb/gdbserver/ChangeLog: * tdesc.c (struct tdesc_type): Change return type. (tdesc_add_flag): Change parameter type. (tdesc_add_bitfield): Likewise. (tdesc_add_field): Likewise. (tdesc_set_struct_size): Likewise.
2017-12-05 22:30:28 +01:00
2017-12-05 Simon Marchi <simon.marchi@polymtl.ca>
* tdesc.c (struct tdesc_type): Change return type.
(tdesc_add_flag): Change parameter type.
(tdesc_add_bitfield): Likewise.
(tdesc_add_field): Likewise.
(tdesc_set_struct_size): Likewise.
Remove some unused variables This patch removes some unused variables, found with -Wunused. I have not removed everything reported by -Wunused, because some expressions such as struct type *arg_type = check_typedef (value_type); in bfin-tdep.c could have an unexpected but important side-effect. I removed others that I considered more low-risk, such as: struct gdbarch *gdbarch = get_objfile_arch (objfile); I tested building with Python 2/Python 3/no Python, with/without expat, with/without libipt and with/without babeltrace. gdb/ChangeLog: * ada-lang.c (ada_collect_symbol_completion_matches): Remove unused variables. (ada_is_redundant_range_encoding): Likewise. * ada-varobj.c (ada_varobj_get_value_of_array_variable): Likewise. * alpha-tdep.c (alpha_software_single_step): Likewise. * arm-tdep.c (_initialize_arm_tdep): Likewise. * auto-load.c (info_auto_load_cmd): Likewise. * break-catch-syscall.c (insert_catch_syscall): Likewise. (remove_catch_syscall): Likewise. * breakpoint.c (condition_completer): Likewise. (clear_command): Likewise. (update_breakpoint_locations): Likewise. * btrace.c (btrace_disable): Likewise. (btrace_teardown): Likewise. (btrace_maint_update_pt_packets): Likewise. (maint_btrace_clear_cmd): Likewise. * cli/cli-decode.c (lookup_cmd_1): Likewise. (lookup_cmd_composition): Likewise. * cli/cli-dump.c (scan_filename): Likewise. (restore_command): Likewise. * compile/compile-loc2c.c (compute_stack_depth): Likewise. * compile/compile-object-load.c (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (compile_to_object): Likewise. * completer.c (filename_completer): Likewise. (complete_files_symbols): Likewise. (complete_expression): Likewise. * corelow.c (core_open): Likewise. * ctf.c (ctf_start): Likewise. (ctf_write_status): Likewise. (ctf_write_uploaded_tsv): Likewise. (ctf_write_definition_end): Likewise. (ctf_open_dir): Likewise. (ctf_xfer_partial): Likewise. (ctf_trace_find): Likewise. * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Likewise. * dwarf2loc.c (allocate_piece_closure): Likewise. (indirect_pieced_value): Likewise. (dwarf2_evaluate_loc_desc_full): Likewise. * dwarf2read.c (dw2_expand_marked_cus): Likewise. (dw2_expand_symtabs_matching): Likewise. (dw2_map_symbol_filenames): Likewise. (read_and_check_comp_unit_head): Likewise. (read_cutu_die_from_dwo): Likewise. (lookup_dwo_unit): Likewise. (read_comp_units_from_section): Likewise. (dwarf2_compute_name): Likewise. (handle_DW_AT_stmt_list): Likewise. (create_cus_hash_table): Likewise. (create_dwp_v2_section): Likewise. (dwarf2_rnglists_process): Likewise. (dwarf2_ranges_process): Likewise. (dwarf2_record_block_ranges): Likewise. (is_vtable_name): Likewise. (read_formatted_entries): Likewise. (skip_form_bytes): Likewise. * elfread.c (elf_symtab_read): Likewise. * exec.c (exec_file_command): Likewise. * f-valprint.c (f_val_print): Likewise. (info_common_command_for_block): Likewise. * guile/guile.c (initialize_scheme_side): Likewise. * guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Likewise. * guile/scm-cmd.c (cmdscm_completer): Likewise. (gdbscm_register_command_x): Likewise. * guile/scm-frame.c (gdbscm_frame_read_var): Likewise. * guile/scm-param.c (gdbscm_parameter_value): Likewise. * guile/scm-ports.c (file_port_magic): Likewise. * guile/scm-pretty-print.c (ppscm_search_pp_list): Likewise. (ppscm_pretty_print_one_value): Likewise. (ppscm_print_children): Likewise. * guile/scm-string.c (gdbscm_string_to_argv): Likewise. * guile/scm-symtab.c (gdbscm_sal_symtab): Likewise. * guile/scm-type.c (gdbscm_type_next_field_x): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * i386-tdep.c (i386_register_reggroup_p): Likewise. * infcmd.c (run_command_1): Likewise. (until_next_fsm_clean_up): Likewise. * linespec.c (linespec_complete): Likewise. (find_label_symbols): Likewise. * m2-valprint.c (m2_val_print): Likewise. * memattr.c (require_user_regions): Likewise. (lookup_mem_region): Likewise. (disable_mem_command): Likewise. (mem_delete): Likewise. * mep-tdep.c (mep_register_name): Likewise. (mep_analyze_prologue): Likewise. * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Likewise. * mi/mi-interp.c (mi_on_sync_execution_done): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise. * microblaze-linux-tdep.c (microblaze_linux_init_abi): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (lookup_minimal_symbol): Likewise. * mips-linux-tdep.c (mips64_fill_fpregset): Likewise. * mips-tdep.c (mips_stub_frame_sniffer): Likewise. (mips_o64_return_value): Likewise. (mips_single_step_through_delay): Likewise. (_initialize_mips_tdep): Likewise. * nios2-tdep.c (nios2_push_dummy_call): Likewise. (nios2_software_single_step): Likewise. * parse.c (find_minsym_type_and_address): Likewise. * psymtab.c (psym_relocate): Likewise. * python/py-breakpoint.c (bppy_get_commands): Likewise. (gdbpy_breakpoint_modified): Likewise. * python/py-infevents.c (create_inferior_call_event_object): Likewise. * python/py-record-btrace.c (btpy_list_item): Likewise. * python/py-type.c (typy_str): Likewise. * python/py-value.c (valpy_call): Likewise. * python/python.c (do_start_initialization): Likewise. * record-btrace.c (record_btrace_insn_history_range): Likewise. (record_btrace_call_history_range): Likewise. (record_btrace_record_method): Likewise. (record_btrace_xfer_partial): Likewise. (btrace_get_frame_function): Likewise. * record-full.c (record_full_open): Likewise. * record.c (get_context_size): Likewise. * registry.h (DEFINE_REGISTRY): Likewise. * remote-fileio.c (remote_fileio_request): Likewise. * remote.c (remote_update_thread_list): Likewise. (remote_check_symbols): Likewise. (remote_commit_resume): Likewise. (remote_interrupt): Likewise. (remote_insert_breakpoint): Likewise. (compare_sections_command): Likewise. * rust-exp.y (super_name): Likewise. (lex_string): Likewise. (convert_ast_to_type): Likewise. (convert_ast_to_expression): Likewise. * rust-lang.c (rust_print_struct_def): Likewise. (rust_print_type): Likewise. (rust_evaluate_subexp): Likewise. * rx-tdep.c (rx_register_type): Likewise. * ser-event.c (serial_event_clear): Likewise. * serial.c (serial_open): Likewise. * spu-tdep.c (spu_overlay_new_objfile): Likewise. * symfile.c (section_is_overlay): Likewise. (overlay_unmapped_address): Likewise. (overlay_mapped_address): Likewise. (simple_overlay_update_1): Likewise. (simple_overlay_update): Likewise. * symtab.c (symbol_find_demangled_name): Likewise. (search_symbols): Likewise. * target-descriptions.c (tdesc_predefined_type): Likewise. * target.c (target_commit_resume): Likewise. * thread.c (print_selected_thread_frame): Likewise. * top.c (new_ui_command): Likewise. (gdb_readline_no_editing): Likewise. * tracefile-tfile.c (tfile_open): Likewise. * tracepoint.c (create_tsv_from_upload): Likewise. * utils.c (quit): Likewise. (defaulted_query): Likewise. * valarith.c (value_concat): Likewise. * xml-syscall.c (xml_list_syscalls_by_group): Likewise. * xml-tdesc.c (target_fetch_description_xml): Likewise. * xtensa-tdep.c (xtensa_pseudo_register_read): Likewise. (xtensa_pseudo_register_write): Likewise. gdb/gdbserver/ChangeLog: * regcache.c (registers_to_string): Remove unused variable.
2017-12-05 22:05:34 +01:00
2017-12-05 Simon Marchi <simon.marchi@ericsson.com>
* regcache.c (registers_to_string): Remove unused variable.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* inferiors.c (for_each_inferior_with_data): Remove.
* inferiors.h (for_each_inferior_with_data): Remove.
* server.c (handle_qxfer_threads_worker): Change parameter type.
(handle_qxfer_threads_proper): Use for_each_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* inferiors.c (for_each_inferior): Remove.
(clear_inferiors): Use for_each_thread.
* inferiors.h (for_each_inferior): Remove.
* linux-low.c (linux_wait_for_event_filtered): Use
for_each_thread.
(linux_stabilize_threads): Likewise.
* regcache.c (regcache_release): Likewise.
* server.c (gdb_wants_all_threads_stopped): Likewise.
(clear_pending_status_callback): Remove.
(handle_status): Use for_each_thread.
(captured_main): Likewise.
* win32-low.c (child_init_thread_list): Likewise.
(win32_clear_inferiors): Likewise.
(fake_breakpoint_event): Likewise.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* inferiors.h (find_inferior): Remove.
* inferiors.c (find_inferior): Remove.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (resume_status_pending_p): Update comment.
(need_step_over_p): Update comment.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (proceed_one_lwp): Return void, change parameter
type.
(unsuspend_and_proceed_one_lwp): Likewise.
(proceed_all_lwps): Use for_each_thread.
(unstop_all_lwps): Likewise.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (linux_resume_one_thread): Return void, take
parameter directly.
(linux_resume): Use for_each_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (send_sigstop_callback): Return void, change
parameter type. Rename to...
(send_sigstop): ... this.
(suspend_and_send_sigstop_callback): Return void, change parameter
type. Rename to...
(suspend_and_send_sigstop): ... this.
(stop_all_lwps): Use for_each_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (lwp_running): Return bool, remove unused
argument.
(linux_stabilize_threads): Use find_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (select_singlestep_lwp_callback): Remove.
(count_events_callback): Remove.
(select_event_lwp_callback): Remove.
(select_event_lwp): Use find_thread/for_each_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (not_stopped_callback): Return bool, take filter
argument directly.
(linux_wait_for_event_filtered): Use find_thread.
(linux_wait_1): Likewise.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (same_lwp): Remove.
(find_lwp_pid): Use find_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (delete_lwp_callback): Remove.
(linux_mourn): Use for_each_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (linux_detach_lwp_callback): Return void, remove
args parameter, don't check for pid.
(linux_detach): Use for_each_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (struct counter): Remove.
(second_thread_of_pid_p): Remove.
(last_thread_of_process_p): Use find_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* inferiors.c (find_inferior_in_random): Remove.
* inferiors.h (find_inferior_in_random): Remove.
* linux-low.c (status_pending_p_callback): Return bool, accept
parameter ptid directly.
(linux_wait_for_event_filtered): Use find_thread_in_random.
(linux_wait_1): Likewise.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* inferiors.c (find_inferior_id): Remove.
(find_thread_ptid): Move implemention from find_inferior_id to
here.
* inferiors.h (find_inferior_id): Remove.
* server.c (handle_status): Use find_thread_ptid.
(process_serial_event): Likewise.
* thread-db.c (find_one_thread): Likewise.
(thread_db_thread_handle): Likewise.
* win32-low.c (thread_rec): Likewise.
(child_delete_thread): Likewise.
(win32_thread_alive): Likewise.
(get_child_debug_event): Likewise.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-mips-low.c (update_watch_registers_callback): Return
void, remove pid_p parameter, don't check for pid.
(mips_insert_point, mips_remove_point): Use for_each_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* lynx.low (lynx_delete_thread_callback): Remove.
(lynx_mourn): Use for_each_thread.
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* regcache.c (regcache_invalidate_one): Remove.
(regcache_invalidate_pid): use for_each_thread.
2017-11-26 Tom Tromey <tom@tromey.com>
* linux-low.c (linux_create_inferior): Update.
2017-11-24 Ulrich Weigand <uweigand@de.ibm.com>
* spu-low.c (spu_create_inferior): Fix typo in argument name.
2017-11-24 Alan Hayward <alan.hayward@arm.com>
* configure.srv: Add linux-aarch64-tdesc-selftest.o.
* linux-aarch64-low.c (initialize_low_arch): Call init func.
* linux-aarch64-tdesc-selftest.c: New file.
* linux-aarch64-tdesc.h (initialize_low_tdesc): New declaration.
2017-11-24 Alan Hayward <alan.hayward@arm.com>
* configure.srv: Add new file.
* linux-aarch64-low.c (initialize_low_arch): Call init func.
* linux-aarch64-tdesc-selftest.c: New file.
* linux-aarch64-tdesc.h (initialize_low_tdesc): New declaration.
2017-11-24 Alan Hayward <alan.hayward@arm.com>
* linux-aarch64-ipa.c (initialize_low_tracepoint): Remove init.
* linux-aarch64-low.c (initialize_low_arch): Remove init.
* linux-aarch64-tdesc.c (aarch64_linux_read_description): Add init.
2017-11-24 Alan Hayward <alan.hayward@arm.com>
* configure.srv: Add new files.
* linux-aarch64-ipa.c (get_ipa_tdesc): Call
aarch64_linux_read_description.
* linux-aarch64-low.c (aarch64_linux_read_description):
Merge with aarch64_arch_setup.
(aarch64_arch_setup): Call aarch64_linux_read_description.
* linux-aarch64-tdesc.c: New file.
* linux-aarch64-tdesc.h: New file.
2017-11-24 Yao Qi <yao.qi@linaro.org>
* configure.srv: Set $srv_regobj for tic6x-linux.
* linux-tic6x-low.c: Include "arch/tic6x.h" and "tdesc.h".
(tic6x_read_description): Move some code to tic6x_arch_setup.
(tic6x_tdesc_test): New function.
(initialize_low_arch): Call selftests::register_test.
Fix build with GCC 8: strncpy -> memcpy Recent gcc 8 trunk emits the warning below, ../../../binutils-gdb/gdb/gdbserver/remote-utils.c:1204:14: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 6 bytes from a string of the same length [-Werror=stringop-truncation] strncpy (buf, "watch:", 6); ~~~~~~~~^~~~~~~~~~~~~~~~~~ ../../binutils-gdb/gdb/cli/cli-decode.c:1118:15: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] strncpy (cmdtype1 + 1, cmdtype, len - 1); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../binutils-gdb/gdb/cli/cli-decode.c:1110:16: note: length computed here len = strlen (cmdtype); ~~~~~~~^~~~~~~~~ ../../binutils-gdb/gdb/cli/cli-decode.c:1120:15: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] strncpy (cmdtype2, cmdtype, len - 1); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../binutils-gdb/gdb/cli/cli-decode.c:1110:16: note: length computed here len = strlen (cmdtype); ~~~~~~~^~~~~~~~~ ../../binutils-gdb/gdb/cp-namespace.c:1071:11: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 2 bytes from a string of the same length [-Werror=stringop-truncation] strncpy (full_name + scope_length, "::", 2); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This patch fixes it by using memcpy instead of strncpy. gdb: 2017-11-22 Yao Qi <yao.qi@linaro.org> * cli/cli-decode.c (help_list): Use memcpy instead of strncpy. * cp-namespace.c (cp_lookup_transparent_type_loop): Likewise. gdb/gdbserver: 2017-11-22 Yao Qi <yao.qi@linaro.org> * remote-utils.c (prepare_resume_reply): Use memcpy.
2017-11-22 13:22:11 +01:00
2017-11-22 Yao Qi <yao.qi@linaro.org>
* remote-utils.c (prepare_resume_reply): Use memcpy.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (kill_one_lwp_callback): Return void, take
argument directly, don't filter on pid.
(linux_kill): Use for_each_thread.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (need_step_over_p): Return bool, remove dummy
argument.
(linux_resume, proceed_all_lwps): Use find_thread.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (resume_status_pending_p): Return bool, remove
flag_p argument.
(linux_resume): Use find_thread.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (struct thread_resume_array): Remove.
(linux_set_resume_request): Return void, take arguments
directly.
(linux_resume): Use for_each_thread.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (stuck_in_jump_pad_callback): Change prototype,
return bool, remove data argument.
(linux_stabilize_threads): Use find_thread.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (unsuspend_one_lwp): Remove.
(unsuspend_all_lwps): Use for_each_thread, inline code from
unsuspend_one_lwp.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* gdbthread.h (find_thread): Add overload with ptid_t filter.
* linux-low.c (struct iterate_over_lwps_args): Remove.
(iterate_over_lwps_filter): Remove.
(iterate_over_lwps): Use find_thread.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (reset_lwp_ptrace_options_callback): Remove.
(linux_handle_new_gdb_connection): Use for_each_thread, inline
code from reset_lwp_ptrace_options_callback.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* linux-arm-low.c (struct update_registers_data): Remove.
(update_registers_callback): Return void, take arguments
directly, don't check thread's pid.
(arm_insert_point, arm_remove_point): Use for_each_thread.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* win32-low.c (continue_one_thread): Return void, take argument
directly.
(child_continue): Use for_each_thread.
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
* win32-i386-low.c (update_debug_registers_callback): Rename
to ...
(update_debug_registers): ... this, return void, remove pid_p arg.
(x86_dr_low_set_addr, x86_dr_low_set_control): Use for_each_thread.
2017-11-17 Simon Marchi <simon.marchi@polymtl.ca>
* inferiors.h (struct process_info): Add constructor, initialize
fields..
<syscalls_to_catch>: Change type to std::vector<int>.
* inferiors.c (add_process): Allocate process_info with new.
(remove_process): Free process_info with delete.
* linux-low.c (handle_extended_wait): Adjust.
(gdb_catching_syscalls_p, gdb_catch_this_syscall_p): Adjust.
* server.c (handle_general_set): Adjust.
2017-11-16 Pedro Alves <palves@redhat.com>
* remote-utils.c (remote_close): Block SIGIO signals instead of
uninstalling the SIGIO handler.
2017-11-16 Alan Hayward <alan.hayward@arm.com>
* tdesc.c (tdesc_get_features_xml): Allow null osabi.
2017-11-16 Yao Qi <yao.qi@linaro.org>
* linux-tic6x-low.c (tic6x_fill_gregset): Cast buf.
(tic6x_store_gregset): Likewise.
(tic6x_usrregs_info): Move it up.
2017-11-15 Alan Hayward <alan.hayward@arm.com>
* Makefile.in: Update arch rules.
* configure.srv: Explicitly mark arch/ files.
2017-11-13 Andreas Schwab <schwab@suse.de>
* linux-m68k-low.c (m68k_supports_hardware_single_step): New
function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
2017-11-06 Pedro Alves <palves@redhat.com>
* config.in, configure: Regenerate.
2017-10-27 Simon Marchi <simon.marchi@ericsson.com>
* target.c (struct thread_search): Remove.
(thread_search_callback): Remove.
(prepare_to_access_memory): Use for_each_thread instead of
find_inferior. Inline code from thread_search_callback.
2017-10-27 Simon Marchi <simon.marchi@ericsson.com>
* server.c (struct visit_actioned_threads_data): Remove.
(visit_actioned_threads): Change prototype to take arguments
directly.
(resume): Use find_thread instead of find_inferior.
2017-10-27 Simon Marchi <simon.marchi@ericsson.com>
* server.c (queue_stop_reply_callback): Change prototype, return
void.
(find_status_pending_thread_callback): Remove.
(handle_status): Replace find_inferior with find_thread and
for_each_thread.
2017-10-25 Alan Hayward <alan.hayward@arm.com>
* linux-aarch64-low.c (aarch64_fill_gregset): Replace defines
with REGNO.
(aarch64_store_gregset): Likewise.
(aarch64_fill_fpregset): Likewise.
(aarch64_store_fpregset): Likewise.
2017-10-21 Simon Marchi <simon.marchi@ericsson.com>
* gdbthread.h (find_thread, for_each_thread): New functions.
* inferiors.c (thread_of_pid): Remove.
(find_any_thread_of_pid): Use find_thread.
* linux-low.c (num_lwps): Use for_each_thread.
2017-10-17 Yao Qi <yao.qi@linaro.org>
* Makefile.in: Remove one rule.
* configure.srv: Rename aarch64-insn.o with arch/aarch64-insn.o.
2017-10-17 Yao Qi <yao.qi@linaro.org>
* configure.srv: Rename arm-linux.o with arch/arm-linux.o.
Rename arm-get-next-pcs.o with arch/arm-get-next-pcs.o.
2017-10-17 Yao Qi <yao.qi@linaro.org>
* configure.srv: Rename arm.o with arch/arm.o.
2017-10-17 Yao Qi <yao.qi@linaro.org>
* Makefile.in (CONFIG_SRC_SUBDIR): New variable.
(clean): Remove .o files in CONFIG_SRC_SUBDIR.
(distclean): Remove DEPDIR in CONFIG_SRC_SUBDIR.
(arch-i386.o, arch-amd64.o): Remove rules.
(arch/%.o): New rule.
Update POSTCOMPILE and COMPILE.pre.
* configure.ac: Invoke AC_CONFIG_COMMANDS.
* configure: Re-generated.
* configure.srv: Replace arch-i386.o with arch/i386.o.
Replace arch-amd64.o with arch/amd64.o.
2017-10-16 Yao Qi <yao.qi@linaro.org>
* configure: Regenerated.
gdbserver: use std::list for all_threads Remove the usage of inferior_list for the all_threads list in gdbserver. The entry field in thread_info is removed, and replaced by a simple ptid field. I added some functions to iterate (for_each_thread) and find threads (find_thread). However, changing all the users of find_inferior & co to use these new functions would have made the patch way too big. So I opted instead to make find_inferior & co some shims, so that the existing code only needs to be updated minimally. We can then update the existing code to use the new functions incrementally (I've started to do the work, but I'll post it afterwards, see [1] if you want a peek). This patch has been built-tested on all relevant platforms, except lynx. I also regtested using the native-gdbserver and native-extended-gdbserver boards on x86. [1] https://github.com/simark/binutils-gdb/commits/kill-inferior-list-entry gdb/gdbserver/ChangeLog: * inferiors.h: (struct inferior_list): Remove. (struct inferior_list_entry); Remove. (add_inferior_to_list, clear_inferior_list, one_inferior_p, A_I_NEXT, ALL_INFERIORS_TYPE, ALL_INFERIORS, remove_inferior, get_first_inferior): Remove. (for_each_inferior, for_each_inferior_with_data, find_inferior, find_inferior_id, find_inferior_in_random): Change signature. * inferiors.c (all_threads): Change type to std::list<thread_info *>. (get_thread): Remove macro. (find_inferior, find_inferior_id): Change signature, implement using find_thread. (find_inferior_in_random): Change signature, implement using find_thread_in_random. (for_each_inferior, for_each_inferior_with_data): Change signature, implement using for_each_thread. (add_inferior_to_list, remove_inferior): Remove. (add_thread, get_first_thread, thread_of_pid, find_any_thread_of_pid, free_one_thread, remove_thread): Update. (get_first_inferior, one_inferior_p, clear_inferior_list): Remove. (clear_inferiors, get_thread_process): Update. * gdbthread.h: Include <list>. (struct thread_info) <entry>: Remove field. <id>: New field. (all_threads): Change type to std::list<thread_info *>. (get_first_inferior): Add doc. (find_thread, for_each_thread, find_thread_in_random): New functions. (current_ptid, pid_of, ptid_of, lwpid_of): Update. * linux-arm-low.c (update_registers_callback): Update. * linux-low.c (second_thread_of_pid_p): Update. (kill_one_lwp_callback, linux_detach_lwp_callback, delete_lwp_callback, status_pending_p_callback, same_lwp, find_lwp_pid, num_lwps, iterate_over_lwps_filter, iterate_over_lwps, not_stopped_callback, resume_stopped_resumed_lwps, count_events_callback, select_singlestep_lwp_callback, select_event_lwp_callback, unsuspend_one_lwp, linux_wait_1, send_sigstop_callback, suspend_and_send_sigstop_callback, wait_for_sigstop, stuck_in_jump_pad_callback, move_out_of_jump_pad_callback, lwp_running, linux_set_resume_request, resume_status_pending_p, need_step_over_p, start_step_over, linux_resume_one_thread, proceed_one_lwp, unsuspend_and_proceed_one_lwp, reset_lwp_ptrace_options_callback): Update. * linux-mips-low.c (update_watch_registers_callback): Update. * regcache.c (regcache_invalidate_one, regcache_invalidate): Update. (free_register_cache_thread_one): Remove. (regcache_release): Update. * server.c (handle_btrace_enable_bts, handle_btrace_enable_pt, handle_qxfer_threads_worker): Update. (handle_query): Update, use list iterator. (visit_actioned_threads, handle_pending_status, queue_stop_reply_callback, gdb_wants_all_threads_stopped, clear_pending_status_callback, set_pending_status_callback, find_status_pending_thread_callback, handle_status, process_serial_event): Update. * target.c (thread_search_callback): Update. * thread-db.c (thread_db_get_tls_address): Update. * tracepoint.c (tracepoint_finished_step, tracepoint_was_hit): Update. * win32-i386-low.c (update_debug_registers_callback): Update. * win32-low.c (delete_thread_info, child_delete_thread, continue_one_thread, suspend_one_thread, get_child_debug_event): Adjust.
2017-10-14 15:11:12 +02:00
2017-10-14 Simon Marchi <simon.marchi@polymtl.ca>
* inferiors.h: (struct inferior_list): Remove.
(struct inferior_list_entry); Remove.
(add_inferior_to_list, clear_inferior_list, one_inferior_p,
A_I_NEXT, ALL_INFERIORS_TYPE, ALL_INFERIORS, remove_inferior,
get_first_inferior): Remove.
(for_each_inferior, for_each_inferior_with_data, find_inferior,
find_inferior_id, find_inferior_in_random): Change signature.
* inferiors.c (all_threads): Change type to
std::list<thread_info *>.
(get_thread): Remove macro.
(find_inferior, find_inferior_id): Change signature, implement
using find_thread.
(find_inferior_in_random): Change signature, implement using
find_thread_in_random.
(for_each_inferior, for_each_inferior_with_data): Change
signature, implement using for_each_thread.
(add_inferior_to_list, remove_inferior): Remove.
(add_thread, get_first_thread, thread_of_pid,
find_any_thread_of_pid, free_one_thread, remove_thread): Update.
(get_first_inferior, one_inferior_p, clear_inferior_list):
Remove.
(clear_inferiors, get_thread_process): Update.
* gdbthread.h: Include <list>.
(struct thread_info) <entry>: Remove field.
<id>: New field.
(all_threads): Change type to std::list<thread_info *>.
(get_first_inferior): Add doc.
(find_thread, for_each_thread, find_thread_in_random): New
functions.
(current_ptid, pid_of, ptid_of, lwpid_of): Update.
* linux-arm-low.c (update_registers_callback): Update.
* linux-low.c (second_thread_of_pid_p): Update.
(kill_one_lwp_callback, linux_detach_lwp_callback,
delete_lwp_callback, status_pending_p_callback, same_lwp,
find_lwp_pid, num_lwps, iterate_over_lwps_filter,
iterate_over_lwps, not_stopped_callback,
resume_stopped_resumed_lwps, count_events_callback,
select_singlestep_lwp_callback, select_event_lwp_callback,
unsuspend_one_lwp, linux_wait_1, send_sigstop_callback,
suspend_and_send_sigstop_callback, wait_for_sigstop,
stuck_in_jump_pad_callback, move_out_of_jump_pad_callback,
lwp_running, linux_set_resume_request, resume_status_pending_p,
need_step_over_p, start_step_over, linux_resume_one_thread,
proceed_one_lwp, unsuspend_and_proceed_one_lwp,
reset_lwp_ptrace_options_callback): Update.
* linux-mips-low.c (update_watch_registers_callback): Update.
* regcache.c (regcache_invalidate_one, regcache_invalidate):
Update.
(free_register_cache_thread_one): Remove.
(regcache_release): Update.
* server.c (handle_btrace_enable_bts, handle_btrace_enable_pt,
handle_qxfer_threads_worker): Update.
(handle_query): Update, use list iterator.
(visit_actioned_threads, handle_pending_status,
queue_stop_reply_callback, gdb_wants_all_threads_stopped,
clear_pending_status_callback, set_pending_status_callback,
find_status_pending_thread_callback, handle_status,
process_serial_event): Update.
* target.c (thread_search_callback): Update.
* thread-db.c (thread_db_get_tls_address): Update.
* tracepoint.c (tracepoint_finished_step, tracepoint_was_hit):
Update.
* win32-i386-low.c (update_debug_registers_callback): Update.
* win32-low.c (delete_thread_info, child_delete_thread,
continue_one_thread, suspend_one_thread,
get_child_debug_event): Adjust.
gdbserver: Use std::list for all_processes Remove the usage of inferior_list for the all_processes list in gdbserver, replace it with an std::list. The entry field in process_info is removed, and replaced by a simple pid field. The pid_of macro, used for both processes and threads, is replaced with separate functions. For completeness, I changed ptid_of and lwpid_of to functions as well. gdb/gdbserver/ChangeLog: * gdbthread.h (ptid_of, pid_of, lwpid_of): New functions. * inferiors.h: Include <list>. (struct process_info) <entry>: Remove field. <pid>: New field. (pid_of): Change macro to function. (ptid_of, lwpid_of): Remove macro. (all_processes): Change type to std::list<process_info *>. (ALL_PROCESSES): Remove macro. (for_each_process, find_process): New function. * inferiors.c (all_processes): Change type to std::list<process_info *>. (find_thread_process): Adjust. (add_process): Likewise. (remove_process): Likewise. (find_process_pid): Likewise. (get_first_process): Likewise. (started_inferior_callback): Remove. (have_started_inferiors_p): Adjust. (attached_inferior_callback): Remove. (have_attached_inferiors_p): Adjust. * linux-low.c (check_zombie_leaders): Likewise. * linux-x86-low.c (x86_arch_setup_process_callback): Remove. (x86_linux_update_xmltarget): Adjust. * server.c (handle_query): Likewise. (gdb_reattached_process): Remove. (handle_status): Adjust. (kill_inferior_callback): Likewise. (detach_or_kill_inferior): Remove. (print_started_pid): Likewise. (print_attached_pid): Likewise. (detach_or_kill_for_exit): Update. (process_serial_event): Likewise. * linux-arm-low.c (arm_new_fork): Likewise.
2017-10-14 15:10:42 +02:00
2017-10-14 Simon Marchi <simon.marchi@polymtl.ca>
* gdbthread.h (ptid_of, pid_of, lwpid_of): New functions.
* inferiors.h: Include <list>.
(struct process_info) <entry>: Remove field.
<pid>: New field.
(pid_of): Change macro to function.
(ptid_of, lwpid_of): Remove macro.
(all_processes): Change type to std::list<process_info *>.
(ALL_PROCESSES): Remove macro.
(for_each_process, find_process): New function.
* inferiors.c (all_processes): Change type to
std::list<process_info *>.
(find_thread_process): Adjust.
(add_process): Likewise.
(remove_process): Likewise.
(find_process_pid): Likewise.
(get_first_process): Likewise.
(started_inferior_callback): Remove.
(have_started_inferiors_p): Adjust.
(attached_inferior_callback): Remove.
(have_attached_inferiors_p): Adjust.
* linux-low.c (check_zombie_leaders): Likewise.
* linux-x86-low.c (x86_arch_setup_process_callback): Remove.
(x86_linux_update_xmltarget): Adjust.
* server.c (handle_query): Likewise.
(gdb_reattached_process): Remove.
(handle_status): Adjust.
(kill_inferior_callback): Likewise.
(detach_or_kill_inferior): Remove.
(print_started_pid): Likewise.
(print_attached_pid): Likewise.
(detach_or_kill_for_exit): Update.
(process_serial_event): Likewise.
* linux-arm-low.c (arm_new_fork): Likewise.
2017-10-14 Simon Marchi <simon.marchi@polymtl.ca>
* dll.h: Include <list>.
(struct dll_info): Add constructor.
<entry>: Remove field.
(all_dlls): Change type to std::list<dll_info>.
* dll.c: Include <algorithm>.
(get_dll): Remove macro.
(all_dlls): Change type to std::list<dll_info *>.
(free_one_dll): Remove.
(match_dll): Likewise.
(loaded_dll): Adjust.
(unloaded_dll): Adjust to all_dlls type change, use
std::find_if. Inline code from match_dll.
(clear_dlls): Adjust to all_dlls type change.
* server.c (emit_dll_description): Remove.
(handle_qxfer_libraries): Adjust to all_dlls type change,
integrate emit_dll_description's functionality.
2017-10-12 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.h (struct linux_target_ops) <delete_process>: New
field.
* linux-low.c (linux_mourn): Call the_low_target.delete_process.
* linux-aarch64-low.c (aarch64_linux_delete_process): New.
(struct linux_target_ops): Add delete_process callback.
* linux-arm-low.c (arm_delete_process): New.
(struct linux_target_ops): Add delete_process callback.
* linux-bfin-low.c (struct linux_target_ops): Likewise.
* linux-crisv32-low.c (struct linux_target_ops): Likewise.
* linux-m32r-low.c (struct linux_target_ops): Likewise.
* linux-mips-low.c (mips_linux_delete_process): New.
(struct linux_target_ops): Add delete_process callback.
* linux-ppc-low.c (struct linux_target_ops): Likewise.
* linux-s390-low.c (struct linux_target_ops): Likewise.
* linux-sh-low.c (struct linux_target_ops): Likewise.
* linux-tic6x-low.c (struct linux_target_ops): Likewise.
* linux-tile-low.c (struct linux_target_ops): Likewise.
* linux-x86-low.c (x86_linux_delete_process): New.
(struct linux_target_ops): Add delete_process callback.
* linux-xtensa-low.c (struct linux_target_ops): Likewise.
lwp_info: Make the arch code free arch_lwp_info I have the goal of "poisoning" the XNEW/xfree-family of functions, so that we catch their usages with non-POD types. A few things need to be fixed in the mean time, this is one. The common lwp code in linux-nat.c and gdbserver/linux-low.c xfrees the private lwp data of type arch_lwp_info. However, that type is opaque from its point of view, as its defined differently in each arch-specific implementation. This trips on the std::is_pod<T> check, since the compiler can't tell whether the type is POD or not if it doesn't know about it. My initial patch [1] made a class hierarchy with a virtual destructor. However, as Pedro pointed out, we only have one native architecture at the time built in gdb and gdbserver, so that's overkill. Instead, we can move the responsibility of free'ing arch_lwp_info to the arch code (which is also the one that allocated it in the first place). This is what this patch does. Also, I had the concern that if we wanted to use C++ features in these structures, we would have a problem with the one-definition rule. However, since a build will only have one version of arch_lwp_info, that's not a problem. There are changes in arch-specific files, I was only able to built-test this patch with the following cross-compilers: aarch64-linux-gnu alpha-linux-gnu arm-linux-gnueabihf hppa-linux-gnu m68k-linux-gnu mips64el-linux-gnuabi64 powerpc64-linux-gnu s390x-linux-gnu sh4-linux-gnu sparc64-linux-gnu x86_64-linux-gnu x86_64-w64-mingw32 A buildbot run didn't find any regression. [1] https://sourceware.org/ml/gdb-patches/2017-08/msg00255.html gdb/ChangeLog: * linux-nat.h (linux_nat_set_delete_thread): New declaration. * linux-nat.c (linux_nat_delete_thread): New variable. (lwp_free): Invoke linux_nat_delete_thread if set. (linux_nat_set_delete_thread): New function. * aarch64-linux-nat.c (_initialize_aarch64_linux_nat): Assign thread delete callback. * arm-linux-nat.c (arm_linux_delete_thread): New function. (_initialize_arm_linux_nat): Assign thread delete callback. * s390-linux-nat.c (s390_delete_thread): New function. (_initialize_s390_nat): Assign thread delete callback. * x86-linux-nat.c (x86_linux_add_target): Likewise. * nat/aarch64-linux.c (aarch64_linux_delete_thread): New function. * nat/aarch64-linux.h (aarch64_linux_delete_thread): New declaration. * nat/x86-linux.c (x86_linux_delete_thread): New function. * nat/x86-linux.h (x86_linux_delete_thread): New declaration. gdb/gdbserver/ChangeLog: * linux-aarch64-low.c (the_low_target): Add thread delete callback. * linux-arm-low.c (arm_delete_thread): New function. (the_low_target): Add thread delete callback. * linux-bfin-low.c (the_low_target): Likewise. * linux-crisv32-low.c (the_low_target): Likewise. * linux-low.c (delete_lwp): Invoke delete_thread callback if set. * linux-low.h (struct linux_target_ops) <delete_thread>: New field. * linux-m32r-low.c (the_low_target): Add thread delete callback. * linux-mips-low.c (mips_linux_delete_thread): New function. (the_low_target): Add thread delete callback. * linux-ppc-low.c (the_low_target): Likewise. * linux-s390-low.c (the_low_target): Likewise. * linux-sh-low.c (the_low_target): Likewise. * linux-tic6x-low.c (the_low_target): Likewise. * linux-tile-low.c (the_low_target): Likewise. * linux-x86-low.c (the_low_target): Likewise. * linux-xtensa-low.c (the_low_target): Likewise.
2017-10-12 22:48:22 +02:00
2017-10-12 Simon Marchi <simon.marchi@ericsson.com>
* linux-aarch64-low.c (the_low_target): Add thread delete
callback.
* linux-arm-low.c (arm_delete_thread): New function.
(the_low_target): Add thread delete callback.
* linux-bfin-low.c (the_low_target): Likewise.
* linux-crisv32-low.c (the_low_target): Likewise.
* linux-low.c (delete_lwp): Invoke delete_thread callback if
set.
* linux-low.h (struct linux_target_ops) <delete_thread>: New
field.
* linux-m32r-low.c (the_low_target): Add thread delete callback.
* linux-mips-low.c (mips_linux_delete_thread): New function.
(the_low_target): Add thread delete callback.
* linux-ppc-low.c (the_low_target): Likewise.
* linux-s390-low.c (the_low_target): Likewise.
* linux-sh-low.c (the_low_target): Likewise.
* linux-tic6x-low.c (the_low_target): Likewise.
* linux-tile-low.c (the_low_target): Likewise.
* linux-x86-low.c (the_low_target): Likewise.
* linux-xtensa-low.c (the_low_target): Likewise.
2017-10-06 Yuanhui Zhang <asmwarrior@gmail.com>
* win32-low.c: Include "common-inferior.h".
Extend "set cwd" to work on gdbserver This is the "natural" extension necessary for the "set cwd" command (and the whole "set the inferior's cwd" logic) to work on gdbserver. The idea here is to have a new remote packet, QSetWorkingDir (name adopted from LLDB's extension to the RSP, as can be seen at <https://raw.githubusercontent.com/llvm-mirror/lldb/master/docs/lldb-gdb-remote.txt>), which sends an hex-encoded string representing the working directory that the remote inferior will use. There is a slight difference from the packet proposed by LLDB: GDB's version will accept empty arguments, meaning that the user wants to clear the previously set working directory for the inferior (i.e., "set cwd" without arguments on GDB). For UNIX-like targets this feature is already implemented on nat/fork-inferior.c, and all gdbserver has to do is to basically implement "set_inferior_cwd" and call it whenever such packet arrives. For other targets, like Windows, it is possible to use the existing "get_inferior_cwd" function and do the necessary steps to make sure that the inferior will use the specified working directory. Aside from that, the patch consists basically of updates to the testcase (making it available on remote targets) and the documentation. No regressions found. gdb/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * NEWS (Changes since GDB 8.0): Add entry about new 'set-cwd-on-gdbserver' feature. (New remote packets): Add entry for QSetWorkingDir. * common/common-inferior.h (set_inferior_cwd): New prototype. * infcmd.c (set_inferior_cwd): Remove "static". (show_cwd_command): Expand text to include remote debugging. * remote.c: Add PACKET_QSetWorkingDir. (remote_protocol_features) <QSetWorkingDir>: New entry for PACKET_QSetWorkingDir. (extended_remote_set_inferior_cwd): New function. (extended_remote_create_inferior): Call "extended_remote_set_inferior_cwd". (_initialize_remote): Call "add_packet_config_cmd" for QSetWorkingDir. gdb/gdbserver/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * inferiors.c (set_inferior_cwd): New function. * server.c (handle_general_set): Handle QSetWorkingDir packet. (handle_query): Inform that QSetWorkingDir is supported. * win32-low.c (create_process): Pass the inferior's cwd to CreateProcess. gdb/testsuite/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/set-cwd.exp: Make it available on native-extended-gdbserver. gdb/doc/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.texinfo (Starting your Program) <The working directory.>: Mention remote debugging. (Working Directory) <Your Program's Working Directory>: Likewise. (Connecting) <Remote Packet>: Add "set-working-dir" and "QSetWorkingDir" to the table. (Remote Protocol) <QSetWorkingDir>: New item, explaining the packet.
2017-09-21 01:15:40 +02:00
2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com>
* inferiors.c (set_inferior_cwd): New function.
* server.c (handle_general_set): Handle QSetWorkingDir packet.
(handle_query): Inform that QSetWorkingDir is supported.
* win32-low.c (create_process): Pass the inferior's cwd to
CreateProcess.
Implement "set cwd" command on GDB This commit adds new "set/show cwd" commands, which are used to set/show the current working directory of the inferior that will be started. The idea here is that "set cwd" will become the de facto way of setting the inferior's cwd. Currently, the user can use "cd" for that, but there are side effects: with "cd", GDB also switches to another directory, and that can impact the loading of scripts and other files. With "set cwd", we separate the logic into a new command. To maintain backward compatibility, if the user issues a "cd" command but doesn't use "set cwd", then the inferior's cwd will still be changed according to what the user specified. However, "set cwd" has precedence over "cd", so it can always be used to override it. "set cwd" works in the following way: - If the user sets the inferior's cwd by using "set cwd", then this directory is saved into current_inferior ()->cwd and is used when the inferior is started (see below). - If the user doesn't set the inferior's cwd by using "set cwd", but rather use the "cd" command as before, then this directory is inherited by the inferior because GDB will have chdir'd into it. On Unix-like hosts, the way the directory is changed before the inferior execution is by expanding the user set directory before the fork, and then "chdir" after the call to fork/vfork on "fork_inferior", but before the actual execution. On Windows, the inferior cwd set by the user is passed directly to the CreateProcess call, which takes care of the actual chdir for us. This way, we'll make sure that GDB's cwd is not affected by the user set cwd. gdb/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * NEWS (New commands): Mention "set/show cwd". * cli/cli-cmds.c (_initialize_cli_cmds): Mention "set cwd" on "cd" command's help text. * common/common-inferior.h (get_inferior_cwd): New prototype. * infcmd.c (inferior_cwd_scratch): New global variable. (set_inferior_cwd): New function. (get_inferior_cwd): Likewise. (set_cwd_command): Likewise. (show_cwd_command): Likewise. (_initialize_infcmd): Add "set/show cwd" commands. * inferior.h (class inferior) <cwd>: New field. * nat/fork-inferior.c: Include "gdb_tilde_expand.h". (fork_inferior): Change inferior's cwd before its execution. * windows-nat.c (windows_create_inferior): Pass inferior's cwd to CreateProcess. gdb/gdbserver/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * inferiors.c (current_inferior_cwd): New global variable. (get_inferior_cwd): New function. * inferiors.h (struct process_info) <cwd>: New field. gdb/doc/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.texinfo (Starting your Program) <The working directory.>: Mention new "set cwd" command. (Working Directory) <Your Program's Working Directory>: Rephrase to explain that "set cwd" exists and is the default way to change the inferior's cwd. gdb/testsuite/ChangeLog: 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/set-cwd.c: New file. * gdb.base/set-cwd.exp: Likewise.
2017-09-11 07:13:50 +02:00
2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com>
* inferiors.c (current_inferior_cwd): New global variable.
(get_inferior_cwd): New function.
* inferiors.h (struct process_info) <cwd>: New field.
2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (SFILES): Add $(srcdir)/common/gdb_tilde_expand.c.
(OBS): Add gdb_tilde_expand.o.
2017-10-02 Simon Marchi <simon.marchi@ericsson.com>
* lynx-i386-low.c (lynx_i386_arch_setup): Call init_target_desc.
* nto-x86-low.c (nto_x86_arch_setup): Likewise.
Constify unpack_varlen_hex & fix fallout I ran into non-const unpack_varlen_hex while working on something else, and decided to just fix it first. Ends up constifying a good deal of remote packet parsing. gdb/ChangeLog: 2017-09-29 Pedro Alves <palves@redhat.com> * common/rsp-low.c (unpack_varlen_hex): Constify. * common/rsp-low.h (unpack_varlen_hex): Constify. * linux-nat.c (linux_child_static_tracepoint_markers_by_strid): Constify. * remote.c (remote_set_permissions, read_ptid) (remote_current_thread, remote_get_threads_with_qthreadinfo) (remote_static_tracepoint_marker_at) (remote_static_tracepoint_markers_by_strid) (stop_reply_extract_thread, remote_parse_stop_reply): Constify. * tracepoint.c (parse_trace_status, parse_tracepoint_status) (parse_tracepoint_definition, parse_tsv_definition) (parse_static_tracepoint_marker_definition): Constify. * tracepoint.h (parse_static_tracepoint_marker_definition) (parse_trace_status, parse_tracepoint_status) (parse_tracepoint_definition, parse_tsv_definition): Constify. gdb/gdbserver/ChangeLog: 2017-09-29 Pedro Alves <palves@redhat.com> * ax.c (gdb_parse_agent_expr): Constify. * ax.h (gdb_parse_agent_expr): Constify. * mem-break.c (add_breakpoint_condition, add_breakpoint_commands): Constify. * mem-break.h (add_breakpoint_condition, add_breakpoint_commands): Constify. * remote-utils.c (hex_or_minus_one, read_ptid): Constify. * remote-utils.h (read_ptid): Constify. * server.c (handle_qxfer_exec_file, handle_query, handle_v_cont) (process_point_options, process_serial_event): Constify. * tracepoint.c (add_tracepoint_action, cmd_qtdp, cmd_qtdpsrc) (cmd_qtdv, cmd_qtenable_disable, cmd_qtro, cmd_qtframe, cmd_qtp) (cmd_qtbuffer): Constify.
2017-09-29 18:15:36 +02:00
2017-09-29 Pedro Alves <palves@redhat.com>
* ax.c (gdb_parse_agent_expr): Constify.
* ax.h (gdb_parse_agent_expr): Constify.
* mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
Constify.
* mem-break.h (add_breakpoint_condition, add_breakpoint_commands): Constify.
* remote-utils.c (hex_or_minus_one, read_ptid): Constify.
* remote-utils.h (read_ptid): Constify.
* server.c (handle_qxfer_exec_file, handle_query, handle_v_cont)
(process_point_options, process_serial_event): Constify.
* tracepoint.c (add_tracepoint_action, cmd_qtdp, cmd_qtdpsrc)
(cmd_qtdv, cmd_qtenable_disable, cmd_qtro, cmd_qtframe, cmd_qtp)
(cmd_qtbuffer): Constify.
2017-09-29 Pedro Alves <palves@redhat.com>
* proc-service.c (ps_pdread): Return PS_ERR if reading memory
fails.
2017-09-29 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Pass parent thread instead
of process to thread_db_notice_clone.
* linux-low.h (thread_db_notice_clone): Replace parent process
parameter with parent thread parameter.
* thread-db.c (find_one_thread): Add comment.
(thread_db_notice_clone): Replace parent process parameter with
parent thread parameter. Temporarily switch to the parent thread.
2017-09-26 Sergio Durigan Junior <sergiodj@redhat.com>
* gdbthread.h: Include "common-gdbthread.h".
* inferiors.c (switch_to_thread): Use "gdb_assert" instead of
"if" when validating the ptid.
* remote-utils.c: Include "gdbthread.h".
(prepare_resume_reply): Use "switch_to_thread".
* target.c (done_accessing_memory): Likewise.
2017-09-25 Andreas Arnez <arnez@linux.vnet.ibm.com>
* configure.srv (s390*-*-linux*): Add s390-gs-linux64.o and
s390x-gs-linux64.o to srv_regobj. Add s390-gs-linux64.xml,
s390x-gs-linux64.xml, s390-gs.xml, and s390-gsbc.xml to
srv_xmlfiles. Add s390-gs-linux64-ipa.o and
s390x-gs-linux64-ipa.o to ipa_obj.
* linux-s390-low.c (HWCAP_S390_GS): New define.
(s390_fill_gs, s390_store_gs, s390_fill_gsbc, s390_store_gsbc):
New functions.
(s390_regsets): Add regsets for NT_S390_GS_CB and NT_S390_GS_BC.
(s390_arch_setup): Check for guarded-storage support and choose
appropriate tdesc.
(initialize_low_arch): Invoke init_registers_s390_gs_linux64 and
init_registers_s390x_gs_linux64.
* linux-s390-tdesc.h (enum s390_linux_tdesc) <S390_TDESC_GS>: New
enum value.
(init_registers_s390x_gs_linux64, tdesc_s390x_gs_linux64)
(init_registers_s390_gs_linux64, tdesc_s390_gs_linux64): Declare.
2017-09-22 Simon Marchi <simon.marchi@ericsson.com>
* win32-i386-low.c (i386_arch_setup): Call init_target_desc.
Add thread_handle_to_thread_info support for remote targets This patch adds support to remote targets for converting a thread handle to a thread_info struct pointer. A thread handle is fetched via a "handle" attribute which has been added to the qXfer:threads:read query packet. An implementation is provided in gdbserver for targets using the Linux kernel. gdb/gdbserver/ChangeLog: * linux-low.h (struct lwp_info): Add new field, thread_handle. (thread_db_thread_handle): Declare. * linux-low.c (linux_target_ops): Initialize thread_handle. * server.c (handle_qxfer_threads_worker): Add support for "handle" attribute. * target.h (struct target_ops): Add new function pointer, thread_handle. (target_thread_handle): Define. * thread-db.c (find_one_thread, attach_thread): Set thread_handle field in lwp. (thread_db_thread_handle): New function. gdb/ChangeLog: * remote.c (vector): Include. (struct private_thread_info): Add field, thread_handle. (free_private_thread_info): Deallocate storage associated with thread handle. (get_private_info_thread): Initialize `thread_handle' field. (struct thread_item): Add field, thread_handle. (clear_threads_listing_context): Deallocate storage associated with thread handle. (start_thread): Add support for "handle" attribute. (thread_attributes): Add "handle". (remote_get_threads_with_qthreadinfo): Initialize thread_handle field. (remote_update_thread_list): Update thread_handle. (remote_thread_handle_to_thread_info): New function. (init_remote_ops): Initialize to_thread_handle_to_thread_info.
2017-04-05 01:17:05 +02:00
2017-09-21 Kevin Buettner <kevinb@redhat.com>
* linux-low.h (struct lwp_info): Add new field, thread_handle.
(thread_db_thread_handle): Declare.
* linux-low.c (linux_target_ops): Initialize thread_handle.
* server.c (handle_qxfer_threads_worker): Add support for
"handle" attribute.
* target.h (struct target_ops): Add new function pointer,
thread_handle.
(target_thread_handle): Define.
* thread-db.c (find_one_thread, attach_thread): Set thread_handle
field in lwp.
(thread_db_thread_handle): New function.
2017-09-21 Kevin Buettner <kevinb@redhat.com>
* linux-low.c (handle_extended_wait): Call thread_db_notice_clone().
* linux-low.h (thread_db_notice_clone): Declare.
* thread-db.c (thread_db_notice_clone): New function.
2017-09-21 Pedro Alves <palves@redhat.com>
* server.c (gdb_read_memory, handle_status, process_serial_event)
(handle_serial_event, handle_target_event): Adjust to
set_desired_thread prototype change.
* target.c (set_desired_thread): Remove 'use_general' parameter
and adjust.
* target.h (set_desired_thread): Remove 'use_general' parameter.
Remove make_cleanup_restore_target_terminal This removes make_cleanup_restore_target_terminal and generally C++-ifies target terminal handling. It changes all target_terminal_* functions to be static members of a new target_terminal class and changes the cleanup to be a scoped_* class. make_cleanup_override_quit_handler is also removed in favor of simply using scoped_restore. Note that there are some files in this patch that I could not compile. Considering that some of the rewrites were automated, and that none of these files involed cleanups, I feel that this is relatively safe. Regression tested by the buildbot. gdb/ChangeLog 2017-09-20 Tom Tromey <tom@tromey.com> * windows-nat.c (get_windows_debug_event, windows_wait) (do_initial_windows_stuff, windows_attach): Update. * utils.c (vwarning, internal_vproblem): Update. (ui_unregister_input_event_handler_cleanup) (prepare_to_handle_input): Remove. (class scoped_input_handler): New. (defaulted_query, prompt_for_continue): Update. * tui/tui-hooks.c (tui_refresh_frame_and_register_information): Update. * top.c (undo_terminal_modifications_before_exit): Update. * target/target.h (target_terminal_init, target_terminal_inferior) (target_terminal_ours): Don't declare. (class target_terminal): New. * target.h (target_terminal_is_inferior, target_terminal_is_ours) (target_terminal_ours_for_output) (make_cleanup_restore_target_terminal): Don't declare. (target_terminal_info): Remove. * target.c (enum terminal_state, terminal_state): Remove. (target_terminal::terminal_state): Define. (target_terminal::init): Rename from target_terminal_init. (target_terminal::inferior): Rename from target_terminal_inferior. (target_terminal::ours): Rename from target_terminal_ours. (target_terminal::ours_for_output): Rename from target_terminal_ours_for_output. (target_terminal::info): New method. (cleanup_restore_target_terminal) (make_cleanup_restore_target_terminal): Remove. * solib.c (handle_solib_event): Update. * remote.c (remote_serial_quit_handler): Update. (remote_terminal_inferior, remote_wait_as): Update. * record-full.c (record_full_wait_1): Update. * nto-procfs.c (procfs_create_inferior): Update. * nat/fork-inferior.c (startup_inferior): Update. * mi/mi-interp.c (mi_new_thread, mi_thread_exit) (mi_record_changed, mi_inferior_added, mi_inferior_appeared) (mi_inferior_exit, mi_inferior_removed, mi_traceframe_changed) (mi_tsv_created, mi_tsv_deleted, mi_tsv_modified) (mi_breakpoint_created, mi_breakpoint_deleted) (mi_breakpoint_modified, mi_on_resume, mi_solib_loaded) (mi_solib_unloaded, mi_command_param_changed, mi_memory_changed) (mi_user_selected_context_changed, report_initial_inferior): Update. * linux-nat.c (linux_nat_attach, linux_nat_terminal_ours) (linux_nat_terminal_inferior): Update. * infrun.c (follow_fork_inferior) (handle_vfork_child_exec_or_exit, do_target_resume) (check_curr_ui_sync_execution_done, handle_inferior_event_1) (handle_signal_stop, maybe_remove_breakpoints, normal_stop): Update. * inflow.c (child_terminal_init, info_terminal_command): Update. * infcmd.c (post_create_inferior, continue_1, prepare_one_step) (attach_command): Update. * infcall.c (call_thread_fsm_should_stop): Update. * gnu-nat.c (gnu_attach): Update. * extension.c (struct active_ext_lang_state) (restore_active_ext_lang): Update. * exceptions.c (print_flush): Update. * event-top.c (async_enable_stdin, default_quit_handler): Update. (struct quit_handler_cleanup_data, restore_quit_handler) (restore_quit_handler_dtor, make_cleanup_override_quit_handler): Remove. * cp-support.c (gdb_demangle): Update. * breakpoint.c (update_inserted_breakpoint_locations) (insert_breakpoint_locations, handle_jit_event) (disable_breakpoints_in_unloaded_shlib): Update. * annotate.c (annotate_breakpoints_invalid) (annotate_frames_invalid): Update. gdb/gdbserver/ChangeLog 2017-09-20 Tom Tromey <tom@tromey.com> * target.c (target_terminal::terminal_state): Define. (target_terminal::init): Rename from target_terminal_init. (target_terminal::inferior): Rename from target_terminal_inferior. (target_terminal::ours): Rename from target_terminal_ours. (target_terminal::ours_for_output, target_terminal::info): New.
2017-09-20 05:56:36 +02:00
2017-09-20 Tom Tromey <tom@tromey.com>
* target.c (target_terminal::terminal_state): Define.
(target_terminal::init): Rename from target_terminal_init.
(target_terminal::inferior): Rename from
target_terminal_inferior.
(target_terminal::ours): Rename from target_terminal_ours.
(target_terminal::ours_for_output, target_terminal::info): New.
2017-09-16 Simon Marchi <simon.marchi@ericsson.com>
* server.c (accumulate_file_name_length): Remove.
(emit_dll_description): Adjust to std::string change.
(handle_qxfer_libraries): Use std::string to hold document.
2017-09-16 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (linux_qxfer_libraries_svr4): Adjust to change of
return type of xml_escape_text.
* server.c (emit_dll_description): Likewise.
Add selftests run filtering With the growing number of selftests, I think it would be useful to be able to run only a subset of the tests. This patch associates a name to each registered selftest. It then allows doing something like: (gdb) maintenance selftest aarch64 Running self-tests. Running selftest aarch64-analyze-prologue. Running selftest aarch64-process-record. Ran 2 unit tests, 0 failed or with gdbserver: ./gdbserver --selftest=aarch64 In both cases, only the tests that contain "aarch64" in their name are ran. To help validate that the tests you want to run were actually ran, it also prints a message with the test name before running each test. Right now, all the arch-dependent tests are registered as a single test of the selftests. To be able to filter those too, I made them "first-class citizen" selftests. The selftest type is an interface, with different implementations for "simple selftests" and "arch selftests". The run_tests function simply iterates on that an invokes operator() on each test. I changed the tests data structure from a vector to a map, because - it allows iterating in a stable (alphabetical) order - it allows to easily verify if a test with a given name has been registered, to avoid duplicates There's also a new command "maintenance info selftests" that lists the registered selftests. gdb/ChangeLog: * common/selftest.h (selftest): New struct/interface. (register_test): Add name parameter, add new overload. (run_tests): Add filter parameter. (for_each_selftest_ftype): New typedef. (for_each_selftest): New declaration. * common/selftest.c (tests): Change type to map<string, unique_ptr<selftest>>. (simple_selftest): New struct. (register_test): New function. (register_test): Add name parameter and use it. (run_tests): Add filter parameter and use it. Add prints. Adjust to vector -> map change. * aarch64-tdep.c (_initialize_aarch64_tdep): Add names when registering selftests. * arm-tdep.c (_initialize_arm_tdep): Likewise. * disasm-selftests.c (_initialize_disasm_selftests): Likewise. * dwarf2-frame.c (_initialize_dwarf2_frame): Likewise. * dwarf2loc.c (_initialize_dwarf2loc): Likewise. * findvar.c (_initialize_findvar): Likewise. * gdbarch-selftests.c (_initialize_gdbarch_selftests): Likewise. * maint.c (maintenance_selftest): Update call to run_tests. (maintenance_info_selftests): New function. (_initialize_maint_cmds): Register "maintenance info selftests" command. Update "maintenance selftest" doc. * regcache.c (_initialize_regcache): Add names when registering selftests. * rust-exp.y (_initialize_rust_exp): Likewise. * selftest-arch.c (gdbarch_selftest): New struct. (gdbarch_tests): Remove. (register_test_foreach_arch): Add name parameter. Call register_test. (tests_with_arch): Remove, move most content to gdbarch_selftest::operator(). (_initialize_selftests_foreach_arch): Remove. * selftest-arch.h (register_test_foreach_arch): Add name parameter. (run_tests_with_arch): New declaration. * utils-selftests.c (_initialize_utils_selftests): Add names when registering selftests. * utils.c (_initialize_utils): Likewise. * unittests/array-view-selftests.c (_initialize_array_view_selftests): Likewise. * unittests/environ-selftests.c (_initialize_environ_selftests): Likewise. * unittests/function-view-selftests.c (_initialize_function_view_selftests): Likewise. * unittests/offset-type-selftests.c (_initialize_offset_type_selftests): Likewise. * unittests/optional-selftests.c (_initialize_optional_selftests): Likewise. * unittests/scoped_restore-selftests.c (_initialize_scoped_restore_selftests): Likewise. * NEWS: Document "maintenance selftest" and "maint info selftests". gdb/gdbserver/ChangeLog: * server.c (captured_main): Accept argument for --selftest. Update run_tests call. * linux-x86-tdesc-selftest.c (initialize_low_tdesc): Add names when registering selftests. gdb/doc/ChangeLog: * gdb.texinfo (Maintenance Commands): Document filter parameter of "maint selftest". Document "maint info selftests" command.
2017-09-16 14:06:03 +02:00
2017-09-16 Simon Marchi <simon.marchi@ericsson.com>
* server.c (captured_main): Accept argument for --selftest.
Update run_tests call.
* linux-x86-tdesc-selftest.c (initialize_low_tdesc): Add names
when registering selftests.
2017-09-16 Sergio Durigan Junior <sergiodj@redhat.com>
* regcache.c (get_thread_regcache): Update code to use "std::vector"
instead of "VEC" for "target_desc.reg_defs".
(regcache_cpy): Likewise.
(registers_to_string): Likewise.
(registers_from_string): Likewise.
(find_regno): Likewise.
(supply_regblock): Likewise.
(regcache_raw_read_unsigned): Likewise.
* tdesc.c (init_target_desc): Likewise.
(tdesc_create_reg): Likewise.
* tdesc.h: Remove declaration of "tdesc_reg_p". Include <vector>.
(struct target_desc) <reg_defs>: Convert to "std::vector".
(target_desc): Do not initialize "reg_defs".
(~target_desc): Update code to use "std::vector" instead of "VEC"
for "target_desc.reg_defs".
(operator==): Likewise.
2017-09-15 Simon Marchi <simon.marchi@ericsson.com>
* inferiors.h (thread_to_gdb_id): Remove.
* inferiors.c (thread_to_gdb_id): Remove.
* server.c (handle_qxfer_threads_worker, handle_query): Adjust.
* lynx-low.c (lynx_resume, lynx_wait_1, lynx_fetch_registers,
lynx_store_registers, lynx_read_memory, lynx_write_memory):
Likewise.
* nto-low.c (nto_fetch_registers, nto_store_registers,
nto_stopped_by_watchpoint, nto_stopped_data_address): Likewise.
gdbserver: Remove gdb_id_to_thread_id From what I understand, this function is not doing anything useful as of today. Here's the result of my archeological research: - The field thread_info::gdb_id was added in a06660f7 Use LWP IDs for thread IDs in gdbserver There was problem when using a 32-bits gdb with a 64-bits gdbserver. For some reason that I don't fully understand, the thread ids exchanged between gdb and gdbserver could overflow a 32 bits data type. My guess is that they were the thread address (e.g. the 0x7ffff7f20b40 in "Thread 0x7ffff7f20b40 (LWP 1058)" today). This patch changed that so gdb/gdbserver would talk in terms of the OS assigned numerical id (as shown in ps). It therefore added a way to convert between this gdb_id (the numerical id) and the thread id (the address). - 95954743cb Implement the multiprocess extensions, and add linux multiprocess supportNon-stop mode support. This patch made gdbserver deal with threads using their numerical ids and not the address-like id. Starting from there, the gdb_id <-> thread id conversion was not needed anymore, since the remote protocol and gdbserver were using the same kind of ids again. The gdb_id field in the thread_info structure was also unused starting there. - d50171e4 Teach linux gdbserver to step-over-breakpoints. This patch moved the thread_info structure around, and got rid of the gdb_id field (which was unused). Looking at the implementation of gdb_id_to_thread_id, it is not doing anything useful. It is looking up a thread by ptid using find_thread_ptid, which basically loops over all threads looking at their entry.id field. If a thread with that ptid is found, it returns its entry.id field. So it will always return the same thing as it input (with the exception of if no thread exist with that ptid, then it will return null_ptid). gdb/gdbserver/ChangeLog: * inferiors.h (gdb_id_to_thread_id): Remove. * inferiors.c (gdb_id_to_thread_id): Remove. * server.c (process_serial_event): Adjust to gdb_id_to_thread_id removal. Move pid declaration closer to where it's used.
2017-09-15 18:02:51 +02:00
2017-09-15 Simon Marchi <simon.marchi@ericsson.com>
* inferiors.h (gdb_id_to_thread_id): Remove.
* inferiors.c (gdb_id_to_thread_id): Remove.
* server.c (process_serial_event): Adjust to gdb_id_to_thread_id
removal. Move pid declaration closer to where it's used.
2017-09-15 Simon Marchi <simon.marchi@ericsson.com>
* server.c (handle_detach): New function.
(process_serial_event): Move code out, call handle_detach.
2017-09-15 Simon Marchi <simon.marchi@ericsson.com>
* server.c (require_running): Rename to ...
(require_running_or_return): ... this ...
(require_running_or_break): ... and this.
(handle_query, process_serial_event): Adjust.
2017-09-15 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (linux_set_resume_request): Remove unused
variables.
2017-09-15 Simon Marchi <simon.marchi@ericsson.com>
* server.c (first_thread_of): Remove.
(process_serial_event): Replace usage of first_thread_of with
find_any_thread_of_pid.
* tracepoint.c (same_process_p): Remove.
(gdb_agent_about_to_close): Replace usage of same_process_p with
find_any_thread_of_pid.
* linux-x86-low.c (same_process_callback): Remove.
(x86_arch_setup_process_callback): Replace usage of
same_process_callback with find_any_thread_of_pid.
* thread-db.c (any_thread_of): Remove.
(switch_to_process): Replace usage of any_thread_of with
find_any_thread_of_pid.
* inferiors.c (thread_pid_matches_callback): Remove.
(find_thread_process): Adjust to use find_any_thread_of_pid.
Fix build breakage on GNU/Linux AArch64, take 2 The last commit unfortunately was not enough to fix the build breakage on AArch64. I made a mistake and did not test it alone on BuildBot, but along with another patch that was responsible for fixing the breakage. The failure is: In file included from /usr/include/string.h:640:0, from build-gnulib-gdbserver/import/string.h:41, from ../../../binutils-gdb/gdb/gdbserver/../common/common-defs.h:56, from ../../../binutils-gdb/gdb/gdbserver/server.h:22, from ../../../binutils-gdb/gdb/gdbserver/regcache.c:19: In function ‘void* memset(void*, int, size_t)’, inlined from ‘regcache* init_register_cache(regcache*, const target_desc*, unsigned char*)’ at ../../../binutils-gdb/gdb/gdbserver/regcache.c:150:50: /usr/include/aarch64-linux-gnu/bits/string3.h:81:32: error: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror] __warn_memset_zero_len (); ^ In function ‘void* memset(void*, int, size_t)’, inlined from ‘regcache* get_thread_regcache(thread_info*, int)’ at ../../../binutils-gdb/gdb/gdbserver/regcache.c:57:60: /usr/include/aarch64-linux-gnu/bits/string3.h:81:32: error: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror] __warn_memset_zero_len (); This is likely due to a GCC bug, because for some reason the compiler assumes that the third argument to the memset: memset (regcache->register_status, REG_UNAVAILABLE, VEC_length (tdesc_reg_p, regcache->tdesc->reg_defs)); is always zero, which is not always true. Anyway, the simple fix for this is to guard the memset calls with: if (!VEC_empty (tdesc_reg_p, regcache->tdesc->reg_defs)) This time, I made sure to regtest only this patch on BuildBot, and it finally solved the breakage. gdb/gdbserver/ChangeLog: 2017-09-10 Sergio Durigan Junior <sergiodj@redhat.com> * regcache.c (get_thread_regcache): Guard calls to "memset" with "!VEC_empty".
2017-09-10 23:50:29 +02:00
2017-09-10 Sergio Durigan Junior <sergiodj@redhat.com>
* regcache.c (get_thread_regcache): Guard calls to "memset"
with "!VEC_empty".
Fix build breakage on GNU/Linux AArch64, take 2 The last commit unfortunately was not enough to fix the build breakage on AArch64. I made a mistake and did not test it alone on BuildBot, but along with another patch that was responsible for fixing the breakage. The failure is: In file included from /usr/include/string.h:640:0, from build-gnulib-gdbserver/import/string.h:41, from ../../../binutils-gdb/gdb/gdbserver/../common/common-defs.h:56, from ../../../binutils-gdb/gdb/gdbserver/server.h:22, from ../../../binutils-gdb/gdb/gdbserver/regcache.c:19: In function ‘void* memset(void*, int, size_t)’, inlined from ‘regcache* init_register_cache(regcache*, const target_desc*, unsigned char*)’ at ../../../binutils-gdb/gdb/gdbserver/regcache.c:150:50: /usr/include/aarch64-linux-gnu/bits/string3.h:81:32: error: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror] __warn_memset_zero_len (); ^ In function ‘void* memset(void*, int, size_t)’, inlined from ‘regcache* get_thread_regcache(thread_info*, int)’ at ../../../binutils-gdb/gdb/gdbserver/regcache.c:57:60: /usr/include/aarch64-linux-gnu/bits/string3.h:81:32: error: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror] __warn_memset_zero_len (); This is likely due to a GCC bug, because for some reason the compiler assumes that the third argument to the memset: memset (regcache->register_status, REG_UNAVAILABLE, VEC_length (tdesc_reg_p, regcache->tdesc->reg_defs)); is always zero, which is not always true. Anyway, the simple fix for this is to guard the memset calls with: if (!VEC_empty (tdesc_reg_p, regcache->tdesc->reg_defs)) This time, I made sure to regtest only this patch on BuildBot, and it finally solved the breakage. gdb/gdbserver/ChangeLog: 2017-09-10 Sergio Durigan Junior <sergiodj@redhat.com> * regcache.c (get_thread_regcache): Guard calls to "memset" with "!VEC_empty".
2017-09-10 23:50:29 +02:00
2017-09-10 Sergio Durigan Junior <sergiodj@redhat.com>
* linux-low.c (handle_extended_wait): Use
"allocate_target_description" instead of "XNEW".
* linux-x86-low.c (initialize_low_arch): Likewise.
Convert the rest x86 target descriptions This patch changes the rest of x86 target descriptions in GDB and GDBserver. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * amd64-tdep.c (amd64_target_description): Create target descriptions. (_initialize_amd64_tdep): Don't call functions initialize_tdesc_amd64_*. Add self tests. * arch/amd64.c (amd64_create_target_description): Add parameter is_linux. Call set_tdesc_osabi if is_linux is true. * arch/amd64.h (amd64_create_target_description): Update the declaration. * arch/i386.c (i386_create_target_description): Add parameter is_linux. Call set_tdesc_osabi if is_linux is true. * arch/i386.h (i386_create_target_description): Update declaration. * configure.tgt: Add i386.o to gdb_target_obs. * features/Makefile (XMLTOC): Remove i386/*.xml. * features/i386/amd64-avx-avx512.c: Remove. * features/i386/amd64-avx-mpx-avx512-pku.c: Remove. * features/i386/amd64-avx-mpx.c: Remove. * features/i386/amd64-avx.c: Remove. * features/i386/amd64-mpx.c: Remove. * features/i386/amd64.c: Remove. * features/i386/i386-avx-avx512.c: Remove. * features/i386/i386-avx-mpx-avx512-pku.c: Remove. * features/i386/i386-avx-mpx.c: Remove. * features/i386/i386-avx.c: Remove. * features/i386/i386-mmx.c: Remove. * features/i386/i386-mpx.c: Remove. * features/i386/i386.c: Remove. * i386-tdep.c: Don't include features/i386/i386*.c., include target-descriptions.h and arch/i386.h. (i386_target_description): Create target descriptions. (i386_gdbarch_init): Don't call initialize_tdesc_i386_* functions. Do self tests. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.srv (srv_i386_regobj): Remove. (srv_amd64_regobj): Remove. (srv_regobj): Set it to "" for x86 non-linux targets. * linux-x86-tdesc.c (i386_linux_read_description): * lynx-i386-low.c: Include x86-xstate.h and arch/i386.h. (init_registers_i386): Remove the declaration. (tdesc_i386): Remove the declaration. (lynx_i386_arch_setup): Call i386_create_target_description. * nto-x86-low.c: Likewise. * win32-i386-low.c [__x86_64__]: include arch/amd64.h. [!__x86_64__]: include arch/i386.h. (i386_arch_setup) [__x86_64__]: Call amd64_create_target_description.
2017-09-05 10:54:54 +02:00
2017-09-05 Yao Qi <yao.qi@linaro.org>
* configure.srv (srv_i386_regobj): Remove.
(srv_amd64_regobj): Remove.
(srv_regobj): Set it to "" for x86 non-linux targets.
* linux-x86-tdesc.c (i386_linux_read_description):
* lynx-i386-low.c: Include x86-xstate.h and arch/i386.h.
(init_registers_i386): Remove the declaration.
(tdesc_i386): Remove the declaration.
(lynx_i386_arch_setup): Call i386_create_target_description.
* nto-x86-low.c: Likewise.
* win32-i386-low.c [__x86_64__]: include arch/amd64.h.
[!__x86_64__]: include arch/i386.h.
(i386_arch_setup) [__x86_64__]: Call amd64_create_target_description.
2017-09-05 Yao Qi <yao.qi@linaro.org>
* configure.srv (srv_amd64_linux_xmlfiles): Remove
i386/amd64-XXX-linux from it.
2017-09-05 Yao Qi <yao.qi@linaro.org>
* configure.srv: Empty srv_amd64_linux_regobj if $development is
false.
(ipa_amd64_linux_regobj): Remove.
(ipa_x32_linux_regobj): Remove.
Convert amd64-linux target descriptions This patch changes amd64-linux target descriptions so that they can be dynamically generated in both GDB and GDBserver. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * Makefile.in (arch-amd64.o): New rule. * configure.srv: Append arch-amd64.o. * linux-amd64-ipa.c: Include common/x86-xstate.h. (get_ipa_tdesc): Call amd64_linux_read_description. (initialize_low_tracepoint): Don't call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-low.c (x86_linux_read_description): Call amd64_linux_read_description. (x86_get_ipa_tdesc_idx): Call amd64_get_ipa_tdesc_idx. (initialize_low_arch): Don't call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-tdesc-selftest.c: Declare init_registers_amd64_XXX and tdesc_amd64_XXX. [__x86_64__] (amd64_tdesc_test): New function. (initialize_low_tdesc) [__x86_64__]: Call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-tdesc.c: Include arch/amd64.h. (xcr0_to_tdesc_idx): New function. (i386_linux_read_description): New function. (amd64_get_ipa_tdesc_idx): New function. * linux-x86-tdesc.h (amd64_get_ipa_tdesc_idx): Declare. (amd64_get_ipa_tdesc): Declare. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * amd64-linux-tdep.c: Include arch/amd64.h. Don't include features/i386/*.c. (amd64_linux_read_description): Call amd64_create_target_description. * arch/amd64.c: New file. * arch/amd64.h: New file. * configure.tgt (x86_64-*-linux*): Append amd64.o. * Makefile.in (ALL_64_TARGET_OBS): Append amd64.o.
2017-09-05 10:54:54 +02:00
2017-09-05 Yao Qi <yao.qi@linaro.org>
* Makefile.in (arch-amd64.o): New rule.
* configure.srv: Append arch-amd64.o.
* linux-amd64-ipa.c: Include common/x86-xstate.h.
(get_ipa_tdesc): Call amd64_linux_read_description.
(initialize_low_tracepoint): Don't call init_registers_x32_XXX
and init_registers_amd64_XXX.
* linux-x86-low.c (x86_linux_read_description): Call
amd64_linux_read_description.
(x86_get_ipa_tdesc_idx): Call amd64_get_ipa_tdesc_idx.
(initialize_low_arch): Don't call init_registers_x32_XXX and
init_registers_amd64_XXX.
* linux-x86-tdesc-selftest.c: Declare init_registers_amd64_XXX
and tdesc_amd64_XXX.
[__x86_64__] (amd64_tdesc_test): New function.
(initialize_low_tdesc) [__x86_64__]: Call init_registers_x32_XXX
and init_registers_amd64_XXX.
* linux-x86-tdesc.c: Include arch/amd64.h.
(xcr0_to_tdesc_idx): New function.
(i386_linux_read_description): New function.
(amd64_get_ipa_tdesc_idx): New function.
* linux-x86-tdesc.h (amd64_get_ipa_tdesc_idx): Declare.
(amd64_get_ipa_tdesc): Declare.
2017-09-05 Yao Qi <yao.qi@linaro.org>
* configure.srv (srv_i386_linux_xmlfiles): Remove
i386/i386-XXX-linux.xml from it.
2017-09-05 Yao Qi <yao.qi@linaro.org>
* configure.srv: Set srv_i386_linux_regobj empty if $development
is false.
* linux-i386-ipa.c (initialize_low_tracepoint): Don't call
initialize_low_tdesc.
* linux-x86-low.c (initialize_low_arch): Wrap initialize_low_tdesc
with #if initialize_low_tdesc.
* linux-x86-tdesc-selftest.c: New file.
* linux-x86-tdesc.c: Move code to linux-x86-tdesc-selftest.c.
2017-09-05 10:54:53 +02:00
2017-09-05 Yao Qi <yao.qi@linaro.org>
* Makefile.in (arch-i386.o): New rule.
* configure.srv (i[34567]86-*-linux*): Add arch-i386.o.
(x86_64-*-linux*): Likewise.
* linux-x86-tdesc.c: Don't include ../features/i386/32bit-XXX.c,
include arch/i386.h.
(i386_linux_read_description): Remove code and call
i386_create_target_description.
* tdesc.c (allocate_target_description): New function.
* tdesc.h (set_tdesc_architecture): Remove declaration.
(set_tdesc_osabi): Likewise.
Dynamically composite xml in reply to GDB GDBserver still uses pre-generated target descriptions in order to reply to GDB's query on target description (see xml-builtin-generated.c in GDBserver build directory). This patch teaches GDBserver to create XML contents according to the target descriptions rather than using pre-generated ones. First, change target feature c files to pass the feature xml file name to tdesc_create_feature, so that target description in GDBserver can record them, and create XML contents from these features in buffer, like ... <xi:include href="$FEATURE1_XML_NAME"/> <xi:include href="$FEATURE2_XML_NAME"/> ... and send this buffer back to GDB. Note that this patch reuses target_desc.xmltarget a little bit, which is to hold the XML contents dynamically generated in tdesc_get_features_xml. However, it is not xfree'ed in ~target_desc, because we can't tell it is from xstrdup or a literal string. Since we don't delete target_desc, there is no memory leak yet. After we change all target descriptions to the new style, target_desc.xmltarget is from xstrdup, then, we can safely xfree it in ~target_desc. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * arch/tdesc.h (tdesc_create_feature): Add an argument xml. * target-descriptions.c (tdesc_create_feature): Likewise, and adjust code. * features/i386/32bit-avx.c: Re-generated. * features/i386/32bit-avx512.c: Re-generated. * features/i386/32bit-core.c: Re-generated. * features/i386/32bit-linux.c: Re-generated. * features/i386/32bit-mpx.c: Re-generated. * features/i386/32bit-pkeys.c: Re-generated. * features/i386/32bit-sse.c: Re-generated. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * linux-x86-tdesc.c: Don't include <inttypes.h>. (i386_linux_read_description) [!IN_PROCESS_AGENT]: Call set_tdesc_architecture and set_tdesc_osabi. Remove code setting .xmltarget. * server.c (get_features_xml): Call tdesc_get_features_xml. * tdesc.c (set_tdesc_architecture): New function. (set_tdesc_osabi): New function. (tdesc_get_features_xml): New function. (tdesc_create_feature): Add an argument. * tdesc.h (struct target_desc) <features>: New field. <arch, osabi>: New field. (~target_desc): xfree features, arch, and osabi. (target_desc::oerator==): Don't compare .xmltarget. [!IN_PROCESS_AGENT] (set_tdesc_architecture): Declare. (set_tdesc_osabi): Likewise. (tdesc_get_features_xml): Likewise.
2017-09-05 10:54:53 +02:00
2017-09-05 Yao Qi <yao.qi@linaro.org>
* linux-x86-tdesc.c: Don't include <inttypes.h>.
(i386_linux_read_description) [!IN_PROCESS_AGENT]: Call
set_tdesc_architecture and set_tdesc_osabi. Remove code setting
.xmltarget.
* server.c (get_features_xml): Call tdesc_get_features_xml.
* tdesc.c (set_tdesc_architecture): New function.
(set_tdesc_osabi): New function.
(tdesc_get_features_xml): New function.
(tdesc_create_feature): Add an argument.
* tdesc.h (struct target_desc) <features>: New field.
<arch, osabi>: New field.
(~target_desc): xfree features, arch, and osabi.
(target_desc::oerator==): Don't compare .xmltarget.
[!IN_PROCESS_AGENT] (set_tdesc_architecture): Declare.
(set_tdesc_osabi): Likewise.
(tdesc_get_features_xml): Likewise.
2017-09-05 Yao Qi <yao.qi@linaro.org>
* linux-x86-tdesc.c: Include selftest.h.
(i386_tdesc_test): New function.
(initialize_low_tdesc): Call selftests::register_test.
* tdesc.h: Include regdef.h.
(target_desc): Override operator == and !=.
[GDBserver] Centralize tdesc for i386-linux tdesc_i386_XXX_linux is used in many places in linux-x86-low.c and this patch adds a new function i386_linux_read_description to return the right tdesc according to xcr0. i386_linux_read_description is quite similar to the counterpart in GDB, and the following patch will share the duplicated code, so this patch adds arch/tdesc.h includes the declarations of various tdesc apis which are used by the shared code. The generated c feature files can include arch/tdesc.h only. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.srv (srv_tgtobj): Append linux-x86-tdesc.o. (ipa_obj): Likewise. * linux-i386-ipa.c: Include common/x86-xstate.h (get_ipa_tdesc): Call i386_linux_read_description. (initialize_low_tracepoint): Don't call init_registers_XXX functions, call initialize_low_tdesc instead. * linux-x86-low.c (x86_linux_read_description): Call i386_linux_read_description. (initialize_low_arch): Don't call init_registers_i386_XXX functions, call initialize_low_tdesc. * linux-x86-tdesc.c: New file. * linux-x86-tdesc.h (x86_linux_tdesc): New X86_TDESC_LAST. (i386_get_ipa_tdesc_idx): Declare. (i386_get_ipa_tdesc): Declare. (initialize_low_tdesc): Declare. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * arch/tdesc.h: New file. * regformats/regdat.sh: Generate code using tdesc_create_reg. * target-descriptions.c: Update comments. * target-descriptions.h: Include "arch/tdesc.h". Remove the declarations. * features/i386/32bit-avx.c: Re-generated. * features/i386/32bit-avx512.c: Re-generated. * features/i386/32bit-core.c: Re-generated. * features/i386/32bit-linux.c: Re-generated. * features/i386/32bit-mpx.c: Re-generated. * features/i386/32bit-pkeys.c: Re-generated. * features/i386/32bit-sse.c: Re-generated.
2017-09-05 10:54:53 +02:00
2017-09-05 Yao Qi <yao.qi@linaro.org>
* configure.srv (srv_tgtobj): Append linux-x86-tdesc.o.
(ipa_obj): Likewise.
* linux-i386-ipa.c: Include common/x86-xstate.h
(get_ipa_tdesc): Call i386_linux_read_description.
(initialize_low_tracepoint): Don't call init_registers_XXX
functions, call initialize_low_tdesc instead.
* linux-x86-low.c (x86_linux_read_description): Call
i386_linux_read_description.
(initialize_low_arch): Don't call init_registers_i386_XXX
functions, call initialize_low_tdesc.
* linux-x86-tdesc.c: New file.
* linux-x86-tdesc.h (x86_linux_tdesc): New X86_TDESC_LAST.
(i386_get_ipa_tdesc_idx): Declare.
(i386_get_ipa_tdesc): Declare.
(initialize_low_tdesc): Declare.
2017-09-05 Yao Qi <yao.qi@linaro.org>
* linux-x86-low.c (x86_get_ipa_tdesc_idx): Use X86_TDESC_MMX
instead of 0.
2017-09-05 Yao Qi <yao.qi@linaro.org>
* Makefile.in (IPA_OBJS): Add vec-ipa.o
* regcache.c (get_thread_regcache): Use VEC_length.
(init_register_cache): Likewise.
(regcache_cpy): Likewise.
(registers_to_string): Iterate reg_defs via VEC_iterate.
(find_regno): Likewise.
(find_register_by_number): Use VEC_index.
(register_size): Call find_register_by_number.
(register_data): Call find_register_by_number.
(supply_regblock): Use VEC_length.
(regcache_raw_read_unsigned): Likewise.
* tdesc.c (init_target_desc): Iterate reg_defs via
VEC_iterate.
(default_description): Update initializer.
(copy_target_description): Don't update field num_registers.
* tdesc.h (struct target_desc) <reg_defs>: Change it to VEC.
<num_registers>: Remove.
2017-09-04 Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (.SECONDARY): Define target.
2017-09-03 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (linux_wait_1): Adjust.
* server.c (queue_stop_reply_callback): Adjust.
Implement the ability to set/unset environment variables to GDBserver when starting the inferior This patch implements the ability to set/unset environment variables on the remote target, mimicking what GDB already offers to the user. There are two features present here: user-set and user-unset environment variables. User-set environment variables are only the variables that are explicitly set by the user, using the 'set environment' command. This means that variables that were already present in the environment when starting GDB/GDBserver are not transmitted/considered by this feature. User-unset environment variables are variables that are explicitly unset by the user, using the 'unset environment' command. The idea behind this patch is to store user-set and user-unset environment variables in two separate sets, both part of gdb_environ. Then, when extended_remote_create_inferior is preparing to start the inferior, it will iterate over the two sets and set/unset variables accordingly. Three new packets are introduced: - QEnvironmentHexEncoded, which is used to set environment variables, and contains an hex-encoded string in the format "VAR=VALUE" (VALUE can be empty if the user set a variable with a null value, by doing 'set environment VAR='). - QEnvironmentUnset, which is used to unset environment variables, and contains an hex-encoded string in the format "VAR". - QEnvironmentReset, which is always the first packet to be transmitted, and is used to reset the environment, i.e., discard any changes made by the user on previous runs. The QEnvironmentHexEncoded packet is inspired on LLDB's extensions to the RSP. Details about it can be seen here: <https://raw.githubusercontent.com/llvm-mirror/lldb/master/docs/lldb-gdb-remote.txt> I decided not to implement the QEnvironment packet because it is considered deprecated by LLDB. This packet, on LLDB, serves the same purpose of QEnvironmentHexEncoded, but sends the information using a plain text, non-hex-encoded string. The other two packets are new. This patch also includes updates to the documentation, testsuite, and unit tests, without introducing regressions. gdb/ChangeLog: 2017-08-31 Sergio Durigan Junior <sergiodj@redhat.com> * NEWS (Changes since GDB 8.0): Add entry mentioning new support for setting/unsetting environment variables on the remote target. (New remote packets): Add entries for QEnvironmentHexEncoded, QEnvironmentUnset and QEnvironmentReset. * common/environ.c (gdb_environ::operator=): Extend method to handle m_user_set_env_list and m_user_unset_env_list. (gdb_environ::clear): Likewise. (match_var_in_string): Change type of first parameter from 'char *' to 'const char *'. (gdb_environ::set): Extend method to handle m_user_set_env_list and m_user_unset_env_list. (gdb_environ::unset): Likewise. (gdb_environ::clear_user_set_env): New method. (gdb_environ::user_set_envp): Likewise. (gdb_environ::user_unset_envp): Likewise. * common/environ.h (gdb_environ): Handle m_user_set_env_list and m_user_unset_env_list on move constructor/assignment. (unset): Add new default parameter 'update_unset_list = true'. (clear_user_set_env): New method. (user_set_envp): Likewise. (user_unset_envp): Likewise. (m_user_set_env_list): New std::set. (m_user_unset_env_list): Likewise. * common/rsp-low.c (hex2str): New function. (bin2hex): New overload for bin2hex function. * common/rsp-low.c (hex2str): New prototype. (str2hex): New overload prototype. * remote.c: Include "environ.h". Add QEnvironmentHexEncoded, QEnvironmentUnset and QEnvironmentReset. (remote_protocol_features): Add QEnvironmentHexEncoded, QEnvironmentUnset and QEnvironmentReset packets. (send_environment_packet): New function. (extended_remote_environment_support): Likewise. (extended_remote_create_inferior): Call extended_remote_environment_support. (_initialize_remote): Add QEnvironmentHexEncoded, QEnvironmentUnset and QEnvironmentReset packet configs. * unittests/environ-selftests.c (gdb_selftest_env_var): New variable. (test_vector_initialization): New function. (test_init_from_host_environ): Likewise. (test_reinit_from_host_environ): Likewise. (test_set_A_unset_B_unset_A_cannot_find_A_can_find_B): Likewise. (test_unset_set_empty_vector): Likewise. (test_vector_clear): Likewise. (test_std_move): Likewise. (test_move_constructor): (test_self_move): Likewise. (test_set_unset_reset): Likewise. (run_tests): Rewrite in terms of the functions above. gdb/gdbserver/ChangeLog: 2017-08-31 Sergio Durigan Junior <sergiodj@redhat.com> * server.c (handle_general_set): Handle QEnvironmentHexEncoded, QEnvironmentUnset and QEnvironmentReset packets. (handle_query): Inform remote that QEnvironmentHexEncoded, QEnvironmentUnset and QEnvironmentReset are supported. gdb/doc/ChangeLog: 2017-08-31 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.texinfo (set environment): Add @anchor. Explain that environment variables set by the user are sent to GDBserver. (unset environment): Likewise, but for unsetting variables. (Connecting) <Remote Packet>: Add "environment-hex-encoded", "QEnvironmentHexEncoded", "environment-unset", "QEnvironmentUnset", "environment-reset" and "QEnvironmentReset" to the table. (Remote Protocol) <QEnvironmentHexEncoded, QEnvironmentUnset, QEnvironmentReset>: New item, explaining the packet. gdb/testsuite/ChangeLog: 2017-08-31 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/share-env-with-gdbserver.c: New file. * gdb.base/share-env-with-gdbserver.exp: Likewise.
2017-06-29 21:06:07 +02:00
2017-08-31 Sergio Durigan Junior <sergiodj@redhat.com>
* server.c (handle_general_set): Handle QEnvironmentHexEncoded,
QEnvironmentUnset and QEnvironmentReset packets.
(handle_query): Inform remote that QEnvironmentHexEncoded,
QEnvironmentUnset and QEnvironmentReset are supported.
2017-08-25 Simon Marchi <simon.marchi@ericsson.com>
* inferiors.h (inferior_target_data): Rename to ...
(thread_target_data): ... this.
(inferior_regcache_data): Rename to ...
(thread_regcache_data): ... this.
(set_inferior_regcache_data): Rename to ...
(set_thread_regcache_data): ... this.
* inferiors.c (inferior_target_data): Rename to ...
(thread_target_data): ... this.
(inferior_regcache_data): Rename to ...
(thread_regcache_data): ... this.
(set_inferior_regcache_data): Rename to ...
(set_thread_regcache_data): ... this.
(free_one_thread): Update.
* linux-low.h (get_thread_lwp): Update.
* regcache.c (get_thread_regcache): Update.
(regcache_invalidate_thread): Update.
(free_register_cache_thread): Update.
* win32-i386-low.c (update_debug_registers_callback): Update.
(win32_get_current_dr): Update.
* win32-low.c (thread_rec): Update.
(delete_thread_info): Update.
(continue_one_thread): Update.
(suspend_one_thread): Update.
2017-08-24 Simon Marchi <simon.marchi@ericsson.com>
* inferiors.c (set_inferior_target_data): Remove.
* inferiors.h (set_inferior_target_data): Remove.
2017-08-18 Yao Qi <yao.qi@linaro.org>
* Makefile.in (OBS): Add selftest.o.
* configure.ac: AC_DEFINE GDB_SELF_TEST if $development.
* configure, config.in: Re-generated.
* server.c: Include common/sefltest.h.
(captured_main): Handle option --selftest.
2017-08-09 Yao Qi <yao.qi@linaro.org>
* configure.srv (srv_i386_regobj): Remove i386-avx.o,
i386-avx-avx512.o, i386-avx-mpx-avx512-pku.o, i386-mpx.o,
i386-avx-mpx.o and i386-mmx.o.
(srv_amd64_regobj): Remove amd64-avx.o, amd64-avx-avx512.o,
amd64-avx-mpx-avx512-pku.o, amd64-mpx.o and amd64-avx-mpx.o.
(srv_i386_xmlfiles): Remove i386/i386-avx.xml,
i386/i386-avx-avx512.xml, i386/i386-avx-mpx-avx512-pku.xml,
i386/i386-mpx.xml, i386/i386-avx-mpx.xml and i386/i386-mmx.xml.
(srv_amd64_xmlfile):i386/amd64-avx.xml, i386/amd64-avx-avx512.xml,
i386/amd64-avx-mpx-avx512-pku.xml, i386/amd64-mpx.xml,
i386/amd64-avx-mpx.xml.
2017-08-09 Yao Qi <yao.qi@linaro.org>
* configure.srv (srv_amd64_regobj): Remove x32.o, x32-avx.o
and x32-avx-avx512.o.
(srv_amd64_xmlfiles): Remove i386/x32.xml, i386/x32-avx.xml
i386/x32-avx-avx512.xml.
2017-07-26 Simon Marchi <simon.marchi@ericsson.com>
* tracepoint.h (enum class fast_tpoint_collect_result): New
enumeration.
(fast_tracepoint_collecting): Change return type to
fast_tpoint_collect_result.
* tracepoint.c (fast_tracepoint_collecting): Likewise.
* linux-low.h: Include tracepoint.h.
(struct lwp_info) <collecting_fast_tracepoint>: Change type to
fast_tpoint_collect_result.
* linux-low.c (handle_tracepoints): Adjust.
(linux_fast_tracepoint_collecting): Change return type to
fast_tpoint_collect_result.
(maybe_move_out_of_jump_pad, linux_wait_for_event_filtered,
linux_wait_1, stuck_in_jump_pad_callback,
lwp_signal_can_be_delivered, linux_resume_one_lwp_throw,
proceed_one_lwp): Adjust to type change.
2017-07-10 Yao Qi <yao.qi@linaro.org>
* linux-x86-low.c (x86_linux_read_description): Re-indent the code.
2017-06-29 Yao Qi <yao.qi@linaro.org>
* tdesc.h (struct target_desc) [IN_PROCESS_AGENT] <expedite_regs>:
Remove.
[IN_PROCESS_AGENT] <xmltarget>: Likewise.
2017-06-20 Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (IPA_OBJS): Sort and format one item per line.
C++ify gdb/common/environ.c As part of the preparation necessary for my upcoming task, I'd like to propose that we turn gdb_environ into a class. The approach taken here is simple: the class gdb_environ contains everything that is needed to manipulate the environment variables. These variables are stored in an std::vector<char *>, which can be converted to a 'char **' and passed as argument to functions that need it. The usage has not changed much. As per Pedro's suggestion, this class uses a static factory method initialization. This means that when an instance is created, it is initially empty. When needed, it has to be initialized using the static method 'from_host_environ'. As mentioned before, this is a preparation for an upcoming work that I will be posting in the next few weeks or so. For that work, I'll probably create another data structure that will contain all the environment variables that were set by the user using the 'set environment' command, because I'll need access to them. This will be much easier with the class-ification of gdb_environ. As noted, this has been regression-tested with the new version of environ.exp and no regressions were found. gdb/ChangeLog: 2017-06-20 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add 'unittests/environ-selftests.c'. (SUBDIR_UNITTESTS_OBS): Add 'environ-selftests.o'. * charset.c (find_charset_names): Declare object 'iconv_env'. Update code to use 'iconv_env' object. Remove call to 'free_environ'. * common/environ.c: Include <utility>. (make_environ): Delete function. (free_environ): Delete function. (gdb_environ::clear): New function. (gdb_environ::operator=): New function. (gdb_environ::get): Likewise. (environ_vector): Delete function. (set_in_environ): Delete function. (gdb_environ::set): New function. (unset_in_environ): Delete function. (gdb_environ::unset): New function. (gdb_environ::envp): Likewise. * common/environ.h: Include <vector>. (struct gdb_environ): Delete; transform into... (class gdb_environ): ... this class. (free_environ): Delete prototype. (init_environ, get_in_environ, set_in_environ, unset_in_environ, environ_vector): Likewise. * infcmd.c (run_command_1): Update code to call 'envp' from 'gdb_environ' class. (environment_info): Update code to call methods from 'gdb_environ' class. (unset_environment_command): Likewise. (path_info): Likewise. (path_command): Likewise. * inferior.c (inferior::~inferior): Delete call to 'free_environ'. (inferior::inferior): Initialize 'environment' using the host's information. * inferior.h: Remove forward declaration of 'struct gdb_environ'. Include "environ.h". (class inferior) <environment>: Change type from 'struct gdb_environ' to 'gdb_environ'. * mi/mi-cmd-env.c (mi_cmd_env_path): Update code to call methods from 'gdb_environ' class. * solib.c (solib_find_1): Likewise * unittests/environ-selftests.c: New file. gdb/gdbserver/ChangeLog: 2017-06-20 Sergio Durigan Junior <sergiodj@redhat.com> * linux-low.c (linux_create_inferior): Adjust code to access the environment information via 'gdb_environ' class. * lynx-low.c (lynx_create_inferior): Likewise. * server.c (our_environ): Make it an instance of 'gdb_environ'. (get_environ): Return a pointer to 'our_environ'. (captured_main): Initialize 'our_environ'. * server.h (get_environ): Adjust prototype. * spu-low.c (spu_create_inferior): Adjust code to access the environment information via 'gdb_environ' class.
2017-02-11 03:19:44 +01:00
2017-06-20 Sergio Durigan Junior <sergiodj@redhat.com>
* linux-low.c (linux_create_inferior): Adjust code to access the
environment information via 'gdb_environ' class.
* lynx-low.c (lynx_create_inferior): Likewise.
* server.c (our_environ): Make it an instance of 'gdb_environ'.
(get_environ): Return a pointer to 'our_environ'.
(captured_main): Initialize 'our_environ'.
* server.h (get_environ): Adjust prototype.
* spu-low.c (spu_create_inferior): Adjust code to access the
environment information via 'gdb_environ' class.
2017-06-17 Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (linux_read_memory, linux_write_memory): Remove
usage of "register" keyword.
2017-06-17 Simon Marchi <simon.marchi@ericsson.com>
* configure: Re-generate.
2017-06-17 Simon Marchi <simon.marchi@ericsson.com>
* configure: Re-generate.
2017-06-17 Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (COMPILE.pre): Add "-x c++".
2017-06-09 Sergio Durigan Junior <sergiodj@redhat.com>
* fork-child.c: Conditionally include <signal.h>.
Implement proper "startup-with-shell" support on gdbserver This patch implements the proper support for the "startup-with-shell" feature on gdbserver. A new packet is added, QStartupWithShell, and it is sent on initialization. If the host sends a "QStartupWithShell:1", it means the inferior shall be started using a shell. If the host sends a "QStartupWithShell:0", it means the inferior shall be started without using a shell. Any other value is considered an error. There is no way to remotely set the shell that will be used by the target to start the inferior. In order to do that, the user must start gdbserver while providing a shell via the $SHELL environment variable. The same is true for the host side. The "set startup-with-shell" setting from the host side is used to decide whether to start the remote inferior using a shell. This same setting is also used to decide whether to use a shell to start the host inferior; this means that it is not really possible to start the inferior using different mechanisms on target and host. A documentation patch is included, along with a new testcase for the feature. gdb/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * NEWS (Changes since GDB 8.0): Announce that GDBserver is now able to start inferiors using a shell. (New remote packets): Announce new packet "QStartupWithShell". * remote.c: Add PACKET_QStartupWithShell. (extended_remote_create_inferior): Handle new PACKET_QStartupWithShell. (remote_protocol_features) <QStartupWithShell>: New entry for PACKET_QStartupWithShell. (_initialize_remote): Call "add_packet_config_cmd" for QStartupShell. gdb/gdbserver/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * server.c (handle_general_set): Handle new packet "QStartupWithShell". (handle_query): Add "QStartupWithShell" to the list of supported packets. (gdbserver_usage): Add help text explaining the new "--startup-with-shell" and "--no-startup-with-shell" CLI options. (captured_main): Recognize and act upon the presence of the new CLI options. gdb/testsuite/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/startup-with-shell.c: New file. * gdb.base/startup-with-shell.exp: Likewise. gdb/doc/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.texinfo (Starting) <startup-with-shell>: Add @anchor. (Connecting) <Remote Packet>: Add "startup-with-shell" and "QStartupWithShell" to the table. (Remote Protocol) <QStartupWithShell>: New item, explaining the packet.
2016-12-23 04:14:02 +01:00
2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com>
* server.c (handle_general_set): Handle new packet
"QStartupWithShell".
(handle_query): Add "QStartupWithShell" to the list of supported
packets.
(gdbserver_usage): Add help text explaining the
new "--startup-with-shell" and "--no-startup-with-shell" CLI
options.
(captured_main): Recognize and act upon the presence of the new
CLI options.
Share fork_inferior et al with gdbserver This is the most important (and the biggest, sorry) patch of the series. It moves fork_inferior from gdb/fork-child.c to nat/fork-inferior.c and makes all the necessary adjustments to both GDB and gdbserver to make sure everything works OK. There is no "most important change" with this patch; all changes are made in a progressive way, making sure that gdbserver had the necessary features while not breaking GDB at the same time. I decided to go ahead and implement a partial support for starting the inferior with a shell on gdbserver, although the full feature comes in the next patch. The user won't have the option to disable the startup-with-shell, and also won't be able to change which shell gdbserver will use (other than setting the $SHELL environment variable, that is). Everything is working as expected, and no regressions were present during the tests. gdb/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> Pedro Alves <palves@redhat.com> * Makefile.in (HFILES_NO_SRCDIR): Add "common/common-inferior.h" and "nat/fork-inferior.h". * common/common-inferior.h: New file, with contents from "gdb/inferior.h". * commom/common-utils.c: Include "common-utils.h". (stringify_argv): New function. * common/common-utils.h (stringify_argv): New prototype. * configure.nat: Add "fork-inferior.o" as a dependency for "*linux*", "fbsd*" and "nbsd*" hosts. * corefile.c (get_exec_file): Update comment. * darwin-nat.c (darwin_ptrace_him): Call "gdb_startup_inferior" instead of "startup_inferior". (darwin_create_inferior): Call "add_thread_silent" after "fork_inferior". * fork-child.c: Cleanup unnecessary includes. (SHELL_FILE): Move to "common/common-fork-child.c". (environ): Likewise. (exec_wrapper): Initialize. (get_exec_wrapper): New function. (breakup_args): Move to "common/common-fork-child.c"; rename to "breakup_args_for_exec". (escape_bang_in_quoted_argument): Move to "common/common-fork-child.c". (saved_ui): New variable. (prefork_hook): New function. (postfork_hook): Likewise. (postfork_child_hook): Likewise. (gdb_startup_inferior): Likewise. (fork_inferior): Move to "common/common-fork-child.c". Update function to support gdbserver. (startup_inferior): Likewise. * gdbcore.h (get_exec_file): Remove declaration. * gnu-nat.c (gnu_create_inferior): Call "gdb_startup_inferior" instead of "startup_inferior". Call "add_thread_silent" after "fork_inferior". * inf-ptrace.c: Include "nat/fork-inferior.h" and "utils.h". (inf_ptrace_create_inferior): Call "gdb_startup_inferior" instead of "startup_inferior". Call "add_thread_silent" after "fork_inferior". * inferior.h: Include "common-inferior.h". (trace_start_error): Move to "common/common-utils.h". (trace_start_error_with_name): Likewise. (fork_inferior): Move prototype to "nat/fork-inferior.h". (startup_inferior): Likewise. (gdb_startup_inferior): New prototype. * nat/fork-inferior.c: New file, with contents from "fork-child.c". * nat/fork-inferior.h: New file. * procfs.c (procfs_init_inferior): Call "gdb_startup_inferior" instead of "startup_inferior". Call "add_thread_silent" after "fork_inferior". * target.h (target_terminal_init): Move prototype to "target/target.h". (target_terminal_inferior): Likewise. (target_terminal_ours): Likewise. * target/target.h (target_terminal_init): New prototype, moved from "target.h". (target_terminal_inferior): Likewise. (target_terminal_ours): Likewise. * utils.c (gdb_flush_out_err): New function. gdb/gdbserver/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> Pedro Alves <palves@redhat.com> * Makefile.in (SFILES): Add "nat/fork-inferior.o". * configure: Regenerate. * configure.srv (srv_linux_obj): Add "fork-child.o" and "fork-inferior.o". (i[34567]86-*-lynxos*): Likewise. (spu*-*-*): Likewise. * fork-child.c: New file. * linux-low.c: Include "common-inferior.h", "nat/fork-inferior.h" and "environ.h". (linux_ptrace_fun): New function. (linux_create_inferior): Adjust function prototype to reflect change on "target.h". Adjust function code to use "fork_inferior". (linux_request_interrupt): Delete "signal_pid". * lynx-low.c: Include "common-inferior.h" and "nat/fork-inferior.h". (lynx_ptrace_fun): New function. (lynx_create_inferior): Adjust function prototype to reflect change on "target.h". Adjust function code to use "fork_inferior". * nto-low.c (nto_create_inferior): Adjust function prototype and code to reflect change on "target.h". Update comments. * server.c: Include "common-inferior.h", "nat/fork-inferior.h", "common-terminal.h" and "environ.h". (terminal_fd): Moved to fork-child.c. (old_foreground_pgrp): Likewise. (restore_old_foreground_pgrp): Likewise. (last_status): Make it global. (last_ptid): Likewise. (our_environ): New variable. (startup_with_shell): Likewise. (program_name): Likewise. (program_argv): Rename to... (program_args): ...this. (wrapper_argv): New variable. (start_inferior): Delete function. (get_exec_wrapper): New function. (get_exec_file): Likewise. (get_environ): Likewise. (prefork_hook): Likewise. (post_fork_inferior): Likewise. (postfork_hook): Likewise. (postfork_child_hook): Likewise. (handle_v_run): Update code to deal with arguments coming from the remote host. Update calls from "start_inferior" to "create_inferior". (captured_main): Likewise. Initialize environment variable. Call "have_job_control". * server.h (post_fork_inferior): New prototype. (get_environ): Likewise. (last_status): Declare. (last_ptid): Likewise. (signal_pid): Likewise. * spu-low.c: Include "common-inferior.h" and "nat/fork-inferior.h". (spu_ptrace_fun): New function. (spu_create_inferior): Adjust function prototype to reflect change on "target.h". Adjust function code to use "fork_inferior". * target.c (target_terminal_init): New function. (target_terminal_inferior): Likewise. (target_terminal_ours): Likewise. * target.h: Include <vector>. (struct target_ops) <create_inferior>: Update prototype. (create_inferior): Update macro. * utils.c (gdb_flush_out_err): New function. * win32-low.c (win32_create_inferior): Adjust function prototype and code to reflect change on "target.h". gdb/testsuite/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.server/non-existing-program.exp: Update regex in order to reflect the fact that gdbserver is now using fork_inferior (with a shell) to startup the inferior.
2016-12-23 03:11:11 +01:00
2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com>
* Makefile.in (SFILES): Add "nat/fork-inferior.o".
* configure: Regenerate.
* configure.srv (srv_linux_obj): Add "fork-child.o" and
"fork-inferior.o".
(i[34567]86-*-lynxos*): Likewise.
(spu*-*-*): Likewise.
* fork-child.c: New file.
* linux-low.c: Include "common-inferior.h", "nat/fork-inferior.h"
and "environ.h".
(linux_ptrace_fun): New function.
(linux_create_inferior): Adjust function prototype to reflect
change on "target.h". Adjust function code to use
"fork_inferior".
(linux_request_interrupt): Delete "signal_pid".
* lynx-low.c: Include "common-inferior.h" and "nat/fork-inferior.h".
(lynx_ptrace_fun): New function.
(lynx_create_inferior): Adjust function prototype to reflect
change on "target.h". Adjust function code to use
"fork_inferior".
* nto-low.c (nto_create_inferior): Adjust function prototype and
code to reflect change on "target.h". Update comments.
* server.c: Include "common-inferior.h", "nat/fork-inferior.h",
"common-terminal.h" and "environ.h".
(terminal_fd): Moved to fork-child.c.
(old_foreground_pgrp): Likewise.
(restore_old_foreground_pgrp): Likewise.
(last_status): Make it global.
(last_ptid): Likewise.
(our_environ): New variable.
(startup_with_shell): Likewise.
(program_name): Likewise.
(program_argv): Rename to...
(program_args): ...this.
(wrapper_argv): New variable.
(start_inferior): Delete function.
(get_exec_wrapper): New function.
(get_exec_file): Likewise.
(get_environ): Likewise.
(prefork_hook): Likewise.
(post_fork_inferior): Likewise.
(postfork_hook): Likewise.
(postfork_child_hook): Likewise.
(handle_v_run): Update code to deal with arguments coming from the
remote host. Update calls from "start_inferior" to
"create_inferior".
(captured_main): Likewise. Initialize environment variable. Call
"have_job_control".
* server.h (post_fork_inferior): New prototype.
(get_environ): Likewise.
(last_status): Declare.
(last_ptid): Likewise.
(signal_pid): Likewise.
* spu-low.c: Include "common-inferior.h" and "nat/fork-inferior.h".
(spu_ptrace_fun): New function.
(spu_create_inferior): Adjust function prototype to reflect change
on "target.h". Adjust function code to use "fork_inferior".
* target.c (target_terminal_init): New function.
(target_terminal_inferior): Likewise.
(target_terminal_ours): Likewise.
* target.h: Include <vector>.
(struct target_ops) <create_inferior>: Update prototype.
(create_inferior): Update macro.
* utils.c (gdb_flush_out_err): New function.
* win32-low.c (win32_create_inferior): Adjust function prototype
and code to reflect change on "target.h".
2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com>
* inferiors.c (switch_to_thread): New function.
Move parts of inferior job control to common/ This commit moves a few bits responsible for dealing with inferior job control from GDB to common/, which makes them available to gdbserver. This is necessary for the upcoming patches that will share fork_inferior et al between GDB and gdbserver. We move some parts of gdb/terminal.h to gdb/common/common-terminal.h, especifically the code that checks terminal features and that are used to set job_control accordingly. After sharing parts of gdb/terminal.h, we also to share the two functions on gdb/inflow.c that are going to be needed by the fork_inferior rework. They are 'gdb_setpgid' and the new 'have_job_control'. I've also taken the opportunity to give a more meaningful name to "inflow.c" on common/. Now it is called "job-control.c" (thanks Pedro for the suggestion). gdb/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add "common/job-control.c". (HFILES_NO_SRCDIR): Add "common/job-control.h". (COMMON_OBS): Add "job-control.o". * common/job-control.c: New file, with contents from "gdb/inflow.c". * common/job-control.h: New file, with contents from "terminal.h". * fork-child.c: Include "job-control.h". * inflow.c: Include "job-control.h". (gdb_setpgid): Move to "common/common-inflow.c". (_initialize_inflow): Move setting of "job_control" to "handle_job_control". * terminal.h (job_control): Moved to "common/common-terminal.h". (gdb_setpgid): Likewise. * top.c: Include "job_control.h". * utils.c: Likewise. (job_control): Moved to "job-control.c". gdb/gdbserver/ChangeLog: 2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILE): Add "common/job-control.c". (OBS): Add "job-control.o".
2016-12-22 18:41:16 +01:00
2017-06-07 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (SFILE): Add "common/job-control.c".
(OBS): Add "job-control.o".
Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files) Due to my ongoing work to make it possible for gdbserver to start the inferior using the shell, I had to share the fork_inferior function under the "nat/" directory. In order to do that, I created a new file and put the function there; however, this meant that I now had to update some of the *.mh files (under "gdb/config") and add the new file as a dependency to be built natively. Bleh... After talking a bit to Pedro about this, the idea came up to write a new "gdb/configure.nat" file, a la "gdb/configure.tgt", which would concentrate all of the native settings for each host/system. I decided to tackle this issue. The patch is simple. All of the previous Makefile variables that were being declared inside the *.mh files are now inside "gdb/Makefile.in", and "gdb/configure" is responsible for AC_SUBST'ing them. The definitions of these variables were put inside "gdb/configure.nat", so now they're shell variables. For excerpts of Makefile code, one must create a file under "gdb/config/${gdb_cpu_host}" and reference it on the "nat_extra_makefile_frag" variable. It should now be easier to update the native dependencies of hosts in this single file. This has been tested on x86_64 without regressions. gdb/ChangeLog: 2017-05-06 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in: Remove "@host_makefile_frag@". Add variables NAT_FILE, NATDEPFILES, NAT_CDEPS, LOADLIBES, MH_CFLAGS, XM_CLIBS, NAT_GENERATED_FILES, HAVE_NATIVE_GCORE_HOST. Add "@nat_extra_makefile_frag@". (Makefile): Remove dependency on "@frags@". ($(GNULIB_BUILDDIR)/Makefile): Likewise. (data-directory/Makefile): Likewise. * config/aarch64/linux.mh: Deleted; moved contents to "gdb/configure.nat". * config/alpha/alpha-linux.mh: Likewise. * config/alpha/nbsd.mh: Likewise. * config/arm/linux.mh: Likewise. * config/arm/nbsdelf.mh: Likewise. * config/i386/cygwin.mh: Likewise. * config/i386/cygwin64.mh: Likewise. * config/i386/darwin.mh: Likewise. * config/i386/fbsd.mh: Likewise. * config/i386/fbsd64.mh: Likewise. * config/i386/go32.mh: Likewise. * config/i386/i386gnu.mh: Likewise. * config/i386/i386sol2.mh: Likewise. * config/i386/linux.mh: Likewise. * config/i386/linux64.mh: Likewise. * config/i386/mingw.mh: Likewise. * config/i386/mingw64.mh: Likewise. * config/i386/nbsd64.mh: Likewise. * config/i386/nbsdelf.mh: Likewise. * config/i386/nto.mh: Likewise. * config/i386/obsd.mh: Likewise. * config/i386/obsd64.mh: Likewise. * config/i386/sol2-64.mh: Likewise. * config/ia64/linux.mh: Likewise. * config/m32r/linux.mh: Likewise. * config/m68k/linux.mh: Likewise. * config/m68k/nbsdelf.mh: Likewise. * config/m68k/obsd.mh: Likewise. * config/m88k/obsd.mh: Likewise. * config/mips/fbsd.mh: Likewise. * config/mips/linux.mh: Likewise. * config/mips/nbsd.mh: Likewise. * config/mips/obsd64.mh: Likewise. * config/pa/linux.mh: Likewise. * config/pa/nbsd.mh: Likewise. * config/pa/obsd.mh: Likewise. * config/powerpc/aix.mh: Likewise. * config/powerpc/fbsd.mh: Likewise. * config/powerpc/linux.mh: Likewise. * config/powerpc/nbsd.mh: Likewise. * config/powerpc/obsd.mh: Likewise. * config/powerpc/ppc64-linux.mh: Likewise. * config/powerpc/spu-linux.mh: Likewise. * config/s390/linux.mh: Likewise. * config/sh/nbsd.mh: Likewise. * config/sparc/fbsd.mh: Likewise. * config/sparc/linux.mh: Likewise. * config/sparc/linux64.mh: Likewise. * config/sparc/nbsd64.mh: Likewise. * config/sparc/nbsdelf.mh: Likewise. * config/sparc/obsd64.mh: Likewise. * config/sparc/sol2.mh: Likewise. * config/tilegx/linux.mh: Likewise. * config/vax/nbsdelf.mh: Likewise. * config/vax/obsd.mh: Likewise. * config/xtensa/linux.mh: Likewise. * config/i386/i386gnu.mn: New file, with excerpts from "config/i386/i386gnu.mh". * configure: Regenerate. * configure.ac: Rewrite code to use "gdb/configure.nat" instead of *.mh files under "gdb/config". * configure.nat: New file, with contents from the "gdb/config/*/*.mh" files. gdb/doc/ChangeLog: 2017-05-06 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile: Remove "@host_makefile_frag@".
2017-04-25 22:03:39 +02:00
2017-05-06 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile: Remove "@host_makefile_frag@".
2017-05-05 Pedro Alves <palves@redhat.com>
* configure: Regenerate.
2017-05-03 Sergio Durigan Junior <sergiodj@redhat.com>
* configure: Regenerate.
Change return type of gdbarch_software_single_step to vector<CORE_ADDR> This is a relatively straightforward patch that changes gdbarch_software_single_step so it returns an std::vector<CORE_ADDR> instead of a VEC (CORE_ADDR). gdb/ChangeLog: * gdbarch.sh (software_single_step): Change return type to std::vector<CORE_ADDR>. * gdbarch.c, gdbarch.h: Re-generate. * arch/arm-get-next-pcs.c (thumb_deal_with_atomic_sequence_raw): Adjust. (arm_deal_with_atomic_sequence_raw): Adjust. (thumb_get_next_pcs_raw): Adjust. (arm_get_next_pcs_raw): Adjust. (arm_get_next_pcs): Adjust. * arch/arm-get-next-pcs.h (arm_get_next_pcs): Adjust. * aarch64-tdep.c (aarch64_software_single_step): Adjust. * alpha-tdep.c (alpha_deal_with_atomic_sequence): Adjust. (alpha_software_single_step): Adjust. * alpha-tdep.h (alpha_software_single_step): Adjust. * arm-linux-tdep.c (arm_linux_software_single_step): Adjust. * arm-tdep.c (arm_software_single_step): Adjust. (arm_breakpoint_kind_from_current_state): Adjust. * arm-tdep.h (arm_software_single_step): Adjust. * breakpoint.c (insert_single_step_breakpoint): Adjust. * cris-tdep.c (cris_software_single_step): Adjust. * mips-tdep.c (mips_deal_with_atomic_sequence): Adjust. (micromips_deal_with_atomic_sequence): Adjust. (deal_with_atomic_sequence): Adjust. (mips_software_single_step): Adjust. * mips-tdep.h (mips_software_single_step): Adjust. * moxie-tdep.c (moxie_software_single_step): Adjust. * nios2-tdep.c (nios2_software_single_step): Adjust. * ppc-tdep.h (ppc_deal_with_atomic_sequence): Adjust. * rs6000-aix-tdep.c (rs6000_software_single_step): Adjust. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Adjust. * s390-linux-tdep.c (s390_software_single_step): Adjust. * sparc-tdep.c (sparc_software_single_step): Adjust. * spu-tdep.c (spu_software_single_step): Adjust. * tic6x-tdep.c (tic6x_software_single_step): Adjust. gdb/gdbserver/ChangeLog: * linux-arm-low.c (arm_gdbserver_get_next_pcs): Adjust to software_single_step change of return type to std::vector<CORE_ADDR>. * linux-low.c (install_software_single_step_breakpoints): Likewise. * linux-low.h (install_software_single_step_breakpoints): Likewise.
2017-05-02 19:30:07 +02:00
2017-05-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-arm-low.c (arm_gdbserver_get_next_pcs): Adjust to
software_single_step change of return type to
std::vector<CORE_ADDR>.
* linux-low.c (install_software_single_step_breakpoints):
Likewise.
* linux-low.h (install_software_single_step_breakpoints):
Likewise.
2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com>
* remote-utils.c: Include "gdb_termios.h" instead of
"terminal.h".
* terminal.h: Delete file.
C++-fy and prepare for sharing fork_inferior As a preparation for the next patch, which will move fork_inferior from GDB to common/ (and therefore share it with gdbserver), it is interesting to convert a few functions to C++. This patch touches functions related to parsing command-line arguments to the inferior (see gdb/fork-child.c:breakup_args), the way the arguments are stored on fork_inferior (using std::vector instead of char **), and the code responsible for dealing with argv also on gdbserver. I've taken this opportunity and decided to constify a few arguments to fork_inferior/create_inferior as well, in order to make the code cleaner. And now, on gdbserver, we're using xstrdup everywhere and aren't checking for memory allocation failures anymore, as requested by Pedro: <https://sourceware.org/ml/gdb-patches/2017-03/msg00191.html> Message-Id: <025ebdb9-90d9-d54a-c055-57ed2406b812@redhat.com> Pedro Alves wrote: > On the "== NULL" check: IIUC, the old NULL check was there to > handle strdup returning NULL due to out-of-memory. > See NULL checks and comments further above in this function. > Now that you're using a std::vector, that doesn't work or make > sense any longer, since if push_back fails to allocate space for > its internal buffer (with operator new), our operator new replacement > (common/new-op.c) calls malloc_failure, which aborts gdbserver. > > Not sure it makes sense to handle out-of-memory specially in > the gdb/rsp-facing functions nowadays (maybe git blame/log/patch > submission for that code shows some guidelines). Maybe (or, probably) > it's OK to stop caring about it, but then we should consistently remove > left over code, by using xstrdup instead and remove the NULL checks. IMO this refactoring was very good to increase the readability of the code as well, because some parts of the argument handling were unnecessarily confusing before. gdb/ChangeLog: 2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com> * common/common-utils.c (free_vector_argv): New function. * common/common-utils.h: Include <vector>. (free_vector_argv): New prototype. * darwin-nat.c (darwin_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * fork-child.c: Include <vector>. (breakup_args): Rewrite function, using C++. (fork_inferior): Rewrite function header, constify "exec_file_arg" and accept "std::string" for "allargs". Update the code to calculate "argv" based on "allargs". Update calls to "exec_fun" and "execvp". * gnu-nat.c (gnu_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * go32-nat.c (go32_create_inferior): Likewise. * inf-ptrace.c (inf_ptrace_create_inferior): Likewise. * infcmd.c (run_command_1): Constify "exec_file". Use "std::string" for inferior arguments. * inferior.h (fork_inferior): Update prototype. * linux-nat.c (linux_nat_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * nto-procfs.c (procfs_create_inferior): Likewise. * procfs.c (procfs_create_inferior): Likewise. * remote-sim.c (gdbsim_create_inferior): Likewise. * remote.c (extended_remote_run): Update code to accept "std::string" as argument. (extended_remote_create_inferior): Rewrite function prototype in order to constify "exec_file" and accept a "std::string" for "allargs". * rs6000-nat.c (super_create_inferior): Likewise. (rs6000_create_inferior): Likewise. * target.h (struct target_ops) <to_create_inferior>: Likewise. * windows-nat.c (windows_create_inferior): Likewise. gdb/gdbserver/ChangeLog: 2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com> * server.c: Include <vector>. <program_argv, wrapper_argv>: Convert to std::vector. (start_inferior): Rewrite function to use C++. (handle_v_run): Likewise. Update code that calculates the argv based on the vRun packet; use C++. (captured_main): Likewise.
2017-03-23 02:54:49 +01:00
2017-04-12 Sergio Durigan Junior <sergiodj@redhat.com>
* server.c: Include <vector>.
<program_argv, wrapper_argv>: Convert to std::vector.
(start_inferior): Rewrite function to use C++.
(handle_v_run): Likewise. Update code that calculates the argv
based on the vRun packet; use C++.
(captured_main): Likewise.
Class-ify ptid_t I grew a bit tired of using ptid_get_{lwp,pid,tid} and friends, so I decided to make it a bit easier to use by making it a proper class. The fields are now private, so it's not possible to change a ptid_t field by mistake. The new methods of ptid_t map to existing functions/practice like this: ptid_t (pid, lwp, tid) -> ptid_build (pid, lwp, tid) ptid_t (pid) -> pid_to_ptid (pid) ptid.is_pid () -> ptid_is_pid (ptid) ptid == other -> ptid_equal (ptid, other) ptid != other -> !ptid_equal (ptid, other) ptid.pid () -> ptid_get_pid (ptid) ptid.lwp_p () -> ptid_lwp_p (ptid) ptid.lwp () -> ptid_get_lwp (ptid) ptid.tid_p () -> ptid_tid_p (ptid) ptid.tid () -> ptid_get_tid (ptid) ptid.matches (filter) -> ptid_match (ptid, filter) I've replaced the implementation of the existing functions with calls to the new methods. People are encouraged to gradually switch to using the ptid_t methods instead of the functions (or we can change them all in one pass eventually). Also, I'm not sure if it's worth it (because of ptid_t's relatively small size), but I have made the functions and methods take ptid_t arguments by const reference instead of by value. gdb/ChangeLog: * common/ptid.h (struct ptid): Change to... (class ptid_t): ... this. <ptid_t>: New constructors. <pid, lwp_p, lwp, tid_p, tid, is_pid, operator==, operator!=, matches>: New methods. <make_null, make_minus_one>: New static methods. <pid>: Rename to... <m_pid>: ...this. <lwp>: Rename to... <m_lwp>: ...this. <tid>: Rename to... <m_tid>: ...this. (ptid_build, ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p, ptid_match): Take ptid arguments as references, move comment to class ptid_t. * common/ptid.c (null_ptid, minus_one_ptid): Initialize with ptid_t static methods. (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_tid, ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p, ptid_match): Take ptid arguments as references, implement using ptid_t methods. * unittests/ptid-selftests.c: New file. * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add unittests/ptid-selftests.c. (SUBDIR_UNITTESTS_OBS): Add unittests/ptid-selftests.o. gdb/gdbserver/ChangeLog: * server.c (handle_v_cont): Initialize thread_resume::thread with null_ptid.
2017-04-07 05:29:53 +02:00
2017-04-06 Simon Marchi <simon.marchi@ericsson.com>
* server.c (handle_v_cont): Initialize thread_resume::thread
with null_ptid.
2017-04-05 Pedro Alves <palves@redhat.com>
* configure: Regenerate.
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
2017-04-05 Pedro Alves <palves@redhat.com>
* gdbreplay.c (sync_error): Constify.
* linux-x86-low.c (push_opcode): Constify.
2017-04-05 Pedro Alves <palves@redhat.com>
* win32-low.c (get_child_debug_event)
<CREATE_PROCESS_DEBUG_EVENT>: Don't report TARGET_WAITKIND_EXECD.
Report TARGET_WAITKIND_SPURIOUS instead.
2017-04-05 Pedro Alves <palves@redhat.com>
* remote-utils.c (remote_prepare, remote_open): Constify.
* remote-utils.h (remote_prepare, remote_open): Constify.
* server.c (captured_main): Constify 'port' handling.
2017-04-04 Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (clean): Clear .deps.
2017-03-31 Simon Marchi <simon.marchi@polymtl.ca>
* .gitignore: Remove generated files, replace with wildcard.
* (clean): Replace removal of generated files with wildcard.
(version.c): Replace with...
(version-generated.c): ...this.
(xml-builtin.c): Replace with...
(xml-builtin-generated.c): ...this.
(%-ipa.o: %-generated.c, %.o: %-generated.c): New rules.
(%.c: *regformats*): Replace with...
(%-generated.c: *regformats*): ...this.
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
* linux-xtensa-low.c (regnum::R_THREADPTR): New enum member.
(xtensa_fill_gregset): Call collect_register_by_name for
threadptr register.
(xtensa_store_gregset): Call supply_register_by_name for
threadptr register.
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
* linux-xtensa-low.c (xtensa_fill_gregset): Call collect_register
for all registers in a0_regnum..a0_regnum + C0_NREGS range.
(xtensa_store_gregset): Call supply_register for all registers in
a0_regnum..a0_regnum + C0_NREGS range.
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (%-ipa.o: %-ipa.c): New rule.
(ax-ipa.o: ax.c): Remove.
(linux-i386-ipa.o: linux-i386-ipa.c): Remove.
(linux-amd64-ipa.o: linux-amd64-ipa.c): Remove.
(linux-aarch64-ipa.o: linux-aarch64-ipa.c): Remove.
(linux-s390-ipa.o: linux-s390-ipa.c): Remove.
(linux-ppc-ipa.o: linux-ppc-ipa.c): Remove.
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (%-ipa.o: ../common/%.c): New rule.
(print-utils-ipa.o: ../common/print-utils.c): Remove.
(rsp-low-ipa.o: ../common/rsp-low.c): Remove.
(errors-ipa.o: ../common/errors.c): Remove.
(format-ipa.o: ../common/format.c): Remove.
(common-utils-ipa.o: ../common/common-utils.c): Remove.
gdbserver: Use pattern rule for IPA objects from gdbserver/ gdb/gdbserver/ChangeLog: * Makefile.in (%-ipa.o: %.c): New rule. (tracepoint-ipa.o: tracepoint.c): Remove. (utils-ipa.o: utils.c): Remove. (remote-utils-ipa.o: remote-utils.c): Remove. (regcache-ipa.o: regcache.c): Remove. (i386-linux-ipa.o: i386-linux.c): Remove. (i386-mmx-linux-ipa.o: i386-mmx-linux.c): Remove. (i386-avx-linux-ipa.o: i386-avx-linux.c): Remove. (i386-mpx-linux-ipa.o: i386-mpx-linux.c): Remove. (i386-avx-mpx-linux-ipa.o: i386-avx-mpx-linux.c): Remove. (i386-avx-avx512-linux-ipa.o: i386-avx-avx512-linux.c): Remove. (i386-avx-mpx-avx512-pku-linux-ipa.o: i386-avx-mpx-avx512-pku-linux.c): Remove. (amd64-linux-ipa.o: amd64-linux.c): Remove. (amd64-avx-linux-ipa.o: amd64-avx-linux.c): Remove. (amd64-mpx-linux-ipa.o: amd64-mpx-linux.c): Remove. (amd64-avx-mpx-linux-ipa.o: amd64-avx-mpx-linux.c): Remove. (amd64-avx-avx512-linux-ipa.o: amd64-avx-avx512-linux.c): Remove. (amd64-avx-mpx-avx512-pku-linux-ipa.o: amd64-avx-mpx-avx512-pku-linux.c): Remove. (aarch64-ipa.o: aarch64.c): Remove. (s390-linux32-ipa.o: s390-linux32.c): Remove. (s390-linux32v1-ipa.o: s390-linux32v1.c): Remove. (s390-linux32v2-ipa.o: s390-linux32v2.c): Remove. (s390-linux64-ipa.o: s390-linux64.c): Remove. (s390-linux64v1-ipa.o: s390-linux64v1.c): Remove. (s390-linux64v2-ipa.o: s390-linux64v2.c): Remove. (s390-te-linux64-ipa.o: s390-te-linux64.c): Remove. (s390-vx-linux64-ipa.o: s390-vx-linux64.c): Remove. (s390-tevx-linux64-ipa.o: s390-tevx-linux64.c): Remove. (s390x-linux64-ipa.o: s390x-linux64.c): Remove. (s390x-linux64v1-ipa.o: s390x-linux64v1.c): Remove. (s390x-linux64v2-ipa.o: s390x-linux64v2.c): Remove. (s390x-te-linux64-ipa.o: s390x-te-linux64.c): Remove. (s390x-vx-linux64-ipa.o: s390x-vx-linux64.c): Remove. (s390x-tevx-linux64-ipa.o: s390x-tevx-linux64.c): Remove. (powerpc-32l-ipa.o: powerpc-32l.c): Remove. (powerpc-altivec32l-ipa.o: powerpc-altivec32l.c): Remove. (powerpc-cell32l-ipa.o: powerpc-cell32l.c): Remove. (powerpc-vsx32l-ipa.o: powerpc-vsx32l.c): Remove. (powerpc-isa205-32l-ipa.o: powerpc-isa205-32l.c): Remove. (powerpc-isa205-altivec32l-ipa.o: powerpc-isa205-altivec32l.c): Remove. (powerpc-isa205-vsx32l-ipa.o: powerpc-isa205-vsx32l.c): Remove. (powerpc-e500l-ipa.o: powerpc-e500l.c): Remove. (powerpc-64l-ipa.o: powerpc-64l.c): Remove. (powerpc-altivec64l-ipa.o: powerpc-altivec64l.c): Remove. (powerpc-cell64l-ipa.o: powerpc-cell64l.c): Remove. (powerpc-vsx64l-ipa.o: powerpc-vsx64l.c): Remove. (powerpc-isa205-64l-ipa.o: powerpc-isa205-64l.c): Remove. (powerpc-isa205-altivec64l-ipa.o: powerpc-isa205-altivec64l.c): Remove. (powerpc-isa205-vsx64l-ipa.o: powerpc-isa205-vsx64l.c): Remove. (tdesc-ipa.o: tdesc.c): Remove. (x32-linux-ipa.o: x32-linux.c): Remove. (x32-avx-linux-ipa.o: x32-avx-linux.c): Remove. (x32-avx512-linux-ipa.o: x32-avx512-linux.c): Remove.
2017-03-13 23:44:04 +01:00
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (%-ipa.o: %.c): New rule.
(tracepoint-ipa.o: tracepoint.c): Remove.
(utils-ipa.o: utils.c): Remove.
(remote-utils-ipa.o: remote-utils.c): Remove.
(regcache-ipa.o: regcache.c): Remove.
(i386-linux-ipa.o: i386-linux.c): Remove.
(i386-mmx-linux-ipa.o: i386-mmx-linux.c): Remove.
(i386-avx-linux-ipa.o: i386-avx-linux.c): Remove.
(i386-mpx-linux-ipa.o: i386-mpx-linux.c): Remove.
(i386-avx-mpx-linux-ipa.o: i386-avx-mpx-linux.c): Remove.
(i386-avx-avx512-linux-ipa.o: i386-avx-avx512-linux.c): Remove.
(i386-avx-mpx-avx512-pku-linux-ipa.o: i386-avx-mpx-avx512-pku-linux.c): Remove.
(amd64-linux-ipa.o: amd64-linux.c): Remove.
(amd64-avx-linux-ipa.o: amd64-avx-linux.c): Remove.
(amd64-mpx-linux-ipa.o: amd64-mpx-linux.c): Remove.
(amd64-avx-mpx-linux-ipa.o: amd64-avx-mpx-linux.c): Remove.
(amd64-avx-avx512-linux-ipa.o: amd64-avx-avx512-linux.c): Remove.
(amd64-avx-mpx-avx512-pku-linux-ipa.o: amd64-avx-mpx-avx512-pku-linux.c): Remove.
(aarch64-ipa.o: aarch64.c): Remove.
(s390-linux32-ipa.o: s390-linux32.c): Remove.
(s390-linux32v1-ipa.o: s390-linux32v1.c): Remove.
(s390-linux32v2-ipa.o: s390-linux32v2.c): Remove.
(s390-linux64-ipa.o: s390-linux64.c): Remove.
(s390-linux64v1-ipa.o: s390-linux64v1.c): Remove.
(s390-linux64v2-ipa.o: s390-linux64v2.c): Remove.
(s390-te-linux64-ipa.o: s390-te-linux64.c): Remove.
(s390-vx-linux64-ipa.o: s390-vx-linux64.c): Remove.
(s390-tevx-linux64-ipa.o: s390-tevx-linux64.c): Remove.
(s390x-linux64-ipa.o: s390x-linux64.c): Remove.
(s390x-linux64v1-ipa.o: s390x-linux64v1.c): Remove.
(s390x-linux64v2-ipa.o: s390x-linux64v2.c): Remove.
(s390x-te-linux64-ipa.o: s390x-te-linux64.c): Remove.
(s390x-vx-linux64-ipa.o: s390x-vx-linux64.c): Remove.
(s390x-tevx-linux64-ipa.o: s390x-tevx-linux64.c): Remove.
(powerpc-32l-ipa.o: powerpc-32l.c): Remove.
(powerpc-altivec32l-ipa.o: powerpc-altivec32l.c): Remove.
(powerpc-cell32l-ipa.o: powerpc-cell32l.c): Remove.
(powerpc-vsx32l-ipa.o: powerpc-vsx32l.c): Remove.
(powerpc-isa205-32l-ipa.o: powerpc-isa205-32l.c): Remove.
(powerpc-isa205-altivec32l-ipa.o: powerpc-isa205-altivec32l.c): Remove.
(powerpc-isa205-vsx32l-ipa.o: powerpc-isa205-vsx32l.c): Remove.
(powerpc-e500l-ipa.o: powerpc-e500l.c): Remove.
(powerpc-64l-ipa.o: powerpc-64l.c): Remove.
(powerpc-altivec64l-ipa.o: powerpc-altivec64l.c): Remove.
(powerpc-cell64l-ipa.o: powerpc-cell64l.c): Remove.
(powerpc-vsx64l-ipa.o: powerpc-vsx64l.c): Remove.
(powerpc-isa205-64l-ipa.o: powerpc-isa205-64l.c): Remove.
(powerpc-isa205-altivec64l-ipa.o: powerpc-isa205-altivec64l.c): Remove.
(powerpc-isa205-vsx64l-ipa.o: powerpc-isa205-vsx64l.c): Remove.
(tdesc-ipa.o: tdesc.c): Remove.
(x32-linux-ipa.o: x32-linux.c): Remove.
(x32-avx-linux-ipa.o: x32-avx-linux.c): Remove.
(x32-avx512-linux-ipa.o: x32-avx512-linux.c): Remove.
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (%.o: ../arch/%.c): New rule.
(arm.o: ../arch/arm.c): Remove.
(arm-linux.o: ../arch/arm-linux.c): Remove.
(arm-get-next-pcs.o: ../arch/arm-get-next-pcs.c): Remove.
(aarch64-insn.o: ../arch/aarch64-insn.c): Remove.
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (%.o: ../nat/%.c): New rule.
(x86-dregs.o: ../nat/x86-dregs.c): Remove.
(amd64-linux-siginfo.o: ../nat/amd64-linux-siginfo.c): Remove.
(linux-btrace.o: ../nat/linux-btrace.c): Remove.
(linux-osdata.o: ../nat/linux-osdata.c): Remove.
(linux-procfs.o: ../nat/linux-procfs.c): Remove.
(linux-ptrace.o: ../nat/linux-ptrace.c): Remove.
(linux-waitpid.o: ../nat/linux-waitpid.c): Remove.
(mips-linux-watch.o: ../nat/mips-linux-watch.c): Remove.
(ppc-linux.o: ../nat/ppc-linux.c): Remove.
(linux-personality.o: ../nat/linux-personality.c): Remove.
(aarch64-linux-hw-point.o: ../nat/aarch64-linux-hw-point.c): Remove.
(aarch64-linux.o: ../nat/aarch64-linux.c): Remove.
(x86-linux.o: ../nat/x86-linux.c): Remove.
(x86-linux-dregs.o: ../nat/x86-linux-dregs.c): Remove.
(linux-namespaces.o: ../nat/linux-namespaces.c): Remove.
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (%.o: ../common/%.c): New rule.
(signals.o: ../common/signals.c): Remove.
(print-utils.o: ../common/print-utils.c): Remove.
(rsp-low.o: ../common/rsp-low.c): Remove.
(common-utils.o: ../common/common-utils.c): Remove.
(posix-strerror.o: ../common/posix-strerror.c): Remove.
(mingw-strerror.o: ../common/mingw-strerror.c): Remove.
(vec.o: ../common/vec.c): Remove.
(gdb_vecs.o: ../common/gdb_vecs.c): Remove.
(xml-utils.o: ../common/xml-utils.c): Remove.
(ptid.o: ../common/ptid.c): Remove.
(buffer.o: ../common/buffer.c): Remove.
(format.o: ../common/format.c): Remove.
(filestuff.o: ../common/filestuff.c): Remove.
(agent.o: ../common/agent.c): Remove.
(errors.o: ../common/errors.c): Remove.
(environ.o: ../common/environ.c): Remove.
(common-debug.o: ../common/common-debug.c): Remove.
(cleanups.o: ../common/cleanups.c): Remove.
(common-exceptions.o: ../common/common-exceptions.c): Remove.
(fileio.o: ../common/fileio.c): Remove.
(common-regcache.o: ../common/common-regcache.c): Remove.
(signals-state-save-restore.o: ../common/signals-state-save-restore.c): Remove.
(new-op.o: ../common/new-op.c): Remove.
(btrace-common.o: ../common/btrace-common.c): Remove.
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (%.o: ../target/%.c): New rule.
(waitstatus.o: ../target/waitstatus.c): Remove.
gdbserver: Use pattern rule for regformats source file generation gdb/gdbserver/ChangeLog: * Makefile.in (%.c: ../regformats/%.dat, (%.c: ../regformats/arm/%.dat, (%.c: ../regformats/i386/%.dat, (%.c: ../regformats/rs6000/%.dat): New rules. (aarch64.c): Remove. (reg-arm.c): Remove. (arm-with-iwmmxt.c): Remove. (arm-with-vfpv2.c): Remove. (arm-with-vfpv3.c): Remove. (arm-with-neon.c): Remove. (reg-bfin.c): Remove. (reg-cris.c): Remove. (reg-crisv32.c): Remove. (i386.c): Remove. (i386-linux.c): Remove. (i386-avx.c): Remove. (i386-avx-linux.c): Remove. (i386-avx-avx512.c): Remove. (i386-avx-avx512-linux.c): Remove. (i386-mpx.c): Remove. (i386-mpx-linux.c): Remove. (i386-avx-mpx-avx512-pku.c): Remove. (i386-avx-mpx-avx512-pku-linux.c): Remove. (i386-avx-mpx.c): Remove. (i386-avx-mpx-linux.c): Remove. (i386-mmx.c): Remove. (i386-mmx-linux.c): Remove. (reg-ia64.c): Remove. (reg-m32r.c): Remove. (reg-m68k.c): Remove. (reg-cf.c): Remove. (mips-linux.c): Remove. (mips-dsp-linux.c): Remove. (mips64-linux.c): Remove. (mips64-dsp-linux.c): Remove. (nios2-linux.c): Remove. (powerpc-32.c): Remove. (powerpc-32l.c): Remove. (powerpc-altivec32l.c): Remove. (powerpc-cell32l.c): Remove. (powerpc-vsx32l.c): Remove. (powerpc-isa205-32l.c): Remove. (powerpc-isa205-altivec32l.c): Remove. (powerpc-isa205-vsx32l.c): Remove. (powerpc-e500l.c): Remove. (powerpc-64l.c): Remove. (powerpc-altivec64l.c): Remove. (powerpc-cell64l.c): Remove. (powerpc-vsx64l.c): Remove. (powerpc-isa205-64l.c): Remove. (powerpc-isa205-altivec64l.c): Remove. (powerpc-isa205-vsx64l.c): Remove. (s390-linux32.c): Remove. (s390-linux32v1.c): Remove. (s390-linux32v2.c): Remove. (s390-linux64.c): Remove. (s390-linux64v1.c): Remove. (s390-linux64v2.c): Remove. (s390-te-linux64.c): Remove. (s390-vx-linux64.c): Remove. (s390-tevx-linux64.c): Remove. (s390x-linux64.c): Remove. (s390x-linux64v1.c): Remove. (s390x-linux64v2.c): Remove. (s390x-te-linux64.c): Remove. (s390x-vx-linux64.c): Remove. (s390x-tevx-linux64.c): Remove. (tic6x-c64xp-linux.c): Remove. (tic6x-c64x-linux.c): Remove. (tic6x-c62x-linux.c): Remove. (reg-sh.c): Remove. (reg-sparc64.c): Remove. (reg-spu.c): Remove. (amd64.c): Remove. (amd64-linux.c): Remove. (amd64-avx.c): Remove. (amd64-avx-linux.c): Remove. (amd64-avx-avx512.c): Remove. (amd64-avx-avx512-linux.c): Remove. (amd64-mpx.c): Remove. (amd64-mpx-linux.c): Remove. (amd64-avx-mpx-avx512-pku.c): Remove. (amd64-avx-mpx-avx512-pku-linux.c): Remove. (amd64-avx-mpx.c): Remove. (amd64-avx-mpx-linux.c): Remove. (x32.c): Remove. (x32-linux.c): Remove. (x32-avx.c): Remove. (x32-avx-linux.c): Remove. (x32-avx-avx512.c): Remove. (x32-avx-avx512-linux.c): Remove. (reg-xtensa.c): Remove. (reg-tilegx.c): Remove. (reg-tilegx32.c): Remove.
2017-03-13 23:44:01 +01:00
2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in
(%.c: ../regformats/%.dat,
(%.c: ../regformats/arm/%.dat,
(%.c: ../regformats/i386/%.dat,
(%.c: ../regformats/rs6000/%.dat): New rules.
(aarch64.c): Remove.
(reg-arm.c): Remove.
(arm-with-iwmmxt.c): Remove.
(arm-with-vfpv2.c): Remove.
(arm-with-vfpv3.c): Remove.
(arm-with-neon.c): Remove.
(reg-bfin.c): Remove.
(reg-cris.c): Remove.
(reg-crisv32.c): Remove.
(i386.c): Remove.
(i386-linux.c): Remove.
(i386-avx.c): Remove.
(i386-avx-linux.c): Remove.
(i386-avx-avx512.c): Remove.
(i386-avx-avx512-linux.c): Remove.
(i386-mpx.c): Remove.
(i386-mpx-linux.c): Remove.
(i386-avx-mpx-avx512-pku.c): Remove.
(i386-avx-mpx-avx512-pku-linux.c): Remove.
(i386-avx-mpx.c): Remove.
(i386-avx-mpx-linux.c): Remove.
(i386-mmx.c): Remove.
(i386-mmx-linux.c): Remove.
(reg-ia64.c): Remove.
(reg-m32r.c): Remove.
(reg-m68k.c): Remove.
(reg-cf.c): Remove.
(mips-linux.c): Remove.
(mips-dsp-linux.c): Remove.
(mips64-linux.c): Remove.
(mips64-dsp-linux.c): Remove.
(nios2-linux.c): Remove.
(powerpc-32.c): Remove.
(powerpc-32l.c): Remove.
(powerpc-altivec32l.c): Remove.
(powerpc-cell32l.c): Remove.
(powerpc-vsx32l.c): Remove.
(powerpc-isa205-32l.c): Remove.
(powerpc-isa205-altivec32l.c): Remove.
(powerpc-isa205-vsx32l.c): Remove.
(powerpc-e500l.c): Remove.
(powerpc-64l.c): Remove.
(powerpc-altivec64l.c): Remove.
(powerpc-cell64l.c): Remove.
(powerpc-vsx64l.c): Remove.
(powerpc-isa205-64l.c): Remove.
(powerpc-isa205-altivec64l.c): Remove.
(powerpc-isa205-vsx64l.c): Remove.
(s390-linux32.c): Remove.
(s390-linux32v1.c): Remove.
(s390-linux32v2.c): Remove.
(s390-linux64.c): Remove.
(s390-linux64v1.c): Remove.
(s390-linux64v2.c): Remove.
(s390-te-linux64.c): Remove.
(s390-vx-linux64.c): Remove.
(s390-tevx-linux64.c): Remove.
(s390x-linux64.c): Remove.
(s390x-linux64v1.c): Remove.
(s390x-linux64v2.c): Remove.
(s390x-te-linux64.c): Remove.
(s390x-vx-linux64.c): Remove.
(s390x-tevx-linux64.c): Remove.
(tic6x-c64xp-linux.c): Remove.
(tic6x-c64x-linux.c): Remove.
(tic6x-c62x-linux.c): Remove.
(reg-sh.c): Remove.
(reg-sparc64.c): Remove.
(reg-spu.c): Remove.
(amd64.c): Remove.
(amd64-linux.c): Remove.
(amd64-avx.c): Remove.
(amd64-avx-linux.c): Remove.
(amd64-avx-avx512.c): Remove.
(amd64-avx-avx512-linux.c): Remove.
(amd64-mpx.c): Remove.
(amd64-mpx-linux.c): Remove.
(amd64-avx-mpx-avx512-pku.c): Remove.
(amd64-avx-mpx-avx512-pku-linux.c): Remove.
(amd64-avx-mpx.c): Remove.
(amd64-avx-mpx-linux.c): Remove.
(x32.c): Remove.
(x32-linux.c): Remove.
(x32-avx.c): Remove.
(x32-avx-linux.c): Remove.
(x32-avx-avx512.c): Remove.
(x32-avx-avx512-linux.c): Remove.
(reg-xtensa.c): Remove.
(reg-tilegx.c): Remove.
(reg-tilegx32.c): Remove.
2017-03-07 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (SFILES): Add "common/environ.c".
(OBJS): Add "common/environ.h".
2017-01-27 Walfred Tedeschi <walfred.tedeschi@intel.com>
* configure.ac: Check if the fs_base and gs_base members of
`struct user_regs_struct' exist.
* config.in: Regenerated.
* configure: Likewise.
Fix inferior memory reading in GDBServer for arm/aarch32 Before this patch, some functions would read the inferior memory with (*the_target)->read_memory, which returns the raw memory, rather than the shadowed memory. This is wrong since these functions do not expect to read a breakpoint instruction and can lead to invalid behavior. Use of raw memory in get_next_pcs_read_memory_unsigned_integer for example could lead to get_next_pc returning an invalid pc. Here's how this would happen: In non-stop: the user issues: thread 1 step& thread 2 step& thread 3 step& In a similar way as non-stop-fair-events.exp (threads are looping). GDBServer: linux_resume is called GDBServer has pending events, threads are not resumed and single-step breakpoint for thread 1 not installed. linux_wait_1 is called with a pending event on thread 2 at pc A GDBServer handles the event and calls proceed_all_lwps This calls proceed_one_lwp and installs single-step breakpoints on all the threads that need one. Now since thread 1 needs to install a single-step breakpoint and is at pc B (different than thread 2), a step-over is not initiated and get_next_pc is called to figure out the next instruction from pc B. However it may just be that thread 3 as a single step breakpoint at pc B. And thus get_next_pc fails. This situation is tested with non-stop-fair-events.exp. In other words, single-step breakpoints are installed in proceed_one_lwp for each thread. GDBserver proceeds two threads for resume_step, as requested by GDB, and the thread proceeded later may see the single-step breakpoints installed for the thread proceeded just now. Tested on gdbserver-native/-m{thumb,arm} no regressions. gdb/gdbserver/ChangeLog: * linux-aarch32-low.c (arm_breakpoint_kind_from_pc): Use target_read_memory. * linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer): Likewise. (get_next_pcs_syscall_next_pc): Likewise.
2017-01-09 18:39:07 +01:00
2017-01-09 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-aarch32-low.c (arm_breakpoint_kind_from_pc): Use
target_read_memory.
* linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer): Likewise.
(get_next_pcs_syscall_next_pc): Likewise.
2016-12-23 Luis Machado <lgustavo@codesourcery.com>
* win32-i386-low.c: Fix incorrect reference to a couple source files.
* nto-x86-low.c: Likewise.
Makefiles: Disable suffix rules and implicit rules Since we don't use suffix rules nor implicit rules in gdb, we can disable them. The advantage is a slightly faster make [1]. Here are some numbers about the speedup. I ran this on my trusty old Intel Q6600, so the time numbers are probably higher than what you'd get on any recent hardware. I ran "make" in the gdb/ directory of an already built repository (configured with --enable-targets=all). I recorded the time of execution (average of 5). I then ran "make -d" and recorded the number of printed lines, which gives a rough idea of the number of operations done. I compared the following configurations, to see the impact of both the empty .SUFFIXES target and the empty pattern rules, as well as running "make -r", which can be considered the "ideal" case. A - baseline B - baseline + .SUFFIXES C - baseline + pattern rules D - baseline + .SUFFIXES + pattern rules E - baseline + make -r config | time (s) | "make -d" ----------------------------- A | 5.74 | 2396643 B | 1.19 | 298469 C | 2.81 | 1266573 D | 1.13 | 245489 E | 1.01 | 163914 We can see that the empty .SUFFIXES target has a bigger impact than the empty pattern rules, but still it doesn't hurt to disable the implicit pattern rules as well. There are still some mentions of implicit rules I can't get rid of in the "make -d" output. For example, it's trying to build .c files from .w files: Looking for an implicit rule for '/home/simark/src/binutils-gdb/gdb/infrun.c'. Trying pattern rule with stem 'infrun'. Trying implicit prerequisite '/home/simark/src/binutils-gdb/gdb/infrun.w'. and trying to build Makefile.in from a bunch of extensions: Looking for an implicit rule for 'Makefile.in'. Trying pattern rule with stem 'Makefile.in'. Trying implicit prerequisite 'Makefile.in.o'. Trying pattern rule with stem 'Makefile.in'. Trying implicit prerequisite 'Makefile.in.c'. Trying pattern rule with stem 'Makefile.in'. Trying implicit prerequisite 'Makefile.in.cc'. ... many more ... If somebody knows how to disable them, we can do it, but at this point the returns are minimal, so it is not that important. I verified that both in-tree and out-of-tree builds work. [1] Switching from explicit rules to pattern rules for files in subdirectories actually made it slower, so this is kind of a way to redeem myself. But it the end it's faster than it was previously, so it was all worth it. :) gdb/ChangeLog: * disable-implicit-rules.mk: New file. * Makefile.in: Include disable-implicit-rules.mk. * data-directory/Makefile.in: Likewise. * gnulib/Makefile.in: Likewise. gdb/doc/ChangeLog: * Makefile.in: Likewise. gdb/gdbserver/ChangeLog: * Makefile.in: Include disable-implicit-rules.mk. gdb/testsuite/ChangeLog: * Makefile.in: Include disable-implicit-rules.mk.
2016-11-30 22:23:59 +01:00
2016-11-30 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Include disable-implicit-rules.mk.
gdb: Use C++11 std::chrono 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-23 16:36:26 +01:00
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-22 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Fix whitespace formatting.
Makefiles: Flatten and sort file lists 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-22 22:14:22 +01:00
2016-11-22 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (SFILES, OBS): Flatten list and order
alphabetically.
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-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-17 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (.c.o): Replace rule with ...
(%.o: %.c): ... this one.
Remove code that checks for GNU/non-GNU make 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-17 18:00:10 +01:00
2016-11-17 Simon Marchi <simon.marchi@polymtl.ca>
* 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: Require C++11 Use AX_CXX_COMPILE_STDCXX to detect if the compiler supports C++11, and if -std=xxx switches are necessary to enable C++11. We need to tweak AX_CXX_COMPILE_STDCXX a bit though. Pristine upstream AX_CXX_COMPILE_STDCXX appends -std=gnu++11 to CXX directly. That doesn't work for us, because the top level Makefile passes CXX down to subdirs, and that overrides whatever gdb/Makefile may set CXX to. The result would be that a make invocation from the build/gdb/ directory would use "g++ -std=gnu++11" as expected, while a make invocation at the top level would not. So instead of having AX_CXX_COMPILE_STDCXX set CXX directly, tweak it to AC_SUBST a separate variable -- CXX_DIALECT -- and use '$(CXX) (CXX_DIALECT)' to compile/link. Confirmed that this enables C++11 starting with gcc 4.8, the first gcc release with full C++11 support. Also confirmed that configure errors out gracefully with older GCC releases: checking whether /opt/gcc-4.7/bin/g++ supports C++11 features by default... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -std=gnu++11... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -std=gnu++0x... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -std=c++11... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -std=c++0x... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with +std=c++11... no checking whether /opt/gcc-4.7/bin/g++ supports C++11 features with -h std=c++11... no configure: error: *** A compiler with support for C++11 language features is required. Makefile:9451: recipe for target 'configure-gdb' failed make[1]: *** [configure-gdb] Error 1 make[1]: Leaving directory '/home/pedro/brno/pedro/gdb/mygit/cxx-convertion/build-gcc-4.7' If we need to revert back to making C++11 optional, all that's necessary is to change the "mandatory" to "optional" in configure.ac and regenerate configure (both gdb and gdbserver). gdb/ChangeLog: 2016-10-28 Pedro Alves <palves@redhat.com> * Makefile.in (CXX_DIALECT): Get from configure. (COMPILE.pre, CC_LD): Append $(CXX_DIALECT). (FLAGS_TO_PASS): Pass CXX_DIALECT. * acinclude.m4: Include ax_cxx_compile_stdcxx.m4. * ax_cxx_compile_stdcxx.m4: Add FSF copyright header. Set and AC_SUBST CXX_DIALECT instead of changing CXX/CXXCPP. * configure.ac: Call AX_CXX_COMPILE_STDCXX. * config.in: Regenerate. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2016-10-28 Pedro Alves <palves@redhat.com> * Makefile.in (CXX_DIALECT): Get from configure. (COMPILE.pre, CC_LD): Append $(CXX_DIALECT). * acinclude.m4: Include ../ax_cxx_compile_stdcxx.m4. * configure.ac: Call AX_CXX_COMPILE_STDCXX. * config.in: Regenerate. * configure: Regenerate.
2016-10-13 01:27:45 +02:00
2016-10-28 Pedro Alves <palves@redhat.com>
* Makefile.in (CXX_DIALECT): Get from configure.
(COMPILE.pre, CC_LD): Append $(CXX_DIALECT).
* acinclude.m4: Include ../ax_cxx_compile_stdcxx.m4.
* configure.ac: Call AX_CXX_COMPILE_STDCXX.
* config.in: Regenerate.
* configure: Regenerate.
2016-10-27 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_supports_range_stepping): Return true if
can_software_single_step return true.
2016-10-27 Yao Qi <yao.qi@linaro.org>
* inferiors.c (find_inferior_in_random): New function.
* inferiors.h (find_inferior_in_random): Declare.
* linux-low.c (linux_wait_for_event_filtered): Call
find_inferior_in_random instead of find_inferior.
2016-10-27 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_wait_1): If single-step breakpoints are
inserted, remove them.
gdbserver: Leave already-vCont-resumed threads as they were Currently GDB never sends more than one action per vCont packet, when connected in non-stop mode. A follow up patch will change that, and it exposed a gdbserver problem with the vCont handling. For example, this in non-stop mode: => vCont;s:p1.1;c <= OK Should be equivalent to: => vCont;s:p1.1 <= OK => vCont;c <= OK But gdbserver currently doesn't handle this. In the latter case, "vCont;c" makes gdbserver clobber the previous step request. This patch fixes that. Note the server side must ignore resume actions for the thread that has a pending %Stopped notification (and any other threads with events pending), until GDB acks the notification with vStopped. Otherwise, e.g., the following case is mishandled: #1 => g (or any other packet) #2 <= [registers] #3 <= %Stopped T05 thread:p1.2 #4 => vCont s:p1.1;c #5 <= OK Above, the server must not resume thread p1.2 when it processes the vCont. GDB can't know that p1.2 stopped until it acks the %Stopped notification. (Otherwise it wouldn't send a default "c" action.) (The vCont documentation already specifies this.) Finally, special care must also be given to handling fork/vfork events. A (v)fork event actually tells us that two processes stopped -- the parent and the child. Until we follow the fork, we must not resume the child. Therefore, if we have a pending fork follow, we must not send a global wildcard resume action (vCont;c). We can still send process-wide wildcards though. (The comments above will be added as code comments to gdb in a follow up patch.) gdb/gdbserver/ChangeLog: 2016-10-26 Pedro Alves <palves@redhat.com> * linux-low.c (handle_extended_wait): Link parent/child fork threads. (linux_wait_1): Unlink them. (linux_set_resume_request): Ignore resume requests for already-resumed and unhandled fork child threads. * linux-low.h (struct lwp_info) <fork_relative>: New field. * server.c (in_queued_stop_replies_ptid, in_queued_stop_replies): New functions. (handle_v_requests) <vCont>: Don't call require_running. * server.h (in_queued_stop_replies): New declaration.
2016-10-26 17:17:25 +02:00
2016-10-26 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Link parent/child fork
threads.
(linux_wait_1): Unlink them.
(linux_set_resume_request): Ignore resume requests for
already-resumed and unhandled fork child threads.
* linux-low.h (struct lwp_info) <fork_relative>: New field.
* server.c (in_queued_stop_replies_ptid, in_queued_stop_replies):
New functions.
(handle_v_requests) <vCont>: Don't call require_running.
* server.h (in_queued_stop_replies): New declaration.
2016-10-24 Yao Qi <yao.qi@linaro.org>
PR server/20733
* linux-aarch64-low.c (append_insns): Cast the return value to
'uint32_t *'.
2016-10-10 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c (enum arm_breakpoint_kinds): Remove.
2016-10-06 Sergio Durigan Junior <sergiodj@redhat.com>
* target.c (target_supports_multi_process): New function, moved
from...
* target.h (target_supports_multi_process): ... here. Remove
macro.
2016-10-05 Tom Tromey <tom@tromey.com>
PR remote/20655:
* tracepoint.c (handle_tracepoint_bkpts): Check
ipa_error_tracepoint, not ipa_stopping_tracepoint.
2016-10-05 Yao Qi <yao.qi@linaro.org>
* configure.srv: Update the path of arm-*.xml files.
Clean up the XML files for ARM This patch is move features/arm-*.xml to features/arm/, and it is based on Terry's patch posted here https://sourceware.org/ml/gdb-patches/2014-06/msg00794.html One comment to Terry's patch is about losing "arm" prefix, and the new patch fixes this problem. gdb: 2016-10-05 Terry Guo <terry.guo@arm.com> Yao Qi <yao.qi@linaro.org> * arm-tdep.c: Adjust includes. * features/Makefile (WHICH): Add "arm/" directory to arm target descriptions. (XMLTOC): Likewise. (arm/arm-with-iwmmxt.dat): Adjust the path for dependencies. * features/arm-core.xml: Moved to ... * features/arm/arm-core.xml: ... it. * features/arm-fpa.xml: Moved to ... * features/arm/arm-fpa.xml: ... it. * features/arm-m-profile.xml: Moved to ... * features/arm/arm-m-profile.xm: ... it. * features/arm-vfpv2.xml: Moved to ... * features/arm/arm-vfpv2.xm: ... it. * features/arm-vfpv3.xml: Moved to ... * features/arm/arm-vfpv3.xml: ... it. * features/arm-with-iwmmxt.c: Moved to ... * features/arm/arm-with-iwmmxt.c: ... it. * features/arm-with-iwmmxt.xml: Moved to ... * features/arm/arm-with-iwmmxt.xml: ... it. * features/arm-with-m-fpa-layout.c: Moved to ... * features/arm/arm-with-m-fpa-layout.c: ... it. * features/arm-with-m-fpa-layout.xml: Moved to ... * features/arm/arm-with-m-fpa-layout.xml: ... it. * features/arm-with-m-vfp-d16.c: Moved to ... * features/arm/arm-with-m-vfp-d16.c: ... it. * features/arm-with-m-vfp-d16.xml: Moved to ... * features/arm/arm-with-m-vfp-d16.xml: ... it. * features/arm-with-m.c: Moved to ... * features/arm/arm-with-m.c: ... it. * features/arm-with-m.xml: Moved to ... * features/arm/arm-with-m.xm: ... it. * features/arm-with-neon.c: Moved to ... * features/arm/arm-with-neon.c: ... it. * features/arm-with-neon.xml: Moved to ... * features/arm/arm-with-neon.xml: ... it. * features/arm-with-vfpv2.c: Moved to ... * features/arm/arm-with-vfpv2.c: ... it. * features/arm-with-vfpv2.xml: Moved to ... * features/arm/arm-with-vfpv2.xml: ... it. * features/arm-with-vfpv3.c: Moved to ... * features/arm/arm-with-vfpv3.c: ... it. * features/arm-with-vfpv3.xml: Moved to ... * features/arm/arm-with-vfpv3.xml: ... it. * features/xscale-iwmmxt.xml: Moved to ... * features/arm/xscale-iwmmxt.xml: ... it. gdb/gdbserver: 2016-10-05 Terry Guo <terry.guo@arm.com> Yao Qi <yao.qi@linaro.org> * Makefile.in: Adjust the path of rules. * configure.srv: Update the path of xml files. * regformats/arm-with-iwmmxt.dat: Regenerated. * regformats/arm-with-neon.dat: Likewise. * regformats/arm-with-vfpv2.dat: Likewise. * regformats/arm-with-vfpv3.dat Likewise.
2016-10-05 10:31:13 +02:00
2016-10-05 Terry Guo <terry.guo@arm.com>
Yao Qi <yao.qi@linaro.org>
* Makefile.in: Adjust the path of rules.
* configure.srv: Update the path of xml files.
* regformats/arm-with-iwmmxt.dat: Regenerated.
* regformats/arm-with-neon.dat: Likewise.
* regformats/arm-with-vfpv2.dat: Likewise.
* regformats/arm-with-vfpv3.dat Likewise.
2016-09-30 Yao Qi <yao.qi@linaro.org>
PR gdbserver/20627
* target.c (target_stop_and_wait): Don't call
target_continue_no_signal, use resume_stop instead.
2016-09-26 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_wait_1): Call debug_exit.
gdb: Replace operator new / operator new[] If xmalloc fails allocating memory, usually because something tried a huge allocation, like xmalloc(-1) or some such, GDB asks the user what to do: .../src/gdb/utils.c:1079: internal-error: virtual memory exhausted. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) If the user says "n", that throws a QUIT exception, which is caught by one of the multiple CATCH(RETURN_MASK_ALL) blocks somewhere up the stack. The default implementations of operator new / operator new[] call malloc directly, and on memory allocation failure throw std::bad_alloc. Currently, if that happens, since nothing catches it, the exception escapes out of main, and GDB aborts from unhandled exception. This patch replaces the default operator new variants with versions that, just like xmalloc: #1 - Raise an internal-error on memory allocation failure. #2 - Throw a QUIT gdb_exception, so that the exact same CATCH blocks continue handling memory allocation problems. A minor complication of #2 is that operator new can _only_ throw std::bad_alloc, or something that extends it: void* operator new (std::size_t size) throw (std::bad_alloc); That means that if we let a gdb QUIT exception escape from within operator new, the C++ runtime aborts due to unexpected exception thrown. So to bridge the gap, this patch adds a new gdb_quit_bad_alloc exception type that inherits both std::bad_alloc and gdb_exception, and throws _that_. If we decide that we should be catching memory allocation errors in fewer places than all the places we currently catch them (everywhere we use RETURN_MASK_ALL currently), then we could change operator new to throw plain std::bad_alloc then. But I'm considering such a change as separate matter from this one -- it'd make sense to do the same to xmalloc at the same time, for instance. Meanwhile, this allows using new/new[] instead of xmalloc/XNEW/etc. without losing the "virtual memory exhausted" internal-error safeguard. Tested on x86_64 Fedora 23. gdb/ChangeLog: 2016-09-23 Pedro Alves <palves@redhat.com> * Makefile.in (SFILES): Add common/new-op.c. (COMMON_OBS): Add common/new-op.o. (new-op.o): New rule. * common/common-exceptions.h: Include <new>. (struct gdb_quit_bad_alloc): New type. * common/new-op.c: New file. gdb/gdbserver/ChangeLog: 2016-09-23 Pedro Alves <palves@redhat.com> * Makefile.in (SFILES): Add common/new-op.c. (OBS): Add common/new-op.o. (new-op.o): New rule.
2016-09-23 17:42:24 +02:00
2016-09-23 Pedro Alves <palves@redhat.com>
* Makefile.in (SFILES): Add common/new-op.c.
(OBS): Add common/new-op.o.
(new-op.o): New rule.
2016-09-21 Simon Marchi <simon.marchi@ericsson.com>
* .gitinore: Ignore more files.
2016-09-21 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c (arm_fill_gregset): Keep bits 20 to
23.
Consolidate target_mourn_inferior between GDB and gdbserver This patch consolidates the API of target_mourn_inferior between GDB and gdbserver, in my continuing efforts to make sharing the fork_inferior function possible between both. GDB's version of the function did not care about the inferior's ptid being mourned, but gdbserver's needed to know this information. Since it actually makes sense to pass the ptid as an argument, instead of depending on a global value directly (which GDB's version did), I decided to make the generic API to accept it. I then went on and extended all calls being made on GDB to include a ptid argument (which ended up being inferior_ptid most of the times, anyway), and now we have a more sane interface. On GDB's side, after talking to Pedro a bit about it, we decided that just an assertion to make sure that the ptid being passed is equal to inferior_ptid would be enough for now, on the GDB side. We can remove the assertion and perform more operations later if we ever pass anything different than inferior_ptid. Regression tested on our BuildBot, everything OK. I'd appreciate a special look at gdb/windows-nat.c's modification because I wasn't really sure what to do there. It seemed to me that maybe I should build a ptid out of the process information there, but then I am almost sure the assertion on GDB's side would trigger. gdb/ChangeLog: 2016-09-19 Sergio Durigan Junior <sergiodj@redhat.com> * darwin-nat.c (darwin_kill_inferior): Adjusting call to target_mourn_inferior to include ptid_t argument. * fork-child.c (startup_inferior): Likewise. * gnu-nat.c (gnu_kill_inferior): Likewise. * inf-ptrace.c (inf_ptrace_kill): Likewise. * infrun.c (handle_inferior_event_1): Likewise. * linux-nat.c (linux_nat_attach): Likewise. (linux_nat_kill): Likewise. * nto-procfs.c (interrupt_query): Likewise. (procfs_interrupt): Likewise. (procfs_kill_inferior): Likewise. * procfs.c (procfs_kill_inferior): Likewise. * record.c (record_mourn_inferior): Likewise. * remote-sim.c (gdbsim_kill): Likewise. * remote.c (remote_detach_1): Likewise. (remote_kill): Likewise. * target.c (target_mourn_inferior): Change declaration to accept new ptid_t argument; use gdb_assert on it. * target.h (target_mourn_inferior): Move function prototype from here... * target/target.h (target_mourn_inferior): ... to here. Adjust it to accept new ptid_t argument. * windows-nat.c (get_windows_debug_event): Adjusting call to target_mourn_inferior to include ptid_t argument. gdb/gdbserver/ChangeLog: 2016-09-19 Sergio Durigan Junior <sergiodj@redhat.com> * server.c (start_inferior): Call target_mourn_inferior instead of mourn_inferior; pass ptid_t argument to it. (resume): Likewise. (handle_target_event): Likewise. * target.c (target_mourn_inferior): New function. * target.h (mourn_inferior): Delete macro.
2016-09-12 05:45:31 +02:00
2016-09-19 Sergio Durigan Junior <sergiodj@redhat.com>
* server.c (start_inferior): Call target_mourn_inferior instead of
mourn_inferior; pass ptid_t argument to it.
(resume): Likewise.
(handle_target_event): Likewise.
* target.c (target_mourn_inferior): New function.
* target.h (mourn_inferior): Delete macro.
2016-09-16 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-low.c (lwp_is_stepping): New function.
2016-09-06 Carl Love <cel@us.ibm.com>
* server.c (start_inferior): Fixed comment, requested comment change
didn't get updated correctly. Removed reference to ptrace () call as
it is only true on Linux systems.
2016-09-06 Carl Love <cel@us.ibm.com>
* server.c (start_inferior): Do not call
function target_post_create_inferior () if the
inferior process has already exited.
2016-09-05 Pedro Alves <palves@redhat.com>
* Makefile.in (COMPILER, COMPILER_CFLAGS): Remove.
(COMPILE.pre, CC_LD): Use CXX directly.
(INTERNAL_CFLAGS_BASE): Use CXXFLAGS directly.
* acinclude.m4: Don't include build-with-cxx.m4.
* configure.ac: Remove GDB_AC_BUILD_WITH_CXX call.
* configure: Regenerate.
2016-09-02 Akash Trehan <akash.trehan123@gmail.com>
PR gdb/19495
* remote-utils.c (relocate_instruction): Remove redundant strcpy()
call writing data to own_buf.
2016-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
* target.c (mywait): Call target_wait instead of
the_target->wait.
(target_wait): New function.
2016-09-01 Sergio Durigan Junior <sergiodj@redhat.com>
* server.c (start_inferior): New variable 'ptid'. Replace calls
to the_target->resume by target_continue{,_no_signal}, depending
on the case.
* target.c (target_stop_and_wait): Call target_continue_no_signal
instead of the_target->resume.
(target_continue): New function.
2016-08-31 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c (linux_wait_1): Move event switch after unsuspend_lwps.
Sync proc_service definition with GLIBC GLIBC BZ#20311 [1] proc_service.h install patch also remove 'const' attributes from ps_get_thread_area and comment #15 discuss why to remove the const attribute (basically since it a callback with the struct ps_prochandle owned by the client it should be able to modify it if it the case). On default build this is not the issue and current g++ does not trigger any issue with this mismatch declaration. However, on some bootstrap build configuration where gdbserver is build with gcc instead this triggers: error: conflicting types for 'ps_get_thread_area' This patch fixes it by syncing the declaration with GLIBC. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=20311 gdb/ChangeLog: 2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org> * aarch64-linux-nat.c (ps_get_thread_area): Remove const from struct ps_prochandle. * amd64-linux-nat.c (ps_get_thread_area): Likewise. * arm-linux-nat.c (ps_get_thread_area): Likewise. * gdb_proc_service.h (ps_get_thread_area): Likewise. * i386-linux-nat.c (ps_get_thread_area): Likewise. * m68klinux-nat.c (ps_get_thread_area): Likewise. * mips-linux-nat.c (ps_get_thread_area): Likewise. * nat/aarch64-linux.c (aarch64_ps_get_thread_area): Likewise. * nat/aarch64-linux.h (aarch64_ps_get_thread_area): Likewise. * xtensa-linux-nat.c (ps_get_thread_area): Likewise. gdb/gdbserver/ChangeLog: 2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org> PR server/20491 * gdb_proc_service.h (ps_get_thread_area): Remove const from struct ps_prochandle. * linux-aarch64-low.c (ps_get_thread_area): Likewise. * linux-arm-low.c (ps_get_thread_area): Likewise. * linux-crisv32-low.c (ps_get_thread_area): Likewise. * linux-m68k-low.c (ps_get_thread_area): Likewise. * linux-mips-low.c (ps_get_thread_area): Likewise. * linux-nios2-low.c (ps_get_thread_area): Likewise. * linux-tic6x-low.c (ps_get_thread_area): Likewise. * linux-x86-low.c (ps_get_thread_area): Likewise. * linux-xtensa-low.c (ps_get_thread_area): Likewise.
2016-08-25 09:42:03 +02:00
2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org>
PR server/20491
* gdb_proc_service.h (ps_get_thread_area): Remove const from struct
ps_prochandle.
* linux-aarch64-low.c (ps_get_thread_area): Likewise.
* linux-arm-low.c (ps_get_thread_area): Likewise.
* linux-crisv32-low.c (ps_get_thread_area): Likewise.
* linux-m68k-low.c (ps_get_thread_area): Likewise.
* linux-mips-low.c (ps_get_thread_area): Likewise.
* linux-nios2-low.c (ps_get_thread_area): Likewise.
* linux-tic6x-low.c (ps_get_thread_area): Likewise.
* linux-x86-low.c (ps_get_thread_area): Likewise.
* linux-xtensa-low.c (ps_get_thread_area): Likewise.
2016-08-19 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (amd64_emit_call): Emit missing call opcode.
2016-08-19 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Fix
comment. Use memcpy instead of casting through unsigned long.
2016-08-19 Pedro Alves <palves@redhat.com>
* linux-amd64-ipa.c (alloc_jump_pad_buffer) [__ILP32__]: Try
allocating around 0x80000000.
2016-08-19 Pedro Alves <palves@redhat.com>
PR gdb/20415
* Makefile.in (x32-linux-ipa.o, x32-avx-linux-ipa.o)
(x32-avx512-linux-ipa.o): New rules.
* configure.ac (x86_64-*-linux*): New x32 check.
* configure.srv (ipa_x32_linux_regobj): New.
(x86_64-*-linux*): Use $ipa_x32_linux_regobj if building for x32.
* linux-amd64-ipa.c (get_ipa_tdesc) [__ILP32__]: Return x32
descriptions.
(initialize_low_tracepoint) [__ILP32__]: Initialize x32
descriptions.
* configure: Regenerate.
Fix PR gdb/18653: gdb disturbs inferior's inherited signal dispositions gdb's (or gdbserver's) own signal handling should not interfere with the signal dispositions their spawned children inherit. However, it currently does. For example, some paths in gdb cause SIGPIPE to be set to SIG_IGN, and as consequence, the child starts with SIGPIPE to set to SIG_IGN too, even though gdb was started with SIGPIPE set to SIG_DFL. This is because the exec family of functions does not reset the signal disposition of signals that are set to SIG_IGN: http://pubs.opengroup.org/onlinepubs/7908799/xsh/execve.html Signals set to the default action (SIG_DFL) in the calling process image are set to the default action in the new process image. Signals set to be ignored (SIG_IGN) by the calling process image are set to be ignored by the new process image. Signals set to be caught by the calling process image are set to the default action in the new process image (see <signal.h>). And neither does it reset signal masks or flags. In order to be transparent, when spawning new child processes to debug (with "run", etc.), reset signal actions and mask back to what was originally inherited from gdb/gdbserver's parent, just before execing the target program to debug. gdb/ChangeLog: 2016-08-09 Pedro Alves <palves@redhat.com> PR gdb/18653 * Makefile.in (SFILES): Add common/signals-state-save-restore.c. (HFILES_NO_SRCDIR): Add common/signals-state-save-restore.h. (COMMON_OBS): Add signals-state-save-restore.o. (signals-state-save-restore.o): New rule. * configure: Regenerate. * fork-child.c: Include "signals-state-save-restore.h". (fork_inferior): Call restore_original_signals_state. * main.c: Include "signals-state-save-restore.h". (captured_main): Call save_original_signals_state. * common/common.m4: Add sigaction to AC_CHECK_FUNCS checks. * common/signals-state-save-restore.c: New file. * common/signals-state-save-restore.h: New file. gdb/gdbserver/ChangeLog: 2016-08-09 Pedro Alves <palves@redhat.com> PR gdb/18653 * Makefile.in (OBS): Add signals-state-save-restore.o. (signals-state-save-restore.o): New rule. * config.in: Regenerate. * configure: Regenerate. * linux-low.c: Include "signals-state-save-restore.h". (linux_create_inferior): Call restore_original_signals_state. * server.c: Include "dispositions-save-restore.h". (captured_main): Call save_original_signals_state. gdb/testsuite/ChangeLog: 2016-08-09 Pedro Alves <palves@redhat.com> PR gdb/18653 * gdb.base/signals-state-child.c: New file. * gdb.base/signals-state-child.exp: New file. * gdb.gdb/selftest.exp (do_steps_and_nexts): Add new pattern.
2016-08-09 21:16:20 +02:00
2016-08-09 Pedro Alves <palves@redhat.com>
PR gdb/18653
* Makefile.in (OBS): Add signals-state-save-restore.o.
(signals-state-save-restore.o): New rule.
* config.in: Regenerate.
* configure: Regenerate.
* linux-low.c: Include "signals-state-save-restore.h".
(linux_create_inferior): Call
restore_original_signals_state.
* server.c: Include "dispositions-save-restore.h".
(captured_main): Call save_original_signals_state.
2016-08-05 Pedro Alves <palves@redhat.com>
* configure: Regenerate.
Quiet ptrace error ESRCH in regsets_fetch_inferior_registers When I run process-dies-while-detaching.exp with GDBserver, I see many warnings printed by GDBserver, ptrace(regsets_fetch_inferior_registers) PID=26183: No such process ptrace(regsets_fetch_inferior_registers) PID=26183: No such process ptrace(regsets_fetch_inferior_registers) PID=26184: No such process ptrace(regsets_fetch_inferior_registers) PID=26184: No such process regsets_fetch_inferior_registers is called when GDBserver resumes each lwp. #2 0x0000000000428260 in regsets_fetch_inferior_registers (regsets_info=0x4690d0 <aarch64_regsets_info>, regcache=0x31832020) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:5412 #3 0x00000000004070e8 in get_thread_regcache (thread=0x31832940, fetch=fetch@entry=1) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/regcache.c:58 #4 0x0000000000429c40 in linux_resume_one_lwp_throw (info=<optimized out>, signal=0, step=0, lwp=0x31832830) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:4463 #5 linux_resume_one_lwp (lwp=0x31832830, step=<optimized out>, signal=<optimized out>, info=<optimized out>) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:4573 The is the case that threads are disappeared when GDB/GDBserver resumes them. We check errno for ESRCH, and don't print error messages, like what we are doing in regsets_store_inferior_registers. gdb/gdbserver: 2016-08-04 Yao Qi <yao.qi@linaro.org> * linux-low.c (regsets_fetch_inferior_registers): Check errno is ESRCH or not.
2016-08-04 11:44:18 +02:00
2016-08-04 Yao Qi <yao.qi@linaro.org>
* linux-low.c (regsets_fetch_inferior_registers): Check
errno is ESRCH or not.
2016-08-02 Yao Qi <yao.qi@linaro.org>
* thread-db.c (struct thread_db) <td_ta_event_getmsg_p>: Remove.
<td_ta_set_event_p, td_ta_event_addr_p>: Remove.
(thread_db_load_search): Update.
(try_thread_db_load_1): Don't look for td_ta_event_addr,
td_ta_set_event and td_ta_event_getmsg.
2016-07-26 Pedro Alves <palves@redhat.com>
PR server/20414
* linux-x86-low.c (x86_get_pc, x86_set_pc): Use uint64_t instead
of unsigned long for 64-bit registers and use uint32_t instead of
unsigned int for 32-bit registers.
Fix PR gdb/20287 - x32 and "gdb_static_assert (sizeof (nat_siginfo_t) == sizeof (siginfo_t))" Building an x32 gdb trips on a static assertion: In file included from .../src/gdb/common/common-defs.h:71:0, from .../src/gdb/nat/amd64-linux-siginfo.c:21: .../src/gdb/common/gdb_assert.h:26:66: error: size of array ‘never_defined_just_used_for_checking’ is negative extern int never_defined_just_used_for_checking[(expr) ? 1 : -1] ^ .../src/gdb/nat/amd64-linux-siginfo.c:113:1: note: in expansion of macro ‘gdb_static_assert’ gdb_static_assert (sizeof (nat_siginfo_t) == sizeof (siginfo_t)); ^ The problem is that the way nat_siginfo_t is defined, it can only match the host's siginfo_t object when gdb is built as a 64-bit program. Several bits of nat_siginfo_t are off: - nat_siginfo_t's _pad field's definition is: int _pad[((128 / sizeof (int)) - 4)]; while /usr/include/bits/siginfo.h has: # define __SI_MAX_SIZE 128 # if __WORDSIZE == 64 # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) # else # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) # endif and __WORDSIZE == 32 for x32. This is what causes the size of nat_siginfo_t to be wrong and the assertion to fail. - the nat_clock_t type is incorrect for 64-bit. We have this: /* For native 64-bit, clock_t in _sigchld is 64bit aligned at 4 bytes. */ typedef long __attribute__ ((__aligned__ (4))) nat_clock_t; however, /usr/include/bits/siginfo.h has: # if defined __x86_64__ && __WORDSIZE == 32 /* si_utime and si_stime must be 4 byte aligned for x32 to match the kernel. We align siginfo_t to 8 bytes so that si_utime and si_stime are actually aligned to 8 bytes since their offsets are multiple of 8 bytes. */ typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t; # define __SI_ALIGNMENT __attribute__ ((__aligned__ (8))) # else typedef __clock_t __sigchld_clock_t; # define __SI_ALIGNMENT # endif So we're currently forcing 4-byte alignment on clock_t, when it should only be so for x32, not 64-bit. The fix: - Leaves nat_siginfo_t strictly for the 64-bit ABI. - Adds a new typedef for the siginfo type that ptrace uses (ptrace_siginfo_t). An x32 gdb always gets/sets an x32 siginfo_t type with PTRACE_GETSIGINFO/PTRACE_SETSIGINFO. - Uses this new ptrace_siginfo_t type instead of nat_siginfo_t as the intermediate conversion type. gdb/ChangeLog: 2016-07-26 Pedro Alves <palves@redhat.com> * amd64-linux-nat.c (amd64_linux_siginfo_fixup): Rename 'native' parameter to 'ptrace'. * nat/amd64-linux-siginfo.c (GDB_SI_SIZE): New define. (nat_uptr_t): New an unsigned long. (nat_clock_t): Remove attribute __aligned__. (struct nat_timeval): Delete. (nat_siginfo_t): Remove attribute __aligned__. (ptrace_siginfo_t): Define. (compat_siginfo_from_siginfo, siginfo_from_compat_siginfo) (compat_x32_siginfo_from_siginfo) (siginfo_from_compat_x32_siginfo): Make 'from' parameter const. Convert through a ptrace_siginfo_t instead of a nat_siginfo_t. Remove casts. (amd64_linux_siginfo_fixup_common): Rename 'native' parameter to 'ptrace'. Remove static assertions. (top level): New static assertions. gdb/gdbserver/ChangeLog: 2016-07-26 Pedro Alves <palves@redhat.com> * linux-x86-low.c (x86_siginfo_fixup): Rename 'native' parameter to 'ptrace'.
2016-07-26 20:35:40 +02:00
2016-07-26 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (x86_siginfo_fixup): Rename 'native' parameter
to 'ptrace'.
2016-07-21 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
2016-07-21 Yao Qi <yao.qi@linaro.org>
* mem-break.c (find_gdb_breakpoint): Cast bp to
'struct gdb_breakpoint *' rather than 'gdb_breakpoint *'.
2016-07-21 Yao Qi <yao.qi@linaro.org>
* server.c (handle_v_requests): Support s and S actions
if target_supports_software_single_step return true.
2016-07-21 Yao Qi <yao.qi@linaro.org>
* linux-low.c (resume_stopped_resumed_lwps): If resume request
is resume_step, call maybe_hw_step.
(linux_wait_1): Stop all threads, remove reinsert breakpoints,
and unstop them.
(linux_resume_one_lwp_throw): Don't assert the thread has reinsert
breakpoints or not.
(proceed_one_lwp): If resume request is resume_step, install
reinsert breakpoints and call maybe_hw_step.
2016-07-21 Yao Qi <yao.qi@linaro.org>
* linux-low.c (proceed_one_lwp): Declare.
(linux_resume_one_thread): Remove local variable 'step'.
Lift code enqueue signal. Call proceed_one_lwp instead of
linux_resume_one_lwp.
2016-07-21 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_resume_one_thread): Call
enqueue_pending_signal.
2016-07-21 Yao Qi <yao.qi@linaro.org>
* gdbthread.h (make_cleanup_restore_current_thread): Declare.
* inferiors.c (do_restore_current_thread_cleanup): New function.
(make_cleanup_restore_current_thread): Likewise.
* linux-low.c (install_software_single_step_breakpoints): Call
make_cleanup_restore_current_thread. Switch current_thread to
thread.
Make reinsert_breakpoint thread specific This patch makes reinsert_breakpoint thread specific, which means we insert and remove reinsert_breakpoint breakpoints for a specific thread. This motivation of this change is that I'll use reinsert_breakpoint for vCont;s on software single step target, so that GDBserver may insert one reinsert_breakpoint for one thread doing step-over, and insert one reinsert_breakpoint for another thread doing vCont;s. After the operation of one thread is finished, GDBserver must remove reinsert_breakpoint for that thread only. On the other hand, reinsert_breakpoint is used for step-over nowadays. GDBserver inserts reinsert_breakpoint, and wait only from the thread doing step-over. After the step-over is done, GDBserver removes the reinsert_breakpoint. If there is still any threads need step-over, do the same again until all threads are finished step-over. In other words, reinsert_breakpoint is globally thread specific, but in an implicit way. It is natural to make it explicitly thread specific. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * mem-break.c (struct reinsert_breakpoint) <ptid>: New field. (set_reinsert_breakpoint): New parameter ptid. Callers updated. (clone_one_breakpoint): Likewise. (delete_reinsert_breakpoints): Change parameter to thread. Callers updated. (has_reinsert_breakpoints): Likewise. (uninsert_reinsert_breakpoints): Likewise. (reinsert_reinsert_breakpoints): Likewise. * mem-break.h (set_reinsert_breakpoint): Update declaration. (delete_reinsert_breakpoints): Likewise. (reinsert_reinsert_breakpoints): Likewise. (uninsert_reinsert_breakpoints): Likewise. (has_reinsert_breakpoints): Likewise.
2016-07-21 13:12:18 +02:00
2016-07-21 Yao Qi <yao.qi@linaro.org>
* mem-break.c (struct reinsert_breakpoint) <ptid>: New field.
(set_reinsert_breakpoint): New parameter ptid. Callers updated.
(clone_one_breakpoint): Likewise.
(delete_reinsert_breakpoints): Change parameter to thread.
Callers updated.
(has_reinsert_breakpoints): Likewise.
(uninsert_reinsert_breakpoints): Likewise.
(reinsert_reinsert_breakpoints): Likewise.
* mem-break.h (set_reinsert_breakpoint): Update declaration.
(delete_reinsert_breakpoints): Likewise.
(reinsert_reinsert_breakpoints): Likewise.
(uninsert_reinsert_breakpoints): Likewise.
(has_reinsert_breakpoints): Likewise.
2016-07-21 Yao Qi <yao.qi@linaro.org>
* inferiors.c (get_thread_process): Make parameter const.
* inferiors.h (get_thread_process): Update declaration.
* mem-break.c (clone_all_breakpoints): Remove all parameters.
Add new parameters child_thread and parent_thread. Callers
updated.
* mem-break.h (clone_all_breakpoints): Update declaration.
Create sub classes of 'struct breakpoint' Nowadays, there are three types of breakpoint in GDBserver, - gdb breakpoints, - reinsert breakpoints, used for software single step, - other breakpoints, used for tracepoint, but we only have one 'struct breakpoint' for all of them. Some fields are only useful to one type of breakpoint. For example, cond_list and command_list are only used by gdb breakpoints, while handler is only used by other breakpoints. This patch changes 'struct breakpoint' to a base class, which has fields needed by all breakpoint types, also add three sub-classes to 'struct breakpoint' to these three types of breakpoints. gdb/gdbserver: 2016-07-21 Yao Qi <yao.qi@linaro.org> * mem-break.c (struct breakpoint) <cond_list>: Remove. <command_list, handler>: Remove. (struct gdb_breakpoint): New. (struct other_breakpoint): New. (struct reinsert_breakpoint): New. (is_gdb_breakpoint): New function. (any_persistent_commands): Update command_list if is_gdb_breakpoint returns true. (set_breakpoint): Create breakpoints according to their types. (find_gdb_breakpoint): Return 'struct gdb_breakpoint *'. (set_gdb_breakpoint_1): Likewise. (set_gdb_breakpoint): Likewise. (clear_breakpoint_conditions): Change parameter type to 'struct gdb_breakpoint *'. (clear_breakpoint_commands): Likewise. (clear_breakpoint_conditions_and_commands): Likewise. (add_condition_to_breakpoint): Likewise. (add_breakpoint_condition): Likewise. (add_commands_to_breakpoint): Likewise. (check_breakpoints): Check other_breakpoint. (clone_one_breakpoint): Clone breakpopint according to its type. * mem-break.h (struct gdb_breakpoint): Declare. (set_gdb_breakpoint): Update declaration. (clear_breakpoint_conditions_and_commands): Likewise. (add_breakpoint_condition): Likewise. (add_breakpoint_commands): Likewise. * server.c (process_point_options): Change parameter type to 'struct gdb_breakpoint *'.
2016-07-21 13:12:17 +02:00
2016-07-21 Yao Qi <yao.qi@linaro.org>
* mem-break.c (struct breakpoint) <cond_list>: Remove.
<command_list, handler>: Remove.
(struct gdb_breakpoint): New.
(struct other_breakpoint): New.
(struct reinsert_breakpoint): New.
(is_gdb_breakpoint): New function.
(any_persistent_commands): Update command_list if
is_gdb_breakpoint returns true.
(set_breakpoint): Create breakpoints according to their types.
(find_gdb_breakpoint): Return 'struct gdb_breakpoint *'.
(set_gdb_breakpoint_1): Likewise.
(set_gdb_breakpoint): Likewise.
(clear_breakpoint_conditions): Change parameter type to
'struct gdb_breakpoint *'.
(clear_breakpoint_commands): Likewise.
(clear_breakpoint_conditions_and_commands): Likewise.
(add_condition_to_breakpoint): Likewise.
(add_breakpoint_condition): Likewise.
(add_commands_to_breakpoint): Likewise.
(check_breakpoints): Check other_breakpoint.
(clone_one_breakpoint): Clone breakpopint according to its type.
* mem-break.h (struct gdb_breakpoint): Declare.
(set_gdb_breakpoint): Update declaration.
(clear_breakpoint_conditions_and_commands): Likewise.
(add_breakpoint_condition): Likewise.
(add_breakpoint_commands): Likewise.
* server.c (process_point_options): Change parameter type to
'struct gdb_breakpoint *'.
2016-07-21 Yao Qi <yao.qi@linaro.org>
* mem-break.c (set_breakpoint_at): Rename it to ...
(set_breakpoint_type_at): ... it.
(set_breakpoint_at): Call set_breakpoint_type_at.
(set_reinsert_breakpoint): Call set_breakpoint_type_at.
* mem-break.h (set_breakpoint_at): Update comments.
2016-07-12 Chung-Lin Tang <cltang@codesourcery.com>
* linux-nios2-low.c (nios2_fill_gregset): Add type cast
to buf parameter.
(nios2_store_gregset): Likewise.
Fix failure to detach if process exits while detaching on Linux This commit fixes detaching on Linux when some thread exits the whole thread group (process) just while we're detaching. On Linux, a ptracer must detach from each LWP individually, with PTRACE_DETACH. Since PTRACE_DETACH sets the thread running free, if one of the already-detached threads causes the whole thread group to exit (e.g., simply calls exit), the kernel force-kills the other threads in the group, making them zombie, just as we're still detaching them. Since PTRACE_DETACH against a zombie thread fails with ESRCH, and gdb/gdbserver are not expecting this, the detach fails with an error like: "Can't detach process: No such process.". This patch detects this detach failure as normal, and instead of erroring out, reaps the now-dead thread. New test included, that exercises several different scenarios that cause GDB/GDBserver to error out when it should not. Tested on x86-64 GNU/Linux with {unix, native-gdbserver, native-extended-gdbserver} Note: without the previous fix, the "single-process + continue" variant of the new test would fail with: (gdb) PASS: gdb.threads/process-dies-while-detaching.exp: single-process: continue: watchpoint: switch to parent continue Continuing. Warning: Could not insert hardware watchpoint 3. Could not insert hardware breakpoints: You may have requested too many hardware breakpoints/watchpoints. Command aborted. (gdb) FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: continue: watchpoint: continue gdb/gdbserver/ChangeLog: 2016-07-01 Pedro Alves <palves@redhat.com> Antoine Tremblay <antoine.tremblay@ericsson.com> * linux-low.c: Change interface to take the target lwp_info pointer directly and return void. Handle detaching from a zombie thread. (linux_detach_lwp_callback): New function. (linux_detach): Detach from the leader thread after detaching from the clone threads. gdb/ChangeLog: 2016-07-01 Pedro Alves <palves@redhat.com> Antoine Tremblay <antoine.tremblay@ericsson.com> * inf-ptrace.c (inf_ptrace_detach_success): New function, factored out from ... (inf_ptrace_detach): ... here. * inf-ptrace.h (inf_ptrace_detach_success): New declaration. * linux-nat.c (get_pending_status): Rename to ... (get_detach_signal): ... this, and return a host signal instead of filling in a wait status. (detach_one_lwp): New function, factored out from detach_callback and adjusted to handle detaching from a zombie thread. (detach_callback): Skip the leader thread. (linux_nat_detach): No longer defer to inf_ptrace_detach to detach the leader thread, nor build a signal string to pass down. Instead, use target_announce_detach, detach_one_lwp and inf_ptrace_detach_success. gdb/testsuite/ChangeLog: 2016-07-01 Pedro Alves <palves@redhat.com> Antoine Tremblay <antoine.tremblay@ericsson.com> * gdb.threads/process-dies-while-detaching.c: New file. * gdb.threads/process-dies-while-detaching.exp: New file.
2016-07-01 12:16:33 +02:00
2016-07-01 Pedro Alves <palves@redhat.com>
Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c: Change interface to take the target lwp_info
pointer directly and return void. Handle detaching from a zombie
thread.
(linux_detach_lwp_callback): New function.
(linux_detach): Detach from the leader thread after detaching from
the clone threads.
2016-06-28 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_ftrace_insn_reloc_b): Use int64_t
for variable new_offset.
(aarch64_ftrace_insn_reloc_b_cond): Likewise.
(aarch64_ftrace_insn_reloc_cb): Likewise.
(aarch64_ftrace_insn_reloc_tb): Likewise.
(aarch64_install_fast_tracepoint_jump_pad): Likewise. Use
PRIx64 instead of PRIx32.
2016-06-28 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (arm_get_syscall_trapinfo): New function.
(the_low_target): Install arm_get_syscall_trapinfo.
2016-06-28 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_get_syscall_trapinfo): New
function.
(the_low_target): Install aarch64_get_syscall_trapinfo.
2016-06-28 Yao Qi <yao.qi@linaro.org>
* linux-low.c (get_syscall_trapinfo): Remove parameter sysret.
Callers updated.
* linux-low.h (struct linux_target_ops) <get_syscall_trapinfo>:
Remove parameter sysno.
* linux-x86-low.c (x86_get_syscall_trapinfo): Remove parameter
sysret.
2016-06-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-s390-low.c (s390_emit_eq_goto): Mark function static.
(s390_emit_ne_goto): Likewise.
(s390_emit_lt_goto): Likewise.
(s390_emit_le_goto): Likewise.
(s390_emit_gt_goto): Likewise.
(s390_emit_ge_goto): Likewise.
(s390x_emit_eq_goto): Likewise.
(s390x_emit_ne_goto): Likewise.
(s390x_emit_lt_goto): Likewise.
(s390x_emit_le_goto): Likewise.
(s390x_emit_gt_goto): Likewise.
(s390x_emit_ge_goto): Likewise.
(s390_emit_ops_impl): Mark variable static.
(s390x_emit_ops): Likewise.
Handle reinsert breakpoints for vforked child When a thread is doing step-over with reinsert breakpoint, and the instruction executed is a syscall doing vfork, both parent and child share the memory, so the reinsert breakpoint in the space is visible to both of them. Also, removing the reinsert breakpoints from the child will effectively remove them from the parent. We should carefully manipulate reinsert breakpoints for both processes. What we are doing here is that - uninsert reinsert breakpoints from the parent before cloning the breakpoint list. We use "uninsert" instead of "remove", because we need to "reinsert" them back after vfork is done. In fact, "uninsert" removes them from both child and parent process space. - reinsert breakpoints in parent process are still copied to child's breakpoint list, - remove them from child's breakpoint list as what we did for fork, at this point, reinsert breakpoints are removed from the child and the parent, but they are still tracked by the parent's breakpoint list, - once vfork is done, "reinsert" them back to the parent, gdb/gdbserver: 2016-06-17 Yao Qi <yao.qi@linaro.org> * linux-low.c (handle_extended_wait): Call uninsert_reinsert_breakpoints for the parent process. Remove reinsert breakpoints from the child process. Reinsert them to the parent process when vfork is done. * mem-break.c (uninsert_reinsert_breakpoints): New function. (reinsert_reinsert_breakpoints): New function. * mem-break.h (uninsert_reinsert_breakpoints): Declare (reinsert_reinsert_breakpoints): Declare.
2016-06-17 11:25:13 +02:00
2016-06-17 Yao Qi <yao.qi@linaro.org>
* linux-low.c (handle_extended_wait): Call
uninsert_reinsert_breakpoints for the parent process. Remove
reinsert breakpoints from the child process. Reinsert them to
the parent process when vfork is done.
* mem-break.c (uninsert_reinsert_breakpoints): New function.
(reinsert_reinsert_breakpoints): New function.
* mem-break.h (uninsert_reinsert_breakpoints): Declare
(reinsert_reinsert_breakpoints): Declare.
2016-06-17 Yao Qi <yao.qi@linaro.org>
* linux-low.c (handle_extended_wait): If the parent is doing
step-over, remove the reinsert breakpoints from the forked child.
Step over exit with reinsert breakpoints This patch fixes a GDBserver crash when one thread is stepping over a syscall instruction which is exit. Step-over isn't finished due to the exit, but GDBserver doesn't clean up the state of step-over, so in the wait next time, GDBserver will wait on step_over_bkpt, which is already exited, and GDBserver crashes because 'requested_child' is NULL. See gdbserver logs below, Need step over [LWP 14858]? yes, found breakpoint at 0x2aaaaad91307^M proceed_all_lwps: found thread 14858 needing a step-over^M Starting step-over on LWP 14858. Stopping all threads^M >>>> entering void stop_all_lwps(int, lwp_info*) .... <<<< exiting void stop_all_lwps(int, lwp_info*)^M Done stopping all threads for step-over.^M pc is 0x2aaaaad91307^M Writing 0f to 0x2aaaaad91307 in process 14858^M Could not find fast tracepoint jump at 0x2aaaaad91307 in list (uninserting).^M pending reinsert at 0x2aaaaad91307^M step from pc 0x2aaaaad91307^M Resuming lwp 14858 (step, signal 0, stop not expected)^M # Start step-over for LWP 14858 >>>> entering ptid_t linux_wait_1(ptid_t, target_waitstatus*, int) .... LLFE: 14858 exited. ... <<<< exiting ptid_t linux_wait_1(ptid_t, target_waitstatus*, int) # LWP 14858 exited ..... >>>> entering ptid_t linux_wait_1(ptid_t, target_waitstatus*, int)^M linux_wait_1: [<all threads>]^M step_over_bkpt set [LWP 14858.14858], doing a blocking wait # but step_over_bkpt is still LWP 14858, which is wrong The fix is to finish step-over if it is ongoing, and unsuspend other threads. Without the fix in linux-low.c, GDBserver will crash in with running gdb.base/step-over-exit.exp. gdb/gdbserver: 2016-06-17 Yao Qi <yao.qi@linaro.org> * linux-low.c (unsuspend_all_lwps): Declare. (linux_low_filter_event): If thread exited, call finish_step_over. If step-over is finished, unsuspend other threads. gdb/testsuite: 2016-06-17 Yao Qi <yao.qi@linaro.org> * gdb.base/step-over-exit.c: New. * gdb.base/step-over-exit.exp: New.
2016-06-17 11:25:12 +02:00
2016-06-17 Yao Qi <yao.qi@linaro.org>
* linux-low.c (unsuspend_all_lwps): Declare.
(linux_low_filter_event): If thread exited, call finish_step_over.
If step-over is finished, unsuspend other threads.
2016-06-17 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_resume_one_lwp_throw): Assert
has_reinsert_breakpoints returns false.
* mem-break.c (delete_disabled_breakpoints): Assert
bp type isn't reinsert_breakpoint.
Switch to current thread in finish_step_over This patch adds some sanity check that reinsert breakpoints must be there when doing step-over on software single step target. The check triggers an assert when running forking-threads-plus-breakpoint.exp on arm-linux target, gdb/gdbserver/linux-low.c:4714: A problem internal to GDBserver has been detected.^M int finish_step_over(lwp_info*): Assertion `has_reinsert_breakpoints ()' failed. the error happens when GDBserver has already resumed a thread of process A for step-over (and wait for it hitting reinsert breakpoint), but receives detach request for process B from GDB, which is shown in the backtrace below, (gdb) bt #2 0x000228aa in finish_step_over (lwp=0x12bbd98) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:4703 #3 0x00025a50 in finish_step_over (lwp=0x12bbd98) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:4749 #4 complete_ongoing_step_over () at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:4760 #5 linux_detach (pid=25228) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:1503 #6 0x00012bae in process_serial_event () at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/server.c:3974 #7 handle_serial_event (err=<optimized out>, client_data=<optimized out>) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/server.c:4347 #8 0x00016d68 in handle_file_event (event_file_desc=<optimized out>) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/event-loop.c:429 #9 0x000173ea in process_event () at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/event-loop.c:184 #10 start_event_loop () at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/event-loop.c:547 #11 0x0000aa2c in captured_main (argv=<optimized out>, argc=<optimized out>) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/server.c:3719 #12 main (argc=<optimized out>, argv=<optimized out>) at /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/server.c:3804 the sanity check tries to find the reinsert breakpoint from process B, but nothing is found. It is wrong, we need to search in process A, since we started step-over of a thread of process A. (gdb) p lwp->thread->entry.id $3 = {pid = 25120, lwp = 25131, tid = 0} (gdb) p current_thread->entry.id $4 = {pid = 25228, lwp = 25228, tid = 0} This patch switched current_thread to the thread we are doing step-over in finish_step_over. gdb/gdbserver: 2016-06-17 Yao Qi <yao.qi@linaro.org> * linux-low.c (maybe_hw_step): New function. (linux_resume_one_lwp_throw): Call maybe_hw_step. (finish_step_over): Switch current_thread to lwp temporarily, and assert has_reinsert_breakpoints returns true. (proceed_one_lwp): Call maybe_hw_step. * mem-break.c (has_reinsert_breakpoints): New function. * mem-break.h (has_reinsert_breakpoints): Declare.
2016-06-17 11:25:12 +02:00
2016-06-17 Yao Qi <yao.qi@linaro.org>
* linux-low.c (maybe_hw_step): New function.
(linux_resume_one_lwp_throw): Call maybe_hw_step.
(finish_step_over): Switch current_thread to lwp temporarily,
and assert has_reinsert_breakpoints returns true.
(proceed_one_lwp): Call maybe_hw_step.
* mem-break.c (has_reinsert_breakpoints): New function.
* mem-break.h (has_reinsert_breakpoints): Declare.
2016-06-02 Jon Turney <jon.turney@dronecode.org.uk>
* win32-low.c (win32_create_inferior): Add pointer casts for C++.
2016-05-17 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_stabilize_threads): Call unsuspend_all_lwps
instead of find_inferior.
2016-05-05 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer):
Initialize res to zero.
2016-05-05 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (arm_sigreturn_next_pc): Change type of cpsr
to uint32_t.
2016-05-04 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* spu-low.c (fetch_ppc_register): Cast PowerPC-Linux-specific value
used as first ptrace argument to PTRACE_TYPE_ARG1 for C++.
(fetch_ppc_memory_1, store_ppc_memory_1): Likewise.
2016-04-28 Par Olsson <par.olsson@windriver.com>
2016-05-05 15:46:06 +02:00
Simon Marchi <simon.marchi@ericsson.com>
* tracepoint.c (write_inferior_int8): New function.
(cmd_qtenable_disable): Write enable flag using
write_inferior_int8.
2016-04-25 Yao Qi <yao.qi@linaro.org>
* linux-low.c (lwp_signal_can_be_delivered): Adjust.
(need_step_over_p): Return zero if the LWP has pending signals
can be delivered on software single step target.
2016-04-25 Yao Qi <yao.qi@linaro.org>
* linux-low.c (reinsert_raw_breakpoint): If bp->inserted is true
return instead of error.
2016-04-22 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c (arm_store_gregset): Clear CPSR bits 20
to 23.
Deliver signal in hardware single step GDBserver doesn't deliver signal when stepping over a breakpoint even hardware single step is used. When GDBserver started to step over (thread creation) breakpoint for mutlit-threaded debugging in 2002 [1], GDBserver behaves this way. This behavior gets trouble on conditional breakpoints on branch to self instruction like this, 0x00000000004005b6 <+29>: jmp 0x4005b6 <main+29> and I set breakpoint $(gdb) break branch-to-self.c:43 if counter > 3 and the variable counter will be set to 5 in SIGALRM signal handler. Since GDBserver keeps stepping over breakpoint, the SIGALRM can never be dequeued and delivered to the inferior, so the program can't stop. The test can be found in gdb.base/branch-to-self.exp. GDBserver didn't deliver signal when stepping over a breakpoint because a tracepoint is collected twice if GDBserver does so in the following scenario, which can be reproduced by gdb.trace/signal.exp. - program stops at tracepoint, and tracepoint is collected, - gdbserver starts a step-over, - a signal arrives, step-over is canceled, and signal should be passed, - gdbserver starts a new step-over again, pass the signal as well, - program stops at the entry of signal handler, step-over finished, - gdbserver proceeds, - program returns from the signal handler, again to the tracepoint, and thus is collected again. The spurious collection isn't that harmful, IMO, so it should be OK to let GDBserver deliver signal when stepping over a breakpoint. gdb/gdbserver: 2016-04-22 Yao Qi <yao.qi@linaro.org> * linux-low.c (lwp_signal_can_be_delivered): Don't deliver signal when stepping over breakpoint with software single step. gdb/testsuite: 2016-04-22 Yao Qi <yao.qi@linaro.org> * gdb.trace/signal.exp: Also pass if $tracepoint_hits($i) > $iterations.
2016-04-22 12:59:18 +02:00
2016-04-22 Yao Qi <yao.qi@linaro.org>
* linux-low.c (lwp_signal_can_be_delivered): Don't deliver
signal when stepping over breakpoint with software single
step.
2016-04-21 Pedro Alves <palves@redhat.com>
* linux-s390-low.c (s390_collect_ptrace_register)
(s390_supply_ptrace_register, s390_get_hwcap): Use gdb_byte * and
add casts.
(s390_check_regset): Use void * instead of gdb_byte *.
2016-04-20 Pedro Alves <palves@redhat.com>
* configure: Renegerate.
2016-04-20 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c: Include "arch/arm-linux.h".
(arm_fill_gregset): Use ARM_CPSR_GREGNUM rather than magic
number 16.
(arm_store_gregset): Likewise.
Add target descriptions for AVX + MPX The current MPX target descriptions assume that MPX is always combined with AVX, however that's not correct. We can have machines with MPX and without AVX; or machines with AVX and without MPX. This patch adds new target descriptions for machines that support both MPX and AVX, as duplicates of the existing MPX descriptions. The following commit will remove AVX from the MPX-only descriptions. 2016-04-16 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-linux.c): New include. (amd64_linux_core_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_mpx_linux. * amd64-linux-tdep.h (tdesc_amd64_avx_mpx_linux): New definition. * amd64-tdep.c (features/i386/amd64-avx-mpx.c): New include. (amd64_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_tdep): Call initialize_tdesc_amd64_avx_mpx. * common/x86-xstate.h (X86_XSTATE_MPX_MASK): Remove AVX bits. (X86_XSTATE_AVX_MPX_MASK): New case. * features/Makefile (i386/i386-avx-mpx, i386/i386-avx-mpx-linux) (i386/amd64-avx-mpx, i386/amd64-avx-mpx-linux): New rules. (i386/i386-avx-mpx-expedite, i386/i386-avx-mpx-linux-expedite) (i386/amd64-avx-mpx-expedite, i386/amd64-avx-mpx-linux-expedite): New expedites. * i386-linux-tdep.c (features/i386/i386-avx-mpx-linux.c): New include. (i386_linux_core_read_description): Add case X86_XSTATE_AVX_MPX_MASK. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_avx_mpx_linux. * i386-linux-tdep.h (tdesc_i386_avx_mpx_linux): New include. * i386-tdep.c (features/i386/i386-avx-mpx.c): New include. (i386_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. * x86-linux-nat.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. * features/i386/amd64-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx-linux.c: Generated. * features/i386/amd64-avx-mpx.c: Generated. * features/i386/i386-avx-mpx-linux.c: Generated. * features/i386/i386-avx-mpx.c: Generated. * regformats/i386/amd64-avx-mpx-linux.dat: Generated. * regformats/i386/amd64-avx-mpx.dat: Generated. * regformats/i386/i386-avx-mpx-linux.dat: Generated. * regformats/i386/i386-avx-mpx.dat: Generated. gdb/gdbserver/ChangeLog: * Makefile.in (clean): Add removal for i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c and amd64-avx-mpx-linux.c. (i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c) (amd64-avx-mpx-linux.c): New rules. (amd64-avx-mpx-linux-ipa.o, i386-avx-mpx-linux-ipa.o): New rule. * configure.srv (srv_i386_regobj): Add i386-avx-mpx.o. (srv_i386_linux_regobj): Add i386-avx-mpx-linux.o. (srv_amd64_regobj): Add amd64-avx-mpx.o. (srv_amd64_linux_regobj): Add amd64-avx-mpx-linux.o. (srv_i386_xmlfiles): Add i386/i386-avx-mpx.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx-mpx.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx-mpx-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-mpx-linux.xml. (ipa_i386_linux_regobj): Add i386-avx-mpx-linux-ipa.o. (ipa_amd64_linux_regobj): Add amd64-avx-mpx-linux-ipa.o. * linux-x86-low.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (x86_get_ipa_tdesc_idx): Add cases for avx_mpx. (initialize_low_arch): Call init_registers_amd64_avx_mpx_linux and init_registers_i386_avx_mpx_linux. * linux-i386-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_i386_avx_mpx_linux. * linux-amd64-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_amd64_avx_mpx_linux. * linux-x86-tdesc.h (X86_TDESC_AVX_MPX): New enum value. (init_registers_amd64_avx_mpx_linux, tdesc_amd64_avx_mpx_linux) (init_registers_i386_avx_mpx_linux, tdesc_i386_avx_mpx_linux): New declarations.
2016-04-19 15:44:32 +02:00
2016-04-16 Walfred Tedeschi <walfred.tedeschi@intel.com>
* Makefile.in (clean): Add removal for i386-avx-mpx.c,
i386-avx-mpx-linux.c, amd64-avx-mpx.c and amd64-avx-mpx-linux.c.
(i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c)
(amd64-avx-mpx-linux.c): New rules.
(amd64-avx-mpx-linux-ipa.o, i386-avx-mpx-linux-ipa.o): New rule.
* configure.srv (srv_i386_regobj): Add i386-avx-mpx.o.
(srv_i386_linux_regobj): Add i386-avx-mpx-linux.o.
(srv_amd64_regobj): Add amd64-avx-mpx.o.
(srv_amd64_linux_regobj): Add amd64-avx-mpx-linux.o.
(srv_i386_xmlfiles): Add i386/i386-avx-mpx.xml.
(srv_amd64_xmlfiles): Add i386/amd64-avx-mpx.xml.
(srv_i386_linux_xmlfiles): Add i386/i386-avx-mpx-linux.xml.
(srv_amd64_linux_xmlfiles): Add i386/amd64-avx-mpx-linux.xml.
(ipa_i386_linux_regobj): Add i386-avx-mpx-linux-ipa.o.
(ipa_amd64_linux_regobj): Add amd64-avx-mpx-linux-ipa.o.
* linux-x86-low.c (x86_linux_read_description): Add case for
X86_XSTATE_AVX_MPX_MASK.
(x86_get_ipa_tdesc_idx): Add cases for avx_mpx.
(initialize_low_arch): Call init_registers_amd64_avx_mpx_linux and
init_registers_i386_avx_mpx_linux.
* linux-i386-ipa.c (get_ipa_tdesc): Add case for avx_mpx.
(initialize_low_tracepoint): Call
init_registers_i386_avx_mpx_linux.
* linux-amd64-ipa.c (get_ipa_tdesc): Add case for avx_mpx.
(initialize_low_tracepoint): Call
init_registers_amd64_avx_mpx_linux.
* linux-x86-tdesc.h (X86_TDESC_AVX_MPX): New enum value.
(init_registers_amd64_avx_mpx_linux, tdesc_amd64_avx_mpx_linux)
(init_registers_i386_avx_mpx_linux, tdesc_i386_avx_mpx_linux): New
declarations.
Fix PR gdb/19250: ptrace prototype is not detected properly in C++ mode The ptrace args/return types detection doesn't work properly in C++ mode, on non-GNU/Linux hosts. For example, on gcc70 (NetBSD 5.1), where the prototype is: int ptrace(int, __pid_t, void*, int); configure misdetects it as: $ grep PTRACE_TYPE config.h #define PTRACE_TYPE_ARG1 int #define PTRACE_TYPE_ARG3 int * #define PTRACE_TYPE_ARG4 int /* #undef PTRACE_TYPE_ARG5 */ #define PTRACE_TYPE_RET int resulting in: ../../src/gdb/amd64bsd-nat.c: In function 'void amd64bsd_fetch_inferior_registers(target_ops*, regcache*, int)': ../../src/gdb/amd64bsd-nat.c:56: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../src/gdb/amd64bsd-nat.c: In function 'void amd64bsd_store_inferior_registers(target_ops*, regcache*, int)': ../../src/gdb/amd64bsd-nat.c:104: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../src/gdb/amd64bsd-nat.c:110: warning: dereferencing type-punned pointer will break strict-aliasing rules We could address this [1], however despite ptrace.m4's claim: # Needs to be tested in C++ mode, to detect whether we need to cast # the first argument to enum __ptrace_request. it appears that there's actually no need to test in C++ mode. Always running the ptrace tests in C mode works just the same on GNU/Linux. I remember experimenting with several different ways to handle the original issue back then, and maybe that was needed in some other attempt and then I didn't realize it ended up not really necessary. Confirmed that this fixes the NetBSD 5.1 C++ build, and confirmed that C and C++ builds on Fedora 23 are unaffected. [1] - https://sourceware.org/ml/gdb-patches/2016-04/msg00374.html gdb/ChangeLog: 2016-04-18 Pedro Alves <palves@redhat.com> * ptrace.m4 (GDB_AC_PTRACE): Don't run tests in C++ mode. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2016-04-18 Pedro Alves <palves@redhat.com> * configure: Regenerate.
2016-04-18 18:42:50 +02:00
2016-04-18 Pedro Alves <palves@redhat.com>
* configure: Regenerate.
2016-04-13 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-aarch64-low.c (aarch64_emit_add): Switch x1 and x0.
(aarch64_emit_sub): Likewise.
2016-04-12 Pedro Alves <palves@redhat.com>
* utils.c (prepare_to_throw_exception): Delete.
Make ftrace tests work with remote targets When we build a shared library for testing, it is built differently whether it is meant for the local system or a remote one. When it is for the local system, the library is built with no SONAME. So when the executable is built, roughly in this way: $ gcc testfile.c /path/to/library.so the executable will contain an absolute reference to the library. For example: $ readelf -a testsuite/gdb.python/py-shared | grep NEEDED 0x0000000000000001 (NEEDED) Shared library: [/home/emaisin/build/binutils-gdb/gdb/testsuite/gdb.python/py-shared-sl.sl] When testing is done remotely, the absolute path obviously doesn't work. Therefore, we build the library with an SONAME: $ readelf -a testsuite/gdb.python/py-shared-sl.sl | grep SONAME 0x000000000000000e (SONAME) Library soname: [py-shared-sl.sl] which ends up in the executable's NEEDED field: $ readelf -a testsuite/gdb.python/py-shared | grep NEEDED 0x0000000000000001 (NEEDED) Shared library: [py-shared-sl.sl] The executable and the library are then uploaded side-by-side on the remote system. To allow the dynamic linker to find the shared library, we have to add the special RPATH value $ORIGIN, which tells it to search in the executable's directory: $ readelf -a testsuite/gdb.python/py-shared | grep ORIGIN 0x000000000000000f (RPATH) Library rpath: [$ORIGIN] The problem with the IPA library is that it doesn't have an SONAME, making it very difficult to do testing on a remote board. When a test executable is linked with it, it contains an absolute reference to the library path. Therefore, unless the paths on the target are the same as on the build system, it won't work. To make it possible for tests using the IPA library to run test on remote boards, I suggest adding an SONAME to libinproctrace.so. I don't think it should be a big problem for users. All the libraries installed on my system have an SONAME, so it should be fine if libinproctrace.so does too. As a consequence, native testing does not work anymore, since executables do not contain the absolute path to the library anymore. To keep them working, we can have gdb_load_shlibs copy the library to the test directory when testing natively. That's done by modifying gdb_load_shlibs. We also have to add RPATH=$ORIGIN to executables, even when testing natively. I think it's a good change in general, as it reduces the differences between testing a native and a remote target. To further reduce those differences, we can also always build test shared libraries with an SONAME. ftrace.exp and ftrace-lock.exp need to be modified slightly. The code checks that the IPA library is loaded using the absolute path on the build machine. That obviously doesn't work if the test is done remotely, as the path will be different. I changed the tests to only search for the library basename (e.g. libinproctrace.so). gdb/gdbserver/ChangeLog: * Makefile.in ($(IPA_LIB)): Set SONAME of the IPA lib. gdb/testsuite/ChangeLog: * gdb.trace/ftrace-lock.exp: Check for IPA basename instead of absolute. * gdb.trace/ftrace.exp: Likewise. * lib/gdb.exp (gdb_compile): Set rpath $ORIGIN for non-remote targets as well. (gdb_compile_shlib): Set SONAME for non-remote targets as well. (gdb_load_shlibs): Copy libraries to test directory when testing natively. Only set solib-search-path if testing remotely. * lib/mi-support.exp (mi_load_shlibs): Likewise.
2016-04-05 19:59:50 +02:00
2016-04-05 Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in ($(IPA_LIB)): Set SONAME of the IPA lib.
2016-04-05 Marcin Kościelnicki <koriakin@0x04.net>
* tracepoint.c (getauxval): Move to #ifdef IN_PROCESS_AGENT.
2016-04-03 Marcin Kościelnicki <koriakin@0x04.net>
* linux-aarch64-ipa.c: Add <elf.h> include.
* linux-ppc-ipa.c: Add <elf.h> include.
* linux-s390-ipa.c: Add <elf.h> include.
2016-03-31 Marcin Kościelnicki <koriakin@0x04.net>
* tracepoint.c (gdb_collect_ptr): Remove const qualifier.
(get_raw_reg_ptr): Likewise.
(get_trace_state_variable_value_ptr): Likewise.
(set_trace_state_variable_value_ptr): Likewise.
(initialize_tracepoint): Cast alloc_jump_pad_buffer result to
char *.
gdbserver: Add emit_ops for powerpc. gdb/gdbserver/ChangeLog: 2016-03-31 Wei-cheng Wang <cole945@gmail.com> Marcin Kościelnicki <koriakin@0x04.net> PR/17221 * linux-ppc-low.c (emit_insns): New function. (__EMIT_ASM, _EMIT_ASM, EMIT_ASM): New macros. (ppc_emit_prologue): New function. (ppc_emit_epilogue): New function. (ppc_emit_add): New function. (ppc_emit_sub): New function. (ppc_emit_mul): New function. (ppc_emit_lsh): New function. (ppc_emit_rsh_signed): New function. (ppc_emit_rsh_unsigned): New function. (ppc_emit_ext): New function. (ppc_emit_zero_ext): New function. (ppc_emit_log_not): New function. (ppc_emit_bit_and): New function. (ppc_emit_bit_or): New function. (ppc_emit_bit_xor): New function. (ppc_emit_bit_not): New function. (ppc_emit_equal): New function. (ppc_emit_less_signed): New function. (ppc_emit_less_unsigned): New function. (ppc_emit_ref): New function. (ppc_emit_const): New function. (ppc_emit_reg): New function. (ppc_emit_pop): New function. (ppc_emit_stack_flush): New function. (ppc_emit_swap): New function. (ppc_emit_stack_adjust): New function. (ppc_emit_call): New function. (ppc_emit_int_call_1): New function. (ppc_emit_void_call_2): New function. (ppc_emit_if_goto): New function. (ppc_emit_goto): New function. (ppc_emit_eq_goto): New function. (ppc_emit_ne_goto): New function. (ppc_emit_lt_goto): New function. (ppc_emit_le_goto): New function. (ppc_emit_gt_goto): New function. (ppc_emit_ge_goto): New function. (ppc_write_goto_address): New function. (ppc_emit_ops_impl): New static variable. (ppc64v1_emit_prologue): New function. (ppc64v2_emit_prologue): New function. (ppc64_emit_epilogue): New function. (ppc64_emit_add): New function. (ppc64_emit_sub): New function. (ppc64_emit_mul): New function. (ppc64_emit_lsh): New function. (ppc64_emit_rsh_signed): New function. (ppc64_emit_rsh_unsigned): New function. (ppc64_emit_ext): New function. (ppc64_emit_zero_ext): New function. (ppc64_emit_log_not): New function. (ppc64_emit_bit_and): New function. (ppc64_emit_bit_or): New function. (ppc64_emit_bit_xor): New function. (ppc64_emit_bit_not): New function. (ppc64_emit_equal): New function. (ppc64_emit_less_signed): New function. (ppc64_emit_less_unsigned): New function. (ppc64_emit_ref): New function. (ppc64_emit_const): New function. (ppc64v1_emit_reg): New function. (ppc64v2_emit_reg): New function. (ppc64_emit_pop): New function. (ppc64_emit_stack_flush): New function. (ppc64_emit_swap): New function. (ppc64v1_emit_call): New function. (ppc64v2_emit_call): New function. (ppc64v1_emit_int_call_1): New function. (ppc64v2_emit_int_call_1): New function. (ppc64v1_emit_void_call_2): New function. (ppc64v2_emit_void_call_2): New function. (ppc64_emit_if_goto): New function. (ppc64_emit_eq_goto): New function. (ppc64_emit_ne_goto): New function. (ppc64_emit_lt_goto): New function. (ppc64_emit_le_goto): New function. (ppc64_emit_gt_goto): New function. (ppc64_emit_ge_goto): New function. (ppc64v1_emit_ops_impl): New static variable. (ppc64v2_emit_ops_impl): New static variable. (ppc_emit_ops): New function. (linux_low_target): Wire in ppc_emit_ops.
2016-03-14 17:29:09 +01:00
2016-03-31 Wei-cheng Wang <cole945@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
PR/17221
* linux-ppc-low.c (emit_insns): New function.
(__EMIT_ASM, _EMIT_ASM, EMIT_ASM): New macros.
(ppc_emit_prologue): New function.
(ppc_emit_epilogue): New function.
(ppc_emit_add): New function.
(ppc_emit_sub): New function.
(ppc_emit_mul): New function.
(ppc_emit_lsh): New function.
(ppc_emit_rsh_signed): New function.
(ppc_emit_rsh_unsigned): New function.
(ppc_emit_ext): New function.
(ppc_emit_zero_ext): New function.
(ppc_emit_log_not): New function.
(ppc_emit_bit_and): New function.
(ppc_emit_bit_or): New function.
(ppc_emit_bit_xor): New function.
(ppc_emit_bit_not): New function.
(ppc_emit_equal): New function.
(ppc_emit_less_signed): New function.
(ppc_emit_less_unsigned): New function.
(ppc_emit_ref): New function.
(ppc_emit_const): New function.
(ppc_emit_reg): New function.
(ppc_emit_pop): New function.
(ppc_emit_stack_flush): New function.
(ppc_emit_swap): New function.
(ppc_emit_stack_adjust): New function.
(ppc_emit_call): New function.
(ppc_emit_int_call_1): New function.
(ppc_emit_void_call_2): New function.
(ppc_emit_if_goto): New function.
(ppc_emit_goto): New function.
(ppc_emit_eq_goto): New function.
(ppc_emit_ne_goto): New function.
(ppc_emit_lt_goto): New function.
(ppc_emit_le_goto): New function.
(ppc_emit_gt_goto): New function.
(ppc_emit_ge_goto): New function.
(ppc_write_goto_address): New function.
(ppc_emit_ops_impl): New static variable.
(ppc64v1_emit_prologue): New function.
(ppc64v2_emit_prologue): New function.
(ppc64_emit_epilogue): New function.
(ppc64_emit_add): New function.
(ppc64_emit_sub): New function.
(ppc64_emit_mul): New function.
(ppc64_emit_lsh): New function.
(ppc64_emit_rsh_signed): New function.
(ppc64_emit_rsh_unsigned): New function.
(ppc64_emit_ext): New function.
(ppc64_emit_zero_ext): New function.
(ppc64_emit_log_not): New function.
(ppc64_emit_bit_and): New function.
(ppc64_emit_bit_or): New function.
(ppc64_emit_bit_xor): New function.
(ppc64_emit_bit_not): New function.
(ppc64_emit_equal): New function.
(ppc64_emit_less_signed): New function.
(ppc64_emit_less_unsigned): New function.
(ppc64_emit_ref): New function.
(ppc64_emit_const): New function.
(ppc64v1_emit_reg): New function.
(ppc64v2_emit_reg): New function.
(ppc64_emit_pop): New function.
(ppc64_emit_stack_flush): New function.
(ppc64_emit_swap): New function.
(ppc64v1_emit_call): New function.
(ppc64v2_emit_call): New function.
(ppc64v1_emit_int_call_1): New function.
(ppc64v2_emit_int_call_1): New function.
(ppc64v1_emit_void_call_2): New function.
(ppc64v2_emit_void_call_2): New function.
(ppc64_emit_if_goto): New function.
(ppc64_emit_eq_goto): New function.
(ppc64_emit_ne_goto): New function.
(ppc64_emit_lt_goto): New function.
(ppc64_emit_le_goto): New function.
(ppc64_emit_gt_goto): New function.
(ppc64_emit_ge_goto): New function.
(ppc64v1_emit_ops_impl): New static variable.
(ppc64v2_emit_ops_impl): New static variable.
(ppc_emit_ops): New function.
(linux_low_target): Wire in ppc_emit_ops.
gdbserver: Add powerpc fast tracepoint support. gdb/gdbserver/ChangeLog: 2016-03-31 Wei-cheng Wang <cole945@gmail.com> Marcin Kościelnicki <koriakin@0x04.net> PR/17221 * Makefile.in: Add powerpc-*-ipa.o * configure.srv: Add ipa_obj for powerpc*-linux. * linux-ppc-ipa.c: New file. * linux-ppc-low.c: Added linux-ppc-tdesc.h, ax.h, tracepoint.h includes. (PPC_FIELD): New macro. (PPC_SEXT): New macro. (PPC_OP6): New macro. (PPC_BO): New macro. (PPC_LI): New macro. (PPC_BD): New macro. (init_registers_*): Move prototype to linux-ppc-tdesc.h. (tdesc_*): Move declaration to linux-ppc-tdesc.h. (ppc_get_hwcap): Rename to ppc_get_auxv and add type parameter. (ppc_get_thread_area): New function. (is_elfv2_inferior): New function. (gen_ds_form): New function. (GEN_STD): New macro. (GEN_STDU): New macro. (GEN_LD): New macro. (GEN_LDU): New macro. (gen_d_form): New function. (GEN_ADDI): New macro. (GEN_ADDIS): New macro. (GEN_LI): New macro. (GEN_LIS): New macro. (GEN_ORI): New macro. (GEN_ORIS): New macro. (GEN_LWZ): New macro. (GEN_STW): New macro. (GEN_STWU): New macro. (gen_xfx_form): New function. (GEN_MFSPR): New macro. (GEN_MTSPR): New macro. (GEN_MFCR): New macro. (GEN_MTCR): New macro. (GEN_SYNC): New macro. (GEN_LWSYNC): New macro. (gen_x_form): New function. (GEN_OR): New macro. (GEN_MR): New macro. (GEN_LWARX): New macro. (GEN_STWCX): New macro. (GEN_CMPW): New macro. (gen_md_form): New function. (GEN_RLDICL): New macro. (GEN_RLDICR): New macro. (gen_i_form): New function. (GEN_B): New macro. (GEN_BL): New macro. (gen_b_form): New function. (GEN_BNE): New macro. (GEN_LOAD): New macro. (GEN_STORE): New macro. (gen_limm): New function. (gen_atomic_xchg): New function. (gen_call): New function. (ppc_relocate_instruction): New function. (ppc_install_fast_tracepoint_jump_pad): New function. (ppc_get_min_fast_tracepoint_insn_len): New function. (ppc_get_ipa_tdesc_idx): New function. (the_low_target): Wire in the new functions. (initialize_low_arch) [!__powerpc64__]: Don'it initialize 64-bit tdescs. * linux-ppc-tdesc.h: New file.
2016-03-10 01:38:18 +01:00
2016-03-31 Wei-cheng Wang <cole945@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
PR/17221
* Makefile.in: Add powerpc-*-ipa.o
* configure.srv: Add ipa_obj for powerpc*-linux.
* linux-ppc-ipa.c: New file.
* linux-ppc-low.c: Added linux-ppc-tdesc.h, ax.h, tracepoint.h
includes.
(PPC_FIELD): New macro.
(PPC_SEXT): New macro.
(PPC_OP6): New macro.
(PPC_BO): New macro.
(PPC_LI): New macro.
(PPC_BD): New macro.
(init_registers_*): Move prototype to linux-ppc-tdesc.h.
(tdesc_*): Move declaration to linux-ppc-tdesc.h.
(ppc_get_hwcap): Rename to ppc_get_auxv and add type parameter.
(ppc_get_thread_area): New function.
(is_elfv2_inferior): New function.
(gen_ds_form): New function.
(GEN_STD): New macro.
(GEN_STDU): New macro.
(GEN_LD): New macro.
(GEN_LDU): New macro.
(gen_d_form): New function.
(GEN_ADDI): New macro.
(GEN_ADDIS): New macro.
(GEN_LI): New macro.
(GEN_LIS): New macro.
(GEN_ORI): New macro.
(GEN_ORIS): New macro.
(GEN_LWZ): New macro.
(GEN_STW): New macro.
(GEN_STWU): New macro.
(gen_xfx_form): New function.
(GEN_MFSPR): New macro.
(GEN_MTSPR): New macro.
(GEN_MFCR): New macro.
(GEN_MTCR): New macro.
(GEN_SYNC): New macro.
(GEN_LWSYNC): New macro.
(gen_x_form): New function.
(GEN_OR): New macro.
(GEN_MR): New macro.
(GEN_LWARX): New macro.
(GEN_STWCX): New macro.
(GEN_CMPW): New macro.
(gen_md_form): New function.
(GEN_RLDICL): New macro.
(GEN_RLDICR): New macro.
(gen_i_form): New function.
(GEN_B): New macro.
(GEN_BL): New macro.
(gen_b_form): New function.
(GEN_BNE): New macro.
(GEN_LOAD): New macro.
(GEN_STORE): New macro.
(gen_limm): New function.
(gen_atomic_xchg): New function.
(gen_call): New function.
(ppc_relocate_instruction): New function.
(ppc_install_fast_tracepoint_jump_pad): New function.
(ppc_get_min_fast_tracepoint_insn_len): New function.
(ppc_get_ipa_tdesc_idx): New function.
(the_low_target): Wire in the new functions.
(initialize_low_arch) [!__powerpc64__]: Don'it initialize 64-bit
tdescs.
* linux-ppc-tdesc.h: New file.
IPA: Add alloc_jump_pad_buffer target hook. Targets may have various requirements on the required location of the jump pad area. Currently IPA allocates it at the lowest possible address, so that it is reachable by branches from the executable. However, this fails on powerpc, which has executable link address (0x10000000) much larger than branch reach (+/- 32MiB). This makes jump pad buffer allocation a target hook instead. The current implementations are as follows: - i386 and s390: Branches can reach anywhere, so just mmap it. This avoids the linear search dance. - x86_64: Branches have +/-2GiB of reach, and executable is loaded low, so just call mmap with MAP_32BIT. Likewise avoids the linear search. - aarch64: Branches have +-128MiB of reach, executable loaded at 4MiB. Do a linear search from 4MiB-size downwards to page_size. - s390x: Branches have +-4GiB of reach, executable loaded at 2GiB. Do like on aarch64. gdb/gdbserver/ChangeLog: * linux-aarch64-ipa.c: Add <sys/mman.h> and <sys/auxv.h> includes. (alloc_jump_pad_buffer): New function. * linux-amd64-ipa.c: Add <sys/mman.h> include. (alloc_jump_pad_buffer): New function. * linux-i386-ipa.c (alloc_jump_pad_buffer): New function. * linux-s390-ipa.c: Add <sys/mman.h> and <sys/auxv.h> includes. (alloc_jump_pad_buffer): New function. * tracepoint.c (getauxval) [!HAVE_GETAUXVAL]: New function. (initialize_tracepoint): Delegate to alloc_jump_pad_buffer. * tracepoint.h (alloc_jump_pad_buffer): New prototype. (getauxval) [!HAVE_GETAUXVAL]: New prototype.
2016-03-13 00:30:11 +01:00
2016-03-31 Marcin Kościelnicki <koriakin@0x04.net>
* linux-aarch64-ipa.c: Add <sys/mman.h> and <sys/auxv.h> includes.
(alloc_jump_pad_buffer): New function.
* linux-amd64-ipa.c: Add <sys/mman.h> include.
(alloc_jump_pad_buffer): New function.
* linux-i386-ipa.c (alloc_jump_pad_buffer): New function.
* linux-s390-ipa.c: Add <sys/mman.h> and <sys/auxv.h> includes.
(alloc_jump_pad_buffer): New function.
* tracepoint.c (getauxval) [!HAVE_GETAUXVAL]: New function.
(initialize_tracepoint): Delegate to alloc_jump_pad_buffer.
* tracepoint.h (alloc_jump_pad_buffer): New prototype.
(getauxval) [!HAVE_GETAUXVAL]: New prototype.
gdbserver/IPA: Export some functions via global function pointers. On powerpc64, qSymbol for a function returns the function code address, and not the descriptor address. Since we emit code calling gdb_collect and some other functions, we need the descriptor (no way to know the proper TOC address without it). To get the descriptor address, make global function pointer variables in the IPA pointing to the relevant functions and read them instead of asking for them directly via qSymbol. gdb/gdbserver/ChangeLog: * linux-aarch64-ipa.c: Rename gdb_agent_get_raw_reg to get_raw_reg. * linux-amd64-ipa.c: Likewise. * linux-i386-ipa.c: Likewise. * linux-s390-ipa.c: Likewise. * tracepoint.c: IPA-export gdb_collect_ptr instead of gdb_collect, ditto for get_raw_reg_ptr, get_trace_state_variable_value_ptr, set_trace_state_variable_value_ptr. (struct ipa_sym_addresses): Likewise. (symbol_list): Likewise. (install_fast_tracepoint): Dereference gdb_collect_ptr instead of accessing gdb_collect directly. (gdb_collect_ptr_type): New typedef. (get_raw_reg_ptr_type): New typedef. (get_trace_state_variable_value_ptr_type): New typedef. (set_trace_state_variable_value_ptr_type): New typedef. (gdb_collect_ptr): New global. (get_raw_reg_ptr): New global. (get_trace_state_variable_value_ptr): New global. (set_trace_state_variable_value_ptr): New global. (get_raw_reg_func_addr): Dereference get_raw_reg_ptr instead of accessing get_raw_reg directly. (get_get_tsv_func_addr): Likewise for get_trace_state_variable_value_ptr. (get_set_tsv_func_addr): Likewise for set_trace_state_variable_value_ptr. * tracepoint.h: Rename gdb_agent_get_raw_reg to get_raw_reg.
2016-03-11 15:51:29 +01:00
2016-03-30 Marcin Kościelnicki <koriakin@0x04.net>
* linux-aarch64-ipa.c: Rename gdb_agent_get_raw_reg to get_raw_reg.
* linux-amd64-ipa.c: Likewise.
* linux-i386-ipa.c: Likewise.
* linux-s390-ipa.c: Likewise.
* tracepoint.c: IPA-export gdb_collect_ptr instead of gdb_collect,
ditto for get_raw_reg_ptr, get_trace_state_variable_value_ptr,
set_trace_state_variable_value_ptr.
(struct ipa_sym_addresses): Likewise.
(symbol_list): Likewise.
(install_fast_tracepoint): Dereference gdb_collect_ptr instead of
accessing gdb_collect directly.
(gdb_collect_ptr_type): New typedef.
(get_raw_reg_ptr_type): New typedef.
(get_trace_state_variable_value_ptr_type): New typedef.
(set_trace_state_variable_value_ptr_type): New typedef.
(gdb_collect_ptr): New global.
(get_raw_reg_ptr): New global.
(get_trace_state_variable_value_ptr): New global.
(set_trace_state_variable_value_ptr): New global.
(get_raw_reg_func_addr): Dereference get_raw_reg_ptr instead of
accessing get_raw_reg directly.
(get_get_tsv_func_addr): Likewise for
get_trace_state_variable_value_ptr.
(get_set_tsv_func_addr): Likewise for
set_trace_state_variable_value_ptr.
* tracepoint.h: Rename gdb_agent_get_raw_reg to get_raw_reg.
2016-03-30 Simon Marchi <simon.marchi@ericsson.com>
* tracepoint.c (cmd_qtenable_disable): Remove whitespace.
2016-03-30 Marcin Kościelnicki <koriakin@0x04.net>
* remote-utils.c (look_up_one_symbol): Remove own_buf, handle 'v'
packets.
(relocate_instruction): Remove own_buf.
* server.c (own_buf): Make global.
(handle_v_requests): Make global.
* server.h (own_buf): New declaration.
(handle_v_requests): New prototype.
gdbserver/s390: Add support for compiled agent expressions. These sequences assume a z900+ CPU, like the rest of fast tracepoint support. gdb/gdbserver/ChangeLog: PR 18377 * linux-s390-low.c (add_insns): New function. (s390_emit_prologue): New function. (s390_emit_epilogue): New function. (s390_emit_add): New function. (s390_emit_sub): New function. (s390_emit_mul): New function. (s390_emit_lsh): New function. (s390_emit_rsh_signed): New function. (s390_emit_rsh_unsigned): New function. (s390_emit_ext): New function. (s390_emit_log_not): New function. (s390_emit_bit_and): New function. (s390_emit_bit_or): New function. (s390_emit_bit_xor): New function. (s390_emit_bit_not): New function. (s390_emit_equal): New function. (s390_emit_less_signed): New function. (s390_emit_less_unsigned): New function. (s390_emit_ref): New function. (s390_emit_if_goto): New function. (s390_emit_goto): New function. (s390_write_goto_address): New function. (s390_emit_litpool): New function. (s390_emit_const): New function. (s390_emit_call): New function. (s390_emit_reg): New function. (s390_emit_pop): New function. (s390_emit_stack_flush): New function. (s390_emit_zero_ext): New function. (s390_emit_swap): New function. (s390_emit_stack_adjust): New function. (s390_emit_set_r2): New function. (s390_emit_int_call_1): New function. (s390_emit_void_call_2): New function. (s390_emit_eq_goto): New function. (s390_emit_ne_goto): New function. (s390_emit_lt_goto): New function. (s390_emit_le_goto): New function. (s390_emit_gt_goto): New function. (s390_emit_ge_goto): New function. (s390x_emit_prologue): New function. (s390x_emit_epilogue): New function. (s390x_emit_add): New function. (s390x_emit_sub): New function. (s390x_emit_mul): New function. (s390x_emit_lsh): New function. (s390x_emit_rsh_signed): New function. (s390x_emit_rsh_unsigned): New function. (s390x_emit_ext): New function. (s390x_emit_log_not): New function. (s390x_emit_bit_and): New function. (s390x_emit_bit_or): New function. (s390x_emit_bit_xor): New function. (s390x_emit_bit_not): New function. (s390x_emit_equal): New function. (s390x_emit_less_signed): New function. (s390x_emit_less_unsigned): New function. (s390x_emit_ref): New function. (s390x_emit_if_goto): New function. (s390x_emit_const): New function. (s390x_emit_call): New function. (s390x_emit_reg): New function. (s390x_emit_pop): New function. (s390x_emit_stack_flush): New function. (s390x_emit_zero_ext): New function. (s390x_emit_swap): New function. (s390x_emit_stack_adjust): New function. (s390x_emit_int_call_1): New function. (s390x_emit_void_call_2): New function. (s390x_emit_eq_goto): New function. (s390x_emit_ne_goto): New function. (s390x_emit_lt_goto): New function. (s390x_emit_le_goto): New function. (s390x_emit_gt_goto): New function. (s390x_emit_ge_goto): New function. (s390_emit_ops): New function. (struct linux_target_ops): Fill in emit_ops hook.
2015-11-15 02:52:34 +01:00
2016-03-29 Marcin Kościelnicki <koriakin@0x04.net>
PR 18377
* linux-s390-low.c (add_insns): New function.
(s390_emit_prologue): New function.
(s390_emit_epilogue): New function.
(s390_emit_add): New function.
(s390_emit_sub): New function.
(s390_emit_mul): New function.
(s390_emit_lsh): New function.
(s390_emit_rsh_signed): New function.
(s390_emit_rsh_unsigned): New function.
(s390_emit_ext): New function.
(s390_emit_log_not): New function.
(s390_emit_bit_and): New function.
(s390_emit_bit_or): New function.
(s390_emit_bit_xor): New function.
(s390_emit_bit_not): New function.
(s390_emit_equal): New function.
(s390_emit_less_signed): New function.
(s390_emit_less_unsigned): New function.
(s390_emit_ref): New function.
(s390_emit_if_goto): New function.
(s390_emit_goto): New function.
(s390_write_goto_address): New function.
(s390_emit_litpool): New function.
(s390_emit_const): New function.
(s390_emit_call): New function.
(s390_emit_reg): New function.
(s390_emit_pop): New function.
(s390_emit_stack_flush): New function.
(s390_emit_zero_ext): New function.
(s390_emit_swap): New function.
(s390_emit_stack_adjust): New function.
(s390_emit_set_r2): New function.
(s390_emit_int_call_1): New function.
(s390_emit_void_call_2): New function.
(s390_emit_eq_goto): New function.
(s390_emit_ne_goto): New function.
(s390_emit_lt_goto): New function.
(s390_emit_le_goto): New function.
(s390_emit_gt_goto): New function.
(s390_emit_ge_goto): New function.
(s390x_emit_prologue): New function.
(s390x_emit_epilogue): New function.
(s390x_emit_add): New function.
(s390x_emit_sub): New function.
(s390x_emit_mul): New function.
(s390x_emit_lsh): New function.
(s390x_emit_rsh_signed): New function.
(s390x_emit_rsh_unsigned): New function.
(s390x_emit_ext): New function.
(s390x_emit_log_not): New function.
(s390x_emit_bit_and): New function.
(s390x_emit_bit_or): New function.
(s390x_emit_bit_xor): New function.
(s390x_emit_bit_not): New function.
(s390x_emit_equal): New function.
(s390x_emit_less_signed): New function.
(s390x_emit_less_unsigned): New function.
(s390x_emit_ref): New function.
(s390x_emit_if_goto): New function.
(s390x_emit_const): New function.
(s390x_emit_call): New function.
(s390x_emit_reg): New function.
(s390x_emit_pop): New function.
(s390x_emit_stack_flush): New function.
(s390x_emit_zero_ext): New function.
(s390x_emit_swap): New function.
(s390x_emit_stack_adjust): New function.
(s390x_emit_int_call_1): New function.
(s390x_emit_void_call_2): New function.
(s390x_emit_eq_goto): New function.
(s390x_emit_ne_goto): New function.
(s390x_emit_lt_goto): New function.
(s390x_emit_le_goto): New function.
(s390x_emit_gt_goto): New function.
(s390x_emit_ge_goto): New function.
(s390_emit_ops): New function.
(struct linux_target_ops): Fill in emit_ops hook.
gdbserver/s390: Add fast tracepoint support. Fast tracepoints will only work on 6-byte intructions, and assume at least a z900 CPU. s390 also has 4-byte jump instructions, which also work on pre-z900, but their range is limitted to +-64kiB, which is not very useful (and wouldn't work at all with current jump pad allocation). There's a little problem with s390_relocate_instruction function: it converts BRAS/BRASL instructions to LARL of the return address + JG to the target address. On 31-bit, this sets the high bit of the target register to 0, while BRAS/BRASL would set it to 1. While this is not a problem when the result is only used to address memory, it could possibly break something that expects to compare such addresses for equality without first masking the bit off. In particular, I'm not sure whether leaving the return address high bit unset is ABI-compliant (could confuse some unwinder?). If that's a problem, it could be fixed by handling it in the jump pad (since at that point we can just modify the GPRs in the save area without having to worry about preserving CCs and only having that one GPR to work with - I'm not sure if it's even possible to set the high bit with such constraints). gdb/gdbserver/ChangeLog: PR 18377 * Makefile.in: Add s390 IPA files. * configure.srv: Build IPA for s390. * linux-s390-ipa.c: New file. * linux-s390-low.c: New includes - inttypes.h and linux-s390-tdesc.h. (init_registers_s390_linux32): Move declaration to linux-s390-tdesc.h. (tdesc_s390_linux32): Likewise. (init_registers_s390_linux32v1): Likewise. (tdesc_s390_linux32v1): Likewise. (init_registers_s390_linux32v2): Likewise. (tdesc_s390_linux32v2): Likewise. (init_registers_s390_linux64): Likewise. (tdesc_s390_linux64): Likewise. (init_registers_s390_linux64v1): Likewise. (tdesc_s390_linux64v1): Likewise. (init_registers_s390_linux64v2): Likewise. (tdesc_s390_linux64v2): Likewise. (init_registers_s390_te_linux64): Likewise. (tdesc_s390_te_linux64): Likewise. (init_registers_s390_vx_linux64): Likewise. (tdesc_s390_vx_linux64): Likewise. (init_registers_s390_tevx_linux64): Likewise. (tdesc_s390_tevx_linux64): Likewise. (init_registers_s390x_linux64): Likewise. (tdesc_s390x_linux64): Likewise. (init_registers_s390x_linux64v1): Likewise. (tdesc_s390x_linux64v1): Likewise. (init_registers_s390x_linux64v2): Likewise. (tdesc_s390x_linux64v2): Likewise. (init_registers_s390x_te_linux64): Likewise. (tdesc_s390x_te_linux64): Likewise. (init_registers_s390x_vx_linux64): Likewise. (tdesc_s390x_vx_linux64): Likewise. (init_registers_s390x_tevx_linux64): Likewise. (tdesc_s390x_tevx_linux64): Likewise. (have_hwcap_s390_vx): New static variable. (s390_arch_setup): Fill have_hwcap_s390_vx. (s390_get_thread_area): New function. (s390_ft_entry_gpr_esa): New const. (s390_ft_entry_gpr_zarch): New const. (s390_ft_entry_misc): New const. (s390_ft_entry_fr): New const. (s390_ft_entry_vr): New const. (s390_ft_main_31): New const. (s390_ft_main_64): New const. (s390_ft_exit_fr): New const. (s390_ft_exit_vr): New const. (s390_ft_exit_misc): New const. (s390_ft_exit_gpr_esa): New const. (s390_ft_exit_gpr_zarch): New const. (append_insns): New function. (s390_relocate_instruction): New function. (s390_install_fast_tracepoint_jump_pad): New function. (s390_get_min_fast_tracepoint_insn_len): New function. (s390_get_ipa_tdesc_idx): New function. (struct linux_target_ops): Wire in the above functions. (initialize_low_arch) [!__s390x__]: Don't initialize s390x tdescs. * linux-s390-tdesc.h: New file.
2016-01-17 22:59:06 +01:00
2016-03-29 Marcin Kościelnicki <koriakin@0x04.net>
PR 18377
* Makefile.in: Add s390 IPA files.
* configure.srv: Build IPA for s390.
* linux-s390-ipa.c: New file.
* linux-s390-low.c: New includes - inttypes.h and linux-s390-tdesc.h.
(init_registers_s390_linux32): Move declaration to linux-s390-tdesc.h.
(tdesc_s390_linux32): Likewise.
(init_registers_s390_linux32v1): Likewise.
(tdesc_s390_linux32v1): Likewise.
(init_registers_s390_linux32v2): Likewise.
(tdesc_s390_linux32v2): Likewise.
(init_registers_s390_linux64): Likewise.
(tdesc_s390_linux64): Likewise.
(init_registers_s390_linux64v1): Likewise.
(tdesc_s390_linux64v1): Likewise.
(init_registers_s390_linux64v2): Likewise.
(tdesc_s390_linux64v2): Likewise.
(init_registers_s390_te_linux64): Likewise.
(tdesc_s390_te_linux64): Likewise.
(init_registers_s390_vx_linux64): Likewise.
(tdesc_s390_vx_linux64): Likewise.
(init_registers_s390_tevx_linux64): Likewise.
(tdesc_s390_tevx_linux64): Likewise.
(init_registers_s390x_linux64): Likewise.
(tdesc_s390x_linux64): Likewise.
(init_registers_s390x_linux64v1): Likewise.
(tdesc_s390x_linux64v1): Likewise.
(init_registers_s390x_linux64v2): Likewise.
(tdesc_s390x_linux64v2): Likewise.
(init_registers_s390x_te_linux64): Likewise.
(tdesc_s390x_te_linux64): Likewise.
(init_registers_s390x_vx_linux64): Likewise.
(tdesc_s390x_vx_linux64): Likewise.
(init_registers_s390x_tevx_linux64): Likewise.
(tdesc_s390x_tevx_linux64): Likewise.
(have_hwcap_s390_vx): New static variable.
(s390_arch_setup): Fill have_hwcap_s390_vx.
(s390_get_thread_area): New function.
(s390_ft_entry_gpr_esa): New const.
(s390_ft_entry_gpr_zarch): New const.
(s390_ft_entry_misc): New const.
(s390_ft_entry_fr): New const.
(s390_ft_entry_vr): New const.
(s390_ft_main_31): New const.
(s390_ft_main_64): New const.
(s390_ft_exit_fr): New const.
(s390_ft_exit_vr): New const.
(s390_ft_exit_misc): New const.
(s390_ft_exit_gpr_esa): New const.
(s390_ft_exit_gpr_zarch): New const.
(append_insns): New function.
(s390_relocate_instruction): New function.
(s390_install_fast_tracepoint_jump_pad): New function.
(s390_get_min_fast_tracepoint_insn_len): New function.
(s390_get_ipa_tdesc_idx): New function.
(struct linux_target_ops): Wire in the above functions.
(initialize_low_arch) [!__s390x__]: Don't initialize s390x tdescs.
* linux-s390-tdesc.h: New file.
2016-03-29 Marcin Kościelnicki <koriakin@0x04.net>
* linux-s390-low.c (s390_supports_tracepoints): New function.
(struct linux_target_ops): Fill supports_tracepoints hook.
2016-03-18 Yao Qi <yao.qi@linaro.org>
* linux-low.c (lwp_signal_can_be_delivered): New function.
(linux_resume_one_lwp_throw): Use lwp_signal_can_be_delivered.
2016-03-18 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_resume_one_lwp_throw): Set 'signal' to
0 if signal is enqueued. Remove 'signal' from one debugging
message. Move one debugging message to some lines below.
Remove code setting 'signal' to 0.
2016-03-18 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_low_filter_event): Remove redundant
WIFSTOPPED check together with linux_wstatus_maybe_breakpoint.
2016-03-09 Marcin Kościelnicki <koriakin@0x04.net>
* linux-ppc-low.c (ppc_supports_tracepoints): New function.
(struct linux_target_ops): Wire in the above.
2016-03-03 Yao Qi <yao.qi@linaro.org>
* linux-low.c: Update comments to start_step_over.
[GDBserver] Leave child suspended when step over parent I see the following GDBserver internal error in two cases, gdb/gdbserver/linux-low.c:1922: A problem internal to GDBserver has been detected. unsuspend LWP 17200, suspended=-1 1. step over a breakpoint on fork/vfork syscall instruction, 2. step over a breakpoint on clone syscall instruction and child threads hits a breakpoint, the stack backtrace is #0 internal_error (file=file@entry=0x44c4c0 "gdb/gdbserver/linux-low.c", line=line@entry=1922, fmt=fmt@entry=0x44c7d0 "unsuspend LWP %ld, suspended=%d\n") at gdb/gdbserver/../common/errors.c:51 #1 0x0000000000424014 in lwp_suspended_decr (lwp=<optimised out>, lwp=<optimised out>) at gdb/gdbserver/linux-low.c:1922 #2 0x000000000042403a in unsuspend_one_lwp (entry=<optimised out>, except=0x66e8c0) at gdb/gdbserver/linux-low.c:2885 #3 0x0000000000405f45 in find_inferior (list=<optimised out>, func=func@entry=0x424020 <unsuspend_one_lwp>, arg=arg@entry=0x66e8c0) at gdb/gdbserver/inferiors.c:243 #4 0x00000000004297de in unsuspend_all_lwps (except=0x66e8c0) at gdb/gdbserver/linux-low.c:2895 #5 linux_wait_1 (ptid=..., ourstatus=ourstatus@entry=0x665ec0 <last_status>, target_options=target_options@entry=0) at gdb/gdbserver/linux-low.c:3632 #6 0x000000000042a764 in linux_wait (ptid=..., ourstatus=0x665ec0 <last_status>, target_options=0) at gdb/gdbserver/linux-low.c:3770 #7 0x0000000000411163 in mywait (ptid=..., ourstatus=ourstatus@entry=0x665ec0 <last_status>, options=options@entry=0, connected_wait=connected_wait@entry=1) at gdb/gdbserver/target.c:214 #8 0x000000000040b1f2 in resume (actions=0x66f800, num_actions=1) at gdb/gdbserver/server.c:2757 #9 0x000000000040f660 in handle_v_cont (own_buf=0x66a630 "vCont;c:p45e9.-1") at gdb/gdbserver/server.c:2719 when GDBserver steps over a thread, other threads have been suspended, the "stepping" thread may create new thread, but GDBserver doesn't set it suspend count to 1. When GDBserver unsuspend threads, the child's suspend count goes to -1, and the assert is triggered. In fact, GDBserver has already taken care of suspend count of new thread when GDBserver is suspending all threads except the one GDBserver wants to step over by https://sourceware.org/ml/gdb-patches/2015-07/msg00946.html + /* If we're suspending all threads, leave this one suspended + too. */ + if (stopping_threads == STOPPING_AND_SUSPENDING_THREADS) + { + if (debug_threads) + debug_printf ("HEW: leaving child suspended\n"); + child_lwp->suspended = 1; + } but that is not enough, because new thread is still can be spawned in the thread which is being stepped over. This patch extends the condition that GDBserver set child's suspend count to one if it is suspending threads or stepping over the thread. gdb/gdbserver: 2016-03-03 Yao Qi <yao.qi@linaro.org> PR server/19736 * linux-low.c (handle_extended_wait): Set child suspended if event_lwp->bp_reinsert isn't zero.
2016-03-03 10:17:44 +01:00
2016-03-03 Yao Qi <yao.qi@linaro.org>
PR server/19736
* linux-low.c (handle_extended_wait): Set child suspended
if event_lwp->bp_reinsert isn't zero.
2016-03-02 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_resume_one_lwp_throw): Replace code with
enqueue_pending_signal.
2016-03-02 Marcin Kościelnicki <koriakin@0x04.net>
* tracepoint.c (cmd_qtstart): Only set ipa_tdesc_idx if agent
is actually loaded.
2016-02-25 Marcin Kościelnicki <koriakin@0x04.net>
* linux-s390-low.c (s390_num_regs_3264): Define on 31-bit too.
(s390_regmap_3264) [!__s390x__]: New global.
(s390_collect_ptrace_register): Skip map entries containing -1.
(s390_supply_ptrace_register): Ditto.
(s390_fill_gprs_high): New function.
(s390_store_gprs_high): New function.
(s390_regsets): Add NT_S390_HIGH_GPRS.
(s390_get_hwcap): Enable on 31-bit.
(have_hwcap_s390_high_gprs): Enable on 31-bit.
(s390_arch_setup): Enable detection of high GPRs, TDB, VX on 31-bit.
Detect NT_S390_HIGH_GPRS.
(s390_usrregs_info_3264): Enable on 31-bit.
(s390_regs_info): Enable regs_info_3264 on 31-bit.
(initialize_low_arch): Initialize s390_regsets_info_3264 on 31-bit.
[PR gdb/13808] gdb.trace: Pass tdesc selected in gdbserver to IPA. If gdbserver and IPA are using different tdesc, they will disagree about 'R' trace packet size. This results in mangled traces. To make sure they pick the same tdesc, gdbserver pokes the tdesc (specified as an index in a target-specific list) into a global variable in IPA. In theory, IPA could find out the tdesc on its own, but that may be complex (in particular, I don't know how to tell whether we have LAST_BREAK on s390 without messing with ptrace), and we'd have to duplicate the logic. Tested on i386 and x86_64. On i386, it fixes two FAILs in ftrace.exp. On x86_64, these failures have been KFAILed - one of them works now, but the other now fails due to an unrelated reason (ugh). gdb/gdbserver/ChangeLog: PR gdb/13808 * Makefile.in: Add i386-*-linux-ipa.o and amd64-*-linux-ipa.o. * configure.srv: Ditto. * linux-aarch64-ipa.c (get_ipa_tdesc): New function. (initialize_low_tracepoint): Remove ipa_tdesc assignment. * linux-amd64-ipa.c: Add "linux-x86-tdesc.h" include. (init_registers_amd64_linux): Remove prototype. (tdesc_amd64_linux): Remove declaration. (get_ipa_tdesc): New function. (initialize_low_tracepoint): Remove ipa_tdesc assignment, initialize remaining tdescs. * linux-i386-ipa.c: Add "linux-x86-tdesc.h" include. (init_registers_i386_linux): Remove prototype. (tdesc_i386_linux): Remove declaration. (get_ipa_tdesc): New function. (initialize_low_tracepoint): Remove ipa_tdesc assignment, initialize remaining tdescs. * linux-low.c (linux_get_ipa_tdesc_idx): New function. (linux_target_ops): wire in linux_get_ipa_tdesc_idx. * linux-low.h (struct linux_target_ops): Add get_ipa_tdesc_idx. * linux-x86-low.c: Move tdesc declarations to linux-x86-tdesc.h. (x86_get_ipa_tdesc_idx): New function. (the_low_target): Wire in x86_get_ipa_tdesc_idx. * linux-x86-tdesc.h: New file. * target.h (struct target_ops): Add get_ipa_tdesc_idx. (target_get_ipa_tdesc_idx): New macro. * tracepoint.c (ipa_tdesc_idx): New macro. (struct ipa_sym_addresses): Add addr_ipa_tdesc_idx. (symbol_list): Add ipa_tdesc_idx. (cmd_qtstart): Write ipa_tdesc_idx in the target. (ipa_tdesc): Remove. (ipa_tdesc_idx): New variable. (get_context_regcache): Use get_ipa_tdesc. (gdb_collect): Ditto. (gdb_probe): Ditto. * tracepoint.h (get_ipa_tdesc): New prototype. (ipa_tdesc): Remove. gdb/testsuite/ChangeLog: PR gdb/13808 * gdb.trace/ftrace.exp (test_fast_tracepoints): Remove kfail.
2016-02-21 21:44:48 +01:00
2016-02-25 Marcin Kościelnicki <koriakin@0x04.net>
PR gdb/13808
* Makefile.in: Add i386-*-linux-ipa.o and amd64-*-linux-ipa.o.
* configure.srv: Ditto.
* linux-aarch64-ipa.c (get_ipa_tdesc): New function.
(initialize_low_tracepoint): Remove ipa_tdesc assignment.
* linux-amd64-ipa.c: Add "linux-x86-tdesc.h" include.
(init_registers_amd64_linux): Remove prototype.
(tdesc_amd64_linux): Remove declaration.
(get_ipa_tdesc): New function.
(initialize_low_tracepoint): Remove ipa_tdesc assignment,
initialize remaining tdescs.
* linux-i386-ipa.c: Add "linux-x86-tdesc.h" include.
(init_registers_i386_linux): Remove prototype.
(tdesc_i386_linux): Remove declaration.
(get_ipa_tdesc): New function.
(initialize_low_tracepoint): Remove ipa_tdesc assignment,
initialize remaining tdescs.
* linux-low.c (linux_get_ipa_tdesc_idx): New function.
(linux_target_ops): wire in linux_get_ipa_tdesc_idx.
* linux-low.h (struct linux_target_ops): Add get_ipa_tdesc_idx.
* linux-x86-low.c: Move tdesc declarations to linux-x86-tdesc.h.
(x86_get_ipa_tdesc_idx): New function.
(the_low_target): Wire in x86_get_ipa_tdesc_idx.
* linux-x86-tdesc.h: New file.
* target.h (struct target_ops): Add get_ipa_tdesc_idx.
(target_get_ipa_tdesc_idx): New macro.
* tracepoint.c (ipa_tdesc_idx): New macro.
(struct ipa_sym_addresses): Add addr_ipa_tdesc_idx.
(symbol_list): Add ipa_tdesc_idx.
(cmd_qtstart): Write ipa_tdesc_idx in the target.
(ipa_tdesc): Remove.
(ipa_tdesc_idx): New variable.
(get_context_regcache): Use get_ipa_tdesc.
(gdb_collect): Ditto.
(gdb_probe): Ditto.
* tracepoint.h (get_ipa_tdesc): New prototype.
(ipa_tdesc): Remove.
Handle MIPS Linux SIGTRAP siginfo.si_code values This unbreaks pending/delayed breakpoints handling, as well as hardware watchpoints, on MIPS. Ref: https://sourceware.org/ml/gdb-patches/2016-02/msg00681.html The MIPS kernel reports SI_KERNEL for all kernel generated traps, instead of TRAP_BRKPT / TRAP_HWBKPT, but GDB isn't aware of this. Basically, this commit: - Folds watchpoints logic into check_stopped_by_breakpoint, and renames it to save_stop_reason. - Adds GDB_ARCH_IS_TRAP_HWBKPT. - Makes MIPS set both GDB_ARCH_IS_TRAP_BRPT and GDB_ARCH_IS_TRAP_HWBKPT to SI_KERNEL. In save_stop_reason, we handle the case of the same si_code returning true for both TRAP_BRPT and TRAP_HWBKPT by looking at what the debug registers say. Tested on x86-64 Fedora 20, native and gdbserver. gdb/ChangeLog: 2016-02-24 Pedro Alves <palves@redhat.com> * linux-nat.c (save_sigtrap) Delete. (stop_wait_callback): Call save_stop_reason instead of save_sigtrap. (check_stopped_by_breakpoint): Rename to ... (save_stop_reason): ... this. Bits of save_sigtrap folded here. Use GDB_ARCH_IS_TRAP_HWBKPT and handle ambiguous GDB_ARCH_IS_TRAP_BRKPT / GDB_ARCH_IS_TRAP_HWBKPT. Factor out common code between the USE_SIGTRAP_SIGINFO and !USE_SIGTRAP_SIGINFO blocks. (linux_nat_filter_event): Call save_stop_reason instead of save_sigtrap. * nat/linux-ptrace.h: Check for both SI_KERNEL and TRAP_BRKPT si_code for MIPS. * nat/linux-ptrace.h: Fix "TRAP_HWBPT" typo in x86 table. Add comments on MIPS behavior. (GDB_ARCH_IS_TRAP_HWBKPT): Define for all archs. gdb/gdbserver/ChangeLog: 2016-02-24 Pedro Alves <palves@redhat.com> * linux-low.c (check_stopped_by_breakpoint): Rename to ... (save_stop_reason): ... this. Use GDB_ARCH_IS_TRAP_HWBKPT and handle ambiguous GDB_ARCH_IS_TRAP_BRKPT / GDB_ARCH_IS_TRAP_HWBKPT. Factor out common code between the USE_SIGTRAP_SIGINFO and !USE_SIGTRAP_SIGINFO blocks. (linux_low_filter_event): Call save_stop_reason instead of check_stopped_by_breakpoint and check_stopped_by_watchpoint. Update comments. (linux_wait_1): Update comments.
2016-02-24 23:52:06 +01:00
2016-02-24 Pedro Alves <palves@redhat.com>
* linux-low.c (check_stopped_by_breakpoint): Rename to ...
(save_stop_reason): ... this. Use GDB_ARCH_IS_TRAP_HWBKPT and
handle ambiguous GDB_ARCH_IS_TRAP_BRKPT / GDB_ARCH_IS_TRAP_HWBKPT.
Factor out common code between the USE_SIGTRAP_SIGINFO and
!USE_SIGTRAP_SIGINFO blocks.
(linux_low_filter_event): Call save_stop_reason instead of
check_stopped_by_breakpoint and check_stopped_by_watchpoint.
Update comments.
(linux_wait_1): Update comments.
2016-02-24 Wei-cheng Wang <cole945@gmail.com>
* linux-ppc-low.c (ppc_supports_z_point_type): New function:
(ppc_insert_point, ppc_remove_point): Insert/remove z-packet breakpoints.
(ppc64_emit_ops_vector): Add target ops - ppc_supports_z_point_type,
ppc_insert_point, ppc_remove_point.
2016-02-17 Marcin Kościelnicki <koriakin@0x04.net>
* linux-s390-low.c (s390_supports_z_point_type): New function.
(struct linux_target_ops): Wire s390_supports_z_point_type in.
2016-02-16 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (get_next_pcs_syscall_next_pc): Remove argument
PC. Get pc from regcache_read_pc.
2016-02-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_get_pc): Call linux_get_pc_64bit
or linux_get_pc_32bit.
(aarch64_set_pc): Call linux_set_pc_64bit or linux_set_pc_32bit.
[ARM] Fixup PC in software single step When I exercise GDBserver software single step, I see the following error, which has been already handled by GDB properly. In GDBserver log, we can see, GDBserver tries to single step instruction on 0xb6e0a6e4, and destination address is 0xffff0fe0, stop pc is 0xb6e0a6e4 Writing f001f0e7 to 0xffff0fe0 in process 7132 Failed to insert breakpoint at 0xffff0fe0 (Input/output error). Failed to insert breakpoint at 0xffff0fe0 (-1). (gdb) disassemble __aeabi_read_tp,+8 Dump of assembler code from 0xb6e0a6e0 to 0xb6e0a6e8: 0xb6e0a6e0 <__aeabi_read_tp+0>: mvn r0, #61440 ; 0xf000 0xb6e0a6e4 <__aeabi_read_tp+4>: sub pc, r0, #31 however, it fails inserting breakpoint there. This problem has already fixed by GDB, see comments in arm-linux-tdep.c:arm_linux_software_single_step /* The Linux kernel offers some user-mode helpers in a high page. We can not read this page (as of 2.6.23), and even if we could then we couldn't set breakpoints in it, and even if we could then the atomic operations would fail when interrupted. They are all called as functions and return to the address in LR, so step to there instead. */ so we need to do the same thing in GDB side as well. This patch adds a new field fixup in arm_get_next_pcs_ops, so that we can fix up PC for arm-linux target. In this way, both GDB and GDBserver can single step instructions going to kernel helpers. gdb: 2016-02-12 Yao Qi <yao.qi@linaro.org> * arch/arm-get-next-pcs.c (arm_get_next_pcs): Call self->ops->fixup if it isn't NULL. * arch/arm-get-next-pcs.h: Include gdb_vecs.h. (struct arm_get_next_pcs_ops) <fixup>: New field. * arch/arm-linux.c: Include common-regcache.h and arch/arm-get-next-pcs.h. (arm_linux_get_next_pcs_fixup): New function. * arch/arm-linux.h (arm_linux_get_next_pcs_fixup): Declare. * arm-linux-tdep.c (arm_linux_get_next_pcs_ops): Initialize it with arm_linux_get_next_pcs_fixup. (arm_linux_software_single_step): Move code to arm_linux_get_next_pcs_fixup. * arm-tdep.c (arm_get_next_pcs_ops): Initialize it. gdb/gdbserver: 2016-02-12 Yao Qi <yao.qi@linaro.org> * linux-arm-low.c (get_next_pcs_ops): Initialize it with arm_linux_get_next_pcs_fixup.
2016-02-08 17:05:31 +01:00
2016-02-12 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (get_next_pcs_ops): Initialize it with
arm_linux_get_next_pcs_fixup.
2016-02-12 Marcin Kościelnicki <koriakin@0x04.net>
* tracepoint.c (x_tracepoint_action_download): Change
write_inferior_data_ptr to write_inferior_data_pointer.
(cmd_qtstart): Likewise.
(write_inferior_data_ptr): Remove.
(download_agent_expr): Change write_inferior_data_ptr to
write_inferior_data_pointer.
(download_tracepoint_1): Likewise.
(download_tracepoint): Likewise.
(download_trace_state_variables): Likewise.
gdbserver: Remove tracepoint_action ops. This patch removes 'ops' in tracepoint, and uses helper functions to call action handler instead. The object layout of tracepoint_action may differ in gdbserver and inferior depend on the alignment rule of target ABI, so gdbserver cannot simply copy the object from its memory to inferior memory. For example, struct collect_memory_action { struct tracepoint_action base; { #ifndef IN_PROCESS_AGENT const struct tracepoint_action_ops *ops; #if - char type; | } | ULONGEST addr; | ULONGEST len; - int32_t basereg; }; and on PowerPC, Wihtout ops with ops 0 1 2 3 0 1 2 3 0 |type| PADDING... 0 |ops-------------| 4 ................. 4 |type|PADDING....| 8 |addr------------ 8 |addr------------- c ----------------| c -----------------| 10 |len------------- 10 |len-------------- 14 ----------------| 14 -----------------| 18 |basereg--------| 18 |basereg---------| so we cannot directly copy the object. In this patch, 'ops' is removed in order to make the objects identical. gdb/gdbserver/ChangeLog: 2016-02-11 Wei-cheng Wang <cole945@gmail.com> Marcin Kościelnicki <koriakin@0x04.net> * tracepoint.c (struct tracepoint_action_ops): Remove. (struct tracepoint_action): Remove ops. (m_tracepoint_action_download, r_tracepoint_action_download) (x_tracepoint_action_download, l_tracepoint_action_download): Adjust size and offset accordingly. (m_tracepoint_action_ops, r_tracepoint_action_ops) (x_tracepoint_action_ops, l_tracepoint_action_ops): Remove. (tracepoint_action_send, tracepoint_action_download): New functions. Helpers for trace action handlers. (add_tracepoint_action): Remove setup actions ops. (download_tracepoint_1, tracepoint_send_agent): Call helper functions.
2015-06-27 18:21:38 +02:00
2016-02-11 Wei-cheng Wang <cole945@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
* tracepoint.c (struct tracepoint_action_ops): Remove.
(struct tracepoint_action): Remove ops.
(m_tracepoint_action_download, r_tracepoint_action_download)
(x_tracepoint_action_download, l_tracepoint_action_download): Adjust
size and offset accordingly.
(m_tracepoint_action_ops, r_tracepoint_action_ops)
(x_tracepoint_action_ops, l_tracepoint_action_ops): Remove.
(tracepoint_action_send, tracepoint_action_download): New functions.
Helpers for trace action handlers.
(add_tracepoint_action): Remove setup actions ops.
(download_tracepoint_1, tracepoint_send_agent): Call helper functions.
2016-02-10 Yao Qi <yao.qi@linaro.org>
* regcache.c (regcache_raw_read_unsigned): Clear *VAL.
2016-02-09 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Use AC_CONFIG_FILES instead of passing arguments
to AC_OUTPUT.
* configure: Regenerate.
Fix siginfo C++ build error Change the signature of gdbserver's siginfo_fixup functions so that it's in line with gdb's. This gets rid of the following build error in C++: /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c: In function ‘int x86_siginfo_fixup(siginfo_t*, void*, int)’: /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c:694:21: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive] FIXUP_32); ^ In file included from /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c:31:0: /home/emaisin/src/binutils-gdb/gdb/gdbserver/../nat/amd64-linux-siginfo.h:52:5: error: initializing argument 2 of ‘int amd64_linux_siginfo_fixup_common(siginfo_t*, gdb_byte*, int, amd64_siginfo_fixup_mode)’ [-fpermissive] int amd64_linux_siginfo_fixup_common (siginfo_t *native, gdb_byte *inf, ^ /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c:698:20: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive] FIXUP_X32); ^ In file included from /home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-x86-low.c:31:0: /home/emaisin/src/binutils-gdb/gdb/gdbserver/../nat/amd64-linux-siginfo.h:52:5: error: initializing argument 2 of ‘int amd64_linux_siginfo_fixup_common(siginfo_t*, gdb_byte*, int, amd64_siginfo_fixup_mode)’ [-fpermissive] int amd64_linux_siginfo_fixup_common (siginfo_t *native, gdb_byte *inf, ^ gdb/gdbserver/ChangeLog: * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): Change void * to gdb_byte *. * linux-low.c (siginfo_fixup): Likewise. (linux_xfer_siginfo): Likewise. * linux-low.h (struct linux_target_ops) <siginfo_fixup>: Likewise. * linux-x86-low.c (x86_siginfo_fixup): Likewise.
2016-02-09 12:18:15 +01:00
2016-02-09 Simon Marchi <simon.marchi@ericsson.com>
* linux-aarch64-low.c (aarch64_linux_siginfo_fixup): Change
void * to gdb_byte *.
* linux-low.c (siginfo_fixup): Likewise.
(linux_xfer_siginfo): Likewise.
* linux-low.h (struct linux_target_ops) <siginfo_fixup>:
Likewise.
* linux-x86-low.c (x86_siginfo_fixup): Likewise.
Merge gdb and gdbserver implementations for siginfo Extract the compatible siginfo handling from amd64-linux-nat.c and gdbserver/linux-x86-low to a new file nat/amd64-linux-siginfo.c. 2016-02-02 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * nat/amd64-linux-siginfo.c: New file. * nat/amd64-linux-siginfo.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add nat/amd64-linux-siginfo.h. (amd64-linux-siginfo.o): New rule. * config/i386/linux64.mh (NATDEPFILES): Add amd64-linux-siginfo.o. * amd64-linux-nat.c (nat/amd64-linux-siginfo.h): New include. (compat_siginfo_from_siginfo, siginfo_from_compat_siginfo) (compat_x32_siginfo_from_siginfo, siginfo_from_compat_x32_siginfo) (compat_timeval, compat_sigval, compat_x32_clock, cpt_si_pid) (cpt_si_uid, cpt_si_timerid, cpt_si_overrun, cpt_si_status) (cpt_si_utime, cpt_si_stime, cpt_si_ptr, cpt_si_addr, cpt_si_band) (cpt_si_fd, si_timerid, si_overrun): Move to nat/amd64-linux-siginfo.c. gdb/gdbserver/ChangeLog: * configure.srv (x86_64-*-linux*): Add amd64-linux-siginfo.o to srv_tgtobj. (i[34567]86-*-linux*): Add amd64-linux-siginfo.o to srv_tgtobj. * linux-x86-low.c [__x86_64__]: Include "nat/amd64-linux-siginfo.h". (compat_siginfo_from_siginfo, siginfo_from_compat_siginfo) (compat_x32_siginfo_from_siginfo, siginfo_from_compat_x32_siginfo) (compat_timeval, compat_sigval, compat_x32_clock, cpt_si_pid) (cpt_si_uid, cpt_si_timerid, cpt_si_overrun, cpt_si_status) (cpt_si_utime, cpt_si_stime, cpt_si_ptr, cpt_si_addr, cpt_si_band) (cpt_si_fd, si_timerid, si_overrun): Move from nat/amd64-linux-siginfo.c. * Makefile.in (amd64-linux-siginfo.o:): New rule.
2016-02-02 11:42:56 +01:00
2016-02-02 Walfred Tedeschi <walfred.tedeschi@intel.com>
* configure.srv (x86_64-*-linux*): Add amd64-linux-siginfo.o
to srv_tgtobj.
(i[34567]86-*-linux*): Add amd64-linux-siginfo.o
to srv_tgtobj.
* linux-x86-low.c [__x86_64__]: Include
"nat/amd64-linux-siginfo.h".
(compat_siginfo_from_siginfo, siginfo_from_compat_siginfo)
(compat_x32_siginfo_from_siginfo, siginfo_from_compat_x32_siginfo)
(compat_timeval, compat_sigval, compat_x32_clock, cpt_si_pid)
(cpt_si_uid, cpt_si_timerid, cpt_si_overrun, cpt_si_status)
(cpt_si_utime, cpt_si_stime, cpt_si_ptr, cpt_si_addr, cpt_si_band)
(cpt_si_fd, si_timerid, si_overrun): Move from
nat/amd64-linux-siginfo.c.
* Makefile.in (amd64-linux-siginfo.o:): New rule.
2016-01-28 Simon Marchi <simon.marchi@ericsson.com>
* server.c (skip_to_semicolon): Remove.
(process_point_options): Use strchrnul instead of
skip_to_semicolon.
2016-01-26 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (arm_gdbserver_get_next_pcs): Remove argument pc.
* linux-low.c (install_software_single_step_breakpoints): Don't
call regcache_read_pc.
* linux-low.h (struct linux_target_ops) <get_next_pcs>: Remove
argument pc.
2016-01-26 Yao Qi <yao.qi@linaro.org>
* linux-low.c (install_software_single_step_breakpoints): Call
regcache_read_pc instead of get_pc.
2016-01-26 Yao Qi <yao.qi@linaro.org>
* remote-utils.c (remote_close) [!USE_WIN32API]: Ignore SIGIO.
(unblock_async_io): Rename to ...
(block_unblock_async_io): ... it. New function.
(enable_async_io): Don't install SIGIO handler. Unblock it
instead.
(disable_async_io): Don't ignore SIGIO. Block it instead.
(initialize_async_io): Install SIGIO handler. Don't call
unblock_async_io.
[GDBserver] Check input interrupt after reading in a packet GDBserver may read some packet together with '\003' in one go. We've already checked '\003' first when reading packet by my patch, Check input interrupt first when reading packet https://sourceware.org/ml/gdb-patches/2016-01/msg00057.html but if we don't check '\003' *after* each packet, the interrupt will be processed next time GDBserver reads from the buffer, so that the interrupt isn't processed in time. For example, GDB sends vCont;c and interrupt (see gdb.base/interrupt-noterm.exp), we'll resume the inferior and wait once packet vCont;c is seen. If we don't check the interrupt character after vCont;c packet, interrupt character will stay in the buffer unattended until GDBserver returns from the wait, which may take a while. Note that since we've read '\003' from file descriptor, SIGIO signal handler input_interrupt doesn't help either. This issue can be exposed by hacking the end of getpkt like @@ -1041,6 +1050,9 @@ getpkt (char *buf) } } + if (readchar_bufcnt > 0) + gdb_assert (*readchar_bufp != '\003'); + return bp - buf; } and this can trigger internal error, (gdb) PASS: gdb.base/interrupt-noterm.exp: interrupt Remote connection closed^M (gdb) FAIL: gdb.base/interrupt-noterm.exp: inferior received SIGINT Remote debugging from host 10.2.206.40^M /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/remote-utils.c:1054: A problem internal to GDBserver has been detected.^M getpkt: Assertion `*readchar_bufp != '\003'' failed.^M This patch is to peek the buffer, if it is '\003', consume it and call *the_target->request_interrupt. gdb/gdbserver: 2016-01-26 Yao Qi <yao.qi@linaro.org> * remote-utils.c (getpkt): If the buffer isn't empty, and the first character is '\003', call *the_target->request_interrupt.
2016-01-26 14:50:22 +01:00
2016-01-26 Yao Qi <yao.qi@linaro.org>
* remote-utils.c (getpkt): If the buffer isn't empty, and the
first character is '\003', call *the_target->request_interrupt.
2016-01-25 Yao Qi <yao.qi@linaro.org>
* remote-utils.c (new_thread_notify): Remove.
(dead_thread_notify): Likewise.
* remote-utils.h (new_thread_notify): Remove declaration.
(dead_thread_notify): Likewise.
2016-01-23 Marcin Kościelnicki <koriakin@0x04.net>
* gdb.trace/pending.exp: Fix expected message on continue.
2016-01-22 Marcin Kościelnicki <koriakin@0x04.net>
* tracepoint.c (write_inferior_data_ptr): Cast to uintptr_t, so that
it works properly on big-endian machines where sizeof (CORE_ADDR)
!= sizeof (void *).
2016-01-21 Pedro Alves <palves@redhat.com>
* Makefile.in (COMPILER_CFLAGS, CXXFLAGS): New.
(INTERNAL_CFLAGS_BASE): Use COMPILER_CFLAGS instead of CFLAGS.
* configure: Regenerate.
Detect the arm/thumb mode of code SIGRETURN or RT_SIGRETURN returns to This patch fixes the following regression introduced by commit d0e59a68 step^M 39 } /* handler */^M 1: x/i $pc^M => 0x8740 <handler+80>: sub sp, r11, #0^M (gdb) step^M ^M Program received signal SIGSEGV, Segmentation fault.^M setitimer () at ../sysdeps/unix/syscall-template.S:81^M 81 ../sysdeps/unix/syscall-template.S: No such file or directory.^M 1: x/i $pc^M => 0xb6eff9c0 <setitimer>: push {r7}^M (gdb) FAIL: gdb.base/sigstep.exp: continue to handler, si+advance in handler, step from handler: leave handler in my test setting, program is compiled in arm mode, but the glibc is built in thumb mode, so when we do 'step' to step over syscall instruction svc for SIGRETURN, GDB should set breakpoint for arm mode in the program, even though the current program in glibc is in thumb mode. Current GDB doesn't consider the case that the mode of program SIGRETURN goes to can be different from current program mode. In fact, GDB has taken care of this arm/thumb mode changes already, see /* Copy the value of next pc of sigreturn and rt_sigrturn into PC, return 1. In addition, set IS_THUMB depending on whether we will return to ARM or Thumb code. Return 0 if it is not a rt_sigreturn/sigreturn syscall. */ static int arm_linux_sigreturn_return_addr (struct frame_info *frame, unsigned long svc_number, CORE_ADDR *pc, int *is_thumb) but in the commit d0e59a68 > - arm_linux_sigreturn_return_addr (frame, svc_number, &return_addr, &is_thumb); > + if (svc_number == ARM_SIGRETURN || svc_number == ARM_RT_SIGRETURN) > + next_pc = arm_linux_sigreturn_next_pc (regcache, svc_number); the IS_THUMB setting is lost, so it is a regression. gdb: 2016-01-21 Yao Qi <yao.qi@linaro.org> * arm-linux-tdep.c (arm_linux_sigreturn_next_pc): Add parameter is_thumb and set it according to CPSR saved on the stack. (arm_linux_get_next_pcs_syscall_next_pc): Pass is_thumb to arm_linux_sigreturn_next_pc. gdb/gdbserver: 2016-01-21 Yao Qi <yao.qi@linaro.org> * linux-arm-low.c (arm_sigreturn_next_pc): Add parameter is_thumb and set it according to CPSR saved on the stack. (get_next_pcs_syscall_next_pc): Pass is_thumb to arm_sigreturn_next_pc.
2016-01-21 08:48:50 +01:00
2016-01-21 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (arm_sigreturn_next_pc): Add parameter
is_thumb and set it according to CPSR saved on the stack.
(get_next_pcs_syscall_next_pc): Pass is_thumb to
arm_sigreturn_next_pc.
2016-01-18 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_set_pc_64bit): New function.
(linux_get_pc_64bit): New function.
* linux-low.h (linux_set_pc_64bit, linux_get_pc_64bit):
Declare.
* linux-sparc-low.c (debug_threads): Remove declaration.
(sparc_get_pc): Remove.
(the_low_target): Use linux_get_pc_64bit instead of
sparc_get_pc.
* linux-tile-low.c (tile_get_pc, tile_set_pc): Remove.
(the_low_target): Use linux_get_pc_64bit and
linux_set_pc_64bit.
Replace some $ARCH_{get,set}_pc with linux_{get,set}_pc_32bit This patch adds a pair of new functions linux_get_pc_32bit and linux_set_pc_32bit which get and set 32-bit register "pc" from regcache. This function can be used some targets and these own $ARCH_{get,set}_pc are replaced by linux_{get,set}_pc_32bit respectively. This patch touches many targets, but I only have arm board to test and no regression. I also rebuilt nios2-linux GDBserver. If it is right to go, I'll post the 64-bit counterpart later. gdb/gdbserver: 2016-01-18 Yao Qi <yao.qi@linaro.org> * linux-arm-low.c (debug_threads): Remove declaration. (arm_get_pc, arm_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-bfin-low.c (bfin_get_pc, bfin_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-cris-low.c (debug_threads): Remove declaration. (cris_get_pc, cris_set_pc,): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-crisv32-low.c (debug_threads): Remove declaration. (cris_get_pc, cris_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-low.c: Include inttypes.h. (linux_get_pc_32bit, linux_set_pc_32bit): New functions. * linux-low.h (linux_get_pc_32bit, linux_set_pc_32bit): Declare. * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-m68k-low.c (m68k_get_pc, m68k_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-nios2-low.c (nios2_get_pc, nios2_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-sh-low.c (sh_get_pc, sh_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit. * linux-xtensa-low.c (xtensa_get_pc, xtensa_set_pc): Remove. (the_low_target): Use linux_get_pc_32bit and linux_set_pc_32bit.
2016-01-18 15:49:50 +01:00
2016-01-18 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (debug_threads): Remove declaration.
(arm_get_pc, arm_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-bfin-low.c (bfin_get_pc, bfin_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-cris-low.c (debug_threads): Remove declaration.
(cris_get_pc, cris_set_pc,): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-crisv32-low.c (debug_threads): Remove declaration.
(cris_get_pc, cris_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-low.c: Include inttypes.h.
(linux_get_pc_32bit, linux_set_pc_32bit): New functions.
* linux-low.h (linux_get_pc_32bit, linux_set_pc_32bit): Declare.
* linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-m68k-low.c (m68k_get_pc, m68k_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-nios2-low.c (nios2_get_pc, nios2_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-sh-low.c (sh_get_pc, sh_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-xtensa-low.c (xtensa_get_pc, xtensa_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
2016-01-18 Gary Benson <gbenson@redhat.com>
* configure.ac (AC_FUNC_FORK): New check.
* config.in: Regenerate.
* configure: Likewise.
[ARM] Make thumb2_breakpoint static again This patch makes thumb2_breakpoint static. When writing this patch, I find the only reason we keep thumb2_breakpoint extern is that it is used as an argument passed to arm_gdbserver_get_next_pcs. However, field arm_thumb2_breakpoint is only used in a null check in thumb_get_next_pcs_raw, so I wonder why do need to pass thumb2_breakpoint to arm_gdbserver_get_next_pcs. thumb2_breakpoint was added by Daniel Jacobowitz in order to support single-step IT block https://sourceware.org/ml/gdb-patches/2010-01/msg00624.html the logic there was if we have 32-bit thumb-2 breakpoint defined, we can safely single-step IT block, otherwise, we can't. Daniel didn't want to use 16-bit thumb BKPT instruction, because it triggers even on instruction which should be executed. Secondly, using 16-bit thumb illegal instruction on top of 32-bit thumb instruction may break the meaning of original IT blocks, because the other 16-bit can be regarded as an instruction. See more explanations from Daniel's kernel patch http://www.spinics.net/lists/arm-kernel/msg80476.html Let us back to this patch, GDB/GDBserver can safely single step IT block if thumb2_breakpoint is defined, but the single step logic doesn't have to know the thumb-2 breakpoint instruction. Only breakpoint insertion mechanism decides to use which breakpoint instruction. In the software single step code, instead of pass thumb2_breakpoint, we can pass a boolean variable has_thumb2_breakpoint indicate whether the target has thumb-2 breakpoint defined, which is equivalent to the original code. Regression tested on arm-linux. No regression. gdb: 2016-01-14 Yao Qi <yao.qi@linaro.org> * arch/arm-get-next-pcs.c (arm_get_next_pcs_ctor): Change argument arm_thumb2_breakpoint to has_thumb2_breakpoint. (thumb_get_next_pcs_raw): Check has_thumb2_breakpoint instead. * arch/arm-get-next-pcs.h (struct arm_get_next_pcs) <arm_thumb2_breakpoint>: Remove. <has_thumb2_breakpoint>: New field. (arm_get_next_pcs_ctor): Update declaration. * arm-linux-tdep.c (arm_linux_software_single_step): Pass 1 to arm_get_next_pcs_ctor. * arm-tdep.c (arm_software_single_step): Pass 0 to arm_get_next_pcs_ctor. gdb/gdbserver: 2016-01-14 Yao Qi <yao.qi@linaro.org> * linux-aarch32-low.c (thumb2_breakpoint): Make it static. * linux-aarch32-low.h (thumb2_breakpoint): Remove declaration. * linux-arm-low.c (arm_gdbserver_get_next_pcs): Pass 1 to arm_get_next_pcs_ctor.
2016-01-14 10:36:43 +01:00
2016-01-14 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c (thumb2_breakpoint): Make it static.
* linux-aarch32-low.h (thumb2_breakpoint): Remove declaration.
* linux-arm-low.c (arm_gdbserver_get_next_pcs): Pass 1 to
arm_get_next_pcs_ctor.
Implement 'catch syscall' for gdbserver This adds a new QCatchSyscalls packet to enable 'catch syscall', and new stop reasons "syscall_entry" and "syscall_return" for those events. It is currently only supported on Linux x86 and x86_64. gdb/ChangeLog: 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * NEWS (Changes since GDB 7.10): Mention QCatchSyscalls and the syscall_entry and syscall_return stop reasons. Mention GDB support for remote catch syscall. * remote.c (PACKET_QCatchSyscalls): New enum. (remote_set_syscall_catchpoint): New function. (remote_protocol_features): New element for QCatchSyscalls. (remote_parse_stop_reply): Parse syscall_entry/return stops. (init_remote_ops): Install remote_set_syscall_catchpoint. (_initialize_remote): Config QCatchSyscalls. * linux-nat.h (struct lwp_info) <syscall_state>: Comment typo. gdb/doc/ChangeLog: 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.texinfo (Remote Configuration): List the QCatchSyscalls packet. (Stop Reply Packets): List the syscall entry and return stop reasons. (General Query Packets): Describe QCatchSyscalls, and add it to the table and the detailed list of stub features. gdb/gdbserver/ChangeLog: 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * inferiors.h: Include "gdb_vecs.h". (struct process_info): Add syscalls_to_catch. * inferiors.c (remove_process): Free syscalls_to_catch. * remote-utils.c (prepare_resume_reply): Report syscall_entry and syscall_return stops. * server.h (UNKNOWN_SYSCALL, ANY_SYSCALL): Define. * server.c (handle_general_set): Handle QCatchSyscalls. (handle_query): Report support for QCatchSyscalls. * target.h (struct target_ops): Add supports_catch_syscall. (target_supports_catch_syscall): New macro. * linux-low.h (struct linux_target_ops): Add get_syscall_trapinfo. (struct lwp_info): Add syscall_state. * linux-low.c (handle_extended_wait): Mark syscall_state as an entry. Maintain syscall_state and syscalls_to_catch across exec. (get_syscall_trapinfo): New function, proxy to the_low_target. (linux_low_ptrace_options): Enable PTRACE_O_TRACESYSGOOD. (linux_low_filter_event): Toggle syscall_state entry/return for syscall traps, and set it ignored for all others. (gdb_catching_syscalls_p): New function. (gdb_catch_this_syscall_p): New function. (linux_wait_1): Handle SYSCALL_SIGTRAP. (linux_resume_one_lwp_throw): Add PTRACE_SYSCALL possibility. (linux_supports_catch_syscall): New function. (linux_target_ops): Install it. * linux-x86-low.c (x86_get_syscall_trapinfo): New function. (the_low_target): Install it. gdb/testsuite/ChangeLog: 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.base/catch-syscall.c (do_execve): New variable. (main): Conditionally trigger an execve. * gdb.base/catch-syscall.exp: Enable testing for remote targets. (test_catch_syscall_execve): New, check entry/return across execve. (do_syscall_tests): Call test_catch_syscall_execve.
2016-01-12 21:27:27 +01:00
2016-01-12 Josh Stone <jistone@redhat.com>
Philippe Waroquiers <philippe.waroquiers@skynet.be>
* inferiors.h: Include "gdb_vecs.h".
(struct process_info): Add syscalls_to_catch.
* inferiors.c (remove_process): Free syscalls_to_catch.
* remote-utils.c (prepare_resume_reply): Report syscall_entry and
syscall_return stops.
* server.h (UNKNOWN_SYSCALL, ANY_SYSCALL): Define.
* server.c (handle_general_set): Handle QCatchSyscalls.
(handle_query): Report support for QCatchSyscalls.
* target.h (struct target_ops): Add supports_catch_syscall.
(target_supports_catch_syscall): New macro.
* linux-low.h (struct linux_target_ops): Add get_syscall_trapinfo.
(struct lwp_info): Add syscall_state.
* linux-low.c (handle_extended_wait): Mark syscall_state as an entry.
Maintain syscall_state and syscalls_to_catch across exec.
(get_syscall_trapinfo): New function, proxy to the_low_target.
(linux_low_ptrace_options): Enable PTRACE_O_TRACESYSGOOD.
(linux_low_filter_event): Toggle syscall_state entry/return for
syscall traps, and set it ignored for all others.
(gdb_catching_syscalls_p): New function.
(gdb_catch_this_syscall_p): New function.
(linux_wait_1): Handle SYSCALL_SIGTRAP.
(linux_resume_one_lwp_throw): Add PTRACE_SYSCALL possibility.
(linux_supports_catch_syscall): New function.
(linux_target_ops): Install it.
* linux-x86-low.c (x86_get_syscall_trapinfo): New function.
(the_low_target): Install it.
2016-01-12 Mike Frysinger <vapier@gentoo.org>
* acinclude.m4: Include new ../warning.m4 file.
* configure: Regenerated.
* configure.ac: Replace all warning logic with AM_GDB_WARNINGS.
2016-01-12 Mike Frysinger <vapier@gentoo.org>
* ax.c (is_goto_target): Mark static.
* linux-low.c (register_addr): Likewise.
(linux_fetch_registers, linux_store_registers): Likewise.
* mem-break.c (any_persistent_commands): Fix old prototype.
(add_commands_to_breakpoint): Mark static.
* regcache.c (find_register_by_name): Delete unused func.
* remote-utils.c (hex_or_minus_one): Mark static.
* server.c (monitor_show_help): Mark static.
(handle_query, handle_v_cont, handle_v_attach, handle_v_kill,
handle_v_requests): Likewise.
2016-01-12 Pedro Alves <palves@redhat.com>
Remove use of the registered trademark symbol throughout.
2016-01-08 Yao Qi <yao.qi@linaro.org>
* remote-utils.c (getpkt): If c is '\003', call target hook
request_interrupt.
[ARM/AArch64] Fix -Werror=unused-const-variable warnings in GDBserver This patch fixes gcc warning when build ARM GDBserver and AArch64 GDBserver, AArch64 GDBserver: gdb/gdbserver/linux-aarch32-low.h:36:29: error: 'thumb2_breakpoint' defined but not used [-Werror=unused-const-variable] static const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 }; ^ gdb/gdbserver/linux-aarch32-low.h:34:29: error: 'thumb_breakpoint' defined but not used [-Werror=unused-const-variable] static const unsigned short thumb_breakpoint = 0xde01; ^ gdb/gdbserver/linux-aarch32-low.h:28:28: error: 'arm_breakpoint' defined but not used [-Werror=unused-const-variable] static const unsigned long arm_breakpoint = arm_eabi_breakpoint; ^ cc1: all warnings being treated as errors ARM GDBserver: gdb/gdbserver/linux-aarch32-low.h:34:29: error: 'thumb_breakpoint' defined but not used [-Werror=unused-const-variable] static const unsigned short thumb_breakpoint = 0xde01; ^~~~~~~~~~~~~~~~ gdb/gdbserver/linux-aarch32-low.h:28:28: error: 'arm_breakpoint' defined but not used [-Werror=unused-const-variable] static const unsigned long arm_breakpoint = arm_eabi_breakpoint; ^~~~~~~~~~~~~~ by simply moving these macros and variables to linux-aarch32-low.c and only declare thumb2_breakpoint in linux-aarch32-low.h, which is not perfect, and reveals some issues in recent arm GDBserver software single step changes. I'll post follow-up patches. gdb/gdbserver: 2016-01-06 Yao Qi <yao.qi@linaro.org> * linux-aarch32-low.h (arm_abi_breakpoint): Move to linux-aarch32-low.c. (arm_eabi_breakpoint, arm_breakpoint): Likewise. (arm_breakpoint_len, thumb_breakpoint_len): Likewise. (thumb2_breakpoint, thumb2_breakpoint_len): Likewise. (thumb2_breakpoint): Declare. * linux-aarch32-low.c (arm_abi_breakpoint): Moved from linux-aarch32-low.h. (arm_eabi_breakpoint, arm_breakpoint): Likewise. (arm_breakpoint_len, thumb_breakpoint_len): Likewise. (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
2016-01-06 13:11:41 +01:00
2016-01-06 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.h (arm_abi_breakpoint): Move to
linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint_len): Likewise.
(thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
(thumb2_breakpoint): Declare.
* linux-aarch32-low.c (arm_abi_breakpoint): Moved from
linux-aarch32-low.h.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint_len): Likewise.
(thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
2016-01-01 Joel Brobecker <brobecker@adacore.com>
* gdbreplay.c (gdbreplay_version): Change copyright year in
version message.
* server.c (gdbserver_version): Likewise.
2015-12-28 Patrick Palka <patrick@parcs.ath.cx>
* server.c (crc32_table): Delete.
(crc32): Use libiberty's xcrc32 function.
[lynxos] gdbserver hangs when killing inferior from GDB With any program under GDBserver control on LynxOS, killing the program from the debugger (using the "kill" command) causes GDBserver to properly kill the inferior but GDBserver then hangs. This change of behavior occured after the following change was applied: commit f0ea042932e6922c90df3fd0001497d287b97677 Date: Mon Nov 30 16:05:27 2015 +0000 Subject: gdbserver: don't exit until GDB disconnects One of the changes introduced by the commit above is that process_serial_event no longer calls exit after handling the vKill packet. Instead, what happens is that we wait until captured_main finds that we no longer have any inferior to debug, at which point it throws_quit. This (normal) exception is then expected to propagate all the way to the exception handle in function "main", which calls exit. However, before the exception gets propagated, the cleanups are first executed, and one of the cleanups in question is detach_or_kill_for_exit_cleanup, which was put in place by captured_main. detach_or_kill_for_exit_cleanup is basically a wrapper around detach_or_kill_for_exit, which iterates over all inferiors, and kills them all. In our case, we have only one inferior, which we have already killed during the handling for the "vKill" packet. Unfortunately, we did not properly clean our internal data for that inferior up, and so detach_or_kill_for_exit thinks that we still have one inferior, and therefore tries to kill it. This results in lynx_kill being called, doing the following: lynx_ptrace (PTRACE_KILL, ptid, 0, 0, 0); lynx_wait (ptid, &status, 0); the_target->mourn (process); The hang is caused by the call to lynx_wait, which waits for an event from a process which does not exist... This patch fixes the issue by enhancing lynx_mourn to clean the threads and process list up. gdb/gdbserver/ChangeLog: * lynx-low.c (lynx_delete_thread_callback): New function. (lynx_mourn): Properly delete our process and all of its threads. Remove call to clear_inferiors.
2015-12-20 15:39:40 +01:00
2015-12-22 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_delete_thread_callback): New function.
(lynx_mourn): Properly delete our process and all of its
threads. Remove call to clear_inferiors.
2015-12-22 Joel Brobecker <brobecker@adacore.com>
* target.c (thread_search_callback): Add check that
the thread_stopped target callback is not NULL before
calling it.
2015-12-21 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.h [__aarch64__]: Use arm_abi_breakpoint
arm breakpoint.
2015-12-18 Antoine Tremblay <antoine.tremblay@ericsson.com>
* server.c (handle_query): Call target_supports_software_single_step.
2015-12-18 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c (single_step): New function.
(linux_resume_one_lwp_throw): Call single_step.
(start_step_over): Likewise.
Support software single step on ARM in GDBServer This patch teaches GDBServer how to software single step on ARM linux by sharing code with GDB. The arm_get_next_pcs function in GDB is now shared with GDBServer. So that GDBServer can use the function to return the possible addresses of the next PC. A proper shared context was also needed so that we could share the code, this context is described in the arm_get_next_pcs structure. Testing : No regressions, tested on ubuntu 14.04 ARMv7 and x86. With gdbserver-{native,extended} / { -marm -mthumb } gdb/ChangeLog: * Makefile.in (ALL_TARGET_OBS): Append arm-get-next-pcs.o, arm-linux.o. (ALLDEPFILES): Append arm-get-next-pcs.c, arm-linux.c (arm-linux.o): New rule. (arm-get-next-pcs.o): New rule. * arch/arm-get-next-pcs.c: New file. * arch/arm-get-next-pcs.h: New file. * arch/arm-linux.h: New file. * arch/arm-linux.c: New file. * arm.c: Include common-regcache.c. (thumb_advance_itstate): Moved from arm-tdep.c. (arm_instruction_changes_pc): Likewise. (thumb_instruction_changes_pc): Likewise. (thumb2_instruction_changes_pc): Likewise. (shifted_reg_val): Likewise. * arm.h (submask): Move macro from arm-tdep.h (bit): Likewise. (bits): Likewise. (sbits): Likewise. (BranchDest): Likewise. (thumb_advance_itstate): Moved declaration from arm-tdep.h (arm_instruction_changes_pc): Likewise. (thumb_instruction_changes_pc): Likewise. (thumb2_instruction_changes_pc): Likewise. (shifted_reg_val): Likewise. * arm-linux-tdep.c: Include arch/arm.h, arch/arm-get-next-pcs.h arch/arm-linux.h. (arm_linux_get_next_pcs_ops): New struct. (ARM_SIGCONTEXT_R0, ARM_UCONTEXT_SIGCONTEXT, ARM_OLD_RT_SIGFRAME_SIGINFO, ARM_OLD_RT_SIGFRAME_UCONTEXT, ARM_NEW_RT_SIGFRAME_UCONTEXT, ARM_NEW_SIGFRAME_MAGIC): Move stack layout defines to arch/arm-linux.h. (arm_linux_sigreturn_next_pc_offset): Move to arch/arm-linux.c. (arm_linux_software_single_step): Adjust for arm_get_next_pcs implementation. * arm-tdep.c: Include arch/arm-get-next-pcs.h. (arm_get_next_pcs_ops): New struct. (submask): Move macro to arm.h. (bit): Likewise. (bits): Likewise. (sbits): Likewise. (BranchDest): Likewise. (thumb_instruction_changes_pc): Move to arm.c (thumb2_instruction_changes_pc): Likewise. (arm_instruction_changes_pc): Likewise. (shifted_reg_val): Likewise. (thumb_advance_itstate): Likewise. (thumb_get_next_pc_raw): Move to arm-get-next-pcs.c. (arm_get_next_pc_raw): Likewise. (arm_get_next_pc): Likewise. (thumb_deal_with_atomic_sequence_raw): Likewise. (arm_deal_with_atomic_sequence_raw): Likewise. (arm_deal_with_atomic_sequence): Likewise. (arm_get_next_pcs_read_memory_unsigned_integer): New function. (arm_get_next_pcs_addr_bits_remove): Likewise. (arm_get_next_pcs_syscall_next_pc): Likewise. (arm_get_next_pcs_is_thumb): Likewise. (arm_software_single_step): Adjust for arm_get_next_pcs implementation. * arm-tdep.h: (arm_get_next_pc): Remove declaration. (arm_get_next_pcs_read_memory_unsigned_integer): New declaration. (arm_get_next_pcs_addr_bits_remove): Likewise. (arm_get_next_pcs_syscall_next_pc): Likewise. (arm_get_next_pcs_is_thumb): Likewise. (arm_deal_with_atomic_sequence: Remove declaration. * common/gdb_vecs.h: Add CORE_ADDR vector definition. * configure.tgt (aarch64*-*-linux): Add arm-get-next-pcs.o, arm-linux.o. (arm*-wince-pe): Add arm-get-next-pcs.o. (arm*-*-linux*): Add arm-get-next-pcs.o, arm-linux.o, arm-get-next-pcs.o (arm*-*-netbsd*,arm*-*-knetbsd*-gnu): Add arm-get-next-pcs.o. (arm*-*-openbsd*): Likewise. (arm*-*-symbianelf*): Likewise. (arm*-*-*): Likewise. * symtab.h: Move CORE_ADDR vector definition to gdb_vecs.h. gdb/gdbserver/ChangeLog: * Makefile.in (SFILES): Append arch/arm-linux.c, arch/arm-get-next-pcs.c. (arm-linux.o): New rule. (arm-get-next-pcs.o): New rule. * configure.srv (arm*-*-linux*): Add arm-get-next-pcs.o, arm-linux.o. * linux-aarch32-low.c (arm_abi_breakpoint): Remove macro. Moved to linux-aarch32-low.c. (arm_eabi_breakpoint, arm_breakpoint): Likewise. (arm_breakpoint_len, thumb_breakpoint): Likewise. (thumb_breakpoint_len, thumb2_breakpoint): Likewise. (thumb2_breakpoint_len): Likewise. (arm_is_thumb_mode): Make non-static. * linux-aarch32-low.h (arm_abi_breakpoint): New macro. Moved from linux-aarch32-low.c. (arm_eabi_breakpoint, arm_breakpoint): Likewise. (arm_breakpoint_len, thumb_breakpoint): Likewise. (thumb_breakpoint_len, thumb2_breakpoint): Likewise. (thumb2_breakpoint_len): Likewise. (arm_is_thumb_mode): New declaration. * linux-arm-low.c: Include arch/arm-linux.h aarch/arm-get-next-pcs.h, sys/syscall.h. (get_next_pcs_ops): New struct. (get_next_pcs_addr_bits_remove): New function. (get_next_pcs_is_thumb): New function. (get_next_pcs_read_memory_unsigned_integer): Likewise. (arm_sigreturn_next_pc): Likewise. (get_next_pcs_syscall_next_pc): Likewise. (arm_gdbserver_get_next_pcs): Likewise. (struct linux_target_ops) <arm_gdbserver_get_next_pcs>: Initialize. * linux-low.h: Move CORE_ADDR vector definition to gdb_vecs.h. * server.h: Include gdb_vecs.h.
2015-12-18 17:33:59 +01:00
2015-12-18 Antoine Tremblay <antoine.tremblay@ericsson.com>
* Makefile.in (SFILES): Append arch/arm-linux.c,
arch/arm-get-next-pcs.c.
(arm-linux.o): New rule.
(arm-get-next-pcs.o): New rule.
* configure.srv (arm*-*-linux*): Add arm-get-next-pcs.o,
arm-linux.o.
* linux-aarch32-low.c (arm_abi_breakpoint): Remove macro. Moved
to linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): Make non-static.
* linux-aarch32-low.h (arm_abi_breakpoint): New macro. Moved
from linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): New declaration.
* linux-arm-low.c: Include arch/arm-linux.h
aarch/arm-get-next-pcs.h, sys/syscall.h.
(get_next_pcs_ops): New struct.
(get_next_pcs_addr_bits_remove): New function.
(get_next_pcs_is_thumb): New function.
(get_next_pcs_read_memory_unsigned_integer): Likewise.
(arm_sigreturn_next_pc): Likewise.
(get_next_pcs_syscall_next_pc): Likewise.
(arm_gdbserver_get_next_pcs): Likewise.
(struct linux_target_ops) <arm_gdbserver_get_next_pcs>:
Initialize.
* linux-low.h: Move CORE_ADDR vector definition to gdb_vecs.h.
* server.h: Include gdb_vecs.h.
2015-12-18 Antoine Tremblay <antoine.tremblay@ericsson.com>
* Makefile.in (SFILES): Append common/common-regcache.c.
(OBS): Append common-regcache.o.
(common-regcache.o): New rule.
* regcache.c (init_register_cache): Initialize cache to
REG_UNAVAILABLE.
(regcache_raw_read_unsigned): New function.
* regcache.h (REG_UNAVAILABLE, REG_VALID): Replaced by shared
register_status enum.
2015-12-18 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-aarch64-low.c (the_low_targets): Rename
breakpoint_reinsert_addr to get_next_pcs.
* linux-arm-low.c (the_low_targets): Likewise.
* linux-bfin-low.c (the_low_targets): Likewise.
* linux-cris-low.c (the_low_targets): Likewise.
* linux-crisv32-low.c (the_low_targets): Likewise.
* linux-low.c (can_software_single_step): Likewise.
(install_software_single_step_breakpoints): New function.
(start_step_over): Use install_software_single_step_breakpoints.
* linux-low.h: New CORE_ADDR vector.
(struct linux_target_ops) Rename breakpoint_reinsert_addr to
get_next_pcs.
* linux-mips-low.c (the_low_targets): Likewise.
* linux-nios2-low.c (the_low_targets): Likewise.
* linux-sparc-low.c (the_low_targets): Likewise.
Remove support for LinuxThreads and vendor 2.4 kernels w/ backported NPTL Since we now rely on PTRACE_EVENT_CLONE being available (added in Linux 2.5.46), we're relying on NPTL. This commit removes the support for older LinuxThreads, as well as the workarounds for vendor 2.4 kernels with NPTL backported. - Rely on tkill being available. - Assume gdb doesn't get cancel signals. - Remove code that checks the LinuxThreads restart and cancel signals in the inferior. - Assume that __WALL is available. - Assume that non-leader threads report WIFEXITED. - Thus, no longer need to send signal 0 to check whether threads are still alive. - Update comments throughout. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ChangeLog: * configure.ac: Remove tkill checks. * configure, config.in: Regenerate. * linux-nat.c: Remove HAVE_TKILL_SYSCALL check. Update top level comments. (linux_nat_post_attach_wait): Remove 'cloned' parameter. Use __WALL. (attach_proc_task_lwp_callback): Don't set the cloned flag. (linux_nat_attach): Adjust. (kill_lwp): Remove HAVE_TKILL_SYSCALL check. No longer fall back to 'kill'. (linux_handle_extended_wait): Use __WALL. Don't set the cloned flag. (wait_lwp): Use __WALL. Update comments. (running_callback, stop_and_resume_callback): Delete. (linux_nat_filter_event): Don't stop and resume all lwps. Don't check if the event LWP has previously exited. (check_zombie_leaders): Update comments. (linux_nat_wait_1): Use __WALL. (kill_wait_callback): Don't handle clone processes separately. Use __WALL instead. (linux_thread_alive): Delete. (linux_nat_thread_alive): Return true as long as the LWP is in the LWP list. (linux_nat_update_thread_list): Assume the kernel supports PTRACE_EVENT_CLONE. (get_signo): Delete. (lin_thread_get_thread_signals): Remove LinuxThreads references. No longer check __pthread_sig_restart / __pthread_sig_cancel in the inferior. * linux-nat.h (struct lwp_info) <cloned>: Delete field. * linux-thread-db.c: Update comments. (_initialize_thread_db): Remove LinuxThreads references. * nat/linux-waitpid.c (my_waitpid): No longer emulate __WALL. Pass down flags unmodified. * linux-waitpid.h (my_waitpid): Update documentation. gdb/gdbserver/ChangeLog: * linux-low.c (linux_kill_one_lwp): Remove references to LinuxThreads. (kill_lwp): Remove HAVE_TKILL_SYSCALL check. No longer fall back to 'kill'. (linux_init_signals): Delete. (initialize_low): Adjust. * thread-db.c (thread_db_init): Remove LinuxThreads reference.
2015-12-17 15:20:51 +01:00
2015-12-17 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_kill_one_lwp): Remove references to
LinuxThreads.
(kill_lwp): Remove HAVE_TKILL_SYSCALL check. No longer fall back
to 'kill'.
(linux_init_signals): Delete.
(initialize_low): Adjust.
* thread-db.c (thread_db_init): Remove LinuxThreads reference.
2015-12-16 Pedro Alves <palves@redhat.com>
* configure.ac (compiler warning flags): When testing a
-Wno-foo option, check whether -Wfoo works instead.
* configure: Regenerate.
Target remote mode fork and exec event support This patch implements support for fork and exec events with target remote mode Linux targets. For such targets with Linux kernels 2.5.46 and later, this enables follow-fork-mode, detach-on-fork and fork and exec catchpoints. The changes required to implement this included: * Don't exit from gdbserver if there are still active inferiors. * Allow changing the active process in remote mode. * Enable fork and exec events in remote mode. * Print "Ending remote debugging" only when disconnecting. * Combine remote_kill and extended_remote_kill into a single function that can handle the multiple inferior case for target remote. Also, the same thing for remote_mourn and extended_remote_mourn. * Enable process-style ptids in target remote. * Remove restriction on multiprocess mode in target remote. gdb/gdbserver/ChangeLog: * server.c (process_serial_event): Don't exit from gdbserver in remote mode if there are still active inferiors. gdb/ChangeLog: * inferior.c (number_of_live_inferiors): New function. (have_live_inferiors): Use number_of_live_inferiors in place of duplicate code. * inferior.h (number_of_live_inferiors): Declare new function. * remote.c (set_general_process): Remove restriction on target remote mode. (remote_query_supported): Likewise. (remote_detach_1): Exit in target remote mode only when there is just one live inferior left. (remote_disconnect): Unpush the target directly instead of calling remote_mourn. (remote_kill): Rewrite function to handle both target remote and extended-remote. Call remote_kill_k. (remote_kill_k): New function. (extended_remote_kill): Delete function. (remote_mourn, extended_remote_mourn): Combine functions into one, remote_mourn, and enable extended functionality for target remote. (remote_pid_to_str): Enable "process" style ptid string for target remote. (remote_supports_multi_process): Remove restriction on target remote mode.
2015-12-14 20:18:05 +01:00
2015-12-11 Don Breazeal <donb@codesourcery.com>
* server.c (process_serial_event): Don't exit from gdbserver
in remote mode if there are still active inferiors.
2015-12-11 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_breakpoint_at): Call
arm_breakpoint_at if the process is 32-bit.
2015-12-11 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint
arm breakpoint.
Support Z0 packet in AArch64 multi-arch debugging In commit 6085d6f6, Z0 packet is disabled in aarch64 GDBserver if the inferior is 32-bit or there may be multiple inferiors, because Z0 packet isn't supported for arm then. Recently, Z0 packet is supported in arm target, so we don't have such limitation in aarch64 GDBserver, that is to say, aarch64 GDBserver can use Z0 packet in multi-arch/multi-inferior debugging when the inferior's arch is arm. Part of this patch is to revert 6085d6f6, and the rest of the patch is to move some breakpoint related arm_* functions into linux-aarch32-low.c in order to share them between arm and aarch64. This patch is regression tested on aarch64-linux for debugging both aarch64 programs and arm programs respectively. gdb/gdbserver: 2015-12-07 Yao Qi <yao.qi@linaro.org> * configure.srv: Append arm.o to srv_tgtobj for aarch64*-*-linux* target. * linux-aarch32-low.c (arm_abi_breakpoint): New macro. Moved from linux-arm-low.c. (arm_eabi_breakpoint, arm_breakpoint): Likewise. (arm_breakpoint_len, thumb_breakpoint): Likewise. (thumb_breakpoint_len, thumb2_breakpoint): Likewise. (thumb2_breakpoint_len): Likewise. (arm_is_thumb_mode, arm_breakpoint_at): Likewise. (arm_breakpoint_kinds): Likewise. (arm_breakpoint_kind_from_pc): Likewise. (arm_sw_breakpoint_from_kind): Likewise. (arm_breakpoint_kind_from_current_state): Likewise. * linux-aarch32-low.h (arm_breakpoint_kind_from_pc): Declare. (arm_sw_breakpoint_from_kind): Declare. (arm_breakpoint_kind_from_current_state): Declare. (arm_breakpoint_at): Declare. * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): Call arm_sw_breakpoint_from_kind if process is 32-bit. (aarch64_breakpoint_kind_from_pc): New function. (aarch64_breakpoint_kind_from_current_state): New function. (the_low_target): Initialize fields breakpoint_kind_from_pc and breakpoint_kind_from_current_state. * linux-arm-low.c (arm_breakpoint_kinds): Move to linux-aarch32-low.c. (arm_abi_breakpoint, arm_eabi_breakpoint): Likewise. (arm_breakpoint, arm_breakpoint_len): Likewise. (thumb_breakpoint, thumb_breakpoint_len): Likewise. (thumb2_breakpoint, thumb2_breakpoint_len): Likewise. (arm_is_thumb_mode): Likewise. (arm_breakpoint_at): Likewise. (arm_breakpoint_kind_from_pc): Likewise. (arm_sw_breakpoint_from_kind): Likewise. (arm_breakpoint_kind_from_current_state): Likewise. Revert: 2015-08-04 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_supports_z_point_type): Return 0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging. * server.c (extended_protocol): Remove "static". * server.h (extended_protocol): Declare it.
2015-12-07 16:56:31 +01:00
2015-12-07 Yao Qi <yao.qi@linaro.org>
* configure.srv: Append arm.o to srv_tgtobj for
aarch64*-*-linux* target.
* linux-aarch32-low.c (arm_abi_breakpoint): New macro. Moved
from linux-arm-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode, arm_breakpoint_at): Likewise.
(arm_breakpoint_kinds): Likewise.
(arm_breakpoint_kind_from_pc): Likewise.
(arm_sw_breakpoint_from_kind): Likewise.
(arm_breakpoint_kind_from_current_state): Likewise.
* linux-aarch32-low.h (arm_breakpoint_kind_from_pc): Declare.
(arm_sw_breakpoint_from_kind): Declare.
(arm_breakpoint_kind_from_current_state): Declare.
(arm_breakpoint_at): Declare.
* linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): Call
arm_sw_breakpoint_from_kind if process is 32-bit.
(aarch64_breakpoint_kind_from_pc): New function.
(aarch64_breakpoint_kind_from_current_state): New function.
(the_low_target): Initialize fields breakpoint_kind_from_pc
and breakpoint_kind_from_current_state.
* linux-arm-low.c (arm_breakpoint_kinds): Move to
linux-aarch32-low.c.
(arm_abi_breakpoint, arm_eabi_breakpoint): Likewise.
(arm_breakpoint, arm_breakpoint_len): Likewise.
(thumb_breakpoint, thumb_breakpoint_len): Likewise.
(thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): Likewise.
(arm_breakpoint_at): Likewise.
(arm_breakpoint_kind_from_pc): Likewise.
(arm_sw_breakpoint_from_kind): Likewise.
(arm_breakpoint_kind_from_current_state): Likewise.
Revert:
2015-08-04 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_supports_z_point_type): Return
0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
* server.c (extended_protocol): Remove "static".
* server.h (extended_protocol): Declare it.
2015-12-04 Josh Stone <jistone@redhat.com>
* target.h (struct target_ops) <arch_setup>: Rename to ...
(struct target_ops) <post_create_inferior>: ... this.
(target_arch_setup): Rename to ...
(target_post_create_inferior): ... this, calling post_create_inferior.
* server.c (start_inferior): Update target_arch_setup calls to
target_post_create_inferior.
* linux-low.c (linux_low_ptrace_options): Forward declare.
(linux_arch_setup): Update its comment for general use.
(linux_post_create_inferior): New, run arch_setup and setup ptrace.
(struct linux_target_ops): Use linux_post_create_inferior.
* lynx-low.c (struct lynx_target_ops): Update arch_setup stub comment
to post_create_inferior.
* nto-low.c (struct nto_target_ops): Likewise.
* spu-low.c (struct spu_target_ops): Likewise.
* win32-low.c (struct win32_target_ops): Likewise.
2015-12-03 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-arm-low.c: Remove duplicate arch/arm.h include.
2015-11-30 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-arm-low.c (arm_reinsert_addr): Remove function.
(struct linux_target_ops <breakpoint_reinsert_addr>: Set to NULL.
* linux-cris-low.c (cris_reinsert_addr> Remove function.
(struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
* linux-crisv32-low.c (cris_reinsert_addr): Remove function.
(struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
* linux-mips-low.c (mips_reinsert_addr): Remove function.
(struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
* linux-nios2-low.c (nios2_reinsert_addr): Remove function.
(struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
* linux-sparc-low.c (sparc_reinsert_addr): Remove function.
(struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
Remove support for thread events without PTRACE_EVENT_CLONE in GDBServer. This patch removes support for thread events if PTRACE_EVENT_CLONE is not supported in GDBServer. Before, on systems that did not support PTRACE_EVENT_CLONE, both GDB and GDBServer coordinated with libthread_db.so to insert breakpoints at magic locations in libpthread.so, in order to break at thread creation and thread death. Simple software single stepping support was implemented to step over these breakpoints in case there was no hardware single stepping support. However, these simple software single stepping implementations were not fit for any other use as discussed in : https://sourceware.org/ml/gdb-patches/2015-04/msg01110.html These too simple implementations conflict with ongoing work to make proper implementations of software single stepping in GDBServer. The problem is that if some implementations are correct and others are not and only there for the thread magic breakpoint, we can't enable features based solely software single step support since some would be broken. To keep the incorrect implementations and allow the new proper ones at the same time we would need to implement fallback code and it quickly becomes ugly and confusing with multiple checks for legacy software single step or proper software single step. However, PTRACE_EVENT_CLONE was first introduced in Linux 2.5.46, released in November 2002. So I think it's reasonable to just remove support for kernels that don't support PTRACE_EVENT_CLONE, and sidestep the libthread_db breakpoints issues entirely. This thread on the mailling list discusses the issue : https://sourceware.org/ml/gdb/2015-10/msg00078.html No regressions, tested on ubuntu 14.04 ARMv7 and x86. With gdbserver-{native,extended} / { -marm -mthumb } gdb/gdbserver/ChangeLog: * linux-low.c (linux_look_up_symbols): Don't call linux_supports_traceclone. * linux-low.h (thread_db_init): Remove use_events argument. * thread-db.c (thread_db_use_event): Remove global variable. (struct thread_db) <td_thr_event_enable_p>: Remove field. (struct thread_db) <td_create_bp>: Remove field. (thread_db_create_event): Remove function. (thread_db_enable_reporting): Likewise. (find_one_thread): Don't check for thread_db_use_events. (attach_thread): Likewise. (thread_db_load_search): Remove td_thr_event_enable_p initialization. (try_thread_db_load_1): Don't check for thread_db_use_events. (thread_db_init): Remove use_events argument and thread events handling. (remove_thread_event_breakpoints): Remove function. (thread_db_detach): Remove call to remove_thred_event_breakpoints.
2015-11-19 17:29:10 +01:00
2015-11-30 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c (linux_look_up_symbols): Don't call
linux_supports_traceclone.
* linux-low.h (thread_db_init): Remove use_events argument.
* thread-db.c (thread_db_use_event): Remove global variable.
(struct thread_db) <td_thr_event_enable_p>: Remove field.
(struct thread_db) <td_create_bp>: Remove field.
(thread_db_create_event): Remove function.
(thread_db_enable_reporting): Likewise.
(find_one_thread): Don't check for thread_db_use_events.
(attach_thread): Likewise.
(thread_db_load_search): Remove td_thr_event_enable_p initialization.
(try_thread_db_load_1): Don't check for thread_db_use_events.
(thread_db_init): Remove use_events argument and thread events
handling.
(remove_thread_event_breakpoints): Remove function.
(thread_db_detach): Remove call to remove_thred_event_breakpoints.
Refactor queries for hardware and software single stepping support in GDBServer. Before this patch there was only one call: can_hardware_single_step. Its implementation was a check on breakpoint_reinsert_addr if NULL it assumed that the target could hardware single step. This patch prepares for the case where this is not true anymore. In order to improve software single stepping in GDBServer the breakpoint_reinsert_addr operation of targets that had a very simple software implementation used only for stepping over thread creation events will be removed. This will create a case where a target does not support hardware single step and has the operation breakpoint_reinsert_addr set to NULL, thus can_hardware_single_step needs to be implemented another way. A new target operation supports_hardware_single_step is introduced and is to return true if the target does support such a feature, support for the feature is manually hardcoded. Note that the hardware single step support was enabled as per the current behavior, I did not check if tile for example really has ptrace singlestep support but since the current implementation assumed it had, I kept it that way. No regressions on Ubuntu 14.04 on ARMv7 and x86. With gdbserver-{native,extended} / { -marm -mthumb } Compilation tested on: aarch64,arm,bfind,crisv32,m32r,ppc,s390,tic6x,tile, xtensa. Not tested : sh. gdb/gdbserver/ChangeLog: * linux-aarch64-low.c (aarch64_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-arm-low.c (arm_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-bfin-low.c (bfin_supports_hardware_single_step): New function. (struct linux_target_ops) <bfin_supports_hardware_single_step>: Initialize. * linux-crisv32-low.c (cris_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-low.c (can_hardware_single_step): Use supports_hardware_single_step. (can_software_single_step): New function. (start_step_over): Call can_software_single_step. (linux_supports_hardware_single_step): New function. (struct target_ops) <supports_software_single_step>: Initialize. * linux-low.h (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-m32r-low.c (m32r_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-ppc-low.c (ppc_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step> Initialize. * linux-s390-low.c (s390_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-sh-low.c (sh_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-tic6x-low.c (tic6x_supports_hardware_single_step): New function. (struct linux_target_ops) <tic6x_supports_hardware_single_step>: Initialize. * linux-tile-low.c (tile_supports_hardware_single_step): New function. (struct linux_target_ops) <tile_supports_hardware_single_step>: Initialize. * linux-x86-low.c (x86_supports_hardware_single_step) New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-xtensa-low.c (xtensa_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * target.h (struct target_ops): <supports_software_single_step>: New field. (target_supports_software_single_step): New macro.
2015-11-19 17:29:10 +01:00
2015-11-30 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-aarch64-low.c (aarch64_supports_hardware_single_step):
New function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
* linux-arm-low.c (arm_supports_hardware_single_step): New function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
* linux-bfin-low.c (bfin_supports_hardware_single_step): New function.
(struct linux_target_ops) <bfin_supports_hardware_single_step>:
Initialize.
* linux-crisv32-low.c (cris_supports_hardware_single_step):
New function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
* linux-low.c (can_hardware_single_step): Use
supports_hardware_single_step.
(can_software_single_step): New function.
(start_step_over): Call can_software_single_step.
(linux_supports_hardware_single_step): New function.
(struct target_ops) <supports_software_single_step>: Initialize.
* linux-low.h (struct linux_target_ops)
<supports_hardware_single_step>: Initialize.
* linux-m32r-low.c (m32r_supports_hardware_single_step): New function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
* linux-ppc-low.c (ppc_supports_hardware_single_step): New function.
(struct linux_target_ops) <supports_hardware_single_step> Initialize.
* linux-s390-low.c (s390_supports_hardware_single_step): New function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
* linux-sh-low.c (sh_supports_hardware_single_step): New function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
* linux-tic6x-low.c (tic6x_supports_hardware_single_step): New function.
(struct linux_target_ops) <tic6x_supports_hardware_single_step>:
Initialize.
* linux-tile-low.c (tile_supports_hardware_single_step): New function.
(struct linux_target_ops) <tile_supports_hardware_single_step>:
Initialize.
* linux-x86-low.c (x86_supports_hardware_single_step) New function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
* linux-xtensa-low.c (xtensa_supports_hardware_single_step):
New function.
(struct linux_target_ops) <supports_hardware_single_step>: Initialize.
* target.h (struct target_ops): <supports_software_single_step>:
New field.
(target_supports_software_single_step): New macro.
Fix instruction skipping when using software single step in GDBServer Without this patch, when doing a software single step, with for example a conditional breakpoint, gdbserver would wrongly avance the pc of breakpoint_len and skips an instruction. This is due to gdbserver assuming that it's hardware single stepping. When it resumes from the breakpoint address it expects the trap to be caused by ptrace and if it's rather caused by a software breakpoint it assumes this is a permanent breakpoint and that it needs to skip over it. However when software single stepping, this breakpoint is legitimate as it's the reinsert breakpoint gdbserver has put in place to break at the next instruction. Thus gdbserver wrongly advances the pc and skips an instruction. This patch fixes this behavior so that gdbserver checks if it is a reinsert breakpoint from software single stepping. If it is it won't advance the pc. And if there's no reinsert breakpoint there we assume then that it's a permanent breakpoint and advance the pc. Here's a commented log of what would happen before and after the fix on gdbserver : /* Here there is a conditional breakpoint at 0x10428 that needs to be stepped over. */ Need step over [LWP 11204]? yes, found breakpoint at 0x10428 ... /* e7f001f0 is a breakpoint instruction on arm Here gdbserver writes the software breakpoint we would like to hit */ Writing e7f001f0 to 0x0001042c in process 11204 ... Resuming lwp 11220 (continue, signal 0, stop not expected) pending reinsert at 0x10428 stop pc is 00010428 continue from pc 0x10428 ... /* Here gdbserver hit the software breakpoint that was in place for the step over */ stop pc is 0001042c pc is 0x1042c step-over for LWP 11220.11220 executed software breakpoint Finished step over. Could not find fast tracepoint jump at 0x10428 in list (reinserting). /* Here gdbserver writes back the original instruction */ Writing e50b3008 to 0x0001042c in process 11220 Step-over finished. Need step over [LWP 11220]? No /* Here because gdbserver assumes this is a permenant breakpoint it advances the pc of breakpoint_len, in this case 4 bytes, so we have just skipped the instruction that was written back here : Writing e50b3008 to 0x0001042c in process 11220 */ stop pc is 00010430 pc is 0x10430 Need step over [LWP 11220]? No, no breakpoint found at 0x10430 Proceeding, no step-over needed proceed_one_lwp: lwp 11220 stop pc is 00010430 This patch fixes this situation and we get the right behavior : Writing e50b3008 to 0x0001042c in process 11245 Hit a gdbserver breakpoint. Hit a gdbserver breakpoint. Step-over finished. proceeding all threads. Need step over [LWP 11245]? No stop pc is 0001042c pc is 0x1042c Need step over [LWP 11245]? No, no breakpoint found at 0x1042c Proceeding, no step-over needed proceed_one_lwp: lwp 11245 stop pc is 0001042c pc is 0x1042c Resuming lwp 11245 (continue, signal 0, stop not expected) stop pc is 0001042c continue from pc 0x1042c It also works if the value at 0x0001042c is a permanent breakpoint. If so gdbserver will finish the step over, remove the reinserted breakpoint, resume at that location and on the next SIGTRAP gdbserver will trigger the advance PC condition as reinsert_breakpoint_inserted_here will be false. I also tested this against bp-permanent.exp on arm (with a work in progress software single step patchset) without any regressions. It's also tested against x86 bp-permanent.exp without any regression. So both software and hardware single step are tested. No regressions on Ubuntu 14.04 on ARMv7 and x86. With gdbserver-{native,extended} / { -marm -mthumb } gdb/gdbserver/ChangeLog: * linux-low.c (linux_wait_1): Fix pc advance condition. * mem-break.c (reinsert_breakpoint_inserted_here): New function. * mem-break.h (reinsert_breakpoint_inserted_here): New declaration.
2015-11-30 21:16:22 +01:00
2015-11-30 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c (linux_wait_1): Fix pc advance condition.
* mem-break.c (reinsert_breakpoint_inserted_here): New function.
* mem-break.h (reinsert_breakpoint_inserted_here): New declaration.
2015-11-30 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-arm-low.c (arm_is_thumb_mode): New function.
(arm_breakpoint_at): Use arm_is_thumb_mode.
(arm_breakpoint_kind_from_current_state): New function.
(struct linux_target_ops) <breakpoint_kind_from_current_state>:
Initialize.
* linux-low.c (linux_wait_1): Call breakpoint_kind_from_current_state.
(linux_breakpoint_kind_from_current_state): New function.
(struct target_ops <breakpoint_kind_from_current_state>: Initialize.
* linux-low.h (struct linux_target_ops)
<breakpoint_kind_from_current_state>: New field.
* target.h (struct target_ops): Likewise.
(target_breakpoint_kind_from_current_state): New macro.
2015-11-30 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_resume): Wake up the event loop before
returning.
2015-11-30 Pedro Alves <palves@redhat.com>
* mem-break.c (check_gdb_bp_preconditions): Remove current_thread
check.
(set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR
to -1.
* target.c (struct thread_search): New structure.
(thread_search_callback): New function.
(prev_general_thread): New global.
(prepare_to_access_memory, done_accessing_memory): New functions.
* target.h (prepare_to_access_memory, done_accessing_memory):
Replace macros with function declarations.
Implement TARGET_WAITKIND_NO_RESUMED in the remote protocol Testing with "maint set target-non-stop on" causes regressions in tests that rely on TARGET_WAITKIND_NO_RESUMED, which isn't modelled on the RSP. In real all-stop, gdbserver detects the situation and reporst error to GDB, and so the tests (e.g., gdb.threads/no-unwaited-for-left.exp) at fail quickly. But with "maint set target-non-stop on", GDB instead hangs forever waiting for a stop reply that never comes, and so the tests take longer to time out. This adds a new "N" stop reply packet that maps 1-1 to TARGET_WAITKIND_NO_RESUMED. gdb/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> PR 14618 * NEWS (New remote packets): Mention the N stop reply. * remote.c (remote_protocol_features): Add "no-resumed" entry. (remote_query_supported): Report no-resumed+ support. (remote_parse_stop_reply): Handle 'N'. (process_stop_reply): Handle TARGET_WAITKIND_NO_RESUMED. (remote_wait_as): Handle 'N' / TARGET_WAITKIND_NO_RESUMED. (_initialize_remote): Register "set/show remote no-resumed-stop-reply" commands. gdb/doc/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> PR 14618 * gdb.texinfo (Stop Reply Packets): Document the N stop reply. (Remote Configuration): Add the "set/show remote no-resumed-stop-reply" to the available settings table. (General Query Packets): Document the "no-resumed" qSupported feature. gdb/gdbserver/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> PR 14618 * linux-low.c (linux_wait_1): If the last resumed thread is gone, report TARGET_WAITKIND_NO_RESUMED. * remote-utils.c (prepare_resume_reply): Handle TARGET_WAITKIND_NO_RESUMED. * server.c (report_no_resumed): New global. (handle_query) <qSupported>: Handle "no-resumed+". Report "no-resumed+" support. (resume): When the target reports TARGET_WAITKIND_NO_RESUMED, only return error if the client doesn't support no-resumed events. (push_stop_notification): New function. (handle_target_event): Use it. Report TARGET_WAITKIND_NO_RESUMED events if the client supports them. gdb/testsuite/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> * gdb.threads/no-unwaited-for-left.exp: Remove setup_kfail calls.
2015-11-30 17:05:25 +01:00
2015-11-30 Pedro Alves <palves@redhat.com>
PR 14618
* linux-low.c (linux_wait_1): If the last resumed thread is gone,
report TARGET_WAITKIND_NO_RESUMED.
* remote-utils.c (prepare_resume_reply): Handle
TARGET_WAITKIND_NO_RESUMED.
* server.c (report_no_resumed): New global.
(handle_query) <qSupported>: Handle "no-resumed+". Report
"no-resumed+" support.
(resume): When the target reports TARGET_WAITKIND_NO_RESUMED, only
return error if the client doesn't support no-resumed events.
(push_stop_notification): New function.
(handle_target_event): Use it. Report TARGET_WAITKIND_NO_RESUMED
events if the client supports them.
gdbserver: fix killed-outside.exp killed-outside.exp regresses with "maint set target-non-stop on". The logs show: (gdb) continue Continuing. infrun: clear_proceed_status_thread (Thread 9028.9028) infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT) infrun: proceed: resuming Thread 9028.9028 Sending packet: $Z0,3615a03966,1#4b... Notification received: Stop:X9;process:2344 Packet received: E01 Sending packet: $Z0,3615a13970,1#47...Packet received: E01 Sending packet: $Z0,3615a14891,1#4a...Packet received: E01 infrun: resume (step=0, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 9028.9028] at 0x4005e4 Sending packet: $vCont;c:p2344.2344#1a...Packet received: E.target not running. Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n</threads>\n Sending packet: $vStopped#55...Packet received: OK Unexpected vCont reply in non-stop mode: E.target not running. (gdb) remote_async_inferior_event_handler infrun: target_wait (-1.0.0, status) = infrun: 9028.0.0 [process 9028], infrun: status->kind = signalled, signal = GDB_SIGNAL_KILL infrun: TARGET_WAITKIND_SIGNALLED Program terminated with signal SIGKILL, Killed. The program no longer exists. infrun: stop_waiting infrun: clear_step_over_info infrun: stop_all_threads remote_thread_exit_events(1) Note the "Unexpected vCont reply" error. I traced it to a problem in status_pending_p_callback. It resumes an LWP when it shouldn't. gdb/gdbserver/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> * linux-low.c (thread_still_has_status_pending_p): Don't check vCont;t here. (lwp_resumed): New function. (status_pending_p_callback): Return early if the LWP is not supposed to be resumed.
2015-11-30 17:05:23 +01:00
2015-11-30 Pedro Alves <palves@redhat.com>
* linux-low.c (thread_still_has_status_pending_p): Don't check
vCont;t here.
(lwp_resumed): New function.
(status_pending_p_callback): Return early if the LWP is not
supposed to be resumed.
Remote thread create/exit events When testing with "maint set target-non-stop on", a few threading-related tests expose an issue that requires new RSP packets. Say there are 3 threads running, 1-3. If GDB tries to stop thread 1, 2 and 3, and then waits for their stops, but meanwhile say, thread 2 exits, GDB hangs forever waiting for a stop for thread 2 that won't ever happen. This patch fixes the issue by adding support for thread exit events to the protocol. However, we don't want these always enabled, as they're useless most of the time, and would slow down remote debugging. So I made it so that GDB can enable/disable them, and then made gdb do that around the cases that need it, which currently is only infrun.c:stop_all_threads. In turn, if we have thread exit events, then the extra "thread x exited" traffic slows down attach-many-short-lived-threads.exp enough that gdb has trouble keeping up with new threads that are spawned while gdb tries to stop existing ones. To fix that I added support for the counterpart thread created events too. Enabling those when we try to stop threads ensures that new threads never get a chance to themselves start new threads, killing the race. gdb/doc/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> * gdb.texinfo (Remote Configuration): List "set/show remote thread-events" command in configuration table. (Stop Reply Packets): Document "T05 create" stop reason and 'w' stop reply. (General Query Packets): Document QThreadEvents packet. Document QThreadEvents qSupported feature. gdb/gdbserver/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> * linux-low.c (handle_extended_wait): Assert that the LWP's waitstatus is TARGET_WAITKIND_IGNORE. If GDB wants to hear about thread create events, leave the new child's status pending. (linux_low_filter_event): If GDB wants to hear about thread exit events, leave the LWP marked dead and don't delete it. (linux_wait_for_event_filtered): Don't check for thread exit. (filter_exit_event): New function. (linux_wait_1): Use it, when returning an exit event. (linux_resume_one_lwp_throw): Assert that the LWP's waitstatus is TARGET_WAITKIND_IGNORE. * remote-utils.c (prepare_resume_reply): Handle TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED. * server.c (report_thread_events): New global. (handle_general_set): Handle QThreadEvents. (handle_query) <qSupported>: Handle and report QThreadEvents+; (handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED. * server.h (report_thread_events): Declare. gdb/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> * NEWS (New commands): Mention "set/show remote thread-events" commands. (New remote packets): Mention thread created/exited stop reasons and QThreadEvents packet. * infrun.c (disable_thread_events): New function. (stop_all_threads): Disable/enable thread create/exit events. Handle TARGET_WAITKIND_THREAD_EXITED. (handle_inferior_event_1): Handle TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED. * remote.c (remove_child_of_pending_fork): Also remove threads of threads that have TARGET_WAITKIND_THREAD_EXITED events. (remote_parse_stop_reply): Handle "create" magic register. Handle 'w' stop reply. (initialize_remote): Install remote_thread_events as to_thread_events target hook. (remote_thread_events): New function. * target-delegates.c: Regenerate. * target.c (target_thread_events): New function. * target.h (struct target_ops) <to_thread_events>: New field. (target_thread_events): Declare. * target/waitstatus.c (target_waitstatus_to_string): Handle TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED. * target/waitstatus.h (enum target_waitkind) <TARGET_WAITKIND_THREAD_CREATED, TARGET_WAITKIND_THREAD_EXITED): New values.
2015-11-30 17:05:21 +01:00
2015-11-30 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Assert that the LWP's
waitstatus is TARGET_WAITKIND_IGNORE. If GDB wants to hear about
thread create events, leave the new child's status pending.
(linux_low_filter_event): If GDB wants to hear about thread exit
events, leave the LWP marked dead and don't delete it.
(linux_wait_for_event_filtered): Don't check for thread exit.
(filter_exit_event): New function.
(linux_wait_1): Use it, when returning an exit event.
(linux_resume_one_lwp_throw): Assert that the LWP's
waitstatus is TARGET_WAITKIND_IGNORE.
* remote-utils.c (prepare_resume_reply): Handle
TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
* server.c (report_thread_events): New global.
(handle_general_set): Handle QThreadEvents.
(handle_query) <qSupported>: Handle and report QThreadEvents+;
(handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and
TARGET_WAITKIND_THREAD_EXITED.
* server.h (report_thread_events): Declare.
gdbserver resume_stop handling bug Running attach-many-short-lived-threads.exp with the extended-remote board with "maint set target-non-stop on" times out -- the attach never completes. Enabling infrun debug logs, we see that GDB is stuck stopping all threads: infrun: target_wait (-1.0.0, status) = infrun: 1639.22213.0 [Thread 1639.22213], infrun: status->kind = stopped, signal = GDB_SIGNAL_0 infrun: Thread 1639.22260 not executing infrun: Thread 1639.22256 not executing infrun: Thread 1639.22258 not executing infrun: Thread 1639.22257 not executing infrun: Thread 1639.22259 not executing infrun: Thread 1639.22255 not executing infrun: Thread 1639.22253 executing, already stopping infrun: Thread 1639.22251 executing, already stopping infrun: Thread 1639.22252 executing, already stopping infrun: Thread 1639.22250 executing, already stopping infrun: Thread 1639.22254 executing, already stopping infrun: Thread 1639.22247 executing, already stopping infrun: Thread 1639.22213 not executing infrun: Thread 1639.22207 not executing infrun: Thread 1639.22201 not executing infrun: Thread 1639.22219 not executing infrun: Thread 1639.1639 not executing ** HANG HERE ** GDB is waiting for the stop replies of any of those "already stopping" threads. Take 22253 for example. On the gdbserver logs we see: ... resume_stop request for LWP 22253 stopping LWP 22253 Sending sigstop to lwp 22253 linux_resume done ... and: my_waitpid (-1, 0x40000001) my_waitpid (-1, 0x80000001): status(3057f), 22253 LWFE: waitpid(-1, ...) returned 22253, ERRNO-OK LLW: waitpid 22253 received Trace/breakpoint trap (stopped) pc is 0x3615ef4ce1 HEW: Got clone event from LWP 22253, new child is LWP 22259 but from here on, we never see any other event for LWP 22253. In particular, we never see the expected SIGSTOP (from "Sending sigstop" above). The issue is that linux_resume_stopped_resumed_lwps never re-resumes the 22253 after the clone event. gdb/gdbserver/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> * linux-low.c (resume_stopped_resumed_lwps): Don't check whether the thread's last_resume_kind was resume_stop.
2015-11-30 17:05:19 +01:00
2015-11-30 Pedro Alves <palves@redhat.com>
* linux-low.c (resume_stopped_resumed_lwps): Don't check whether
the thread's last_resume_kind was resume_stop.
2015-11-30 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_attach): In non-stop mode, wait for one stop
before returning.
2015-11-30 17:05:17 +01:00
2015-11-30 Pedro Alves <palves@redhat.com>
* server.c (handle_v_requests): Handle vCtrlC.
2015-11-30 Pedro Alves <palves@redhat.com>
* gdbthread.h (find_any_thread_of_pid): Declare.
* inferiors.c (thread_of_pid, find_any_thread_of_pid): New
functions.
* server.c (handle_query): If current_thread is NULL, look for
another thread of the selected process.
2015-11-26 Daniel Colascione <dancol@dancol.org>
Simon Marchi <simon.marchi@ericsson.com>
* linux-low.c (linux_target_ops): Use linux_proc_tid_get_name.
* server.c (handle_qxfer_threads_worker): Refactor to include thread
name in reply.
* target.h (struct target_ops) <thread_name>: New field.
(target_thread_name): New macro.
[LynxOS] GDBserver crash debugging threaded program This crash is observable by debugging a threaded program on LynxOS. On the GDB side, this is what we would see: % gdb q (gdb) target remote machine:4444 (gdb) break q.adb:6 (gdb) cont [gdb hits breakpoint] (gdb) cont Remote connection closed <<<--- expected: [Inferior 1 (Remote target) exited normally] On the gdbserver side, which was launched as usual: % gdbserver --once :4444 q Segmentation fault (core dumped) Ooops! The problem happens while GDB is trying to handle the thread termination event of the thread that hit the breakpoint. It started happening after the following change was made: commit 96e7a1eb6d09fda9e22e112e35e7d0085a8f4fd0 Date: Fri Oct 16 11:08:38 2015 -0400 Subject: gdbserver: Reset current_thread when the thread is removed. Reset current_thread and make sure 'remove_process' is used after all associated threads have been removed first. More precisely: . GDBserver receives the execution-resume order; . lynx-low resumes it succesfully, and then relies on lynx_wait_1 to wait for the next event; . We quickly receive one, which lynx_wait_1 analyzes to be a "thread exit" event, and therefore does... case SIGTHREADEXIT: remove_thread (find_thread_ptid (new_ptid)); lynx_continue (new_ptid); goto retry; => remove_thread causes current_thread to be set to NULL... (that's the recent change mentioned above) => ... which causes problems during lynx_continue, because it calls lynx_resume, which calls regcache_invalidate, which unfortunately assumes that CURRENT_THREAD is not NULL: void regcache_invalidate (void) { /* Only update the threads of the current process. */ SEGV!--> int pid = ptid_get_pid (current_thread->entry.id); find_inferior (&all_threads, regcache_invalidate_one, &pid); } Since the problem at hand is caused by trying to figure out which inferior to reset the regcache for, and since lynx_resume actually had that info, this patch fixes the problem by introducing a new routine called regcache_invalidate_pid, which invalidates the cache of the given pid; and then modifies lynx_resume use that new routine rather than relying on regcache_invalidate to invalidate the regcache of the expected inferior. gdb/gdbserver/ChangeLog: * regcache.h (regcache_invalidate_pid): Add declaration. * regcache.c (regcache_invalidate_pid): New function, extracted from regcache_invalidate. (regcache_invalidate): Reimplement using regcache_invalidate_pid. Add trivial documentation comment. * lynx-low.c: Use regcache_invalidate_pid instead of regcache_invalidate.
2015-11-23 18:56:23 +01:00
2015-11-23 Joel Brobecker <brobecker@adacore.com>
* regcache.h (regcache_invalidate_pid): Add declaration.
* regcache.c (regcache_invalidate_pid): New function, extracted
from regcache_invalidate.
(regcache_invalidate): Reimplement using regcache_invalidate_pid.
Add trivial documentation comment.
* lynx-low.c: Use regcache_invalidate_pid instead of
regcache_invalidate.
2015-11-23 Joel Brobecker <brobecker@adacore.com>
* configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t
and Elf64_auxv_t if the target is Android.
2015-11-22 Doug Evans <xdje42@gmail.com>
* target.h: #include <sys/types.h>.
gdbserver: Fix qSupported:xmlRegisters=i386;UnknownFeature+ handling The target_process_qsupported method is called for each qSupported feature that the common code does not recognize. The only current implementation, for x86 Linux (x86_linux_process_qsupported), assumes that it either is called with the "xmlRegisters=i386" feature, or that it is isn't called at all, indicating the connected GDB predates x86 XML descriptions. That's a bad assumption however. If GDB sends in a new/unknown (to core gdbserver) feature after "xmlRegisters=i386", say, something like qSupported:xmlRegisters=i386;UnknownFeature+, then when target_process_qsupported is called for "UnknownFeature+", x86_linux_process_qsupported clears the 'use_xml' global and calls x86_linux_update_xmltarget, and gdbserver ends up _not_ reporting a XML description... This commit changes the target_process_qsupported API to instead pass down a vector of unprocessed qSupported features in one go. (There's an early call to target_process_qsupported(NULL) that indicates "starting qSupported processing". There's no matching call to mark the end of processing, though. I first fixed this by passing (char *)-1 to indicate that, and adjusted the x86 backend to only clear 'use_xml' when qSupported processing starts, and then only call x86_linux_update_xmltarget() when (char *)-1 was passed. However, I wasn't that happy with the hack and came up this alternative version.) gdb/gdbserver/ChangeLog: 2015-11-19 Pedro Alves <palves@redhat.com> * linux-low.c (linux_process_qsupported): Change prototype. Adjust. * linux-low.h (struct linux_target_ops) <process_qsupported>: Change prototype. * linux-x86-low.c (x86_linux_process_qsupported): Change prototype and adjust to loop over all features. * server.c (handle_query) <qSupported>: Adjust to call target_process_qsupported once, passing it a vector of unprocessed features. * target.h (struct target_ops) <process_qsupported>: Change prototype. (target_process_qsupported): Adjust.
2015-11-19 19:31:50 +01:00
2015-11-19 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_process_qsupported): Change prototype.
Adjust.
* linux-low.h (struct linux_target_ops) <process_qsupported>:
Change prototype.
* linux-x86-low.c (x86_linux_process_qsupported): Change prototype
and adjust to loop over all features.
* server.c (handle_query) <qSupported>: Adjust to call
target_process_qsupported once, passing it a vector of unprocessed
features.
* target.h (struct target_ops) <process_qsupported>: Change
prototype.
(target_process_qsupported): Adjust.
2015-11-19 Pedro Alves <palves@redhat.com>
* configure.ac (ERROR_ON_WARNING): Don't check whether in C++
mode.
* configure: Regenerate.
2015-11-19 Pedro Alves <palves@redhat.com>
* configure: Regenerate.
2015-11-19 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (emit_data_processing_reg): Change opcode
type to uint32_t.
2015-11-19 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (enum aarch64_operand_type): New.
(struct aarch64_operand): Move enum out.
2015-11-19 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
struct user_fpsimd_state *.
(aarch64_store_fpregset): Likewise.
2015-11-19 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
struct user_pt_regs *.
(aarch64_store_gregset): Likewise.
2015-11-18 Pedro Alves <palves@redhat.com>
* Makefile.in (all_object_files): Add $IPA_OBJS.
2015-11-17 Pedro Alves <palves@redhat.com>
* win32-low.c (win32_resume): Use gdb_signal_from_host,
GDB_SIGNAL_0 and gdb_signal_to_string.
2015-11-17 Pedro Alves <palves@redhat.com>
* win32-low.c (handle_output_debug_string): Remove parameter.
(win32_kill): Remove our_status local and adjust call to
handle_output_debug_string.
(get_child_debug_event): Adjust call to
handle_output_debug_string.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
* linux-mips-low.c (mips_fill_gregset): Add cast.
(mips_store_gregset): Likewise.
(mips_fill_fpregset): Likewise.
(mips_store_fpregset): Likewise.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
* linux-mips-low.c (mips_add_watchpoint): Rename private to
priv.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
* linux-mips-low.c (mips_linux_new_thread): Change type of
watch_type to enum target_hw_bp_type.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
* linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
Change return type to arm_hwbp_type.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
* linux-aarch32-low.c (arm_fill_gregset): Add cast.
(arm_store_gregset): Likewise.
* linux-arm-low.c (arm_get_hwcap): Likewise.
(arm_read_description): Likewise.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
* linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
* linux-ppc-low.c (ppc_get_hwcap): Add cast.
(ppc_fill_vsxregset): Likewise.
(ppc_store_vsxregset): Likewise.
(ppc_fill_vrregset): Likewise.
(ppc_store_vrregset): Likewise.
(ppc_fill_evrregset): Likewise.
(ppc_store_evrregset): Likewise.
2015-11-03 Simon Marchi <simon.marchi@polymtl.ca>
* linux-ppc-low.c (ppc_usrregs_info): Remove
forward-declaration.
(ppc_arch_setup): Move lower in file.
2015-10-30 Simon Marchi <simon.marchi@ericsson.com>
* proc-service.c (ps_pdread): Change CORE_ADDR cast to uintptr_t.
(ps_pdwrite): Likewise.
2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
* linux-arm-low.c (arm_new_thread): Move pointer dereference
to after assert checks.
2015-10-29 Simon Marchi <simon.marchi@ericsson.com>
* proc-service.c (ps_pdread): Add/adjust casts.
(ps_pdwrite): Add/adjust casts.
2015-10-29 Simon Marchi <simon.marchi@polymtl.ca>
* server.c (handle_search_memory_1): Cast return value of
memmem.
2015-10-29 Simon Marchi <simon.marchi@polymtl.ca>
* server.c (write_qxfer_response): Change type of data to
gdb_byte *.
2015-10-29 Pedro Alves <palves@redhat.com>
* mem-break.c (Z_packet_to_bkpt_type): Add cast.
2015-10-29 Pedro Alves <palves@redhat.com>
* tracepoint.c (clear_installed_tracepoints): Add casts.
2015-10-29 Pedro Alves <palves@redhat.com>
* server.c (handle_v_cont, process_serial_event): Add enum
gdb_signal casts to signal parsing code.
2015-10-29 Pedro Alves <palves@redhat.com>
* linux-low.h (NULL_REGSET): Define.
* linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
* linux-arm-low.c (arm_regsets): Likewise.
* linux-crisv32-low.c (cris_regsets): Likewise.
* linux-m68k-low.c (m68k_regsets): Likewise.
* linux-mips-low.c (mips_regsets): Likewise.
* linux-nios2-low.c (nios2_regsets): Likewise.
* linux-ppc-low.c (ppc_regsets): Likewise.
* linux-s390-low.c (s390_regsets): Likewise.
* linux-sh-low.c (sh_regsets): Likewise.
* linux-sparc-low.c (sparc_regsets): Likewise.
* linux-tic6x-low.c (tic6x_regsets): Likewise.
* linux-tile-low.c (tile_regsets): Likewise.
* linux-x86-low.c (x86_regsets): Likewise.
* linux-xtensa-low.c (xtensa_regsets): Likewise.
2015-10-29 Pedro Alves <palves@redhat.com>
* linux-low.h (NULL_REGSET): Define.
* linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
* linux-arm-low.c (arm_regsets): Likewise.
* linux-crisv32-low.c (cris_regsets): Likewise.
* linux-m68k-low.c (m68k_regsets): Likewise.
* linux-mips-low.c (mips_regsets): Likewise.
* linux-nios2-low.c (nios2_regsets): Likewise.
* linux-ppc-low.c (ppc_regsets): Likewise.
* linux-s390-low.c (s390_regsets): Likewise.
* linux-sh-low.c (sh_regsets): Likewise.
* linux-sparc-low.c (sparc_regsets): Likewise.
* linux-tic6x-low.c (tic6x_regsets): Likewise.
* linux-tile-low.c (tile_regsets): Likewise.
* linux-x86-low.c (x86_regsets): Likewise.
* linux-xtensa-low.c (xtensa_regsets): Likewise.
2015-10-26 Doug Evans <dje@google.com>
* linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
2015-10-26 Doug Evans <dje@google.com>
* linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
2015-10-26 Doug Evans <dje@google.com>
* thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
for debug_printf.
(attach_thread, find_new_threads_callback): Ditto.
2015-10-23 Antoine Tremblay <antoine.tremblay@ericsson.com>
* mem-break.h (set_breakpoint_data): Remove.
2015-10-23 Antoine Tremblay <antoine.tremblay@ericsson.com>
* nto-low.c (nto_sw_breakpoint_from_kind): New function.
(struct target_ops) <sw_breakpoint_from_kind>: Initialize.
(initialize_low): Remove set_breakpoint_data call.
* spu-low.c (spu_sw_breakpoint_from_kind): New function.
(struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
(initialize_low): Remove set_breakpoint_data call.
* win32-low.c (win32_sw_breakpoint_from_kind): New function.
(struct target_ops) <sw_breakpoint_from_kind>: Initialize.
(initialize_low): Remove set_breakpoint_data call.
2015-10-23 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
* mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
* target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
* target.h (target_breakpoint_kind_from_pc): New macro.
2015-10-22 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c (default_breakpoint_kind_from_pc): New function.
(linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
the default breakpoint kind.
2015-10-21 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-arm-low.c (arm_supports_z_point_type): Add software
breakpoint support.
2015-10-21 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-arm-low.c: Refactor breakpoint definitions.
(arm_breakpoint_at): Adjust for arm_abi_breakpoint.
(arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
Implement breakpoint_kind_from_pc and sw_breakpoint_from_kind for ARM in GDBServer. ARM can have multiple breakpoint types based on the instruction set it's currently in: arm, thumb or thumb2. GDBServer needs to know what breakpoint is to be inserted at location when inserting a breakpoint. This is handled by the breakpoint_kind_from_pc and sw_breakpoint_from_kind target ops introduced in a previous patch, this patch adds the arm_breakpoint_kind_from_pc and arm_sw_breakpoint_from_kind implementation so that the proper breakpoint type is returned based on the pc. Also in order to share some code with GDB a new file called arm.c have been introduced in arch/. While this file does not contain much yet future patches will add more to it thus the inclusion at this stage. No regressions on Ubuntu 14.04 on ARMv7 and x86. With gdbserver-{native,extended} / { -marm -mthumb } gdb/ChangeLog: * Makefile.in: Add arm.c/o. * arch/arm.c: New file. * arch/arm.h: (IS_THUMB_ADDR): Move macro from arm-tdep.c. (MAKE_THUMB_ADDR): Likewise. (UNMAKE_THUMB_ADDR): Likewise. * arm-tdep.c (int thumb_insn_size): Move to arm.c. (IS_THUMB_ADDR): Move to arm.h. (MAKE_THUMB_ADDR): Likewise. (UNMAKE_THUMB_ADDR): Likewise. * configure.tgt: Add arm.o to all ARM configs. gdb/gdbserver/ChangeLog: * Makefile.in: Add arm.c/o. * configure.srv: Likewise. * linux-arm-low.c (arm_breakpoint_kinds): New enum. (arm_breakpoint_kind_from_pc): New function. (arm_sw_breakpoint_from_kind): Return proper kind. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
2015-10-21 17:13:41 +02:00
2015-10-21 Antoine Tremblay <antoine.tremblay@ericsson.com>
* Makefile.in: Add arm.c/o.
* configure.srv: Likewise.
* linux-arm-low.c (arm_breakpoint_kinds): New enum.
(arm_breakpoint_kind_from_pc): New function.
(arm_sw_breakpoint_from_kind): Return proper kind.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
Support breakpoint kinds for software breakpoints in GDBServer. There's two ways to set breakpoints in GDBServer. - GDBServer setting its own breakpoints, through API set_breakpoint_at. - GDBServer setting breakpoints according to the information in Z packets, through API set_gdb_breakpoint. Before this patch the breakpoint kinds were a concept unique to GDB and Z packets, as GDBServer never had to set different kinds of breakpoint on its own. This patch teaches GDBServer to handle breakpoint kinds for its own breakpoints. It generalizes the breakpoint kind as per Z packets to represent different kinds of breakpoints directly set by GDBServer also. GDBServer now querys breakpoint_kind_from_pc to know what breakpoint kind to set on its own. As the kind is now a differentiating factor equivalent to size for the breakpoint struct and that it's size can be queried using sw_breakpoint_from_kind, the size field has been replaced with the kind field. All references to size are now replaced by kind or a call to bp_size that wraps sw_breakpoing_from_kind and returns the size of the breakpoint in memory. To fetch the software breakpoint data bp_opcode is called and wraps the sw_breakpoint_from_kind call. No regressions on Ubuntu 14.04 on ARMv7 and x86. With gdbserver-{native,extended} / { -marm -mthumb } gdb/gdbserver/ChangeLog: * linux-low.c (initialize_low): Ajdust for breakpoint global variables removal. * mem-break.c : Remove breakpoint_data/breakpoint_len global variables. (struct raw_breakpoint) <size>: Remove. (struct raw_breakpoint) <kind>: Add. (bp_size): New function. (bp_opcode): Likewise. (find_raw_breakpoint_at): Adjust for kind. (insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode. (remove_memory_breakpoint): Adjust for kind call bp_size. (set_raw_breakpoint_at): Adjust for kind. (set_breakpoint): Likewise. (set_breakpoint_at): Call breakpoint_kind_from_pc. (delete_raw_breakpoint): Adjust for kind. (delete_breakpoint): Likewise. (find_gdb_breakpoint): Likewise. (set_gdb_breakpoint_1): Likewise. (set_gdb_breakpoint): Likewise. (delete_gdb_breakpoint_1): Likewise. (delete_gdb_breakpoint): Likewise. (uninsert_raw_breakpoint): Likewise. (reinsert_raw_breakpoint): Likewise. (set_breakpoint_data): Remove. (validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode. (check_mem_read): Adjust for kind call bp_size. (check_mem_write): Adjust for kind call bp_size,bp_opcode. (clone_one_breakpoint): Adjust for kind. * mem-break.h (set_gdb_breakpoint): Likewise. (delete_gdb_breakpoint): Likewise. * server.c (process_serial_event): Likewise.
2015-10-21 17:13:40 +02:00
2015-10-21 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-low.c (initialize_low): Ajdust for breakpoint global variables
removal.
* mem-break.c : Remove breakpoint_data/breakpoint_len global variables.
(struct raw_breakpoint) <size>: Remove.
(struct raw_breakpoint) <kind>: Add.
(bp_size): New function.
(bp_opcode): Likewise.
(find_raw_breakpoint_at): Adjust for kind.
(insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode.
(remove_memory_breakpoint): Adjust for kind call bp_size.
(set_raw_breakpoint_at): Adjust for kind.
(set_breakpoint): Likewise.
(set_breakpoint_at): Call breakpoint_kind_from_pc.
(delete_raw_breakpoint): Adjust for kind.
(delete_breakpoint): Likewise.
(find_gdb_breakpoint): Likewise.
(set_gdb_breakpoint_1): Likewise.
(set_gdb_breakpoint): Likewise.
(delete_gdb_breakpoint_1): Likewise.
(delete_gdb_breakpoint): Likewise.
(uninsert_raw_breakpoint): Likewise.
(reinsert_raw_breakpoint): Likewise.
(set_breakpoint_data): Remove.
(validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode.
(check_mem_read): Adjust for kind call bp_size.
(check_mem_write): Adjust for kind call bp_size,bp_opcode.
(clone_one_breakpoint): Adjust for kind.
* mem-break.h (set_gdb_breakpoint): Likewise.
(delete_gdb_breakpoint): Likewise.
* server.c (process_serial_event): Likewise.
Add the target_ops needed for software breakpoints in GDBServer. This patch is in preparation for software breakpoints on ARM linux. It refactors breakpoint and breakpoint_len into breakpoint_kind_from_pc and sw_breakpoint_from kind to prepare the case where we have multiple types of breakpoints. Kind is the type of breakpoint (hardware or software) to be inserted, usually it is the lenght of the software breakpoint but can be something else depending on the target. This patch introduces the linux_target_ops breakpoint_kind_from_pc and sw_breakpoint_from_kind. breakpoint_kind_from_pc returns the breakpoint kind and adjusts the PC to the real memory location in case a flag was present in the PC. E.g the instruction mode on ARM. sw_breakpoint_from_kind returns the software breakpoint for this kind as a string of bytes, the length of the breakpoint is adjusted for the breakpoint's size in memory. For targets that have only one kind of breakpoint, the default value 0 is returned by linux_breakpoint_kind_from_pc so that not all targets need to implement the breakpoint_kind_from_pc operation. No regressions, tested on Ubuntu 14.04 on ARMv7 and x86 With gdbserver-{native,extended} / { -marm -mthumb } Also since the target_ops have been changed compilation was tested on affected archs namely : aarch64, arm, bfin, cris, crisv32, m32r, m68k, mips, nios2, ppc, s390, sparc, tic6x, tile, x86, steins. Not tested : sh gdb/gdbserver/ChangeLog: * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-arm-low.c (arm_breakpoint_kind_from_pc): New function. (arm_sw_breakpoint_from_kind): New function. * linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-cris-low.c (cris_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-crisv32-low.c (cris_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-low.c (linux_wait_1): Call breakpoint_kind_from_pc and sw_breakpoint_from_kind to increment the pc. (linux_breakpoint_kind_from_pc): New function. (linux_sw_breakpoint_from_kind): New function. (struct target_ops) <sw_breakpoint_from_kind>: Initialize field. (initialize_low): Call breakpoint_kind_from_pc and sw_breakpoint_from_kind to replace breakpoint_data/len. * linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>: New field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise. * linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-mips-low.c (mips_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-nios2-low.c (nios2_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-ppc-low.c (ppc_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-s390-low.c (s390_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-sh-low.c (sh_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-sparc-low.c (sparc_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-tic6x-low.c (tic6x_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-tile-low.c (tile_sw_breakpoint_from_kind): New function. * linux-x86-low.c (x86_sw_breakpoint_from_kind): New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field. * linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function. (struct linux_target_ops) <breakpoint>: Remove. (struct linux_target_ops) <breakpoint_len>: Remove. (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field. (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
2015-10-21 17:17:26 +02:00
2015-10-21 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-arm-low.c (arm_breakpoint_kind_from_pc): New function.
(arm_sw_breakpoint_from_kind): New function.
* linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-cris-low.c (cris_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-crisv32-low.c (cris_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-low.c (linux_wait_1): Call breakpoint_kind_from_pc
and sw_breakpoint_from_kind to increment the pc.
(linux_breakpoint_kind_from_pc): New function.
(linux_sw_breakpoint_from_kind): New function.
(struct target_ops) <sw_breakpoint_from_kind>: Initialize field.
(initialize_low): Call breakpoint_kind_from_pc and
sw_breakpoint_from_kind to replace breakpoint_data/len.
* linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>:
New field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise.
* linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-mips-low.c (mips_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-nios2-low.c (nios2_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-ppc-low.c (ppc_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-s390-low.c (s390_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-sh-low.c (sh_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-sparc-low.c (sparc_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-tic6x-low.c (tic6x_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-tile-low.c (tile_sw_breakpoint_from_kind): New function.
* linux-x86-low.c (x86_sw_breakpoint_from_kind): New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
* linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function.
(struct linux_target_ops) <breakpoint>: Remove.
(struct linux_target_ops) <breakpoint_len>: Remove.
(struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
(struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
2015-10-21 Antoine Tremblay <antoine.tremblay@ericsson.com>
* linux-cris-low.c (cris_get_pc): Remove void arg.
2015-10-16 Aleksandar Ristovski <aristovski@qnx.com>
* gdbserver/nto-low.c (nto_insert_point, nto_remove_point): Fix
variable name.
2015-10-16 Aleksandar Ristovski <aristovski@qnx.com>
* inferiors.c (thread_pid_matches_callback): New function.
(find_thread_process): New function.
(remove_thread): Reset current_thread.
(remove_process): Assert threads have been removed first.
aarch64 multi-arch part 6: HW breakpoint on unaligned address Nowadays, both aarch64 GDB and linux kernel assumes that address for setting breakpoint should be 4-byte aligned. However that is not true after we support multi-arch, because thumb instruction can be at 2-byte aligned address. Patch http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/375141.html to linux kernel is to teach kernel to handle 2-byte aligned address for HW breakpoint, while this patch is to teach aarch64 GDB handle 2-byte aligned address. First of all, we call gdbarch_breakpoint_from_pc to get the instruction length rather than using hard-coded 4. Secondly, in GDBserver, we set length back to 2 if it is 3, because GDB encode 3 in it to indicate it is a 32-bit thumb breakpoint. Then we relax the address alignment check from 4-byte aligned to 2-byte aligned. This patch enables some tests (such as gdb.base/break-idempotent.exp, gdb.base/cond-eval-mode.exp, gdb.base/watchpoint-reuse-slot.exp,) and fixes many fails (such as gdb.base/hbreak2.exp) when the program is compiled in thumb mode on aarch64. Regression tested on aarch64-linux, both native and gdbserver. This is the last patch of multi-arch work. gdb: 2015-10-15 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_insert_hw_breakpoint): Call gdbarch_breakpoint_from_pc to instruction length. (aarch64_linux_remove_hw_breakpoint): Likewise. * common/common-regcache.h (regcache_register_size): Declare. * nat/aarch64-linux-hw-point.c: Include "common-regcache.h". (aarch64_point_is_aligned): Set alignment to 2 for breakpoint if the process is 32bit, otherwise set alignment to 4. (aarch64_handle_breakpoint): Update comments. * regcache.c (regcache_register_size): New function. gdb/gdbserver: 2015-10-15 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_insert_point): Set len to 2 if it is 3. (aarch64_remove_point): Likewise. * regcache.c (regcache_register_size): New function.
2015-10-15 16:05:10 +02:00
2015-10-15 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_insert_point): Set len to 2
if it is 3.
(aarch64_remove_point): Likewise.
* regcache.c (regcache_register_size): New function.
2015-10-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c: Update all callers as emit_load_store
is renamed to aarch64_emit_load_store.
2015-10-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c: Update all callers of function renaming
from emit_insn to aarch64_emit_insn.
Support displaced stepping in aarch64-linux This patch is to support displaced stepping in aarch64-linux. A visitor is implemented for displaced stepping, and used to record information to fixup pc after displaced stepping if needed. Some emit_* functions are converted to macros, and moved to arch/aarch64-insn.{c,h} so that they can be shared. gdb: 2015-10-12 Yao Qi <yao.qi@linaro.org> * aarch64-linux-tdep.c: Include arch-utils.h. (aarch64_linux_init_abi): Call set_gdbarch_max_insn_length, set_gdbarch_displaced_step_copy_insn, set_gdbarch_displaced_step_fixup, set_gdbarch_displaced_step_free_closure, set_gdbarch_displaced_step_location, and set_gdbarch_displaced_step_hw_singlestep. * aarch64-tdep.c (struct displaced_step_closure): New. (struct aarch64_displaced_step_data): New. (aarch64_displaced_step_b): New function. (aarch64_displaced_step_b_cond): Likewise. (aarch64_register): Likewise. (aarch64_displaced_step_cb): Likewise. (aarch64_displaced_step_tb): Likewise. (aarch64_displaced_step_adr): Likewise. (aarch64_displaced_step_ldr_literal): Likewise. (aarch64_displaced_step_others): Likewise. (aarch64_displaced_step_copy_insn): Likewise. (aarch64_displaced_step_fixup): Likewise. (aarch64_displaced_step_hw_singlestep): Likewise. * aarch64-tdep.h (DISPLACED_MODIFIED_INSNS): New macro. (aarch64_displaced_step_copy_insn): Declare. (aarch64_displaced_step_fixup): Declare. (aarch64_displaced_step_hw_singlestep): Declare. * arch/aarch64-insn.c (emit_insn): Moved from gdbserver/linux-aarch64-low.c. (emit_load_store): Likewise. * arch/aarch64-insn.h (enum aarch64_opcodes): Moved from gdbserver/linux-aarch64-low.c. (struct aarch64_register): Likewise. (struct aarch64_memory_operand): Likewise. (ENCODE): Likewise. (can_encode_int32): New macro. (emit_b, emit_bcond, emit_cb, emit_ldr, emit_ldrsw): Likewise. (emit_tb, emit_nop): Likewise. (emit_insn): Declare. (emit_load_store): Declare. gdb/gdbserver: 2015-10-12 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (enum aarch64_opcodes): Move to arch/aarch64-insn.h. (struct aarch64_memory_operand): Likewise. (ENCODE): Likewise. (emit_insn): Move to arch/aarch64-insn.c. (emit_b, emit_bcond, emit_cb, emit_tb): Remove. (emit_load_store): Move to arch/aarch64-insn.c. (emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove. (can_encode_int32): Remove.
2015-10-12 12:28:38 +02:00
2015-10-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (enum aarch64_opcodes): Move to
arch/aarch64-insn.h.
(struct aarch64_memory_operand): Likewise.
(ENCODE): Likewise.
(emit_insn): Move to arch/aarch64-insn.c.
(emit_b, emit_bcond, emit_cb, emit_tb): Remove.
(emit_load_store): Move to arch/aarch64-insn.c.
(emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove.
(can_encode_int32): Remove.
2015-10-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (extract_signed_bitfield): Remove.
(aarch64_decode_ldr_literal): Move to gdb/arch/aarch64-insn.c.
(aarch64_relocate_instruction): Likewise.
(struct aarch64_insn_data): Move to gdb/arch/aarch64-insn.h.
(struct aarch64_insn_visitor): Likewise.
2015-10-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (struct aarch64_insn_data): New.
(struct aarch64_insn_visitor): New.
(struct aarch64_insn_relocation_data): New.
(aarch64_ftrace_insn_reloc_b): New function.
(aarch64_ftrace_insn_reloc_b_cond): Likewise.
(aarch64_ftrace_insn_reloc_cb): Likewise.
(aarch64_ftrace_insn_reloc_tb): Likewise.
(aarch64_ftrace_insn_reloc_adr): Likewise.
(aarch64_ftrace_insn_reloc_ldr_literal): Likewise.
(aarch64_ftrace_insn_reloc_others): Likewise.
(visitor): New.
(aarch64_relocate_instruction): Use visitor.
2015-10-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_relocate_instruction): Return
int. Add argument buf.
(aarch64_install_fast_tracepoint_jump_pad): Pass buf to
aarch64_relocate_instruction.
2015-10-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_relocate_instruction): Add
argument insn. Remove local variable insn. Don't call
target_read_uint32.
(aarch64_install_fast_tracepoint_jump_pad): Call
target_read_uint32.
2015-09-30 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (emit_movk): Shorten a long line.
(emit_load_store_pair): Likewise.
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
2015-09-25 Simon Marchi <simon.marchi@ericsson.com>
* dll.c (match_dll): Add cast(s).
(unloaded_dll): Likewise.
* linux-low.c (second_thread_of_pid_p): Likewise.
(delete_lwp_callback): Likewise.
(count_events_callback): Likewise.
(select_event_lwp_callback): Likewise.
(linux_set_resume_request): Likewise.
* server.c (accumulate_file_name_length): Likewise.
(emit_dll_description): Likewise.
(handle_qxfer_threads_worker): Likewise.
(visit_actioned_threads): Likewise.
* thread-db.c (any_thread_of): Likewise.
* tracepoint.c (same_process_p): Likewise.
(match_blocktype): Likewise.
(build_traceframe_info_xml): Likewise.
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
2015-09-25 Simon Marchi <simon.marchi@ericsson.com>
* ax.c (gdb_parse_agent_expr): Add cast to allocation result
assignment.
(gdb_unparse_agent_expr): Likewise.
* hostio.c (require_data): Likewise.
(handle_pread): Likewise.
* linux-low.c (disable_regset): Likewise.
(fetch_register): Likewise.
(store_register): Likewise.
(get_dynamic): Likewise.
(linux_qxfer_libraries_svr4): Likewise.
* mem-break.c (delete_fast_tracepoint_jump): Likewise.
(set_fast_tracepoint_jump): Likewise.
(uninsert_fast_tracepoint_jumps_at): Likewise.
(reinsert_fast_tracepoint_jumps_at): Likewise.
(validate_inserted_breakpoint): Likewise.
(clone_agent_expr): Likewise.
* regcache.c (init_register_cache): Likewise.
* remote-utils.c (putpkt_binary_1): Likewise.
(decode_M_packet): Likewise.
(decode_X_packet): Likewise.
(look_up_one_symbol): Likewise.
(relocate_instruction): Likewise.
(monitor_output): Likewise.
* server.c (handle_search_memory): Likewise.
(handle_qxfer_exec_file): Likewise.
(handle_qxfer_libraries): Likewise.
(handle_qxfer): Likewise.
(handle_query): Likewise.
(handle_v_cont): Likewise.
(handle_v_run): Likewise.
(captured_main): Likewise.
* target.c (write_inferior_memory): Likewise.
* thread-db.c (try_thread_db_load_from_dir): Likewise.
* tracepoint.c (init_trace_buffer): Likewise.
(add_tracepoint_action): Likewise.
(add_traceframe): Likewise.
(add_traceframe_block): Likewise.
(cmd_qtdpsrc): Likewise.
(cmd_qtdv): Likewise.
(cmd_qtstatus): Likewise.
(response_source): Likewise.
(response_tsv): Likewise.
(cmd_qtnotes): Likewise.
(gdb_collect): Likewise.
(initialize_tracepoint): Likewise.
Implement target_emit_ops This patch implements compiling agent expressions to native code for AArch64. This allows us to compile conditions set on fast tracepoints. The compiled function has the following prologue: High *------------------------------------------------------* | LR | | FP | <- FP | x1 (ULONGEST *value) | | x0 (unsigned char *regs) | Low *------------------------------------------------------* We save the function's argument on the stack as well as the return address and the frame pointer. We then set the current frame pointer to point to the previous one. The generated code for the expression will freely update the stack pointer so we use the frame pointer to refer to `*value' and `*regs'. `*value' needs to be accessed in the epilogue of the function, in order to set it to whatever is on top of the stack. `*regs' needs to be passed down to the `gdb_agent_get_raw_reg' function with the `reg' operation. gdb/gdbserver/ChangeLog: * linux-aarch64-low-.c: Include ax.h and tracepoint.h. (enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>, <EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>, <NOP>: New. (enum aarch64_condition_codes): New enum. (w0): New static global. (fp): Likewise. (lr): Likewise. (struct aarch64_memory_operand) <type>: New MEMORY_OPERAND_POSTINDEX type. (postindex_memory_operand): New helper function. (emit_ret): New function. (emit_load_store_pair): New function, factored out of emit_stp with support for MEMORY_OPERAND_POSTINDEX. (emit_stp): Rewrite using emit_load_store_pair. (emit_ldp): New function. (emit_load_store): Likewise. (emit_ldr): Mention post-index instruction in comment. (emit_ldrh): New function. (emit_ldrb): New function. (emit_ldrsw): Mention post-index instruction in comment. (emit_str): Likewise. (emit_subs): New function. (emit_cmp): Likewise. (emit_and): Likewise. (emit_orr): Likewise. (emit_orn): Likewise. (emit_eor): Likewise. (emit_mvn): Likewise. (emit_lslv): Likewise. (emit_lsrv): Likewise. (emit_asrv): Likewise. (emit_mul): Likewise. (emit_sbfm): Likewise. (emit_sbfx): Likewise. (emit_ubfm): Likewise. (emit_ubfx): Likewise. (emit_csinc): Likewise. (emit_cset): Likewise. (emit_nop): Likewise. (emit_ops_insns): New helper function. (emit_pop): Likewise. (emit_push): Likewise. (aarch64_emit_prologue): New function. (aarch64_emit_epilogue): Likewise. (aarch64_emit_add): Likewise. (aarch64_emit_sub): Likewise. (aarch64_emit_mul): Likewise. (aarch64_emit_lsh): Likewise. (aarch64_emit_rsh_signed): Likewise. (aarch64_emit_rsh_unsigned): Likewise. (aarch64_emit_ext): Likewise. (aarch64_emit_log_not): Likewise. (aarch64_emit_bit_and): Likewise. (aarch64_emit_bit_or): Likewise. (aarch64_emit_bit_xor): Likewise. (aarch64_emit_bit_not): Likewise. (aarch64_emit_equal): Likewise. (aarch64_emit_less_signed): Likewise. (aarch64_emit_less_unsigned): Likewise. (aarch64_emit_ref): Likewise. (aarch64_emit_if_goto): Likewise. (aarch64_emit_goto): Likewise. (aarch64_write_goto_address): Likewise. (aarch64_emit_const): Likewise. (aarch64_emit_call): Likewise. (aarch64_emit_reg): Likewise. (aarch64_emit_pop): Likewise. (aarch64_emit_stack_flush): Likewise. (aarch64_emit_zero_ext): Likewise. (aarch64_emit_swap): Likewise. (aarch64_emit_stack_adjust): Likewise. (aarch64_emit_int_call_1): Likewise. (aarch64_emit_void_call_2): Likewise. (aarch64_emit_eq_goto): Likewise. (aarch64_emit_ne_goto): Likewise. (aarch64_emit_lt_goto): Likewise. (aarch64_emit_le_goto): Likewise. (aarch64_emit_gt_goto): Likewise. (aarch64_emit_ge_got): Likewise. (aarch64_emit_ops_impl): New static global variable. (aarch64_emit_ops): New target function, return &aarch64_emit_ops_impl. (struct linux_target_ops): Install it.
2015-09-21 16:01:04 +02:00
2015-09-21 Pierre Langlois <pierre.langlois@arm.com>
* linux-aarch64-low-.c: Include ax.h and tracepoint.h.
(enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>,
<EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>,
<NOP>: New.
(enum aarch64_condition_codes): New enum.
(w0): New static global.
(fp): Likewise.
(lr): Likewise.
(struct aarch64_memory_operand) <type>: New
MEMORY_OPERAND_POSTINDEX type.
(postindex_memory_operand): New helper function.
(emit_ret): New function.
(emit_load_store_pair): New function, factored out of emit_stp
with support for MEMORY_OPERAND_POSTINDEX.
(emit_stp): Rewrite using emit_load_store_pair.
(emit_ldp): New function.
(emit_load_store): Likewise.
(emit_ldr): Mention post-index instruction in comment.
(emit_ldrh): New function.
(emit_ldrb): New function.
(emit_ldrsw): Mention post-index instruction in comment.
(emit_str): Likewise.
(emit_subs): New function.
(emit_cmp): Likewise.
(emit_and): Likewise.
(emit_orr): Likewise.
(emit_orn): Likewise.
(emit_eor): Likewise.
(emit_mvn): Likewise.
(emit_lslv): Likewise.
(emit_lsrv): Likewise.
(emit_asrv): Likewise.
(emit_mul): Likewise.
(emit_sbfm): Likewise.
(emit_sbfx): Likewise.
(emit_ubfm): Likewise.
(emit_ubfx): Likewise.
(emit_csinc): Likewise.
(emit_cset): Likewise.
(emit_nop): Likewise.
(emit_ops_insns): New helper function.
(emit_pop): Likewise.
(emit_push): Likewise.
(aarch64_emit_prologue): New function.
(aarch64_emit_epilogue): Likewise.
(aarch64_emit_add): Likewise.
(aarch64_emit_sub): Likewise.
(aarch64_emit_mul): Likewise.
(aarch64_emit_lsh): Likewise.
(aarch64_emit_rsh_signed): Likewise.
(aarch64_emit_rsh_unsigned): Likewise.
(aarch64_emit_ext): Likewise.
(aarch64_emit_log_not): Likewise.
(aarch64_emit_bit_and): Likewise.
(aarch64_emit_bit_or): Likewise.
(aarch64_emit_bit_xor): Likewise.
(aarch64_emit_bit_not): Likewise.
(aarch64_emit_equal): Likewise.
(aarch64_emit_less_signed): Likewise.
(aarch64_emit_less_unsigned): Likewise.
(aarch64_emit_ref): Likewise.
(aarch64_emit_if_goto): Likewise.
(aarch64_emit_goto): Likewise.
(aarch64_write_goto_address): Likewise.
(aarch64_emit_const): Likewise.
(aarch64_emit_call): Likewise.
(aarch64_emit_reg): Likewise.
(aarch64_emit_pop): Likewise.
(aarch64_emit_stack_flush): Likewise.
(aarch64_emit_zero_ext): Likewise.
(aarch64_emit_swap): Likewise.
(aarch64_emit_stack_adjust): Likewise.
(aarch64_emit_int_call_1): Likewise.
(aarch64_emit_void_call_2): Likewise.
(aarch64_emit_eq_goto): Likewise.
(aarch64_emit_ne_goto): Likewise.
(aarch64_emit_lt_goto): Likewise.
(aarch64_emit_le_goto): Likewise.
(aarch64_emit_gt_goto): Likewise.
(aarch64_emit_ge_got): Likewise.
(aarch64_emit_ops_impl): New static global variable.
(aarch64_emit_ops): New target function, return
&aarch64_emit_ops_impl.
(struct linux_target_ops): Install it.
Add support for fast tracepoints This patch adds support for fast tracepoints for aarch64-linux. With this implementation, a tracepoint can only be placed in a +/- 128MB range of the jump pad. This is due to the unconditional branch instruction being limited to a (26 bit << 2) offset from the current PC. Three target operations are implemented: - target_install_fast_tracepoint_jump_pad Building the jump pad the biggest change of this patch. We need to add functions to emit all instructions needed to save and restore the current state when the tracepoint is hit. As well as implementing a lock and creating a collecting_t object identifying the current thread. Steps performed by the jump pad: * Save the current state on the stack. * Push a collecting_t object on the stack. We read the special tpidr_el0 system register to get the thread ID. * Spin-lock on the shared memory location of all tracing threads. We write the address of our collecting_t object there once we have the lock. * Call gdb_collect. * Release the lock. * Restore the state. * Execute the replaced instruction which will have been relocated. * Jump back to the program. - target_get_thread_area As implemented in ps_get_thread_area, target_get_thread_area uses ptrace to fetch the NT_ARM_TLS register. At the architecture level, NT_ARM_TLS represents the tpidr_el0 system register. So this ptrace call (if lwpid is the current thread): ~~~ ptrace (PTRACE_GETREGSET, lwpid, NT_ARM_TLS, &iovec); ~~~ Is equivalent to the following instruction: ~~~ msr x0, tpidr_el0 ~~~ This instruction is used when creating the collecting_t object that GDBserver can read to know if a given thread is currently tracing. So target_get_thread_area must get the same thread IDs as what the jump pad writes into its collecting_t object. - target_get_min_fast_tracepoint_insn_len This just returns 4. gdb/gdbserver/ChangeLog: * Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules. * configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and aarch64-ipa.o. * linux-aarch64-ipa.c: New file. * linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h and endian.h. (aarch64_get_thread_area): New target method. (extract_signed_bitfield): New helper function. (aarch64_decode_ldr_literal): New function. (enum aarch64_opcodes): New enum. (struct aarch64_register): New struct. (struct aarch64_operand): New struct. (x0): New static global. (x1): Likewise. (x2): Likewise. (x3): Likewise. (x4): Likewise. (w2): Likewise. (ip0): Likewise. (sp): Likewise. (xzr): Likewise. (aarch64_register): New helper function. (register_operand): Likewise. (immediate_operand): Likewise. (struct aarch64_memory_operand): New struct. (offset_memory_operand): New helper function. (preindex_memory_operand): Likewise. (enum aarch64_system_control_registers): New enum. (ENCODE): New macro. (emit_insn): New helper function. (emit_b): New function. (emit_bcond): Likewise. (emit_cb): Likewise. (emit_tb): Likewise. (emit_blr): Likewise. (emit_stp): Likewise. (emit_ldp_q_offset): Likewise. (emit_stp_q_offset): Likewise. (emit_load_store): Likewise. (emit_ldr): Likewise. (emit_ldrsw): Likewise. (emit_str): Likewise. (emit_ldaxr): Likewise. (emit_stxr): Likewise. (emit_stlr): Likewise. (emit_data_processing_reg): Likewise. (emit_data_processing): Likewise. (emit_add): Likewise. (emit_sub): Likewise. (emit_mov): Likewise. (emit_movk): Likewise. (emit_mov_addr): Likewise. (emit_mrs): Likewise. (emit_msr): Likewise. (emit_sevl): Likewise. (emit_wfe): Likewise. (append_insns): Likewise. (can_encode_int32_in): New helper function. (aarch64_relocate_instruction): New function. (aarch64_install_fast_tracepoint_jump_pad): Likewise. (aarch64_get_min_fast_tracepoint_insn_len): Likewise. (struct linux_target_ops): Install aarch64_get_thread_area, aarch64_install_fast_tracepoint_jump_pad and aarch64_get_min_fast_tracepoint_insn_len.
2015-09-21 16:01:04 +02:00
2015-09-21 Pierre Langlois <pierre.langlois@arm.com>
* Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules.
* configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and
aarch64-ipa.o.
* linux-aarch64-ipa.c: New file.
* linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h
and endian.h.
(aarch64_get_thread_area): New target method.
(extract_signed_bitfield): New helper function.
(aarch64_decode_ldr_literal): New function.
(enum aarch64_opcodes): New enum.
(struct aarch64_register): New struct.
(struct aarch64_operand): New struct.
(x0): New static global.
(x1): Likewise.
(x2): Likewise.
(x3): Likewise.
(x4): Likewise.
(w2): Likewise.
(ip0): Likewise.
(sp): Likewise.
(xzr): Likewise.
(aarch64_register): New helper function.
(register_operand): Likewise.
(immediate_operand): Likewise.
(struct aarch64_memory_operand): New struct.
(offset_memory_operand): New helper function.
(preindex_memory_operand): Likewise.
(enum aarch64_system_control_registers): New enum.
(ENCODE): New macro.
(emit_insn): New helper function.
(emit_b): New function.
(emit_bcond): Likewise.
(emit_cb): Likewise.
(emit_tb): Likewise.
(emit_blr): Likewise.
(emit_stp): Likewise.
(emit_ldp_q_offset): Likewise.
(emit_stp_q_offset): Likewise.
(emit_load_store): Likewise.
(emit_ldr): Likewise.
(emit_ldrsw): Likewise.
(emit_str): Likewise.
(emit_ldaxr): Likewise.
(emit_stxr): Likewise.
(emit_stlr): Likewise.
(emit_data_processing_reg): Likewise.
(emit_data_processing): Likewise.
(emit_add): Likewise.
(emit_sub): Likewise.
(emit_mov): Likewise.
(emit_movk): Likewise.
(emit_mov_addr): Likewise.
(emit_mrs): Likewise.
(emit_msr): Likewise.
(emit_sevl): Likewise.
(emit_wfe): Likewise.
(append_insns): Likewise.
(can_encode_int32_in): New helper function.
(aarch64_relocate_instruction): New function.
(aarch64_install_fast_tracepoint_jump_pad): Likewise.
(aarch64_get_min_fast_tracepoint_insn_len): Likewise.
(struct linux_target_ops): Install aarch64_get_thread_area,
aarch64_install_fast_tracepoint_jump_pad and
aarch64_get_min_fast_tracepoint_insn_len.
Move instruction decoding into new arch/ directory This patch moves the following functions into the arch/ common directory, in new files arch/aarch64-insn.{h,c}. They are prefixed with 'aarch64_': - aarch64_decode_adrp - aarch64_decode_b - aarch64_decode_cb - aarch64_decode_tb We will need them to implement fast tracepoints in GDBserver. For consistency, this patch also adds the 'aarch64_' prefix to static decoding functions that do not need to be shared right now. V2: make sure the formatting issues propagated fix `gdbserver/configure.srv'. gdb/ChangeLog: * Makefile.in (ALL_64_TARGET_OBS): Add aarch64-insn.o. (HFILES_NO_SRCDIR): Add arch/aarch64-insn.h. (aarch64-insn.o): New rule. * configure.tgt (aarch64*-*-elf): Add aarch64-insn.o. (aarch64*-*-linux*): Likewise. * arch/aarch64-insn.c: New file. * arch/aarch64-insn.h: New file. * aarch64-tdep.c: Include arch/aarch64-insn.h. (aarch64_debug): Move to arch/aarch64-insn.c. Declare in arch/aarch64-insn.h. (decode_add_sub_imm): Rename to ... (aarch64_decode_add_sub_imm): ... this. (decode_adrp): Rename to ... (aarch64_decode_adrp): ... this. Move to arch/aarch64-insn.c. Declare in arch/aarch64-insn.h. (decode_b): Rename to ... (aarch64_decode_b): ... this. Move to arch/aarch64-insn.c. Declare in arch/aarch64-insn.h. (decode_bcond): Rename to ... (aarch64_decode_bcond): ... this. Move to arch/aarch64-insn.c. Declare in arch/aarch64-insn.h. (decode_br): Rename to ... (aarch64_decode_br): ... this. (decode_cb): Rename to ... (aarch64_decode_cb): ... this. Move to arch/aarch64-insn.c. Declare in arch/aarch64-insn.h. (decode_eret): Rename to ... (aarch64_decode_eret): ... this. (decode_movz): Rename to ... (aarch64_decode_movz): ... this. (decode_orr_shifted_register_x): Rename to ... (aarch64_decode_orr_shifted_register_x): ... this. (decode_ret): Rename to ... (aarch64_decode_ret): ... this. (decode_stp_offset): Rename to ... (aarch64_decode_stp_offset): ... this. (decode_stp_offset_wb): Rename to ... (aarch64_decode_stp_offset_wb): ... this. (decode_stur): Rename to ... (aarch64_decode_stur): ... this. (decode_tb): Rename to ... (aarch64_decode_tb): ... this. Move to arch/aarch64-insn.c. Declare in arch/aarch64-insn.h. (aarch64_analyze_prologue): Adjust calls to renamed functions. gdb/gdbserver/ChangeLog: * Makefile.in (aarch64-insn.o): New rule. * configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
2015-09-21 16:01:04 +02:00
2015-09-21 Pierre Langlois <pierre.langlois@arm.com>
* Makefile.in (aarch64-insn.o): New rule.
* configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
Wrap gdb_agent_op_sizes by #ifndef IN_PROCESS_AGENT Hi, I see the following build warning with recent GCC built from mainline, aarch64-none-linux-gnu-gcc -g -O2 -I. -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../common -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../regformats -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/.. -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../../include -I/home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -Wdeclaration-after-statement -Werror -DGDBSERVER -DCONFIG_UST_GDB_INTEGRATION -fPIC -DIN_PROCESS_AGENT -fvisibility=hidden -c -o ax-ipa.o -MT ax-ipa.o -MMD -MP -MF .deps/ax-ipa.Tpo `echo " -Wall -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -Wdeclaration-after-statement " | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"` /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/ax.c /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/ax.c:73:28: error: 'gdb_agent_op_sizes' defined but not used [-Werror=unused-const-variable] static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] = ^ cc1: all warnings being treated as errors gdb_agent_op_sizes is only used in function is_goto_target, which is defined inside #ifndef IN_PROCESS_AGENT. This warning is not arch specific, so GCC mainline for other targets should produce this warning too, although this warning is triggered by enabling aarch64 fast tracepoint. The fix is to move gdb_agent_op_sizes to gdb/gdbserver: 2015-09-21 Yao Qi <yao.qi@linaro.org> * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
2015-09-21 13:31:51 +02:00
2015-09-21 Yao Qi <yao.qi@linaro.org>
* ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
2015-09-21 Yao Qi <yao.qi@linaro.org>
* tracepoint.c (max_jump_pad_size): Remove.
aarch64 multi-arch (part 3): get thread area With the kernle fix <http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/356511.html>, aarch64 GDB is able to read the base of thread area of 32-bit arm program through NT_ARM_TLS. This patch is to teach both GDB and GDBserver to read the base of thread area correctly in the multi-arch case. A new function aarch64_ps_get_thread_area is added, and is shared between GDB and GDBserver. With this patch applied, the following fails in multi-arch testing (GDB is aarch64 but the test cases are arm) are fixed, -FAIL: gdb.threads/tls-nodebug.exp: thread local storage -FAIL: gdb.threads/tls-shared.exp: print thread local storage variable -FAIL: gdb.threads/tls-so_extern.exp: print thread local storage variable -FAIL: gdb.threads/tls-var.exp: print tls_var -FAIL: gdb.threads/tls.exp: first thread local storage -FAIL: gdb.threads/tls.exp: first another thread local storage -FAIL: gdb.threads/tls.exp: p a_thread_local -FAIL: gdb.threads/tls.exp: p file2_thread_local -FAIL: gdb.threads/tls.exp: p a_thread_local second time gdb: 2015-09-18 Yao Qi <yao.qi@linaro.org> * nat/aarch64-linux.c: Include elf/common.h, nat/gdb_ptrace.h, asm/ptrace.h and sys/uio.h. (aarch64_ps_get_thread_area): New function. * nat/aarch64-linux.h: Include gdb_proc_service.h. (aarch64_ps_get_thread_area): Declare. * aarch64-linux-nat.c (ps_get_thread_area): Call aarch64_ps_get_thread_area. gdb/gdbserver: 2015-09-18 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c: Don't include sys/uio.h. (ps_get_thread_area): Call aarch64_ps_get_thread_area.
2015-09-18 14:59:42 +02:00
2015-09-18 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c: Don't include sys/uio.h.
(ps_get_thread_area): Call aarch64_ps_get_thread_area.
2015-09-16 Wei-cheng Wang <cole945@gmail.com>
* tracepoint.c (eval_result_type): Change prototype.
(condition_true_at_tracepoint): Fix argument to compiled_cond.
2015-09-15 Pedro Alves <palves@redhat.com>
* remote-utils.c (prepare_resume_reply) <TARGET_WAITKIND_EXECD>:
Check whether to report exec events instead of checking whether
multiprocess is enabled.
2015-09-15 Pedro Alves <palves@redhat.com>
PR remote/18965
* remote-utils.c (prepare_resume_reply): Merge
TARGET_WAITKIND_VFORK_DONE switch case with the
TARGET_WAITKIND_FORKED case.
2015-09-15 Yao Qi <yao.qi@linaro.org>
* server.c (handle_query): Check string comparison using
"else if" instead of "if".
Support single step by arch or target Nowadays, GDB only knows whether architecture supports hardware single step or software single step (through gdbarch hook software_single_step), and for a given instruction or instruction sequence, GDB knows how to do single step (hardware or software). However, GDB doesn't know whether the target supports hardware single step. It is possible that the architecture doesn't support hardware single step, such as arm, but the target supports, such as simulator. This was discussed in this thread https://www.sourceware.org/ml/gdb/2009-12/msg00033.html before. I encounter this problem for aarch64 multi-arch support. When aarch64 debugs arm program, gdbarch is arm, so software single step is still used. However, the underneath linux kernel does support hardware single step, so IWBN to use it. This patch is to add a new target_ops hook to_can_do_single_step, and only use it in arm_linux_software_single_step to decide whether or not to use hardware single step. On the native aarch64 linux target, 1 is returned. On other targets, -1 is returned. On the remote target, if the target supports s and S actions in the vCont? reply, then target can do single step. However, old GDBserver will send s and S in the reply to vCont?, which will confuse new GDB. For example, old GDBserver on arm-linux will send s and S in the reply to vCont?, but it doesn't support hardware single step. On the other hand, new GDBserver, on arm-linux for example, will not send s and S in the reply to vCont?, but old GDB thinks it doesn't support vCont packet at all. In order to address this problem, I add a new qSupported feature vContSupported, which indicates GDB wants to know the supported actions in the reply to vCont?, and qSupported response contains vContSupported if the stub is able tell supported vCont actions in the reply of vCont?. If the patched GDB talks with patched GDBserver on x86, the RSP traffic is like this: -> $qSupported:...+;vContSupported+ <- ...+;vContSupported+ ... -> $vCont? <- vCont;c;C;t;s;S;r then, GDB knows the stub can do single step, and may stop using software single step even the architecture doesn't support hardware single step. If the patched GDB talks with patched GDBserver on arm, the last vCont? reply will become: <- vCont;c;C;t GDB thinks the target doesn't support single step, so it will use software single step. If the patched GDB talks with unpatched GDBserver, the RSP traffic is like this: -> $qSupported:...+;vContSupported+ <- ...+ ... -> $vCont? <- vCont;c;C;t;s;S;r although GDBserver returns s and S, GDB still thinks GDBserver may not support single step because it doesn't support vContSupported. If the unpatched GDB talks with patched GDBserver on x86, the RSP traffic is like: -> $qSupported:...+; <- ...+;vContSupported+ ... -> $vCont? <- vCont;c;C;t;s;S;r Since GDB doesn't sent vContSupported in the qSupported feature, GDBserver sends s and S regardless of the support of hardware single step. gdb: 2015-09-15 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_can_do_single_step): New function. (_initialize_aarch64_linux_nat): Install it to to_can_do_single_step. * arm-linux-tdep.c (arm_linux_software_single_step): Return 0 if target_can_do_single_step returns 1. * remote.c (struct vCont_action_support) <s, S>: New fields. (PACKET_vContSupported): New enum. (remote_protocol_features): New element for vContSupported. (remote_query_supported): Append "vContSupported+". (remote_vcont_probe): Remove support_s and support_S, use rs->supports_vCont.s and rs->supports_vCont.S instead. Disable vCont packet if c and C actions are not supported. (remote_can_do_single_step): New function. (init_remote_ops): Install it to to_can_do_single_step. (_initialize_remote): Call add_packet_config_cmd. * target.h (struct target_ops) <to_can_do_single_step>: New field. (target_can_do_single_step): New macro. * target-delegates.c: Re-generated. gdb/gdbserver: 2015-09-15 Yao Qi <yao.qi@linaro.org> * server.c (vCont_supported): New global variable. (handle_query): Set vCont_supported to 1 if "vContSupported+" matches. Append ";vContSupported+" to own_buf. (handle_v_requests): Append ";s;S" to own_buf if target supports hardware single step or vCont_supported is false. (capture_main): Set vCont_supported to zero. gdb/doc: 2015-09-15 Yao Qi <yao.qi@linaro.org> * gdb.texinfo (General Query Packets): Add vContSupported to tables of 'gdbfeatures' and 'stub features' supported in the qSupported packet, as well as to the list containing stub feature details.
2015-09-15 15:09:18 +02:00
2015-09-15 Yao Qi <yao.qi@linaro.org>
* server.c (vCont_supported): New global variable.
(handle_query): Set vCont_supported to 1 if "vContSupported+"
matches. Append ";vContSupported+" to own_buf.
(handle_v_requests): Append ";s;S" to own_buf if target supports
hardware single step or vCont_supported is false.
(capture_main): Set vCont_supported to zero.
2015-09-15 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_supports_conditional_breakpoints): Rename
it to ...
(linux_supports_hardware_single_step): ... New function.
(linux_target_ops): Update.
* lynx-low.c (lynx_target_ops): Set field
supports_hardware_single_step to target_can_do_hardware_single_step.
* nto-low.c (nto_target_ops): Likewise.
* spu-low.c (spu_target_ops): Likewise.
* win32-low.c (win32_target_ops): Likewise.
* target.c (target_can_do_hardware_single_step): New function.
* target.h (struct target_ops) <supports_conditional_breakpoints>:
Remove. <supports_hardware_single_step>: New field.
(target_supports_conditional_breakpoints): Remove.
(target_supports_hardware_single_step): New macro.
(target_can_do_hardware_single_step): Declare.
* server.c (handle_query): Use target_supports_hardware_single_step
instead of target_supports_conditional_breakpoints.
2015-09-15 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
function.
(struct linux_target_ops the_low_target): Install
aarch64_linux_siginfo_fixup.
Extended-remote follow-exec This patch implements support for exec events on extended-remote Linux targets. Follow-exec-mode and rerun behave as expected. Catchpoints and test updates are implemented in subsequent patches. This patch was derived from a patch posted last October: https://sourceware.org/ml/gdb-patches/2014-10/msg00877.html. It was originally based on some work done by Luis Machado in 2013. IMPLEMENTATION ---------------- Exec events are enabled via ptrace options. When an exec event is detected by gdbserver, the existing process data, along with all its associated lwp and thread data, is deleted and replaced by data for a new single-threaded process. The new process data is initialized with the appropriate parts of the state of the execing process. This approach takes care of several potential pitfalls, including: * deleting the data for an execing non-leader thread before any wait/sigsuspend occurs * correctly initializing the architecture of the execed process We then report the exec event using a new RSP stop reason, "exec". When GDB receives an "exec" event, it saves the status in the event structure's target_waitstatus field, like what is done for remote fork events. Because the original and execed programs may have different architectures, we skip parsing the section of the stop reply packet that contains register data. The register data will be retrieved later after the inferior's architecture has been set up by infrun.c:follow_exec. At that point the exec event is handled by the existing event handling in GDB. However, a few changes were necessary so that infrun.c:follow_exec could accommodate the remote target. * Where follow-exec-mode "new" is handled, we now call add_inferior_with_spaces instead of add_inferior with separate calls to set up the program and address spaces. The motivation for this is that add_inferior_with_spaces also sets up the initial architecture for the inferior, which is needed later by target_find_description when it calls target_gdbarch. * We call a new target function, target_follow_exec. This function allows us to store the execd_pathname in the inferior, instead of using the static string remote_exec_file from remote.c. The static string didn't work for follow-exec-mode "new", since once you switched to the execed program, the original remote exec-file was lost. The execd_pathname is now stored in the inferior's program space as a REGISTRY field. All of the requisite mechanisms for this are defined in remote.c. gdb/gdbserver/ChangeLog: * linux-low.c (linux_mourn): Static declaration. (linux_arch_setup): Move in front of handle_extended_wait. (linux_arch_setup_thread): New function. (handle_extended_wait): Handle exec events. Call linux_arch_setup_thread. Make event_lwp argument a pointer-to-a-pointer. (check_zombie_leaders): Do not check stopped threads. (linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC. (linux_low_filter_event): Add lwp and thread for exec'ing non-leader thread if leader thread has been deleted. Refactor code into linux_arch_setup_thread and call it. Pass child lwp pointer by reference to handle_extended_wait. (linux_wait_for_event_filtered): Update comment. (linux_wait_1): Prevent clobbering exec event status. (linux_supports_exec_events): New function. (linux_target_ops) <supports_exec_events>: Initialize new member. * lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize new member. * remote-utils.c (prepare_resume_reply): New stop reason 'exec'. * server.c (report_exec_events): New global variable. (handle_query): Handle qSupported query for exec-events feature. (captured_main): Initialize report_exec_events. * server.h (report_exec_events): Declare new global variable. * target.h (struct target_ops) <supports_exec_events>: New member. (target_supports_exec_events): New macro. * win32-low.c (win32_target_ops) <supports_exec_events>: Initialize new member. gdb/ChangeLog: * infrun.c (follow_exec): Use process-style ptid for exec message. Call add_inferior_with_spaces and target_follow_exec. * nat/linux-ptrace.c (linux_supports_traceexec): New function. * nat/linux-ptrace.h (linux_supports_traceexec): Declare. * remote.c (remote_pspace_data): New static variable. (remote_pspace_data_cleanup): New function. (get_remote_exec_file): New function. (set_remote_exec_file_1): New function. (set_remote_exec_file): New function. (show_remote_exec_file): New function. (remote_exec_file): Delete static variable. (anonymous enum) <PACKET_exec_event_feature> New enumeration constant. (remote_protocol_features): Add entry for exec-events feature. (remote_query_supported): Add client side of qSupported query for exec-events feature. (remote_follow_exec): New function. (remote_parse_stop_reply): Handle 'exec' stop reason. (extended_remote_run, extended_remote_create_inferior): Call get_remote_exec_file and set_remote_exec_file_1. (init_extended_remote_ops) <to_follow_exec>: Initialize new member. (_initialize_remote): Call register_program_space_data_with_cleanup. Call add_packet_config_cmd for remote exec-events feature. Modify call to add_setshow_string_noescape_cmd for exec-file to use new functions set_remote_exec_file and show_remote_exec_file. * target-debug.h, target-delegates.c: Regenerated. * target.c (target_follow_exec): New function. * target.h (struct target_ops) <to_follow_exec>: New member. (target_follow_exec): Declare new function.
2015-09-11 20:06:02 +02:00
2015-09-11 Don Breazeal <donb@codesourcery.com>
Luis Machado <lgustavo@codesourcery.com>
* linux-low.c (linux_mourn): Static declaration.
(linux_arch_setup): Move in front of
handle_extended_wait.
(linux_arch_setup_thread): New function.
(handle_extended_wait): Handle exec events. Call
linux_arch_setup_thread. Make event_lwp argument a
pointer-to-a-pointer.
(check_zombie_leaders): Do not check stopped threads.
(linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC.
(linux_low_filter_event): Add lwp and thread for exec'ing
non-leader thread if leader thread has been deleted.
Refactor code into linux_arch_setup_thread and call it.
Pass child lwp pointer by reference to handle_extended_wait.
(linux_wait_for_event_filtered): Update comment.
(linux_wait_1): Prevent clobbering exec event status.
(linux_supports_exec_events): New function.
(linux_target_ops) <supports_exec_events>: Initialize new member.
* lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize
new member.
* remote-utils.c (prepare_resume_reply): New stop reason 'exec'.
* server.c (report_exec_events): New global variable.
(handle_query): Handle qSupported query for exec-events feature.
(captured_main): Initialize report_exec_events.
* server.h (report_exec_events): Declare new global variable.
* target.h (struct target_ops) <supports_exec_events>: New
member.
(target_supports_exec_events): New macro.
* win32-low.c (win32_target_ops) <supports_exec_events>:
Initialize new member.
btrace: kernel address filtering For the BTS recording format, we sometimes get a FROM->TO record where the FROM address lies in the kernel and the TO address lies in user space at whatever address the user process was resumed. GDB has a heuristic to filter out such records based on looking at the most significant bit in the PC. This works fine for 64-bit systems but it doesn't always work for 32-bit systems. Libraries that are loaded at fairly high addresses might be mistaken for kernel code and branches inside the library are filtered out. Change the heuristic to (again heuristically) try to determine the lowest address in kernel space. Any PC that is smaller than that should be in user space. On today's systems, there should be a symbol "_text" at that address. Read /proc/kallsyms and search for that symbol. It is not guaranteed that /proc/kallsyms is readable on all systems. On 64-bit systems, we fall back to check the most significant bit. On 32-bit systems, we refrain from filtering out addresses. The filtering should really be done by the kernel. And it soon will be: https://lkml.org/lkml/2015/8/31/212. gdb/ * nat/linux-btrace.h (struct btrace_target_info) <ptr_bits>: Remove. * nat/linux-btrace.c: Include filestuff.h and inttypes.h. Remove include of sys/utsname.h. (linux_determine_kernel_ptr_bits): Remove. (linux_determine_kernel_start): New. (perf_event_is_kernel_addr): Remove tinfo argument. Update users. Update check. (perf_event_skip_bts_record): Remove tinfo argument. Update users. (linux_enable_bts, linux_enable_pt): Remove tinfo->ptr_bits initialization. * x86-linux-nat.c (x86_linux_enable_btrace): Remove ptr_bits assignment. gdbserver/ * linux-low.c (linux_low_enable_btrace): Remove. (linux_target_ops): Replace linux_low_enable_btrace with linux_enable_btrace.
2015-08-11 11:05:58 +02:00
2015-09-09 Markus Metzger <markus.t.metzger@intel.com>
* linux-low.c (linux_low_enable_btrace): Remove.
(linux_target_ops): Replace linux_low_enable_btrace with
linux_enable_btrace.
[aarch64] Check region OK for HW watchpoint in GDBserver Nowadays, if user requests HW watchpoint to monitor a large memory area or unaligned area, aarch64 GDB will split into multiple aligned areas, and use multiple debugging registers to watch them. However, the registers are not updated in a transaction way. GDBserver doesn't revert updates in previous iterations if some debugging registers fail to update due to some reason, like no free debugging registers available, in the latter iteration. For example, if we have a char buf[34], and watch buf in gdb, (gdb) watch buf Hardware watchpoint 2: buf (gdb) c Continuing. infrun: clear_proceed_status_thread (Thread 13466) infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT) infrun: step-over queue now empty infrun: resuming [Thread 13466] for step-over Sending packet: $m410838,22#35...Packet received: 00000000000000000000000000000000000000000000000000000000000000000000 infrun: skipping breakpoint: stepping past insn at: 0x400524 infrun: skipping breakpoint: stepping past insn at: 0x400524 Sending packet: $Z2,410838,22#80...Packet received: E01 <----- [1] Packet Z2 (write-watchpoint) is supported Sending packet: $Z0,7fb7fe0a8c,4#43...Packet received: OK Warning: Could not insert hardware watchpoint 2. Could not insert hardware breakpoints: You may have requested too many hardware breakpoints/watchpoints. GDB receives E01 for Z2 packet [1] but GDBserver updates the debugging register status, insert_point (addr=0x00410838, len=34, type=hw-write-watchpoint): BREAKPOINTs: BP0: addr=0x0, ctrl=0x00000000, ref.count=0 BP1: addr=0x0, ctrl=0x00000000, ref.count=0 BP2: addr=0x0, ctrl=0x00000000, ref.count=0 BP3: addr=0x0, ctrl=0x00000000, ref.count=0 BP4: addr=0x0, ctrl=0x00000000, ref.count=0 BP5: addr=0x0, ctrl=0x00000000, ref.count=0 WATCHPOINTs: WP0: addr=0x410850, ctrl=0x00001ff5, ref.count=1 WP1: addr=0x410848, ctrl=0x00001ff5, ref.count=1 WP2: addr=0x410840, ctrl=0x00001ff5, ref.count=1 WP3: addr=0x410838, ctrl=0x00001ff5, ref.count=1 four debugging registers can not monitor 34-byte long area, so the last iteration of updating debugging register state fails but previous iterations succeed. This makes GDB think no HW watchpoint is inserted but some debugging registers are used. This problem was exposed by "watch buf" gdb.base/watchpoint.exp with aarch64 GDBserver debugging arm 32-bit program. The buf is 30-byte long but 4-byte aligned, and four debugging registers can't cover 34-byte (extend 4 bytes to be 8-byte aligned) area. However, this problem does exist on non-multi-arch debugging scenario as well. This patch moves code in aarch64_linux_region_ok_for_hw_watchpoint to aarch64_linux_region_ok_for_watchpoint in nat/aarch64-linux-hw-point.c. Then, checks with aarch64_linux_region_ok_for_watchpoint, like what we are doing in GDB. If the region is OK, call aarch64_handle_watchpoint. Regression tested on aarch64 with both 64-bit program and 32-bit program. Some fails in gdb.base/watchpoint.exp are fixed. gdb: 2015-09-03 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_region_ok_for_hw_watchpoint): Move code to aarch64_linux_region_ok_for_watchpoint. Call aarch64_linux_region_ok_for_watchpoint. * nat/aarch64-linux-hw-point.c (aarch64_linux_region_ok_for_watchpoint): New function. * nat/aarch64-linux-hw-point.h (aarch64_linux_region_ok_for_watchpoint): Declare it. gdb/gdbserver: 2015-09-03 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_insert_point): Call aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint returns true.
2015-09-03 15:01:49 +02:00
2015-09-03 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_insert_point): Call
aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint
returns true.
2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* linux-low.c (check_stopped_by_breakpoint): Use
GDB_ARCH_IS_TRAP_BRKPT instead of GDB_ARCH_TRAP_BRKPT.
2015-08-27 Pedro Alves <palves@redhat.com>
* proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
2015-08-26 Simon Marchi <simon.marchi@ericsson.com>
* ax.c (gdb_parse_agent_expr): Replace xmalloc-family function with
the XNEW-family equivalent.
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
(compile_bytecodes): Likewise.
* dll.c (loaded_dll): Likewise.
* event-loop.c (append_callback_event): Likewise.
(create_file_handler): Likewise.
(create_file_event): Likewise.
* hostio.c (handle_open): Likewise.
* inferiors.c (add_thread): Likewise.
(add_process): Likewise.
* linux-aarch64-low.c (aarch64_linux_new_process): Likewise.
* linux-arm-low.c (arm_new_process): Likewise.
(arm_new_thread): Likewise.
* linux-low.c (add_to_pid_list): Likewise.
(linux_add_process): Likewise.
(handle_extended_wait): Likewise.
(add_lwp): Likewise.
(enqueue_one_deferred_signal): Likewise.
(enqueue_pending_signal): Likewise.
(linux_resume_one_lwp_throw): Likewise.
(linux_resume_one_thread): Likewise.
(linux_read_memory): Likewise.
(linux_write_memory): Likewise.
* linux-mips-low.c (mips_linux_new_process): Likewise.
(mips_linux_new_thread): Likewise.
(mips_add_watchpoint): Likewise.
* linux-x86-low.c (initialize_low_arch): Likewise.
* lynx-low.c (lynx_add_process): Likewise.
* mem-break.c (set_raw_breakpoint_at): Likewise.
(set_breakpoint): Likewise.
(add_condition_to_breakpoint): Likewise.
(add_commands_to_breakpoint): Likewise.
(clone_agent_expr): Likewise.
(clone_one_breakpoint): Likewise.
* regcache.c (new_register_cache): Likewise.
* remote-utils.c (look_up_one_symbol): Likewise.
* server.c (queue_stop_reply): Likewise.
(start_inferior): Likewise.
(queue_stop_reply_callback): Likewise.
(handle_target_event): Likewise.
* spu-low.c (fetch_ppc_memory): Likewise.
(store_ppc_memory): Likewise.
* target.c (set_target_ops): Likewise.
* thread-db.c (thread_db_load_search): Likewise.
(try_thread_db_load_1): Likewise.
* tracepoint.c (add_tracepoint): Likewise.
(add_tracepoint_action): Likewise.
(create_trace_state_variable): Likewise.
(cmd_qtdpsrc): Likewise.
(cmd_qtro): Likewise.
(add_while_stepping_state): Likewise.
* win32-low.c (child_add_thread): Likewise.
(get_image_name): Likewise.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* Makefile.in (aarch64-linux.o): New rule.
* configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
srv_tgtobj.
* linux-aarch64-low.c: Include nat/aarch64-linux.h.
(aarch64_init_debug_reg_state): Make it extern.
(aarch64_linux_prepare_to_resume): Remove.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
lwp_arch_private_info and ptid_of_lwp.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
Find proc_info by find_process_pid. All callers updated.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (struct arch64_dr_update_callback_param):
Remove.
(debug_reg_change_callback): Remove.
(aarch64_notify_debug_reg_change): Remove.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_notify_debug_reg_change):
Call current_lwp_ptid.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (debug_reg_change_callback): Use
debug_printf.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (debug_reg_change_callback): Use phex.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (debug_reg_change_callback): Remove comments.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (debug_reg_change_callback): Re-indent
the code.
2015-08-25 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
Remove.
(debug_reg_change_callback): Remove argument entry and add argument
lwp. Remove local variable thread. Don't print thread id in the
debugging output. Don't check whether pid of thread equals to pid.
(aarch64_notify_debug_reg_change): Don't set param.pid. Call
iterate_over_lwps instead find_inferior.
2015-08-24 Pedro Alves <palves@redhat.com>
* inferiors.c (get_first_process): New function.
* inferiors.h (get_first_process): New declaration.
* remote-utils.c (read_ptid): Default to the first process in the
list, instead of to the current thread's process.
Prepare for gnulib update After the last gnulib import (Dec 2012), gnulib upstream started replacing mingw's 'struct timeval' with a version with 64-bit time_t, for POSIX compliance: commit f8e84098084b3b53bc6943a5542af1f607ffd477 Author: Bruno Haible <bruno@clisp.org> Date: Sat Jan 28 18:12:10 2012 +0100 sys_time: Override 'struct timeval' on some native Windows platforms. See: https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00372.html However, that results in conflicts with native Winsock2's 'select': select()'s argument http://sourceforge.net/p/mingw-w64/mailman/message/29610438/ ... and libiberty's timeval-utils.h timeval_add/timeval_sub, at the least. We don't really need the POSIX compliance, so this patch prepares us to simply not use gnulib's 'struct timeval' replacement once a more recent gnulib is imported, thus preserving the current behavior, by adding a sys/time.h wrapper header that undefs gnulib's replacements, and including that everywhere instead. The SIZE -> OSIZE change is necessary because newer gnulib's sys/time.h also includes windows.h/winsock2.h, which defines a conflicting SIZE symbol. Cross build-tested mingw-w64 32-bit and 64-bit. Regtested on x86_64 Fedora 20. gdb/ChangeLog: 2015-08-24 Pedro Alves <palves@redhat.com> * Makefile.in (HFILES_NO_SRCDIR): Add common/gdb_sys_time.h. * common/gdb_sys_time.h: New file. * event-loop.c: Include gdb_sys_time.h instead of sys/time.h. * gdb_select.h: Likewise. * gdb_usleep.c: Likewise. * maint.c: Likewise. * mi/mi-main.c: Likewise. * mi/mi-parse.h: Likewise. * remote-fileio.c: Likewise. * remote-m32r-sdi.c: Likewise. * remote.c: Likewise. * ser-base.c: Likewise. * ser-pipe.c: Likewise. * ser-tcp.c: Likewise. * ser-unix.c: Likewise. * symfile.c: Likewise. * symfile.c: Likewise. Rename OSIZE to SIZE throughout. * target-memory.c: Include gdb_sys_time.h instead of sys/time.h. * utils.c: Likewise. gdb/gdbserver/ChangeLog: 2015-08-24 Pedro Alves <palves@redhat.com> * debug.c: Include gdb_sys_time.h instead of sys/time.h. * event-loop.c: Likewise. * remote-utils.c: Likewise. * tracepoint.c: Likewise.
2015-08-24 19:50:55 +02:00
2015-08-24 Pedro Alves <palves@redhat.com>
* debug.c: Include gdb_sys_time.h instead of sys/time.h.
* event-loop.c: Likewise.
* remote-utils.c: Likewise.
* tracepoint.c: Likewise.
2015-08-24 Pedro Alves <palves@redhat.com>
* spu-low.c (spu_request_interrupt): Use lwpid_of instead of
ptid_get_lwp.
2015-08-21 Pedro Alves <palves@redhat.com>
* ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
instead of literal 1.
2015-08-21 Pedro Alves <palves@redhat.com>
* tdesc.c (default_description): Explicitly zero-initialize.
Fix gdbserver crash exposed by gdb.threads/process-dies-while-handling-bp.exp Running that test in a loop, I found a gdbserver core dump with the following back trace: Core was generated by `../gdbserver/gdbserver --once --multi :2346'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000000000406ab6 in inferior_regcache_data (inferior=0x0) at src/gdb/gdbserver/inferiors.c:236 236 return inferior->regcache_data; (gdb) up #1 0x0000000000406d7f in get_thread_regcache (thread=0x0, fetch=1) at src/gdb/gdbserver/regcache.c:31 31 regcache = (struct regcache *) inferior_regcache_data (thread); (gdb) bt #0 0x0000000000406ab6 in inferior_regcache_data (inferior=0x0) at src/gdb/gdbserver/inferiors.c:236 #1 0x0000000000406d7f in get_thread_regcache (thread=0x0, fetch=1) at src/gdb/gdbserver/regcache.c:31 #2 0x0000000000409271 in prepare_resume_reply (buf=0x20dd593 "", ptid=..., status=0x20edce0) at src/gdb/gdbserver/remote-utils.c:1147 #3 0x000000000040ab0a in vstop_notif_reply (event=0x20edcc0, own_buf=0x20dd590 "T05") at src/gdb/gdbserver/server.c:183 #4 0x0000000000426b38 in notif_write_event (notif=0x66e6c0 <notif_stop>, own_buf=0x20dd590 "T05") at src/gdb/gdbserver/notif.c:69 #5 0x0000000000426c55 in handle_notif_ack (own_buf=0x20dd590 "T05", packet_len=8) at src/gdb/gdbserver/notif.c:113 #6 0x000000000041118f in handle_v_requests (own_buf=0x20dd590 "T05", packet_len=8, new_packet_len=0x7fff742c77b8) at src/gdb/gdbserver/server.c:2862 #7 0x0000000000413850 in process_serial_event () at src/gdb/gdbserver/server.c:4148 #8 0x0000000000413945 in handle_serial_event (err=0, client_data=0x0) at src/gdb/gdbserver/server.c:4196 #9 0x000000000041a1ef in handle_file_event (event_file_desc=5) at src/gdb/gdbserver/event-loop.c:429 #10 0x00000000004199b6 in process_event () at src/gdb/gdbserver/event-loop.c:184 #11 0x000000000041a735 in start_event_loop () at src/gdb/gdbserver/event-loop.c:547 #12 0x00000000004123d2 in captured_main (argc=4, argv=0x7fff742c7ac8) at src/gdb/gdbserver/server.c:3562 #13 0x000000000041252e in main (argc=4, argv=0x7fff742c7ac8) at src/gdb/gdbserver/server.c:3631 Clearly this means that a thread pushed a stop reply in the event queue, and then before GDB confused the event, the whole process died, along with its thread. But the pending thread event was left dangling. When GDB fetched that event, gdbserver looked up the corresponding thread, but found NULL; not expecting this, gdbserver crashes when it tries to read this thread's registers. gdb/gdbserver/ 2015-08-21 Pedro Alves <palves@redhat.com> PR gdb/18749 * inferiors.c (remove_thread): Discard any pending stop reply for this thread. * server.c (remove_all_on_match_pid): Rename to ... (remove_all_on_match_ptid): ... this. Work with a filter ptid instead of a pid. (discard_queued_stop_replies): Change parameter to a ptid. Now extern. (handle_v_kill, kill_inferior_callback) (process_serial_event): Adjust. (captured_main): Call initialize_notif before starting the program, thus before threads are created. * server.h (discard_queued_stop_replies): Declare.
2015-08-21 20:52:36 +02:00
2015-08-21 Pedro Alves <palves@redhat.com>
PR gdb/18749
* inferiors.c (remove_thread): Discard any pending stop reply for
this thread.
* server.c (remove_all_on_match_pid): Rename to ...
(remove_all_on_match_ptid): ... this. Work with a filter ptid
instead of a pid.
(discard_queued_stop_replies): Change parameter to a ptid. Now
extern.
(handle_v_kill, kill_inferior_callback, captured_main)
(process_serial_event): Adjust.
* server.h (discard_queued_stop_replies): Declare.
gdbserver: don't pick a random thread if the current thread dies In all-stop mode, if the current thread disappears while stopping all threads, gdbserver calls set_desired_thread(0) ['0' means "I want the continue thread"] which just picks the first thread in the list. This looks like a dangerous thing to do. GDBserver continues processing whatever it was doing, but to the wrong thread. If debugging more than one process, we may even pick the wrong process. Instead, GDBserver should detect the situation and bail out of whatever is was doing. The backends used to pay attention to the set 'cont_thread' (the Hc thread, used in the old way to resume threads, before vCont), but all such 'cont_thread' checks have been eliminated meanwhile. The remaining implicit dependencies that I found on there being a selected thread in the backends are in the Ctrl-C handling, which some backends use as thread to send a signal to. Even that seems to me to be better handled by always using the first thread in the list or by using the signal_pid PID. In order to make this a systematic approach, I'm making set_desired_thread never fallback to a random thread, and instead end up with current_thread == NULL, like already done in non-stop mode. Then I updated all callers to handle the situation. I stumbled on this while fixing other bugs exposed by gdb.threads/fork-plus-threads.exp test. The problems I saw were fixed in a different way, but in any case, I think the potential for problems is more or less obvious, and the resulting code looks a bit less magical to me. Tested on x86-64 Fedora 20, w/ native-extended-gdbserver board. gdb/gdbserver/ChangeLog: 2015-08-21 Pedro Alves <palves@redhat.com> * linux-low.c (wait_for_sigstop): Always switch to no thread selected if the previously current thread dies. * lynx-low.c (lynx_request_interrupt): Use the first thread's process instead of the current thread's. * remote-utils.c (input_interrupt): Don't check if there's no current thread. * server.c (gdb_read_memory, gdb_write_memory): If setting the current thread to the general thread fails, error out. (handle_qxfer_auxv, handle_qxfer_libraries) (handle_qxfer_libraries_svr4, handle_qxfer_siginfo) (handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic) (handle_query): Check if there's a thread selected instead of checking whether there's any thread in the thread list. (handle_qxfer_threads, handle_qxfer_btrace) (handle_qxfer_btrace_conf): Don't error out early if there's no thread in the thread list. (handle_v_cont, myresume): Don't set the current thread to the continue thread. (process_serial_event) <Hg handling>: Also set thread_id if the previous general thread is still alive. (process_serial_event) <g/G handling>: If setting the current thread to the general thread fails, error out. * spu-low.c (spu_resume, spu_request_interrupt): Use the first thread's lwp instead of the current thread's. * target.c (set_desired_thread): If the desired thread was not found, leave the current thread pointing to NULL. Return an int (boolean) indicating success. * target.h (set_desired_thread): Change return type to int.
2015-08-21 20:20:31 +02:00
2015-08-21 Pedro Alves <palves@redhat.com>
* linux-low.c (wait_for_sigstop): Always switch to no thread
selected if the previously current thread dies.
* lynx-low.c (lynx_request_interrupt): Use the first thread's
process instead of the current thread's.
* remote-utils.c (input_interrupt): Don't check if there's no
current thread.
* server.c (gdb_read_memory, gdb_write_memory): If setting the
current thread to the general thread fails, error out.
(handle_qxfer_auxv, handle_qxfer_libraries)
(handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
(handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
(handle_query): Check if there's a thread selected instead of
checking whether there's any thread in the thread list.
(handle_qxfer_threads, handle_qxfer_btrace)
(handle_qxfer_btrace_conf): Don't error out early if there's no
thread in the thread list.
(handle_v_cont, myresume): Don't set the current thread to the
continue thread.
(process_serial_event) <Hg handling>: Also set thread_id if the
previous general thread is still alive.
(process_serial_event) <g/G handling>: If setting the current
thread to the general thread fails, error out.
* spu-low.c (spu_resume, spu_request_interrupt): Use the first
thread's lwp instead of the current thread's.
* target.c (set_desired_thread): If the desired thread was not
found, leave the current thread pointing to NULL. Return an int
(boolean) indicating success.
* target.h (set_desired_thread): Change return type to int.
2015-08-20 Max Filippov <jcmvbkbc@gmail.com>
* configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
* linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
#includes.
(ps_get_thread_area): New function.
2015-08-19 Gary Benson <gbenson@redhat.com>
* hostio.c (handle_pread): Do not attempt to read more data
than hostio_reply_with_data can fit in a packet.
2015-08-18 Joel Brobecker <brobecker@adacore.com>
* linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
2015-08-14 Matthew Fortune <matthew.fortune@imgtec.com>
* linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL.
2015-08-06 Pedro Alves <palves@redhat.com>
* tracepoint.c (expr_eval_result): Now an int.
2015-08-06 Pedro Alves <palves@redhat.com>
* gdbthread.h (struct regcache): Forward declare.
(struct thread_info) <regcache_data>: Now a struct regcache
pointer.
* inferiors.c (inferior_regcache_data)
(set_inferior_regcache_data): Now work with struct regcache
pointers.
* inferiors.h (struct regcache): Forward declare.
(inferior_regcache_data, set_inferior_regcache_data): Now work
with struct regcache pointers.
* regcache.c (get_thread_regcache, regcache_invalidate_thread)
(free_register_cache_thread): Remove struct regcache pointer
casts.
2015-08-06 Pedro Alves <palves@redhat.com>
* server.c (captured_main): On error, print the exception message
to stderr, and if run_once is set, throw a quit.
2015-08-06 Pedro Alves <palves@redhat.com>
* linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
the current thread.
Fix gdbserver --debug issues caught by Valgrind Running gdbserver --debug under Valgrind shows: ==4803== Invalid read of size 4 ==4803== at 0x432B62: linux_write_memory (linux-low.c:5320) ==4803== by 0x4143F7: write_inferior_memory (target.c:83) ==4803== by 0x415895: remove_memory_breakpoint (mem-break.c:362) ==4803== by 0x432EF5: linux_remove_point (linux-low.c:5460) ==4803== by 0x416319: delete_raw_breakpoint (mem-break.c:802) ==4803== by 0x4163F3: release_breakpoint (mem-break.c:842) ==4803== by 0x416477: delete_breakpoint_1 (mem-break.c:869) ==4803== by 0x4164EF: delete_breakpoint (mem-break.c:891) ==4803== by 0x416843: delete_gdb_breakpoint_1 (mem-break.c:1069) ==4803== by 0x4168D8: delete_gdb_breakpoint (mem-break.c:1098) ==4803== by 0x4134E3: process_serial_event (server.c:4051) ==4803== by 0x4138E4: handle_serial_event (server.c:4196) ==4803== Address 0x4c6b930 is 0 bytes inside a block of size 1 alloc'd ==4803== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==4803== by 0x4240C6: xmalloc (common-utils.c:43) ==4803== by 0x41439C: write_inferior_memory (target.c:80) ==4803== by 0x415895: remove_memory_breakpoint (mem-break.c:362) ==4803== by 0x432EF5: linux_remove_point (linux-low.c:5460) ==4803== by 0x416319: delete_raw_breakpoint (mem-break.c:802) ==4803== by 0x4163F3: release_breakpoint (mem-break.c:842) ==4803== by 0x416477: delete_breakpoint_1 (mem-break.c:869) ==4803== by 0x4164EF: delete_breakpoint (mem-break.c:891) ==4803== by 0x416843: delete_gdb_breakpoint_1 (mem-break.c:1069) ==4803== by 0x4168D8: delete_gdb_breakpoint (mem-break.c:1098) ==4803== by 0x4134E3: process_serial_event (server.c:4051) ==4803== And: ==7272== Conditional jump or move depends on uninitialised value(s) ==7272== at 0x3615E48361: vfprintf (vfprintf.c:1634) ==7272== by 0x414E89: debug_vprintf (debug.c:60) ==7272== by 0x42800A: debug_printf (common-debug.c:35) ==7272== by 0x43937B: my_waitpid (linux-waitpid.c:149) ==7272== by 0x42D740: linux_wait_for_event_filtered (linux-low.c:2441) ==7272== by 0x42DADA: linux_wait_for_event (linux-low.c:2552) ==7272== by 0x42E165: linux_wait_1 (linux-low.c:2860) ==7272== by 0x42F5D8: linux_wait (linux-low.c:3453) ==7272== by 0x4144A4: mywait (target.c:107) ==7272== by 0x413969: handle_target_event (server.c:4214) ==7272== by 0x41A1A6: handle_file_event (event-loop.c:429) ==7272== by 0x41996D: process_event (event-loop.c:184) gdb/ChangeLog: 2015-08-06 Pedro Alves <palves@redhat.com> * nat/linux-waitpid.c (my_waitpid): Only print *status if waitpid returned > 0. gdb/gdbserver/ChangeLog: 2015-08-06 Pedro Alves <palves@redhat.com> * linux-low.c (linux_write_memory): Rewrite debug output to avoid reading beyond the passed in buffer length.
2015-07-30 17:15:24 +02:00
2015-08-06 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_write_memory): Rewrite debug output to avoid
reading beyond the passed in buffer length.
2015-08-06 Pierre Langlois <pierre.langlois@arm.com>
* tracepoint.c (symbol_list) <required>: Remove.
gdbserver: Fix non-stop / fork / step-over issues Ref: https://sourceware.org/ml/gdb-patches/2015-07/msg00868.html This adds a test that has a multithreaded program have several threads continuously fork, while another thread continuously steps over a breakpoint. This exposes several intertwined issues, which this patch addresses: - When we're stopping and suspending threads, some thread may fork, and we missed setting its suspend count to 1, like we do when a new clone/thread is detected. When we next unsuspend threads, the fork child's suspend count goes below 0, which is bogus and fails an assertion. - If a step-over is cancelled because a signal arrives, but then gdb is not interested in the signal, we pass the signal straight back to the inferior. However, we miss that we need to re-increment the suspend counts of all other threads that had been paused for the step-over. As a result, other threads indefinitely end up stuck stopped. - If a detach request comes in just while gdbserver is handling a step-over (in the test at hand, this is GDB detaching the fork child), gdbserver internal errors in stabilize_thread's helpers, which assert that all thread's suspend counts are 0 (otherwise we wouldn't be able to move threads out of the jump pads). The suspend counts aren't 0 while a step-over is in progress, because all threads but the one stepping past the breakpoint must remain paused until the step-over finishes and the breakpoint can be reinserted. - Occasionally, we see "BAD - reinserting but not stepping." being output (from within linux_resume_one_lwp_throw). That was because GDB pokes memory while gdbserver is busy with a step-over, and that suspends threads, and then re-resumes them with proceed_one_lwp, which missed another reason to tell linux_resume_one_lwp that the thread should be set back to stepping. - In a couple places, we were resuming threads that are meant to be suspended. E.g., when a vCont;c/s request for thread B comes in just while gdbserver is stepping thread A past a breakpoint. The resume for thread B must be deferred until the step-over finishes. - The test runs with both "set detach-on-fork" on and off. When off, it exercises the case of GDB detaching the fork child explicitly. When on, it exercises the case of gdb resuming the child explicitly. In the "off" case, gdb seems to exponentially become slower as new inferiors are created. This is _very_ noticeable as with only 100 inferiors gdb is crawling already, which makes the test take quite a bit to run. For that reason, I've disabled the "off" variant for now. gdb/ChangeLog: 2015-08-06 Pedro Alves <palves@redhat.com> * target/waitstatus.h (enum target_stop_reason) <TARGET_STOPPED_BY_SINGLE_STEP>: New value. gdb/gdbserver/ChangeLog: 2015-08-06 Pedro Alves <palves@redhat.com> * linux-low.c (handle_extended_wait): Set the fork child's suspend count if stopping and suspending threads. (check_stopped_by_breakpoint): If stopped by trace, set the LWP's stop reason to TARGET_STOPPED_BY_SINGLE_STEP. (linux_detach): Complete an ongoing step-over. (lwp_suspended_inc, lwp_suspended_decr): New functions. Use throughout. (resume_stopped_resumed_lwps): Don't resume a suspended thread. (linux_wait_1): If passing a signal to the inferior after finishing a step-over, unsuspend and re-resume all lwps. If we see a single-step event but the thread should be continuing, don't pass the trap to gdb. (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use internal_error instead of gdb_assert. (enqueue_pending_signal): New function. (check_ptrace_stopped_lwp_gone): Add debug output. (start_step_over): Use internal_error instead of gdb_assert. (complete_ongoing_step_over): New function. (linux_resume_one_thread): Don't resume a suspended thread. (proceed_one_lwp): If the LWP is stepping over a breakpoint, reset it stepping. gdb/testsuite/ChangeLog: 2015-08-06 Pedro Alves <palves@redhat.com> * gdb.threads/forking-threads-plus-breakpoint.exp: New file. * gdb.threads/forking-threads-plus-breakpoint.c: New file.
2015-08-06 11:30:18 +02:00
2015-08-06 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Set the fork child's suspend
count if stopping and suspending threads.
(check_stopped_by_breakpoint): If stopped by trace, set the LWP's
stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
(linux_detach): Complete an ongoing step-over.
(lwp_suspended_inc, lwp_suspended_decr): New functions. Use
throughout.
(resume_stopped_resumed_lwps): Don't resume a suspended thread.
(linux_wait_1): If passing a signal to the inferior after
finishing a step-over, unsuspend and re-resume all lwps. If we
see a single-step event but the thread should be continuing, don't
pass the trap to gdb.
(stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
internal_error instead of gdb_assert.
(enqueue_pending_signal): New function.
(check_ptrace_stopped_lwp_gone): Add debug output.
(start_step_over): Use internal_error instead of gdb_assert.
(complete_ongoing_step_over): New function.
(linux_resume_one_thread): Don't resume a suspended thread.
(proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
it stepping.
Linux gdbserver confused when event randomization picks process exit event The tail end of linux_wait_1 isn't expecting that the select_event_lwp machinery can pick a whole-process exit event to report to GDB. When that happens, both gdb and gdbserver end up quite confused: ... (gdb) [Thread 24971.24971] #1 stopped. 0x0000003615a011f0 in ?? () c& Continuing. (gdb) [New Thread 24971.24981] [New Thread 24983.24983] [New Thread 24971.24982] [Thread 24983.24983] #3 stopped. 0x0000003615ebc7cc in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:130 130 pid = ARCH_FORK (); [New Thread 24984.24984] Error in re-setting breakpoint -16: PC register is not available Error in re-setting breakpoint -17: PC register is not available Error in re-setting breakpoint -18: PC register is not available Error in re-setting breakpoint -19: PC register is not available Error in re-setting breakpoint -24: PC register is not available Error in re-setting breakpoint -25: PC register is not available Error in re-setting breakpoint -26: PC register is not available Error in re-setting breakpoint -27: PC register is not available Error in re-setting breakpoint -28: PC register is not available Error in re-setting breakpoint -29: PC register is not available Error in re-setting breakpoint -30: PC register is not available PC register is not available (gdb) gdb/gdbserver/ChangeLog: 2015-08-06 Pedro Alves <palves@redhat.com> * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE. (linux_thread_alive): Use lwp_is_marked_dead. (extended_event_reported): Delete. (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE instead of extended_event_reported. (mark_lwp_dead): Don't set the 'dead' flag. Store the waitstatus as well. (lwp_is_marked_dead): New function. (lwp_running): Use lwp_is_marked_dead. * linux-low.h: Delete 'dead' field, and update 'waitstatus's comment.
2015-08-06 11:30:17 +02:00
2015-08-06 Pedro Alves <palves@redhat.com>
* linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
(linux_thread_alive): Use lwp_is_marked_dead.
(extended_event_reported): Delete.
(linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
instead of extended_event_reported.
(mark_lwp_dead): Don't set the 'dead' flag. Store the waitstatus
as well.
(lwp_is_marked_dead): New function.
(lwp_running): Use lwp_is_marked_dead.
* linux-low.h: Delete 'dead' field, and update 'waitstatus's
comment.
2015-08-06 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_wait_1): Move fork event output out of the
!report_to_gdb check. Pass event_child->waitstatus to
target_waitstatus_to_string instead of ourstatus.
2015-08-04 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
if current_thread is 32 bit.
Disable Z0 packet on aarch64 on multi-arch debugging In multi-arch debugging, if GDB sends Z0 packet, GDBserver should be able to do several things below: - choose the right breakpoint instruction to insert according to the information available, such as 'kind' in Z0 packet and address, - choose the right breakpoint instruction to check memory writes and validate inserted memory breakpoint - be aware of different breakpoint instructions in $ARCH_breakpoint_at. unfortunately GDBserver can't do them now. Although x86 GDBserver supports multi-arch, it doesn't need to support them above because breakpoint instruction on i686 and x86_64 is the same. However, breakpoint instructions on aarch64 and arm (arm mode, thumb1, and thumb2) are different. I tried to teach aarch64 GDBserver backend to be really multi-arch-capable in the following ways, - linux_low_target return the right breakpoint instruction according to the 'kind' in Z0 packet, and insert_memory_breakpoint can do the right thing. - once breakpoint is inserted, the breakpoint data and length is recorded in each breakpoint object, so that validate_breakpoint and check_mem_write can get the right breakpoint instruction from each breakpoint object, rather than from global variable breakpoint_data. - linux_low_target needs another hook function for pc increment after hitting a breakpoint. - let set_breakpoint_at, which is widely used for tracepoint, use the 'default' breakpoint instruction. We can always use aarch64 breakpoint instruction since arm doesn't support tracepoint yet. looks it is not a small piece of work, so I decide to disable Z0 packet on multi-arch, which means aarch64 GDBserver only supports Z0 packet if it is started to debug only one process (extended protocol is not used) and process target description is 64-bit. gdb/gdbserver: 2015-08-04 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_supports_z_point_type): Return 0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging. * server.c (extended_protocol): Remove "static". * server.h (extended_protocol): Declare it.
2015-08-04 15:34:14 +02:00
2015-08-04 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_supports_z_point_type): Return
0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
* server.c (extended_protocol): Remove "static".
* server.h (extended_protocol): Declare it.
2015-08-04 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_get_pc): Get PC register on
both aarch64 and aarch32.
(aarch64_set_pc): Likewise.
2015-08-04 Yao Qi <yao.qi@linaro.org>
* configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
to srv_regobj and append arm-core.xml arm-vfpv3.xml and
arm-with-neon.xml to srv_xmlfiles.
* linux-aarch64-low.c: Include linux-aarch32-low.h.
(is_64bit_tdesc): New function.
(aarch64_linux_read_description): New function.
(aarch64_arch_setup): Call aarch64_linux_read_description.
(regs_info): Rename to regs_info_aarch64.
(aarch64_regs_info): Return right regs_info.
(initialize_low_arch): Call initialize_low_arch_aarch32.
2015-08-04 Yao Qi <yao.qi@linaro.org>
* configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
* linux-aarch32-low.c: New file.
* linux-aarch32-low.h: New file.
* linux-arm-low.c (arm_fill_gregset): Move it to
linux-aarch32-low.c.
(arm_store_gregset): Likewise.
(arm_fill_vfpregset): Call arm_fill_vfpregset_num
(arm_store_vfpregset): Call arm_store_vfpregset_num.
(arm_arch_setup): Check if PTRACE_GETREGSET works.
(regs_info): Rename to regs_info_arm.
(arm_regs_info): Return regs_info_aarch32 if
have_ptrace_getregset is 1 and target description is
arm_with_neon or arm_with_vfpv3.
(initialize_low_arch): Don't call init_registers_arm_with_neon.
Call initialize_low_arch_aarch32 instead.
2015-08-04 Yao Qi <yao.qi@linaro.org>
* linux-x86-low.c (have_ptrace_getregset): Move it to ...
* linux-low.c: ... here.
* linux-low.h (have_ptrace_getregset): Declare it.
2015-08-04 Pedro Alves <palves@redhat.com>
* thread-db.c (struct thread_db): Use new typedefs.
(try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
CHK calls.
(disable_thread_event_reporting): Cast result of dlsym to
destination function pointer type.
(thread_db_mourn): Use td_ta_delete_ftype.
Nios II R2 support for GDB. 2015-08-03 Sandra Loosemore <sandra@codesourcery.com> gdb/ * nios2-tdep.h: Include opcode/nios2.h here. (NIOS2_CDX_OPCODE_SIZE): New. (struct gdbarch_tdep): Add OP parameter to syscall_next_pc. * nios2-tdep.c: Don't include opcode/nios2.h here. (nios2_fetch_insn): For R2, try reading 2-byte instruction if 4-byte read fails. (nios2_match_add, nios2_match_sub): Add cases for R2 encodings. (nios2_match_addi, nios2_match_orhi): Likewise. (nios2_match_stw, nios2_match_ldw): Likewise. (nios2_match_rdctl): Likewise. (nios2_match_stwm, nios2_match_ldwm): New. (nios2_match_branch): Add cases for R2 encodings. (nios2_match_jmpi, nios2_match_calli): Likewise. (nios2_match_jmpr, nios2_match_callr): Likewise. (nios2_match_break, nios2_match_trap): Likewise. (nios2_in_epilogue_p): Add R2 support. (nios2_analyze_prologue): Update comments. Recognize R2 CDX prologues. (nios2_breakpoint_from_pc): Handle R2 instructions. (nios2_get_next_pc): Likewise. Adjust call to tdep->syscall_next_pc. * nios2-linux-tdep.c (nios2_r1_linux_rt_sigreturn_tramp_frame): Renamed from nios2_linux_rt_sigreturn_tramp_frame. Use instruction field macros instead of literal hex values. (nios2_r2_linux_rt_sigreturn_tramp_frame): New. (nios2_linux_syscall_next_pc): Adjust signature to pass OP. Use size field from OP instead of assuming all instructions are the same size. (nios2_linux_init_abi): Register appropriate unwinder for mach. gdb/gdbserver/ * linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for arch variant. (CDX_BREAKPOINT): Define for R2. (nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2. (the_low_target): Add comments.
2015-08-03 20:39:52 +02:00
2015-08-03 Sandra Loosemore <sandra@codesourcery.com>
* linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
arch variant.
(CDX_BREAKPOINT): Define for R2.
(nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
(the_low_target): Add comments.
2015-07-30 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (arm_hwcap): Remove it.
(arm_read_description): New local variable arm_hwcap. Don't
set arm_hwcap to zero.
2015-07-30 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
Use regcache->tdesc instead.
(arm_store_wmmxregset): Likewise.
(arm_fill_vfpregset): Likewise.
(arm_store_vfpregset): Likewise.
2015-07-30 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c: Include arch/arm.h.
(arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
(arm_store_gregset): Likewise.
2015-07-29 Simon Marchi <simon.marchi@ericsson.com>
* linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
ptrace's 4th parameter.
2015-07-27 Yao Qi <yao.qi@linaro.org>
* configure.srv (case aarch64*-*-linux*): Don't set
srv_linux_usrregs.
2015-07-24 Pedro Alves <palves@redhat.c: Likewise.om>
* linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of
sys/ptrace.h.
* linux-arm-low.c: Likewise.
* linux-cris-low.c: Likewise.
* linux-crisv32-low.c: Likewise.
* linux-low.c: Likewise.
* linux-m68k-low.c: Likewise.
* linux-mips-low.c: Likewise.
* linux-nios2-low.c: Likewise.
* linux-s390-low.c: Likewise.
* linux-sparc-low.c: Likewise.
* linux-tic6x-low.c: Likewise.
* linux-tile-low.c: Likewise.
* linux-x86-low.c: Likewise.
C++: handle glibc's ptrace(enum __ptrace_request, ...) Building in C++ mode issues ~40 warnings like this: ../../src/gdb/linux-nat.c: In function ‘int linux_handle_extended_wait(lwp_info*, int, int)’: ../../src/gdb/linux-nat.c:2016:51: warning: invalid conversion from ‘int’ to ‘__ptrace_request’ [-fpermissive] ptrace (PTRACE_GETEVENTMSG, pid, 0, &new_pid); The issue is that in glibc, ptrace's first parameter is an enum. That's not a problem if we pick the PTRACE_XXX requests from sys/ptrace.h, as those will be values of the corresponding enum. However, we have fallback definitions for PTRACE_XXX symbols when the system headers miss them (such as PTRACE_GETEVENTMSG above), and those are plain integer constants. E.g., nat/linux-ptrace.h: #define PTRACE_GETEVENTMSG 0x4201 One idea would be to fix this by defining those fallbacks like: -#define PTRACE_GETEVENTMSG 0x4201 +#define PTRACE_GETEVENTMSG ((enum __ptrace_request) 0x4201) However, while glibc's ptrace uses enum __ptrace_request for first parameter: extern long int ptrace (enum __ptrace_request __request, ...) __THROW; other libc's, like e.g., Android's bionic do not -- in that case, the first parameter is int: long ptrace(int request, pid_t pid, void * addr, void * data); So the fix I came up is to make configure/ptrace.m4 also detect the type of the ptrace's first parameter and defin PTRACE_TYPE_ARG1, as already does the for parameters 3-4, and then simply wrap ptrace with a macro that casts the first argument to the detected type. (I'm leaving adding a nicer wrapper for when we drop building in C). While this adds the wrapper, GNU/Linux files won't use it until the next patch, which makes all native GNU/Linux files include gdb_ptrace.h. gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * ptrace.m4 (ptrace tests): Test in C++ mode. Try with 'enum __ptrace_request as first parameter type instead of int. (PTRACE_TYPE_ARG1): Define. * nat/gdb_ptrace.h [!PTRACE_TYPE_ARG5] (ptrace): Define as wrapper that casts first argument to PTRACE_TYPE_ARG1. * config.in: Regenerate. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * config.in: Regenerate. * configure: Regenerate.
2015-07-24 15:57:20 +02:00
2015-07-24 Pedro Alves <palves@redhat.com>
* config.in: Regenerate.
* configure: Regenerate.
2015-07-24 Pedro Alves <palves@redhat.com>
* acinclude.m4: Include ../ptrace.m4.
* configure.ac: Call GDB_AC_PTRACE.
* config.in, configure: Regenerate.
2015-07-24 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_create_inferior): Remove setting to
proc->priv->new_inferior.
(linux_attach): Likewise.
(linux_low_filter_event): Likewise.
* linux-low.h (struct process_info_private) <new_inferior>: Remove.
Initialise target descrption after skipping extra traps for --wrapper Nowadays, when --wrapper is used, GDBserver skips extra traps/stops in the wrapper program, and stops at the first instruction of the program to be debugged. However, GDBserver created target description in the first stop of inferior, and the executable of the inferior is the wrapper program rather than the program to be debugged. In this way, the target description can be wrong if the architectures of wrapper program and program to be debugged are different. This is shown by some fails in gdb.server/wrapper.exp on buildbot. We are testing i686-linux GDB (Fedora-i686) on an x86_64-linux box (fedora-x86-64-4) in buildbot, such configuration causes fails in gdb.server/wrapper.exp like this: spawn /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/../../gdb/gdbserver/gdbserver --once --wrapper env TEST=1 -- :2346 /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/outputs/gdb.server/wrapper/wrapper Process /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/outputs/gdb.server/wrapper/wrapper created; pid = 8795 Can't debug 64-bit process with 32-bit GDBserver Exiting target remote localhost:2346 localhost:2346: Connection timed out. (gdb) FAIL: gdb.server/wrapper.exp: setting breakpoint at marker See https://sourceware.org/ml/gdb-testers/2015-q3/msg01541.html In this case, program to be debugged ("wrapper") is 32-bit but wrapper program ("/usr/bin/env") is 64-bit, so GDBserver gets the 64-bit target description instead of 32-bit. The root cause of this problem is that GDBserver creates target description too early, and the rationale of fix could be creating target description once the GDBserver skips extra traps and inferior stops at the first instruction of the program we want to debug. IOW, when GDBserver skips extra traps, the inferior's tdesc is NULL, and mywait and its callees shouldn't use inferior's tdesc, so in this patch, we skip code that requires register access, see changes in linux_resume_one_lwp_throw and need_step_over_p. In linux_low_filter_event, if target description isn't initialised and GDBserver attached the process, we create target description immediately, because GDBserver don't have to skip extra traps for attach, IOW, it makes no sense to use --attach and --wrapper together. Otherwise, the process is launched by GDBserver, we keep the status pending, and return. After GDBserver skipped extra traps in start_inferior, we call a target_ops hook arch_setup to initialise target description there. gdb/gdbserver: 2015-07-24 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_arch_setup): New function. (linux_low_filter_event): If proc->tdesc is NULL and proc->attached is true, call the_low_target.arch_setup. Otherwise, keep status pending, and return. (linux_resume_one_lwp_throw): Don't call get_pc if thread->while_stepping isn't NULL. Don't call get_thread_regcache if proc->tdesc is NULL. (need_step_over_p): Return 0 if proc->tdesc is NULL. (linux_target_ops): Install arch_setup. * server.c (start_inferior): Call the_target->arch_setup. * target.h (struct target_ops) <arch_setup>: New field. (target_arch_setup): New marco. * lynx-low.c (lynx_target_ops): Update. * nto-low.c (nto_target_ops): Update. * spu-low.c (spu_target_ops): Update. * win32-low.c (win32_target_ops): Update.
2015-07-24 15:40:34 +02:00
2015-07-24 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_arch_setup): New function.
(linux_low_filter_event): If proc->tdesc is NULL and
proc->attached is true, call the_low_target.arch_setup.
Otherwise, keep status pending, and return.
(linux_resume_one_lwp_throw): Don't call get_pc if
thread->while_stepping isn't NULL. Don't call
get_thread_regcache if proc->tdesc is NULL.
(need_step_over_p): Return 0 if proc->tdesc is NULL.
(linux_target_ops): Install arch_setup.
* server.c (start_inferior): Call the_target->arch_setup.
* target.h (struct target_ops) <arch_setup>: New field.
(target_arch_setup): New marco.
* lynx-low.c (lynx_target_ops): Update.
* nto-low.c (nto_target_ops): Update.
* spu-low.c (spu_target_ops): Update.
* win32-low.c (win32_target_ops): Update.
2015-07-24 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_add_process): Don't set
proc->priv->new_inferior.
(linux_create_inferior): Set proc->priv->new_inferior to 1.
(linux_attach): Likewise.
2015-07-24 Yao Qi <yao.qi@linaro.org>
* server.c (start_inferior): Code refactor.
Set general_thread after restart When I run gdb.server/ext-restart.exp, I get the following GDB internal error, run^M The program being debugged has been started already.^M Start it from the beginning? (y or n) y^M Sending packet: $vKill;53c5#3d...Packet received: OK^M Packet vKill (kill) is supported^M Sending packet: $vFile:close:6#b6...Packet received: F0^M Sending packet: $vFile:close:3#b3...Packet received: F0^M Starting program: /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.server/ext-restart ^M Sending packet: $QDisableRandomization:1#cf...Packet received: OK^M Sending packet: $R0#82...Sending packet: $qC#b4...Packet received: QCp53c5.53c5^M <-- [1] Sending packet: $qAttached:53c5#c9...Packet received: E01^M warning: Remote failure reply: E01^M .... 0x00002aaaaaaac2d0 in ?? () from target:/lib64/ld-linux-x86-64.so.2^M /home/yao/SourceCode/gnu/gdb/git/gdb/thread.c:88: internal-error: inferior_thread: Assertion `tp' failed.^M A problem internal to GDB has been detected,^M further debugging may prove unreliable.^M Quit this debugging session? (y or n) FAIL: gdb.server/ext-restart.exp: run to main (GDB internal error) Resyncing due to internal error. the test is to restart the program, to make sure GDBserver handles packet 'R' correctly. From the GDBserver output, we can see, Remote debugging from host 127.0.0.1^M Process /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.server/ext-restart created; pid = 21445^M GDBserver restarting^M Process /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.server/ext-restart created; pid = 21446^M Killing process(es): 21446 we first start process 21445(0x53c5), kill it and restart a new process 21446. However, in the gdb output above [1], we can see that the reply of qC is still the old process id rather than the new one. Looks general_thread isn't up to date after GDBserver receives R packet. This patch is to update general_thread after call start_inferior. gdb/gdbserver: 2015-07-24 Yao Qi <yao.qi@linaro.org> * server.c (process_serial_event): Set general_thread. gdb/testsuite: 2015-07-24 Yao Qi <yao.qi@linaro.org> * gdb.server/ext-restart.exp: New file.
2015-07-24 15:40:34 +02:00
2015-07-24 Yao Qi <yao.qi@linaro.org>
* server.c (process_serial_event): Set general_thread.
2015-07-21 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
aarch64_linux_get_debug_reg_capacity.
Move common aarch64 HW breakpoint/watchpoint code to nat/ When I look at test fails related to watchpoint on aarch64-linux, I find there are some code duplicates between GDB and GDBserver. This patch is to move some of them to a nat/aarch64-linux-hw-point.{h,c}. The only change I do is about the dr_changed_t typedef, which was ULONGEST in GDB and 'unsigned long long' in GDBserver. Each bit of dr_changed_t represents a status of each HW breakpoint or watchpoint register, and the max number of HW breakpoint or watchpoint registers is 16, so the width of 'unsigned long long' is sufficient. gdb: 2015-07-17 Yao Qi <yao.qi@linaro.org> * Makefile.in (HFILES_NO_SRCDIR): Add nat/aarch64-linux-hw-point.h. (aarch64-linux-hw-point.o): New rule. * nat/aarch64-linux-hw-point.h: New file. * nat/aarch64-linux-hw-point.c: New file. * aarch64-linux-nat.c: Include nat/aarch64-linux-hw-point.h. (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h. (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise. (AARCH64_HWP_ALIGNMENT): Likewise. (AARCH64_HWP_MAX_LEN_PER_REG): Likewise. (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise. (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise. (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise. (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise. (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise. (struct aarch64_debug_reg_state): Likewise. (struct arch_lwp_info): Likewise. (aarch64_linux_set_debug_regs): Likewise. (aarch64_notify_debug_reg_change): Remove static. (aarch64_align_watchpoint): Likewise. (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise. (aarch64_watchpoint_length): Likewise. (aarch64_point_encode_ctrl_reg): Likewise (aarch64_point_is_aligned): Likewise. (aarch64_dr_state_insert_one_point): Likewise. (aarch64_dr_state_remove_one_point): Likewise. (aarch64_handle_breakpoint): Likewise. (aarch64_handle_aligned_watchpoint): Likewise. (aarch64_handle_unaligned_watchpoint): Likewise. (aarch64_handle_watchpoint): Likewise. * config/aarch64/linux.mh (NAT_FILE): Add aarch64-linux-hw-point.o. gdb/gdbserver: 2015-07-17 Yao Qi <yao.qi@linaro.org> * Makefile.in (aarch64-linux-hw-point.o): New rule. * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o. * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h. (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h. (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise. (AARCH64_HWP_ALIGNMENT): Likewise. (AARCH64_HWP_MAX_LEN_PER_REG): Likewise. (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise. (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise. (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise. (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise. (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise. (struct aarch64_debug_reg_state): Likewise. (struct arch_lwp_info): Likewise. (aarch64_align_watchpoint): Likewise. (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise. (aarch64_watchpoint_length): Likewise. (aarch64_point_encode_ctrl_reg): Likewise (aarch64_point_is_aligned): Likewise. (aarch64_align_watchpoint): Likewise. (aarch64_linux_set_debug_regs): (aarch64_dr_state_insert_one_point): Likewise. (aarch64_dr_state_remove_one_point): Likewise. (aarch64_handle_breakpoint): Likewise. (aarch64_handle_aligned_watchpoint): Likewise. (aarch64_handle_unaligned_watchpoint): Likewise. (aarch64_handle_watchpoint): Likewise.
2015-07-17 15:32:40 +02:00
2015-07-17 Yao Qi <yao.qi@linaro.org>
* Makefile.in (aarch64-linux-hw-point.o): New rule.
* configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
* linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
(AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
(AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
(AARCH64_HWP_ALIGNMENT): Likewise.
(AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
(AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
(aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
(AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
(DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
(DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
(struct aarch64_debug_reg_state): Likewise.
(struct arch_lwp_info): Likewise.
(aarch64_align_watchpoint): Likewise.
(DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
(aarch64_watchpoint_length): Likewise.
(aarch64_point_encode_ctrl_reg): Likewise
(aarch64_point_is_aligned): Likewise.
(aarch64_align_watchpoint): Likewise.
(aarch64_linux_set_debug_regs):
(aarch64_dr_state_insert_one_point): Likewise.
(aarch64_dr_state_remove_one_point): Likewise.
(aarch64_handle_breakpoint): Likewise.
(aarch64_handle_aligned_watchpoint): Likewise.
(aarch64_handle_unaligned_watchpoint): Likewise.
(aarch64_handle_watchpoint): Likewise.
Pass aarch64_debug_reg_state to functions Some functions on handling HW watchpoint in GDB and GDBserver looks the same except the code getting debug register state from current inferior. In GDB, we get debug register state like this: state = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid)); while in GDBserver, we get debug register state like this: state = aarch64_get_debug_reg_state (); This patch is to move two lines above out of some functions, and pass aarch64_debug_reg_state to these functions, in this way, these functions are the same, and can be moved to a common place. gdb: 2015-07-17 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_handle_breakpoint): Add argument state and don't call aarch64_get_debug_reg_state. All callers update. (aarch64_linux_insert_hw_breakpoint): Call aarch64_get_debug_reg_state earlier. (aarch64_linux_remove_hw_breakpoint): Likewise. (aarch64_handle_aligned_watchpoint): Add argument state and don't call aarch64_get_debug_reg_state. All callers update. (aarch64_handle_unaligned_watchpoint): Likewise. (aarch64_handle_watchpoint): Add argument state. (aarch64_linux_insert_watchpoint): Call aarch64_get_debug_reg_state earlier. (aarch64_linux_remove_watchpoint): Likewise. gdb/gdbserver: 2015-07-17 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state and don't aarch64_get_debug_reg_state. All callers update. (aarch64_handle_aligned_watchpoint): Likewise. (aarch64_handle_unaligned_watchpoint): Likewise. (aarch64_handle_watchpoint): Likewise. (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier. (aarch64_remove_point): Likewise.
2015-07-17 15:32:40 +02:00
2015-07-17 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
and don't aarch64_get_debug_reg_state. All callers update.
(aarch64_handle_aligned_watchpoint): Likewise.
(aarch64_handle_unaligned_watchpoint): Likewise.
(aarch64_handle_watchpoint): Likewise.
(aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
(aarch64_remove_point): Likewise.
2015-07-17 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
debug_printf.
(aarch64_handle_unaligned_watchpoint): Likewise.
Revert the previous 7 commits of: Validate binary before use ddc98fbf2fd9e244a215a4d09e559180dc573a14 Create empty nat/linux-maps.[ch] and common/target-utils.[ch] 6e5b4429db0d66e2d0b27e1bcfe4709f3dae73ed Move gdb_regex* to common/ f7af1fcd759fa126612018a5916cf808df7bb8bc Prepare linux_find_memory_regions_full & co. for move 9904185cfde13d6c6849f1f042c8e3b74974cf08 Move linux_find_memory_regions_full & co. 700ca40f6fc1addd7238f4ab57f76c095ad3c99f gdbserver build-id attribute generator ca5268b6be265580b91ef75c1a1a9815f581ae42 Validate symbol file using build-id 0a94970d663a053c523f23ac0d71deb25a77f709 Tests for validate symbol file using build-id gdb/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 6 commits: Create empty nat/linux-maps.[ch] and common/target-utils.[ch]. Move gdb_regex* to common/ Prepare linux_find_memory_regions_full & co. for move Move linux_find_memory_regions_full & co. gdbserver build-id attribute generator Validate symbol file using build-id gdb/gdbserver/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 3 commits: Move gdb_regex* to common/ Move linux_find_memory_regions_full & co. gdbserver build-id attribute generator gdb/doc/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 2 commits: gdbserver build-id attribute generator Validate symbol file using build-id gdb/testsuite/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous commit: Tests for validate symbol file using build-id.
2015-07-15 20:27:32 +02:00
2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com>
Revert the previous 3 commits:
Move gdb_regex* to common/
Move linux_find_memory_regions_full & co.
gdbserver build-id attribute generator
2015-07-15 Aleksandar Ristovski <aristovski@qnx.com
Jan Kratochvil <jan.kratochvil@redhat.com>
gdbserver build-id attribute generator.
* linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
(ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
(ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
(find_phdr): New.
(get_dynamic): Use find_pdhr to traverse program headers.
(struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
(compare_mapping_entry_range, struct find_memory_region_callback_data)
(read_build_id, find_memory_region_callback, lrfind_mapping_entry)
(get_hex_build_id): New.
(linux_qxfer_libraries_svr4): Add optional build-id attribute
to reply XML document.
Move linux_find_memory_regions_full & co. This should be just a move with no changes. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> Move linux_find_memory_regions_full & co. * linux-tdep.c (nat/linux-maps.h): Include. (gdb_regex.h): Remove the include. (enum filterflags, struct smaps_vmflags, read_mapping, decode_vmflags) (mapping_is_anonymous_p, dump_mapping_p): Moved to nat/linux-maps.c. (linux_find_memory_region_ftype): Moved typedef to nat/linux-maps.h. (linux_find_memory_regions_full): Moved definition to nat/linux-maps.c. * nat/linux-maps.c: Include ctype.h, target/target-utils.h, gdb_regex.h and target/target.h. (struct smaps_vmflags, read_mapping, decode_vmflags) (mapping_is_anonymous_p, dump_mapping_p): Move from linux-tdep.c. (linux_find_memory_regions_full): Move from linux-tdep.c. * nat/linux-maps.h (read_mapping): New declaration. (linux_find_memory_region_ftype, enum filterflags): Moved from linux-tdep.c. (linux_find_memory_regions_full): New declaration. * target.c (target/target-utils.h): Include. (read_alloc_pread_ftype): Moved typedef to target/target-utils.h. (read_alloc, read_stralloc_func_ftype, read_stralloc): Moved definitions to target/target-utils.c. * target.h (target_fileio_read_stralloc): Move it to target/target.h. * target/target-utils.c (read_alloc, read_stralloc): Move definitions from target.c. * target/target-utils.h (read_alloc_pread_ftype): New typedef. (read_alloc): New declaration. (read_stralloc_func_ftype): New typedef. (read_stralloc): New declaration. * target/target.h (target_fileio_read_stralloc): Move it from target.h. gdb/gdbserver/ChangeLog 2015-07-15 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> * target.c: Include target/target-utils.h and fcntl.h. (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1) (target_fileio_read_stralloc): New functions.
2015-07-15 17:37:27 +02:00
2015-07-15 Aleksandar Ristovski <aristovski@qnx.com
Jan Kratochvil <jan.kratochvil@redhat.com>
* target.c: Include target/target-utils.h and fcntl.h.
(target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
(target_fileio_read_stralloc): New functions.
2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (OBS): Add gdb_regex.o.
(gdb_regex.o): New.
* config.in: Rebuilt.
* configure: Rebuilt.
2015-07-15 Aleksandar Ristovski <aristovski@qnx.com
Jan Kratochvil <jan.kratochvil@redhat.com>
Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
* Makefile.in (OBS): Add target-utils.o.
(linux-maps.o, target-utils.o): New.
* configure.srv (srv_linux_obj): Add linux-maps.o.
2015-07-15 Pierre Langlois <pierre.langlois@arm.com>
* linux-aarch64-low.c (aarch64_supports_range_stepping): New
function, return 1.
(the_low_target): Install it.
2015-07-14 Pedro Alves <palves@redhat.com>
* linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
Instead, ignore ECHILD, and throw an error for other errnos.
2015-07-10 Pedro Alves <palves@redhat.com>
* event-loop.c (struct callback_event) <data>: Change type to
gdb_client_data instance instead of gdb_client_data pointer.
(append_callback_event): Adjust.
2015-07-10 Pierre Langlois <pierre.langlois@arm.com>
* linux-aarch64-low.c: Add comments for each linux_target_ops
method. Remove comments already covered in target_ops and
linux_target_ops definitions.
(the_low_target): Add comments for each unimplemented method.
2015-07-09 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_regmap): Remove.
(aarch64_usrregs_info): Remove.
(regs_info): Set field usrregs to NULL.
btrace: support Intel(R) Processor Trace Adds a new command "record btrace pt" to configure the kernel to use Intel(R) Processor Trace instead of Branch Trace Strore. The "record btrace" command chooses the tracing format automatically. Intel(R) Processor Trace support requires Linux 4.1 and libipt. gdb/ * NEWS: Announce new commands "record btrace pt" and "record pt". Announce new options "set|show record btrace pt buffer-size". * btrace.c: Include "rsp-low.h". Include "inttypes.h". (btrace_add_pc): Add forward declaration. (pt_reclassify_insn, ftrace_add_pt, btrace_pt_readmem_callback) (pt_translate_cpu_vendor, btrace_finalize_ftrace_pt) (btrace_compute_ftrace_pt): New. (btrace_compute_ftrace): Support BTRACE_FORMAT_PT. (check_xml_btrace_version): Update version check. (parse_xml_raw, parse_xml_btrace_pt_config_cpu) (parse_xml_btrace_pt_raw, parse_xml_btrace_pt) (btrace_pt_config_cpu_attributes, btrace_pt_config_children) (btrace_pt_children): New. (btrace_children): Add support for "pt". (parse_xml_btrace_conf_pt, btrace_conf_pt_attributes): New. (btrace_conf_children): Add support for "pt". * btrace.h: Include "intel-pt.h". (btrace_pt_error): New. * common/btrace-common.c (btrace_format_string, btrace_data_fini) (btrace_data_empty): Support BTRACE_FORMAT_PT. * common/btrace-common.h (btrace_format): Add BTRACE_FORMAT_PT. (struct btrace_config_pt): New. (struct btrace_config)<pt>: New. (struct btrace_data_pt_config, struct btrace_data_pt): New. (struct btrace_data)<pt>: New. * features/btrace-conf.dtd (btrace-conf)<pt>: New. (pt): New. * features/btrace.dtd (btrace)<pt>: New. (pt, pt-config, cpu): New. * nat/linux-btrace.c (perf_event_read, perf_event_read_all) (perf_event_pt_event_type, kernel_supports_pt) (linux_supports_pt): New. (linux_supports_btrace): Support BTRACE_FORMAT_PT. (linux_enable_bts): Free tinfo on error. (linux_enable_pt): New. (linux_enable_btrace): Support BTRACE_FORMAT_PT. (linux_disable_pt): New. (linux_disable_btrace): Support BTRACE_FORMAT_PT. (linux_fill_btrace_pt_config, linux_read_pt): New. (linux_read_btrace): Support BTRACE_FORMAT_PT. * nat/linux-btrace.h (struct btrace_tinfo_pt): New. (struct btrace_target_info)<pt>: New. * record-btrace.c (set_record_btrace_pt_cmdlist) (show_record_btrace_pt_cmdlist): New. (record_btrace_print_pt_conf): New. (record_btrace_print_conf): Support BTRACE_FORMAT_PT. (btrace_ui_out_decode_error): Support BTRACE_FORMAT_PT. (cmd_record_btrace_pt_start): New. (cmd_record_btrace_start): Support BTRACE_FORMAT_PT. (cmd_set_record_btrace_pt, cmd_show_record_btrace_pt): New. (_initialize_record_btrace): Add new commands. * remote.c (PACKET_Qbtrace_pt, PACKET_Qbtrace_conf_pt_size): New. (remote_protocol_features): Add "Qbtrace:pt". Add "Qbtrace-conf:pt:size". (remote_supports_btrace): Support BTRACE_FORMAT_PT. (btrace_sync_conf): Support PACKET_Qbtrace_conf_pt_size. (remote_enable_btrace): Support BTRACE_FORMAT_PT. (_initialize_remote): Add new commands. gdbserver/ * linux-low.c: Include "rsp-low.h" (linux_low_encode_pt_config, linux_low_encode_raw): New. (linux_low_read_btrace): Support BTRACE_FORMAT_PT. (linux_low_btrace_conf): Support BTRACE_FORMAT_PT. (handle_btrace_enable_pt): New. (handle_btrace_general_set): Support "pt". (handle_btrace_conf_general_set): Support "pt:size". doc/ * gdb.texinfo (Process Record and Replay): Spell out that variables and registers are not available during btrace replay. Describe the new "record btrace pt" command. Describe the new "set|show record btrace pt buffer-size" options. (General Query Packets): Describe the new Qbtrace:pt and Qbtrace-conf:pt:size packets. Expand "bts" to "Branch Trace Store". Update the branch trace DTD.
2014-01-24 13:45:47 +01:00
2015-07-02 Markus Metzger <markus.t.metzger@intel.com>
* linux-low.c: Include "rsp-low.h"
(linux_low_encode_pt_config, linux_low_encode_raw): New.
(linux_low_read_btrace): Support BTRACE_FORMAT_PT.
(linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
(handle_btrace_enable_pt): New.
(handle_btrace_general_set): Support "pt".
(handle_btrace_conf_general_set): Support "pt:size".
2015-06-29 Pierre Langlois <pierre.langlois@arm.com>
* linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
Z_PACKET_SW_BP.
2015-06-29 Pierre Langlois <pierre.langlois@arm.com>
* linux-aarch64-low.c: Remove comment about endianness.
(aarch64_breakpoint): Change type to gdb_byte[]. Set to "brk #0".
(aarch64_breakpoint_at): Change type of insn to gdb_byte[]. Use
memcmp.
2015-06-24 Gary Benson <gbenson@redhat.com>
* linux-i386-ipa.c (stdint.h): Do not include.
* lynx-i386-low.c (stdint.h): Likewise.
* lynx-ppc-low.c (stdint.h): Likewise.
* mem-break.c (stdint.h): Likewise.
* thread-db.c (stdint.h): Likewise.
* tracepoint.c (stdint.h): Likewise.
* win32-low.c (stdint.h): Likewise.
2015-06-18 Simon Marchi <simon.marchi@ericsson.com>
* server.c (write_qxfer_response): Update call to
remote_escape_output.
2015-06-15 Aleksandar Ristovski <aristovski@qnx.com
Jan Kratochvil <jan.kratochvil@redhat.com>
Merge multiple hex conversions.
* gdbreplay.c (tohex): Rename to 'fromhex'.
(logchar): Use fromhex.
2015-06-10 Jan Kratochvil <jan.kratochvil@redhat.com>
* server.c (handle_qxfer_libraries): Set `version' attribute for
<library-list>.
2015-06-10 Gary Benson <gbenson@redhat.com>
* target.h (struct target_ops) <multifs_open>: New field.
<multifs_unlink>: Likewise.
<multifs_readlink>: Likewise.
* linux-low.c (nat/linux-namespaces.h): New include.
(linux_target_ops): Initialize the_target->multifs_open,
the_target->multifs_unlink and the_target->multifs_readlink.
* hostio.h (hostio_handle_new_gdb_connection): New declaration.
* hostio.c (hostio_fs_pid): New static variable.
(hostio_handle_new_gdb_connection): New function.
(handle_setfs): Likewise.
(handle_open): Use the_target->multifs_open as appropriate.
(handle_unlink): Use the_target->multifs_unlink as appropriate.
(handle_readlink): Use the_target->multifs_readlink as
appropriate.
(handle_vFile): Handle vFile:setfs packets.
* server.c (handle_query): Call hostio_handle_new_gdb_connection
after target_handle_new_gdb_connection.
Introduce nat/linux-namespaces.[ch] This commit introduces new shared files nat/linux-namespaces.[ch] containing code to support Linux namespaces that will be used by both GDB and gdbserver. gdb/ChangeLog: * configure.ac (AC_CHECK_FUNCS): Add setns. * config.in: Regenerate. * configure: Likewise. * nat/linux-namespaces.h: New file. * nat/linux-namespaces.c: Likewise. * Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-namespaces.h. (linux-namespaces.o): New rule. * config/aarch64/linux.mh (NATDEPFILES): Add linux-namespaces.o. * config/alpha/alpha-linux.mh (NATDEPFILES): Likewise. * config/arm/linux.mh (NATDEPFILES): Likewise. * config/i386/linux.mh (NATDEPFILES): Likewise. * config/i386/linux64.mh (NATDEPFILES): Likewise. * config/ia64/linux.mh (NATDEPFILES): Likewise. * config/m32r/linux.mh (NATDEPFILES): Likewise. * config/m68k/linux.mh (NATDEPFILES): Likewise. * config/mips/linux.mh (NATDEPFILES): Likewise. * config/pa/linux.mh (NATDEPFILES): Likewise. * config/powerpc/linux.mh (NATDEPFILES): Likewise. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise. * config/powerpc/spu-linux.mh (NATDEPFILES): Likewise. * config/s390/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * config/tilegx/linux.mh (NATDEPFILES): Likewise. * config/xtensa/linux.mh (NATDEPFILES): Likewise. gdb/gdbserver/ChangeLog: * configure.ac (AC_CHECK_FUNCS): Add setns. * config.in: Regenerate. * configure: Likewise. * Makefile.in (SFILES): Add nat/linux-namespaces.c. (linux-namespaces.o): New rule. * configure.srv (srv_linux_obj): Add linux-namespaces.o.
2015-06-10 15:28:43 +02:00
2015-06-10 Gary Benson <gbenson@redhat.com>
* configure.ac (AC_CHECK_FUNCS): Add setns.
* config.in: Regenerate.
* configure: Likewise.
* Makefile.in (SFILES): Add nat/linux-namespaces.c.
(linux-namespaces.o): New rule.
* configure.srv (srv_linux_obj): Add linux-namespaces.o.
2015-06-09 Gary Benson <gbenson@redhat.com>
* hostio.c (handle_open): Process mode argument with
fileio_to_host_mode.
2015-06-01 Yao Qi <yao.qi@linaro.org>
* linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
* linux-x86-low.c: Likewise.
Initialize last_resume_kind for remote fork child This patch fixes some intermittent test failures in gdb.base/foll-vfork.exp where a vfork child would be (incorrectly) resumed when handling the vfork event. In this case the result was a subsequent event reported to the client side as a SIGTRAP delivered to the as-yet-unknown child thread. The new thread was resumed (incorrectly) in linux-low.c when resume_stopped_resumed_lwps was called from linux_wait_for_event_filtered after the vfork event had been handled in handle_extended_wait. Gdbserver/linux-low.c's add_thread function creates threads with last_resume_kind == resume_continue by default. This field is used by resume_stopped_resumed_lwps to decide whether to perform the resume: static void resume_stopped_resumed_lwps (struct inferior_list_entry *entry) { struct thread_info *thread = (struct thread_info *) entry; struct lwp_info *lp = get_thread_lwp (thread); if (lp->stopped && !lp->status_pending_p && thread->last_resume_kind != resume_stop && thread->last_status.kind == TARGET_WAITKIND_IGNORE) { So the fix is to make sure to set thread->last_resume_kind to resume_stop. Here we do that for new fork children in gdbserver/linux-low.c:handle_extended_wait. In addition, it seemed prudent to initialize lwp_info.status_pending_p for the new fork child. I also rearranged the initialization code so that all of the lwp_info initialization was together, rather than intermixed with thread_info and process_info initialization. Tested native, native-gdbserver, native-extended-gdbserver on x86_64 GNU/Linux. gdb/gdbserver/ * linux-low.c (handle_extended_wait): Initialize thread_info.last_resume_kind for new fork children.
2015-05-28 22:12:01 +02:00
2015-05-28 Don Breazeal <donb@codesourcery.com>
* linux-low.c (handle_extended_wait): Initialize
thread_info.last_resume_kind for new fork children.
2015-05-15 Pedro Alves <palves@redhat.com>
* target.h (target_handle_new_gdb_connection): Rewrite using if
wrapped in do/while.
Fix gdbserver build failure on arm-android. The following patch... | proc-service, extern "C" | | libthread_db.so calls symbols in the client (GDB), through the | proc-service interface. These routines must have extern "C" linkage | so their symbol names are not mangled when GDB is built as a C++ | program. On the GDBserver side, we were missing fallback declarations for | all these symbols. | | gdb/ChangeLog: | | * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP. | | gdb/gdbserver/ChangeLog: | 2015-02-27 Pedro Alves <palves@redhat.com> | | * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP. | [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare. | [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread) | ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs) | (ps_lsetfpregs, ps_getpid) | (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue) | (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs) | (ps_lsetxregs, ps_plog): Declare. ... added a number of declarations which do not compile when cross- compiling GDBserver on arm-android. The problem comes from type prfpregset_t not being declared: /[...]/gdbserver/gdb_proc_service.h:98:47: error: unknown type name 'prfpregset_t' After searching through the includes of the install we have, I could not find that type being declared anywhere. So I did the same as for prgregset_t, and created the typedef if the type isn't declared. gdb/gdbserver/ChangeLog: * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check. * configure, config.in: Regenerate. * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t): Declare typedef.
2015-03-24 18:19:10 +01:00
2015-05-14 Joel Brobecker <brobecker@adacore.com>
* configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
* configure, config.in: Regenerate.
* gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
Declare typedef.
2015-05-12 18:52:45 +02:00
2015-05-12 Don Breazeal <donb@codesourcery.com>
* linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
PTRACE_EVENT_VFORK_DONE.
(linux_low_ptrace_options, extended_event_reported): Add vfork
events.
* remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
and "vforkdone" for RSP 'T' Stop Reply Packet.
* server.h (report_vfork_events): Declare
global variable.
Arch-specific remote follow fork This patch implements the architecture-specific pieces of follow-fork for remote and extended-remote Linux targets, which in the current implementation copyies the parent's debug register state into the new child's data structures. This is required for x86, arm, aarch64, and mips. This follows the native implementation as closely as possible by implementing a new linux_target_ops function 'new_fork', which is analogous to 'linux_nat_new_fork' in linux-nat.c. In gdbserver, the debug registers are stored in the process list, instead of an architecture-specific list, so the function arguments are process_info pointers instead of an lwp_info and a pid as in the native implementation. In the MIPS implementation the debug register mirror is stored differently from x86, ARM, and aarch64, so instead of doing a simple structure assignment I had to clone the list of watchpoint structures. Tested using gdb.threads/watchpoint-fork.exp on x86, and ran manual tests on a MIPS board and an ARM board. Aarch64 hasn't been tested. gdb/gdbserver/ChangeLog: * linux-aarch64-low.c (aarch64_linux_new_fork): New function. (the_low_target) <new_fork>: Initialize new member. * linux-arm-low.c (arm_new_fork): New function. (the_low_target) <new_fork>: Initialize new member. * linux-low.c (handle_extended_wait): Call new target function new_fork. * linux-low.h (struct linux_target_ops) <new_fork>: New member. * linux-mips-low.c (mips_add_watchpoint): New function extracted from mips_insert_point. (the_low_target) <new_fork>: Initialize new member. (mips_linux_new_fork): New function. (mips_insert_point): Call mips_add_watchpoint. * linux-x86-low.c (x86_linux_new_fork): New function. (the_low_target) <new_fork>: Initialize new member.
2015-05-12 18:52:44 +02:00
2015-05-12 Don Breazeal <donb@codesourcery.com>
* linux-aarch64-low.c (aarch64_linux_new_fork): New function.
(the_low_target) <new_fork>: Initialize new member.
* linux-arm-low.c (arm_new_fork): New function.
(the_low_target) <new_fork>: Initialize new member.
* linux-low.c (handle_extended_wait): Call new target function
new_fork.
* linux-low.h (struct linux_target_ops) <new_fork>: New member.
* linux-mips-low.c (mips_add_watchpoint): New function
extracted from mips_insert_point.
(the_low_target) <new_fork>: Initialize new member.
(mips_linux_new_fork): New function.
(mips_insert_point): Call mips_add_watchpoint.
* linux-x86-low.c (x86_linux_new_fork): New function.
(the_low_target) <new_fork>: Initialize new member.
Extended-remote Linux follow fork This patch implements basic support for follow-fork and detach-on-fork on extended-remote Linux targets. Only 'fork' is supported in this patch; 'vfork' support is added n a subsequent patch. This patch depends on the previous patches in the patch series. Sufficient extended-remote functionality has been implemented here to pass gdb.base/multi-forks.exp, as well as gdb.base/foll-fork.exp with the catchpoint tests commented out. Some other fork tests fail with this patch because it doesn't provide the architecture support needed for watchpoint inheritance or fork catchpoints. The implementation follows the same general structure as for the native implementation as much as possible. This implementation includes: * enabling fork events in linux-low.c in initialize_low and linux_enable_extended_features * handling fork events in gdbserver/linux-low.c:handle_extended_wait - when a fork event occurs in gdbserver, we must do the full creation of the new process, thread, lwp, and breakpoint lists. This is required whether or not the new child is destined to be detached-on-fork, because GDB will make target calls that require all the structures. In particular we need the breakpoint lists in order to remove the breakpoints from a detaching child. If we are not detaching the child we will need all these structures anyway. - as part of this event handling we store the target_waitstatus in a new member of the parent lwp_info structure, 'waitstatus'. This is used to store extended event information for reporting to GDB. - handle_extended_wait is given a return value, denoting whether the handled event should be reported to GDB. Previously it had only handled clone events, which were never reported. * using a new predicate in gdbserver to control handling of the fork event (and eventually all extended events) in linux_wait_1. The predicate, extended_event_reported, checks a target_waitstatus.kind for an extended ptrace event. * implementing a new RSP 'T' Stop Reply Packet stop reason: "fork", in gdbserver/remote-utils.c and remote.c. * implementing new target and RSP support for target_follow_fork with target extended-remote. (The RSP components were actually defined in patch 1, but they see their first use here). - remote target routine remote_follow_fork, which just sends the 'D;pid' detach packet to detach the new fork child cleanly. We can't just call target_detach because the data structures for the forked child have not been allocated on the host side. Tested on x64 Ubuntu Lucid, native, remote, extended-remote. gdb/gdbserver/ChangeLog: * linux-low.c (handle_extended_wait): Implement return value, rename argument 'event_child' to 'event_lwp', handle PTRACE_EVENT_FORK, call internal_error for unrecognized event. (linux_low_ptrace_options): New function. (linux_low_filter_event): Call linux_low_ptrace_options, use different argument fo linux_enable_event_reporting, use return value from handle_extended_wait. (extended_event_reported): New function. (linux_wait_1): Call extended_event_reported and set status to report fork events. (linux_write_memory): Add pid to debug message. (reset_lwp_ptrace_options_callback): New function. (linux_handle_new_gdb_connection): New function. (linux_target_ops): Initialize new structure member. * linux-low.h (struct lwp_info) <waitstatus>: New member. * lynx-low.c: Initialize new structure member. * remote-utils.c (prepare_resume_reply): Implement stop reason "fork" for "T" stop message. * server.c (handle_query): Call handle_new_gdb_connection. * server.h (report_fork_events): Declare global flag. * target.h (struct target_ops) <handle_new_gdb_connection>: New member. (target_handle_new_gdb_connection): New macro. * win32-low.c: Initialize new structure member. gdb/ChangeLog: * linux-nat.c (linux_nat_ptrace_options): New function. (linux_init_ptrace, wait_lwp, linux_nat_filter_event): Call linux_nat_ptrace_options and use different argument to linux_enable_event_reporting. (_initialize_linux_nat): Delete call to linux_ptrace_set_additional_flags. * nat/linux-ptrace.c (current_ptrace_options): Rename to supported_ptrace_options. (additional_flags): Delete variable. (linux_check_ptrace_features): Use supported_ptrace_options. (linux_test_for_tracesysgood, linux_test_for_tracefork): Likewise, and remove additional_flags check. (linux_enable_event_reporting): Change 'attached' argument to 'options'. Use supported_ptrace_options. (ptrace_supports_feature): Change comment. Use supported_ptrace_options. (linux_ptrace_set_additional_flags): Delete function. * nat/linux-ptrace.h (linux_ptrace_set_additional_flags): Delete function prototype. * remote.c (remote_fork_event_p): New function. (remote_detach_pid): New function. (remote_detach_1): Call remote_detach_pid, don't mourn inferior if doing detach-on-fork. (remote_follow_fork): New function. (remote_parse_stop_reply): Handle new "T" stop reason "fork". (remote_pid_to_str): Print "process" strings for pid/0/0 ptids. (init_extended_remote_ops): Initialize to_follow_fork.
2015-05-12 18:52:43 +02:00
2015-05-12 Don Breazeal <donb@codesourcery.com>
* linux-low.c (handle_extended_wait): Implement return value,
rename argument 'event_child' to 'event_lwp', handle
PTRACE_EVENT_FORK, call internal_error for unrecognized event.
(linux_low_ptrace_options): New function.
(linux_low_filter_event): Call linux_low_ptrace_options,
use different argument fo linux_enable_event_reporting,
use return value from handle_extended_wait.
(extended_event_reported): New function.
(linux_wait_1): Call extended_event_reported and set
status to report fork events.
(linux_write_memory): Add pid to debug message.
(reset_lwp_ptrace_options_callback): New function.
(linux_handle_new_gdb_connection): New function.
(linux_target_ops): Initialize new structure member.
* linux-low.h (struct lwp_info) <waitstatus>: New member.
* lynx-low.c: Initialize new structure member.
* remote-utils.c (prepare_resume_reply): Implement stop reason
"fork" for "T" stop message.
* server.c (handle_query): Call handle_new_gdb_connection.
* server.h (report_fork_events): Declare global flag.
* target.h (struct target_ops) <handle_new_gdb_connection>:
New member.
(target_handle_new_gdb_connection): New macro.
* win32-low.c: Initialize new structure member.
2015-05-12 Don Breazeal <donb@codesourcery.com>
* mem-break.c (APPEND_TO_LIST): Define macro.
(clone_agent_expr): New function.
(clone_one_breakpoint): New function.
(clone_all_breakpoints): New function.
* mem-break.h: Declare new functions.
Identify remote fork event support This patch implements a mechanism for GDB to determine whether fork events are supported in gdbserver. This is a preparatory patch for remote fork and exec event support. Two new RSP packets are defined to represent fork and vfork event support. These packets are used just like PACKET_multiprocess_feature to denote whether the corresponding event is supported. GDB sends fork-events+ and vfork-events+ to gdbserver to inquire about fork event support. If the response enables these packets, then GDB knows that gdbserver supports the corresponding events and will enable them. Target functions used to query for support are included along with each new packet. In order for gdbserver to know whether the events are supported at the point where the qSupported packet arrives, the code in nat/linux-ptrace.c had to be reorganized. Previously it would test for fork/exec event support, then enable the events using the pid of the inferior. When the qSupported packet arrives there may not be an inferior. So the mechanism was split into two parts: a function that checks whether the events are supported, called when gdbserver starts up, and another that enables the events when the inferior stops for the first time. Another gdbserver change was to add some global variables similar to multi_process, one per new packet. These are used to control whether the corresponding fork events are enabled. If GDB does not inquire about the event support in the qSupported packet, then gdbserver will not set these "report the event" flags. If the flags are not set, the events are ignored like they were in the past. Thus, gdbserver will never send fork event notification to an older GDB that doesn't recognize fork events. Tested on Ubuntu x64, native/remote/extended-remote, and as part of subsequent patches in the series. gdb/gdbserver/ChangeLog: * linux-low.c (linux_supports_fork_events): New function. (linux_supports_vfork_events): New function. (linux_target_ops): Initialize new structure members. (initialize_low): Call linux_check_ptrace_features. * lynx-low.c (lynx_target_ops): Initialize new structure members. * server.c (report_fork_events, report_vfork_events): New global flags. (handle_query): Add new features to qSupported packet and response. (captured_main): Initialize new global variables. * target.h (struct target_ops) <supports_fork_events>: New member. <supports_vfork_events>: New member. (target_supports_fork_events): New macro. (target_supports_vfork_events): New macro. * win32-low.c (win32_target_ops): Initialize new structure members. gdb/ChangeLog: * nat/linux-ptrace.c (linux_check_ptrace_features): Change from static to extern. * nat/linux-ptrace.h (linux_check_ptrace_features): Declare. * remote.c (anonymous enum): <PACKET_fork_event_feature, * PACKET_vfork_event_feature>: New enumeration constants. (remote_protocol_features): Add table entries for new packets. (remote_query_supported): Add new feature queries to qSupported packet. (_initialize_remote): Exempt new packets from the requirement to have 'set remote' commands.
2015-05-12 18:52:41 +02:00
2015-05-12 Don Breazeal <donb@codesourcery.com>
* linux-low.c (linux_supports_fork_events): New function.
(linux_supports_vfork_events): New function.
(linux_target_ops): Initialize new structure members.
(initialize_low): Call linux_check_ptrace_features.
* lynx-low.c (lynx_target_ops): Initialize new structure
members.
* server.c (report_fork_events, report_vfork_events):
New global flags.
(handle_query): Add new features to qSupported packet and
response.
(captured_main): Initialize new global variables.
* target.h (struct target_ops) <supports_fork_events>:
New member.
<supports_vfork_events>: New member.
(target_supports_fork_events): New macro.
(target_supports_vfork_events): New macro.
* win32-low.c (win32_target_ops): Initialize new structure
members.
2015-05-12 Gary Benson <gbenson@redhat.com>
* server.c (handle_qxfer_exec_file): Use current process
if annex is empty.
2015-05-08 Sandra Loosemore <sandra@codesourcery.com>
* linux-nios2-low.c: Include elf/common.h. Adjust comments.
Remove HAVE_PTRACE_GETREGS conditionals.
(nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
instead of PTRACE_GETREGS and PTRACE_SETREGS.
[gdbserver] Disable conditional breakpoints on no-hardware-single-step targets GDBserver steps over breakpoint if the condition is false, but if target doesn't support hardware single step, the step over is very simple, if not incorrect, in linux-arm-low.c: /* We only place breakpoints in empty marker functions, and thread locking is outside of the function. So rather than importing software single-step, we can just run until exit. */ static CORE_ADDR arm_reinsert_addr (void) { struct regcache *regcache = get_thread_regcache (current_thread, 1); unsigned long pc; collect_register_by_name (regcache, "lr", &pc); return pc; } and linux-mips-low.c does the same. GDBserver sets a breakpoint at the return address of the current function, resume and wait the program hits the breakpoint in order to achieve "breakpoint step over". What if program hits other user breakponits during this "step over"? It is worse if the arm/thumb interworking is considered. Nowadays, GDBserver arm backend unconditionally inserts arm breakpoint, /* Define an ARM-mode breakpoint; we only set breakpoints in the C library, which is most likely to be ARM. If the kernel supports clone events, we will never insert a breakpoint, so even a Thumb C library will work; so will mixing EABI/non-EABI gdbserver and application. */ (const unsigned char *) &arm_breakpoint, (const unsigned char *) &arm_eabi_breakpoint, note that the comments are no longer valid as C library can be compiled in thumb mode. When GDBserver steps over a breakpoint in arm mode function, which returns to thumb mode, GDBserver will insert arm mode breakpoint by mistake and the program will crash. GDBserver alone is unable to determine the arm/thumb mode given a PC address. See how GDB does it in arm-tdep.c:arm_pc_is_thumb. After thinking about how to teach GDBserver inserting right breakpoint (arm or thumb) for a while, I reconsider it from a different direction that it may be unreasonable to run target-side conditional breakpoint for targets without hardware single step. Pedro also pointed this out here https://sourceware.org/ml/gdb-patches/2015-04/msg00337.html This patch is to add a new target_ops hook supports_conditional_breakpoints, and only reply ";ConditionalBreakpoints+" if it is true. On linux targets, supports_conditional_breakpoints returns true if target has hardware single step, on other targets, (win32, lynx, nto, spu), set it to NULL, because conditional breakpoint is a linux-specific feature. gdb/gdbserver: 2015-05-08 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_supports_conditional_breakpoints): New function. (linux_target_ops): Install new target method. * lynx-low.c (lynx_target_ops): Install NULL hook for supports_conditional_breakpoints. * nto-low.c (nto_target_ops): Likewise. * spu-low.c (spu_target_ops): Likewise. * win32-low.c (win32_target_ops): Likewise. * server.c (handle_query): Check target_supports_conditional_breakpoints. * target.h (struct target_ops) <supports_conditional_breakpoints>: New field. (target_supports_conditional_breakpoints): New macro.
2015-05-08 13:29:13 +02:00
2015-05-08 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_supports_conditional_breakpoints): New
function.
(linux_target_ops): Install new target method.
* lynx-low.c (lynx_target_ops): Install NULL hook for
supports_conditional_breakpoints.
* nto-low.c (nto_target_ops): Likewise.
* spu-low.c (spu_target_ops): Likewise.
* win32-low.c (win32_target_ops): Likewise.
* server.c (handle_query): Check
target_supports_conditional_breakpoints.
* target.h (struct target_ops) <supports_conditional_breakpoints>:
New field.
(target_supports_conditional_breakpoints): New macro.
2015-05-06 Pedro Alves <palves@redhat.com>
PR server/18081
* server.c (start_inferior): If the process exits, mourn it.
2015-04-21 Gary Benson <gbenson@redhat.com>
* hostio.c (fileio_open_flags_to_host): Factored out to
fileio_to_host_openflags in common/fileio.c. Single use
updated.
2015-04-17 Max Filippov <jcmvbkbc@gmail.com>
* linux-xtensa-low.c (xtensa_fill_gregset)
(xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
XCHAL_HAVE_LOOP.
2015-04-17 Max Filippov <jcmvbkbc@gmail.com>
* linux-xtensa-low.c (xtensa_usrregs_info): Remove.
(regs_info): Replace usrregs pointer with NULL.
2015-04-17 Gary Benson <gbenson@redhat.com>
* target.h (struct target_ops) <pid_to_exec_file>: New field.
* linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
* server.c (handle_qxfer_exec_file): New function.
(qxfer_packets): Add exec-file entry.
(handle_query): Report qXfer:exec-file:read as supported packet.
2015-04-14 Romain Naour <romain.naour@openwide.fr> (tiny change)
* linux-low.c (linux_read_offsets): Remove get_thread_lwp.
2015-04-09 Gary Benson <gbenson@redhat.com>
* hostio-errno.c (errno_to_fileio_error): Remove function.
Update caller to use remote_fileio_to_fio_error.
gdbserver gnu/linux: stepping over breakpoint Hi, I see the following error on arm linux gdbserver, continue^M Continuing.^M ../../../binutils-gdb/gdb/gdbserver/linux-arm-low.c:458: A problem internal to GDBserver has been detected.^M raw_bkpt_type_to_arm_hwbp_type: unhandled raw type^M Remote connection closed^M (gdb) FAIL: gdb.base/cond-eval-mode.exp: hbreak: continue After we make GDBserver handling Zx/zx packet idempotent, [PATCH 3/3] [GDBserver] Make Zx/zx packet handling idempotent. https://sourceware.org/ml/gdb-patches/2014-04/msg00480.html > Now removal/insertion of all kinds of breakpoints/watchpoints, either > internal, or from GDB, always go through the target methods. GDBserver handles all kinds of breakpoints/watchpoints through target methods. However, some target backends, such as arm, don't support Z0 packet but need software breakpoint to do breakpoint stepping over in linux-low.c:start_step_over, if (can_hardware_single_step ()) { step = 1; } else { CORE_ADDR raddr = (*the_low_target.breakpoint_reinsert_addr) (); set_reinsert_breakpoint (raddr); step = 0; } a software breakpoint is requested to the backend, and the error is triggered. This problem should affect targets having breakpoint_reinsert_addr hooked. Instead of handling memory breakpoint in these affected linux backend, this patch handles memory breakpoint in linux_{insert,remove}_point, that, if memory breakpoint is requested, call {insert,remove}_memory_breakpoint respectively. Then, it becomes unnecessary to handle memory breakpoint for linux x86 backend, so this patch removes the code there. This patch is tested with GDBserver on x86_64-linux and arm-linux (-marm, -mthumb). Note that there are still some fails in gdb.base/cond-eval-mode.exp with -mthumb, because GDBserver doesn't know how to select the correct breakpoint instruction according to the arm-or-thumb-mode of requested address. This is a separate issue, anyway. gdb/gdbserver: 2015-04-09 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_insert_point): Call insert_memory_breakpoint if TYPE is raw_bkpt_type_sw. (linux_remove_point): Call remove_memory_breakpoint if type is raw_bkpt_type_sw. * linux-x86-low.c (x86_insert_point): Don't call insert_memory_breakpoint. (x86_remove_point): Don't call remove_memory_breakpoint.
2015-04-09 11:20:48 +02:00
2015-04-09 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_insert_point): Call
insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
(linux_remove_point): Call remove_memory_breakpoint if type is
raw_bkpt_type_sw.
* linux-x86-low.c (x86_insert_point): Don't call
insert_memory_breakpoint.
(x86_remove_point): Don't call remove_memory_breakpoint.
GDBServer: give more complete usage information --attach/--multi are currently only mentioned on the usage info first lines, the meaning of PROG is completely absent and the COMM text does not mention '-/stdio'. A few options are missing: . --disable-randomization / --no-disable-randomization is not mentioned. Although the manual has a comment saying these are superceded by QDisableRandomization, that only makes sense for "run" in extended-remote mode. When we start gdbserver passing it a PROG, --disable-randomization / --no-disable-randomization do take effect. So I think we should document these. . We show --debug / --remote-debug, so might as well show --disable-packet too. GDB's --help has this "For more information, consult the GDB manual" blurb that is missing in GDBserver's --help. Then shuffle things around a bit into "Operating modes", "Other options" and "Debug options" sections, similarly to GDB's --help structure. Before: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $ ./gdbserver/gdbserver --help Usage: gdbserver [OPTIONS] COMM PROG [ARGS ...] gdbserver [OPTIONS] --attach COMM PID gdbserver [OPTIONS] --multi COMM COMM may either be a tty device (for serial debugging), or HOST:PORT to listen for a TCP connection. Options: --debug Enable general debugging output. --debug-format=opt1[,opt2,...] Specify extra content in debugging output. Options: all none timestamp --remote-debug Enable remote protocol debugging output. --version Display version information and exit. --wrapper WRAPPER -- Run WRAPPER to start new programs. --once Exit after the first connection has closed. Report bugs to "<http://www.gnu.org/software/gdb/bugs/>". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ After: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $ ./gdbserver/gdbserver --help Usage: gdbserver [OPTIONS] COMM PROG [ARGS ...] gdbserver [OPTIONS] --attach COMM PID gdbserver [OPTIONS] --multi COMM COMM may either be a tty device (for serial debugging), HOST:PORT to listen for a TCP connection, or '-' or 'stdio' to use stdin/stdout of gdbserver. PROG is the executable program. ARGS are arguments passed to inferior. PID is the process ID to attach to, when --attach is specified. Operating modes: --attach Attach to running process PID. --multi Start server without a specific program, and only quit when explicitly commanded. --once Exit after the first connection has closed. --help Print this message and then exit. --version Display version information and exit. Other options: --wrapper WRAPPER -- Run WRAPPER to start new programs. --disable-randomization Run PROG with address space randomization disabled. --no-disable-randomization Don't disable address space randomization when starting PROG. Debug options: --debug Enable general debugging output. --debug-format=opt1[,opt2,...] Specify extra content in debugging output. Options: all none timestamp --remote-debug Enable remote protocol debugging output. --disable-packet=opt1[,opt2,...] Disable support for RSP packets or features. Options: vCont, Tthread, qC, qfThreadInfo and threads (disable all threading packets). For more information, consult the GDB manual (available as on-line info or a printed manual). Report bugs to "<http://www.gnu.org/software/gdb/bugs/>". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gdb/gdbserver/ChangeLog: 2015-04-01 Pedro Alves <palves@redhat.com> Cleber Rosa <crosa@redhat.com> * server.c (gdbserver_usage): Reorganize and extend the usage message.
2015-04-01 12:01:44 +02:00
2015-04-01 Pedro Alves <palves@redhat.com>
Cleber Rosa <crosa@redhat.com>
* server.c (gdbserver_usage): Reorganize and extend the usage
message.
2015-03-24 Pedro Alves <palves@redhat.com>
* linux-low.c (check_stopped_by_breakpoint): Tweak debug log
output. Also dump TRAP_TRACE.
(linux_low_filter_event): In debug output, distinguish a
resume_stop SIGSTOP from a delayed SIGSTOP.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_linux_new_thread): Moved to
nat/x86-linux.c.
(x86_linux_prepare_to_resume): Likewise.
Move low-level Linux x86 debug register code to a shared file This commit moves the now-identical low-level Linux x86 debug register code from gdb/x86-linux-nat.c and gdb/gdbserver/linux-x86-low.c into a new shared file gdb/nat/x86-linux-dregs.c. gdb/ChangeLog: * nat/x86-linux-dregs.h: New file. * nat/x86-linux-dregs.c: Likewise. * Makefile.in (HFILES_NO_SRCDIR): Add nat/x86-linux-dregs.h. (x86-linux-dregs.o): New rule. * config/i386/linux.mh (NATDEPFILES): Add x86-linux-dregs.o. * config/i386/linux64.mh (NATDEPFILES): Likewise. * x86-linux-nat.c: Include nat/x86-linux-dregs.h. (u_debugreg_offset): Moved to nat/x86-linux-dregs.c. (x86_linux_dr_get): Likewise. (x86_linux_dr_set): Likewise. (x86_linux_dr_get_addr): Likewise. (x86_linux_dr_get_control): Likewise. (x86_linux_dr_get_status): Likewise. (update_debug_registers_callback): Likewise. (x86_linux_dr_set_control): Likewise. (x86_linux_dr_set_addr): Likewise. (x86_linux_update_debug_registers): Likewise. gdb/gdbserver/ChangeLog: * Makefile.in (x86-linux-dregs.o): New rule. * configure.srv: Add x86-linux-dregs.o to relevant targets. * linux-x86-low.c: Include nat/x86-linux-dregs.h. (u_debugreg_offset): Moved to nat/x86-linux-dregs.c. (x86_linux_dr_get): Likewise. (x86_linux_dr_set): Likewise. (update_debug_registers_callback): Likewise. (x86_linux_dr_set_addr): Likewise. (x86_linux_dr_get_addr): Likewise. (x86_linux_dr_set_control): Likewise. (x86_linux_dr_get_control): Likewise. (x86_linux_dr_get_status): Likewise. (x86_linux_update_debug_registers): Likewise.
2015-03-24 15:05:45 +01:00
2015-03-24 Gary Benson <gbenson@redhat.com>
* Makefile.in (x86-linux-dregs.o): New rule.
* configure.srv: Add x86-linux-dregs.o to relevant targets.
* linux-x86-low.c: Include nat/x86-linux-dregs.h.
(u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
(x86_linux_dr_get): Likewise.
(x86_linux_dr_set): Likewise.
(update_debug_registers_callback): Likewise.
(x86_linux_dr_set_addr): Likewise.
(x86_linux_dr_get_addr): Likewise.
(x86_linux_dr_set_control): Likewise.
(x86_linux_dr_get_control): Likewise.
(x86_linux_dr_get_status): Likewise.
(x86_linux_update_debug_registers): Likewise.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_linux_update_debug_registers):
New function, factored out from...
(x86_linux_prepare_to_resume): ...this.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_linux_dr_get): Update comments.
(x86_linux_dr_set): Likewise.
(update_debug_registers_callback): Likewise.
(x86_linux_dr_set_addr): Likewise.
(x86_linux_dr_get_addr): Likewise.
(x86_linux_dr_set_control): Likewise.
(x86_linux_dr_get_control): Likewise.
(x86_linux_dr_get_status): Likewise.
(x86_linux_prepare_to_resume): Likewise.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_linux_dr_get): Add assertion.
Use perror_with_name. Pass string through gettext.
(x86_linux_dr_set): Likewise.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_dr_low_set_addr): Rename to...
(x86_linux_dr_set_addr): ...this.
(x86_dr_low_get_addr): Rename to...
(x86_linux_dr_get_addr): ...this.
(x86_dr_low_set_control): Rename to...
(x86_linux_dr_set_control): ...this.
(x86_dr_low_get_control): Rename to...
(x86_linux_dr_get_control): ...this.
(x86_dr_low_get_status): Rename to...
(x86_linux_dr_get_status): ...this.
(x86_dr_low): Update with new function names.
2015-03-24 15:05:44 +01:00
2015-03-24 Gary Benson <gbenson@redhat.com>
* Makefile.in (x86-linux.o): New rule.
* configure.srv: Add x86-linux.o to relevant targets.
* linux-low.c (lwp_set_arch_private_info): New function.
(lwp_arch_private_info): Likewise.
* linux-x86-low.c: Include nat/x86-linux.h.
(arch_lwp_info): Removed structure.
(update_debug_registers_callback):
Use lwp_set_debug_registers_changed.
(x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
and lwp_set_debug_registers_changed.
(x86_linux_new_thread): Use lwp_set_debug_registers_changed.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-low.h (linux_target_ops) <new_thread>: Changed signature.
* linux-arm-low.c (arm_new_thread): Likewise.
* linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
* linux-mips-low.c (mips_linux_new_thread): Likewise.
* linux-x86-low.c (x86_linux_new_thread): Likewise.
* linux-low.c (add_lwp): Update the_low_target.new_thread call.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-low.c (ptid_of_lwp): New function.
(lwp_is_stopped): Likewise.
(lwp_stop_reason): Likewise.
* linux-x86-low.c (update_debug_registers_callback):
Use lwp_is_stopped.
(x86_linux_prepare_to_resume): Use ptid_of_lwp and
lwp_stop_reason.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-low.h (linux_stop_lwp): Remove declaration.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-low.h: Include nat/linux-nat.h.
* linux-low.c (iterate_over_lwps_args): New structure.
(iterate_over_lwps_filter): New function.
(iterate_over_lwps): Likewise.
* linux-x86-low.c (update_debug_registers_callback):
Update signature to what iterate_over_lwps expects.
Remove PID check that iterate_over_lwps now performs.
(x86_dr_low_set_addr): Use iterate_over_lwps.
(x86_dr_low_set_control): Likewise.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_debug_reg_state): New function.
(x86_linux_prepare_to_resume): Use the above.
2015-03-24 Gary Benson <gbenson@redhat.com>
* linux-low.c (current_lwp_ptid): New function.
* linux-x86-low.c: Include nat/linux-nat.h.
(x86_dr_low_get_addr): Use current_lwp_ptid.
(x86_dr_low_get_control): Likewise.
(x86_dr_low_get_status): Likewise.
2015-03-20 Pedro Alves <palves@redhat.com>
* tracepoint.c (cmd_qtstatus): Make "str" const.
2015-03-20 Pedro Alves <palves@redhat.com>
* server.c (handle_general_set): Make "req_str" const.
Fix race exposed by gdb.threads/killed.exp On GNU/Linux, this test sometimes FAILs like this: (gdb) run Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/killed [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". ptrace: No such process. (gdb) Program terminated with signal SIGKILL, Killed. The program no longer exists. FAIL: gdb.threads/killed.exp: run program to completion (timeout) Note the suspicious "No such process" line (that's errno==ESRCH). Adding debug output we see: linux_nat_wait: [process -1], [TARGET_WNOHANG] LLW: enter LNW: waitpid(-1, ...) returned 18465, ERRNO-OK LLW: waitpid 18465 received Stopped (signal) (stopped) LNW: waitpid(-1, ...) returned 18461, ERRNO-OK LLW: waitpid 18461 received Trace/breakpoint trap (stopped) LLW: Handling extended status 0x03057f LHEW: Got clone event from LWP 18461, new child is LWP 18465 LNW: waitpid(-1, ...) returned 0, ERRNO-OK RSRL: resuming stopped-resumed LWP LWP 18465 at 0x3b36af4b51: step=0 RSRL: resuming stopped-resumed LWP LWP 18461 at 0x3b36af4b51: step=0 sigchld ptrace: No such process. (gdb) linux_nat_wait: [process -1], [TARGET_WNOHANG] LLW: enter LNW: waitpid(-1, ...) returned 18465, ERRNO-OK LLW: waitpid 18465 received Killed (terminated) LLW: LWP 18465 exited. LNW: waitpid(-1, ...) returned 18461, No child processes LLW: waitpid 18461 received Killed (terminated) Process 18461 exited LNW: waitpid(-1, ...) returned -1, No child processes LLW: exit sigchld infrun: target_wait (-1, status) = infrun: 18461 [process 18461], infrun: status->kind = signalled, signal = GDB_SIGNAL_KILL infrun: TARGET_WAITKIND_SIGNALLED Program terminated with signal SIGKILL, Killed. The program no longer exists. infrun: stop_waiting FAIL: gdb.threads/killed.exp: run program to completion (timeout) The issue is that here: RSRL: resuming stopped-resumed LWP LWP 18465 at 0x3b36af4b51: step=0 RSRL: resuming stopped-resumed LWP LWP 18461 at 0x3b36af4b51: step=0 The first line shows we had just resumed LWP 18465, which does: void * child_func (void *dummy) { kill (pid, SIGKILL); exit (1); } So if the kernel manages to schedule that thread fast enough, the process may be killed before GDB has a chance to resume LWP 18461. GDBserver has code at the tail end of linux_resume_one_lwp to cope with this: ~~~ ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, lwpid_of (thread), (PTRACE_TYPE_ARG3) 0, /* Coerce to a uintptr_t first to avoid potential gcc warning of coercing an 8 byte integer to a 4 byte pointer. */ (PTRACE_TYPE_ARG4) (uintptr_t) signal); current_thread = saved_thread; if (errno) { /* ESRCH from ptrace either means that the thread was already running (an error) or that it is gone (a race condition). If it's gone, we will get a notification the next time we wait, so we can ignore the error. We could differentiate these two, but it's tricky without waiting; the thread still exists as a zombie, so sending it signal 0 would succeed. So just ignore ESRCH. */ if (errno == ESRCH) return; perror_with_name ("ptrace"); } ~~~ However, that's not a complete fix, because between starting to handle the resume request and getting that PTRACE_CONTINUE, we run other ptrace calls that can also fail with ESRCH, and that end up throwing an error (with perror_with_name). In the case above, I indeed sometimes see resume_stopped_resumed_lwps fail in the registers read: resume_stopped_resumed_lwps (struct lwp_info *lp, void *data) { ... CORE_ADDR pc = regcache_read_pc (regcache); Or e.g., in 32-bit mode, i386_linux_resume has several calls that can throw too. Whether to ignore ptrace errors or not depends on context that is only available somewhere up the call chain. So the fix is to let ptrace errors throw as they do today, and wrap the resume request in a TRY/CATCH that swallows it iff the lwp that we were trying to resume is no longer ptrace-stopped. gdb/gdbserver/ChangeLog: 2015-03-19 Pedro Alves <palves@redhat.com> * linux-low.c (linux_resume_one_lwp): Rename to ... (linux_resume_one_lwp_throw): ... this. Don't handle ESRCH here, instead call perror_with_name. (check_ptrace_stopped_lwp_gone): New function. (linux_resume_one_lwp): Reimplement as wrapper around linux_resume_one_lwp_throw that swallows errors if the LWP is gone. gdb/ChangeLog: 2015-03-19 Pedro Alves <palves@redhat.com> * linux-nat.c (linux_resume_one_lwp): Rename to ... (linux_resume_one_lwp_throw): ... this. Don't handle ESRCH here, instead call perror_with_name. (check_ptrace_stopped_lwp_gone): New function. (linux_resume_one_lwp): Reimplement as wrapper around linux_resume_one_lwp_throw that swallows errors if the LWP is gone. (resume_stopped_resumed_lwps): Try register reads in TRY/CATCH and swallows errors if the LWP is gone. Use linux_resume_one_lwp_throw instead of linux_resume_one_lwp.
2015-03-19 16:12:33 +01:00
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_resume_one_lwp): Rename to ...
(linux_resume_one_lwp_throw): ... this. Don't handle ESRCH here,
instead call perror_with_name.
(check_ptrace_stopped_lwp_gone): New function.
(linux_resume_one_lwp): Reimplement as wrapper around
linux_resume_one_lwp_throw that swallows errors if the LWP is
gone.
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-low.c (count_events_callback, select_event_lwp_callback):
No longer check whether the thread has resume_stop as last resume
kind.
gdbserver/Linux: unbreak thread event randomization Wanting to make sure the new continue-pending-status.exp test tests both cases of threads 2 and 3 reporting an event, I added counters to the test, to make it FAIL if events for both threads aren't seen. Assuming a well behaved backend, and given a reasonable number of iterations, it should PASS. However, running that against GNU/Linux gdbserver, I found that surprisingly, that FAILed. GDBserver always reported the breakpoint hit for the same thread. Turns out that I broke gdbserver's thread event randomization recently, with git commit 582511be ([gdbserver] linux-low.c: better starvation avoidance, handle non-stop mode too). In that commit I missed that the thread structure also has a status_pending_p field... The end result was that count_events_callback always returns 0, and then if no thread is stepping, select_event_lwp always returns the event thread. IOW, no randomization is happening at all. Quite curious how all the other changes in that patch were sufficient to fix non-stop-fair-events.exp anyway even with that broken. Tested on x86_64 Fedora 20, native and gdbserver. gdb/gdbserver/ChangeLog: 2015-03-19 Pedro Alves <palves@redhat.com> * linux-low.c (count_events_callback, select_event_lwp_callback): Use the lwp's status_pending_p field, not the thread's. gdb/testsuite/ChangeLog: 2015-03-19 Pedro Alves <palves@redhat.com> * gdb.threads/continue-pending-status.exp (saw_thread_2) (saw_thread_3): New globals. (top level): Increment them when an event for the corresponding thread is seen. (no thread starvation): New test.
2015-03-15 20:35:26 +01:00
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-low.c (count_events_callback, select_event_lwp_callback):
Use the lwp's status_pending_p field, not the thread's.
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-low.c (select_event_lwp_callback): Update comments to
no longer mention SIGTRAP.
2015-03-18 Gary Benson <gbenson@redhat.com>
* server.c (handle_query): Do not report vFile:fstat as supported.
2015-03-11 Gary Benson <gbenson@redhat.com>
* hostio.c (sys/types.h): New include.
(sys/stat.h): Likewise.
(common-remote-fileio.h): Likewise.
(handle_fstat): New function.
(handle_vFile): Handle vFile:fstat packets.
2015-03-11 Gary Benson <gbenson@redhat.com>
* configure.ac (AC_CHECK_MEMBERS): Add checks for
struct stat.st_blocks and struct stat.st_blksize.
* configure: Regenerate.
* config.in: Likewise.
* Makefile.in (SFILES): Add common/common-remote-fileio.c.
(OBS): Add common-remote-fileio.o.
(common-remote-fileio.o): New rule.
2015-03-09 Pedro Alves <palves@redhat.com>
* tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
'struct sockaddr' pointer in 'accept' call.
2015-03-09 Pedro Alves <palves@redhat.com>
Revert:
2015-03-07 Pedro Alves <palves@redhat.com>
* gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
or <winsock2.h> here. Instead include "gdb_socket.h".
(remote_open): Use union gdb_sockaddr_u.
* remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
or <winsock2.h> here. Instead include "gdb_socket.h".
(handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
* tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
or <sys/un.h>.
(init_named_socket, gdb_agent_helper_thread): Use union
gdb_sockaddr_u.
2015-03-07 Pedro Alves <palves@redhat.com>
* configure.ac (build_warnings): Move
-Wdeclaration-after-statement to the C-specific set.
* configure: Regenerate.
2015-03-07 Pedro Alves <palves@redhat.com>
* gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
or <winsock2.h> here. Instead include "gdb_socket.h".
(remote_open): Use union gdb_sockaddr_u.
* remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
or <winsock2.h> here. Instead include "gdb_socket.h".
(handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
* tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
or <sys/un.h>.
(init_named_socket, gdb_agent_helper_thread): Use union
gdb_sockaddr_u.
Split TRY_CATCH into TRY + CATCH This patch splits the TRY_CATCH macro into three, so that we go from this: ~~~ volatile gdb_exception ex; TRY_CATCH (ex, RETURN_MASK_ERROR) { } if (ex.reason < 0) { } ~~~ to this: ~~~ TRY { } CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH ~~~ Thus, we'll be getting rid of the local volatile exception object, and declaring the caught exception in the catch block. This allows reimplementing TRY/CATCH in terms of C++ exceptions when building in C++ mode, while still allowing to build GDB in C mode (using setjmp/longjmp), as a transition step. TBC, after this patch, is it _not_ valid to have code between the TRY and the CATCH blocks, like: TRY { } // some code here. CATCH (ex, RETURN_MASK_ERROR) { } END_CATCH Just like it isn't valid to do that with C++'s native try/catch. By switching to creating the exception object inside the CATCH block scope, we can get rid of all the explicitly allocated volatile exception objects all over the tree, and map the CATCH block more directly to C++'s catch blocks. The majority of the TRY_CATCH -> TRY+CATCH+END_CATCH conversion was done with a script, rerun from scratch at every rebase, no manual editing involved. After the mechanical conversion, a few places needed manual intervention, to fix preexisting cases where we were using the exception object outside of the TRY_CATCH block, and cases where we were using "else" after a 'if (ex.reason) < 0)' [a CATCH after this patch]. The result was folded into this patch so that GDB still builds at each incremental step. END_CATCH is necessary for two reasons: First, because we name the exception object in the CATCH block, which requires creating a scope, which in turn must be closed somewhere. Declaring the exception variable in the initializer field of a for block, like: #define CATCH(EXCEPTION, mask) \ for (struct gdb_exception EXCEPTION; \ exceptions_state_mc_catch (&EXCEPTION, MASK); \ EXCEPTION = exception_none) would avoid needing END_CATCH, but alas, in C mode, we build with C90, which doesn't allow mixed declarations and code. Second, because when TRY/CATCH are wired to real C++ try/catch, as long as we need to handle cleanup chains, even if there's no CATCH block that wants to catch the exception, we need for stop at every frame in the unwind chain and run cleanups, then rethrow. That will be done in END_CATCH. After we require C++, we'll still need TRY/CATCH/END_CATCH until cleanups are completely phased out -- TRY/CATCH in C++ mode will save/restore the current cleanup chain, like in C mode, and END_CATCH catches otherwise uncaugh exceptions, runs cleanups and rethrows, so that C++ cleanups and exceptions can coexist. IMO, this still makes the TRY/CATCH code look a bit more like a newcomer would expect, so IMO worth it even if we weren't considering C++. gdb/ChangeLog. 2015-03-07 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (struct catcher) <exception>: No longer a pointer to volatile exception. Now an exception value. <mask>: Delete field. (exceptions_state_mc_init): Remove all parameters. Adjust. (exceptions_state_mc): No longer pop the catcher here. (exceptions_state_mc_catch): New function. (throw_exception): Adjust. * common/common-exceptions.h (exceptions_state_mc_init): Remove all parameters. (exceptions_state_mc_catch): Declare. (TRY_CATCH): Rename to ... (TRY): ... this. Remove EXCEPTION and MASK parameters. (CATCH, END_CATCH): New. All callers adjusted. gdb/gdbserver/ChangeLog: 2015-03-07 Pedro Alves <palves@redhat.com> Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH instead.
2015-03-07 16:14:14 +01:00
2015-03-07 Pedro Alves <palves@redhat.com>
Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
instead.
2015-03-06 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_insert_point): Use
show_debug_regs as a boolean.
(aarch64_remove_point): Likewise.
2015-03-05 Pedro Alves <palves@redhat.com>
* lynx-low.c (lynx_target_ops): Install NULL hooks for
stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
* nto-low.c (nto_target_ops): Likewise.
* spu-low.c (spu_target_ops): Likewise.
* win32-low.c (win32_target_ops): Likewise.
2015-03-04 Pedro Alves <palves@redhat.com>
* linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
Decide whether a breakpoint triggered based on the SIGTRAP's
siginfo.si_code.
(thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
(linux_low_filter_event): Check for breakpoints before checking
watchpoints.
(linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
siginfo.si_code.
(linux_stopped_by_sw_breakpoint)
(linux_supports_stopped_by_sw_breakpoint)
(linux_stopped_by_hw_breakpoint)
(linux_supports_stopped_by_hw_breakpoint): New functions.
(linux_target_ops): Install new target methods.
2015-03-04 Pedro Alves <palves@redhat.com>
* remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
* server.c (swbreak_feature, hwbreak_feature): New globals.
(handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
(captured_main): Clear swbreak_feature and hwbreak_feature.
* server.h (swbreak_feature, hwbreak_feature): Declare.
* target.h (struct target_ops) <stopped_by_sw_breakpoint,
supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
supports_stopped_by_hw_breakpoint>: New fields.
(target_supports_stopped_by_sw_breakpoint)
(target_stopped_by_sw_breakpoint)
(target_supports_stopped_by_hw_breakpoint)
(target_stopped_by_hw_breakpoint): Declare.
2015-03-04 Pedro Alves <palves@redhat.com>
enum lwp_stop_reason -> enum target_stop_reason
* linux-low.c (check_stopped_by_breakpoint): Adjust.
(thread_still_has_status_pending_p, check_stopped_by_watchpoint)
(linux_wait_1, stuck_in_jump_pad_callback)
(move_out_of_jump_pad_callback, linux_resume_one_lwp)
(linux_stopped_by_watchpoint):
* linux-low.h (enum lwp_stop_reason): Delete.
(struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
* linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2015-03-04 Yao Qi <yao.qi@linaro.org>
* Makefile.in (SFILES): Add linux-aarch64-low.c.
2015-03-03 Gary Benson <gbenson@redhat.com>
* hostio.c (handle_vFile): Fix prefix lengths.
2015-03-03 Markus Metzger <markus.t.metzger@intel.com>
* linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
ptr_bits.
2015-03-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
* Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
(s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
(clean): Add "rm -f" for above C files.
* configure.srv (srv_regobj): Add s390-vx-linux64.o,
s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
(srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
* linux-s390-low.c (HWCAP_S390_VX): New macro.
(init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
(init_registers_s390x_vx_linux64)
(init_registers_s390x_tevx_linux64)
(tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
(tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
declarations.
(s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
(s390_store_vxrs_high): New functions.
(s390_regsets): Add entries for NT_S390_VXRS_LOW and
NT_S390_VXRS_HIGH.
(s390_arch_setup): Add logic for selecting one of the new target
descriptions. Activate the new vector regsets if applicable.
(initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
and init_registers_s390x_tevx_linux64.
2015-03-01 Pedro Alves <palves@redhat.com>
* linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
parameter.
2015-02-27 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (u_debugreg_offset): New function.
(x86_linux_dr_get, x86_linux_dr_set): Use it.
2015-02-27 Pedro Alves <palves@redhat.com>
* gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
[!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
[!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
(ps_lsetfpregs, ps_getpid)
(ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
(ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
(ps_lsetxregs, ps_plog): Declare.
Make functions and variables exported by the IPA be extern "C" Functions and variables that are exported by the IPA DSO (that GDBserver needs to look up) should have "C" mangling, thus be declared with extern "C". Function and variable declarations need the extern "C" marker, but variable definitions can't be marked extern, so the patch splits IP_AGENT_EXPORT into three. Building in C++ mode revealed that a few variables were missing IP_AGENT_EXPORT, thus the IPA has been broken when stripped, even in C mode... So this ends being a bug fix as well. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * common/agent.h (IPA_SYM_EXPORTED_NAME): New. (IPA_SYM): Use it. * common/common-defs.h (EXTERN_C_PUSH, EXTERN_C_POP): New macros. gdb/gdbserver/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use IP_AGENT_EXPORT_FUNC. * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use IP_AGENT_EXPORT_FUNC. * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR) (IP_AGENT_EXPORT): Delete. (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) (gdb_trampoline_buffer, gdb_trampoline_buffer_end) (gdb_trampoline_buffer_error, collecting, gdb_collect) (stop_tracing, flush_trace_buffer, about_to_request_buffer_space) (trace_buffer_is_full, stopping_tracepoint, expr_eval_result) (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl) (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi) (traceframe_read_count, traceframe_write_count) (traceframes_created, trace_state_variables, get_raw_reg) (get_trace_state_variable_value, set_trace_state_variable_value) (ust_loaded, helper_thread_id, cmd_buf): Use IPA_SYM_EXPORTED_NAME. (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC. (tracepoints) Use IP_AGENT_EXPORT_VAR. (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (last_tracepoint): Move into !IN_PROCESS_AGENT block. (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (trace_state_variables): Use IP_AGENT_EXPORT_VAR. (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (trace_buffer_ctrl, trace_buffer_ctrl_curr) (traceframe_write_count, traceframe_read_count) (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR. (about_to_request_buffer_space, get_trace_state_variable_value) (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC. (collecting): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (gdb_collect): Use IP_AGENT_EXPORT_FUNC. (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR. (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) (gdb_trampoline_buffer, gdb_trampoline_buffer_end) (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR. * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL): Define. (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR) (IP_AGENT_EXPORT_VAR_DECL): Define. (tracing): Declare. (gdb_agent_get_raw_reg): Declare.
2015-02-09 15:59:08 +01:00
2015-02-27 Pedro Alves <palves@redhat.com>
* linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
IP_AGENT_EXPORT_FUNC.
* linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
IP_AGENT_EXPORT_FUNC.
* tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
(IP_AGENT_EXPORT): Delete.
(gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
(gdb_trampoline_buffer, gdb_trampoline_buffer_end)
(gdb_trampoline_buffer_error, collecting, gdb_collect)
(stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
(trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
(error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
(trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
(traceframe_read_count, traceframe_write_count)
(traceframes_created, trace_state_variables, get_raw_reg)
(get_trace_state_variable_value, set_trace_state_variable_value)
(ust_loaded, helper_thread_id, cmd_buf): Use
IPA_SYM_EXPORTED_NAME.
(stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
(tracepoints) Use IP_AGENT_EXPORT_VAR.
(stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
(last_tracepoint): Move into !IN_PROCESS_AGENT block.
(error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
EXTERN_C_PUSH/EXTERN_C_POP.
(trace_state_variables): Use IP_AGENT_EXPORT_VAR.
(trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
wrap in EXTERN_C_PUSH/EXTERN_C_POP.
(trace_buffer_ctrl, trace_buffer_ctrl_curr)
(traceframe_write_count, traceframe_read_count)
(traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
(about_to_request_buffer_space, get_trace_state_variable_value)
(set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
(collecting): Use IP_AGENT_EXPORT_VAR and wrap in
EXTERN_C_PUSH/EXTERN_C_POP.
(gdb_collect): Use IP_AGENT_EXPORT_FUNC.
(ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
(helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
(gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
(gdb_trampoline_buffer, gdb_trampoline_buffer_end)
(gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
* tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
Define.
(IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
(IP_AGENT_EXPORT_VAR_DECL): Define.
(tracing): Declare.
(gdb_agent_get_raw_reg): Declare.
2015-02-27 Tom Tromey <tromey@redhat.com>
Pedro Alves <palves@redhat.com>
Rename symbols whose names are reserved C++ keywords throughout.
Add --enable-build-with-cxx configure switch This new option, disabled by default for now, allows specifying whether to build GDB, GDBserver, and friends with a C++ (98/03) compiler. The name of the switch should be familiar to those who followed GCC's own C++ conversion process. . Adding -fpermissive to COMPILER in C++ mode (see the new build-with-cxx.m4 file) makes errors like these be warnings instead: gdb/infrun.c:6597:1: error: initializing argument 1 of ‘void sig_print_info(gdb_signal)’ [-fpermissive] sig_print_info (enum gdb_signal oursig) ^ gdb/infrun.c: In function ‘void do_restore_infcall_suspend_state_cleanup(void*)’: gdb/infrun.c:7164:39: error: invalid conversion from ‘void*’ to ‘infcall_suspend_state*’ [-fpermissive] restore_infcall_suspend_state (state); ^ so that the compiler carries on compiling the file. -Werror still catches the warnings, so nothing is lost, only our lifes are made easier by concentrating on getting other more important things out of the way first. There's no way to quiet those warnings. Until they're all fixed, when building in C++ mode, -Werror is disabled by default. . Adding -Wno-narrowing suppresses thousands of instances of this warning: gdb/arm-linux-tdep.c:439:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing] gdb/arm-linux-tdep.c:439:1: error: narrowing conversion of ‘-1l’ from ‘LONGEST {aka long int}’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing] gdb/arm-linux-tdep.c:450:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing] We can defer handling those until we target C++11. . Adding -Wno-sign-compare suppresses thousands of instances of this warning: gdb/linux-record.c:1763:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (tmpulongest == tdep->fcntl_F_GETLK64) ^ . Adding -Wno-write-strings suppresses thousands of instances of this warning: gdb/mi/mi-cmd-var.c: In function ‘void mi_cmd_var_show_attributes(char*, char**, int)’: gdb/mi/mi-cmd-var.c:514:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] attstr = "editable"; ^ gdb/mi/mi-cmd-var.c:516:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] attstr = "noneditable"; ^ For now, it's best to hide these warnings from view until we're '-fpermissive'-clean, and can thus start building with -Werror. The C compiler has always managed to build working GDBs with these issues in the code, so a C++ compiler should too. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * Makefile.in (COMPILER): New, get it from autoconf. (COMPILE.pre, CC_LD): Use COMPILER. (CXX): Get from autoconf instead. (CXX_FOR_TARGET): Default to g++ instead of gcc. * acinclude.m4: Include build-with-cxx.m4. * build-with-cxx.m4: New file. * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX. Disable -Werror by default if building in C++ mode. (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and -Wno-narrowing in C++ mode. Only enable -Wpointer-sign in C mode. Run supported-warning-flags tests with the C++ compiler. Save/restore CXXFLAGS too. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * Makefile.in (COMPILER): New, get it from autoconf. (CXX): Get from autoconf instead. (COMPILE.pre): Use COMPILER. (CC-LD): Rename to ... (CC_LD): ... this. Use COMPILER. (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust. (CXX_FOR_TARGET): Default to g++ instead of gcc. * acinclude.m4: Include build-with-cxx.m4. * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX. Disable -Werror by default if building in C++ mode. (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and -Wno-narrowing in C++ mode. Run supported-warning-flags tests with the C++ compiler. Save/restore CXXFLAGS too. * configure: Regenerate.
2015-02-27 14:11:25 +01:00
2015-02-27 Pedro Alves <palves@redhat.com>
* Makefile.in (COMPILER): New, get it from autoconf.
(CXX): Get from autoconf instead.
(COMPILE.pre): Use COMPILER.
(CC-LD): Rename to ...
(CC_LD): ... this. Use COMPILER.
(gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
(CXX_FOR_TARGET): Default to g++ instead of gcc.
* acinclude.m4: Include build-with-cxx.m4.
* configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
Disable -Werror by default if building in C++ mode.
(build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
-Wno-narrowing in C++ mode. Run supported-warning-flags tests with
the C++ compiler. Save/restore CXXFLAGS too.
* configure: Regenerate.
2015-02-27 Pedro Alves <palves@redhat.com>
* acinclude.m4: Include libiberty.m4.
* configure.ac: Call libiberty_INIT.
* config.in, configure: Regenerate.
2015-02-26 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_wait_1): When incrementing the PC past a
program breakpoint always use the_low_target.breakpoint_len as
increment, rather than the maximum between that and
the_low_target.decr_pc_after_break.
2015-02-23 Pedro Alves <palves@redhat.com>
* linux-low.c (check_stopped_by_breakpoint): Don't check if the
thread was doing a step-over; always adjust the PC if
we stepped over a permanent breakpoint.
(linux_wait_1): If we stepped over breakpoint that was on top of a
permanent breakpoint, manually advance the PC past it.
gdbserver: 64-bit kernel / 32-inferior, syscall restarting $ make check RUNTESTFLAGS="--target_board=native-gdbserver/-m32 clone-thread_db.exp" gdb.log shows: Running target native-gdbserver/-m32 ... clone-thread_db: src/gdb/testsuite/gdb.threads/clone-thread_db.c:57: thread_fn: Assertion `res != -1' failed. ... (gdb) FAIL: gdb.threads/clone-thread_db.exp: continue to end That was waitpid returning -1 / EINTR. We don't see that when testing with unix/-m32 (native debugging). Turns out to be that when debugging a 32-bit inferior, a 64-bit GDBserver is reading/writing $orig_eax from/to the wrong ptrace register buffer offset. When gdbserver is 64-bit, the ptrace register buffer is in 64-bit layout, so the register is found at "ORIG_EAX * 8", not at "ORIG_EAX * 4". Fixes these with --target_board=native-gdbserver/-m32 on x86_64 Fedora 20: -FAIL: gdb.threads/clone-thread_db.exp: continue to end +PASS: gdb.threads/clone-thread_db.exp: continue to end -FAIL: gdb.threads/hand-call-in-threads.exp: all dummies popped +PASS: gdb.threads/hand-call-in-threads.exp: all dummies popped PASS: gdb.threads/hand-call-in-threads.exp: breakpoint on all_threads_running PASS: gdb.threads/hand-call-in-threads.exp: breakpoint on hand_call PASS: gdb.threads/hand-call-in-threads.exp: disable scheduler locking @@ -29339,15 +29331,15 @@ PASS: gdb.threads/hand-call-in-threads.e PASS: gdb.threads/hand-call-in-threads.exp: discard hand call, thread 4 PASS: gdb.threads/hand-call-in-threads.exp: discard hand call, thread 5 PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 1 -FAIL: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 2 -FAIL: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 3 -FAIL: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 4 +PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 2 +PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 3 +PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 4 PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 5 PASS: gdb.threads/hand-call-in-threads.exp: enable scheduler locking PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 1 -FAIL: gdb.threads/hand-call-in-threads.exp: hand call, thread 2 -FAIL: gdb.threads/hand-call-in-threads.exp: hand call, thread 3 -FAIL: gdb.threads/hand-call-in-threads.exp: hand call, thread 4 +PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 2 +PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 3 +PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 4 PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 5 PASS: gdb.threads/hand-call-in-threads.exp: prepare to discard hand call, thread 1 PASS: gdb.threads/hand-call-in-threads.exp: prepare to discard hand call, thread 2 gdb/gdbserver/ChangeLog 2015-02-23 Pedro Alves <palves@redhat.com> * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit modes. (x86_fill_gregset, x86_store_gregset): Use it when handling $orig_eax.
2015-02-23 14:03:10 +01:00
2015-02-23 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
modes.
(x86_fill_gregset, x86_store_gregset): Use it when handling
$orig_eax.
GNU/Linux: Stop using libthread_db/td_ta_thr_iter TL;DR - GDB can hang if something refreshes the thread list out of the target while the target is running. GDB hangs inside td_ta_thr_iter. The fix is to not use that libthread_db function anymore. Long version: Running the testsuite against my all-stop-on-top-of-non-stop series is still exposing latent non-stop bugs. I was originally seeing this with the multi-create.exp test, back when we were still using libthread_db thread event breakpoints. The all-stop-on-top-of-non-stop series forces a thread list refresh each time GDB needs to start stepping over a breakpoint (to pause all threads). That test hits the thread event breakpoint often, resulting in a bunch of step-over operations, thus a bunch of thread list refreshes while some threads in the target are running. The commit adds a real non-stop mode test that triggers the issue, based on multi-create.exp, that does an explicit "info threads" when a breakpoint is hit. IOW, it does the same things the as-ns series was doing when testing multi-create.exp. The bug is a race, so it unfortunately takes several runs for the test to trigger it. In fact, even when setting the test running in a loop, it sometimes takes several minutes for it to trigger for me. The race is related to libthread_db's td_ta_thr_iter. This is libthread_db's entry point for walking the thread list of the inferior. Sometimes, when GDB refreshes the thread list from the target, libthread_db's td_ta_thr_iter can somehow see glibc's thread list as a cycle, and get stuck in an infinite loop. The issue is that when a thread exits, its thread control structure in glibc is moved from a "used" list to a "cache" list. These lists are simply circular linked lists where the "next/prev" pointers are embedded in the thread control structure itself. The "next" pointer of the last element of the list points back to the list's sentinel "head". There's only one set of "next/prev" pointers for both lists; thus a thread can only be in one of the lists at a time, not in both simultaneously. So when thread C exits, simplifying, the following happens. A-C are threads. stack_used and stack_cache are the list's heads. Before: stack_used -> A -> B -> C -> (&stack_used) stack_cache -> (&stack_cache) After: stack_used -> A -> B -> (&stack_used) stack_cache -> C -> (&stack_cache) td_ta_thr_iter starts by iterating at the list's head's next, and iterates until it sees a thread whose next pointer points to the list's head again. Thus in the before case above, C's next points to stack_used, indicating end of list. In the same case, the stack_cache list is empty. For each thread being iterated, td_ta_thr_iter reads the whole thread object out of the inferior. This includes the thread's "next" pointer. In the scenario above, it may happen that td_ta_thr_iter is iterating thread B and has already read B's thread structure just before thread C exits and its control structure moves to the cached list. Now, recall that td_ta_thr_iter is running in the context of GDB, and there's no locking between GDB and the inferior. From it's local copy of B, td_ta_thr_iter believes that the next thread after B is thread C, so it happilly continues iterating to C, a thread that has already exited, and is now in the stack cache list. After iterating C, td_ta_thr_iter finds the stack_cache head, which because it is not stack_used, td_ta_thr_iter assumes it's just another thread. After this, unless the reverse race triggers, GDB gets stuck in td_ta_thr_iter forever walking the stack_cache list, as no thread in thatlist has a next pointer that points back to stack_used (the terminating condition). Before fully understanding the issue, I tried adding cycle detection to GDB's td_ta_thr_iter callback. However, td_ta_thr_iter skips calling the callback in some cases, which means that it's possible that the callback isn't called at all, making it impossible for GDB to break the loop. I did manage to get GDB stuck in that state more than once. Fortunately, we can avoid the issue altogether. We don't really need td_ta_thr_iter for live debugging nowadays, given PTRACE_EVENT_CLONE. We already know how to map and lwp id to a thread id without iterating (thread_from_lwp), so use that more. gdb/ChangeLog: 2015-02-20 Pedro Alves <palves@redhat.com> * linux-nat.c (linux_handle_extended_wait): Call thread_db_notice_clone whenever a new clone LWP is detected. (linux_stop_and_wait_all_lwps, linux_unstop_all_lwps): New functions. * linux-nat.h (thread_db_attach_lwp): Delete declaration. (thread_db_notice_clone, linux_stop_and_wait_all_lwps) (linux_unstop_all_lwps): Declare. * linux-thread-db.c (struct thread_get_info_inout): Delete. (thread_get_info_callback): Delete. (thread_from_lwp): Use td_thr_get_info and record_thread. (thread_db_attach_lwp): Delete. (thread_db_notice_clone): New function. (try_thread_db_load_1): If /proc is mounted and shows the process'es task list, walk over all LWPs and call thread_from_lwp instead of relying on td_ta_thr_iter. (attach_thread): Don't call check_thread_signals here. Split the tail part of the function (which adds the thread to the core GDB thread list) to ... (record_thread): ... this function. Call check_thread_signals here. (thread_db_wait): Don't call thread_db_find_new_threads_1. Always call thread_from_lwp. (thread_db_update_thread_list): Rename to ... (thread_db_update_thread_list_org): ... this. (thread_db_update_thread_list): New function. (thread_db_find_thread_from_tid): Delete. (thread_db_get_ada_task_ptid): Simplify. * nat/linux-procfs.c: Include <sys/stat.h>. (linux_proc_task_list_dir_exists): New function. * nat/linux-procfs.h (linux_proc_task_list_dir_exists): Declare. gdb/gdbserver/ChangeLog: 2015-02-20 Pedro Alves <palves@redhat.com> * thread-db.c: Include "nat/linux-procfs.h". (thread_db_init): Skip listing new threads if the kernel supports PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible. gdb/testsuite/ChangeLog: 2015-02-20 Pedro Alves <palves@redhat.com> * gdb.threads/multi-create-ns-info-thr.exp: New file.
2015-02-20 21:21:59 +01:00
2015-02-20 Pedro Alves <palves@redhat.com>
* thread-db.c: Include "nat/linux-procfs.h".
(thread_db_init): Skip listing new threads if the kernel supports
PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
2015-02-20 Pedro Alves <palves@redhat.com>
* linux-low.c (status_pending_p_callback): Use ptid_match.
2015-02-12 20:55:08 +01:00
2015-02-19 Antoine Tremblay <antoine.tremblay@ericsson.com>
PR breakpoints/16812
* linux-low.c (wstatus_maybe_breakpoint): Remove.
(linux_low_filter_event): Update wstatus_maybe_breakpoint name.
(linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
2015-02-10 Antoine Tremblay <antoine.tremblay@ericsson.com>
PR breakpoints/15956
* tracepoint.c (cmd_qtinit): Add check for current_thread.
record-btrace: add bts buffer size configuration option Allow the size of the branch trace ring buffer to be defined by the user. The specified buffer size will be used when BTS tracing is enabled for new threads. The obtained buffer size may differ from the requested size. The actual buffer size for the current thread is shown in the "info record" command. Bigger buffers mean longer traces, but also longer processing time. 2015-02-09 Markus Metzger <markus.t.metzger@intel.com> * btrace.c (parse_xml_btrace_conf_bts): Add size. (btrace_conf_bts_attributes): New. (btrace_conf_children): Add attributes. * common/btrace-common.h (btrace_config_bts): New. (btrace_config)<bts>: New. (btrace_config): Update comment. * nat/linux-btrace.c (linux_enable_btrace, linux_enable_bts): Use config. * features/btrace-conf.dtd: Increment version. Add size attribute to bts element. * record-btrace.c (set_record_btrace_bts_cmdlist, show_record_btrace_bts_cmdlist): New. (record_btrace_adjust_size, record_btrace_print_bts_conf, record_btrace_print_conf, cmd_set_record_btrace_bts, cmd_show_record_btrace_bts): New. (record_btrace_info): Call record_btrace_print_conf. (_initialize_record_btrace): Add commands. * remote.c: Add PACKET_Qbtrace_conf_bts_size enum. (remote_protocol_features): Add Qbtrace-conf:bts:size packet. (btrace_sync_conf): Synchronize bts size. (_initialize_remote): Add Qbtrace-conf:bts:size packet. * NEWS: Announce new commands and new packets. doc/ * gdb.texinfo (Branch Trace Configuration Format): Add size. (Process Record and Replay): Describe new set|show commands. (General Query Packets): Describe Qbtrace-conf:bts:size packet. testsuite/ * gdb.btrace/buffer-size: New. gdbserver/ * linux-low.c (linux_low_btrace_conf): Print size. * server.c (handle_btrace_conf_general_set): New. (hanle_general_set): Call handle_btrace_conf_general_set. (handle_query): Report Qbtrace-conf:bts:size as supported.
2013-11-28 16:39:12 +01:00
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
* linux-low.c (linux_low_btrace_conf): Print size.
* server.c (handle_btrace_conf_general_set): New.
(hanle_general_set): Call handle_btrace_conf_general_set.
(handle_query): Report Qbtrace-conf:bts:size as supported.
record btrace: add configuration struct Add a struct to describe the branch trace configuration and use it for enabling branch tracing. The user will be able to set configuration fields for each tracing format to be used for new threads. The actual configuration that is active for a given thread will be shown in the "info record" command. At the moment, the configuration struct only contains a format field that is set to the only available format. The format is the only configuration option that can not be set via set commands. It is given as argument to the "record btrace" command when starting recording. 2015-02-09 Markus Metzger <markus.t.metzger@intel.com> * Makefile.in (XMLFILES): Add btrace-conf.dtd. * x86-linux-nat.c (x86_linux_enable_btrace): Update parameters. (x86_linux_btrace_conf): New. (x86_linux_create_target): Initialize to_btrace_conf. * nat/linux-btrace.c (linux_enable_btrace): Update parameters. Check format. Split into this and ... (linux_enable_bts): ... this. (linux_btrace_conf): New. (perf_event_skip_record): Renamed into ... (perf_event_skip_bts_record): ... this. Updated users. (linux_disable_btrace): Split into this and ... (linux_disable_bts): ... this. (linux_read_btrace): Check format. * nat/linux-btrace.h (linux_enable_btrace): Update parameters. (linux_btrace_conf): New. (btrace_target_info)<ptid>: Moved. (btrace_target_info)<conf>: New. (btrace_target_info): Split into this and ... (btrace_tinfo_bts): ... this. Updated users. * btrace.c (btrace_enable): Update parameters. (btrace_conf, parse_xml_btrace_conf_bts, parse_xml_btrace_conf) (btrace_conf_children, btrace_conf_attributes) (btrace_conf_elements): New. * btrace.h (btrace_enable): Update parameters. (btrace_conf, parse_xml_btrace_conf): New. * common/btrace-common.h (btrace_config): New. * feature/btrace-conf.dtd: New. * record-btrace.c (record_btrace_conf): New. (record_btrace_cmdlist): New. (record_btrace_enable_warn, record_btrace_open): Pass &record_btrace_conf. (record_btrace_info): Print recording format. (cmd_record_btrace_bts_start): New. (cmd_record_btrace_start): Call cmd_record_btrace_bts_start. (_initialize_record_btrace): Add "record btrace bts" subcommand. Add "record bts" alias command. * remote.c (remote_state)<btrace_config>: New. (remote_btrace_reset, PACKET_qXfer_btrace_conf): New. (remote_protocol_features): Add qXfer:btrace-conf:read. (remote_open_1): Call remote_btrace_reset. (remote_xfer_partial): Handle TARGET_OBJECT_BTRACE_CONF. (btrace_target_info)<conf>: New. (btrace_sync_conf, btrace_read_config): New. (remote_enable_btrace): Update parameters. Call btrace_sync_conf and btrace_read_conf. (remote_btrace_conf): New. (init_remote_ops): Initialize to_btrace_conf. (_initialize_remote): Add qXfer:btrace-conf packet. * target.c (target_enable_btrace): Update parameters. (target_btrace_conf): New. * target.h (target_enable_btrace): Update parameters. (target_btrace_conf): New. (target_object)<TARGET_OBJECT_BTRACE_CONF>: New. (target_ops)<to_enable_btrace>: Update parameters and comment. (target_ops)<to_btrace_conf>: New. * target-delegates: Regenerate. * target-debug.h (target_debug_print_const_struct_btrace_config_p) (target_debug_print_const_struct_btrace_target_info_p): New. NEWS: Announce new command and new packet. doc/ * gdb.texinfo (Process Record and Replay): Describe the "record btrace bts" command. (General Query Packets): Describe qXfer:btrace-conf:read packet. (Branch Trace Configuration Format): New. gdbserver/ * linux-low.c (linux_low_enable_btrace): Update parameters. (linux_low_btrace_conf): New. (linux_target_ops)<to_btrace_conf>: Initialize. * server.c (current_btrace_conf): New. (handle_btrace_enable): Rename to ... (handle_btrace_enable_bts): ... this. Pass &current_btrace_conf to target_enable_btrace. Update comment. Update users. (handle_qxfer_btrace_conf): New. (qxfer_packets): Add btrace-conf entry. (handle_query): Report qXfer:btrace-conf:read as supported packet. * target.h (target_ops)<enable_btrace>: Update parameters and comment. (target_ops)<read_btrace_conf>: New. (target_enable_btrace): Update parameters. (target_read_btrace_conf): New. testsuite/ * gdb.btrace/delta.exp: Update "info record" output. * gdb.btrace/enable.exp: Update "info record" output. * gdb.btrace/finish.exp: Update "info record" output. * gdb.btrace/instruction_history.exp: Update "info record" output. * gdb.btrace/next.exp: Update "info record" output. * gdb.btrace/nexti.exp: Update "info record" output. * gdb.btrace/step.exp: Update "info record" output. * gdb.btrace/stepi.exp: Update "info record" output. * gdb.btrace/nohist.exp: Update "info record" output.
2013-11-28 15:44:13 +01:00
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
* linux-low.c (linux_low_enable_btrace): Update parameters.
(linux_low_btrace_conf): New.
(linux_target_ops)<to_btrace_conf>: Initialize.
* server.c (current_btrace_conf): New.
(handle_btrace_enable): Rename to ...
(handle_btrace_enable_bts): ... this. Pass &current_btrace_conf
to target_enable_btrace. Update comment. Update users.
(handle_qxfer_btrace_conf): New.
(qxfer_packets): Add btrace-conf entry.
(handle_query): Report qXfer:btrace-conf:read as supported packet.
* target.h (target_ops)<enable_btrace>: Update parameters and comment.
(target_ops)<read_btrace_conf>: New.
(target_enable_btrace): Update parameters.
(target_read_btrace_conf): New.
btrace: add format argument to supports_btrace Add a format argument to the various supports_btrace functions to check for support of a specific btrace format. This is to prepare for a new format. Removed two redundant calls. The check will be made in the subsequent btrace_enable call. 2015-02-09 Markus Metzger <markus.t.metzger@intel.com> * btrace.c (btrace_enable): Pass BTRACE_FORMAT_BTS. * record-btrace.c (record_btrace_open): Remove call to target_supports_btrace. * remote.c (remote_supports_btrace): Update parameters. * target.c (target_supports_btrace): Update parameters. * target.h (to_supports_btrace, target_supports_btrace): Update parameters. * target-delegates.c: Regenerate. * target-debug.h (target_debug_print_enum_btrace_format): New. * nat/linux-btrace.c (kernel_supports_btrace): Rename into ... (kernel_supports_bts): ... this. Update users. Update warning text. (intel_supports_btrace): Rename into ... (intel_supports_bts): ... this. Update users. (cpu_supports_btrace): Rename into ... (cpu_supports_bts): ... this. Update users. (linux_supports_btrace): Update parameters. Split into this and ... (linux_supports_bts): ... this. * nat/linux-btrace.h (linux_supports_btrace): Update parameters. gdbserver/ * server.c (handle_btrace_general_set): Remove call to target_supports_btrace. (supported_btrace_packets): New. (handle_query): Call supported_btrace_packets. * target.h: include btrace-common.h. (btrace_target_info): Removed. (supports_btrace, target_supports_btrace): Update parameters.
2014-01-17 13:29:19 +01:00
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
* server.c (handle_btrace_general_set): Remove call to
target_supports_btrace.
(supported_btrace_packets): New.
(handle_query): Call supported_btrace_packets.
* target.h: include btrace-common.h.
(btrace_target_info): Removed.
(supports_btrace, target_supports_btrace): Update parameters.
btrace: add struct btrace_data Add a structure to hold the branch trace data and an enum to describe the format of that data. So far, only BTS is supported. Also added a NONE format to indicate that no branch trace data is available. This will make it easier to support different branch trace formats in the future. 2015-02-09 Markus Metzger <markus.t.metzger@intel.com> * Makefile.in (SFILES): Add common/btrace-common.c. (COMMON_OBS): Add common/btrace-common.o. (btrace-common.o): Add build rules. * btrace.c (parse_xml_btrace): Update parameters. (parse_xml_btrace_block): Set format field. (btrace_add_pc, btrace_fetch): Use struct btrace_data. (do_btrace_data_cleanup, make_cleanup_btrace_data): New. (btrace_compute_ftrace): Split into this and... (btrace_compute_ftrace_bts): ...this. (btrace_stitch_trace): Split into this and... (btrace_stitch_bts): ...this. * btrace.h (parse_xml_btrace): Update parameters. (make_cleanup_btrace_data): New. * common/btrace-common.c: New. * common/btrace-common.h: Include common-defs.h. (btrace_block_s): Update comment. (btrace_format): New. (btrace_format_string): New. (btrace_data_bts): New. (btrace_data): New. (btrace_data_init, btrace_data_fini, btrace_data_empty): New. * remote.c (remote_read_btrace): Update parameters. * target.c (target_read_btrace): Update parameters. * target.h (target_read_btrace): Update parameters. (target_ops)<to_read_btrace>: Update parameters. * x86-linux-nat.c (x86_linux_read_btrace): Update parameters. * target-delegates.c: Regenerate. * target-debug (target_debug_print_struct_btrace_data_p): New. * nat/linux-btrace.c (linux_read_btrace): Split into this and... (linux_read_bts): ...this. * nat/linux-btrace.h (linux_read_btrace): Update parameters. gdbserver/ * Makefile.in (SFILES): Add common/btrace-common.c. (OBS): Add common/btrace-common.o. (btrace-common.o): Add build rules. * linux-low: Include btrace-common.h. (linux_low_read_btrace): Use struct btrace_data. Call btrace_data_init and btrace_data_fini.
2013-11-13 15:31:07 +01:00
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
* Makefile.in (SFILES): Add common/btrace-common.c.
(OBS): Add common/btrace-common.o.
(btrace-common.o): Add build rules.
* linux-low: Include btrace-common.h.
(linux_low_read_btrace): Use struct btrace_data. Call
btrace_data_init and btrace_data_fini.
2015-02-06 Pedro Alves <palves@redhat.com>
* thread-db.c (find_new_threads_callback): Add debug output.
Linux: don't resume new LWPs until we've pulled all events out of the kernel Since the starvation avoidance series (https://sourceware.org/ml/gdb-patches/2014-12/msg00631.html), both GDB and GDBserver pull all events out of ptrace before deciding which event to process. There's one problem with that though. Because we resume new threads immediately when we see a PTRACE_EVENT_CLONE event, if the program constantly spawns threads fast enough, new threads can spawn threads faster we can pull events out of the kernel, and thus we'd get stuck in an infinite loop, never returning any event to the core to process. I occasionally see this happen with the attach-many-short-lived-threads.exp test against gdbserver. The fix is to delay resuming new threads until we've pulled out all events out of the kernel. On native, we already have the resume_stopped_resumed_lwps function that knows to resume LWPs that are stopped with no event to report to the core. So the patch just adds another use. GDBserver didn't have the equivalent yet, so the patch adds one. Tested on x86_64 Fedora 20, native and gdbserver (remote and extended-remote). gdb/gdbserver/ChangeLog: 2015-02-04 Pedro Alves <palves@redhat.com> * linux-low.c (handle_extended_wait): Don't resume LWPs here. (resume_stopped_resumed_lwps): New function. (linux_wait_for_event_filtered): Use it. gdb/ChangeLog: 2015-02-04 Pedro Alves <palves@redhat.com> * linux-nat.c (handle_extended_wait): Don't resume LWPs here. (wait_lwp): Don't call wait_lwp if linux_handle_extended_wait returns true. (resume_stopped_resumed_lwps): Don't check whether the thread is marked as executing. (linux_nat_wait_1): Use resume_stopped_resumed_lwps.
2015-02-04 19:13:28 +01:00
2015-02-04 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Don't resume LWPs here.
(resume_stopped_resumed_lwps): New function.
(linux_wait_for_event_filtered): Use it.
Move code to disable ASR to nat/ This patch moves the shared code present on gdb/linux-nat.c:linux_nat_create_inferior and gdb/gdbserver/linux-low.c:linux_create_inferior to nat/linux-personality.c. This code is responsible for disabling address space randomization based on user setting, and using <sys/personality.h> to do that. I decided to put the prototype of the maybe_disable_address_space_randomization on nat/linux-osdata.h because it seemed the best place to put it. I regression-tested this patch on Fedora 20 x86_64, and found no regressions. gdb/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-personality.h. (linux-personality.o): New rule. * common/common-defs.h: Include <stdint.h>. * config/aarch64/linux.mh (NATDEPFILES): Include linux-personality.o. * config/alpha/alpha-linux.mh (NATDEPFILES): Likewise. * config/arm/linux.mh (NATDEPFILES): Likewise. * config/i386/linux64.mh (NATDEPFILES): Likewise. * config/i386/linux.mh (NATDEPFILES): Likewise. * config/ia64/linux.mh (NATDEPFILES): Likewise. * config/m32r/linux.mh (NATDEPFILES): Likewise. * config/m68k/linux.mh (NATDEPFILES): Likewise. * config/mips/linux.mh (NATDEPFILES): Likewise. * config/pa/linux.mh (NATDEPFILES): Likewise. * config/powerpc/linux.mh (NATDEPFILES): Likewise. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise. * config/powerpc/spu-linux.mh (NATDEPFILES): Likewise. * config/s390/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/tilegx/linux.mh (NATDEPFILES): Likewise. * config/xtensa/linux.mh (NATDEPFILES): Likewise. * defs.h: Remove #include <stdint.h> (moved to common/common-defs.h). * linux-nat.c: Include nat/linux-personality.h. Remove #include <sys/personality.h>; do not define ADDR_NO_RANDOMIZE (moved to nat/linux-personality.c). (linux_nat_create_inferior): Remove code to disable address space randomization (moved to nat/linux-personality.c). Create cleanup to disable address space randomization. * nat/linux-personality.c: New file. * nat/linux-personality.h: Likewise. gdb/gdbserver/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add linux-personality.c. (linux-personality.o): New rule. * configure.srv (srv_linux_obj): Add linux-personality.o to the list of objects to be built. * linux-low.c: Include nat/linux-personality.h. (linux_create_inferior): Remove code to disable address space randomization (moved to ../nat/linux-personality.c). Create cleanup to disable address space randomization.
2015-01-15 21:10:49 +01:00
2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (SFILES): Add linux-personality.c.
(linux-personality.o): New rule.
* configure.srv (srv_linux_obj): Add linux-personality.o to the
list of objects to be built.
* linux-low.c: Include nat/linux-personality.h.
(linux_create_inferior): Remove code to disable address space
randomization (moved to ../nat/linux-personality.c). Create
cleanup to disable address space randomization.
Move safe_strerror to common/ This patch moves safe_strerror from the gdb/{posix,mingw}-hdep.c files to the respective common/{posix,mingw}-strerror.c files. This is a preparation for the next patch, which shares a common code (to disable address space randomization when creating a new inferior). The patch has been regtested on Fedora 20 x86_64, and no regressions were found. gdb/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (ALLDEPFILES): Including common/mingw-strerror.c and common/posix-strerror.c. (posix-strerror.o): New rule. (mingw-strerror.o): Likewise. * common/common-utils.h (safe_strerror): Move prototype to here, from utils.h. * common/common.host: New file. * common/mingw-strerror.c: Likewise. * common/posix-strerror.c: Likewise. * configure: Regenerated. * configure.ac: Source common/common.host. Add variable common_host_obs to gdb_host_obs. * contrib/ari/gdb_ari.sh: Mention gdb/common/mingw-strerror.c and gdb/common/posix-strerror.c when warning about the use of strerror. * mingw-hdep.c (safe_strerror): Remove definition; move it to common/mingw-strerror.c. * posix-hdep.c (safe_strerror): Remove definition; move it to common/posix-hdep.c. * utils.h (safe_strerror): Remove prototype; move to common/common-utils.h. gdb/gdbserver/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (posix-strerror.o): New rule. (mingw-strerror.o): Likewise. * configure: Regenerated. * configure.ac: Source file ../common/common.host. Initialize new variable srv_host_obs. Add srv_host_obs to GDBSERVER_DEPFILES.
2015-01-15 21:09:15 +01:00
2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (posix-strerror.o): New rule.
(mingw-strerror.o): Likewise.
* configure: Regenerated.
* configure.ac: Source file ../common/common.host. Initialize new
variable srv_host_obs. Add srv_host_obs to GDBSERVER_DEPFILES.
Detect 64-bit-ness in PowerPC Book III-E This patch is to teach both GDB and GDBServer to detect 64-bit inferior correctly. We find a problem that GDBServer is unable to detect on a e5500 core processor. Current GDBServer assumes that MSR is a 64-bit register, but MSR is a 32-bit register in Book III-E. This patch is to fix this problem by checking the right bit in MSR, in order to handle both Book III-S and Book III-E. In order to detect Book III-S and Book III-E, we check the PPC_FEATURE_BOOKE from the host's HWCAP (by getauxval on glibc >= 2.16. If getauxval doesn't exist, we implement the fallback by parsing /proc/self/auxv), because it should an invariant on the same machine cross different processes. In order to share code, I add nat/ppc-linux.c for both GDB and GDBserver side. gdb: 2015-01-14 Yao Qi <yao@codesourcery.com> * Makefile.in (ppc-linux.o): New rule. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Add ppc-linux.o. * configure.ac: AC_CHECK_FUNCS(getauxval). * config.in: Re-generated. * configure: Re-generated. * nat/ppc-linux.h [__powerpc64__] (ppc64_64bit_inferior_p): Declare. * nat/ppc-linux.c: New file. * ppc-linux-nat.c (ppc_linux_target_wordsize) [__powerpc64__]: Call ppc64_64bit_inferior_p. gdb/gdbserver: 2015-01-14 Yao Qi <yao@codesourcery.com> * Makefile.in (SFILES): Add nat/ppc-linux.c. (ppc-linux.o): New rule. * configure.srv (powerpc*-*-linux*): Add ppc-linux.o. * configure.ac: AC_CHECK_FUNCS(getauxval). * config.in: Re-generated. * configure: Re-generated. * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call ppc64_64bit_inferior_p
2014-11-28 02:18:26 +01:00
2015-01-14 Yao Qi <yao@codesourcery.com>
* Makefile.in (SFILES): Add nat/ppc-linux.c.
(ppc-linux.o): New rule.
* configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
* configure.ac: AC_CHECK_FUNCS(getauxval).
* config.in: Re-generated.
* configure: Re-generated.
* linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
ppc64_64bit_inferior_p
2015-01-14 Yao Qi <yao@codesourcery.com>
* linux-ppc-low.c: Include "nat/ppc-linux.h".
(PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
(PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Likewise.
(PT_ORIG_R3, PT_TRAP): Likewise.
(PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
(PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
(PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
2015-01-10 Joel Brobecker <brobecker@adacore.com>
* i387-fp.c (i387_cache_to_xsave): In look over
num_avx512_zmmh_high_registers, replace use of struct i387_xsave
zmmh_low_space field by use of zmmh_high_space.
[gdbserver] linux-low.c: better starvation avoidance, handle non-stop mode too This patch applies the same starvation avoidance improvements of the previous patch to the Linux gdbserver side. Without this, the test added by the following commit (gdb.threads/non-stop-fair-events.exp) always fails with time outs. gdb/gdbserver/ 2015-01-09 Pedro Alves <palves@redhat.com> * linux-low.c (step_over_bkpt): Move higher up in the file. (handle_extended_wait): Don't store the stop_pc here. (get_stop_pc): Adjust comments and rename to ... (check_stopped_by_breakpoint): ... this. Record whether the LWP stopped for a software breakpoint or hardware breakpoint. (thread_still_has_status_pending_p): New function. (status_pending_p_callback): Use thread_still_has_status_pending_p. If the event is no longer interesting, resume the LWP. (handle_tracepoints): Add assert. (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call. (wstatus_maybe_breakpoint): New function. (cancel_breakpoint): Delete function. (check_stopped_by_watchpoint): New function, factored out from linux_low_filter_event. (lp_status_maybe_breakpoint): Delete function. (linux_low_filter_event): Remove filter_ptid argument. Leave thread group exits pending here. Store the LWP's stop PC. Always leave events pending. (linux_wait_for_event_filtered): Pull all events out of the kernel, and leave them all pending. (count_events_callback, select_event_lwp_callback): Consider all events. (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete. (select_event_lwp): Only give preference to the stepping LWP in all-stop mode. Adjust comments. (ignore_event): New function. (linux_wait_1): Delete 'retry' label. Use ignore_event. Remove references to cancel_breakpoints. Adjust to renames. Also give equal priority to all LWPs that have had events in non-stop mode. If reporting a software breakpoint event, unadjust the LWP's PC. (linux_wait): If linux_wait_1 returned an ignored event, retry. (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Adjust. (linux_resume_one_lwp): Store the LWP's PC. Adjust. (resume_status_pending_p): Use thread_still_has_status_pending_p. (linux_stopped_by_watchpoint): Adjust. (linux_target_ops): Remove reference to linux_cancel_breakpoints. * linux-low.h (enum lwp_stop_reason): New. (struct lwp_info) <stop_pc>: Adjust comment. <stopped_by_watchpoint>: Delete field. <stop_reason>: New field. * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust. * mem-break.c (software_breakpoint_inserted_here) (hardware_breakpoint_inserted_here): New function. * mem-break.h (software_breakpoint_inserted_here) (hardware_breakpoint_inserted_here): Declare. * target.h (struct target_ops) <cancel_breakpoints>: Remove field. (cancel_breakpoints): Delete. * tracepoint.c (clear_installed_tracepoints, stop_tracing) (upload_fast_traceframes): Remove references to cancel_breakpoints.
2014-12-29 20:41:07 +01:00
2015-01-09 Pedro Alves <palves@redhat.com>
* linux-low.c (step_over_bkpt): Move higher up in the file.
(handle_extended_wait): Don't store the stop_pc here.
(get_stop_pc): Adjust comments and rename to ...
(check_stopped_by_breakpoint): ... this. Record whether the LWP
stopped for a software breakpoint or hardware breakpoint.
(thread_still_has_status_pending_p): New function.
(status_pending_p_callback): Use
thread_still_has_status_pending_p. If the event is no longer
interesting, resume the LWP.
(handle_tracepoints): Add assert.
(maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
(wstatus_maybe_breakpoint): New function.
(cancel_breakpoint): Delete function.
(check_stopped_by_watchpoint): New function, factored out from
linux_low_filter_event.
(lp_status_maybe_breakpoint): Delete function.
(linux_low_filter_event): Remove filter_ptid argument.
Leave thread group exits pending here. Store the LWP's stop PC.
Always leave events pending.
(linux_wait_for_event_filtered): Pull all events out of the
kernel, and leave them all pending.
(count_events_callback, select_event_lwp_callback): Consider all
events.
(cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
(select_event_lwp): Only give preference to the stepping LWP in
all-stop mode. Adjust comments.
(ignore_event): New function.
(linux_wait_1): Delete 'retry' label. Use ignore_event. Remove
references to cancel_breakpoints. Adjust to renames. Also give
equal priority to all LWPs that have had events in non-stop mode.
If reporting a software breakpoint event, unadjust the LWP's PC.
(linux_wait): If linux_wait_1 returned an ignored event, retry.
(stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
Adjust.
(linux_resume_one_lwp): Store the LWP's PC. Adjust.
(resume_status_pending_p): Use thread_still_has_status_pending_p.
(linux_stopped_by_watchpoint): Adjust.
(linux_target_ops): Remove reference to linux_cancel_breakpoints.
* linux-low.h (enum lwp_stop_reason): New.
(struct lwp_info) <stop_pc>: Adjust comment.
<stopped_by_watchpoint>: Delete field.
<stop_reason>: New field.
* linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
* mem-break.c (software_breakpoint_inserted_here)
(hardware_breakpoint_inserted_here): New function.
* mem-break.h (software_breakpoint_inserted_here)
(hardware_breakpoint_inserted_here): Declare.
* target.h (struct target_ops) <cancel_breakpoints>: Remove field.
(cancel_breakpoints): Delete.
* tracepoint.c (clear_installed_tracepoints, stop_tracing)
(upload_fast_traceframes): Remove references to
cancel_breakpoints.
libthread_db: Skip attaching to terminated and joined threads I wrote a test that attaches to a program that constantly spawns short-lived threads, which exposed several issues. This is one of them. On GNU/Linux, attaching to a multi-threaded program sometimes prints out warnings like: ... [New LWP 20700] warning: unable to open /proc file '/proc/-1/status' [New LWP 20850] [New LWP 21019] ... That happens because when a thread exits, and is joined, glibc does: nptl/pthread_join.c: pthread_join () { ... if (__glibc_likely (result == 0)) { /* We mark the thread as terminated and as joined. */ pd->tid = -1; ... /* Free the TCB. */ __free_tcb (pd); } So if we attach or interrupt the program (which does an implicit "info threads") at just the right (or rather, wrong) time, we can find and return threads in the libthread_db/pthreads thread list with kernel thread ID -1. I've filed glibc PR nptl/17707 for this. You'll find more info there. This patch handles this as a special case in GDB. This is actually more than just a cosmetic issue. lin_lwp_attach_lwp will think that this -1 is an LWP we're not attached to yet, and after failing to attach will try to check we were already attached to the process, using a waitpid call, which in this case ends up being "waitpid (-1, ...", which obviously results in GDB potentially discarding an event when it shouldn't... Tested on x86_64 Fedora 20, native and gdbserver. gdb/gdbserver/ 2015-01-09 Pedro Alves <palves@redhat.com> * thread-db.c (find_new_threads_callback): Ignore thread if the kernel thread ID is -1. gdb/ 2015-01-09 Pedro Alves <palves@redhat.com> * linux-nat.c (lin_lwp_attach_lwp): Assert that the lwp id we're about to wait for is > 0. * linux-thread-db.c (find_new_threads_callback): Ignore thread if the kernel thread ID is -1.
2014-12-16 17:12:24 +01:00
2015-01-09 Pedro Alves <palves@redhat.com>
* thread-db.c (find_new_threads_callback): Ignore thread if the
kernel thread ID is -1.
Linux: on attach, attach to lwps listed under /proc/$pid/task/ ... instead of relying on libthread_db. I wrote a test that attaches to a program that constantly spawns short-lived threads, which exposed several issues. This is one of them. On Linux, we need to attach to all threads of a process (thread group) individually. We currently rely on libthread_db to list the threads, but that is problematic, because libthread_db relies on reading data structures out of the inferior (which may well be corrupted). If threads are being created or exiting just while we try to attach, we may trip on inconsistencies in the inferior's thread list. To work around that, when we see a seemingly corrupt list, we currently retry a few times: static void thread_db_find_new_threads_2 (ptid_t ptid, int until_no_new) { ... if (until_no_new) { /* Require 4 successive iterations which do not find any new threads. The 4 is a heuristic: there is an inherent race here, and I have seen that 2 iterations in a row are not always sufficient to "capture" all threads. */ ... That heuristic may well fail, and when it does, we end up with threads in the program that aren't under GDB's control. That's obviously bad and results in quite mistifying failures, like e.g., the process dying for seeminly no reason when a thread that wasn't attached trips on a breakpoint. There's really no reason to rely on libthread_db for this nowadays when we have /proc mounted. In that case, which is the usual case, we can list the LWPs from /proc/PID/task/. In fact, GDBserver is already doing this. The patch factors out that code that knows to walk the task/ directory out of GDBserver, and makes GDB use it too. Like GDBserver, the patch makes GDB attach to LWPs and _not_ wait for them to stop immediately. Instead, we just tag the LWP as having an expected stop. Because we can only set the ptrace options when the thread stops, we need a new flag in the lwp structure to keep track of whether we've already set the ptrace options, just like in GDBserver. Note that nothing issues any ptrace command to the threads between the PTRACE_ATTACH and the stop, so this is safe (unlike one scenario described in gdbserver's linux-low.c). When we attach to a program that has threads exiting while we attach, it's easy to race with a thread just exiting as we try to attach to it, like: #1 - get current list of threads #2 - attach to each listed thread #3 - ooops, attach failed, thread is already gone As this is pretty normal, we shouldn't be issuing a scary warning in step #3. When #3 happens, PTRACE_ATTACH usually fails with ESRCH, but sometimes we'll see EPERM as well. That happens when the kernel still has the thread in its task list, but the thread is marked as dead. Unfortunately, EPERM is ambiguous and we'll get it also on other scenarios where the thread isn't dead, and in those cases, it's useful to get a warning. To distiguish the cases, when we get an EPERM failure, we open /proc/PID/status, and check the thread's state -- if the /proc file no longer exists, or the state is "Z (Zombie)" or "X (Dead)", we ignore the EPERM error silently; otherwise, we'll warn. Unfortunately, there seems to be a kernel race here. Sometimes I get EPERM, and then the /proc state still indicates "R (Running)"... If we wait a bit and retry, we do end up seeing X or Z state, or get an ESRCH. I thought of making GDB retry the attach a few times, but even with a 500ms wait and 4 retries, I still see the warning sometimes. I haven't been able to identify the kernel path that causes this yet, but in any case, it looks like a kernel bug to me. As this just results failure to suppress a warning that we've been printing since about forever anyway, I'm just making the test cope with it, and issue an XFAIL. gdb/gdbserver/ 2015-01-09 Pedro Alves <palves@redhat.com> * linux-low.c (linux_attach_fail_reason_string): Move to nat/linux-ptrace.c, and rename. (linux_attach_lwp): Update comment. (attach_proc_task_lwp_callback): New function. (linux_attach): Adjust to rename and use linux_proc_attach_tgid_threads. (linux_attach_fail_reason_string): Delete declaration. gdb/ 2015-01-09 Pedro Alves <palves@redhat.com> * linux-nat.c (attach_proc_task_lwp_callback): New function. (linux_nat_attach): Use linux_proc_attach_tgid_threads. (wait_lwp, linux_nat_filter_event): If not set yet, set the lwp's ptrace option flags. * linux-nat.h (struct lwp_info) <must_set_ptrace_flags>: New field. * nat/linux-procfs.c: Include <dirent.h>. (linux_proc_get_int): New parameter "warn". Handle it. (linux_proc_get_tgid): Adjust. (linux_proc_get_tracerpid): Rename to ... (linux_proc_get_tracerpid_nowarn): ... this. (linux_proc_pid_get_state): New function, factored out from (linux_proc_pid_has_state): ... this. Add new parameter "warn" and handle it. (linux_proc_pid_is_gone): New function. (linux_proc_pid_is_stopped): Adjust. (linux_proc_pid_is_zombie_maybe_warn) (linux_proc_pid_is_zombie_nowarn): New functions. (linux_proc_pid_is_zombie): Use linux_proc_pid_is_zombie_maybe_warn. (linux_proc_attach_tgid_threads): New function. * nat/linux-procfs.h (linux_proc_get_tgid): Update comment. (linux_proc_get_tracerpid): Rename to ... (linux_proc_get_tracerpid_nowarn): ... this, and update comment. (linux_proc_pid_is_gone): New declaration. (linux_proc_pid_is_zombie): Update comment. (linux_proc_pid_is_zombie_nowarn): New declaration. (linux_proc_attach_lwp_func): New typedef. (linux_proc_attach_tgid_threads): New declaration. * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason): Adjust to use nowarn functions. (linux_ptrace_attach_fail_reason_string): Move here from gdbserver/linux-low.c and rename. (ptrace_supports_feature): If the current ptrace options are not known yet, check them now, instead of asserting. * nat/linux-ptrace.h (linux_ptrace_attach_fail_reason_string): Declare.
2014-12-16 17:12:24 +01:00
2015-01-09 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_attach_fail_reason_string): Move to
nat/linux-ptrace.c, and rename.
(linux_attach_lwp): Update comment.
(attach_proc_task_lwp_callback): New function.
(linux_attach): Adjust to rename and use
linux_proc_attach_tgid_threads.
(linux_attach_fail_reason_string): Delete declaration.
2015-01-01 Joel Brobecker <brobecker@adacore.com>
* gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
* server.c (gdbserver_version): Likewise.
2014-12-29 Sergio Durigan Junior <sergiodj@redhat.com>
* remote-utils.c: Include ctype.h.
(input_interrupt): Explicitly handle the case when the char
received is the NUL byte. Improve the printing of non-ASCII
characters.
[Linux] Ask kernel to kill inferior when GDB terminates This patch enhances GDB on GNU/Linux systems in the situation where we are debugging an inferior that was created from GDB (as opposed to attached to), by asking the kernel to kill the inferior if GDB terminates without doing it itself. This would typically happen when GDB encounters a problem and crashes, or when it gets killed by an external process. This can be observed by starting a program under GDB, and then killing GDB with signal 9. After GDB is killed, the inferior still remains. This patch also fixes GDBserver similarly. This fix is conditional on the kernel supporting the PTRACE_O_EXITKILL feature. On older kernels, the behavior remains unchanged. gdb/ChangeLog: * nat/linux-ptrace.h (PTRACE_O_EXITKILL): Define if not already defined. (linux_enable_event_reporting): Add parameter "attached". * nat/linux-ptrace.c (linux_test_for_exitkill): New forward declaration. New function. (linux_check_ptrace_features): Add linux_test_for_exitkill call. (linux_enable_event_reporting): Add new parameter "attached". Do not call ptrace with the PTRACE_O_EXITKILL if ATTACHED is nonzero. * linux-nat.c (linux_init_ptrace): Add parameter "attached". Use it. Update function description. (linux_child_post_attach, linux_child_post_startup_inferior): Update call to linux_enable_event_reporting. gdb/gdbserver/ChangeLog: * linux-low.c (linux_low_filter_event): Update call to linux_enable_event_reporting following the addition of a new parameter to that function. Tested on x86_64-linux, native and native-gdbserver. I also verified by hand that the inferior gets killed when killing GDB in the "run" case, while the inferior remains in the "attach" case. Same for GDBserver.
2014-11-11 07:07:21 +01:00
2014-12-16 Joel Brobecker <brobecker@adacore.com>
* linux-low.c (linux_low_filter_event): Update call to
linux_enable_event_reporting following the addition of
a new parameter to that function.
2014-12-16 Catalin Udma <catalin.udma@freescale.com>
PR server/17457
* linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
(AARCH64_FPCR_REGNO): Likewise.
(AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
(aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
(aarch64_store_fpregset): Likewise.
Use PTRACE_SINGLESTEP_ONE when single-stepping one thread. Currently, when we receive a request to single-step one single thread (Eg, when single-stepping out of a breakpoint), we use the PTRACE_SINGLESTEP pthread request, which does single-step the corresponding thread, but also resumes execution of all other threads in the inferior. This causes problems when debugging programs where another thread receives multiple debug events while trying to single-step a specific thread out of a breakpoint (with infrun traces turned on): (gdb) continue Continuing. infrun: clear_proceed_status_thread (Thread 126) [...] infrun: clear_proceed_status_thread (Thread 142) [...] infrun: clear_proceed_status_thread (Thread 146) infrun: clear_proceed_status_thread (Thread 125) infrun: proceed (addr=0xffffffff, signal=GDB_SIGNAL_DEFAULT, step=0) infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 142] at 0x10684838 infrun: wait_for_inferior () infrun: target_wait (-1, status) = infrun: 42000 [Thread 146], infrun: status->kind = stopped, signal = GDB_SIGNAL_REALTIME_34 infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x10a187f4 infrun: context switch infrun: Switching context from Thread 142 to Thread 146 infrun: random signal (GDB_SIGNAL_REALTIME_34) infrun: switching back to stepped thread infrun: Switching context from Thread 146 to Thread 142 infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 142] at 0x10684838 infrun: prepare_to_wait [...handling of similar events for threads 145, 144 and 143 snipped...] infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 42000 [Thread 146], infrun: status->kind = stopped, signal = GDB_SIGNAL_REALTIME_34 infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x10a187f4 infrun: context switch infrun: Switching context from Thread 142 to Thread 146 ../../src/gdb/inline-frame.c:339: internal-error: skip_inline_frames: Assertion `find_inline_frame_state (ptid) == NULL' failed. What happens is that GDB keeps sending requests to resume one specific thread, and keeps receiving debugging events for other threads. Things break down when the one of the other threads receives a debug event for the second time (thread 146 in the example above). This patch fixes the problem by making sure that only one thread gets resumed, thus preventing the other threads from generating an unexpected event. gdb/gdbserver/ChangeLog: * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1. Remove FIXME comment about assumption about N.
2014-11-25 17:12:10 +01:00
2014-12-15 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
Remove FIXME comment about assumption about N.
2014-12-13 Joel Brobecker <brobecker@adacore.com>
* configure.ac: If large-file support is disabled in GDBserver,
pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
* configure: Regenerate.
2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-low.c (regsets_fetch_inferior_registers): Suppress the
warning upon ENODATA from ptrace.
* linux-s390-low.c (s390_store_tdb): New.
(s390_regsets): Add regset for NT_S390_TDB.
2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-low.c (regsets_store_inferior_registers): Skip regsets
without a fill_function.
* linux-s390-low.c (s390_fill_last_break): Remove.
(s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
(s390_arch_setup): Use regset's size instead of fill_function for
loop end condition.
2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-low.c (regsets_fetch_inferior_registers): Do not invoke
the regset's store function when ptrace returned an error.
* regcache.c (get_thread_regcache): Invalidate register cache
before fetching inferior's registers.
2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-low.c (regsets_fetch_inferior_registers): Rephrase
while-loop as for-loop.
(regsets_store_inferior_registers): Likewise.
2014-11-28 Yao Qi <yao@codesourcery.com>
* configure.ac(AC_CHECK_FUNCS): Remove readlink.
* config.in, configure: Re-generate.
* hostio.c (handle_unlink): Remove code checking HAVE_READLINK
is defined.
2014-11-21 Yao Qi <yao@codesourcery.com>
* configure.ac: Don't invoke AC_FUNC_ALLOCA.
(AC_CHECK_HEADERS): Remove malloc.h.
* configure: Re-generated.
* config.in: Re-generated.
* server.h: Don't include alloca.h and malloc.h.
* gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
Don't include malloc.h.
[gdbserver/lynx] spurious failure to write in inferior memory We noticed the following error on ppc-lynx178, using just about any program: (gdb) tar remote mytarget:4444 Remote debugging using mytarget:4444 0x000100c8 in _start () (gdb) b try Breakpoint 1 at 0x10844: file try.adb, line 11. (gdb) cont Continuing. !!!-> Cannot remove breakpoints because program is no longer writable. !!!-> Further execution is probably impossible. Breakpoint 1, try () at try.adb:11 11 Local : Integer := 18; And, of course, trying to continue yielded the expected outcome: (gdb) c Continuing. warning: Error removing breakpoint 1 Cannot remove breakpoints because program is no longer writable. Further execution is probably impossible. It turns out that the problem is caused by an intentional test against a variable with an undefined value. After GDB receives notification of the inferior stopping, it tries to remove the breakpoint by sending a memory-write packet ("X10844,4:9 "). This leads us to lynx_write_memory, where it tries to split the memory-write into chunks of 4 bytes. And, in order to handle writes which are not aligned on word boundaries, we have the following code: if (skip > 0 || truncate > 0) /* We need to read the memory at this address in order to preserve the data that we are not overwriting. */ lynx_read_memory (addr, (unsigned char *) &buf, xfer_size); if (errno) return errno; (the comment explains what the code is about). Unfortunately, the not-so-glaring error that we've made here is that we're checking ERRNO regardless of whether we've called lynx_read_memory. In our case, because we are writing 4 bytes aligned on a word boundary, we do not call lynx_read_memory and therefore test an ERRNO with an undefined value. gdb/gdbserver/ChangeLog: * lynx-low.c (lynx_write_memory): Put lynx_read_memory and corresponding ERRNO check in same block.
2014-09-20 00:00:07 +02:00
2014-11-17 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_write_memory): Put lynx_read_memory and
corresponding ERRNO check in same block.
2014-11-12 Pedro Alves <palves@redhat.com>
* server.c (cont_thread): Update comment.
(start_inferior, attach_inferior): No longer clear cont_thread.
(handle_v_cont): No longer set cont_thread.
(captured_main): Clear cont_thread each time a GDB connects.
GDBserver: don't resume all threads if the Hc thread disapears There's code in linux_wait_1 that resumes all threads if the Hc thread disappears. It's the wrong thing to do, as GDB has told GDBserver to resume only one thread, because e.g., the user has scheduler-locking enabled, or because GDB was stepping the program over a breakpoint. Resuming all threads behind GDB's back can't be good in either case. The right thing to do is to detect that that the (only) resumed thread is gone, and let GDB know about it. The Linux backend is already doing that nowadays, since: commit fa96cb382c12b099675c5cc238aaa7352a3fd3d7 Author: Pedro Alves <palves@redhat.com> AuthorDate: Thu Feb 27 14:30:08 2014 +0000 Teach GDBserver's Linux backend about no unwaited-for children (TARGET_WAITKIND_NO_RESUMED). The backend detects that all resumed threads have disappeared, and returns TARGET_WAITKIND_NO_RESUMED to the core of GDBserver, which then reports an error to GDB. There's no need to frob the passed in ptid to wait for the continue thread either -- linux_wait_for_event only returns events for resumed threads. The badness (of resuming threads) can actually be observed in the testsuite, if we force-disable vCont support in GDBserver -- before the patch, gdb.threads/no-unwaited-for-left.exp hangs if we disable vCont: (gdb) continue Continuing. FAIL: gdb.threads/no-unwaited-for-left.exp: continue to breakpoint: break-here (timeout) ... more cascading timeouts .... After the patch, gdb.threads/no-unwaited-for-left.exp behaves the same with or without vCont support: (gdb) continue Continuing. [New Thread 32226] [Switching to Thread 32226] Breakpoint 2, thread_a (arg=0x0) at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.threads/no-unwaited-for-left.c:28 28 return 0; /* break-here */ (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: continue to breakpoint: break-here ... continue Continuing. warning: Remote failure reply: E.No unwaited-for children left. [Thread 32222] #1 stopped. (gdb) FAIL: gdb.threads/no-unwaited-for-left.exp: continue stops when the main thread exits Overall, this is also good for getting rid of a RSP detail from the backend. gdb/gdbserver/ 2014-11-12 Pedro Alves <palves@redhat.com> * linux-low.c (linux_wait_1): Don't force a wait for the Hc thread, and don't resume all threads if the Hc thread has exited.
2014-11-12 12:17:39 +01:00
2014-11-12 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_wait_1): Don't force a wait for the Hc
thread, and don't resume all threads if the Hc thread has exited.
2014-11-12 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_request_interrupt): Always send a SIGINT to
the process group instead of to a specific LWP.
gdbserver/win32: Rewrite debug registers handling Don't use debug_reg_state for both: * "intent" - what we want the debug registers to look like * "reality" - what/which were the contents of the DR registers when the event triggered Reserve it for the former only, like in the GNU/Linux port. Otherwise the core x86 debug registers code can get confused if the inferior itself changes the debug registers since GDB last set them. This is also a requirement for being able to set watchpoints while the target is running, if/when we get to it on Windows. See the big comment in x86_dr_stopped_data_address. Seems to me this may also fixes propagating watchpoints to all threads -- continue_one_thread only calls win32_set_thread_context (what copies the DR registers to the thread), if something already fetched the thread's context before. Something else may be masking this issue, I haven't checked. Smoke tested by running gdbserver under Wine, connecting to it from GNU/Linux, and checking that I could trigger a watchpoint as expected. Joel tested it on x86-windows using AdaCore's testsuite. gdb/gdbserver/ 2014-10-15 Pedro Alves <palves@redhat.com> PR server/17487 * win32-arm-low.c (arm_set_thread_context): Remove current_event parameter. (arm_set_thread_context): Delete. (the_low_target): Adjust. * win32-i386-low.c (debug_registers_changed) (debug_registers_used): Delete. (update_debug_registers_callback): New function. (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as needing to update their debug registers. (win32_get_current_dr): New function. (x86_dr_low_get_addr, x86_dr_low_get_control) (x86_dr_low_get_status): Fetch the debug register from the thread record's context. (i386_initial_stuff): Adjust. (i386_get_thread_context): Remove current_event parameter. Don't clear debug_registers_changed nor copy DR values to debug_reg_state. (i386_set_thread_context): Delete. (i386_prepare_to_resume): New function. (i386_thread_added): Mark the thread as needing to update irs debug registers. (the_low_target): Remove i386_set_thread_context and install i386_prepare_to_resume. * win32-low.c (win32_get_thread_context): Adjust. (win32_set_thread_context): Use SetThreadContext directly. (win32_prepare_to_resume): New function. (win32_require_context): New function, factored out from ... (thread_rec): ... this. (continue_one_thread): Call win32_prepare_to_resume on each thread we're about to continue. (win32_resume): Call win32_prepare_to_resume on the event thread. * win32-low.h (struct win32_thread_info) <debug_registers_changed>: New field. (struct win32_target_ops): Change prototype of set_thread_context, delete set_thread_context and add prepare_to_resume. (win32_require_context): New declaration.
2014-10-15 20:55:50 +02:00
2014-10-15 Pedro Alves <palves@redhat.com>
PR server/17487
* win32-arm-low.c (arm_set_thread_context): Remove current_event
parameter.
(arm_set_thread_context): Delete.
(the_low_target): Adjust.
* win32-i386-low.c (debug_registers_changed)
(debug_registers_used): Delete.
(update_debug_registers_callback): New function.
(x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
needing to update their debug registers.
(win32_get_current_dr): New function.
(x86_dr_low_get_addr, x86_dr_low_get_control)
(x86_dr_low_get_status): Fetch the debug register from the thread
record's context.
(i386_initial_stuff): Adjust.
(i386_get_thread_context): Remove current_event parameter. Don't
clear debug_registers_changed nor copy DR values to
debug_reg_state.
(i386_set_thread_context): Delete.
(i386_prepare_to_resume): New function.
(i386_thread_added): Mark the thread as needing to update irs
debug registers.
(the_low_target): Remove i386_set_thread_context and install
i386_prepare_to_resume.
* win32-low.c (win32_get_thread_context): Adjust.
(win32_set_thread_context): Use SetThreadContext
directly.
(win32_prepare_to_resume): New function.
(win32_require_context): New function, factored out from ...
(thread_rec): ... this.
(continue_one_thread): Call win32_prepare_to_resume on each thread
we're about to continue.
(win32_resume): Call win32_prepare_to_resume on the event thread.
* win32-low.h (struct win32_thread_info)
<debug_registers_changed>: New field.
(struct win32_target_ops): Change prototype of set_thread_context,
delete set_thread_context and add prepare_to_resume.
(win32_require_context): New declaration.
2014-10-08 Gary Benson <gbenson@redhat.com>
* server.h: Do not include common-exceptions.h.
2014-10-08 Gary Benson <gbenson@redhat.com>
* server.h: Do not include cleanups.h.
2014-09-30 James Hogan <james.hogan@imgtec.com>
* Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
mips64-dsp-linux.c.
Honour SIGILL and SIGSEGV in cancel breakpoint and event lwp selection I see the following fail on arm-none-linux-gnueabi testing, (gdb) continue^M Continuing.^M ^M Program received signal SIGILL, Illegal instruction.^M [Switching to Thread 1003]^M handler (signo=10) at /scratch/yqi/arm-none-linux-gnueabi/src/gdb-trunk/gdb/testsuite/gdb.threads/sigstep-threads.c:33^M 33 tgkill (getpid (), gettid (), SIGUSR1); /* step-2 */^M (gdb) FAIL: gdb.threads/sigstep-threads.exp: continue the cause is that GDBserver doesn't cancel the breakpoint if the stop signal is SIGILL. The kernel used here is a little old, 2.6.x, and doesn't translate SIGILL to SIGTRAP when program hits breakpoint instruction (which is an illegal instruction actually). GDB and GDBserver can translate SIGILL to SIGTRAP under certain circumstance, so it is not a problem here. See gdbserver/linux-low.c:linux_wait_1 /* If this event was not handled before, and is not a SIGTRAP, we report it. SIGILL and SIGSEGV are also treated as traps in case a breakpoint is inserted at the current PC. If this target does not support internal breakpoints at all, we also report the SIGTRAP without further processing; it's of no concern to us. */ maybe_internal_trap = (supports_breakpoints () && (WSTOPSIG (w) == SIGTRAP || ((WSTOPSIG (w) == SIGILL || WSTOPSIG (w) == SIGSEGV) && (*the_low_target.breakpoint_at) (event_child->stop_pc)))); However, SIGILL and SIGSEGV is not considered when cancelling breakpoint, which causes the fail above. That is, when GDB is doing software single step on address ADDR, both thread A and thread B hits the software single step breakpoint, and get SIGILL. GDB selects the event from thread A, removes the software single step breakpoint, and resume the program. The event (SIGILL) from thread B is reported to GDB, but GDB doesn't regard this SIGILL as SIGTRAP, because the breakpoint on address ADDR was removed, so GDB reports "Program received signal SIGILL". The patch is to allow calling cancel_breakpoint if the signal is SIGILL and SIGSEGV. This patch fixes the fail above. Likewise, event lwp selection should honour SIGILL and SIGSEGV too. gdb/gdbserver: 2014-09-23 Yao Qi <yao@codesourcery.com> * linux-low.c (lp_status_maybe_breakpoint): New function. (linux_low_filter_event): Call lp_status_maybe_breakpoint. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (cancel_breakpoints_callback): Likewise.
2014-09-12 07:35:11 +02:00
2014-09-23 Yao Qi <yao@codesourcery.com>
* linux-low.c (lp_status_maybe_breakpoint): New function.
(linux_low_filter_event): Call lp_status_maybe_breakpoint.
(count_events_callback): Likewise.
(select_event_lwp_callback): Likewise.
(cancel_breakpoints_callback): Likewise.
2014-09-19 Don Breazeal <donb@codesourcery.com>
* linux-low.c (handle_extended_wait): Call
linux_ptrace_get_extended_event.
(get_stop_pc, get_detach_signal, linux_low_filter_event): Call
linux_is_extended_waitstatus.
2014-09-16 Joel Brobecker <brobecker@adacore.com>
* Makefile.in (CPPFLAGS): Define.
(INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
(IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
Rename current_inferior as current_thread in gdbserver GDB has a function named "current_inferior" and gdbserver has a global variable named "current_inferior", but the two are not equivalent; indeed, gdbserver does not have any real equivalent of what GDB calls an inferior. What gdbserver's "current_inferior" is actually pointing to is a structure describing the current thread. This commit renames current_inferior as current_thread in gdbserver to clarify this. It also renames the function "set_desired_inferior" to "set_desired_thread" and renames various local variables from foo_inferior to foo_thread. gdb/gdbserver/ChangeLog: * inferiors.h (current_inferior): Renamed as... (current_thread): New variable. All uses updated. * linux-low.c (get_pc): Renamed saved_inferior as saved_thread. (maybe_move_out_of_jump_pad): Likewise. (cancel_breakpoint): Likewise. (linux_low_filter_event): Likewise. (wait_for_sigstop): Likewise. (linux_resume_one_lwp): Likewise. (need_step_over_p): Likewise. (start_step_over): Likewise. (linux_stabilize_threads): Renamed save_inferior as saved_thread. * linux-x86-low.c (x86_linux_update_xmltarget): Likewise. * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread and save_inferior as saved_thread. * regcache.c (get_thread_regcache): Renamed saved_inferior as saved_thread. (regcache_invalidate_thread): Likewise. * remote-utils.c (prepare_resume_reply): Likewise. * thread-db.c (thread_db_get_tls_address): Likewise. (disable_thread_event_reporting): Likewise. (remove_thread_event_breakpoints): Likewise. * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior as saved_thread. * target.h (set_desired_inferior): Renamed as... (set_desired_thread): New declaration. All uses updated. * server.c (myresume): Updated comment to reference thread instead of inferior. (handle_serial_event): Likewise. (handle_target_event): Likewise.
2014-09-10 11:37:11 +02:00
2014-09-16 Gary Benson <gbenson@redhat.com>
* inferiors.h (current_inferior): Renamed as...
(current_thread): New variable. All uses updated.
* linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
(maybe_move_out_of_jump_pad): Likewise.
(cancel_breakpoint): Likewise.
(linux_low_filter_event): Likewise.
(wait_for_sigstop): Likewise.
(linux_resume_one_lwp): Likewise.
(need_step_over_p): Likewise.
(start_step_over): Likewise.
(linux_stabilize_threads): Renamed save_inferior as saved_thread.
* linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
* proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
and save_inferior as saved_thread.
* regcache.c (get_thread_regcache): Renamed saved_inferior as
saved_thread.
(regcache_invalidate_thread): Likewise.
* remote-utils.c (prepare_resume_reply): Likewise.
* thread-db.c (thread_db_get_tls_address): Likewise.
(disable_thread_event_reporting): Likewise.
(remove_thread_event_breakpoints): Likewise.
* tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
as saved_thread.
* target.h (set_desired_inferior): Renamed as...
(set_desired_thread): New declaration. All uses updated.
* server.c (myresume): Updated comment to reference thread instead
of inferior.
(handle_serial_event): Likewise.
(handle_target_event): Likewise.
2014-09-12 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* regcache.h: Include common-regcache.h.
(regcache_read_pc): Don't declare.
* regcache.c (get_thread_regcache_for_ptid): New function.
2014-09-11 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* symbol.c: New file.
* Makefile.in (SFILES): Add symbol.c.
(OBS): Add symbol.o.
2014-09-11 Gary Benson <gbenson@redhat.com>
* target.c (target_stop_ptid, target_continue_ptid): New
functions.
2014-09-11 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* target.h: Include target/target.h.
* target.c (target_read_memory, target_read_uint32)
(target_write_memory): New functions.
2014-09-11 Gary Benson <gbenson@redhat.com>
* server.h (debug_hw_points): Don't declare.
* server.c (debug_hw_points): Don't define. Replace all uses
with show_debug_regs.
* linux-aarch64-low.c (debug_hw_points): Don't define. Replace
all uses with show_debug_regs.
2014-09-08 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
* linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
endianness into account.
(ppc_supply_ptrace_register): Likewise.
2014-09-03 James Hogan <james.hogan@imgtec.com>
* linux-mips-low.c (mips_read_description): Reset errno to 0 prior
to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
2014-09-03 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_linux_prepare_to_resume): Use
ALL_DEBUG_ADDRESS_REGISTERS.
Rename 32- and 64-bit Intel files from "i386" to "x86" This commit renames nine files that contain code used by both 32- and 64-bit Intel ports such that their names are prefixed with "x86" rather than "i386". All types, functions and variables within these files are likewise renamed such that their names are prefixed with "x86" rather than "i386". This makes GDB follow the convention used by gdbserver such that 32-bit Intel code lives in files called "i386-*", 64-bit Intel code lives in files called "amd64-*", and code for both 32- and 64-bit Intel lives in files called "x86-*". This commit only renames OS-independent files. The Linux ports of both GDB and gdbserver now follow the i386/amd64/x86 convention fully. Some ports still use the old convention where "i386" in file/function/ type/variable names can mean "32-bit only" or "32- and 64-bit" but I don't want to touch ports I can't fully test except where absolutely necessary. gdb/ChangeLog: * i386-nat.h: Renamed as... * x86-nat.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * i386-nat.c: Renamed as... * x86-nat.c: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * common/i386-xstate.h: Renamed as... * common/x86-xstate.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * nat/i386-cpuid.h: Renamed as... * nat/x86-cpuid.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * nat/i386-gcc-cpuid.h: Renamed as... * nat/x86-gcc-cpuid.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * nat/i386-dregs.h: Renamed as... * nat/x86-dregs.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * nat/i386-dregs.c: Renamed as... * nat/x86-dregs.c: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. gdb/gdbserver/ChangeLog: * i386-low.h: Renamed as... * x86-low.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * i386-low.c: Renamed as... * x86-low.c: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated.
2014-08-19 16:16:11 +02:00
2014-09-02 Gary Benson <gbenson@redhat.com>
* i386-low.h: Renamed as...
* x86-low.h: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
* i386-low.c: Renamed as...
* x86-low.c: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
2014-09-02 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (x86_linux_new_process): Use XCNEW.
(x86_linux_new_thread): Likewise.
2014-08-29 Gary Benson <gbenson@redhat.com>
* server.h (setjmp.h): Do not include.
(toplevel): Do not declare.
(common-exceptions.h): Include.
(cleanups.h): Likewise.
* server.c (toplevel): Do not define.
(exit_code): New static global.
(detach_or_kill_for_exit_cleanup): New function.
(main): New function. Original main renamed to...
(captured_main): New function.
* utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
Introduce common/common-exceptions.[ch] This commit moves the exception throwing and catching code into gdb/common/. All exception printing code remains in gdb/exceptions.[ch]. gdb/ChangeLog: * common/common-exceptions.h: New file. * common/common-exceptions.c: Likewise. * Makefile.in (SFILES): Add common/common-exceptions.c. (HFILES_NO_SRCDIR): Add common/common-exceptions.h. (COMMON_OBS): Add common-exceptions.o. (common-exceptions.o): New rule. * exceptions.h (common-exceptions.h): Include. (gdb_setjmp.h): Do not include. (return_reason): Moved to common-exceptions.h. (enum return_reason): Likewise. (RETURN_MASK): Likewise. (typedef return_mask): Likewise. (enum errors): Likewise. (struct gdb_exception): Likewise. (exceptions_state_mc_init): Likewise. (exceptions_state_mc_action_iter): Likewise. (exceptions_state_mc_action_iter_1): Likewise. (TRY_CATCH): Likewise. (throw_exception): Likewise. (throw_verror): Likewise. (throw_vquit): Likewise. (throw_error): Likewise. (throw_quit): Likewise. * exceptions.c (enum catcher_state): Moved to common-exceptions.c. (enum catcher_action): Likewise. (struct catcher): Likewise. (current_catcher): Likewise. (catcher_list_size): Likewise. (exceptions_state_mc_init): Likewise. (catcher_pop): Likewise. (exceptions_state_mc): Likewise. (exceptions_state_mc_action_iter): Likewise. (exceptions_state_mc_action_iter_1): Likewise. (throw_exception): Likewise. (exception_messages): Likewise. (exception_messages_size): Likewise. (throw_it): Likewise. (throw_verror): Likewise. (throw_vquit): Likewise. (throw_error): Likewise. (throw_quit): Likewise. (prepare_to_throw_exception): New function. gdb/gdbserver/ChangeLog: * Makefile.in (SFILES): Add common/common-exceptions.c. (OBS): Add common-exceptions.o. (common-exceptions.o): New rule. * utils.c (prepare_to_throw_exception): New function.
2014-08-07 17:29:19 +02:00
2014-08-29 Gary Benson <gbenson@redhat.com>
* Makefile.in (SFILES): Add common/common-exceptions.c.
(OBS): Add common-exceptions.o.
(common-exceptions.o): New rule.
* utils.c (prepare_to_throw_exception): New function.
2014-08-29 Gary Benson <gbenson@redhat.com>
* config.in: Regenerate.
* configure: Likewise.
2014-08-29 Gary Benson <gbenson@redhat.com>
* Makefile.in (SFILES): Add common/cleanups.c.
(OBS): cleanups.o.
(cleanups.o): New rule.
2014-08-29 Gary Benson <gbenson@redhat.com>
* utils.c (internal_vwarning): New function.
2014-08-28 Gary Benson <gbenson@redhat.com>
* utils.h (fatal): Remove declaration.
* utils.c (fatal): Remove function.
2014-08-28 Gary Benson <gbenson@redhat.com>
* tracepoint.c (gdb_agent_init): Replace fatal with
perror_with_name.
(initialize_tracepoint): Likewise.
2014-08-28 Gary Benson <gbenson@redhat.com>
* remote-utils.c (remote_prepare): Replace fatal with error.
2014-08-28 Gary Benson <gbenson@redhat.com>
* linux-low.c (linux_async): Replace fatal with warning.
Tidy up and return.
(linux_start_non_stop): Return -1 if linux_async failed.
2014-08-28 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c (i386_dr_low_set_addr): Replace check with
gdb_assert.
(i386_dr_low_get_addr): Remove vague comment.
* win32-i386-low.c (i386_dr_low_set_addr): Replace check with
gdb_assert.
2014-08-28 Gary Benson <gbenson@redhat.com>
* inferiors.c (get_thread_process): Replace check with gdb_assert.
* linux-low.c (linux_wait_for_event_filtered): Replace fatal with
internal_error.
(linux_resume_one_lwp): Likewise.
* linux-x86-low.c (x86_siginfo_fixup): Replace checks with
gdb_assert.
* mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
with internal_error.
* regcache.c (get_thread_regcache): Replace check with gdb_assert.
(init_register_cache): Replace fatal with gdb_assert_not_reached.
(find_register_by_name): Replace fatal with internal_error.
(find_regno): Likewise.
* tdesc.c (init_target_desc): Replace check with gdb_assert.
* thread-db.c (thread_db_create_event): Likewise.
(thread_db_load_search): Likewise.
(try_thread_db_load_1): Likewise.
* tracepoint.c (get_jump_space_head): Replace fatal with
internal_error.
(claim_trampoline_space): Likewise.
(have_fast_tracepoint_trampoline_buffer): Likewise.
(cmd_qtstart): Likewise.
(stop_tracing): Likewise.
(fast_tracepoint_collecting): Likewise.
(target_malloc): Likewise.
(download_tracepoint): Likewise.
(download_trace_state_variables): Replace check with gdb_assert.
(upload_fast_traceframes): Replace fatal with internal_error.
2014-08-19 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* 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-08-19 Gary Benson <gbenson@redhat.com>
* utils.h: Do not include print-utils.h.
2014-08-19 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* server.h: Add static assertion.
(gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
2014-08-19 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* Makefile.in (SFILES): Add common/errors.c.
(OBS): Add errors.o.
(IPA_OBS): Add errors-ipa.o.
(errors.o): New rule.
(errors-ipa.o): Likewise.
* utils.h (perror_with_name, error, warning): Don't declare.
* utils.c (warning): Renamed and rewritten as...
(vwarning): New function.
(error): Renamed and rewritten as...
(verror): New function.
(internal_error): Renamed and rewritten as...
(internal_verror): New function.
2014-08-07 Gary Benson <gbenson@redhat.com>
* configure.ac (AC_CHECK_HEADERS): Remove errno.h.
* configure: Regenerate.
* config.in: Likewise.
* server.h: Do not include errno.h.
* event-loop.c: Likewise.
* hostio-errno.c: Likewise.
* linux-low.c: Likewise.
* remote-utils.c: Likewise.
* spu-low.c: Likewise.
* utils.c: Likewise.
* gdbreplay.c: Unconditionally include errno.h.
Include string.h in common-defs.h This commit includes string.h in common-defs.h and removes all other inclusions. gdb/ 2014-08-07 Gary Benson <gbenson@redhat.com> * common/common-defs.h: Include string.h. * aarch64-tdep.c: Do not include string.h. * ada-exp.y: Likewise. * ada-lang.c: Likewise. * ada-lex.l: Likewise. * ada-typeprint.c: Likewise. * ada-valprint.c: Likewise. * aix-thread.c: Likewise. * alpha-linux-tdep.c: Likewise. * alpha-mdebug-tdep.c: Likewise. * alpha-nat.c: Likewise. * alpha-osf1-tdep.c: Likewise. * alpha-tdep.c: Likewise. * alphanbsd-tdep.c: Likewise. * amd64-dicos-tdep.c: Likewise. * amd64-linux-tdep.c: Likewise. * amd64-nat.c: Likewise. * amd64-sol2-tdep.c: Likewise. * amd64fbsd-tdep.c: Likewise. * amd64obsd-tdep.c: Likewise. * arch-utils.c: Likewise. * arm-linux-nat.c: Likewise. * arm-linux-tdep.c: Likewise. * arm-tdep.c: Likewise. * arm-wince-tdep.c: Likewise. * armbsd-tdep.c: Likewise. * armnbsd-nat.c: Likewise. * armnbsd-tdep.c: Likewise. * armobsd-tdep.c: Likewise. * avr-tdep.c: Likewise. * ax-gdb.c: Likewise. * ax-general.c: Likewise. * bcache.c: Likewise. * bfin-tdep.c: Likewise. * breakpoint.c: Likewise. * build-id.c: Likewise. * buildsym.c: Likewise. * c-exp.y: Likewise. * c-lang.c: Likewise. * c-typeprint.c: Likewise. * c-valprint.c: Likewise. * charset.c: Likewise. * cli-out.c: Likewise. * cli/cli-cmds.c: Likewise. * cli/cli-decode.c: Likewise. * cli/cli-dump.c: Likewise. * cli/cli-interp.c: Likewise. * cli/cli-logging.c: Likewise. * cli/cli-script.c: Likewise. * cli/cli-setshow.c: Likewise. * cli/cli-utils.c: Likewise. * coffread.c: Likewise. * common/agent.c: Likewise. * common/buffer.c: Likewise. * common/buffer.h: Likewise. * common/common-utils.c: Likewise. * common/filestuff.c: Likewise. * common/filestuff.c: Likewise. * common/format.c: Likewise. * common/print-utils.c: Likewise. * common/rsp-low.c: Likewise. * common/signals.c: Likewise. * common/vec.h: Likewise. * common/xml-utils.c: Likewise. * core-regset.c: Likewise. * corefile.c: Likewise. * corelow.c: Likewise. * cp-abi.c: Likewise. * cp-name-parser.y: Likewise. * cp-support.c: Likewise. * cp-valprint.c: Likewise. * cris-tdep.c: Likewise. * d-exp.y: Likewise. * darwin-nat.c: Likewise. * dbxread.c: Likewise. * dcache.c: Likewise. * demangle.c: Likewise. * dicos-tdep.c: Likewise. * disasm.c: Likewise. * doublest.c: Likewise. * dsrec.c: Likewise. * dummy-frame.c: Likewise. * dwarf2-frame.c: Likewise. * dwarf2loc.c: Likewise. * dwarf2read.c: Likewise. * elfread.c: Likewise. * environ.c: Likewise. * eval.c: Likewise. * event-loop.c: Likewise. * exceptions.c: Likewise. * exec.c: Likewise. * expprint.c: Likewise. * f-exp.y: Likewise. * f-lang.c: Likewise. * f-typeprint.c: Likewise. * f-valprint.c: Likewise. * fbsd-nat.c: Likewise. * findcmd.c: Likewise. * findvar.c: Likewise. * fork-child.c: Likewise. * frame.c: Likewise. * frv-linux-tdep.c: Likewise. * frv-tdep.c: Likewise. * gdb.c: Likewise. * gdb_bfd.c: Likewise. * gdbarch.c: Likewise. * gdbarch.sh: Likewise. * gdbtypes.c: Likewise. * gnu-nat.c: Likewise. * gnu-v2-abi.c: Likewise. * gnu-v3-abi.c: Likewise. * go-exp.y: Likewise. * go-lang.c: Likewise. * go32-nat.c: Likewise. * guile/guile.c: Likewise. * guile/scm-auto-load.c: Likewise. * hppa-hpux-tdep.c: Likewise. * hppa-linux-nat.c: Likewise. * hppanbsd-tdep.c: Likewise. * hppaobsd-tdep.c: Likewise. * i386-cygwin-tdep.c: Likewise. * i386-dicos-tdep.c: Likewise. * i386-linux-tdep.c: Likewise. * i386-nto-tdep.c: Likewise. * i386-sol2-tdep.c: Likewise. * i386-tdep.c: Likewise. * i386bsd-tdep.c: Likewise. * i386gnu-nat.c: Likewise. * i386nbsd-tdep.c: Likewise. * i386obsd-tdep.c: Likewise. * i387-tdep.c: Likewise. * ia64-libunwind-tdep.c: Likewise. * ia64-linux-nat.c: Likewise. * inf-child.c: Likewise. * inf-ptrace.c: Likewise. * inf-ttrace.c: Likewise. * infcall.c: Likewise. * infcmd.c: Likewise. * inflow.c: Likewise. * infrun.c: Likewise. * interps.c: Likewise. * iq2000-tdep.c: Likewise. * irix5-nat.c: Likewise. * jv-exp.y: Likewise. * jv-lang.c: Likewise. * jv-typeprint.c: Likewise. * jv-valprint.c: Likewise. * language.c: Likewise. * linux-fork.c: Likewise. * linux-nat.c: Likewise. * lm32-tdep.c: Likewise. * m2-exp.y: Likewise. * m2-typeprint.c: Likewise. * m32c-tdep.c: Likewise. * m32r-linux-nat.c: Likewise. * m32r-linux-tdep.c: Likewise. * m32r-rom.c: Likewise. * m32r-tdep.c: Likewise. * m68hc11-tdep.c: Likewise. * m68k-tdep.c: Likewise. * m68kbsd-tdep.c: Likewise. * m68klinux-nat.c: Likewise. * m68klinux-tdep.c: Likewise. * m88k-tdep.c: Likewise. * machoread.c: Likewise. * macrocmd.c: Likewise. * main.c: Likewise. * mdebugread.c: Likewise. * mem-break.c: Likewise. * memattr.c: Likewise. * memory-map.c: Likewise. * mep-tdep.c: Likewise. * mi/mi-cmd-break.c: Likewise. * mi/mi-cmd-disas.c: Likewise. * mi/mi-cmd-env.c: Likewise. * mi/mi-cmd-stack.c: Likewise. * mi/mi-cmd-var.c: Likewise. * mi/mi-cmds.c: Likewise. * mi/mi-console.c: Likewise. * mi/mi-getopt.c: Likewise. * mi/mi-interp.c: Likewise. * mi/mi-main.c: Likewise. * mi/mi-parse.c: Likewise. * microblaze-rom.c: Likewise. * microblaze-tdep.c: Likewise. * mingw-hdep.c: Likewise. * minidebug.c: Likewise. * minsyms.c: Likewise. * mips-irix-tdep.c: Likewise. * mips-linux-tdep.c: Likewise. * mips-tdep.c: Likewise. * mips64obsd-tdep.c: Likewise. * mipsnbsd-tdep.c: Likewise. * mipsread.c: Likewise. * mn10300-linux-tdep.c: Likewise. * mn10300-tdep.c: Likewise. * monitor.c: Likewise. * moxie-tdep.c: Likewise. * mt-tdep.c: Likewise. * nat/linux-btrace.c: Likewise. * nat/linux-osdata.c: Likewise. * nat/linux-procfs.c: Likewise. * nat/linux-ptrace.c: Likewise. * nat/linux-waitpid.c: Likewise. * nbsd-tdep.c: Likewise. * nios2-linux-tdep.c: Likewise. * nto-procfs.c: Likewise. * nto-tdep.c: Likewise. * objc-lang.c: Likewise. * objfiles.c: Likewise. * opencl-lang.c: Likewise. * osabi.c: Likewise. * osdata.c: Likewise. * p-exp.y: Likewise. * p-lang.c: Likewise. * p-typeprint.c: Likewise. * parse.c: Likewise. * posix-hdep.c: Likewise. * ppc-linux-nat.c: Likewise. * ppc-sysv-tdep.c: Likewise. * ppcfbsd-tdep.c: Likewise. * ppcnbsd-tdep.c: Likewise. * ppcobsd-tdep.c: Likewise. * printcmd.c: Likewise. * procfs.c: Likewise. * prologue-value.c: Likewise. * python/py-auto-load.c: Likewise. * python/py-gdb-readline.c: Likewise. * ravenscar-thread.c: Likewise. * regcache.c: Likewise. * registry.c: Likewise. * remote-fileio.c: Likewise. * remote-m32r-sdi.c: Likewise. * remote-mips.c: Likewise. * remote-notif.c: Likewise. * remote-sim.c: Likewise. * remote.c: Likewise. * reverse.c: Likewise. * rs6000-aix-tdep.c: Likewise. * ser-base.c: Likewise. * ser-go32.c: Likewise. * ser-mingw.c: Likewise. * ser-pipe.c: Likewise. * ser-tcp.c: Likewise. * ser-unix.c: Likewise. * serial.c: Likewise. * sh-tdep.c: Likewise. * sh64-tdep.c: Likewise. * shnbsd-tdep.c: Likewise. * skip.c: Likewise. * sol-thread.c: Likewise. * solib-dsbt.c: Likewise. * solib-frv.c: Likewise. * solib-osf.c: Likewise. * solib-som.c: Likewise. * solib-spu.c: Likewise. * solib-target.c: Likewise. * solib.c: Likewise. * somread.c: Likewise. * source.c: Likewise. * sparc-nat.c: Likewise. * sparc-sol2-tdep.c: Likewise. * sparc-tdep.c: Likewise. * sparc64-tdep.c: Likewise. * sparc64fbsd-tdep.c: Likewise. * sparc64nbsd-tdep.c: Likewise. * sparcnbsd-tdep.c: Likewise. * spu-linux-nat.c: Likewise. * spu-multiarch.c: Likewise. * spu-tdep.c: Likewise. * stabsread.c: Likewise. * stack.c: Likewise. * std-regs.c: Likewise. * symfile.c: Likewise. * symmisc.c: Likewise. * symtab.c: Likewise. * target.c: Likewise. * thread.c: Likewise. * tilegx-linux-nat.c: Likewise. * tilegx-tdep.c: Likewise. * top.c: Likewise. * tracepoint.c: Likewise. * tui/tui-command.c: Likewise. * tui/tui-data.c: Likewise. * tui/tui-disasm.c: Likewise. * tui/tui-file.c: Likewise. * tui/tui-layout.c: Likewise. * tui/tui-out.c: Likewise. * tui/tui-regs.c: Likewise. * tui/tui-source.c: Likewise. * tui/tui-stack.c: Likewise. * tui/tui-win.c: Likewise. * tui/tui-windata.c: Likewise. * tui/tui-winsource.c: Likewise. * typeprint.c: Likewise. * ui-file.c: Likewise. * ui-out.c: Likewise. * user-regs.c: Likewise. * utils.c: Likewise. * v850-tdep.c: Likewise. * valarith.c: Likewise. * valops.c: Likewise. * valprint.c: Likewise. * value.c: Likewise. * varobj.c: Likewise. * vax-tdep.c: Likewise. * vaxnbsd-tdep.c: Likewise. * vaxobsd-tdep.c: Likewise. * windows-nat.c: Likewise. * xcoffread.c: Likewise. * xml-support.c: Likewise. * xstormy16-tdep.c: Likewise. * xtensa-linux-nat.c: Likewise. gdb/gdbserver/ 2014-08-07 Gary Benson <gbenson@redhat.com> * server.h: Do not include string.h. * event-loop.c: Likewise. * linux-low.c: Likewise. * regcache.c: Likewise. * remote-utils.c: Likewise. * spu-low.c: Likewise. * utils.c: Likewise.
2014-07-29 16:06:51 +02:00
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include string.h.
* event-loop.c: Likewise.
* linux-low.c: Likewise.
* regcache.c: Likewise.
* remote-utils.c: Likewise.
* spu-low.c: Likewise.
* utils.c: Likewise.
Include gdb_assert.h in common-defs.h This commit includes gdb_assert.h in common-defs.h and removes all other inclusions. gdb/ 2014-08-07 Gary Benson <gbenson@redhat.com> * common/common-defs.h: Include gdb_assert.h. * aarch64-tdep.c: Do not include gdb_assert.h. * addrmap.c: Likewise. * aix-thread.c: Likewise. * alpha-linux-tdep.c: Likewise. * alpha-mdebug-tdep.c: Likewise. * alphanbsd-tdep.c: Likewise. * amd64-nat.c: Likewise. * amd64-tdep.c: Likewise. * amd64bsd-nat.c: Likewise. * amd64fbsd-nat.c: Likewise. * amd64fbsd-tdep.c: Likewise. * amd64nbsd-nat.c: Likewise. * amd64nbsd-tdep.c: Likewise. * amd64obsd-nat.c: Likewise. * amd64obsd-tdep.c: Likewise. * arch-utils.c: Likewise. * arm-tdep.c: Likewise. * armbsd-tdep.c: Likewise. * auxv.c: Likewise. * bcache.c: Likewise. * bfin-tdep.c: Likewise. * blockframe.c: Likewise. * breakpoint.c: Likewise. * bsd-kvm.c: Likewise. * bsd-uthread.c: Likewise. * buildsym.c: Likewise. * c-exp.y: Likewise. * c-lang.c: Likewise. * charset.c: Likewise. * cleanups.c: Likewise. * cli-out.c: Likewise. * cli/cli-decode.c: Likewise. * cli/cli-dump.c: Likewise. * cli/cli-logging.c: Likewise. * cli/cli-script.c: Likewise. * cli/cli-utils.c: Likewise. * coffread.c: Likewise. * common/common-utils.c: Likewise. * common/queue.h: Likewise. * common/signals.c: Likewise. * common/vec.h: Likewise. * complaints.c: Likewise. * completer.c: Likewise. * corelow.c: Likewise. * cp-abi.c: Likewise. * cp-name-parser.y: Likewise. * cp-namespace.c: Likewise. * cp-support.c: Likewise. * cris-tdep.c: Likewise. * dbxread.c: Likewise. * dictionary.c: Likewise. * doublest.c: Likewise. * dsrec.c: Likewise. * dummy-frame.c: Likewise. * dwarf2-frame-tailcall.c: Likewise. * dwarf2-frame.c: Likewise. * dwarf2expr.c: Likewise. * dwarf2loc.c: Likewise. * dwarf2read.c: Likewise. * eval.c: Likewise. * event-loop.c: Likewise. * exceptions.c: Likewise. * expprint.c: Likewise. * f-valprint.c: Likewise. * fbsd-nat.c: Likewise. * findvar.c: Likewise. * frame-unwind.c: Likewise. * frame.c: Likewise. * frv-tdep.c: Likewise. * gcore.c: Likewise. * gdb-dlfcn.c: Likewise. * gdb_bfd.c: Likewise. * gdbarch.c: Likewise. * gdbarch.sh: Likewise. * gdbtypes.c: Likewise. * gnu-nat.c: Likewise. * gnu-v3-abi.c: Likewise. * go-lang.c: Likewise. * guile/scm-exception.c: Likewise. * guile/scm-gsmob.c: Likewise. * guile/scm-lazy-string.c: Likewise. * guile/scm-math.c: Likewise. * guile/scm-pretty-print.c: Likewise. * guile/scm-safe-call.c: Likewise. * guile/scm-utils.c: Likewise. * guile/scm-value.c: Likewise. * h8300-tdep.c: Likewise. * hppa-hpux-nat.c: Likewise. * hppa-tdep.c: Likewise. * hppanbsd-tdep.c: Likewise. * hppaobsd-tdep.c: Likewise. * i386-darwin-nat.c: Likewise. * i386-darwin-tdep.c: Likewise. * i386-nto-tdep.c: Likewise. * i386-tdep.c: Likewise. * i386bsd-nat.c: Likewise. * i386fbsd-tdep.c: Likewise. * i386gnu-nat.c: Likewise. * i386nbsd-tdep.c: Likewise. * i386obsd-tdep.c: Likewise. * i387-tdep.c: Likewise. * ia64-libunwind-tdep.c: Likewise. * ia64-tdep.c: Likewise. * inf-ptrace.c: Likewise. * inf-ttrace.c: Likewise. * infcall.c: Likewise. * infcmd.c: Likewise. * infrun.c: Likewise. * inline-frame.c: Likewise. * interps.c: Likewise. * jv-lang.c: Likewise. * jv-typeprint.c: Likewise. * linux-fork.c: Likewise. * linux-nat.c: Likewise. * linux-thread-db.c: Likewise. * m32c-tdep.c: Likewise. * m32r-linux-nat.c: Likewise. * m32r-tdep.c: Likewise. * m68k-tdep.c: Likewise. * m68kbsd-nat.c: Likewise. * m68kbsd-tdep.c: Likewise. * m88k-tdep.c: Likewise. * machoread.c: Likewise. * macroexp.c: Likewise. * macrotab.c: Likewise. * maint.c: Likewise. * mdebugread.c: Likewise. * memory-map.c: Likewise. * mep-tdep.c: Likewise. * mi/mi-common.c: Likewise. * microblaze-tdep.c: Likewise. * mingw-hdep.c: Likewise. * mips-linux-nat.c: Likewise. * mips-linux-tdep.c: Likewise. * mips-tdep.c: Likewise. * mips64obsd-tdep.c: Likewise. * mipsnbsd-tdep.c: Likewise. * mn10300-linux-tdep.c: Likewise. * mn10300-tdep.c: Likewise. * moxie-tdep.c: Likewise. * mt-tdep.c: Likewise. * nat/linux-btrace.c: Likewise. * nat/linux-osdata.c: Likewise. * nat/linux-ptrace.c: Likewise. * nat/mips-linux-watch.c: Likewise. * nios2-linux-tdep.c: Likewise. * nios2-tdep.c: Likewise. * objc-lang.c: Likewise. * objfiles.c: Likewise. * obsd-nat.c: Likewise. * opencl-lang.c: Likewise. * osabi.c: Likewise. * parse.c: Likewise. * ppc-linux-nat.c: Likewise. * ppc-sysv-tdep.c: Likewise. * ppcfbsd-nat.c: Likewise. * ppcfbsd-tdep.c: Likewise. * ppcnbsd-nat.c: Likewise. * ppcnbsd-tdep.c: Likewise. * ppcobsd-nat.c: Likewise. * ppcobsd-tdep.c: Likewise. * printcmd.c: Likewise. * procfs.c: Likewise. * prologue-value.c: Likewise. * psymtab.c: Likewise. * python/py-lazy-string.c: Likewise. * python/py-value.c: Likewise. * regcache.c: Likewise. * reggroups.c: Likewise. * registry.c: Likewise. * remote-sim.c: Likewise. * remote.c: Likewise. * rs6000-aix-tdep.c: Likewise. * rs6000-tdep.c: Likewise. * s390-linux-tdep.c: Likewise. * score-tdep.c: Likewise. * ser-base.c: Likewise. * ser-mingw.c: Likewise. * sh-tdep.c: Likewise. * sh64-tdep.c: Likewise. * solib-darwin.c: Likewise. * solib-spu.c: Likewise. * solib-svr4.c: Likewise. * source.c: Likewise. * sparc-nat.c: Likewise. * sparc-sol2-tdep.c: Likewise. * sparc-tdep.c: Likewise. * sparc64-sol2-tdep.c: Likewise. * sparc64-tdep.c: Likewise. * sparc64fbsd-tdep.c: Likewise. * sparc64nbsd-tdep.c: Likewise. * sparc64obsd-tdep.c: Likewise. * sparcnbsd-tdep.c: Likewise. * sparcobsd-tdep.c: Likewise. * spu-multiarch.c: Likewise. * spu-tdep.c: Likewise. * stabsread.c: Likewise. * stack.c: Likewise. * symfile.c: Likewise. * symtab.c: Likewise. * target-descriptions.c: Likewise. * target-memory.c: Likewise. * target.c: Likewise. * tic6x-linux-tdep.c: Likewise. * tic6x-tdep.c: Likewise. * tilegx-linux-nat.c: Likewise. * tilegx-tdep.c: Likewise. * top.c: Likewise. * tramp-frame.c: Likewise. * tui/tui-out.c: Likewise. * tui/tui-winsource.c: Likewise. * ui-out.c: Likewise. * user-regs.c: Likewise. * utils.c: Likewise. * v850-tdep.c: Likewise. * valops.c: Likewise. * value.c: Likewise. * varobj.c: Likewise. * vax-nat.c: Likewise. * xml-syscall.c: Likewise. * xml-tdesc.c: Likewise. * xstormy16-tdep.c: Likewise. * xtensa-linux-nat.c: Likewise. * xtensa-tdep.c: Likewise. gdb/gdbserver/ 2014-08-07 Gary Benson <gbenson@redhat.com> * server.h: Do not include gdb_assert.h.
2014-07-29 15:47:21 +02:00
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include gdb_assert.h.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include common-utils.h.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include ptid.h.
* notif.h: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include gdb_locale.h.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include gdb/signals.h.
* win32-low.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include pathmax.h.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include libiberty.h.
* linux-bfin-low.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include ansidecl.h.
2014-08-07 Gary Benson <gbenson@redhat.com>
* linux-x86-low.c: Do not include stddef.h.
* lynx-ppc-low.c: Likewise.
* tracepoint.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include stdarg.h.
* nto-low.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include stdlib.h.
* inferiors.c: Likewise.
* linux-low.c: Likewise.
* regcache.c: Likewise.
* spu-low.c: Likewise.
* tracepoint.c: Likewise.
* utils.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* server.h: Do not include stdio.h.
* linux-low.c: Likewise.
* remote-utils.c: Likewise.
* spu-low.c: Likewise.
* utils.c: Likewise.
* wincecompat.c: Likewise.
2014-08-06 Gary Benson <gbenson@redhat.com>
* regcache.c (init_register_cache): Move conditionals inside if.
2014-08-06 Gary Benson <gbenson@redhat.com>
* linux-low.c (linux_supports_non_stop): Use target_is_async_p.
2014-07-31 Gary Benson <gbenson@redhat.com>
* ax.h: Do not include server.h.
* gdbthread.h: Likewise.
* lynx-low.h: Likewise.
* notif.h: Likewise.
2014-07-30 Gary Benson <gbenson@redhat.com>
* server.h: Include common-defs.h.
Do not include config.h or build-gnulib-gdbserver/config.h.
2014-07-30 Gary Benson <gbenson@redhat.com>
* hostio-errno.c: Move server.h to top of includes list.
* inferiors.c: Likewise.
* linux-x86-low.c: Likewise.
* notif.c: Include server.h.
2014-07-24 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* server.h (CORE_ADDR): Now unsigned.
2014-07-16 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
2014-07-15 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_kill_one_lwp): Save errno and work with saved
copy.
GDBserver crashes when killing a multi-thread process Here's an example, with the new test: gdbserver :9999 gdb.threads/kill gdb gdb.threads/kill (gdb) b 52 Breakpoint 1 at 0x4007f4: file kill.c, line 52. Continuing. Breakpoint 1, main () at kill.c:52 52 return 0; /* set break here */ (gdb) k Kill the program being debugged? (y or n) y gdbserver :9999 gdb.threads/kill Process gdb.base/watch_thread_num created; pid = 9719 Listening on port 1234 Remote debugging from host 127.0.0.1 Killing all inferiors Segmentation fault (core dumped) Backtrace: (gdb) bt #0 0x00000000004068a0 in find_inferior (list=0x66b060 <all_threads>, func=0x427637 <kill_one_lwp_callback>, arg=0x7fffffffd3fc) at src/gdb/gdbserver/inferiors.c:199 #1 0x00000000004277b6 in linux_kill (pid=15708) at src/gdb/gdbserver/linux-low.c:966 #2 0x000000000041354d in kill_inferior (pid=15708) at src/gdb/gdbserver/target.c:163 #3 0x00000000004107e9 in kill_inferior_callback (entry=0x6704f0) at src/gdb/gdbserver/server.c:2934 #4 0x0000000000406522 in for_each_inferior (list=0x66b050 <all_processes>, action=0x4107a6 <kill_inferior_callback>) at src/gdb/gdbserver/inferiors.c:57 #5 0x0000000000412377 in process_serial_event () at src/gdb/gdbserver/server.c:3767 #6 0x000000000041267c in handle_serial_event (err=0, client_data=0x0) at src/gdb/gdbserver/server.c:3880 #7 0x00000000004189ff in handle_file_event (event_file_desc=4) at src/gdb/gdbserver/event-loop.c:434 #8 0x00000000004181c6 in process_event () at src/gdb/gdbserver/event-loop.c:189 #9 0x0000000000418f45 in start_event_loop () at src/gdb/gdbserver/event-loop.c:552 #10 0x0000000000411272 in main (argc=3, argv=0x7fffffffd8d8) at src/gdb/gdbserver/server.c:3283 The problem is that linux_wait_for_event deletes lwps that have exited (even those not passed in as lwps of interest), while the lwp/thread list is being walked on with find_inferior. find_inferior can handle the current iterated inferior being deleted, but not others. When killing lwps, we don't really care about any of the pending status handling of linux_wait_for_event. We can just waitpid the lwps directly, which is also what GDB does (see linux-nat.c:kill_wait_callback). This way the lwps are not deleted while we're walking the list. They'll be deleted by linux_mourn afterwards. This crash triggers several times when running the testsuite against GDBserver with the native-gdbserver board (target remote), but as GDB can't distinguish between GDBserver crashing and "kill" being sucessful, as in both cases the connection is closed (the 'k' packet doesn't require a reply), and the inferior is gone, that results in no FAIL. The patch adds a generic test that catches the issue with extended-remote mode (and works fine with native testing too). Here's how it fails with the native-extended-gdbserver board without the fix: (gdb) info threads Id Target Id Frame 6 Thread 15367.15374 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81 5 Thread 15367.15373 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81 4 Thread 15367.15372 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81 3 Thread 15367.15371 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81 2 Thread 15367.15370 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81 * 1 Thread 15367.15367 main () at .../gdb.threads/kill.c:52 (gdb) kill Kill the program being debugged? (y or n) y Remote connection closed ^^^^^^^^^^^^^^^^^^^^^^^^ (gdb) FAIL: gdb.threads/kill.exp: kill Extended remote should remain connected after the kill. gdb/gdbserver/ 2014-07-11 Pedro Alves <palves@redhat.com> * linux-low.c (kill_wait_lwp): New function, based on kill_one_lwp_callback, but use my_waitpid directly. (kill_one_lwp_callback, linux_kill): Use it. gdb/testsuite/ 2014-07-11 Pedro Alves <palves@redhat.com> * gdb.threads/kill.c: New file. * gdb.threads/kill.exp: New file.
2014-07-11 12:07:13 +02:00
2014-07-11 Pedro Alves <palves@redhat.com>
* linux-low.c (kill_wait_lwp): New function, based on
kill_one_lwp_callback, but use my_waitpid directly.
(kill_one_lwp_callback, linux_kill): Use it.
x86 Linux watchpoints: Couldn't write debug register: Invalid argument. This patch fixes this on x86 Linux: (gdb) watch *buf@2 Hardware watchpoint 8: *buf@2 (gdb) si 0x00000000004005a7 34 for (i = 0; i < 100000; i++); /* stepi line */ (gdb) del Delete all breakpoints? (y or n) y (gdb) watch *(buf+1)@1 Hardware watchpoint 9: *(buf+1)@1 (gdb) si 0x00000000004005a7 in main () at ../../../src/gdb/testsuite/gdb.base/watchpoint-reuse-slot.c:34 34 for (i = 0; i < 100000; i++); /* stepi line */ Couldn't write debug register: Invalid argument. (gdb) In the example above the debug registers are being switched from this state: CONTROL (DR7): 0000000000050101 STATUS (DR6): 0000000000000000 DR0: addr=0x0000000000601040, ref.count=1 DR1: addr=0x0000000000000000, ref.count=0 DR2: addr=0x0000000000000000, ref.count=0 DR3: addr=0x0000000000000000, ref.count=0 to this: CONTROL (DR7): 0000000000010101 STATUS (DR6): 0000000000000000 DR0: addr=0x0000000000601041, ref.count=1 DR1: addr=0x0000000000000000, ref.count=0 DR2: addr=0x0000000000000000, ref.count=0 DR3: addr=0x0000000000000000, ref.count=0 That is, before, DR7 was setup for watching a 2 byte region starting at what's in DR0 (0x601040). And after, DR7 is setup for watching a 1 byte region starting at what's in DR0 (0x601041). We always write DR0..DR3 before DR7, because if we enable a slot's bits in DR7, you need to have already written the corresponding DR0..DR3 registers -- the kernel rejects the DR7 write with EINVAL otherwise. The error shown above is the opposite scenario. When we try to write 0x601041 to DR0, DR7's bits still indicate intent of watching a 2-byte region. That DR0/DR7 combination is invalid, because 0x601041 is unaligned. To watch two bytes, we'd have to use two slots. So the kernel errors out with EINVAL. Fix this by always first clearing DR7, then writing DR0..DR3, and then setting DR7's bits. A little optimization -- if we're disabling the last watchpoint, then we can clear DR7 just once. The changes to nat/i386-dregs.c make that easier to detect, and as bonus, they make it a little easier to make sense of DR7 in the debug logs, as we no longer need to remember we're seeing stale bits. Tested on x86_64 Fedora 20, native and GDBserver. This adds an exhaustive test that switches between many different combinations of watchpoint types and addresses and widths. gdb/ 2014-06-23 Pedro Alves <palves@redhat.com> * amd64-linux-nat.c (amd64_linux_prepare_to_resume): Clear DR_CONTROL before setting DR0..DR3. * i386-linux-nat.c (i386_linux_prepare_to_resume): Likewise. * nat/i386-dregs.c (i386_remove_aligned_watchpoint): Clear all bits of DR_CONTROL related to the debug register slot being disabled. If all slots are vacant, clear local slowdown as well, and assert DR_CONTROL is 0. gdb/gdbserver/ 2014-06-23 Pedro Alves <palves@redhat.com> * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL before setting DR0..DR3. gdb/testsuite/ 2014-06-23 Pedro Alves <palves@redhat.com> * gdb.base/watchpoint-reuse-slot.c: New file. * gdb.base/watchpoint-reuse-slot.exp: New file.
2014-06-23 17:44:04 +02:00
2014-06-23 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
before setting DR0..DR3.
2014-06-20 Gary Benson <gbenson@redhat.com>
* configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
* configure: Regenerated.
* config.in: Likewise.
Move shared native target specific code to gdb/nat https://sourceware.org/gdb/wiki/Common describes the following directory structure: gdb/nat/ Native target backend files. Code that interfaces with the host debug API. E.g., ptrace code, Windows debug API code, procfs code should go here. gdb/target/ Host-independent, target vector specific code (target_ops). gdb/common/ All other shared code. This commit moves all native target backend files currently in gdb/common to gdb/nat. gdb/ 2014-06-20 Gary Benson <gbenson@redhat.com> * common/gdb_thread_db.h: Moved to nat. All includes updated. * common/glibc_thread_db.h: Likewise. * common/i386-cpuid.h: Likewise. * common/i386-gcc-cpuid.h: Likewise. * common/linux-btrace.h: Likewise. * common/linux-osdata.h: Likewise. * common/linux-procfs.h: Likewise. * common/linux-ptrace.h: Likewise. * common/mips-linux-watch.h: Likewise. * common/linux-btrace.c: Moved to nat. * common/linux-osdata.c: Likewise. * common/linux-procfs.c: Likewise. * common/linux-ptrace.c: Likewise. * common/mips-linux-watch.c: Likewise. * nat/gdb_thread_db.h: Moved from common. * nat/glibc_thread_db.h: Likewise. * nat/i386-cpuid.h: Likewise. * nat/i386-gcc-cpuid.h: Likewise. * nat/linux-btrace.c: Likewise. * nat/linux-btrace.h: Likewise. * nat/linux-osdata.c: Likewise. * nat/linux-osdata.h: Likewise. * nat/linux-procfs.c: Likewise. * nat/linux-procfs.h: Likewise. * nat/linux-ptrace.c: Likewise. * nat/linux-ptrace.h: Likewise. * nat/mips-linux-watch.c: Likewise. * nat/mips-linux-watch.h: Likewise. * Makefile.in (HFILES_NO_SRCDIR): Reflect new locations. (object file files): Reordered. * gdb/copyright.py (EXCLUDE_LIST): Reflect new location of glibc_thread_db.h. gdb/gdbserver/ 2014-06-20 Gary Benson <gbenson@redhat.com> * Makefile.in (SFILES): Update locations for files moved from common to nat. (object file files): Reordered. gdb/testsuite/ 2014-06-20 Gary Benson <gbenson@redhat.com> * gdb.arch/i386-avx.exp: Fix include file location. * gdb.arch/i386-sse.exp: Likewise.
2014-06-19 15:46:38 +02:00
2014-06-20 Gary Benson <gbenson@redhat.com>
* Makefile.in (SFILES): Update locations for files moved
from common to nat.
(object file files): Reordered.
Vectorize gdbserver x86 debug register accessors This commit makes gdbserver access the x86 debug register accessor functions via the same function vector as GDB proper. This removes a chunk of conditional code that was previously in i386-{nat,low}.h and leaves a single macro as the only GDB/gdbserver difference in nat/i386-dregs.c. gdb/ 2014-06-20 Gary Benson <gbenson@redhat.com> * i386-nat.h (debug_hw_points): Moved to nat/i386-dregs.c. (i386_dr_low_type): Moved to nat/i386-dregs.h. (i386_dr_low): Likewise. (i386_dr_low_can_set_addr): Moved to nat/i386-dregs.c. (i386_dr_low_set_addr): Likewise. (i386_dr_low_get_addr): Likewise. (i386_dr_low_can_set_control): Likewise. (i386_dr_low_set_control): Likewise. (i386_dr_low_get_control): Likewise. (i386_dr_low_get_status): Likewise. (i386_get_debug_register_length): Likewise. * nat/i386-dregs.h (i386_dr_low_type): Moved from i386-nat.h. (i386_dr_low): Likewise. * nat/i386-dregs.c (i386-low.h): Remove include. (i386-nat.h): Likewise. (nat/i386-dregs.h): New include. (i386_dr_low_can_set_addr): Moved from i386-nat.h. (i386_dr_low_set_addr): Likewise. (i386_dr_low_get_addr): Likewise. (i386_dr_low_can_set_control): Likewise. (i386_dr_low_set_control): Likewise. (i386_dr_low_get_control): Likewise. (i386_dr_low_get_status): Likewise. (i386_get_debug_register_length): Likewise. (debug_hw_points): Likewise. gdb/gdbserver/ 2014-06-20 Gary Benson <gbenson@redhat.com> * i386-low.h (i386_dr_low_can_set_addr): Removed. (i386_dr_low_set_addr): Likewise. (i386_dr_low_get_addr): Likewise. (i386_dr_low_can_set_control): Likewise. (i386_dr_low_set_control): Likewise. (i386_dr_low_get_control): Likewise. (i386_dr_low_get_status): Likewise. (i386_get_debug_register_length): Likewise. * linux-x86-low.c (i386_dr_low_set_addr): Changed signature. Made static. (i386_dr_low_get_addr): Likewise. (i386_dr_low_set_control): Likewise. (i386_dr_low_get_control): Likewise. (i386_dr_low_get_status): Likewise. (i386_dr_low): New global variable. * win32-i386-low.c (i386_dr_low_set_addr): Changed signature. Made static. (i386_dr_low_get_addr): Likewise. (i386_dr_low_set_control): Likewise. (i386_dr_low_get_control): Likewise. (i386_dr_low_get_status): Likewise. (i386_dr_low): New global variable.
2014-06-19 12:55:26 +02:00
2014-06-20 Gary Benson <gbenson@redhat.com>
* i386-low.h (i386_dr_low_can_set_addr): Removed.
(i386_dr_low_set_addr): Likewise.
(i386_dr_low_get_addr): Likewise.
(i386_dr_low_can_set_control): Likewise.
(i386_dr_low_set_control): Likewise.
(i386_dr_low_get_control): Likewise.
(i386_dr_low_get_status): Likewise.
(i386_get_debug_register_length): Likewise.
* linux-x86-low.c (i386_dr_low_set_addr):
Changed signature. Made static.
(i386_dr_low_get_addr): Likewise.
(i386_dr_low_set_control): Likewise.
(i386_dr_low_get_control): Likewise.
(i386_dr_low_get_status): Likewise.
(i386_dr_low): New global variable.
* win32-i386-low.c (i386_dr_low_set_addr):
Changed signature. Made static.
(i386_dr_low_get_addr): Likewise.
(i386_dr_low_set_control): Likewise.
(i386_dr_low_get_control): Likewise.
(i386_dr_low_get_status): Likewise.
(i386_dr_low): New global variable.
2014-06-20 Marcus Shawcroft <marcus.shawcroft@arm.com>
* configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
* Makefile.in (AR, AR_FLAGS): Define.
* configure: Regenerate.
Create nat/i386-dregs.c This commit moves code to be shared from i386-{nat,low}.[ch] into a new file, nat/i386-dregs.c. gdb/ 2014-06-19 Gary Benson <gbenson@redhat.com> * nat/i386-dregs.c: New file. * Makefile.in (i386-dregs.o): New rule. * config/i386/cygwin.mh (NATDEPFILES): Add i386-dregs.o. * config/i386/cygwin64.mh (NATDEPFILES): Likewise. * config/i386/darwin.mh (NATDEPFILES): Likewise. * config/i386/fbsd.mh (NATDEPFILES): Likewise. * config/i386/fbsd64.mh (NATDEPFILES): Likewise. * config/i386/go32.mh (NATDEPFILES): Likewise. * config/i386/linux.mh (NATDEPFILES): Likewise. * config/i386/linux64.mh (NATDEPFILES): Likewise. * config/i386/mingw.mh (NATDEPFILES): Likewise. * config/i386/mingw64.mh (NATDEPFILES): Likewise. * i386-nat.h (debug_hw_points): New declaration. * i386-nat.c (breakpoint.h): Remove include. (command.h): Likewise. (target.h): Likewise. (gdb_assert.h): Likewise. (debug_hw_points): Made nonstatic. (debug_printf): Now in i386-dregs.c. (TARGET_HAS_DR_LEN_8): Likewise. (DR_CONTROL_SHIFT): Likewise. (DR_CONTROL_SIZE): Likewise. (DR_RW_EXECUTE): Likewise. (DR_RW_WRITE): Likewise. (DR_RW_READ): Likewise. (DR_RW_IORW): Likewise. (DR_LEN_1): Likewise. (DR_LEN_2): Likewise. (DR_LEN_4): Likewise. (DR_LEN_8): Likewise. (DR_LOCAL_ENABLE_SHIFT): Likewise. (DR_GLOBAL_ENABLE_SHIFT): Likewise. (DR_ENABLE_SIZE): Likewise. (DR_LOCAL_SLOWDOWN): Likewise. (DR_GLOBAL_SLOWDOWN): Likewise. (DR_CONTROL_RESERVED): Likewise. (I386_DR_CONTROL_MASK): Likewise. (I386_DR_VACANT): Likewise. (I386_DR_LOCAL_ENABLE): Likewise. (I386_DR_GLOBAL_ENABLE): Likewise. (I386_DR_DISABLE): Likewise. (I386_DR_SET_RW_LEN): Likewise. (I386_DR_GET_RW_LEN): Likewise. (I386_DR_WATCH_HIT): Likewise. (i386_wp_op_t): Likewise. (i386_show_dr): Likewise. (i386_length_and_rw_bits): Likewise. (i386_insert_aligned_watchpoint): Likewise. (i386_remove_aligned_watchpoint): Likewise. (i386_handle_nonaligned_watchpoint): Likewise. (i386_update_inferior_debug_regs): Likewise. (i386_insert_watchpoint): Use i386_dr_insert_watchpoint. (i386_remove_watchpoint): Use i386_dr_remove_watchpoint. (i386_region_ok_for_watchpoint): Use i386_dr_region_ok_for_watchpoint. (i386_stopped_data_address): Use i386_dr_stopped_data_address. gdb/gdbserver/ 2014-06-19 Gary Benson <gbenson@redhat.com> * Makefile.in (i386-dregs.o): New rule. * configure.srv: Add i386-dregs.o to all targets using i386-low.o. * i386-low.c (target.h): Remove include. (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c. (DR_CONTROL_SHIFT): Likewise. (DR_CONTROL_SIZE): Likewise. (DR_RW_EXECUTE): Likewise. (DR_RW_WRITE): Likewise. (DR_RW_READ): Likewise. (DR_RW_IORW): Likewise. (DR_LEN_1): Likewise. (DR_LEN_2): Likewise. (DR_LEN_4): Likewise. (DR_LEN_8): Likewise. (DR_LOCAL_ENABLE_SHIFT): Likewise. (DR_GLOBAL_ENABLE_SHIFT): Likewise. (DR_ENABLE_SIZE): Likewise. (DR_LOCAL_SLOWDOWN): Likewise. (DR_GLOBAL_SLOWDOWN): Likewise. (DR_CONTROL_RESERVED): Likewise. (I386_DR_CONTROL_MASK): Likewise. (I386_DR_VACANT): Likewise. (I386_DR_LOCAL_ENABLE): Likewise. (I386_DR_GLOBAL_ENABLE): Likewise. (I386_DR_DISABLE): Likewise. (I386_DR_SET_RW_LEN): Likewise. (I386_DR_GET_RW_LEN): Likewise. (I386_DR_WATCH_HIT): Likewise. (i386_wp_op_t): Likewise. (i386_show_dr): Likewise. (i386_length_and_rw_bits): Likewise. (i386_insert_aligned_watchpoint): Likewise. (i386_remove_aligned_watchpoint): Likewise. (i386_handle_nonaligned_watchpoint): Likewise. i386_update_inferior_debug_regs(): Likewise. (i386_dr_insert_watchpoint): Likewise. (i386_dr_remove_watchpoint): Likewise. (i386_dr_region_ok_for_watchpoint): Likewise. (i386_dr_stopped_data_address): Likewise. (i386_dr_stopped_by_watchpoint): Likewise.
2014-06-19 11:53:12 +02:00
2014-06-19 Gary Benson <gbenson@redhat.com>
* Makefile.in (i386-dregs.o): New rule.
* configure.srv: Add i386-dregs.o to all targets using i386-low.o.
* i386-low.c (target.h): Remove include.
(TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
(DR_CONTROL_SHIFT): Likewise.
(DR_CONTROL_SIZE): Likewise.
(DR_RW_EXECUTE): Likewise.
(DR_RW_WRITE): Likewise.
(DR_RW_READ): Likewise.
(DR_RW_IORW): Likewise.
(DR_LEN_1): Likewise.
(DR_LEN_2): Likewise.
(DR_LEN_4): Likewise.
(DR_LEN_8): Likewise.
(DR_LOCAL_ENABLE_SHIFT): Likewise.
(DR_GLOBAL_ENABLE_SHIFT): Likewise.
(DR_ENABLE_SIZE): Likewise.
(DR_LOCAL_SLOWDOWN): Likewise.
(DR_GLOBAL_SLOWDOWN): Likewise.
(DR_CONTROL_RESERVED): Likewise.
(I386_DR_CONTROL_MASK): Likewise.
(I386_DR_VACANT): Likewise.
(I386_DR_LOCAL_ENABLE): Likewise.
(I386_DR_GLOBAL_ENABLE): Likewise.
(I386_DR_DISABLE): Likewise.
(I386_DR_SET_RW_LEN): Likewise.
(I386_DR_GET_RW_LEN): Likewise.
(I386_DR_WATCH_HIT): Likewise.
(i386_wp_op_t): Likewise.
(i386_show_dr): Likewise.
(i386_length_and_rw_bits): Likewise.
(i386_insert_aligned_watchpoint): Likewise.
(i386_remove_aligned_watchpoint): Likewise.
(i386_handle_nonaligned_watchpoint): Likewise.
i386_update_inferior_debug_regs(): Likewise.
(i386_dr_insert_watchpoint): Likewise.
(i386_dr_remove_watchpoint): Likewise.
(i386_dr_region_ok_for_watchpoint): Likewise.
(i386_dr_stopped_data_address): Likewise.
(i386_dr_stopped_by_watchpoint): Likewise.
Partially revert 4be83cc2b28ea09aa8ff789839e6520df60836f8 The above commit did two things: 1) A number of functions were renamed and made nonstatic. 2) A number of other functions were renamed only. This commit reverts #1 but not #2. In addition, prototypes for functions now remade static have been removed from i386-dregs.h. gdb/ 2014-06-19 Gary Benson <gbenson@redhat.com> * i386-nat.c (i386_dr_show): Renamed to i386_show_dr and made static. All uses updated. (i386_dr_length_and_rw_bits): Renamed to i386_length_and_rw_bits and made static. All uses updated. (i386_dr_insert_aligned_watchpoint): Renamed to i386_insert_aligned_watchpoint and made static. All uses updated. (i386_dr_remove_aligned_watchpoint): Renamed to i386_remove_aligned_watchpoint and made static. All uses updated. (i386_dr_update_inferior_debug_regs): Renamed to i386_update_inferior_debug_regs and made static. All uses updated. * nat/i386-dregs.h (i386_dr_show): Removed. (i386_dr_length_and_rw_bits): Likewise. (i386_dr_insert_aligned_watchpoint): Likewise. (i386_dr_remove_aligned_watchpoint): Likewise. (i386_dr_update_inferior_debug_regs): Likewise. gdb/gdbserver/ 2014-06-19 Gary Benson <gbenson@redhat.com> * i386-low.c (i386_dr_show): Renamed to i386_show_dr and made static. All uses updated. (i386_dr_length_and_rw_bits): Renamed to i386_length_and_rw_bits and made static. All uses updated. (i386_dr_insert_aligned_watchpoint): Renamed to i386_insert_aligned_watchpoint and made static. All uses updated. (i386_dr_remove_aligned_watchpoint): Renamed to i386_remove_aligned_watchpoint and made static. All uses updated. (i386_dr_update_inferior_debug_regs): Renamed to i386_update_inferior_debug_regs and made static. All uses updated.
2014-06-18 16:17:02 +02:00
2014-06-19 Gary Benson <gbenson@redhat.com>
* i386-low.c (i386_dr_show): Renamed to
i386_show_dr and made static. All uses updated.
(i386_dr_length_and_rw_bits): Renamed to
i386_length_and_rw_bits and made static.
All uses updated.
(i386_dr_insert_aligned_watchpoint): Renamed to
i386_insert_aligned_watchpoint and made static.
All uses updated.
(i386_dr_remove_aligned_watchpoint): Renamed to
i386_remove_aligned_watchpoint and made static.
All uses updated.
(i386_dr_update_inferior_debug_regs): Renamed to
i386_update_inferior_debug_regs and made static.
All uses updated.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.h (i386_dr_low_can_set_addr): New macro.
(i386_dr_low_can_set_control): Likewise.
(i386_get_debug_register_length): Likewise.
* i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
(i386_dr_low_can_set_control): Likewise.
(i386_get_debug_register_length): Likewise.
2014-06-17 Gary Benson <gbenson@redhat.com>
* i386-low.h (i386-dregs.h): New include.
(DR_FIRSTADDR): Now in i386-dregs.h.
(DR_LASTADDR): Likewise.
(DR_NADDR): Likewise.
(DR_STATUS): Likewise.
(DR_CONTROL): Likewise.
(i386_debug_reg_state): Likewise.
(i386_dr_insert_watchpoint): Likewise.
(i386_dr_remove_watchpoint): Likewise.
(i386_dr_region_ok_for_watchpoint): Likewise.
(i386_dr_stopped_data_address): Likewise.
(i386_dr_stopped_by_watchpoint): Likewise.
* i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
Rename functions and make nonstatic as necessary This commit renames the functions that are to be shared. Functions to be shared that were static are made nonstatic. gdb/ 2014-06-18 Gary Benson <gbenson@redhat.com> * i386-nat.c (i386_show_dr): Renamed to i386_dr_show and made nonstatic. All uses updated. (i386_length_and_rw_bits): Renamed to i386_dr_length_and_rw_bits and made nonstatic. All uses updated. (i386_insert_aligned_watchpoint): Renamed to i386_dr_insert_aligned_watchpoint and made nonstatic. All uses updated. (i386_remove_aligned_watchpoint): Renamed to i386_dr_remove_aligned_watchpoint and made nonstatic. All uses updated. (i386_update_inferior_debug_regs): Renamed to i386_dr_update_inferior_debug_regs and made nonstatic. All uses updated. gdb/gdbserver/ 2014-06-18 Gary Benson <gbenson@redhat.com> * i386-low.h (i386_low_insert_watchpoint): Renamed to i386_dr_insert_watchpoint. (i386_low_remove_watchpoint): Renamed to i386_dr_remove_watchpoint. (i386_low_region_ok_for_watchpoint): Renamed to i386_dr_region_ok_for_watchpoint. (i386_low_stopped_data_address): Renamed to i386_dr_stopped_data_address. (i386_low_stopped_by_watchpoint): Renamed to i386_dr_stopped_by_watchpoint. * i386-low.c (i386_show_dr): Renamed to i386_dr_show and made nonstatic. All uses updated. (i386_length_and_rw_bits): Renamed to i386_dr_length_and_rw_bits and made nonstatic. All uses updated. (i386_insert_aligned_watchpoint): Renamed to i386_dr_insert_aligned_watchpoint and made nonstatic. All uses updated. (i386_remove_aligned_watchpoint): Renamed to i386_dr_remove_aligned_watchpoint and made nonstatic. All uses updated. (i386_update_inferior_debug_regs): Renamed to i386_dr_update_inferior_debug_regs and made nonstatic. All uses updated. (i386_low_insert_watchpoint): Renamed to i386_dr_insert_watchpoint. All uses updated. (i386_low_remove_watchpoint): Renamed to i386_dr_remove_watchpoint. All uses updated. (i386_low_region_ok_for_watchpoint): Renamed to i386_dr_region_ok_for_watchpoint. All uses updated. (i386_low_stopped_data_address): Renamed to i386_dr_stopped_data_address. All uses updated. (i386_low_stopped_by_watchpoint): Renamed to i386_dr_stopped_by_watchpoint. All uses updated.
2014-06-16 12:06:43 +02:00
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.h (i386_low_insert_watchpoint): Renamed to
i386_dr_insert_watchpoint.
(i386_low_remove_watchpoint): Renamed to
i386_dr_remove_watchpoint.
(i386_low_region_ok_for_watchpoint): Renamed to
i386_dr_region_ok_for_watchpoint.
(i386_low_stopped_data_address): Renamed to
i386_dr_stopped_data_address.
(i386_low_stopped_by_watchpoint): Renamed to
i386_dr_stopped_by_watchpoint.
* i386-low.c (i386_show_dr): Renamed to
i386_dr_show and made nonstatic. All uses updated.
(i386_length_and_rw_bits): Renamed to
i386_dr_length_and_rw_bits and made nonstatic.
All uses updated.
(i386_insert_aligned_watchpoint): Renamed to
i386_dr_insert_aligned_watchpoint and made nonstatic.
All uses updated.
(i386_remove_aligned_watchpoint): Renamed to
i386_dr_remove_aligned_watchpoint and made nonstatic.
All uses updated.
(i386_update_inferior_debug_regs): Renamed to
i386_dr_update_inferior_debug_regs and made nonstatic.
All uses updated.
(i386_low_insert_watchpoint): Renamed to
i386_dr_insert_watchpoint. All uses updated.
(i386_low_remove_watchpoint): Renamed to
i386_dr_remove_watchpoint. All uses updated.
(i386_low_region_ok_for_watchpoint): Renamed to
i386_dr_region_ok_for_watchpoint. All uses updated.
(i386_low_stopped_data_address): Renamed to
i386_dr_stopped_data_address. All uses updated.
(i386_low_stopped_by_watchpoint): Renamed to
i386_dr_stopped_by_watchpoint. All uses updated.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.c (i386_dr_low_can_set_addr): New macro.
(i386_dr_low_can_set_control): Likewise.
(i386_insert_aligned_watchpoint): New check.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
Renamed to state.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.c (i386_length_and_rw_bits): Use internal_error
instead of fatal and error.
(i386_handle_nonaligned_watchpoint): Likewise.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.c (i386_get_debug_register_length): New macro.
(TARGET_HAS_DR_LEN_8): Remove conditional. Use above macro.
(i386_show_dr): Use debug_printf instead of fprintf. Use
phex to format values.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.h: Comment changes.
* i386-low.c: Likewise.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-low.c: Whitespace changes.
2014-06-12 Tom Tromey <tromey@redhat.com>
* utils.c (freeargv): Remove.
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.
Make it easy to make --disable-werror the default for both binutils and gdb The goal of this patch is to provide an easy way to make --disable-werror the default when building binutils, or the parts of binutils that need to get built when building GDB. In development mode, we want to continue making -Werror the default with GCC. But, when making releases, I think we want to make it as easy as possible for regular users to successfully build from sources. GDB already has this kind of feature to turn -Werror as well as the use of the libmcheck library. As GDB Release Manager, I take advantage of it to turn those off after having cut the branch. I'd like to be able to do the same for the binutils bits. And perhaps Tristan will want to do the same for his releases too (not sure, binutils builders might be a little savvier than GDB builders). This patch introduces a new file, called development.sh, which just sets a variable called $development. In our development branches (Eg. "master"), it's set to true. But setting it to false would allow us to change the default behavior of various development-related features to be turned off; in this case, it turns off the use of -Werror by default (use --enable-werror to turn it back on). bfd/ChangeLog: * development.sh: New file. * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh. Make -Werror the default with GCC only if DEVELOPMENT is true. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add $(srcdir)/development.sh. * Makefile.in, configure: Regenerate. binutils/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gas/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gold/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New. * Makefile.in, configure: Regenerate. gprof/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. ld/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. opcodes/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gdb/ChangeLog: * development.sh: Delete. * Makefile.in (config.status): Adjust dependency on development.sh. * configure.ac: Adjust development.sh source call. * configure: Regenerate. gdb/gdbserver/ChangeLog: * configure.ac: Adjust development.sh source call. * Makefile.in (config.status): Adjust dependency on development.sh. * configure: Regenerate. Tested on x86_64-linux by building two ways: One with DEVELOPMENT set to true, and one with DEVELOPMENT set to false. In the first case, I could see the use of -Werror, while it disappeared in the second case.
2014-05-19 23:46:01 +02:00
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* development.sh: Delete.
* Makefile.in (config.status): Adjust dependency on development.sh.
* configure.ac: Adjust development.sh source call.
* configure: Regenerate.
2014-06-02 Pedro Alves <palves@redhat.com>
* ax.c (gdb_free_agent_expr): New function.
* ax.h (gdb_free_agent_expr): New declaration.
* mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
list.
(clear_breakpoint_conditions, clear_breakpoint_commands): Make
static.
(clear_breakpoint_conditions_and_commands): New function.
* mem-break.h (clear_breakpoint_conditions): Delete declaration.
(clear_breakpoint_conditions_and_commands): New declaration.
2014-05-23 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* linux-aarch64-low.c (asm/ptrace.h): Include.
Fix TLS access for -static -pthread I have posted: TLS variables access for -static -lpthread executables https://sourceware.org/ml/libc-help/2014-03/msg00024.html and the GDB patch below has been confirmed as OK for current glibcs. Further work should be done for newer glibcs: Improve TLS variables glibc compatibility https://sourceware.org/bugzilla/show_bug.cgi?id=16954 Still the patch below implements the feature in a fully functional way backward compatible with current glibcs, it depends on the following glibc source line: csu/libc-tls.c main_map->l_tls_modid = 1; gdb/ 2014-05-21 Jan Kratochvil <jan.kratochvil@redhat.com> Fix TLS access for -static -pthread. * linux-thread-db.c (struct thread_db_info): Add td_thr_tlsbase_p. (try_thread_db_load_1): Initialize it. (thread_db_get_thread_local_address): Call it if LM is zero. * target.c (target_translate_tls_address): Remove LM_ADDR zero check. * target.h (struct target_ops) (to_get_thread_local_address): Add load_module_addr comment. gdb/gdbserver/ 2014-05-21 Jan Kratochvil <jan.kratochvil@redhat.com> Fix TLS access for -static -pthread. * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p. (thread_db_get_tls_address): Call it if LOAD_MODULE is zero. (thread_db_load_search, try_thread_db_load_1): Initialize it. gdb/testsuite/ 2014-05-21 Jan Kratochvil <jan.kratochvil@redhat.com> Fix TLS access for -static -pthread. * gdb.threads/staticthreads.c <HAVE_TLS> (tlsvar): New. <HAVE_TLS> (thread_function, main): Initialize it. * gdb.threads/staticthreads.exp: Try gdb_compile_pthreads for $have_tls. Add clean_restart. <$have_tls != "">: Check TLSVAR. Message-ID: <20140410115204.GB16411@host2.jankratochvil.net>
2014-05-21 16:25:53 +02:00
2014-05-21 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix TLS access for -static -pthread.
* gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
(thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
(thread_db_load_search, try_thread_db_load_1): Initialize it.
[GDBserver] Make Zx/zx packet handling idempotent. This patch fixes hardware breakpoint regressions exposed by my fix for "PR breakpoints/7143 - Watchpoint does not trigger when first set", at https://sourceware.org/ml/gdb-patches/2014-03/msg00167.html The testsuite caught them on Linux/x86_64, at least. gdb.sum: gdb.sum: FAIL: gdb.base/hbreak2.exp: next over recursive call FAIL: gdb.base/hbreak2.exp: backtrace from factorial(5.1) FAIL: gdb.base/hbreak2.exp: continue until exit at recursive next test gdb.log: (gdb) next Program received signal SIGTRAP, Trace/breakpoint trap. factorial (value=4) at ../../../src/gdb/testsuite/gdb.base/break.c:113 113 if (value > 1) { /* set breakpoint 7 here */ (gdb) FAIL: gdb.base/hbreak2.exp: next over recursive call Actually, that patch just exposed a latent issue to "breakpoints always-inserted off" mode, not really caused it. After that patch, GDB no longer removes breakpoints at each internal event, thus making some scenarios behave like breakpoint always-inserted on. The bug is easy to trigger with always-inserted on. The issue is that since the target-side breakpoint conditions support, if the stub/server supports evaluating breakpoint conditions on the target side, then GDB is sending duplicate Zx packets to the target without removing them before, and GDBserver is not really expecting that for Z packets other than Z0/z0. E.g., with "set breakpoint always-inserted on" and "set debug remote 1": (gdb) b main Sending packet: $m410943,1#ff...Packet received: 48 Breakpoint 4 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028. Sending packet: $Z0,410943,1#48...Packet received: OK ^^^^^^^^^^^^ (gdb) b main Note: breakpoint 4 also set at pc 0x410943. Sending packet: $m410943,1#ff...Packet received: 48 Breakpoint 5 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028. Sending packet: $Z0,410943,1#48...Packet received: OK ^^^^^^^^^^^^ (gdb) b main Note: breakpoints 4 and 5 also set at pc 0x410943. Sending packet: $m410943,1#ff...Packet received: 48 Breakpoint 6 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028. Sending packet: $Z0,410943,1#48...Packet received: OK ^^^^^^^^^^^^ (gdb) del Delete all breakpoints? (y or n) y Sending packet: $Z0,410943,1#48...Packet received: OK Sending packet: $Z0,410943,1#48...Packet received: OK Sending packet: $z0,410943,1#68...Packet received: OK And for Z1, similarly: (gdb) hbreak main Sending packet: $m410943,1#ff...Packet received: 48 Hardware assisted breakpoint 4 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028. Sending packet: $Z1,410943,1#49...Packet received: OK ^^^^^^^^^^^^ Packet Z1 (hardware-breakpoint) is supported (gdb) hbreak main Note: breakpoint 4 also set at pc 0x410943. Sending packet: $m410943,1#ff...Packet received: 48 Hardware assisted breakpoint 5 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028. Sending packet: $Z1,410943,1#49...Packet received: OK ^^^^^^^^^^^^ (gdb) hbreak main Note: breakpoints 4 and 5 also set at pc 0x410943. Sending packet: $m410943,1#ff...Packet received: 48 Hardware assisted breakpoint 6 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028. Sending packet: $Z1,410943,1#49...Packet received: OK ^^^^^^^^^^^^ (gdb) del Delete all breakpoints? (y or n) y Sending packet: $Z1,410943,1#49...Packet received: OK ^^^^^^^^^^^^ Sending packet: $Z1,410943,1#49...Packet received: OK ^^^^^^^^^^^^ Sending packet: $z1,410943,1#69...Packet received: OK ^^^^^^^^^^^^ So GDB sent a bunch of Z1 packets, and then when finally removing the breakpoint, only one z1 packet was sent. On the GDBserver side (with monitor set debug-hw-points 1), in the Z1 case, we see: $ ./gdbserver :9999 ./gdbserver Process ./gdbserver created; pid = 8629 Listening on port 9999 Remote debugging from host 127.0.0.1 insert_watchpoint (addr=410943, len=1, type=instruction-execute): CONTROL (DR7): 00000101 STATUS (DR6): 00000000 DR0: addr=0x410943, ref.count=1 DR1: addr=0x0, ref.count=0 DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0 insert_watchpoint (addr=410943, len=1, type=instruction-execute): CONTROL (DR7): 00000101 STATUS (DR6): 00000000 DR0: addr=0x410943, ref.count=2 DR1: addr=0x0, ref.count=0 DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0 insert_watchpoint (addr=410943, len=1, type=instruction-execute): CONTROL (DR7): 00000101 STATUS (DR6): 00000000 DR0: addr=0x410943, ref.count=3 DR1: addr=0x0, ref.count=0 DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0 insert_watchpoint (addr=410943, len=1, type=instruction-execute): CONTROL (DR7): 00000101 STATUS (DR6): 00000000 DR0: addr=0x410943, ref.count=4 DR1: addr=0x0, ref.count=0 DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0 insert_watchpoint (addr=410943, len=1, type=instruction-execute): CONTROL (DR7): 00000101 STATUS (DR6): 00000000 DR0: addr=0x410943, ref.count=5 DR1: addr=0x0, ref.count=0 DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0 remove_watchpoint (addr=410943, len=1, type=instruction-execute): CONTROL (DR7): 00000101 STATUS (DR6): 00000000 DR0: addr=0x410943, ref.count=4 DR1: addr=0x0, ref.count=0 DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0 That's one insert_watchpoint call for each Z1 packet, and then one remove_watchpoint call for the z1 packet. Notice how ref.count increased for each insert_watchpoint call, and then in the end, after GDB told GDBserver to forget about the hardware breakpoint, GDBserver ends with the the first debug register still with ref.count=4! IOW, the hardware breakpoint is left armed on the target, while on the GDB end it's gone. If the program happens to execute 0x410943 afterwards, then the CPU traps, GDBserver reports the trap to GDB, and GDB not having a breakpoint set at that address anymore, reports to the user a spurious SIGTRAP. This is exactly what is happening in the hbreak2.exp test, though in that case, it's a shared library event that triggers a breakpoint_re_set, when breakpoints are still inserted (because nowadays GDB doesn't remove breakpoints while handling internal events), and that recreates breakpoint locations, which likewise forces breakpoint reinsertion and Zx packet resends... That is a lot of bogus Zx duplication that should possibly be addressed on the GDB side. GDB resends Zx packets because the way to change the target-side condition, is to resend the breakpoint to the server with the new condition. (That's an option in the packet: e.g., "Z1,410943,1;X3,220027" for "hbreak main if 0". The packets in the examples above are shorter because the breakpoints don't have conditions attached). GDB doesn't remove the breakpoint first before reinserting it because that'd be bad for non-stop, as it'd open a window where the inferior could miss the breakpoint. The conditions actually haven't changed between the resends, but GDB isn't smart enough to realize that. (TBC, if the target doesn't support target-side conditions, then GDB doesn't trigger these resends (init_bp_location calls mark_breakpoint_location_modified, and that does nothing if condition evaluation is on the host side. The resends are caused by the 'loc->condition_changed = condition_modified.' line.) But, even if GDB was made smarter, GDBserver should really still handle the resends anyway. So target-side conditions also aren't really to blame. The documentation of the Z/z packets says: "To avoid potential problems with duplicate packets, the operations should be implemented in an idempotent way." As such, we may want to fix GDB, but we should definitely fix GDBserver. The fix is a prerequisite for target-side conditions on hardware breakpoints anyway (and while at it, on watchpoints too). GDBserver indeed already treats duplicate Z0 packets in an idempotent way. mem-break.c has the concept of high-level and low-level breakpoints, somewhat similar to GDB's split of breakpoints vs breakpoint locations, and keeps track of multiple breakpoints referencing the same address/location, for the case of an internal GDBserver breakpoint or a tracepoint being set at the same address as a GDB breakpoint. But, it only allows GDB to ever contribute one reference to a software breakpoint location. IOW, if gdbserver sees a Z0 packet for the same address where it already had a GDB breakpoint set, then GDBserver won't create another high-level GDB breakpoint. However, mem-break.c only tracks GDB Z0 breakpoints. The same logic should apply to all kinds of Zx packets. Currently, gdbserver passes down each duplicate Zx (other than Z0) request directly to the target->insert_point routine. The x86 watchpoint support itself refcounts watchpoint / hw breakpoint requests, to handle overlapping watchpoints, and save debug registers. But that code doesn't (and really shouldn't) handle the duplicate requests, assuming that for each insert there will be a corresponding remove. So the fix is to generalize mem-break.c to track all kinds of Zx breakpoints, and filter out duplicates. As mentioned, this ends up adding support for target-side conditions on hardware breakpoints and watchpoints too (though GDB itself doesn't support the latter yet). Probably the least obvious change in the patch is that it kind of turns the breakpoint insert/remove APIs inside out. Before, the target methods were only called for GDB breakpoints. The internal breakpoint set/delete methods inserted memory breakpoints directly bypassing the insert/remove target methods. That's not good when the target should use a debug API to set software breakpoints, instead of relying on GDBserver patching memory with breakpoint instructions, as is the case of NTO. Now removal/insertion of all kinds of breakpoints/watchpoints, either internal, or from GDB, always go through the target methods. The insert_point/remove_point methods no longer get passed a Z packet type, but an internal/raw breakpoint type. They're also passed a pointer to the raw breakpoint itself (note that's still opaque outside mem-break.c), so that insert_memory_breakpoint / remove_memory_breakpoint have access to the breakpoint's shadow buffer. I first tried passing down a new structure based on GDB's "struct bp_target_info" (actually with that name exactly), but then decided against it as unnecessary complication. As software/memory breakpoints work by poking at memory, when setting a GDB Z0 breakpoint (but not internal breakpoints, as those can assume the conditions are already right), we need to tell the target to prepare to access memory (which on Linux means stop threads). If that operation fails, we need to return error to GDB. Seeing an error, if this is the first breakpoint of that type that GDB tries to insert, GDB would then assume the breakpoint type is supported, but it may actually not be. So we need to check whether the type is supported at all before preparing to access memory. And to solve that, the patch adds a new target->supports_z_point_type method that is called before actually trying to insert the breakpoint. Other than that, hopefully the change is more or less obvious. New test added that exercises the hbreak2.exp regression in a more direct way, without relying on a breakpoint re-set happening before main is reached. Tested by building GDBserver for: aarch64-linux-gnu arm-linux-gnueabihf i686-pc-linux-gnu i686-w64-mingw32 m68k-linux-gnu mips-linux-gnu mips-uclinux nios2-linux-gnu powerpc-linux-gnu sh-linux-gnu tilegx-unknown-linux-gnu x86_64-redhat-linux x86_64-w64-mingw32 And also regression tested on x86_64 Fedora 20. gdb/gdbserver/ 2014-05-20 Pedro Alves <palves@redhat.com> * linux-aarch64-low.c (aarch64_insert_point) (aarch64_remove_point): No longer check whether the type is supported here. Adjust to new interface. (the_low_target): Install aarch64_supports_z_point_type as supports_z_point_type method. * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function. (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type instead of a Z packet char. Adjust. (arm_supports_z_point_type): New function. (arm_insert_point, arm_remove_point): Adjust to new interface. (the_low_target): Install arm_supports_z_point_type. * linux-crisv32-low.c (cris_supports_z_point_type): New function. (cris_insert_point, cris_remove_point): Adjust to new interface. Don't check whether the type is supported here. (the_low_target): Install cris_supports_z_point_type. * linux-low.c (linux_supports_z_point_type): New function. (linux_insert_point, linux_remove_point): Adjust to new interface. * linux-low.h (struct linux_target_ops) <insert_point, remove_point>: Take an enum raw_bkpt_type instead of a char. Add raw_breakpoint pointer parameter. <supports_z_point_type>: New method. * linux-mips-low.c (mips_supports_z_point_type): New function. (mips_insert_point, mips_remove_point): Adjust to new interface. Use mips_supports_z_point_type. (the_low_target): Install mips_supports_z_point_type. * linux-ppc-low.c (the_low_target): Install NULL as supports_z_point_type method. * linux-s390-low.c (the_low_target): Install NULL as supports_z_point_type method. * linux-sparc-low.c (the_low_target): Install NULL as supports_z_point_type method. * linux-x86-low.c (x86_supports_z_point_type): New function. (x86_insert_point): Adjust to new insert_point interface. Use insert_memory_breakpoint. Adjust to new i386_low_insert_watchpoint interface. (x86_remove_point): Adjust to remove_point interface. Use remove_memory_breakpoint. Adjust to new i386_low_remove_watchpoint interface. (the_low_target): Install x86_supports_z_point_type. * lynx-low.c (lynx_target_ops): Install NULL as supports_z_point_type callback. * nto-low.c (nto_supports_z_point_type): New. (nto_insert_point, nto_remove_point): Adjust to new interface. (nto_target_ops): Install nto_supports_z_point_type. * mem-break.c: Adjust intro comment. (struct raw_breakpoint) <raw_type, size>: New fields. <inserted>: Update comment. <shlib_disabled>: Delete field. (enum bkpt_type) <gdb_breakpoint>: Delete value. <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2, gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values. (raw_bkpt_type_to_target_hw_bp_type): New function. (find_enabled_raw_code_breakpoint_at): New function. (find_raw_breakpoint_at): New type and size parameters. Use them. (insert_memory_breakpoint): New function, based off set_raw_breakpoint_at. (remove_memory_breakpoint): New function. (set_raw_breakpoint_at): Reimplement. (set_breakpoint): New, based on set_breakpoint_at. (set_breakpoint_at): Reimplement. (delete_raw_breakpoint): Go through the_target->remove_point instead of assuming memory breakpoints. (find_gdb_breakpoint_at): Delete. (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions. (find_gdb_breakpoint): New function. (set_gdb_breakpoint_at): Delete. (z_type_supported): New function. (set_gdb_breakpoint_1): New function, loosely based off set_gdb_breakpoint_at. (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions. (delete_gdb_breakpoint_at): Delete. (delete_gdb_breakpoint_1): New function, loosely based off delete_gdb_breakpoint_at. (delete_gdb_breakpoint): New function. (clear_gdb_breakpoint_conditions): Rename to ... (clear_breakpoint_conditions): ... this. Don't handle a NULL breakpoint. (add_condition_to_breakpoint): Make static. (add_breakpoint_condition): Take a struct breakpoint pointer instead of an address. Adjust. (gdb_condition_true_at_breakpoint): Rename to ... (gdb_condition_true_at_breakpoint_z_type): ... this, and add z_type parameter. (gdb_condition_true_at_breakpoint): Reimplement. (add_breakpoint_commands): Take a struct breakpoint pointer instead of an address. Adjust. (gdb_no_commands_at_breakpoint): Rename to ... (gdb_no_commands_at_breakpoint_z_type): ... this. Add z_type parameter. Return true if no breakpoint was found. Change debug output. (gdb_no_commands_at_breakpoint): Reimplement. (run_breakpoint_commands): Rename to ... (run_breakpoint_commands_z_type): ... this. Add z_type parameter, and change return type to boolean. (run_breakpoint_commands): New function. (gdb_breakpoint_here): Also check for Z1 breakpoints. (uninsert_raw_breakpoint): Don't try to reinsert a disabled breakpoint. Go through the_target->remove_point instead of assuming memory breakpoint. (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert software and hardware breakpoints. (reinsert_raw_breakpoint): Go through the_target->insert_point instead of assuming memory breakpoint. (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert software and hardware breakpoints. (check_breakpoints, breakpoint_here, breakpoint_inserted_here): Check both software and hardware breakpoints. (validate_inserted_breakpoint): Assert the breakpoint is a software breakpoint. Set the inserted flag to -1 instead of setting shlib_disabled. (delete_disabled_breakpoints): Adjust. (validate_breakpoints): Only validate software breakpoints. Adjust to inserted flag change. (check_mem_read, check_mem_write): Skip breakpoint types other than software breakpoints. Adjust to inserted flag change. * mem-break.h (enum raw_bkpt_type): New enum. (raw_breakpoint, struct process_info): Forward declare. (Z_packet_to_target_hw_bp_type): Delete declaration. (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type) (set_gdb_breakpoint, delete_gdb_breakpoint) (clear_breakpoint_conditions): New declarations. (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete. (breakpoint_inserted_here): Update comment. (add_breakpoint_condition, add_breakpoint_commands): Replace address parameter with a breakpoint pointer parameter. (gdb_breakpoint_here): Update comment. (delete_gdb_breakpoint_at): Delete. (insert_memory_breakpoint, remove_memory_breakpoint): Declare. * server.c (process_point_options): Take a struct breakpoint pointer instead of an address. Adjust. (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and delete_gdb_breakpoint. * spu-low.c (spu_target_ops): Install NULL as supports_z_point_type method. * target.h: Include mem-break.h. (struct target_ops) <prepare_to_access_memory>: Update comment. <supports_z_point_type>: New field. <insert_point, remove_point>: Take an enum raw_bkpt_type argument instead of a char. Also take a raw breakpoint pointer. * win32-arm-low.c (the_low_target): Install NULL as supports_z_point_type. * win32-i386-low.c (i386_supports_z_point_type): New function. (i386_insert_point, i386_remove_point): Adjust to new interface. (the_low_target): Install i386_supports_z_point_type. * win32-low.c (win32_supports_z_point_type): New function. (win32_insert_point, win32_remove_point): Adjust to new interface. (win32_target_ops): Install win32_supports_z_point_type. * win32-low.h (struct win32_target_ops): <supports_z_point_type>: New method. <insert_point, remove_point>: Take an enum raw_bkpt_type argument instead of a char. Also take a raw breakpoint pointer. gdb/testsuite/ 2014-05-20 Pedro Alves <palves@redhat.com> * gdb.base/break-idempotent.c: New file. * gdb.base/break-idempotent.exp: New file.
2014-05-20 19:24:28 +02:00
2014-05-20 Pedro Alves <palves@redhat.com>
* linux-aarch64-low.c (aarch64_insert_point)
(aarch64_remove_point): No longer check whether the type is
supported here. Adjust to new interface.
(the_low_target): Install aarch64_supports_z_point_type as
supports_z_point_type method.
* linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
(arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
instead of a Z packet char. Adjust.
(arm_supports_z_point_type): New function.
(arm_insert_point, arm_remove_point): Adjust to new interface.
(the_low_target): Install arm_supports_z_point_type.
* linux-crisv32-low.c (cris_supports_z_point_type): New function.
(cris_insert_point, cris_remove_point): Adjust to new interface.
Don't check whether the type is supported here.
(the_low_target): Install cris_supports_z_point_type.
* linux-low.c (linux_supports_z_point_type): New function.
(linux_insert_point, linux_remove_point): Adjust to new interface.
* linux-low.h (struct linux_target_ops) <insert_point,
remove_point>: Take an enum raw_bkpt_type instead of a char. Add
raw_breakpoint pointer parameter.
<supports_z_point_type>: New method.
* linux-mips-low.c (mips_supports_z_point_type): New function.
(mips_insert_point, mips_remove_point): Adjust to new interface.
Use mips_supports_z_point_type.
(the_low_target): Install mips_supports_z_point_type.
* linux-ppc-low.c (the_low_target): Install NULL as
supports_z_point_type method.
* linux-s390-low.c (the_low_target): Install NULL as
supports_z_point_type method.
* linux-sparc-low.c (the_low_target): Install NULL as
supports_z_point_type method.
* linux-x86-low.c (x86_supports_z_point_type): New function.
(x86_insert_point): Adjust to new insert_point interface. Use
insert_memory_breakpoint. Adjust to new
i386_low_insert_watchpoint interface.
(x86_remove_point): Adjust to remove_point interface. Use
remove_memory_breakpoint. Adjust to new
i386_low_remove_watchpoint interface.
(the_low_target): Install x86_supports_z_point_type.
* lynx-low.c (lynx_target_ops): Install NULL as
supports_z_point_type callback.
* nto-low.c (nto_supports_z_point_type): New.
(nto_insert_point, nto_remove_point): Adjust to new interface.
(nto_target_ops): Install nto_supports_z_point_type.
* mem-break.c: Adjust intro comment.
(struct raw_breakpoint) <raw_type, size>: New fields.
<inserted>: Update comment.
<shlib_disabled>: Delete field.
(enum bkpt_type) <gdb_breakpoint>: Delete value.
<gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
(raw_bkpt_type_to_target_hw_bp_type): New function.
(find_enabled_raw_code_breakpoint_at): New function.
(find_raw_breakpoint_at): New type and size parameters. Use them.
(insert_memory_breakpoint): New function, based off
set_raw_breakpoint_at.
(remove_memory_breakpoint): New function.
(set_raw_breakpoint_at): Reimplement.
(set_breakpoint): New, based on set_breakpoint_at.
(set_breakpoint_at): Reimplement.
(delete_raw_breakpoint): Go through the_target->remove_point
instead of assuming memory breakpoints.
(find_gdb_breakpoint_at): Delete.
(Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
(find_gdb_breakpoint): New function.
(set_gdb_breakpoint_at): Delete.
(z_type_supported): New function.
(set_gdb_breakpoint_1): New function, loosely based off
set_gdb_breakpoint_at.
(check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
(delete_gdb_breakpoint_at): Delete.
(delete_gdb_breakpoint_1): New function, loosely based off
delete_gdb_breakpoint_at.
(delete_gdb_breakpoint): New function.
(clear_gdb_breakpoint_conditions): Rename to ...
(clear_breakpoint_conditions): ... this. Don't handle a NULL
breakpoint.
(add_condition_to_breakpoint): Make static.
(add_breakpoint_condition): Take a struct breakpoint pointer
instead of an address. Adjust.
(gdb_condition_true_at_breakpoint): Rename to ...
(gdb_condition_true_at_breakpoint_z_type): ... this, and add
z_type parameter.
(gdb_condition_true_at_breakpoint): Reimplement.
(add_breakpoint_commands): Take a struct breakpoint pointer
instead of an address. Adjust.
(gdb_no_commands_at_breakpoint): Rename to ...
(gdb_no_commands_at_breakpoint_z_type): ... this. Add z_type
parameter. Return true if no breakpoint was found. Change debug
output.
(gdb_no_commands_at_breakpoint): Reimplement.
(run_breakpoint_commands): Rename to ...
(run_breakpoint_commands_z_type): ... this. Add z_type parameter,
and change return type to boolean.
(run_breakpoint_commands): New function.
(gdb_breakpoint_here): Also check for Z1 breakpoints.
(uninsert_raw_breakpoint): Don't try to reinsert a disabled
breakpoint. Go through the_target->remove_point instead of
assuming memory breakpoint.
(uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
software and hardware breakpoints.
(reinsert_raw_breakpoint): Go through the_target->insert_point
instead of assuming memory breakpoint.
(reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
software and hardware breakpoints.
(check_breakpoints, breakpoint_here, breakpoint_inserted_here):
Check both software and hardware breakpoints.
(validate_inserted_breakpoint): Assert the breakpoint is a
software breakpoint. Set the inserted flag to -1 instead of
setting shlib_disabled.
(delete_disabled_breakpoints): Adjust.
(validate_breakpoints): Only validate software breakpoints.
Adjust to inserted flag change.
(check_mem_read, check_mem_write): Skip breakpoint types other
than software breakpoints. Adjust to inserted flag change.
* mem-break.h (enum raw_bkpt_type): New enum.
(raw_breakpoint, struct process_info): Forward declare.
(Z_packet_to_target_hw_bp_type): Delete declaration.
(raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
(set_gdb_breakpoint, delete_gdb_breakpoint)
(clear_breakpoint_conditions): New declarations.
(set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
(breakpoint_inserted_here): Update comment.
(add_breakpoint_condition, add_breakpoint_commands): Replace
address parameter with a breakpoint pointer parameter.
(gdb_breakpoint_here): Update comment.
(delete_gdb_breakpoint_at): Delete.
(insert_memory_breakpoint, remove_memory_breakpoint): Declare.
* server.c (process_point_options): Take a struct breakpoint
pointer instead of an address. Adjust.
(process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
delete_gdb_breakpoint.
* spu-low.c (spu_target_ops): Install NULL as
supports_z_point_type method.
* target.h: Include mem-break.h.
(struct target_ops) <prepare_to_access_memory>: Update comment.
<supports_z_point_type>: New field.
<insert_point, remove_point>: Take an enum raw_bkpt_type argument
instead of a char. Also take a raw breakpoint pointer.
* win32-arm-low.c (the_low_target): Install NULL as
supports_z_point_type.
* win32-i386-low.c (i386_supports_z_point_type): New function.
(i386_insert_point, i386_remove_point): Adjust to new interface.
(the_low_target): Install i386_supports_z_point_type.
* win32-low.c (win32_supports_z_point_type): New function.
(win32_insert_point, win32_remove_point): Adjust to new interface.
(win32_target_ops): Install win32_supports_z_point_type.
* win32-low.h (struct win32_target_ops):
<supports_z_point_type>: New method.
<insert_point, remove_point>: Take an enum raw_bkpt_type argument
instead of a char. Also take a raw breakpoint pointer.
[GDBserver] Move Z packet defines and type convertion routines to shared code. The Aarch64, MIPS and x86 Linux backends all have Z packet number defines and corresponding protocol number to internal type convertion routines. Factor them all out to gdbserver's core code, so we only have one shared copy. Tested on x86_64 Fedora 20, and also cross built for aarch64-linux-gnu and mips-linux-gnu. gdb/gdbserver/ 2014-05-20 Pedro Alves <palves@redhat.com> * mem-break.h: Include break-common.h. (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP) (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines. (Z_packet_to_target_hw_bp_type): New declaration. * mem-break.c (Z_packet_to_target_hw_bp_type): New function. * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP) (Z_PACKET_ACCESS_WP): Delete macros. (Z_packet_to_hw_type): Delete function. * i386-low.h: Don't include break-common.h here. (Z_packet_to_hw_type): Delete declaration. * linux-x86-low.c (x86_insert_point, x86_insert_point): Call Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type. * win32-i386-low.c (i386_insert_point, i386_remove_point): Call Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type. * linux-aarch64-low.c: Don't include break-common.h here. (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP) (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros. (Z_packet_to_target_hw_bp_type): Delete function. * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete function. (mips_insert_point, mips_remove_point): Use Z_packet_to_target_hw_bp_type.
2014-05-20 19:24:27 +02:00
2014-05-20 Pedro Alves <palves@redhat.com>
* mem-break.h: Include break-common.h.
(Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
(Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
(Z_packet_to_target_hw_bp_type): New declaration.
* mem-break.c (Z_packet_to_target_hw_bp_type): New function.
* i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
(Z_PACKET_ACCESS_WP): Delete macros.
(Z_packet_to_hw_type): Delete function.
* i386-low.h: Don't include break-common.h here.
(Z_packet_to_hw_type): Delete declaration.
* linux-x86-low.c (x86_insert_point, x86_insert_point): Call
Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
* win32-i386-low.c (i386_insert_point, i386_remove_point): Call
Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
* linux-aarch64-low.c: Don't include break-common.h here.
(Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
(Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
(Z_packet_to_target_hw_bp_type): Delete function.
* linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
function.
(mips_insert_point, mips_remove_point): Use
Z_packet_to_target_hw_bp_type.
2014-05-20 Pedro Alves <palves@redhat.com>
* linux-aarch64-low.c: Include break-common.h.
(enum target_point_type): Delete.
(Z_packet_to_point_type): Rename to ...
(Z_packet_to_target_hw_bp_type): ... this, and return a
target_hw_bp_type instead.
(aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
instead of an enum target_point_type.
(aarch64_point_encode_ctrl_reg): Likewise. Compute type mask from
breakpoint type.
(aarch64_dr_state_insert_one_point)
(aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
(aarch64_handle_aligned_watchpoint)
(aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
Take an enum target_hw_bp_type instead of an enum
target_point_type.
(aarch64_supports_z_point_type): New function.
(aarch64_insert_point, aarch64_remove_point): Use it. Adjust to
use Z_packet_to_target_hw_bp_type.
2014-05-20 Joel Brobecker <brobecker@adacore.com>
* configure.ac: Only use -Werror by default when DEVELOPMENT
is true.
* configure: Regenerate.
Fix gdbserver qGetTLSAddr for x86_64 -m32 gdbserver makes libthread_db to access uninitialized memory. Surprisingly it does not harm normally, even -fsanitize=address works with current gdbserver. I have found just valgrind detects it as a very first warning for gdbserver: Syscall param ptrace(addr) contains uninitialised byte(s) at 0x3721EECEBE: ptrace (ptrace.c:45) by 0x436EE5: ps_get_thread_area (linux-x86-low.c:252) by 0x5559D02: __td_ta_lookup_th_unique (td_ta_map_lwp2thr.c:157) by 0x5559EC3: td_ta_map_lwp2thr (td_ta_map_lwp2thr.c:207) by 0x43F87D: find_one_thread (thread-db.c:281) by 0x440038: thread_db_get_tls_address (thread-db.c:505) by 0x40F6D0: handle_query (server.c:2004) by 0x4124CF: process_serial_event (server.c:3445) by 0x4136B6: handle_serial_event (server.c:3889) by 0x419571: handle_file_event (event-loop.c:434) by 0x418D38: process_event (event-loop.c:189) by 0x419AB7: start_event_loop (event-loop.c:552) Reproducible with: cd gdb/testsuite g++ -o gdb.threads/tls gdb.threads/tls{,2}.c -m32 -pthread ../gdbserver/gdbserver :1234 gdb.threads/tls ../gdb -batch gdb.threads/tls -ex 'target remote :1234' -ex 'b spin' -ex c -ex 'p a_thread_local' It is more easily reproducible even without valgrind using s/0x00/0xff/ in the attached patch. It will then turn the output of reproducer above: $1 = 0 -> Cannot find thread-local storage for Thread 29044, executable file .../gdb/testsuite/gdb.threads/tls: Remote target failed to process qGetTLSAddr request gdb/gdbserver/ 2014-05-19 Jan Kratochvil <jan.kratochvil@redhat.com> Fix gdbserver qGetTLSAddr for x86_64 -m32. * linux-x86-low.c (X86_64_USER_REGS): New. (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case. Message-ID: <20140410114901.GA16411@host2.jankratochvil.net>
2014-05-19 20:20:27 +02:00
2014-05-19 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix gdbserver qGetTLSAddr for x86_64 -m32.
* linux-x86-low.c (X86_64_USER_REGS): New.
(x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
2014-04-28 Yao Qi <yao@codesourcery.com>
* Makefile.in (i386-avx512.c): Fix the typo of generated file
name.
2014-04-25 Pedro Alves <palves@redhat.com>
PR server/16255
* linux-low.c (linux_attach_fail_reason_string): New function.
(linux_attach_lwp): Delete.
(linux_attach_lwp_1): Rename to ...
(linux_attach_lwp): ... this. Take a ptid instead of a pid as
argument. Remove "initial" parameter. Return int instead of
void. Don't error or warn here.
(linux_attach): Adjust to call linux_attach_lwp. Call error on
failure to attach to the tgid. Call warning when failing to
attach to an lwp.
* linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
argument. Remove "initial" parameter. Return int instead of
void. Don't error or warn here.
(linux_attach_fail_reason_string): New declaration.
* thread-db.c (attach_thread): Adjust to linux_attach_lwp's
interface change. Use linux_attach_fail_reason_string.
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
2014-04-24 Michael Sturm <michael.sturm@mintel.com>
Walfred Tedeschi <walfred.tedeschi@intel.com>
* Makefile.in: Added rules to handle new files
i386-avx512.c i386-avx512-linux.c amd64-avx512.c
amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
* configure.srv (srv_i386_regobj): Add i386-avx512.o.
(srv_i386_linux_regobj): Add i386-avx512-linux.o.
(srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
(srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
x32-avx512-linux.o.
(srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
(srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
(srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
i386/x32-avx512.xml.
(srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
(srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
i386/x32-avx512-linux.xml.
* i387-fp.c (num_avx512_k_registers): New constant for number
of K registers.
(num_avx512_zmmh_low_registers): New constant for number of
lower ZMM registers (0-15).
(num_avx512_zmmh_high_registers): New constant for number of
higher ZMM registers (16-31).
(num_avx512_ymmh_registers): New contant for number of higher
YMM registers (ymm16-31 added by avx521 on x86_64).
(num_avx512_xmm_registers): New constant for number of higher
XMM registers (xmm16-31 added by AVX512 on x86_64).
(struct i387_xsave): Add space for AVX512 registers.
(i387_cache_to_xsave): Change raw buffer size to 64 characters.
Add code to handle AVX512 registers.
(i387_xsave_to_cache): Add code to handle AVX512 registers.
* linux-x86-low.c (init_registers_amd64_avx512_linux): New
prototypei from generated file.
(tdesc_amd64_avx512_linux): Likewise.
(init_registers_x32_avx512_linux): Likewise.
(tdesc_x32_avx512_linux): Likewise.
(init_registers_i386_avx512_linux): Likewise.
(tdesc_i386_avx512_linux): Likewise.
(x86_64_regmap): Add AVX512 registers.
(x86_linux_read_description): Add code to handle AVX512 XSTATE
mask.
(initialize_low_arch): Add code to initialize AVX512 registers.
2014-04-23 Pedro Alves <palves@redhat.com>
* mem-break.c (find_gdb_breakpoint_at): Make static.
* mem-break.h (find_gdb_breakpoint_at): Delete declaration.
2014-04-23 Pedro Alves <palves@redhat.com>
* i386-low.c: Don't include break-common.h here.
(i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
prototype to take target_hw_bp_type as argument instead of a Z
packet char.
* i386-low.h: Include break-common.h here.
(Z_packet_to_hw_type): Declare.
(i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
prototypes.
* linux-x86-low.c (x86_insert_point): Convert the packet number to
a target_hw_bp_type before calling i386_low_insert_watchpoint.
(x86_remove_point): Convert the packet number to a
target_hw_bp_type before calling i386_low_remove_watchpoint.
* win32-i386-low.c (i386_insert_point): Convert the packet number
to a target_hw_bp_type before calling i386_low_insert_watchpoint.
(i386_remove_point): Convert the packet number to a
target_hw_bp_type before calling i386_low_remove_watchpoint.
2014-04-23 Pedro Alves <palves@redhat.com>
* utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
Conditional Z1 breakpoint hangs GDBserver. While trying to fix hbreak2.exp against GDBserver I noticed this... (gdb) hbreak main if 1 Sending packet: $m400580,40#2e...Packet received: e8d2ffffff5dc3554889e54883ec10c745fc00000000eb0eb800000000e8c1ffffff8345fc01817dfce70300007ee9b800000000c9c3662e0f1f840000000000 Sending packet: $m40058f,1#31...Packet received: c7 Hardware assisted breakpoint 1 at 0x40058f: file ../../../src/gdb/testsuite/gdb.base/break-idempotent.c, line 46. Sending packet: $Z1,40058f,1;X3,220127#9b... *hangs forever* The issue is that nothing advances the packet pointer if add_breakpoint_condition either fails to parse the agent expression, or fails to find the breakpoint, resulting in an infinite loop in process_point_options. The latter case should really be fixed by GDBserver tracking GDB Z1 breakpoints in its breakpoint structures like Z0 breakpoints are, but the latter case still needs handling. add_breakpoint_commands has the same issue, though at present I don't know any way to trigger it other than sending a manually cooked packet. Unbelievably, it doesn't look like we have any test that tries setting a conditional hardware breakpoint. Looking at cond-eval-mode.exp, it looks like the file was meant to actually test something, but it's mostly empty today. This patch adds tests that tries all sorts of conditional breakpoints and watchpoints. The test hangs/fails without the GDBserver fix. Tested on x86_64 Fedora 17. gdb/gdbserver/ 2014-04-10 Pedro Alves <palves@redhat.com> * mem-break.c (add_breakpoint_condition, add_breakpoint_commands): Check if the condition or command is NULL before checking if the breakpoint is known. On success, return true. * mem-break.h (add_breakpoint_condition): Document return. (add_breakpoint_commands): Add describing comment. * server.c (skip_to_semicolon): New function. (process_point_options): Use it. gdb/testsuite/ 2014-04-10 Pedro Alves <palves@redhat.com> * gdb.base/cond-eval-mode.c: New file. * gdb.base/cond-eval-mode.exp: Use standard_testfile. Adjust prepare_for_testing to build the new file. Check result of runto_main. (test_break, test_watch): New procedures. (top level): Use them.
2014-04-10 20:22:23 +02:00
2014-04-10 Pedro Alves <palves@redhat.com>
* mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
Check if the condition or command is NULL before checking if the
breakpoint is known. On success, return true.
* mem-break.h (add_breakpoint_condition): Document return.
(add_breakpoint_commands): Add describing comment.
* server.c (skip_to_semicolon): New function.
(process_point_options): Use it.
2014-04-09 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_read_loadmap): Pass current_inferior directly
to lwpid_of.
Teach GDBserver's Linux backend about no unwaited-for children (TARGET_WAITKIND_NO_RESUMED). GDBserver currently hangs forever in waitpid if the leader thread exits before other threads, or if all resumed threads exit - e.g., next over a thread exit with sched-locking on. This is exposed by leader-exit.exp. leader-exit.exp is part of a series of tests for a set of related problems. See <http://www.sourceware.org/ml/gdb-patches/2011-10/msg00704.html>: " To recap, on the Linux kernel, ptrace/waitpid don't allow reaping the leader thread until all other threads in the group are reaped. When the leader exits, it goes zombie, but waitpid will not return an exit status until the other threads are gone. This is presently exercised by the gdb.threads/leader-exit.exp test. The fix for that test, in linux-nat.c:wait_lwp, handles the case where we see the leader gone when we're stopping all threads to report an event to some other thread to the core. (...) The latter bit about not blocking if there no resumed threads in the process also applies to some other thread exiting, not just the main thread. E.g., this test starts a thread, and runs to a breakpoint in that thread: ... (gdb) c Continuing. [New Thread 0x7ffff75a4700 (LWP 23397)] [Switching to Thread 0x7ffff75a4700 (LWP 23397)] Breakpoint 2, thread_a (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/no-unwaited-for-left.c:28 28 return 0; /* break-here */ (gdb) info threads * 2 Thread 0x7ffff75a4700 (LWP 23397) thread_a (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/no-unwaited-for-left.c:28 1 Thread 0x7ffff7fcb720 (LWP 23391) 0x00007ffff7bc606d in pthread_join (threadid=140737343276800, thread_return=0x0) at pthread_join.c:89 The thread will exit as soon as we resume it. But if we only resume that thread, leaving the rest of the threads stopped: (gdb) set scheduler-locking on (gdb) c Continuing. ^C^C^C^C^C^C^C^C " This patch fixes the issues by implementing TARGET_WAITKIND_NO_RESUMED on GDBserver, similarly to what the patch above did for native Linux GDB. gdb.threads/leader-exit.exp now passes. gdb.threads/no-unwaited-for-left.exp now at least errors out instead of hanging: continue Continuing. warning: Remote failure reply: E.No unwaited-for children left. [Thread 15454] #1 stopped. 0x00000034cf408e60 in pthread_join (threadid=140737353922368, thread_return=0x0) at pthread_join.c:93 93 lll_wait_tid (pd->tid); (gdb) FAIL: gdb.threads/no-unwaited-for-left.exp: continue stops when the main thread exits The gdb.threads/non-ldr-exc-*.exp tests are skipped because GDBserver unfortunately doesn't support fork/exec yet, but I'm confident this fixes the related issues. I'm leaving modeling TARGET_WAITKIND_NO_RESUMED in the RSP for a separate pass. (BTW, in case of error in response to a vCont, it would be better for GDB to query the target for the current thread, or re-select one, instead of assuming current inferior_ptid is still the selected thread.) This implementation is a little different from GDB's, because I'm avoiding bringing in more of this broken use of waitpid(PID) into GDBserver. Specifically, this avoids waitpid(PID) when stopping all threads. There's really no need for wait_for_sigstop to wait for each LWP in turn. Instead, with some refactoring, we make it reuse linux_wait_for_event. gdb/gdbserver/ 2014-02-27 Pedro Alves <palves@redhat.com> PR 12702 * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New macros. * linux-low.c (delete_lwp, handle_extended_wait): Add debug output. (last_thread_of_process_p): Take a PID argument instead of a thread pointer. (linux_wait_for_lwp): Delete. (num_lwps, check_zombie_leaders, not_stopped_callback): New functions. (linux_low_filter_event): New function, party factored out from linux_wait_for_event. (linux_wait_for_event): Rename to ... (linux_wait_for_event_filtered): ... this. Add new filter ptid argument. Partly rewrite. Always use waitpid(-1, WNOHANG) and sigsuspend. Check for zombie leaders. (linux_wait_for_event): Reimplement as wrapper around linux_wait_for_event_filtered. (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED. Assume that if a normal or signal exit is seen, it's the whole process exiting. (wait_for_sigstop): No longer a for_each_inferior callback. Rewrite on top of linux_wait_for_event_filtered. (stop_all_lwps): Call wait_for_sigstop directly. * server.c (resume, handle_target_event): Handle TARGET_WAITKIND_NO_RESUMED.
2014-02-27 15:30:08 +01:00
2014-02-27 Pedro Alves <palves@redhat.com>
PR 12702
* inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
macros.
* linux-low.c (delete_lwp, handle_extended_wait): Add debug
output.
(last_thread_of_process_p): Take a PID argument instead of a
thread pointer.
(linux_wait_for_lwp): Delete.
(num_lwps, check_zombie_leaders, not_stopped_callback): New
functions.
(linux_low_filter_event): New function, party factored out from
linux_wait_for_event.
(linux_wait_for_event): Rename to ...
(linux_wait_for_event_filtered): ... this. Add new filter ptid
argument. Partly rewrite. Always use waitpid(-1, WNOHANG) and
sigsuspend. Check for zombie leaders.
(linux_wait_for_event): Reimplement as wrapper around
linux_wait_for_event_filtered.
(linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED. Assume that if
a normal or signal exit is seen, it's the whole process exiting.
(wait_for_sigstop): No longer a for_each_inferior callback.
Rewrite on top of linux_wait_for_event_filtered.
(stop_all_lwps): Call wait_for_sigstop directly.
* server.c (resume, handle_target_event): Handle
TARGET_WAITKIND_NO_RESUMED.
2014-02-26 Joel Brobecker <brobecker@adacore.com>
* win32-low.c (psapi_get_dll_name,
* win32_CreateToolhelp32Snapshot): Delete.
(win32_CreateToolhelp32Snapshot, win32_Module32First)
(win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
Delete.
(handle_load_dll): Add function description.
Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
2014-02-26 Joel Brobecker <brobecker@adacore.com>
* win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
Add comment.
(win32_add_all_dlls): Remove 0x1000 offset applied to DLL
base address when calling win32_add_one_solib.
(handle_load_dll): Delete local variable load_addr.
Remove 0x1000 offset applied to DLL base address when calling
win32_add_one_solib.
(handle_unload_dll): Add comment.
2014-02-26 Joel Brobecker <brobecker@adacore.com>
* win32-low.c (win32_add_all_dlls): Renames
win32_ensure_ntdll_loaded. Rewrite function documentation.
Adjust implementation to always load all DLLs.
Add 0x1000 offset to DLL base address when calling
win32_add_one_solib.
(child_initialization_done): New static global.
(do_initial_child_stuff): Set child_initialization_done to
zero during child initialization, and 1 after. Replace call
to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
Add comment.
(match_dll_by_basename, dll_is_loaded_by_basename): Delete.
(handle_unload_dll): Add function documentation.
(get_child_debug_event): Ignore load and unload DLL events
during child initialization.
Remove all_lwps global. * inferiors.h (ptid_of): Move here from linux-low.h. (pid_of, lwpid_of): Ditto. * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry" parameter is a struct thread_info * now. (aarch64_notify_debug_reg_change): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior instead of &all_lwps. (aarch64_stopped_data_address): Fetch lwpid from current_inferior directly. (aarch64_linux_prepare_to_resume): Fetch ptid from thread. (aarch64_arch_setup): Fetch lwpid from current_inferior directly. * linux-arm-low.c (update_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from current_inferior directly. (arm_insert_point): Pass &all_threads to find_inferior instead of &all_lwps. (arm_remove_point): Ditto. (arm_stopped_by_watchpoint): Fetch lwp from current_inferior. (arm_prepare_to_resume): Fetch pid from thread. (arm_read_description): Fetch lwpid from current_inferior directly. * linux-low.c (all_lwps): Delete. (delete_lwp): Delete call to remove_inferior. (handle_extended_wait): Fetch lwpid from thread. (add_lwp): Don't set lwp->entry.id. Remove call to add_inferior_to_list. (linux_attach_lwp_1): Fetch pid from current_inferior directly. (linux_kill_one_lwp): Fetch ptid,lwpid from thread. (kill_one_lwp_callback): Ditto. (linux_kill): Don't dereference NULL pointer. Fetch ptid,lwpid from thread. (get_detach_signal): Fetch ptid from thread. (linux_detach_one_lwp): Fetch ptid,lwpid from thread. Simplify call to regcache_invalidate_thread. (delete_lwp_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps. (status_pending_p_callback): Update, "entry" parameter is a struct thread_info * now. Fetch ptid from thread. (find_lwp_pid): Update, "entry" parameter is a struct thread_info * now. (linux_wait_for_lwp): Fetch pid from thread. (linux_fast_tracepoint_collecting): Fetch lwpid from thread. (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior. (enqueue_one_deferred_signal): Fetch lwpid from thread. (dequeue_one_deferred_signal): Ditto. (cancel_breakpoint): Fetch ptid from current_inferior. (linux_wait_for_event): Pass &all_threads to find_inferior, not &all_lwps. Fetch ptid, lwpid from thread. (count_events_callback): Update, "entry" parameter is a struct thread_info * now. (select_singlestep_lwp_callback): Ditto. (select_event_lwp_callback): Ditto. (cancel_breakpoints_callback): Ditto. (linux_cancel_breakpoints): Pass &all_threads to find_inferior, not &all_lwps. (select_event_lwp): Ditto. Fetch ptid from event_thread. (unsuspend_one_lwp): Update, "entry" parameter is a struct thread_info * now. (unsuspend_all_lwps): Pass &all_threads to find_inferior, not &all_lwps. (linux_stabilize_threads): Ditto. And for for_each_inferior. Fetch lwpid from thread, not lwp. (linux_wait_1): Fetch ptid, lwpid from current_inferior. Pass &all_threads to find_inferior, not &all_lwps. (send_sigstop): Fetch lwpid from thread, not lwp. (send_sigstop_callback): Update, "entry" parameter is a struct thread_info * now. (suspend_and_send_sigstop_callback): Ditto. (wait_for_sigstop): Ditto. Fetch ptid, lwpid from thread, lwp. (stuck_in_jump_pad_callback): Update, "entry" parameter is a struct thread_info * now. (move_out_of_jump_pad_callback): Ditto. Fetch ptid, lwpid from thread, lwp. (lwp_running): Update, "entry" parameter is a struct thread_info * now. (stop_all_lwps): Fetch ptid from thread. Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps. (linux_resume_one_lwp): Fetch lwpid from thread. (linux_set_resume_request): Update, "entry" parameter is a struct thread_info * now. Fetch pid, lwpid from thread. (resume_status_pending_p): Update, "entry" parameter is a struct thread_info * now. (need_step_over_p): Ditto. Fetch lwpid from thread. (start_step_over): Fetch lwpid from thread. (linux_resume_one_thread): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from thread. (linux_resume): Pass &all_threads to find_inferior, not &all_lwps. (proceed_one_lwp): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from thread. (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a struct thread_info * now. (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps. (unstop_all_lwps): Ditto. Fetch lwpid from thread. (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior directly. (regsets_store_inferior_registers): Ditto. (fetch_register, store_register): Ditto. (linux_read_memory, linux_write_memory): Ditto. (linux_request_interrupt): Ditto. (linux_read_auxv): Ditto. (linux_xfer_siginfo): Ditto. (linux_qxfer_spu): Ditto. (linux_qxfer_libraries_svr4): Ditto. * linux-low.h (ptid_of, pid_of, lwpid_of): Delete, moved to inferiors.h. (get_lwp): Delete. (get_thread_lwp): Update. (struct lwp_info): Delete member "entry". Simplify comment for member "thread". (all_lwps): Delete. * linux-mips-low.c (mips_read_description): Fetch lwpid from current_inferior directly. (update_watch_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (mips_linux_prepare_to_resume): Fetch ptid from thread. (mips_insert_point): Fetch lwpid from current_inferior. Pass &all_threads to find_inferior, not &all_lwps. (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps. (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior directly. (mips_stopped_data_address): Ditto. * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior directly. * linux-tile-low.c (tile_arch_setup): Ditto. * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread. (update_debug_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (i386_dr_low_set_addr): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior, not &all_lwps. (i386_dr_low_get_addr): Fetch ptid from current_inferior directly. (i386_dr_low_set_control): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior, not &all_lwps. (i386_dr_low_get_control): Fetch ptid from current_inferior directly. (i386_dr_low_get_status): Ditto. (x86_linux_prepare_to_resume): Fetch ptid from thread. (x86_siginfo_fixup): Fetch lwpid from current_inferior directly. (x86_linux_read_description): Ditto. * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
2014-02-20 21:23:26 +01:00
2014-02-20 Doug Evans <dje@google.com>
Remove global all_lwps.
Remove all_lwps global. * inferiors.h (ptid_of): Move here from linux-low.h. (pid_of, lwpid_of): Ditto. * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry" parameter is a struct thread_info * now. (aarch64_notify_debug_reg_change): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior instead of &all_lwps. (aarch64_stopped_data_address): Fetch lwpid from current_inferior directly. (aarch64_linux_prepare_to_resume): Fetch ptid from thread. (aarch64_arch_setup): Fetch lwpid from current_inferior directly. * linux-arm-low.c (update_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from current_inferior directly. (arm_insert_point): Pass &all_threads to find_inferior instead of &all_lwps. (arm_remove_point): Ditto. (arm_stopped_by_watchpoint): Fetch lwp from current_inferior. (arm_prepare_to_resume): Fetch pid from thread. (arm_read_description): Fetch lwpid from current_inferior directly. * linux-low.c (all_lwps): Delete. (delete_lwp): Delete call to remove_inferior. (handle_extended_wait): Fetch lwpid from thread. (add_lwp): Don't set lwp->entry.id. Remove call to add_inferior_to_list. (linux_attach_lwp_1): Fetch pid from current_inferior directly. (linux_kill_one_lwp): Fetch ptid,lwpid from thread. (kill_one_lwp_callback): Ditto. (linux_kill): Don't dereference NULL pointer. Fetch ptid,lwpid from thread. (get_detach_signal): Fetch ptid from thread. (linux_detach_one_lwp): Fetch ptid,lwpid from thread. Simplify call to regcache_invalidate_thread. (delete_lwp_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps. (status_pending_p_callback): Update, "entry" parameter is a struct thread_info * now. Fetch ptid from thread. (find_lwp_pid): Update, "entry" parameter is a struct thread_info * now. (linux_wait_for_lwp): Fetch pid from thread. (linux_fast_tracepoint_collecting): Fetch lwpid from thread. (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior. (enqueue_one_deferred_signal): Fetch lwpid from thread. (dequeue_one_deferred_signal): Ditto. (cancel_breakpoint): Fetch ptid from current_inferior. (linux_wait_for_event): Pass &all_threads to find_inferior, not &all_lwps. Fetch ptid, lwpid from thread. (count_events_callback): Update, "entry" parameter is a struct thread_info * now. (select_singlestep_lwp_callback): Ditto. (select_event_lwp_callback): Ditto. (cancel_breakpoints_callback): Ditto. (linux_cancel_breakpoints): Pass &all_threads to find_inferior, not &all_lwps. (select_event_lwp): Ditto. Fetch ptid from event_thread. (unsuspend_one_lwp): Update, "entry" parameter is a struct thread_info * now. (unsuspend_all_lwps): Pass &all_threads to find_inferior, not &all_lwps. (linux_stabilize_threads): Ditto. And for for_each_inferior. Fetch lwpid from thread, not lwp. (linux_wait_1): Fetch ptid, lwpid from current_inferior. Pass &all_threads to find_inferior, not &all_lwps. (send_sigstop): Fetch lwpid from thread, not lwp. (send_sigstop_callback): Update, "entry" parameter is a struct thread_info * now. (suspend_and_send_sigstop_callback): Ditto. (wait_for_sigstop): Ditto. Fetch ptid, lwpid from thread, lwp. (stuck_in_jump_pad_callback): Update, "entry" parameter is a struct thread_info * now. (move_out_of_jump_pad_callback): Ditto. Fetch ptid, lwpid from thread, lwp. (lwp_running): Update, "entry" parameter is a struct thread_info * now. (stop_all_lwps): Fetch ptid from thread. Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps. (linux_resume_one_lwp): Fetch lwpid from thread. (linux_set_resume_request): Update, "entry" parameter is a struct thread_info * now. Fetch pid, lwpid from thread. (resume_status_pending_p): Update, "entry" parameter is a struct thread_info * now. (need_step_over_p): Ditto. Fetch lwpid from thread. (start_step_over): Fetch lwpid from thread. (linux_resume_one_thread): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from thread. (linux_resume): Pass &all_threads to find_inferior, not &all_lwps. (proceed_one_lwp): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from thread. (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a struct thread_info * now. (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps. (unstop_all_lwps): Ditto. Fetch lwpid from thread. (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior directly. (regsets_store_inferior_registers): Ditto. (fetch_register, store_register): Ditto. (linux_read_memory, linux_write_memory): Ditto. (linux_request_interrupt): Ditto. (linux_read_auxv): Ditto. (linux_xfer_siginfo): Ditto. (linux_qxfer_spu): Ditto. (linux_qxfer_libraries_svr4): Ditto. * linux-low.h (ptid_of, pid_of, lwpid_of): Delete, moved to inferiors.h. (get_lwp): Delete. (get_thread_lwp): Update. (struct lwp_info): Delete member "entry". Simplify comment for member "thread". (all_lwps): Delete. * linux-mips-low.c (mips_read_description): Fetch lwpid from current_inferior directly. (update_watch_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (mips_linux_prepare_to_resume): Fetch ptid from thread. (mips_insert_point): Fetch lwpid from current_inferior. Pass &all_threads to find_inferior, not &all_lwps. (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps. (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior directly. (mips_stopped_data_address): Ditto. * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior directly. * linux-tile-low.c (tile_arch_setup): Ditto. * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread. (update_debug_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (i386_dr_low_set_addr): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior, not &all_lwps. (i386_dr_low_get_addr): Fetch ptid from current_inferior directly. (i386_dr_low_set_control): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior, not &all_lwps. (i386_dr_low_get_control): Fetch ptid from current_inferior directly. (i386_dr_low_get_status): Ditto. (x86_linux_prepare_to_resume): Fetch ptid from thread. (x86_siginfo_fixup): Fetch lwpid from current_inferior directly. (x86_linux_read_description): Ditto. * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
2014-02-20 21:23:26 +01:00
* inferiors.h (ptid_of): Move here from linux-low.h.
(pid_of, lwpid_of): Ditto.
* linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
parameter is a struct thread_info * now.
(aarch64_notify_debug_reg_change): Fetch pid from current_inferior
directly. Pass &all_threads to find_inferior instead of &all_lwps.
(aarch64_stopped_data_address): Fetch lwpid from current_inferior
directly.
(aarch64_linux_prepare_to_resume): Fetch ptid from thread.
(aarch64_arch_setup): Fetch lwpid from current_inferior directly.
* linux-arm-low.c (update_registers_callback): Update, "entry"
parameter is a struct thread_info * now.
Fetch lwpid from current_inferior directly.
(arm_insert_point): Pass &all_threads to find_inferior instead of
&all_lwps.
(arm_remove_point): Ditto.
(arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
(arm_prepare_to_resume): Fetch pid from thread.
(arm_read_description): Fetch lwpid from current_inferior directly.
* linux-low.c (all_lwps): Delete.
(delete_lwp): Delete call to remove_inferior.
(handle_extended_wait): Fetch lwpid from thread.
(add_lwp): Don't set lwp->entry.id. Remove call to
add_inferior_to_list.
(linux_attach_lwp_1): Fetch pid from current_inferior directly.
(linux_kill_one_lwp): Fetch ptid,lwpid from thread.
(kill_one_lwp_callback): Ditto.
(linux_kill): Don't dereference NULL pointer.
Fetch ptid,lwpid from thread.
(get_detach_signal): Fetch ptid from thread.
(linux_detach_one_lwp): Fetch ptid,lwpid from thread.
Simplify call to regcache_invalidate_thread.
(delete_lwp_callback): Update, "entry" parameter is a
struct thread_info * now. Fetch pid from thread.
(linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
(status_pending_p_callback): Update, "entry" parameter is a
struct thread_info * now. Fetch ptid from thread.
(find_lwp_pid): Update, "entry" parameter is a
struct thread_info * now.
(linux_wait_for_lwp): Fetch pid from thread.
(linux_fast_tracepoint_collecting): Fetch lwpid from thread.
(maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
(enqueue_one_deferred_signal): Fetch lwpid from thread.
(dequeue_one_deferred_signal): Ditto.
(cancel_breakpoint): Fetch ptid from current_inferior.
(linux_wait_for_event): Pass &all_threads to find_inferior,
not &all_lwps. Fetch ptid, lwpid from thread.
(count_events_callback): Update, "entry" parameter is a
struct thread_info * now.
(select_singlestep_lwp_callback): Ditto.
(select_event_lwp_callback): Ditto.
(cancel_breakpoints_callback): Ditto.
(linux_cancel_breakpoints): Pass &all_threads to find_inferior,
not &all_lwps.
(select_event_lwp): Ditto. Fetch ptid from event_thread.
(unsuspend_one_lwp): Update, "entry" parameter is a
struct thread_info * now.
(unsuspend_all_lwps): Pass &all_threads to find_inferior,
not &all_lwps.
(linux_stabilize_threads): Ditto. And for for_each_inferior.
Fetch lwpid from thread, not lwp.
(linux_wait_1): Fetch ptid, lwpid from current_inferior.
Pass &all_threads to find_inferior, not &all_lwps.
(send_sigstop): Fetch lwpid from thread, not lwp.
(send_sigstop_callback): Update, "entry" parameter is a
struct thread_info * now.
(suspend_and_send_sigstop_callback): Ditto.
(wait_for_sigstop): Ditto. Fetch ptid, lwpid from thread, lwp.
(stuck_in_jump_pad_callback): Update, "entry" parameter is a
struct thread_info * now.
(move_out_of_jump_pad_callback): Ditto. Fetch ptid, lwpid
from thread, lwp.
(lwp_running): Update, "entry" parameter is a
struct thread_info * now.
(stop_all_lwps): Fetch ptid from thread.
Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
(linux_resume_one_lwp): Fetch lwpid from thread.
(linux_set_resume_request): Update, "entry" parameter is a
struct thread_info * now. Fetch pid, lwpid from thread.
(resume_status_pending_p): Update, "entry" parameter is a
struct thread_info * now.
(need_step_over_p): Ditto. Fetch lwpid from thread.
(start_step_over): Fetch lwpid from thread.
(linux_resume_one_thread): Update, "entry" parameter is a
struct thread_info * now. Fetch lwpid from thread.
(linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
(proceed_one_lwp): Update, "entry" parameter is a
struct thread_info * now. Fetch lwpid from thread.
(unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
struct thread_info * now.
(proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
(unstop_all_lwps): Ditto. Fetch lwpid from thread.
(regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
directly.
(regsets_store_inferior_registers): Ditto.
(fetch_register, store_register): Ditto.
(linux_read_memory, linux_write_memory): Ditto.
(linux_request_interrupt): Ditto.
(linux_read_auxv): Ditto.
(linux_xfer_siginfo): Ditto.
(linux_qxfer_spu): Ditto.
(linux_qxfer_libraries_svr4): Ditto.
* linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
moved to inferiors.h.
(get_lwp): Delete.
(get_thread_lwp): Update.
(struct lwp_info): Delete member "entry". Simplify comment for
member "thread".
(all_lwps): Delete.
* linux-mips-low.c (mips_read_description): Fetch lwpid from
current_inferior directly.
(update_watch_registers_callback): Update, "entry" parameter is a
struct thread_info * now. Fetch pid from thread.
(mips_linux_prepare_to_resume): Fetch ptid from thread.
(mips_insert_point): Fetch lwpid from current_inferior.
Pass &all_threads to find_inferior, not &all_lwps.
(mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
(mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
directly.
(mips_stopped_data_address): Ditto.
* linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
directly.
* linux-tile-low.c (tile_arch_setup): Ditto.
* linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
(update_debug_registers_callback): Update, "entry" parameter is a
struct thread_info * now. Fetch pid from thread.
(i386_dr_low_set_addr): Fetch pid from current_inferior directly.
Pass &all_threads to find_inferior, not &all_lwps.
(i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
(i386_dr_low_set_control): Fetch pid from current_inferior directly.
Pass &all_threads to find_inferior, not &all_lwps.
(i386_dr_low_get_control): Fetch ptid from current_inferior directly.
(i386_dr_low_get_status): Ditto.
(x86_linux_prepare_to_resume): Fetch ptid from thread.
(x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
(x86_linux_read_description): Ditto.
* proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
2014-02-20 Doug Evans <dje@google.com>
* inferiors.c (get_first_inferior): Fix buglet.
2014-02-19 Doug Evans <dje@google.com>
* gdbthread.h (add_thread): Change result type to struct thread_info *.
* inferiors.c (add_thread): Change result type to struct thread_info *.
All callers updated.
(add_lwp): Call add_thread here instead of in callers.
All callers updated.
* linux-low.h (get_lwp_thread): Rewrite.
(struct lwp_info): New member "thread".
2014-02-19 Doug Evans <dje@google.com>
* linux-low.c (add_lwp): Change result to struct lwp_info *.
All callers updated.
2014-02-19 Doug Evans <dje@google.com>
* inferiors.c (add_thread): Fix whitespace.
Replace code accessing list implementation details with API calls. * dll.c (clear_dlls): Replace accessing list implemention details with API function. * gdbthread.h (get_first_thread): Declare. * inferiors.c (for_each_inferior_with_data): New function. (get_first_thread): New function. (find_thread_ptid): Simplify. (get_first_inferior): New function. (clear_list): Delete. (one_inferior_p): New function. (clear_inferior_list): New function. (clear_inferiors): Update. * inferiors.h (for_each_inferior_with_data): Declare. (clear_inferior_list): Declare. (one_inferior_p): Declare. (get_first_inferior): Declare. * linux-low.c (linux_wait_for_event): Replace accessing list implemention details with API function. * server.c (target_running): Ditto. (accumulate_file_name_length): New function. (emit_dll_description): New function. (handle_qxfer_libraries): Replace accessing list implemention details with API function. (handle_qxfer_threads_worker): New function. (handle_qxfer_threads_proper): Replace accessing list implemention details with API function. (handle_query): Ditto. (visit_actioned_threads_callback_ftype): New typedef. (visit_actioned_threads_data): New struct. (visit_actioned_threads): Rewrite to be find_inferior callback. (resume): Call find_inferior. (handle_status): Replace accessing list implemention details with API function. (process_serial_event): Replace accessing list implemention details with API function. * target.c (set_desired_inferior): Replace accessing list implemention details with API function. * tracepoint.c (same_process_p): New function. (gdb_agent_about_to_close): Replace accessing list implemention details with API function. * win32-low.c (child_delete_thread): Replace accessing list implemention details with API function. (match_dll_by_basename): New function. (dll_is_loaded_by_basename): New function. (win32_ensure_ntdll_loaded): Replace accessing list implemention details call to dll_is_loaded_by_basename.
2014-02-20 00:28:50 +01:00
2014-02-19 Doug Evans <dje@google.com>
* dll.c (clear_dlls): Replace accessing list implemention details
with API function.
* gdbthread.h (get_first_thread): Declare.
* inferiors.c (for_each_inferior_with_data): New function.
(get_first_thread): New function.
(find_thread_ptid): Simplify.
(get_first_inferior): New function.
(clear_list): Delete.
(one_inferior_p): New function.
(clear_inferior_list): New function.
(clear_inferiors): Update.
* inferiors.h (for_each_inferior_with_data): Declare.
(clear_inferior_list): Declare.
(one_inferior_p): Declare.
(get_first_inferior): Declare.
* linux-low.c (linux_wait_for_event): Replace accessing list
implemention details with API function.
* server.c (target_running): Ditto.
(accumulate_file_name_length): New function.
(emit_dll_description): New function.
(handle_qxfer_libraries): Replace accessing list implemention
details with API function.
(handle_qxfer_threads_worker): New function.
(handle_qxfer_threads_proper): Replace accessing list implemention
details with API function.
(handle_query): Ditto.
(visit_actioned_threads_callback_ftype): New typedef.
(visit_actioned_threads_data): New struct.
(visit_actioned_threads): Rewrite to be find_inferior callback.
(resume): Call find_inferior.
(handle_status): Replace accessing list implemention
details with API function.
(process_serial_event): Replace accessing list implemention details
with API function.
* target.c (set_desired_inferior): Replace accessing list implemention
details with API function.
* tracepoint.c (same_process_p): New function.
(gdb_agent_about_to_close): Replace accessing list implemention
details with API function.
* win32-low.c (child_delete_thread): Replace accessing list
implemention details with API function.
(match_dll_by_basename): New function.
(dll_is_loaded_by_basename): New function.
(win32_ensure_ntdll_loaded): Replace accessing list implemention
details call to dll_is_loaded_by_basename.
2014-02-19 Doug Evans <dje@google.com>
* dll.h (struct dll_info): Add comment.
* gdbthread.h (struct thread_info): Add comment.
(current_ptid): Simplify.
* inferiors.c (add_process): Update.
(remove_process): Update.
* inferiors.h (struct process_info): Rename member "head" to "entry".
* linux-low.c (delete_lwp): Update.
(add_lwp): Update.
(last_thread_of_process_p): Update.
(kill_one_lwp_callback, linux_kill): Update.
(status_pending_p_callback): Update.
(wait_for_sigstop): Update. Simplify read of ptid.
(start_step_over): Update.
* linux-low.h (ptid_of, pid_of, lwpid_of): Update.
(get_lwp_thread): Update.
(struct lwp_info): Rename member "head" to "entry".
* regcache.h (inferior_list_entry): Delete.
* server.c (kill_inferior_callback): Update.
(detach_or_kill_inferior_callback): Update.
(print_started_pid): Update.
(print_attached_pid): Update.
(process_serial_event): Simplify read of ptid.
* thread-db.c (thread_db_create_event): Update.
(thread_db_get_tls_address): Update.
* win32-low.c (current_inferior_ptid): Simplify.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <supports_btrace>: Add target_ops
argument.
(target_supports_btrace): Update.
2014-02-14 Yao Qi <yao@codesourcery.com>
* Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
(rsp-low-ipa.o): New target.
2014-02-12 Tom Tromey <tromey@redhat.com>
* ax.c (gdb_parse_agent_expr): Use hex2bin, not
convert_ascii_to_int.
* regcache.c (registers_to_string): Likewise.
* remote-utils.c (decode_M_packet): Likewise.
* server.c (process_serial_event): Likewise.
2014-02-12 Tom Tromey <tromey@redhat.com>
* server.c (handle_query, handle_v_run): Use hex2bin, not
unhexify.
* tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
2014-02-12 Tom Tromey <tromey@redhat.com>
* ax.c (gdb_unparse_agent_expr): Use bin2hex, not
convert_int_to_ascii.
* regcache.c (registers_to_string, collect_register_as_string):
Likewise.
* remote-utils.c (look_up_one_symbol, relocate_instruction):
Likewise.
* server.c (process_serial_event): Likewise.
* tracepoint.c (cmd_qtstatus, response_source, response_tsv)
(cmd_qtbuffer, cstr_to_hexstr): Likewise.
2014-02-12 Tom Tromey <tromey@redhat.com>
* remote-utils.c (look_up_one_symbol, monitor_output): Use
bin2hex, not hexify.
* tracepoint.c (cmd_qtstatus): Likewise.
2014-02-12 Tom Tromey <tromey@redhat.com>
* remote-utils.c (monitor_output): Pass explicit length to
hexify.
move some rsp bits into rsp-low.h This moves various low-level remote serial protocol bits into common/rsp-low.[ch]. This is as close to a pure move as possible. There are some redundancies remaining but those will be dealt with in a subsequent patch. Note that the two variants of remote_escape_output disagreed on the treatment of "*". On the theory that quoting cannot hurt but the absence possibly can, I chose the gdbserver variant to be the canonical one. 2014-02-12 Tom Tromey <tromey@redhat.com> * tracepoint.c: Include rsp-low.h. * remote.h (hex2bin, bin2hex, unpack_varlen_hex): Don't declare. * remote.c: Include rsp-low.h. (hexchars, ishex, unpack_varlen_hex, pack_nibble, pack_hex_byte) (fromhex, hex2bin, tohex, bin2hex, remote_escape_output) (remote_unescape_input): Move to common/rsp-low.c. * common/rsp-low.h: New file. * common/rsp-low.c: New file. * Makefile.in (SFILES): Add common/rsp-low.c. (HFILES_NO_SRCDIR): Add common/rsp-low.h. (COMMON_OBS): Add rsp-low.o. (rsp-low.o): New target. 2014-02-12 Tom Tromey <tromey@redhat.com> * tracepoint.c: Include rsp-low.h. * server.c: Include rsp-low.h. * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii) (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't declare. * remote-utils.c: Include rsp-low.h. (fromhex, hexchars, ishex, unhexify, tohex, hexify) (remote_escape_output, remote_unescape_input, unpack_varlen_hex) (convert_int_to_ascii, convert_ascii_to_int): Move to common/rsp-low.c. * regcache.c: Include rsp-low.h. * ax.c: Include rsp-low.h. * Makefile.in (SFILES): Add common/rsp-low.c. (OBS): Add rsp-low.o. (rsp-low.o): New target.
2014-01-18 22:32:47 +01:00
2014-02-12 Tom Tromey <tromey@redhat.com>
* tracepoint.c: Include rsp-low.h.
* server.c: Include rsp-low.h.
* remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
(unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
declare.
* remote-utils.c: Include rsp-low.h.
(fromhex, hexchars, ishex, unhexify, tohex, hexify)
(remote_escape_output, remote_unescape_input, unpack_varlen_hex)
(convert_int_to_ascii, convert_ascii_to_int): Move to
common/rsp-low.c.
* regcache.c: Include rsp-low.h.
* ax.c: Include rsp-low.h.
* Makefile.in (SFILES): Add common/rsp-low.c.
(OBS): Add rsp-low.o.
(rsp-low.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-06 Tom Tromey <tromey@redhat.com>
* Makefile.in (SFILES): Fix indentation.
2014-02-05 Doug Evans <dje@google.com>
* linux-low.c (linux_wait_for_event): Improve comment.
(linux_wait_1): Keep current_inferior in sync with event_child.
2014-01-22 Doug Evans <dje@google.com>
* gdbthread.h (gdb_id_to_thread): Delete, unused.
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".
2014-01-22 23:17:39 +01:00
2014-01-22 Doug Evans <dje@google.com>
* 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.
2014-01-20 Baruch Siach <baruch@tkos.co.il>
* linux-xtensa-low.c: Include asm/ptrace.h instead of
sys/ptrace.h.
2014-01-17 Pedro Alves <palves@redhat.com>
PR build/16445
* linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
defined after including gdb_proc_service.h.
2014-01-16 Doug Evans <dje@google.com>
* dll.c (UNSPECIFIED_CORE_ADDR): New macro.
(match_dll): Use it.
btrace, gdbserver: read branch trace incrementally Read branch trace data incrementally and extend the current trace rather than discarding it and reading the entire trace buffer each time. If the branch trace buffer overflowed, we can't extend the current trace so we discard it and start anew by reading the entire branch trace buffer. 2014-01-16 Markus Metzger <markus.t.metzger@intel.com> * common/linux-btrace.c (perf_event_read_bts, linux_read_btrace): Support delta reads. (linux_disable_btrace): Change return type. * common/linux-btrace.h (linux_read_btrace): Change parameters and return type to allow error reporting. Update users. (linux_disable_btrace): Change return type. Update users. * common/btrace-common.h (btrace_read_type) <BTRACE_READ_DELTA>: New. (btrace_error): New. (btrace_block) <begin>: Comment on BEGIN == 0. * btrace.c (btrace_compute_ftrace): Start from the end of the current trace. (btrace_stitch_trace, btrace_clear_history): New. (btrace_fetch): Read delta trace, return if replaying. (btrace_clear): Move clear history code to btrace_clear_history. (parse_xml_btrace): Throw an error if parsing failed. * target.h (struct target_ops) <to_read_btrace>: Change parameters and return type to allow error reporting. (target_read_btrace): Change parameters and return type to allow error reporting. * target.c (target_read_btrace): Update. * remote.c (remote_read_btrace): Support delta reads. Pass errors on. * NEWS: Announce it. gdbserver/ * target.h (target_ops) <read_btrace>: Change parameters and return type to allow error reporting. * server.c (handle_qxfer_btrace): Support delta reads. Pass trace reading errors on. * linux-low.c (linux_low_read_btrace): Pass trace reading errors on. (linux_low_disable_btrace): New.
2013-06-03 15:39:35 +02:00
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* target.h (target_ops) <read_btrace>: Change parameters and
return type to allow error reporting.
* server.c (handle_qxfer_btrace): Support delta reads. Pass
trace reading errors on.
* linux-low.c (linux_low_read_btrace): Pass trace reading
errors on.
(linux_low_disable_btrace): New.
2014-01-15 Doug Evans <dje@google.com>
* inferiors.c (thread_id_to_gdb_id): Delete.
* inferiors.h (thread_id_to_gdb_id): Delete.
2014-01-13 Eli Zaretskii <eliz@gnu.org>
* Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
"-I$(srcdir)/../". Fixes MinGW compilation errors with old GCC
versions.
2014-01-08 Pedro Alves <palves@redhat.com>
* server.c (handle_status): Don't discard previous queued stop
replies or thread's pending status here.
(main) <disconnection>: Do it here instead.
[remote/gdbserver] Don't lose signals when reconnecting. Currently, when GDB connects in all-stop mode, GDBserver always responds to the status packet with a GDB_SIGNAL_TRAP, even if the program is actually stopped for some other signal. (gdb) tar rem ... ... (gdb) c Program received signal SIGUSR1, User defined signal 1. (gdb) disconnect (gdb) tar rem ... (gdb) c (Or a GDB crash instead of an explicit disconnect.) This results in the program losing that signal on that last continue, because gdb will tell the target to resume with no signal (to suppress the GDB_SIGNAL_TRAP, due to 'handle SISGTRAP nopass'), and that will actually suppress the real signal the program had stopped for (SIGUSR1). To fix that, I think we should make GDBserver report the real signal the thread had stopped for in response to the status packet: @item ? @cindex @samp{?} packet Indicate the reason the target halted. The reply is the same as for step and continue. But, that raises the question -- which thread are we reporting the status for? Due to how the RSP in all-stop works, we can only report one status. The status packet's response is a stop reply packet, so it includes the thread identifier, so it's not a problem packet-wise. However, GDBserver is currently always reporting the status for first thread in the thread list, even though that may well not be the thread that got the signal that caused the program to stop. So the next logical step would be to report the status for the last_ptid/last_status thread (the last event reported to gdb), if it's still around; and if not, fallback to some other thread. There's an issue on the GDB side with that, though... GDB currently always adds the thread reported in response to the status query as the first thread in its list. That means that if we start with e.g., (gdb) info threads 3 Thread 1003 ... * 2 Thread 1002 ... 1 Thread 1001 ... And reconnect: (gdb) disconnect (gdb) tar rem ... We end up with: (gdb) info threads 3 Thread 1003 ... 2 Thread 1001 ... * 1 Thread 1002 ... Not a real big issue, but it's reasonably fixable, by having GDB fetch/sync the thread list before fetching the status/'?', and then using the status to select the right thread as current on the GDB side. Holes in the thread numbers are squashed before/after reconnection (e.g., 2,3,5 becomes 1,2,3), but the order is preserved, which I think is both good, and good enough. However (yes, there's more...), the previous GDB that was connected might have had gdbserver running in non-stop mode, or could have left gdbserver doing disconnected tracing (which also forces non-stop), and if the new gdb/connection is in all-stop mode, we can end up with more than one thread with a signal to report back to gdb. As we can only report one thread/status (in the all-stop RSP variant; the non-stop variant doesn't have this issue), we get to do what we do at every other place we have this situation -- leave events we can't report right now as pending, so that the next resume picks them up. Note all this ammounts to a QoI change, within the existing framework. There's really no RSP change here. The only user visible change (other than that the signal is program is stopped at isn't lost / is passed to the program), is in "info program", that now can show the signal the program stopped for. Of course, the next resume will respect the pass/nopass setting for the signal in question. It'd be reasonable to have the initial connection tell the user the program was stopped with a signal, similar to when we load a core to debug, but I'm leaving that out for a future change. I think we'll need to either change how handle_inferior_event & co handle stop_soon, or maybe bypass them completely (like fork-child.c:startup_inferior) for that. Tested on x86_64 Fedora 17. gdb/gdbserver/ 2014-01-08 Pedro Alves <palves@redhat.com> * gdbthread.h (struct thread_info) <status_pending_p>: New field. * server.c (visit_actioned_threads, handle_pending_status): New function. (handle_v_cont): Factor out parts to ... (resume): ... this new function. If in all-stop, and a thread being resumed has a pending status, report it without actually resuming. (myresume): Adjust to use the new 'resume' function. (clear_pending_status_callback, set_pending_status_callback) (find_status_pending_thread_callback): New functions. (handle_status): Handle the case of multiple threads having interesting statuses to report. Report threads' real last signal instead of always reporting GDB_SIGNAL_TRAP. Look for a thread with an interesting thread to report the status for, instead of always reporting the status of the first thread. gdb/ 2014-01-08 Pedro Alves <palves@redhat.com> * remote.c (remote_add_thread): Add threads silently if starting up. (remote_notice_new_inferior): If in all-stop, and starting up, don't call notice_new_inferior. (get_current_thread): New function, factored out from ... (add_current_inferior_and_thread): ... this. Adjust. (remote_start_remote) <all-stop>: Fetch the thread list. If we found any thread, then select the remote's current thread as GDB's current thread too. gdb/testsuite/ 2014-01-08 Pedro Alves <palves@redhat.com> * gdb.threads/reconnect-signal.c: New file. * gdb.threads/reconnect-signal.exp: New file.
2014-01-08 19:55:51 +01:00
2014-01-08 Pedro Alves <palves@redhat.com>
* gdbthread.h (struct thread_info) <status_pending_p>: New field.
* server.c (visit_actioned_threads, handle_pending_status): New
function.
(handle_v_cont): Factor out parts to ...
(resume): ... this new function. If in all-stop, and a thread
being resumed has a pending status, report it without actually
resuming.
(myresume): Adjust to use the new 'resume' function.
(clear_pending_status_callback, set_pending_status_callback)
(find_status_pending_thread_callback): New functions.
(handle_status): Handle the case of multiple threads having
interesting statuses to report. Report threads' real last signal
instead of always reporting GDB_SIGNAL_TRAP. Look for a thread
with an interesting thread to report the status for, instead of
always reporting the status of the first thread.
2014-01-01 Joel Brobecker <brobecker@adacore.com>
* gdbserver.c (gdbserver_version): Set copyright year to 2014.
* gdbreplay.c (gdbreplay_version): Likewise.
2013-12-18 Yufeng Zhang <yufeng.zhang@arm.com>
* linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
iov.iov_len with the real length in use.
2013-12-13 Joel Brobecker <brobecker@adacore.com>
* Makefile.in (safe-ctype.o, lbasename.o): New rules.
* configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
for all targets that use win32-low.c.
* win32-low.c (win32_ensure_ntdll_loaded): New function.
(do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
2013-12-13 Pedro Alves <palves@redhat.com>
* target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
if equal to TARGET_WAITKIND_LOADED.
* win32-low.c (cached_status): New static global.
(win32_wait): Add declaration.
(do_initial_child_stuff): Flush all initial pending debug events
up to the initial breakpoint.
(win32_wait): If CACHED_STATUS was set, return that instead
of doing a real wait. Remove the code resuming the execution
of the inferior after receiving a TARGET_WAITKIND_LOADED event
during the initial phase. Also remove the code changing
OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
TARGET_WAITKIND_STOPPED.
2013-12-11 Yao Qi <yao@codesourcery.com>
* notif.c (handle_notif_ack): Return 0 if no notification
matches.
2013-11-20 Doug Evans <dje@google.com>
* linux-low.c (linux_set_resume_request): Fix comment.
2013-11-20 Doug Evans <dje@google.com>
* linux-low.c (resume_status_pending_p): Tweak comment.
2013-11-20 Walfred Tedeschi <walfred.tedeschi@intel.com>
* Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
* configure.srv (srv_i386_regobj): Add i386-mpx.o.
(srv_i386_linux_regobj): Add i386-mpx-linux.o.
(srv_amd64_regobj): Add amd64-mpx.o.
(srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
(srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
(srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
* i387-fp.c (num_pl_bnd_register) Added constant.
(num_pl_bnd_cfg_registers) Added constant.
(struct i387_xsave) Added reserved area and MPX fields.
(i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
* linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
function.
(tdesc_i386_mpx_linux): Add MPX amd64 target.
(init_registers_amd64_mpx_linux): Declare new function.
(tdesc_amd64_mpx_linux): Add MPX amd64 target.
(x86_64_regmap): Add MPX registers.
(x86_linux_read_description): Add MPX case.
(initialize_low_arch): Initialize MPX targets.
2013-11-18 Tom Tromey <tromey@redhat.com>
* configure: Rebuild.
* configure.ac: Don't check for stdlib.h.
* gdbreplay.c: Unconditionally include stdlib.h.
2013-11-18 Tom Tromey <tromey@redhat.com>
* config.in: Rebuild.
* configure: Rebuild.
* configure.ac: Don't use AC_HEADER_DIRENT.
2013-11-18 Tom Tromey <tromey@redhat.com>
* server.h: Don't check HAVE_STRING_H.
* gdbreplay.c: Don't check HAVE_STRING_H.
* configure: Rebuild.
2013-11-18 Tom Tromey <tromey@redhat.com>
* Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
LIBGNU.
2013-11-08 Tom Tromey <tromey@redhat.com>
* configure, config.in: Rebuild.
* configure.ac: Remove unused configury.
2013-11-08 Tom Tromey <tromey@redhat.com>
* acinclude.m4: Include common.m4, codeset.m4.
* configure, config.in: Rebuild.
* configure.ac: Use GDB_AC_COMMON.
2013-11-06 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-s390-low.c (HWCAP_S390_TE): New define.
(s390_arch_setup): Consider the TE field in the HWCAP for
determining 'have_regset_tdb'.
2013-10-16 Sergio Durigan Junior <sergiodj@redhat.com>
PR gdb/16014
* tracepoint.c (download_tracepoint_1): Remove unnecessary double
call to sizeof.
[GDBserver]: Silence exits if GDB is connected through stdio. If we make gdbserver gdb_continue_to_end actually expect a process exit with GDBserver, we get many testsuite failures with the remote stdio board: -PASS: gdb.arch/amd64-disp-step.exp: continue until exit at amd64-disp-step +FAIL: gdb.arch/amd64-disp-step.exp: continue until exit at amd64-disp-step (the program exited) -PASS: gdb.base/break.exp: continue until exit at recursive next test +FAIL: gdb.base/break.exp: continue until exit at recursive next test (the program exited) -PASS: gdb.base/chng-syms.exp: continue until exit at breakpoint first time through +FAIL: gdb.base/chng-syms.exp: continue until exit at breakpoint first time through (the program exited) ... etc. ... This is what the log shows for all of them: (gdb) continue Continuing. Child exited with status 0 GDBserver exiting [Inferior 1 (process 22721) exited normally] (gdb) FAIL: gdb.arch/amd64-disp-step.exp: continue until exit (the program exited) The problem is the whole "Child exited ... GDBserver exiting" output, that comes out of GDBserver, and that the testsuite is not expecting. I pondered somehow making the testsuite adjust to this. But, testsuite aside, I think GDBserver should not be outputting this at all when GDB is connected through stdio. GDBserver will be printing this in GDB's console, but the user can already tell from the regular output that the inferior is gone. Again, manually: (gdb) tar remote | ./gdbserver/gdbserver - program Remote debugging using | ./gdbserver/gdbserver - program Process program created; pid = 22486 stdin/stdout redirected Remote debugging using stdio done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 0x000000323d001530 in _start () from /lib64/ld-linux-x86-64.so.2 (gdb) c Continuing. Child exited with status 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^ GDBserver exiting ^^^^^^^^^^^^^^^^^ [Inferior 1 (process 22486) exited with code 01] (gdb) Suppressing those two lines makes the output be exactly like when debugging against a remote tcp gdbserver: (gdb) c Continuing. [Inferior 1 (process 22914) exited with code 01] (gdb) 2013-10-02 Pedro Alves <palves@redhat.com> * server.c (process_serial_event): Don't output "GDBserver exiting" if GDB is connected through stdio. * target.c (mywait): Likewise, be silent if GDB is connected through stdio.
2013-10-02 13:42:35 +02:00
2013-10-02 Pedro Alves <palves@redhat.com>
* server.c (process_serial_event): Don't output "GDBserver
exiting" if GDB is connected through stdio.
* target.c (mywait): Likewise, be silent if GDB is connected
through stdio.
2013-10-01 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_add_threads_after_attach): New function.
(lynx_attach): Remove call to add_thread. Add call to
lynx_add_threads_after_attach instead.
2013-09-28 Mike Frysinger <vapier@gentoo.org>
* configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
* config.in, configure: Regenerated.
2013-09-18 Yao Qi <yao@codesourcery.com>
PR server/15959
* server.c (start_inferior): Clear 'resume_info'.
2013-09-16 Jiong Wang <jiwang@tilera.com>
* linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
for each register.
2013-09-16 Jiong Wang <jiwang@tilera.com>
* configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
linux-tile-low.o to srv_tgtobj.
2013-09-16 Will Newton <will.newton@linaro.org>
* linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
out regs.
2013-09-06 Pedro Alves <palves@redhat.com>
* Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
(signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
(linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
(server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
(gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
(mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
2013-09-06 Pedro Alves <palves@redhat.com>
* Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
explicit header dependencies and use $COMPILE/$POSTCOMPILE.
2013-09-06 Pedro Alves <palves@redhat.com>
* linux-amd64-ipa.c: Include tracepoint.h.
* linux-i386-ipa.c: Include tracepoint.h.
2013-09-06 Ricard Wanderlof <ricardw@axis.com>
* linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
(ps_get_thread_area): New function.
2013-09-06 Ricard Wanderlof <ricardw@axis.com>
* linux-crisv32-low.c (elf_gregset_t): Delete typedef.
(initialize_low_arch): Call init_registers_crisv32 rather than
init_register_crisv32.
2013-09-05 Pedro Alves <palves@redhat.com>
* server.h (handle_vFile, hostio_last_error_from_errno): Move
to ...
* hostio.h: ... this new file.
* hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
win32-low.c: Include hostio.h.
2013-09-05 Pedro Alves <palves@redhat.com>
* server.h (gdb_client_data, handler_func, callback_handler_func)
(delete_file_handler, add_file_handler, append_callback_event)
(delete_callback_event, start_event_loop, initialize_event_loop):
Move to event-loop.h and include it.
* event-loop.h: New file.
2013-09-05 Pedro Alves <palves@redhat.com>
* dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
* server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
(loaded_dll, unloaded_dll): Move to ...
* dll.h: ... this new file.
* inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
2013-09-05 Pedro Alves <palves@redhat.com>
* server.h (current_process, get_thread_process, all_processes)
(add_inferior_to_list, for_each_inferior, current_inferior)
(remove_inferior, add_process, remove_process, find_process_pid)
(have_started_inferiors_p, have_attached_inferiors_p)
(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
(clear_inferiors, find_inferior, find_inferior_id)
(inferior_target_data, set_inferior_target_data)
(inferior_regcache_data, set_inferior_regcache_data): Move to
inferiors.h, and include it.
* inferiors.h: New file.
2013-09-05 Pedro Alves <palves@redhat.com>
* server.h (struct emit_ops, current_insn_ptr, emit_error):
Move ...
* ax.h: ... here.
2013-09-05 Pedro Alves <palves@redhat.com>
* ax.c, linux-low.c, linux-x86-low.c, server.c: Include
tracepoint.h.
* server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
(disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
(handle_tracepoint_general_set, handle_tracepoint_query)
(tracepoint_finished_step, tracepoint_was_hit)
(release_while_stepping_state_list, current_traceframe)
(in_readonly_region, traceframe_read_mem)
(fetch_traceframe_registers, traceframe_read_sdata)
(traceframe_read_info, struct fast_tpoint_collect_status)
(fast_tracepoint_collecting, force_unlock_trace_buffer)
(handle_tracepoit_bkpts, initialize_low_tracepoint)
(supply_fast_tracepoint_registers)
(supply_static_tracepoint_registers, set_trampoline_buffer_space)
(ipa_tdesc, claim_trampoline_space)
(have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
(agent_mem_read, agent_get_trace_state_variable_value)
(agent_set_trace_state_variable_value, agent_tsv_read)
(agent_mem_read_string, get_raw_reg_func_addr)
(get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
* tracepoint.h: ... this new file.
2013-09-05 Pedro Alves <palves@redhat.com>
* server.h (perror_with_name, error, fatal, warning, paddress)
(pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
include it.
* utils.h: New file.
2013-09-05 Pedro Alves <palves@redhat.com>
* server.h (remote_debug, noack_mode, transport_is_reliable)
(gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
(read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
(getpkt, remote_prepare, remote_open, remote_close, write_ok)
(write_enn, initialize_async_io, enable_async_io)
(disable_async_io, check_remote_input_interrupt_request)
(convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
(dead_thread_notify, prepare_resume_reply)
(decode_address_to_semicolon, decode_address, decode_m_packet)
(decode_M_packet, decode_X_packet, decode_xfer_write)
(decode_search_memory_packet, unhexify, hexify)
(remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
(look_up_one_symbol, relocate_instruction)
(monitor_output): Move to remote-utils.h, and include it.
* remote-utils.h: New file.
2013-09-05 Pedro Alves <palves@redhat.com>
* server.h (_): Delete.
[gdbserver] Fix trace-buffer-size.exp FAILs. I'm seeing trace-buffer-size.exp failing (with gdbserver): (gdb) PASS: gdb.trace/trace-buffer-size.exp: tstatus check 2 show trace-buffer-size 4 Requested size of trace buffer is 4. (gdb) PASS: gdb.trace/trace-buffer-size.exp: show trace buffer size set trace-buffer-size -1 memory clobbered past end of allocated block Remote connection closed (gdb) FAIL: gdb.trace/trace-buffer-size.exp: set trace buffer size 2 set trace-buffer-size unlimited (gdb) PASS: gdb.trace/trace-buffer-size.exp: set trace-buffer-size unlimited That "memory clobbered past end of allocated block" is mcheck triggering. Valgrind shows: ==23624== Invalid write of size 1 ==23624== at 0x418DD8: clear_trace_buffer (tracepoint.c:1443) ==23624== by 0x418F3A: init_trace_buffer (tracepoint.c:1497) ==23624== by 0x41D95B: cmd_bigqtbuffer_size (tracepoint.c:4061) ==23624== by 0x41DEEC: handle_tracepoint_general_set (tracepoint.c:4193) clear_trace_buffer does: static void clear_trace_buffer (void) { trace_buffer_start = trace_buffer_lo; trace_buffer_free = trace_buffer_lo; trace_buffer_end_free = trace_buffer_hi; trace_buffer_wrap = trace_buffer_hi; /* A traceframe with zeroed fields marks the end of trace data. */ ((struct traceframe *) trace_buffer_free)->tpnum = 0; ((struct traceframe *) trace_buffer_free)->data_size = 0; traceframe_read_count = traceframe_write_count = 0; traceframes_created = 0; } And the tpnum+data_size fields are over 4 bytes... This fixes it by ensuring we allocate space at least for an EOB. We have code elsewhere that relies on the EOB being present (like e.g., find_traceframe), so this seems simplest. gdb/gdbserver/ 2013-09-02 Pedro Alves <palves@redhat.com> * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro. (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is allocated. (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
2013-09-02 17:15:57 +02:00
2013-09-02 Pedro Alves <palves@redhat.com>
* tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
(init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
allocated.
(trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
2013-09-02 Pierre Muller <muller@sourceware.org>
* win32-low.c (child_xfer_memory): Check if ReadProcessMemory
or WriteProcessMemory complete successfully and handle
ERROR_PARTIAL_COPY error.
2013-09-02 Pedro Alves <palves@redhat.com>
* server.c (gdb_read_memory): Return -1 on traceframe memory read
error instead of EIO.
2013-08-28 Jan Kratochvil <jan.kratochvil@redhat.com>
PR server/15604
* linux-low.c: Include filestuff.h.
(linux_create_inferior) <pid == 0>: Call close_most_fds.
* lynx-low.c: Include filestuff.h.
(lynx_create_inferior) <pid == 0>: Call close_most_fds.
* server.c: Include filestuff.h.
(main): Call notice_open_fds.
* spu-low.c: Include filestuff.h.
(spu_create_inferior) <pid == 0>: Call close_most_fds.
Unify ptrace options discovery code and make both GDB and gdbserver use it. gdb/ * Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-nat.h and nat/linux-waitpid.h. (linux-waitpid.o): New object file rule. * common/linux-ptrace.c: Include nat/linux-waitpid.h. (current_ptrace_options): Moved from linux-nat.c. (linux_ptrace_test_ret_to_nx): Use type casts for ptrace parameters. (linux_fork_to_function): New function. (linux_grandchild_function): Likewise. (linux_child_function): Likewise. (linux_check_ptrace_features): New function, heavily based on linux-nat.c:linux_test_for_tracefork. (linux_enable_event_reporting): New function. (ptrace_supports_feature): Likewise. (linux_supports_tracefork): Likewise. (linux_supports_traceclone): Likewise. (linux_supports_tracevforkdone): Likewise. (linux_supports_tracesysgood): Likewise. * common/linux-ptrace.h (HAS_NOMMU): Moved from gdbserver/linux-low.c. (linux_enable_event_reporting): New declaration. (linux_supports_tracefork): Likewise. (linux_supports_traceclone): Likewise. (linux_supports_tracevforkdone): Likewise. (linux_supports_tracesysgood): Likewise. * config.in (PTRACE_TYPE_ARG4): Regenerate. * config/aarch64/linux.mh (NATDEPFILES): Add linux-waitpid.o. * config/alpha/alpha-linux.mh (NATDEPFILES): Likewise. * config/arm/linux.mh (NATDEPFILES): Likewise. * config/i386/linux.mh (NATDEPFILES): Likewise. * config/i386/linux64.mh (NATDEPFILES): Likewise. * config/ia64/linux.mh (NATDEPFILES): Likewise. * config/m32r/linux.mh (NATDEPFILES): Likewise. * config/m68k/linux.mh (NATDEPFILES): Likewise. * config/mips/linux.mh (NATDEPFILES): Likewise. * config/pa/linux.mh (NATDEPFILES): Likewise.. * config/powerpc/linux.mh (NATDEPFILES): Likewise.. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise. * config/powerpc/spu-linux.mh (NATDEPFILES): Likewise. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * config/tilegx/linux.mh (NATDEPFILES): Likewise. * config/xtensa/linux.mh (NATDEPFILES): Likewise. * configure.ac (AC_CACHE_CHECK): Add void * to the list of ptrace's 4th argument's types. Check the type of PTRACE_TYPE_ARG4. * configure: Regenerate. * linux-nat.c: Include nat/linux-nat.h and nat/linux-waitpid.h. (SYSCALL_SIGTRAP): Moved to nat/linux-nat.h. (linux_supports_tracefork_flag): Remove. (linux_supports_tracesysgood_flag): Likewise. (linux_supports_tracevforkdone_flag): Likewise. (current_ptrace_options): Moved to common/linux-ptrace.c. (linux_tracefork_child): Remove. (my_waitpid): Remove. (linux_test_for_tracefork): Renamed to linux_check_ptrace_features and moved to common/linux-ptrace.c. (linux_test_for_tracesysgood): Remove. (linux_supports_tracesysgood): Remove. (linux_supports_tracefork): Remove. (linux_supports_tracevforkdone): Remove. (linux_enable_tracesysgood): Remove. (linux_enable_event_reporting): Remove. (linux_init_ptrace): New function. (linux_child_post_attach): Call linux_init_ptrace. (linux_child_post_startup_inferior): Call linux_init_ptrace. (linux_child_follow_fork): Call linux_supports_tracefork and linux_supports_tracevforkdone. (linux_child_insert_fork_catchpoint): Call linux_supports_tracefork. (linux_child_insert_vfork_catchpoint): Likewise. (linux_child_set_syscall_catchpoint): Call linux_supports_tracesysgood. (lin_lwp_attach_lwp): Call linux_supports_tracefork. * nat/linux-nat.h: New file. * nat/linux-waitpid.c: New file. * nat/linux-waitpid.h: New file. gdb/gdbserver/ * Makefile.in: Explain why ../target and ../nat are not listed as include file search paths. (linux-waitpid.o): New object file rule. * configure.srv (srv_native_linux_obj): New variable. Replace all occurrences of linux native object files with $srv_native_linux_obj. * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h. (HAS_NOMMU): Move defining logic to common/linux-ptrace.c. (linux_enable_event_reporting): Remove declaration. (my_waitpid): Moved to common/linux-waitpid.c. (linux_wait_for_event): Pass ptid when calling linux_enable_event_reporting. (linux_supports_tracefork_flag): Remove. (linux_enable_event_reporting): Likewise. (linux_tracefork_grandchild): Remove. (STACK_SIZE): Moved to common/linux-ptrace.c. (linux_tracefork_child): Remove. (linux_test_for_tracefork): Remove. (linux_look_up_symbols): Call linux_supports_traceclone. (initialize_low): Remove call to linux_test_for_tracefork. * linux-low.h (PTRACE_TYPE_ARG3): Move to common/linux-ptrace.h. (PTRACE_TYPE_ARG4): Likewise. Include linux-ptrace.h.
2013-08-23 01:46:30 +02:00
2013-08-22 Luis Machado <lgustavo@codesourcery.com>
* Makefile.in: Explain why ../target and ../nat are not
listed as include file search paths.
(linux-waitpid.o): New object file rule.
* configure.srv (srv_native_linux_obj): New variable.
Replace all occurrences of linux native object files with
$srv_native_linux_obj.
* linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
(HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
(linux_enable_event_reporting): Remove declaration.
(my_waitpid): Moved to common/linux-waitpid.c.
(linux_wait_for_event): Pass ptid when calling
linux_enable_event_reporting.
(linux_supports_tracefork_flag): Remove.
(linux_enable_event_reporting): Likewise.
(linux_tracefork_grandchild): Remove.
(STACK_SIZE): Moved to common/linux-ptrace.c.
(linux_tracefork_child): Remove.
(linux_test_for_tracefork): Remove.
(linux_look_up_symbols): Call linux_supports_traceclone.
(initialize_low): Remove call to linux_test_for_tracefork.
* linux-low.h (PTRACE_TYPE_ARG3): Move to
common/linux-ptrace.h.
(PTRACE_TYPE_ARG4): Likewise.
Include linux-ptrace.h.
2013-08-21 Pedro Alves <palves@redhat.com>
* config.in: Renegerate.
2013-08-19 Luis Machado <lgustavo@codesourcery.com>
2013-08-21 23:31:45 +02:00
* Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
(SFILES): Remove $(srcdir)/common/target-common.c and
add $(srcdir)/target/waitstatus.c.
(OBS): Remove target-common.o and add waitstatus.o.
(server_h): Remove $(srcdir)/../common/target-common.h and
add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
and $(srcdir)/../target/waitstatus.h.
(target-common.o): Remove.
(waitstatus.o): New target object file.
* target.h: Do not include target-common.h and
include target/resume.h, target/wait.h and
target/waitstatus.h.
2013-08-13 Luis Machado <lgustavo@codesourcery.com>
* linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
to PTRACE_TYPE_ARG3.
* linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
PTRACE_TYPE_ARG4.
* linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
(PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
2013-07-27 Jie Zhang <jie@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
Yao Qi <yao@codesourcery.com>
* Makefile.in (SFILES): Add common/mips-linux-watch.c.
(mips-linux-watch.o): New rule.
(mips_linux_watch_h): New variable.
* configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
srv_tgtobj.
* linux-mips-low.c: Include mips-linux-watch.h.
(struct arch_process_info, struct arch_lwp_info): New.
(update_watch_registers_callback): New function.
(mips_linux_new_process, mips_linux_new_thread) New functions.
(mips_linux_prepare_to_resume, mips_insert_point): New
functions.
(mips_remove_point, mips_stopped_by_watchpoint): New
functions.
(rsp_bp_type_to_target_hw_bp_type): New function.
(mips_stopped_data_address): New function.
(the_low_target): Add watchpoint support functions.
2013-07-27 Yao Qi <yao@codesourcery.com>
* i386-low.c: Include break-common.h.
(enum target_hw_bp_type): Remove.
2013-07-24 Luis Machado <lgustavo@codesourcery.com>
* Makefile.in (SFILES): /common/target-common.c.
(OBS): Add target-common.o.
(server_h): Add $(srcdir)/../common/target-common.h.
(target-common.o): New target.
* server.c (queue_stop_reply_callback): Free
status string after use.
* target.c (target_waitstatus_to_string): Remove.
* target.h: Include target-common.h.
(resume_kind): Likewise.
(target_waitkind): Likewise.
(target_waitstatus): Likewise.
(TARGET_WNOHANG): Likewise.
2013-07-04 Yao Qi <yao@codesourcery.com>
* Makefile.in (host_alias): Use @host_noncanonical@.
(target_alias): Use @target_noncanonical@.
* configure.ac: Use ACX_NONCANONICAL_TARGET and
ACX_NONCANONICAL_HOST.
* configure: Regenerated.
Revert:
2013-06-28 Mircea Gherzan <mircea.gherzan@intel.com>
* configure.ac (version_host, version_target): Set and AC_SUBST them.
* configure: Rebuild.
* Makefile.in (version_host, version_target): Get from configure.
(version.c): Use $(version_host) and $(version_target).
On mainline/development, also link GDBserver with -lmcheck. This factors --enable-libmcheck related bits from GDB's configure.ac and makes GDBserver use them too. Specifically, the 'development' global is moved to a separate script to it can be sourced by both GDB and GDBserver, and the --enable-libmcheck/--disable-libmcheck bits proper are moved to a new m4 file. I started out by defining 'development' in the m4 file, but in the end decided against it, as a separate script has the advantage that changing it in release branches does not require regenerating configure, unlike today. I had also started out by making the new GDB_AC_LIBMCHECK itself handle the yes/no default fallback depending on release/developement, but since I had split out 'development' to a separate script, and, GDB needs the python checks anyway (hence we'd need to do the python checks in gdb's configure.ac, and pass in a 'default lmcheck yes/no' parameter to GDB_AC_LIBMCHECK anyway), I ended up keeping GDB_AC_LIBMCHECK isolated from the 'development' global. IOW, it's the caller's business to handle it. Tested on x86_64 Fedora 17. Built GDB and GDBserver with and without --enable-libmcheck, and observed --enable-libmcheck overrides the disablement of -lmcheck caused by python supporting threads, and that GDBserver links with -lmcheck when expected. Also observed that changing the 'development' global, and issuing "make" triggers a relink, and '-lmcheck' is included or not from the link accordingly. gdb/ 2013-07-03 Pedro Alves <palves@redhat.com> * Makefile.in (config.status): Depend on development.sh. (aclocal_m4_deps): Add libmcheck.m4. * acinclude.m4: Include libmcheck.m4. * configure.ac: Source development.sh instead of setting 'development' here. --enable-libmcheck/--disable-libmcheck code factored out to GDB_AC_LIBMCHECK. Run it. * development.sh: New file. * libmcheck.m4: New file. * configure: Regenerate. gdb/gdbserver/ 2013-07-03 Pedro Alves <palves@redhat.com> * Makefile.in (config.status): Depend on development.sh. * acinclude.m4: Include libmcheck.m4. * configure: Regenerate.
2013-07-03 15:25:46 +02:00
2013-07-03 Pedro Alves <palves@redhat.com>
* Makefile.in (config.status): Depend on development.sh.
* acinclude.m4: Include libmcheck.m4.
* configure: Regenerate.
2013-07-02 Mircea Gherzan <mircea.gherzan@intel.com>
* win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
attribute inside the parentheses.
(winapi_DebugSetProcessKillOnExit): Ditto.
(winapi_DebugBreakProcess): Ditto.
(winapi_GenerateConsoleCtrlEvent): Ditto.
2013-08-21 23:31:45 +02:00
2013-07-02 Mircea Gherzan <mircea.gherzan@intel.com>
* notif.h (notif_event): Add a dummy member to avoid compiler
errors.
2013-07-01 Pedro Alves <palves@redhat.com>
* hostio.c (HOSTIO_PATH_MAX): Define.
(require_filename, handle_open, handle_unlink, handle_readlink):
Use it.
Normalize on PATH_MAX instead of MAXPATHLEN throughout. With the pathmax gnulib module in place, we can use PATH_MAX consistently throughout, instead of the current mixbag of PATH_MAX and MAXPATHLEN uses. It's no longer necessary to include sys/param.h (supposedly, I can't check all ports touched here) for MAXPATHLEN. Don't remove sys/param.h from GDB's configure.ac, as later tests in the file use HAVE_SYS_PARAM_H checks. Tested on x86_64 Fedora 17. Also cross-built for --host=i686-w64-mingw32, and --host=i586-pc-msdosdjgpp. gdb/ 2013-07-01 Pedro Alves <palves@redhat.com> * defs.h: Include "pathmax.h". * utils.c: Don't include sys/param.h. (gdb_realpath): Remove code that checks for MAXPATHLEN. * solib-ia64-hpux.c (ia64_hpux_handle_load_event): Use PATH_MAX instead of MAXPATHLEN. * solib-sunos.c: Don't include sys/param.h. * xcoffread.c: Don't include sys/param.h. * bsd-kvm.c: Don't include sys/param.h. * darwin-nat.c: Don't include sys/param.h. (darwin_pid_to_exec_file): Use PATH_MAX instead of MAXPATHLEN. * darwin-nat-info.c: Don't include sys/param.h. * fbsd-nat.c (fbsd_pid_to_exec_file): Use PATH_MAX instead of MAXPATHLEN. * i386obsd-nat.c: Don't include sys/param.h. * inf-child.c: Don't include sys/param.h. (inf_child_fileio_readlink): Use PATH_MAX instead of MAXPATHLEN. * linux-fork.c: Don't include sys/param.h. (fork_save_infrun_state): Use PATH_MAX instead of MAXPATHLEN. * linux-nat.c: Don't include sys/param.h. (linux_child_pid_to_exec_file, linux_proc_pending_signals) (linux_proc_pending_signals): Use PATH_MAX instead of MAXPATHLEN. * m68klinux-nat.c: Don't include sys/param.h. * nbsd-nat.c: Don't include sys/param.h. (nbsd_pid_to_exec_file): Use PATH_MAX instead of MAXPATHLEN. * ppc-linux-nat.c: Don't include sys/param.h. * rs6000-nat.c: Don't include sys/param.h. * spu-linux-nat.c. Don't include sys/param.h. * windows-nat.c: Don't include sys/param.h. * xtensa-linux-nat.c: Don't include sys/param.h. * config/i386/nm-fbsd.h: Don't include sys/param.h. gdb/gdbserver/ 2013-07-01 Pedro Alves <palves@redhat.com> * server.h: Include "pathmax.h". * linux-low.c: Don't include sys/param.h. (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of MAXPATHLEN. * win32-low.c: Don't include sys/param.h. (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
2013-07-01 13:28:30 +02:00
2013-07-01 Pedro Alves <palves@redhat.com>
* server.h: Include "pathmax.h".
* linux-low.c: Don't include sys/param.h.
(linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
MAXPATHLEN.
* win32-low.c: Don't include sys/param.h.
(win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
2013-07-01 Pedro Alves <palves@redhat.com>
* event-loop.c: Don't check HAVE_UNISTD_H before including
<unistd.h>.
* gdbreplay.c: Likewise.
* remote-utils.c: Likewise.
* server.c: Likewise.
* configure.ac: Don't check for unistd.h.
* configure: Regenerate.
2013-06-28 Tom Tromey <tromey@redhat.com>
* Makefile.in (version.c): Use version.in, not
common/version.in.
2013-06-28 Mircea Gherzan <mircea.gherzan@intel.com>
* configure.ac (version_host, version_target): Set and AC_SUBST them.
* configure: Rebuild.
* Makefile.in (version_host, version_target): Get from configure.
(version.c): Use $(version_host) and $(version_target).
2013-06-10 Dmitry Kozlov <ddk@codesourcery.com>
Fix trace-status to output user name without trailing colon.
* tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
2013-06-10 Dmitry Kozlov <ddk@codesourcery.com>
Fix trace-status to output proper start-time and stop-time.
* tracepoint.c (cmd_qtstatus): Modify trace-status output to
output start time and stop time in hex as gdb expects.
2013-06-26 Pedro Alves <pedro@codesourcery.com>
* tracepoint.c (build_traceframe_info_xml): Output trace state
variables present in the trace buffer.
don't keep a gdb-specific date Right now there are two nightly commits to update a file in the tree with the current date. One commit is for BFD, one is for gdb. It seems unnecessary to me to do this twice. We can make do with a single such commit. This patch changes gdb in a minimal way to reuse the BFD date -- it extracts it from bfd/version.h and changes version.in to use the placeholder string "DATE" for those times when a date is wanted. I propose removing the cron job that updates the version on trunk, and then check in this patch. For release branches, we can keep the cron job, but just tell it to rewrite bfd/version.h. I believe this is a simple change in the crontab -- the script will work just fine on this file. This also moves version.in and version.h into common/, to reflect their shared status; and updates gdbserver to use version.h besides. * common/create-version.sh: New file. * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (HFILES_NO_SRCDIR): Use common/version.h. * version.in: Move to ... * common/version.in: ... here. Replace date with "DATE". * version.h: Move to ... * common/version.h: ... here. gdbserver: * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (version.o): Remove. * gdbreplay.c: Include version.h. (version, host_name): Don't declare. * server.h: Include version.h. (version, host_name): Don't declare. doc: * Makefile.in (POD2MAN1, POD2MAN5): Use version.subst. (GDBvn.texi): Use version.subst. (version.subst): New target. (mostlyclean): Remove version.subst.
2013-06-24 17:06:27 +02:00
2013-06-24 Tom Tromey <tromey@redhat.com>
* Makefile.in (version.c): Use bfd/version.h, common/version.in,
create-version.sh.
(version.o): Remove.
* gdbreplay.c: Include version.h.
(version, host_name): Don't declare.
* server.h: Include version.h.
(version, host_name): Don't declare.
2013-06-12 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (linux_is_elf64): Delete global.
(x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
with local linux_pid_exe_is_elf_64_file use.
2013-06-11 Pedro Alves <palves@redhat.com>
* linux-low.c (regset_disabled, disable_regset): New functions.
(regsets_fetch_inferior_registers)
(regsets_store_inferior_registers): Use them.
(initialize_regsets_info); Don't allocate the disabled_regsets
array here.
* linux-low.h (struct regsets_info) <disabled_regsets>: Extend
comment.
2013-06-11 Pedro Alves <palves@redhat.com>
* linux-low.c (initialize_regsets_info): Use xcalloc instead of
xmalloc.
2013-06-11 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (initialize_low_arch): Call
init_registers_x32_avx_linux.
2013-06-09 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix compatibility with Android Bionic.
* linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
it is not empty.
[GDBserver] Multi-process + multi-arch This patch makes GDBserver support multi-process + biarch. Currently, if you're debugging more than one process at once with a single gdbserver (in extended-remote mode), then all processes must have the same architecture (e.g., 64-bit vs 32-bit). Otherwise, you see this: Added inferior 2 [Switching to inferior 2 [<null>] (<noexec>)] Reading symbols from /home/pedro/gdb/tests/main32...done. Temporary breakpoint 2 at 0x4004cf: main. (2 locations) Starting program: /home/pedro/gdb/tests/main32 warning: Selected architecture i386 is not compatible with reported target architecture i386:x86-64 warning: Architecture rejected target-supplied description Remote 'g' packet reply is too long: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090cfffff0000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000b042f7460000000000020000230000002b0000002b0000002b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f03000000000000ffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801f00003b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ... etc, etc ... Even though the process was running a 32-bit program, GDBserver sent back to GDB a register set in 64-bit layout. A patch (http://sourceware.org/ml/gdb-patches/2012-11/msg00228.html) a while ago made GDB track a target_gdbarch per inferior, and as consequence, fetch a target description per-inferior. This patch is the GDBserver counterpart, that makes GDBserver keep track of each process'es XML target description and register layout. So in the example above, GDBserver will send the correct register set in 32-bit layout to GDB. A new "struct target_desc" object (tdesc for short) is added, that holds the target description and register layout information about each process. Each `struct process_info' holds a pointer to a target description. The regcache also gains a pointer to a target description, mainly for convenience, and parallel with GDB (and possible future support for programs that flip processor modes). The low target's arch_setup routines are responsible for setting the process'es correct tdesc. This isn't that much different to how things were done before, except that instead of detecting the inferior process'es architecture and calling the corresponding init_registers_FOO routine, which would change the regcache layout globals and recreate the threads' regcaches, the regcache.c globals are gone, and the init_registers_$BAR routines now each initialize a separate global struct target_desc object (one for each arch variant GDBserver supports), and so all the init_registers_$BAR routines that are built into GDBserver are called early at GDBserver startup time (similarly to how GDB handles its built-in target descriptions), and then the arch_setup routine is responsible for making process_info->tdesc point to one of these target description globals. The regcache module is all parameterized to get the regcache's layout from the tdesc object instead of the old register_bytes, etc. globals. The threads' regcaches are now created lazily. The old scheme where we created each of them when we added a new thread doesn't work anymore, because we add the main thread/lwp before we see it stop for the first time, and it is only when we see the thread stop for the first time that we have a chance of determining the inferior's architecture (through the_low_target.arch_setup). Therefore when we add the main thread we don't know which architecture/tdesc its regcache should have. This patch makes the gdb.multi/multi-arch.exp test now pass against (extended-remote) GDBserver. It currently fails, without this patch. The IPA also uses the regcache, so it gains a new global struct target_desc pointer, which points at the description of the process it is loaded in. Re. the linux-low.c & friends changes. Since the register map etc. may differ between processes (64-bit vs 32-bit) etc., the linux_target_ops num_regs, regmap and regset_bitmap data fields are no longer sufficient. A new method is added in their place that returns a pointer to a new struct that includes all info linux-low.c needs to access registers of the current inferior. The patch/discussion that originally introduced linux-low.c:disabled_regsets mentions that the disabled_regsets set may be different per mode (in a biarch setup), and indeed that is cleared whenever we start a new (first) inferior, so that global is moved as well behind the new `struct regs_info'. On the x86 side: I simply replaced the i387-fp.c:num_xmm_registers global with a check for 64-bit or 32-bit process, which is equivalent to how the global was set. This avoided coming up with some more general mechanism that would work for all targets that use this module (GNU/Linux, Windows, etc.). Tested: GNU/Linux IA64 GNU/Linux MIPS64 GNU/Linux PowerPC (Fedora 16) GNU/Linux s390x (Fedora 16) GNU/Linux sparc64 (Debian) GNU/Linux x86_64, -m64 and -m32 (Fedora 17) Cross built, and smoke tested: i686-w64-mingw32, under Wine. GNU/Linux TI C6x, by Yao Qi. Cross built but otherwise not tested: aarch64-linux-gnu arm-linux-gnu m68k-linux nios2-linux-gnu sh-linux-gnu spu tilegx-unknown-linux-gnu Completely untested: GNU/Linux Blackfin GNU/Linux CRIS GNU/Linux CRISv32 GNU/Linux TI Xtensa GNU/Linux M32R LynxOS QNX NTO gdb/gdbserver/ 2013-06-07 Pedro Alves <palves@redhat.com> * Makefile.in (OBS): Add tdesc.o. (IPA_OBJS): Add tdesc-ipa.o. (tdesc-ipa.o): New rule. * ax.c (gdb_eval_agent_expr): Adjust register_size call to new interface. * linux-low.c (new_inferior): Delete. (disabled_regsets, num_regsets): Delete. (linux_add_process): Adjust to set the new per-process new_inferior flag. (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread. (linux_wait_for_lwp): Adjust. Only call arch_setup if the event was a stop. When calling arch_setup, switch the current inferior to the thread that got an event. (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread. (regsets_fetch_inferior_registers) (regsets_store_inferior_registers): New regsets_info parameter. Adjust to use it. (linux_register_in_regsets): New regs_info parameter. Adjust to use it. (register_addr, fetch_register, store_register): New usrregs_info parameter. Adjust to use it. (usr_fetch_inferior_registers, usr_store_inferior_registers): New parameter regs_info. Adjust to use it. (linux_fetch_registers): Get the current inferior's regs_info, and adjust to use it. (linux_store_registers): Ditto. [HAVE_LINUX_REGSETS] (initialize_regsets_info): New. (initialize_low): Don't initialize the target_regsets here. Call initialize_low_arch. * linux-low.h (target_regsets): Delete declaration. (struct regsets_info): New. (struct usrregs_info): New. (struct regs_info): New. (struct process_info_private) <new_inferior>: New field. (struct linux_target_ops): Delete the num_regs, regmap, and regset_bitmap fields. New field regs_info. [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare. * i387-fp.c (num_xmm_registers): Delete. (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno calls to new interface. (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache) (i387_xsave_to_cache): Adjust find_regno calls to new interface. Infer the number of xmm registers from the regcache's target description. * i387-fp.h (num_xmm_registers): Delete. * inferiors.c (add_thread): Don't install the thread's regcache here. * proc-service.c (gregset_info): Fetch the current inferior's regs_info. Adjust to use it. * regcache.c: Include tdesc.h. (register_bytes, reg_defs, num_registers) (gdbserver_expedite_regs): Delete. (get_thread_regcache): If the thread doesn't have a regcache yet, create one, instead of aborting gdbserver. (regcache_invalidate_one): Rename to ... (regcache_invalidate_thread): ... this. (regcache_invalidate_one): New. (regcache_invalidate): Only invalidate registers of the current process. (init_register_cache): Add target_desc parameter, and use it. (new_register_cache): Ditto. Assert the target description has a non zero registers_size. (regcache_cpy): Add assertions. Adjust. (realloc_register_cache, set_register_cache): Delete. (registers_to_string, registers_from_string): Adjust. (find_register_by_name, find_regno, find_register_by_number) (register_cache_size): Add target_desc parameter, and use it. (free_register_cache_thread, free_register_cache_thread_one) (regcache_release, register_cache_size): New. (register_size): Add target_desc parameter, and use it. (register_data, supply_register, supply_register_zeroed) (supply_regblock, supply_register_by_name, collect_register) (collect_register_as_string, collect_register_by_name): Adjust. * regcache.h (struct target_desc): Forward declare. (struct regcache) <tdesc>: New field. (init_register_cache, new_register_cache): Add target_desc parameter. (regcache_invalidate_thread): Declare. (regcache_invalidate_one): Delete declaration. (regcache_release): Declare. (find_register_by_number, register_cache_size, register_size) (find_regno): Add target_desc parameter. (gdbserver_expedite_regs, gdbserver_xmltarget): Delete declarations. * remote-utils.c: Include tdesc.h. (outreg, prepare_resume_reply): Adjust. * server.c: Include tdesc.h. (gdbserver_xmltarget): Delete declaration. (get_features_xml, process_serial_event): Adjust. * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward declare. (struct process_info) <tdesc>: New field. (ipa_tdesc): Declare. * tdesc.c: New file. * tdesc.h: New file. * tracepoint.c: Include tdesc.h. [IN_PROCESS_AGENT] (ipa_tdesc): Define. (get_context_regcache): Adjust to pass ipa_tdesc down. (do_action_at_tracepoint): Adjust to get the register cache size from the context regcache's description. (traceframe_walk_blocks): Adjust to get the register cache size from the current trace frame's description. (traceframe_get_pc): Adjust to get current trace frame's description and pass it down. (gdb_collect): Adjust to get the register cache size from the IPA's description. * linux-amd64-ipa.c (tdesc_amd64_linux): Declare. (gdbserver_xmltarget): Delete. (initialize_low_tracepoint): Set the ipa's target description. * linux-i386-ipa.c (tdesc_i386_linux): Declare. (initialize_low_tracepoint): Set the ipa's target description. * linux-x86-low.c: Include tdesc.h. [__x86_64__] (is_64bit_tdesc): New. (ps_get_thread_area, x86_get_thread_area): Use it. (i386_cannot_store_register): Rename to ... (x86_cannot_store_register): ... this. Use is_64bit_tdesc. (i386_cannot_fetch_register): Rename to ... (x86_cannot_fetch_register): ... this. Use is_64bit_tdesc. (x86_fill_gregset, x86_store_gregset): Adjust register_size calls to new interface. (target_regsets): Rename to ... (x86_regsets): ... this. (x86_get_pc, x86_set_pc): Adjust register_size calls to new interface. (x86_siginfo_fixup): Use is_64bit_tdesc. [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux) (tdesc_x32_avx_linux, tdesc_x32_linux) (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux): Declare. (x86_linux_update_xmltarget): Delete. (I386_LINUX_XSAVE_XCR0_OFFSET): Define. (have_ptrace_getfpxregs, have_ptrace_getregset): New. (AMD64_LINUX_USER64_CS): New. (x86_linux_read_description): New, based on x86_linux_update_xmltarget. (same_process_callback): New. (x86_arch_setup_process_callback): New. (x86_linux_update_xmltarget): New. (x86_regsets_info): New. (amd64_linux_regs_info): New. (i386_linux_usrregs_info): New. (i386_linux_regs_info): New. (x86_linux_regs_info): New. (x86_arch_setup): Reimplement. (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc. (x86_emit_ops): Ditto. (the_low_target): Adjust. Install x86_linux_regs_info, x86_cannot_fetch_register, and x86_cannot_store_register. (initialize_low_arch): New. * linux-ia64-low.c (tdesc_ia64): Declare. (ia64_fetch_register): Adjust. (ia64_usrregs_info, regs_info): New globals. (ia64_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-sparc-low.c (tdesc_sparc64): Declare. (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack): Adjust. (sparc_arch_setup): New function. (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l) (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l) (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l) (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l) (tdesc_powerpc_64l, tdesc_powerpc_altivec64l) (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l) (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l) (tdesc_powerpc_isa205_vsx64l): Declare. (ppc_cannot_store_register, ppc_collect_ptrace_register) (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc) (ppc_set_pc, ppc_get_hwcap): Adjust. (ppc_usrregs_info): Forward declare. (!__powerpc64__) ppc_regmap_adjusted: New global. (ppc_arch_setup): Adjust to the current process'es target description. (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset) (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse) (ppc_store_evrregset): Adjust. (target_regsets): Rename to ... (ppc_regsets): ... this, and make static. (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals. (ppc_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1) (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1) (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1) (tdesc_s390x_linux64v2): Declare. (s390_collect_ptrace_register, s390_supply_ptrace_register) (s390_fill_gregset, s390_store_last_break): Adjust. (target_regsets): Rename to ... (s390_regsets): ... this, and make static. (s390_get_pc, s390_set_pc): Adjust. (s390_get_hwcap): New target_desc parameter, and use it. [__s390x__] (have_hwcap_s390_high_gprs): New global. (s390_arch_setup): Adjust to set the current process'es target description. Don't adjust the regmap. (s390_usrregs_info, s390_regsets_info, regs_info): New globals. [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264) (regs_info_3264): New globals. (s390_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux) (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare. [__mips64] (init_registers_mips_linux) (init_registers_mips_dsp_linux): Delete defines. [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines. (have_dsp): New global. (mips_read_description): New, based on mips_arch_setup. (mips_arch_setup): Reimplement. (get_usrregs_info): New function. (mips_cannot_fetch_register, mips_cannot_store_register) (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset) (mips_fill_fpregset, mips_store_fpregset): Adjust. (target_regsets): Rename to ... (mips_regsets): ... this, and make static. (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info) (dsp_regs_info, regs_info): New globals. (mips_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt) (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon): Declare. (arm_fill_vfpregset, arm_store_vfpregset): Adjust. (arm_read_description): New, with bits factored from arm_arch_setup. (arm_arch_setup): Reimplement. (target_regsets): Rename to ... (arm_regsets): ... this, and make static. (arm_regsets_info, arm_usrregs_info, regs_info): New globals. (arm_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-m68k-low.c (tdesc_m68k): Declare. (target_regsets): Rename to ... (m68k_regsets): ... this, and make static. (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals. (m68k_regs_info): New function. (m68k_arch_setup): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-sh-low.c (tdesc_sharch): Declare. (target_regsets): Rename to ... (sh_regsets): ... this, and make static. (sh_regsets_info, sh_usrregs_info, regs_info): New globals. (sh_regs_info, sh_arch_setup): New functions. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-bfin-low.c (tdesc_bfin): Declare. (bfin_arch_setup): New function. (bfin_usrregs_info, regs_info): New globals. (bfin_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-cris-low.c (tdesc_cris): Declare. (cris_arch_setup): New function. (cris_usrregs_info, regs_info): New globals. (cris_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-cris-low.c (tdesc_crisv32): Declare. (cris_arch_setup): New function. (cris_regsets_info, cris_usrregs_info, regs_info): New globals. (cris_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-m32r-low.c (tdesc_m32r): Declare. (m32r_arch_setup): New function. (m32r_usrregs_info, regs_info): New globals. (m32r_regs_info): Adjust. (initialize_low_arch): New function. * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux) (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare. (tic6x_usrregs_info): Forward declare. (tic6x_read_description): New function, based on ... (tic6x_arch_setup): ... this. Reimplement. (target_regsets): Rename to ... (tic6x_regsets): ... this, and make static. (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals. (tic6x_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-xtensa-low.c (tdesc_xtensa): Declare. (xtensa_fill_gregset, xtensa_store_gregset): Adjust. (target_regsets): Rename to ... (xtensa_regsets): ... this, and make static. (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New globals. (xtensa_arch_setup, xtensa_regs_info): New functions. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-nios2-low.c (tdesc_nios2_linux): Declare. (nios2_arch_setup): Set the current process'es tdesc. (target_regsets): Rename to ... (nios2_regsets): ... this. (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals. (nios2_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-aarch64-low.c (tdesc_aarch64): Declare. (aarch64_arch_setup): Set the current process'es tdesc. (target_regsets): Rename to ... (aarch64_regsets): ... this. (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals. (aarch64_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare globals. (target_regsets): Rename to ... (tile_regsets): ... this. (tile_regsets_info, tile_usrregs_info, regs_info): New globals. (tile_regs_info): New function. (tile_arch_setup): Set the current process'es tdesc. (the_low_target): Adjust. (initialize_low_arch): New function. * spu-low.c (tdesc_spu): Declare. (spu_create_inferior, spu_attach): Set the new process'es tdesc. * win32-arm-low.c (tdesc_arm): Declare. (arm_arch_setup): New function. (the_low_target): Install arm_arch_setup instead of init_registers_arm. * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare. (init_windows_x86): Rename to ... (i386_arch_setup): ... this. Set `win32_tdesc'. (the_low_target): Adjust. * win32-low.c (win32_tdesc): New global. (child_add_thread): Don't create the thread cache here. (do_initial_child_stuff): Set the new process'es tdesc. * win32-low.h (struct target_desc): Forward declare. (win32_tdesc): Declare. * lynx-i386-low.c (tdesc_i386): Declare global. (lynx_i386_arch_setup): Set `lynx_tdesc'. * lynx-low.c (lynx_tdesc): New global. (lynx_add_process): Set the new process'es tdesc. * lynx-low.h (struct target_desc): Forward declare. (lynx_tdesc): Declare global. * lynx-ppc-low.c (tdesc_powerpc_32): Declare global. (lynx_ppc_arch_setup): Set `lynx_tdesc'. * nto-low.c (nto_tdesc): New global. (do_attach): Set the new process'es tdesc. * nto-low.h (struct target_desc): Forward declare. (nto_tdesc): Declare. * nto-x86-low.c (tdesc_i386): Declare. (nto_x86_arch_setup): Set `nto_tdesc'. gdb/ 2013-06-07 Pedro Alves <palves@redhat.com> * regformats/regdat.sh: Output #include tdesc.h. Make globals static. Output a global target description pointer. (init_registers_${name}): Adjust to initialize a target description structure.
2013-06-07 12:46:59 +02:00
2013-06-07 Pedro Alves <palves@redhat.com>
2013-06-07 12:55:22 +02:00
PR server/14823
[GDBserver] Multi-process + multi-arch This patch makes GDBserver support multi-process + biarch. Currently, if you're debugging more than one process at once with a single gdbserver (in extended-remote mode), then all processes must have the same architecture (e.g., 64-bit vs 32-bit). Otherwise, you see this: Added inferior 2 [Switching to inferior 2 [<null>] (<noexec>)] Reading symbols from /home/pedro/gdb/tests/main32...done. Temporary breakpoint 2 at 0x4004cf: main. (2 locations) Starting program: /home/pedro/gdb/tests/main32 warning: Selected architecture i386 is not compatible with reported target architecture i386:x86-64 warning: Architecture rejected target-supplied description Remote 'g' packet reply is too long: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090cfffff0000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000b042f7460000000000020000230000002b0000002b0000002b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f03000000000000ffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801f00003b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ... etc, etc ... Even though the process was running a 32-bit program, GDBserver sent back to GDB a register set in 64-bit layout. A patch (http://sourceware.org/ml/gdb-patches/2012-11/msg00228.html) a while ago made GDB track a target_gdbarch per inferior, and as consequence, fetch a target description per-inferior. This patch is the GDBserver counterpart, that makes GDBserver keep track of each process'es XML target description and register layout. So in the example above, GDBserver will send the correct register set in 32-bit layout to GDB. A new "struct target_desc" object (tdesc for short) is added, that holds the target description and register layout information about each process. Each `struct process_info' holds a pointer to a target description. The regcache also gains a pointer to a target description, mainly for convenience, and parallel with GDB (and possible future support for programs that flip processor modes). The low target's arch_setup routines are responsible for setting the process'es correct tdesc. This isn't that much different to how things were done before, except that instead of detecting the inferior process'es architecture and calling the corresponding init_registers_FOO routine, which would change the regcache layout globals and recreate the threads' regcaches, the regcache.c globals are gone, and the init_registers_$BAR routines now each initialize a separate global struct target_desc object (one for each arch variant GDBserver supports), and so all the init_registers_$BAR routines that are built into GDBserver are called early at GDBserver startup time (similarly to how GDB handles its built-in target descriptions), and then the arch_setup routine is responsible for making process_info->tdesc point to one of these target description globals. The regcache module is all parameterized to get the regcache's layout from the tdesc object instead of the old register_bytes, etc. globals. The threads' regcaches are now created lazily. The old scheme where we created each of them when we added a new thread doesn't work anymore, because we add the main thread/lwp before we see it stop for the first time, and it is only when we see the thread stop for the first time that we have a chance of determining the inferior's architecture (through the_low_target.arch_setup). Therefore when we add the main thread we don't know which architecture/tdesc its regcache should have. This patch makes the gdb.multi/multi-arch.exp test now pass against (extended-remote) GDBserver. It currently fails, without this patch. The IPA also uses the regcache, so it gains a new global struct target_desc pointer, which points at the description of the process it is loaded in. Re. the linux-low.c & friends changes. Since the register map etc. may differ between processes (64-bit vs 32-bit) etc., the linux_target_ops num_regs, regmap and regset_bitmap data fields are no longer sufficient. A new method is added in their place that returns a pointer to a new struct that includes all info linux-low.c needs to access registers of the current inferior. The patch/discussion that originally introduced linux-low.c:disabled_regsets mentions that the disabled_regsets set may be different per mode (in a biarch setup), and indeed that is cleared whenever we start a new (first) inferior, so that global is moved as well behind the new `struct regs_info'. On the x86 side: I simply replaced the i387-fp.c:num_xmm_registers global with a check for 64-bit or 32-bit process, which is equivalent to how the global was set. This avoided coming up with some more general mechanism that would work for all targets that use this module (GNU/Linux, Windows, etc.). Tested: GNU/Linux IA64 GNU/Linux MIPS64 GNU/Linux PowerPC (Fedora 16) GNU/Linux s390x (Fedora 16) GNU/Linux sparc64 (Debian) GNU/Linux x86_64, -m64 and -m32 (Fedora 17) Cross built, and smoke tested: i686-w64-mingw32, under Wine. GNU/Linux TI C6x, by Yao Qi. Cross built but otherwise not tested: aarch64-linux-gnu arm-linux-gnu m68k-linux nios2-linux-gnu sh-linux-gnu spu tilegx-unknown-linux-gnu Completely untested: GNU/Linux Blackfin GNU/Linux CRIS GNU/Linux CRISv32 GNU/Linux TI Xtensa GNU/Linux M32R LynxOS QNX NTO gdb/gdbserver/ 2013-06-07 Pedro Alves <palves@redhat.com> * Makefile.in (OBS): Add tdesc.o. (IPA_OBJS): Add tdesc-ipa.o. (tdesc-ipa.o): New rule. * ax.c (gdb_eval_agent_expr): Adjust register_size call to new interface. * linux-low.c (new_inferior): Delete. (disabled_regsets, num_regsets): Delete. (linux_add_process): Adjust to set the new per-process new_inferior flag. (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread. (linux_wait_for_lwp): Adjust. Only call arch_setup if the event was a stop. When calling arch_setup, switch the current inferior to the thread that got an event. (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread. (regsets_fetch_inferior_registers) (regsets_store_inferior_registers): New regsets_info parameter. Adjust to use it. (linux_register_in_regsets): New regs_info parameter. Adjust to use it. (register_addr, fetch_register, store_register): New usrregs_info parameter. Adjust to use it. (usr_fetch_inferior_registers, usr_store_inferior_registers): New parameter regs_info. Adjust to use it. (linux_fetch_registers): Get the current inferior's regs_info, and adjust to use it. (linux_store_registers): Ditto. [HAVE_LINUX_REGSETS] (initialize_regsets_info): New. (initialize_low): Don't initialize the target_regsets here. Call initialize_low_arch. * linux-low.h (target_regsets): Delete declaration. (struct regsets_info): New. (struct usrregs_info): New. (struct regs_info): New. (struct process_info_private) <new_inferior>: New field. (struct linux_target_ops): Delete the num_regs, regmap, and regset_bitmap fields. New field regs_info. [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare. * i387-fp.c (num_xmm_registers): Delete. (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno calls to new interface. (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache) (i387_xsave_to_cache): Adjust find_regno calls to new interface. Infer the number of xmm registers from the regcache's target description. * i387-fp.h (num_xmm_registers): Delete. * inferiors.c (add_thread): Don't install the thread's regcache here. * proc-service.c (gregset_info): Fetch the current inferior's regs_info. Adjust to use it. * regcache.c: Include tdesc.h. (register_bytes, reg_defs, num_registers) (gdbserver_expedite_regs): Delete. (get_thread_regcache): If the thread doesn't have a regcache yet, create one, instead of aborting gdbserver. (regcache_invalidate_one): Rename to ... (regcache_invalidate_thread): ... this. (regcache_invalidate_one): New. (regcache_invalidate): Only invalidate registers of the current process. (init_register_cache): Add target_desc parameter, and use it. (new_register_cache): Ditto. Assert the target description has a non zero registers_size. (regcache_cpy): Add assertions. Adjust. (realloc_register_cache, set_register_cache): Delete. (registers_to_string, registers_from_string): Adjust. (find_register_by_name, find_regno, find_register_by_number) (register_cache_size): Add target_desc parameter, and use it. (free_register_cache_thread, free_register_cache_thread_one) (regcache_release, register_cache_size): New. (register_size): Add target_desc parameter, and use it. (register_data, supply_register, supply_register_zeroed) (supply_regblock, supply_register_by_name, collect_register) (collect_register_as_string, collect_register_by_name): Adjust. * regcache.h (struct target_desc): Forward declare. (struct regcache) <tdesc>: New field. (init_register_cache, new_register_cache): Add target_desc parameter. (regcache_invalidate_thread): Declare. (regcache_invalidate_one): Delete declaration. (regcache_release): Declare. (find_register_by_number, register_cache_size, register_size) (find_regno): Add target_desc parameter. (gdbserver_expedite_regs, gdbserver_xmltarget): Delete declarations. * remote-utils.c: Include tdesc.h. (outreg, prepare_resume_reply): Adjust. * server.c: Include tdesc.h. (gdbserver_xmltarget): Delete declaration. (get_features_xml, process_serial_event): Adjust. * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward declare. (struct process_info) <tdesc>: New field. (ipa_tdesc): Declare. * tdesc.c: New file. * tdesc.h: New file. * tracepoint.c: Include tdesc.h. [IN_PROCESS_AGENT] (ipa_tdesc): Define. (get_context_regcache): Adjust to pass ipa_tdesc down. (do_action_at_tracepoint): Adjust to get the register cache size from the context regcache's description. (traceframe_walk_blocks): Adjust to get the register cache size from the current trace frame's description. (traceframe_get_pc): Adjust to get current trace frame's description and pass it down. (gdb_collect): Adjust to get the register cache size from the IPA's description. * linux-amd64-ipa.c (tdesc_amd64_linux): Declare. (gdbserver_xmltarget): Delete. (initialize_low_tracepoint): Set the ipa's target description. * linux-i386-ipa.c (tdesc_i386_linux): Declare. (initialize_low_tracepoint): Set the ipa's target description. * linux-x86-low.c: Include tdesc.h. [__x86_64__] (is_64bit_tdesc): New. (ps_get_thread_area, x86_get_thread_area): Use it. (i386_cannot_store_register): Rename to ... (x86_cannot_store_register): ... this. Use is_64bit_tdesc. (i386_cannot_fetch_register): Rename to ... (x86_cannot_fetch_register): ... this. Use is_64bit_tdesc. (x86_fill_gregset, x86_store_gregset): Adjust register_size calls to new interface. (target_regsets): Rename to ... (x86_regsets): ... this. (x86_get_pc, x86_set_pc): Adjust register_size calls to new interface. (x86_siginfo_fixup): Use is_64bit_tdesc. [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux) (tdesc_x32_avx_linux, tdesc_x32_linux) (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux): Declare. (x86_linux_update_xmltarget): Delete. (I386_LINUX_XSAVE_XCR0_OFFSET): Define. (have_ptrace_getfpxregs, have_ptrace_getregset): New. (AMD64_LINUX_USER64_CS): New. (x86_linux_read_description): New, based on x86_linux_update_xmltarget. (same_process_callback): New. (x86_arch_setup_process_callback): New. (x86_linux_update_xmltarget): New. (x86_regsets_info): New. (amd64_linux_regs_info): New. (i386_linux_usrregs_info): New. (i386_linux_regs_info): New. (x86_linux_regs_info): New. (x86_arch_setup): Reimplement. (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc. (x86_emit_ops): Ditto. (the_low_target): Adjust. Install x86_linux_regs_info, x86_cannot_fetch_register, and x86_cannot_store_register. (initialize_low_arch): New. * linux-ia64-low.c (tdesc_ia64): Declare. (ia64_fetch_register): Adjust. (ia64_usrregs_info, regs_info): New globals. (ia64_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-sparc-low.c (tdesc_sparc64): Declare. (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack): Adjust. (sparc_arch_setup): New function. (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l) (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l) (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l) (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l) (tdesc_powerpc_64l, tdesc_powerpc_altivec64l) (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l) (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l) (tdesc_powerpc_isa205_vsx64l): Declare. (ppc_cannot_store_register, ppc_collect_ptrace_register) (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc) (ppc_set_pc, ppc_get_hwcap): Adjust. (ppc_usrregs_info): Forward declare. (!__powerpc64__) ppc_regmap_adjusted: New global. (ppc_arch_setup): Adjust to the current process'es target description. (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset) (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse) (ppc_store_evrregset): Adjust. (target_regsets): Rename to ... (ppc_regsets): ... this, and make static. (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals. (ppc_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1) (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1) (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1) (tdesc_s390x_linux64v2): Declare. (s390_collect_ptrace_register, s390_supply_ptrace_register) (s390_fill_gregset, s390_store_last_break): Adjust. (target_regsets): Rename to ... (s390_regsets): ... this, and make static. (s390_get_pc, s390_set_pc): Adjust. (s390_get_hwcap): New target_desc parameter, and use it. [__s390x__] (have_hwcap_s390_high_gprs): New global. (s390_arch_setup): Adjust to set the current process'es target description. Don't adjust the regmap. (s390_usrregs_info, s390_regsets_info, regs_info): New globals. [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264) (regs_info_3264): New globals. (s390_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux) (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare. [__mips64] (init_registers_mips_linux) (init_registers_mips_dsp_linux): Delete defines. [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines. (have_dsp): New global. (mips_read_description): New, based on mips_arch_setup. (mips_arch_setup): Reimplement. (get_usrregs_info): New function. (mips_cannot_fetch_register, mips_cannot_store_register) (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset) (mips_fill_fpregset, mips_store_fpregset): Adjust. (target_regsets): Rename to ... (mips_regsets): ... this, and make static. (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info) (dsp_regs_info, regs_info): New globals. (mips_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt) (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon): Declare. (arm_fill_vfpregset, arm_store_vfpregset): Adjust. (arm_read_description): New, with bits factored from arm_arch_setup. (arm_arch_setup): Reimplement. (target_regsets): Rename to ... (arm_regsets): ... this, and make static. (arm_regsets_info, arm_usrregs_info, regs_info): New globals. (arm_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-m68k-low.c (tdesc_m68k): Declare. (target_regsets): Rename to ... (m68k_regsets): ... this, and make static. (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals. (m68k_regs_info): New function. (m68k_arch_setup): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-sh-low.c (tdesc_sharch): Declare. (target_regsets): Rename to ... (sh_regsets): ... this, and make static. (sh_regsets_info, sh_usrregs_info, regs_info): New globals. (sh_regs_info, sh_arch_setup): New functions. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-bfin-low.c (tdesc_bfin): Declare. (bfin_arch_setup): New function. (bfin_usrregs_info, regs_info): New globals. (bfin_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-cris-low.c (tdesc_cris): Declare. (cris_arch_setup): New function. (cris_usrregs_info, regs_info): New globals. (cris_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-cris-low.c (tdesc_crisv32): Declare. (cris_arch_setup): New function. (cris_regsets_info, cris_usrregs_info, regs_info): New globals. (cris_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-m32r-low.c (tdesc_m32r): Declare. (m32r_arch_setup): New function. (m32r_usrregs_info, regs_info): New globals. (m32r_regs_info): Adjust. (initialize_low_arch): New function. * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux) (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare. (tic6x_usrregs_info): Forward declare. (tic6x_read_description): New function, based on ... (tic6x_arch_setup): ... this. Reimplement. (target_regsets): Rename to ... (tic6x_regsets): ... this, and make static. (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals. (tic6x_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-xtensa-low.c (tdesc_xtensa): Declare. (xtensa_fill_gregset, xtensa_store_gregset): Adjust. (target_regsets): Rename to ... (xtensa_regsets): ... this, and make static. (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New globals. (xtensa_arch_setup, xtensa_regs_info): New functions. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-nios2-low.c (tdesc_nios2_linux): Declare. (nios2_arch_setup): Set the current process'es tdesc. (target_regsets): Rename to ... (nios2_regsets): ... this. (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals. (nios2_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-aarch64-low.c (tdesc_aarch64): Declare. (aarch64_arch_setup): Set the current process'es tdesc. (target_regsets): Rename to ... (aarch64_regsets): ... this. (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals. (aarch64_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare globals. (target_regsets): Rename to ... (tile_regsets): ... this. (tile_regsets_info, tile_usrregs_info, regs_info): New globals. (tile_regs_info): New function. (tile_arch_setup): Set the current process'es tdesc. (the_low_target): Adjust. (initialize_low_arch): New function. * spu-low.c (tdesc_spu): Declare. (spu_create_inferior, spu_attach): Set the new process'es tdesc. * win32-arm-low.c (tdesc_arm): Declare. (arm_arch_setup): New function. (the_low_target): Install arm_arch_setup instead of init_registers_arm. * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare. (init_windows_x86): Rename to ... (i386_arch_setup): ... this. Set `win32_tdesc'. (the_low_target): Adjust. * win32-low.c (win32_tdesc): New global. (child_add_thread): Don't create the thread cache here. (do_initial_child_stuff): Set the new process'es tdesc. * win32-low.h (struct target_desc): Forward declare. (win32_tdesc): Declare. * lynx-i386-low.c (tdesc_i386): Declare global. (lynx_i386_arch_setup): Set `lynx_tdesc'. * lynx-low.c (lynx_tdesc): New global. (lynx_add_process): Set the new process'es tdesc. * lynx-low.h (struct target_desc): Forward declare. (lynx_tdesc): Declare global. * lynx-ppc-low.c (tdesc_powerpc_32): Declare global. (lynx_ppc_arch_setup): Set `lynx_tdesc'. * nto-low.c (nto_tdesc): New global. (do_attach): Set the new process'es tdesc. * nto-low.h (struct target_desc): Forward declare. (nto_tdesc): Declare. * nto-x86-low.c (tdesc_i386): Declare. (nto_x86_arch_setup): Set `nto_tdesc'. gdb/ 2013-06-07 Pedro Alves <palves@redhat.com> * regformats/regdat.sh: Output #include tdesc.h. Make globals static. Output a global target description pointer. (init_registers_${name}): Adjust to initialize a target description structure.
2013-06-07 12:46:59 +02:00
* Makefile.in (OBS): Add tdesc.o.
(IPA_OBJS): Add tdesc-ipa.o.
(tdesc-ipa.o): New rule.
* ax.c (gdb_eval_agent_expr): Adjust register_size call to new
interface.
* linux-low.c (new_inferior): Delete.
(disabled_regsets, num_regsets): Delete.
(linux_add_process): Adjust to set the new per-process
new_inferior flag.
(linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
(linux_wait_for_lwp): Adjust. Only call arch_setup if the event
was a stop. When calling arch_setup, switch the current inferior
to the thread that got an event.
(linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
(regsets_fetch_inferior_registers)
(regsets_store_inferior_registers): New regsets_info parameter.
Adjust to use it.
(linux_register_in_regsets): New regs_info parameter. Adjust to
use it.
(register_addr, fetch_register, store_register): New usrregs_info
parameter. Adjust to use it.
(usr_fetch_inferior_registers, usr_store_inferior_registers): New
parameter regs_info. Adjust to use it.
(linux_fetch_registers): Get the current inferior's regs_info, and
adjust to use it.
(linux_store_registers): Ditto.
[HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
(initialize_low): Don't initialize the target_regsets here. Call
initialize_low_arch.
* linux-low.h (target_regsets): Delete declaration.
(struct regsets_info): New.
(struct usrregs_info): New.
(struct regs_info): New.
(struct process_info_private) <new_inferior>: New field.
(struct linux_target_ops): Delete the num_regs, regmap, and
regset_bitmap fields. New field regs_info.
[HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
* i387-fp.c (num_xmm_registers): Delete.
(i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
calls to new interface.
(i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
(i387_xsave_to_cache): Adjust find_regno calls to new interface.
Infer the number of xmm registers from the regcache's target
description.
* i387-fp.h (num_xmm_registers): Delete.
* inferiors.c (add_thread): Don't install the thread's regcache
here.
* proc-service.c (gregset_info): Fetch the current inferior's
regs_info. Adjust to use it.
* regcache.c: Include tdesc.h.
(register_bytes, reg_defs, num_registers)
(gdbserver_expedite_regs): Delete.
(get_thread_regcache): If the thread doesn't have a regcache yet,
create one, instead of aborting gdbserver.
(regcache_invalidate_one): Rename to ...
(regcache_invalidate_thread): ... this.
(regcache_invalidate_one): New.
(regcache_invalidate): Only invalidate registers of the current
process.
(init_register_cache): Add target_desc parameter, and use it.
(new_register_cache): Ditto. Assert the target description has a
non zero registers_size.
(regcache_cpy): Add assertions. Adjust.
(realloc_register_cache, set_register_cache): Delete.
(registers_to_string, registers_from_string): Adjust.
(find_register_by_name, find_regno, find_register_by_number)
(register_cache_size): Add target_desc parameter, and use it.
(free_register_cache_thread, free_register_cache_thread_one)
(regcache_release, register_cache_size): New.
(register_size): Add target_desc parameter, and use it.
(register_data, supply_register, supply_register_zeroed)
(supply_regblock, supply_register_by_name, collect_register)
(collect_register_as_string, collect_register_by_name): Adjust.
* regcache.h (struct target_desc): Forward declare.
(struct regcache) <tdesc>: New field.
(init_register_cache, new_register_cache): Add target_desc
parameter.
(regcache_invalidate_thread): Declare.
(regcache_invalidate_one): Delete declaration.
(regcache_release): Declare.
(find_register_by_number, register_cache_size, register_size)
(find_regno): Add target_desc parameter.
(gdbserver_expedite_regs, gdbserver_xmltarget): Delete
declarations.
* remote-utils.c: Include tdesc.h.
(outreg, prepare_resume_reply): Adjust.
* server.c: Include tdesc.h.
(gdbserver_xmltarget): Delete declaration.
(get_features_xml, process_serial_event): Adjust.
* server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
declare.
(struct process_info) <tdesc>: New field.
(ipa_tdesc): Declare.
* tdesc.c: New file.
* tdesc.h: New file.
* tracepoint.c: Include tdesc.h.
[IN_PROCESS_AGENT] (ipa_tdesc): Define.
(get_context_regcache): Adjust to pass ipa_tdesc down.
(do_action_at_tracepoint): Adjust to get the register cache size
from the context regcache's description.
(traceframe_walk_blocks): Adjust to get the register cache size
from the current trace frame's description.
(traceframe_get_pc): Adjust to get current trace frame's
description and pass it down.
(gdb_collect): Adjust to get the register cache size from the
IPA's description.
* linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
(gdbserver_xmltarget): Delete.
(initialize_low_tracepoint): Set the ipa's target description.
* linux-i386-ipa.c (tdesc_i386_linux): Declare.
(initialize_low_tracepoint): Set the ipa's target description.
* linux-x86-low.c: Include tdesc.h.
[__x86_64__] (is_64bit_tdesc): New.
(ps_get_thread_area, x86_get_thread_area): Use it.
(i386_cannot_store_register): Rename to ...
(x86_cannot_store_register): ... this. Use is_64bit_tdesc.
(i386_cannot_fetch_register): Rename to ...
(x86_cannot_fetch_register): ... this. Use is_64bit_tdesc.
(x86_fill_gregset, x86_store_gregset): Adjust register_size calls
to new interface.
(target_regsets): Rename to ...
(x86_regsets): ... this.
(x86_get_pc, x86_set_pc): Adjust register_size calls to new
interface.
(x86_siginfo_fixup): Use is_64bit_tdesc.
[__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
(tdesc_x32_avx_linux, tdesc_x32_linux)
(tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
Declare.
(x86_linux_update_xmltarget): Delete.
(I386_LINUX_XSAVE_XCR0_OFFSET): Define.
(have_ptrace_getfpxregs, have_ptrace_getregset): New.
(AMD64_LINUX_USER64_CS): New.
(x86_linux_read_description): New, based on
x86_linux_update_xmltarget.
(same_process_callback): New.
(x86_arch_setup_process_callback): New.
(x86_linux_update_xmltarget): New.
(x86_regsets_info): New.
(amd64_linux_regs_info): New.
(i386_linux_usrregs_info): New.
(i386_linux_regs_info): New.
(x86_linux_regs_info): New.
(x86_arch_setup): Reimplement.
(x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
(x86_emit_ops): Ditto.
(the_low_target): Adjust. Install x86_linux_regs_info,
x86_cannot_fetch_register, and x86_cannot_store_register.
(initialize_low_arch): New.
* linux-ia64-low.c (tdesc_ia64): Declare.
(ia64_fetch_register): Adjust.
(ia64_usrregs_info, regs_info): New globals.
(ia64_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-sparc-low.c (tdesc_sparc64): Declare.
(sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
Adjust.
(sparc_arch_setup): New function.
(sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
(tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
(tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
(tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
(tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
(tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
(tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
(tdesc_powerpc_isa205_vsx64l): Declare.
(ppc_cannot_store_register, ppc_collect_ptrace_register)
(ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
(ppc_set_pc, ppc_get_hwcap): Adjust.
(ppc_usrregs_info): Forward declare.
(!__powerpc64__) ppc_regmap_adjusted: New global.
(ppc_arch_setup): Adjust to the current process'es target
description.
(ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
(ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
(ppc_store_evrregset): Adjust.
(target_regsets): Rename to ...
(ppc_regsets): ... this, and make static.
(ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
(ppc_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
(tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
(tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
(tdesc_s390x_linux64v2): Declare.
(s390_collect_ptrace_register, s390_supply_ptrace_register)
(s390_fill_gregset, s390_store_last_break): Adjust.
(target_regsets): Rename to ...
(s390_regsets): ... this, and make static.
(s390_get_pc, s390_set_pc): Adjust.
(s390_get_hwcap): New target_desc parameter, and use it.
[__s390x__] (have_hwcap_s390_high_gprs): New global.
(s390_arch_setup): Adjust to set the current process'es target
description. Don't adjust the regmap.
(s390_usrregs_info, s390_regsets_info, regs_info): New globals.
[__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
(regs_info_3264): New globals.
(s390_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
(tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
[__mips64] (init_registers_mips_linux)
(init_registers_mips_dsp_linux): Delete defines.
[__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
(have_dsp): New global.
(mips_read_description): New, based on mips_arch_setup.
(mips_arch_setup): Reimplement.
(get_usrregs_info): New function.
(mips_cannot_fetch_register, mips_cannot_store_register)
(mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
(mips_fill_fpregset, mips_store_fpregset): Adjust.
(target_regsets): Rename to ...
(mips_regsets): ... this, and make static.
(mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
(dsp_regs_info, regs_info): New globals.
(mips_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
(tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
Declare.
(arm_fill_vfpregset, arm_store_vfpregset): Adjust.
(arm_read_description): New, with bits factored from
arm_arch_setup.
(arm_arch_setup): Reimplement.
(target_regsets): Rename to ...
(arm_regsets): ... this, and make static.
(arm_regsets_info, arm_usrregs_info, regs_info): New globals.
(arm_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-m68k-low.c (tdesc_m68k): Declare.
(target_regsets): Rename to ...
(m68k_regsets): ... this, and make static.
(m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
(m68k_regs_info): New function.
(m68k_arch_setup): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-sh-low.c (tdesc_sharch): Declare.
(target_regsets): Rename to ...
(sh_regsets): ... this, and make static.
(sh_regsets_info, sh_usrregs_info, regs_info): New globals.
(sh_regs_info, sh_arch_setup): New functions.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-bfin-low.c (tdesc_bfin): Declare.
(bfin_arch_setup): New function.
(bfin_usrregs_info, regs_info): New globals.
(bfin_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-cris-low.c (tdesc_cris): Declare.
(cris_arch_setup): New function.
(cris_usrregs_info, regs_info): New globals.
(cris_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-cris-low.c (tdesc_crisv32): Declare.
(cris_arch_setup): New function.
(cris_regsets_info, cris_usrregs_info, regs_info): New globals.
(cris_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-m32r-low.c (tdesc_m32r): Declare.
(m32r_arch_setup): New function.
(m32r_usrregs_info, regs_info): New globals.
(m32r_regs_info): Adjust.
(initialize_low_arch): New function.
* linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
(tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
(tic6x_usrregs_info): Forward declare.
(tic6x_read_description): New function, based on ...
(tic6x_arch_setup): ... this. Reimplement.
(target_regsets): Rename to ...
(tic6x_regsets): ... this, and make static.
(tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
(tic6x_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-xtensa-low.c (tdesc_xtensa): Declare.
(xtensa_fill_gregset, xtensa_store_gregset): Adjust.
(target_regsets): Rename to ...
(xtensa_regsets): ... this, and make static.
(xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
globals.
(xtensa_arch_setup, xtensa_regs_info): New functions.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* linux-nios2-low.c (tdesc_nios2_linux): Declare.
(nios2_arch_setup): Set the current process'es tdesc.
(target_regsets): Rename to ...
(nios2_regsets): ... this.
(nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
(nios2_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
2013-08-21 23:31:45 +02:00
* linux-aarch64-low.c (tdesc_aarch64): Declare.
(aarch64_arch_setup): Set the current process'es tdesc.
(target_regsets): Rename to ...
(aarch64_regsets): ... this.
(aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
(aarch64_regs_info): New function.
(the_low_target): Adjust.
(initialize_low_arch): New function.
[GDBserver] Multi-process + multi-arch This patch makes GDBserver support multi-process + biarch. Currently, if you're debugging more than one process at once with a single gdbserver (in extended-remote mode), then all processes must have the same architecture (e.g., 64-bit vs 32-bit). Otherwise, you see this: Added inferior 2 [Switching to inferior 2 [<null>] (<noexec>)] Reading symbols from /home/pedro/gdb/tests/main32...done. Temporary breakpoint 2 at 0x4004cf: main. (2 locations) Starting program: /home/pedro/gdb/tests/main32 warning: Selected architecture i386 is not compatible with reported target architecture i386:x86-64 warning: Architecture rejected target-supplied description Remote 'g' packet reply is too long: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000090cfffff0000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000b042f7460000000000020000230000002b0000002b0000002b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f03000000000000ffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000801f00003b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ... etc, etc ... Even though the process was running a 32-bit program, GDBserver sent back to GDB a register set in 64-bit layout. A patch (http://sourceware.org/ml/gdb-patches/2012-11/msg00228.html) a while ago made GDB track a target_gdbarch per inferior, and as consequence, fetch a target description per-inferior. This patch is the GDBserver counterpart, that makes GDBserver keep track of each process'es XML target description and register layout. So in the example above, GDBserver will send the correct register set in 32-bit layout to GDB. A new "struct target_desc" object (tdesc for short) is added, that holds the target description and register layout information about each process. Each `struct process_info' holds a pointer to a target description. The regcache also gains a pointer to a target description, mainly for convenience, and parallel with GDB (and possible future support for programs that flip processor modes). The low target's arch_setup routines are responsible for setting the process'es correct tdesc. This isn't that much different to how things were done before, except that instead of detecting the inferior process'es architecture and calling the corresponding init_registers_FOO routine, which would change the regcache layout globals and recreate the threads' regcaches, the regcache.c globals are gone, and the init_registers_$BAR routines now each initialize a separate global struct target_desc object (one for each arch variant GDBserver supports), and so all the init_registers_$BAR routines that are built into GDBserver are called early at GDBserver startup time (similarly to how GDB handles its built-in target descriptions), and then the arch_setup routine is responsible for making process_info->tdesc point to one of these target description globals. The regcache module is all parameterized to get the regcache's layout from the tdesc object instead of the old register_bytes, etc. globals. The threads' regcaches are now created lazily. The old scheme where we created each of them when we added a new thread doesn't work anymore, because we add the main thread/lwp before we see it stop for the first time, and it is only when we see the thread stop for the first time that we have a chance of determining the inferior's architecture (through the_low_target.arch_setup). Therefore when we add the main thread we don't know which architecture/tdesc its regcache should have. This patch makes the gdb.multi/multi-arch.exp test now pass against (extended-remote) GDBserver. It currently fails, without this patch. The IPA also uses the regcache, so it gains a new global struct target_desc pointer, which points at the description of the process it is loaded in. Re. the linux-low.c & friends changes. Since the register map etc. may differ between processes (64-bit vs 32-bit) etc., the linux_target_ops num_regs, regmap and regset_bitmap data fields are no longer sufficient. A new method is added in their place that returns a pointer to a new struct that includes all info linux-low.c needs to access registers of the current inferior. The patch/discussion that originally introduced linux-low.c:disabled_regsets mentions that the disabled_regsets set may be different per mode (in a biarch setup), and indeed that is cleared whenever we start a new (first) inferior, so that global is moved as well behind the new `struct regs_info'. On the x86 side: I simply replaced the i387-fp.c:num_xmm_registers global with a check for 64-bit or 32-bit process, which is equivalent to how the global was set. This avoided coming up with some more general mechanism that would work for all targets that use this module (GNU/Linux, Windows, etc.). Tested: GNU/Linux IA64 GNU/Linux MIPS64 GNU/Linux PowerPC (Fedora 16) GNU/Linux s390x (Fedora 16) GNU/Linux sparc64 (Debian) GNU/Linux x86_64, -m64 and -m32 (Fedora 17) Cross built, and smoke tested: i686-w64-mingw32, under Wine. GNU/Linux TI C6x, by Yao Qi. Cross built but otherwise not tested: aarch64-linux-gnu arm-linux-gnu m68k-linux nios2-linux-gnu sh-linux-gnu spu tilegx-unknown-linux-gnu Completely untested: GNU/Linux Blackfin GNU/Linux CRIS GNU/Linux CRISv32 GNU/Linux TI Xtensa GNU/Linux M32R LynxOS QNX NTO gdb/gdbserver/ 2013-06-07 Pedro Alves <palves@redhat.com> * Makefile.in (OBS): Add tdesc.o. (IPA_OBJS): Add tdesc-ipa.o. (tdesc-ipa.o): New rule. * ax.c (gdb_eval_agent_expr): Adjust register_size call to new interface. * linux-low.c (new_inferior): Delete. (disabled_regsets, num_regsets): Delete. (linux_add_process): Adjust to set the new per-process new_inferior flag. (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread. (linux_wait_for_lwp): Adjust. Only call arch_setup if the event was a stop. When calling arch_setup, switch the current inferior to the thread that got an event. (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread. (regsets_fetch_inferior_registers) (regsets_store_inferior_registers): New regsets_info parameter. Adjust to use it. (linux_register_in_regsets): New regs_info parameter. Adjust to use it. (register_addr, fetch_register, store_register): New usrregs_info parameter. Adjust to use it. (usr_fetch_inferior_registers, usr_store_inferior_registers): New parameter regs_info. Adjust to use it. (linux_fetch_registers): Get the current inferior's regs_info, and adjust to use it. (linux_store_registers): Ditto. [HAVE_LINUX_REGSETS] (initialize_regsets_info): New. (initialize_low): Don't initialize the target_regsets here. Call initialize_low_arch. * linux-low.h (target_regsets): Delete declaration. (struct regsets_info): New. (struct usrregs_info): New. (struct regs_info): New. (struct process_info_private) <new_inferior>: New field. (struct linux_target_ops): Delete the num_regs, regmap, and regset_bitmap fields. New field regs_info. [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare. * i387-fp.c (num_xmm_registers): Delete. (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno calls to new interface. (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache) (i387_xsave_to_cache): Adjust find_regno calls to new interface. Infer the number of xmm registers from the regcache's target description. * i387-fp.h (num_xmm_registers): Delete. * inferiors.c (add_thread): Don't install the thread's regcache here. * proc-service.c (gregset_info): Fetch the current inferior's regs_info. Adjust to use it. * regcache.c: Include tdesc.h. (register_bytes, reg_defs, num_registers) (gdbserver_expedite_regs): Delete. (get_thread_regcache): If the thread doesn't have a regcache yet, create one, instead of aborting gdbserver. (regcache_invalidate_one): Rename to ... (regcache_invalidate_thread): ... this. (regcache_invalidate_one): New. (regcache_invalidate): Only invalidate registers of the current process. (init_register_cache): Add target_desc parameter, and use it. (new_register_cache): Ditto. Assert the target description has a non zero registers_size. (regcache_cpy): Add assertions. Adjust. (realloc_register_cache, set_register_cache): Delete. (registers_to_string, registers_from_string): Adjust. (find_register_by_name, find_regno, find_register_by_number) (register_cache_size): Add target_desc parameter, and use it. (free_register_cache_thread, free_register_cache_thread_one) (regcache_release, register_cache_size): New. (register_size): Add target_desc parameter, and use it. (register_data, supply_register, supply_register_zeroed) (supply_regblock, supply_register_by_name, collect_register) (collect_register_as_string, collect_register_by_name): Adjust. * regcache.h (struct target_desc): Forward declare. (struct regcache) <tdesc>: New field. (init_register_cache, new_register_cache): Add target_desc parameter. (regcache_invalidate_thread): Declare. (regcache_invalidate_one): Delete declaration. (regcache_release): Declare. (find_register_by_number, register_cache_size, register_size) (find_regno): Add target_desc parameter. (gdbserver_expedite_regs, gdbserver_xmltarget): Delete declarations. * remote-utils.c: Include tdesc.h. (outreg, prepare_resume_reply): Adjust. * server.c: Include tdesc.h. (gdbserver_xmltarget): Delete declaration. (get_features_xml, process_serial_event): Adjust. * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward declare. (struct process_info) <tdesc>: New field. (ipa_tdesc): Declare. * tdesc.c: New file. * tdesc.h: New file. * tracepoint.c: Include tdesc.h. [IN_PROCESS_AGENT] (ipa_tdesc): Define. (get_context_regcache): Adjust to pass ipa_tdesc down. (do_action_at_tracepoint): Adjust to get the register cache size from the context regcache's description. (traceframe_walk_blocks): Adjust to get the register cache size from the current trace frame's description. (traceframe_get_pc): Adjust to get current trace frame's description and pass it down. (gdb_collect): Adjust to get the register cache size from the IPA's description. * linux-amd64-ipa.c (tdesc_amd64_linux): Declare. (gdbserver_xmltarget): Delete. (initialize_low_tracepoint): Set the ipa's target description. * linux-i386-ipa.c (tdesc_i386_linux): Declare. (initialize_low_tracepoint): Set the ipa's target description. * linux-x86-low.c: Include tdesc.h. [__x86_64__] (is_64bit_tdesc): New. (ps_get_thread_area, x86_get_thread_area): Use it. (i386_cannot_store_register): Rename to ... (x86_cannot_store_register): ... this. Use is_64bit_tdesc. (i386_cannot_fetch_register): Rename to ... (x86_cannot_fetch_register): ... this. Use is_64bit_tdesc. (x86_fill_gregset, x86_store_gregset): Adjust register_size calls to new interface. (target_regsets): Rename to ... (x86_regsets): ... this. (x86_get_pc, x86_set_pc): Adjust register_size calls to new interface. (x86_siginfo_fixup): Use is_64bit_tdesc. [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux) (tdesc_x32_avx_linux, tdesc_x32_linux) (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux): Declare. (x86_linux_update_xmltarget): Delete. (I386_LINUX_XSAVE_XCR0_OFFSET): Define. (have_ptrace_getfpxregs, have_ptrace_getregset): New. (AMD64_LINUX_USER64_CS): New. (x86_linux_read_description): New, based on x86_linux_update_xmltarget. (same_process_callback): New. (x86_arch_setup_process_callback): New. (x86_linux_update_xmltarget): New. (x86_regsets_info): New. (amd64_linux_regs_info): New. (i386_linux_usrregs_info): New. (i386_linux_regs_info): New. (x86_linux_regs_info): New. (x86_arch_setup): Reimplement. (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc. (x86_emit_ops): Ditto. (the_low_target): Adjust. Install x86_linux_regs_info, x86_cannot_fetch_register, and x86_cannot_store_register. (initialize_low_arch): New. * linux-ia64-low.c (tdesc_ia64): Declare. (ia64_fetch_register): Adjust. (ia64_usrregs_info, regs_info): New globals. (ia64_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-sparc-low.c (tdesc_sparc64): Declare. (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack): Adjust. (sparc_arch_setup): New function. (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l) (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l) (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l) (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l) (tdesc_powerpc_64l, tdesc_powerpc_altivec64l) (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l) (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l) (tdesc_powerpc_isa205_vsx64l): Declare. (ppc_cannot_store_register, ppc_collect_ptrace_register) (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc) (ppc_set_pc, ppc_get_hwcap): Adjust. (ppc_usrregs_info): Forward declare. (!__powerpc64__) ppc_regmap_adjusted: New global. (ppc_arch_setup): Adjust to the current process'es target description. (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset) (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse) (ppc_store_evrregset): Adjust. (target_regsets): Rename to ... (ppc_regsets): ... this, and make static. (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals. (ppc_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1) (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1) (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1) (tdesc_s390x_linux64v2): Declare. (s390_collect_ptrace_register, s390_supply_ptrace_register) (s390_fill_gregset, s390_store_last_break): Adjust. (target_regsets): Rename to ... (s390_regsets): ... this, and make static. (s390_get_pc, s390_set_pc): Adjust. (s390_get_hwcap): New target_desc parameter, and use it. [__s390x__] (have_hwcap_s390_high_gprs): New global. (s390_arch_setup): Adjust to set the current process'es target description. Don't adjust the regmap. (s390_usrregs_info, s390_regsets_info, regs_info): New globals. [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264) (regs_info_3264): New globals. (s390_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux) (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare. [__mips64] (init_registers_mips_linux) (init_registers_mips_dsp_linux): Delete defines. [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines. (have_dsp): New global. (mips_read_description): New, based on mips_arch_setup. (mips_arch_setup): Reimplement. (get_usrregs_info): New function. (mips_cannot_fetch_register, mips_cannot_store_register) (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset) (mips_fill_fpregset, mips_store_fpregset): Adjust. (target_regsets): Rename to ... (mips_regsets): ... this, and make static. (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info) (dsp_regs_info, regs_info): New globals. (mips_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt) (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon): Declare. (arm_fill_vfpregset, arm_store_vfpregset): Adjust. (arm_read_description): New, with bits factored from arm_arch_setup. (arm_arch_setup): Reimplement. (target_regsets): Rename to ... (arm_regsets): ... this, and make static. (arm_regsets_info, arm_usrregs_info, regs_info): New globals. (arm_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-m68k-low.c (tdesc_m68k): Declare. (target_regsets): Rename to ... (m68k_regsets): ... this, and make static. (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals. (m68k_regs_info): New function. (m68k_arch_setup): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-sh-low.c (tdesc_sharch): Declare. (target_regsets): Rename to ... (sh_regsets): ... this, and make static. (sh_regsets_info, sh_usrregs_info, regs_info): New globals. (sh_regs_info, sh_arch_setup): New functions. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-bfin-low.c (tdesc_bfin): Declare. (bfin_arch_setup): New function. (bfin_usrregs_info, regs_info): New globals. (bfin_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-cris-low.c (tdesc_cris): Declare. (cris_arch_setup): New function. (cris_usrregs_info, regs_info): New globals. (cris_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-cris-low.c (tdesc_crisv32): Declare. (cris_arch_setup): New function. (cris_regsets_info, cris_usrregs_info, regs_info): New globals. (cris_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-m32r-low.c (tdesc_m32r): Declare. (m32r_arch_setup): New function. (m32r_usrregs_info, regs_info): New globals. (m32r_regs_info): Adjust. (initialize_low_arch): New function. * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux) (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare. (tic6x_usrregs_info): Forward declare. (tic6x_read_description): New function, based on ... (tic6x_arch_setup): ... this. Reimplement. (target_regsets): Rename to ... (tic6x_regsets): ... this, and make static. (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals. (tic6x_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-xtensa-low.c (tdesc_xtensa): Declare. (xtensa_fill_gregset, xtensa_store_gregset): Adjust. (target_regsets): Rename to ... (xtensa_regsets): ... this, and make static. (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New globals. (xtensa_arch_setup, xtensa_regs_info): New functions. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-nios2-low.c (tdesc_nios2_linux): Declare. (nios2_arch_setup): Set the current process'es tdesc. (target_regsets): Rename to ... (nios2_regsets): ... this. (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals. (nios2_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-aarch64-low.c (tdesc_aarch64): Declare. (aarch64_arch_setup): Set the current process'es tdesc. (target_regsets): Rename to ... (aarch64_regsets): ... this. (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals. (aarch64_regs_info): New function. (the_low_target): Adjust. (initialize_low_arch): New function. * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare globals. (target_regsets): Rename to ... (tile_regsets): ... this. (tile_regsets_info, tile_usrregs_info, regs_info): New globals. (tile_regs_info): New function. (tile_arch_setup): Set the current process'es tdesc. (the_low_target): Adjust. (initialize_low_arch): New function. * spu-low.c (tdesc_spu): Declare. (spu_create_inferior, spu_attach): Set the new process'es tdesc. * win32-arm-low.c (tdesc_arm): Declare. (arm_arch_setup): New function. (the_low_target): Install arm_arch_setup instead of init_registers_arm. * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare. (init_windows_x86): Rename to ... (i386_arch_setup): ... this. Set `win32_tdesc'. (the_low_target): Adjust. * win32-low.c (win32_tdesc): New global. (child_add_thread): Don't create the thread cache here. (do_initial_child_stuff): Set the new process'es tdesc. * win32-low.h (struct target_desc): Forward declare. (win32_tdesc): Declare. * lynx-i386-low.c (tdesc_i386): Declare global. (lynx_i386_arch_setup): Set `lynx_tdesc'. * lynx-low.c (lynx_tdesc): New global. (lynx_add_process): Set the new process'es tdesc. * lynx-low.h (struct target_desc): Forward declare. (lynx_tdesc): Declare global. * lynx-ppc-low.c (tdesc_powerpc_32): Declare global. (lynx_ppc_arch_setup): Set `lynx_tdesc'. * nto-low.c (nto_tdesc): New global. (do_attach): Set the new process'es tdesc. * nto-low.h (struct target_desc): Forward declare. (nto_tdesc): Declare. * nto-x86-low.c (tdesc_i386): Declare. (nto_x86_arch_setup): Set `nto_tdesc'. gdb/ 2013-06-07 Pedro Alves <palves@redhat.com> * regformats/regdat.sh: Output #include tdesc.h. Make globals static. Output a global target description pointer. (init_registers_${name}): Adjust to initialize a target description structure.
2013-06-07 12:46:59 +02:00
* linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
globals.
(target_regsets): Rename to ...
(tile_regsets): ... this.
(tile_regsets_info, tile_usrregs_info, regs_info): New globals.
(tile_regs_info): New function.
(tile_arch_setup): Set the current process'es tdesc.
(the_low_target): Adjust.
(initialize_low_arch): New function.
* spu-low.c (tdesc_spu): Declare.
(spu_create_inferior, spu_attach): Set the new process'es tdesc.
* win32-arm-low.c (tdesc_arm): Declare.
(arm_arch_setup): New function.
(the_low_target): Install arm_arch_setup instead of
init_registers_arm.
* win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
(init_windows_x86): Rename to ...
(i386_arch_setup): ... this. Set `win32_tdesc'.
(the_low_target): Adjust.
* win32-low.c (win32_tdesc): New global.
(child_add_thread): Don't create the thread cache here.
(do_initial_child_stuff): Set the new process'es tdesc.
* win32-low.h (struct target_desc): Forward declare.
(win32_tdesc): Declare.
* lynx-i386-low.c (tdesc_i386): Declare global.
(lynx_i386_arch_setup): Set `lynx_tdesc'.
* lynx-low.c (lynx_tdesc): New global.
(lynx_add_process): Set the new process'es tdesc.
* lynx-low.h (struct target_desc): Forward declare.
(lynx_tdesc): Declare global.
* lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
(lynx_ppc_arch_setup): Set `lynx_tdesc'.
* nto-low.c (nto_tdesc): New global.
(do_attach): Set the new process'es tdesc.
* nto-low.h (struct target_desc): Forward declare.
(nto_tdesc): Declare.
* nto-x86-low.c (tdesc_i386): Declare.
(nto_x86_arch_setup): Set `nto_tdesc'.
2013-06-04 Gary Benson <gbenson@redhat.com>
* server.c (handle_query): Add "augmented-libraries-svr4-read+"
to qSupported response when appropriate.
(handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
with nonzero-length annex.
* linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
arguments supplied in annex.
2013-05-31 Doug Evans <dje@google.com>
PR server/15594
* linux-x86-low.c (ps_get_thread_area): Properly extend address to
64 bits in 64-cross-32 environment.
2013-05-28 Pedro Alves <palves@redhat.com>
* Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
(aarch64-without-fpu.c): Delete rule.
* configure.srv (aarch64*-*-linux*): Remove references to
aarch64-without-fpu.o and aarch64-without-fpu.xml.
* linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
declaration.
2013-05-24 Pedro Alves <palves@redhat.com>
* server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
instead of strchr/decode_address. Error if the range isn't split
with a ','. Don't assume there's be a ':' in the action.
range stepping: gdbserver (x86 GNU/Linux) This patch adds support for range stepping to GDBserver, teaching it about vCont;r. It'd be easy to enable this for all hardware single-step targets without needing the linux_target_ops hook, however, at least PPC needs special care, due to the fact that PPC atomic sequences can't be hardware single-stepped through, a thing which GDBserver doesn't know about. So this leaves the support limited to x86/x86_64. gdb/ 2013-05-23 Pedro Alves <palves@redhat.com> * NEWS: Mention GDBserver range stepping support. gdb/gdbserver/ 2013-05-23 Yao Qi <yao@codesourcery.com> Pedro Alves <palves@redhat.com> * linux-low.c (lwp_in_step_range): New function. (linux_wait_1): If the thread was range stepping and stopped outside the stepping range, report the stop to GDB. Otherwise, continue stepping. Add range stepping debug output. (linux_set_resume_request): Copy the step range from the resume request to the lwp. (linux_supports_range_stepping): New. (linux_target_ops) <supports_range_stepping>: Set to linux_supports_range_stepping. * linux-low.h (struct linux_target_ops) <supports_range_stepping>: New field. (struct lwp_info) <step_range_start, step_range_end>: New fields. * linux-x86-low.c (x86_supports_range_stepping): New. (the_low_target) <supports_range_stepping>: Set to x86_supports_range_stepping. * server.c (handle_v_cont): Handle 'r' action. (handle_v_requests): Append ";r" if the target supports range stepping. * target.h (struct thread_resume) <step_range_start, step_range_end>: New fields. (struct target_ops) <supports_range_stepping>: New field. (target_supports_range_stepping): New macro.
2013-05-23 19:17:50 +02:00
2013-05-23 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* linux-low.c (lwp_in_step_range): New function.
(linux_wait_1): If the thread was range stepping and stopped
outside the stepping range, report the stop to GDB. Otherwise,
continue stepping. Add range stepping debug output.
(linux_set_resume_request): Copy the step range from the resume
request to the lwp.
(linux_supports_range_stepping): New.
(linux_target_ops) <supports_range_stepping>: Set to
linux_supports_range_stepping.
* linux-low.h (struct linux_target_ops)
<supports_range_stepping>: New field.
(struct lwp_info) <step_range_start, step_range_end>: New fields.
* linux-x86-low.c (x86_supports_range_stepping): New.
(the_low_target) <supports_range_stepping>: Set to
x86_supports_range_stepping.
* server.c (handle_v_cont): Handle 'r' action.
(handle_v_requests): Append ";r" if the target supports range
stepping.
* target.h (struct thread_resume) <step_range_start,
step_range_end>: New fields.
(struct target_ops) <supports_range_stepping>:
New field.
(target_supports_range_stepping): New macro.
2013-05-17 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
confusion in comment.
gdbserver/lynx178: spurious SIG61 signal when resuming inferior. On ppc-lynx178, resuming the execution of a program after hitting a breakpoint sometimes triggers a spurious SIG61 event: (gdb) cont Continuing. Program received signal SIG61, Real-time event 61. [Switching to Thread 39] 0x10002324 in a_test.task1 (<_task>=0x3ffff774) at a_test.adb:30 30 select -- Task 1 From this point on, continuing again lets the signal kill the program. Using "signal 0" or configuring GDB to discard the signal does not help either, as the program immediately reports the same signal again. What happens is the following: - GDB sends a single-step order to gdbserver: $vCont;s:31 This tells GDBserver to do a step using thread 0x31=49. GDBserver does the step, and thread 49 receives the SIGTRAP indicating that the step has finished. - GDB then sends a "continue", but this time does not specify which thread to continue: $vCont;c GDBserver uses an arbitrary thread's ptid to resume the program's execution (the current_inferior's ptid was chosen for that). See lynx-low.c:lynx_resume: if (ptid_equal (ptid, minus_one_ptid)) ptid = thread_to_gdb_id (current_inferior); So far on all LynxOS platforms, this has been good enough. But not so on LynxOS 178. If the ptid used to resume the execution is not the same as the thread that did the step, we get the weird signal. This patch fixes the problem by saving the ptid of the thread that last caused an event, received during a call to waitpid. The ptid is saved in per-process private data. gdb/gdbserver/ChangeLog: * lynx-low.c (struct process_info_private): New type. (lynx_add_process): New function. (lynx_create_inferior, lynx_attach): Replace calls to add_process by calls to lynx_add_process. (lynx_resume): If PTID is null, then try using current_process()->private->last_wait_event_ptid. Add comments. (lynx_clear_inferiors): Delete. The contents of that function has been inlined in lynx_mourn; (lynx_wait_1): Save the ptid in the process's private data. (lynx_mourn): Free the process' private data. Replace call to lynx_clear_inferiors by call to clear_inferiors.
2013-05-17 08:47:44 +02:00
2013-05-17 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (struct process_info_private): New type.
(lynx_add_process): New function.
(lynx_create_inferior, lynx_attach): Replace calls to
add_process by calls to lynx_add_process.
(lynx_resume): If PTID is null, then try using
current_process()->private->last_wait_event_ptid.
Add comments.
(lynx_clear_inferiors): Delete. The contents of that function
has been inlined in lynx_mourn;
(lynx_wait_1): Save the ptid in the process's private data.
(lynx_mourn): Free the process' private data. Replace call
to lynx_clear_inferiors by call to clear_inferiors.
2013-05-17 Yao Qi <yao@codesourcery.com>
* i386-low.c (i386_length_and_rw_bits): Move the comment to
the right place.
2013-05-16 Luis Machado <lgustavo@codesourcery.com>
* linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
PT_DATA_ADDR and PT_TEXT_END_ADDR. Update comments.
(linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
PT_TEXT_END_ADDR guards. Update comments.
(linux_target_op) <read_offsets>: Conditionally define to
linux_read_offsets if the target is UCLIBC and if it defines
PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
2013-05-06 Sandra Loosemore <sandra@codesourcery.com>
Andrew Jenner <andrew@codesourcery.com>
* Makefile.in (SFILES): Add linux-nios2-low.c.
(clean): Add action to delete nios2-linux.c.
(nios2-linux.c): New rule.
* configure.srv: Add nios2*-*-linux*.
* linux-nios2-low.c: New.
2013-05-03 Hafiz Abid Qadeer <abidh@codesourcery.com>
* tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
2013-04-25 Hui Zhu <hui@codesourcery.com>
PR gdb/15186
* ax.c (ax_printf): Add fflush.
PR gdb/7912: * Makefile.in (SFILES): Add filestuff.c (COMMON_OBS): Add filestuff.o. (filestuff.o): New target. * auto-load.c (auto_load_objfile_script_1): Use gdb_fopen_cloexec. * auxv.c (procfs_xfer_auxv): Use gdb_open_cloexec. * cli/cli-cmds.c (shell_escape): Call close_most_fds. * cli/cli-dump.c (fopen_with_cleanup): Use gdb_fopen_cloexec. * common/agent.c (gdb_connect_sync_socket): Use gdb_socket_cloexec. * common/filestuff.c: New file. * common/filestuff.h: New file. * common/linux-osdata.c (linux_common_core_of_thread) (command_from_pid, commandline_from_pid, print_source_lines) (linux_xfer_osdata_shm, linux_xfer_osdata_sem) (linux_xfer_osdata_msg, linux_xfer_osdata_modules): Use gdb_fopen_cloexec. * common/linux-procfs.c (linux_proc_get_int) (linux_proc_pid_has_state): Use gdb_fopen_cloexec. * config.in, configure: Rebuild. * configure.ac: Don't check for sys/socket.h. Check for fdwalk, pipe2. * corelow.c (core_open): Use gdb_open_cloexec. * dwarf2read.c (write_psymtabs_to_index): Use gdb_fopen_cloexec. * fork-child.c (fork_inferior): Call close_most_fds. * gdb_bfd.c (gdb_bfd_open): Use gdb_open_cloexec. * inf-child.c (inf_child_fileio_readlink): Use gdb_open_cloexec. * linux-nat.c (linux_nat_thread_name, linux_proc_pending_signals): Use gdb_fopen_cloexec. (linux_proc_xfer_partial, linux_proc_xfer_spu): Use gdb_open_cloexec. (linux_async_pipe): Use gdb_pipe_cloexec. * remote-fileio.c (remote_fileio_func_open): Use gdb_open_cloexec. * remote.c (remote_file_put, remote_file_get): Use gdb_fopen_cloexec. * ser-pipe.c (pipe_open): Use gdb_socketpair_cloexec, close_most_fds. * ser-tcp.c (net_open): Use gdb_socket_cloexec. * ser-unix.c (hardwire_open): Use gdb_open_cloexec. * solib.c (solib_find): Use gdb_open_cloexec. * source.c (openp, find_and_open_source): Use gdb_open_cloexec. * tracepoint.c (tfile_start): Use gdb_fopen_cloexec. (tfile_open): Use gdb_open_cloexec. * tui/tui-io.c (tui_initialize_io): Use gdb_pipe_cloexec. * ui-file.c (gdb_fopen): Use gdb_fopen_cloexec. * xml-support.c (xml_fetch_content_from_file): Use gdb_fopen_cloexec. * main.c (captured_main): Call notice_open_fds. gdbserver * Makefile.in (SFILES): Add filestuff.c. (OBS): Add filestuff.o. (filestuff.o): New target. * config.in, configure: Rebuild. * configure.ac: Check for fdwalk, pipe2.
2013-04-22 18:46:15 +02:00
2013-04-22 Tom Tromey <tromey@redhat.com>
* Makefile.in (SFILES): Add filestuff.c.
(OBS): Add filestuff.o.
(filestuff.o): New target.
* config.in, configure: Rebuild.
* configure.ac: Check for fdwalk, pipe2.
2013-04-17 Pedro Alves <palves@redhat.com>
* configure.ac (USE_THREAD_DB): Delete variable.
(if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
Don't AC_SUBST USE_THREAD_DB.
* Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
* config.in, configure: Regenerate.
2013-04-16 Pedro Alves <palves@redhat.com>
* linux-low.h (struct lwp_info) <thread_known>: Move under
the USE_THREAD_DB #ifdef.
Fix remaining GDBserver issues with !HAVE_THREAD_DB_H. The previous patches are still not sufficient to build gdbserver with our copy of thread_db.h. ../../../src/gdb/gdbserver/thread-db.c: In function ‘find_one_thread’: ../../../src/gdb/gdbserver/thread-db.c:316:6: error: ‘struct lwp_info’ has no member named ‘th’ ../../../src/gdb/gdbserver/thread-db.c: In function ‘attach_thread’: ../../../src/gdb/gdbserver/thread-db.c:341:6: error: ‘struct lwp_info’ has no member named ‘th’ ../../../src/gdb/gdbserver/thread-db.c: In function ‘thread_db_get_tls_address’: ../../../src/gdb/gdbserver/thread-db.c:514:47: error: ‘struct lwp_info’ has no member named ‘th’ make: *** [thread-db.o] Error 1 First, linux-low.h is including <thread_db.h> directly instead of our gdb_thread_db.h, although thread-db.c includes the latter. Then the 'th' field of struct lwp_info is only defined if HAVE_THREAD_DB_H is defined, which is not true if we're using our replacement copy of thread_db.h. We have a USE_THREAD_DB symbol defined if we're building thread-db.c that's ideal for this, however, it's currently only defined when compiling linux-low.c (through a Makefile rule). The patch makes it defined when compiling any file. gdb/gdbserver/ 2013-04-16 Pedro Alves <palves@redhat.com> * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@. (linux-low.o): Delete rule. * linux-low.h: Always include "gdb_thread_db.h" instead of conditionally including thread_db.h. (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of HAVE_THREAD_DB_H.
2013-04-16 20:20:40 +02:00
2013-04-16 Pedro Alves <palves@redhat.com>
* Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
(linux-low.o): Delete rule.
* linux-low.h: Always include "gdb_thread_db.h" instead of
conditionally including thread_db.h.
(struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
HAVE_THREAD_DB_H.
2013-04-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (install-only): Fix make install regression.
2013-04-05 Jan Kratochvil <jan.kratochvil@redhat.com>
Convert man pages to texinfo, new gdbinit.5 texinfo page.
* Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
installation.
* gdbserver.1: Remove.
Linux: No need to set ptrace event options in fork/clone children. Oleg Nesterov told me that the Linux kernel copies the parent's ptrace options to fork/clone children, so there's no need for GDB to do that manually. I was actually a bit surprised, since I thought the ptracer had to always set the ptrace options itself, and GDB is indeed calling PTRACE_SETOPTIONS for each new fork child, if it'll stay attached. Looking at the history of that code, I found that is was actually I who added that set-ptrace-options-in-children bit, back in http://sourceware.org/ml/gdb-patches/2009-05/msg00656.html. But, honestly, I don't recall why I needed that. I think I may have just blindly believed it was necessary. I then looked back at the history of all the PTRACE_SETOPTIONS code we have, and found that gdb never did copy the ptrace options before my patch. But, when gdbserver learnt to use PTRACE_EVENT_CLONE, at http://sourceware.org/ml/gdb-patches/2007-10/msg00547.html, it was made to do 'ptrace (PTRACE_SETOPTIONS, new_pid, 0, PTRACE_O_TRACECLONE)' for all new clones. Hmmm. But, GDB itself never did that, so it can't really ever have been necessary, I believe, otherwise GDB should have been doing it too. (GDBserver doesn't support following forks, and so naturally doesn't do any PTRACE_SETOPTIONS on fork children.) So this patch removes the -I believe- unnecessary ptrace syscalls. Tested on x86_64 Fedora 17, native/gdbserver, and on x86_64 RHEL5 native/gdbserver (Linux 2.6.18, I think a ptrace-on-utrace kernel). No regressions. gdb/ 2013-03-22 Pedro Alves <palves@redhat.com> * linux-nat.c (linux_child_follow_fork): Don't call linux_enable_event_reporting. (linux_handle_extended_wait): Don't call linux_enable_event_reporting. gdb/gdbserver/ 2013-03-22 Pedro Alves <palves@redhat.com> * linux-low.c (handle_extended_wait): Don't call linux_enable_event_reporting.
2013-03-22 15:52:26 +01:00
2013-03-22 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Don't call
linux_enable_event_reporting.
2013-03-15 Tony Theodore <tonyt@logyst.com>
PR build/9098:
* Makefile.in (SHELL): Use @SHELL@.
2013-03-14 Sergio Durigan Junior <sergiodj@redhat.com>
* tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
compiler warning.
2013-03-13 Joel Brobecker <brobecker@adacore.com>
* linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
Remove extraneous NULL element.
2013-03-13 Yao Qi <yao@codesourcery.com>
* tracepoint.c (traceframe_read_tsv): Look for the last matched
'V' block in trace frame.
Add the gdb remote target operations for branch tracing. We define the following packets: Qbtrace:bts enable branch tracing for the current thread returns "OK" or "Enn" Qbtrace:off disable branch tracing for the current thread returns "OK" or "Enn" qXfer:btrace:read read the full branch trace data for the current thread gdb/ * target.h (enum target_object): Add TARGET_OBJECT_BTRACE. * remote.c: Include btrace.h. (struct btrace_target_info): New struct. (remote_supports_btrace): New function. (send_Qbtrace): New function. (remote_enable_btrace): New function. (remote_disable_btrace): New function. (remote_teardown_btrace): New function. (remote_read_btrace): New function. (init_remote_ops): Add btrace ops. (enum <unnamed>): Add btrace packets. (struct protocol_feature remote_protocol_features[]): Add btrace packets. (_initialize_remote): Add packet configuration for branch tracing. gdbserver/ * target.h (struct target_ops): Add btrace ops. (target_supports_btrace): New macro. (target_enable_btrace): New macro. (target_disable_btrace): New macro. (target_read_btrace): New macro. * gdbthread.h (struct thread_info): Add btrace field. * server.c: Include btrace-common.h. (handle_btrace_general_set): New function. (handle_btrace_enable): New function. (handle_btrace_disable): New function. (handle_general_set): Call handle_btrace_general_set. (handle_qxfer_btrace): New function. (struct qxfer qxfer_packets[]): Add btrace entry. * inferiors.c (remove_thread): Disable btrace. * linux-low: Include linux-btrace.h. (linux_low_enable_btrace): New function. (linux_low_read_btrace): New function. (linux_target_ops): Add btrace ops. * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o. Add srv_linux_btrace=yes. (x86_64-*-linux*): Add linux-btrace.o. Add srv_linux_btrace=yes. * configure.ac: Define HAVE_LINUX_BTRACE. * config.in: Regenerated. * configure: Regenerated.
2013-03-11 09:35:11 +01:00
2013-03-11 Markus Metzger <markus.t.metzger@intel.com>
* target.h (struct target_ops): Add btrace ops.
(target_supports_btrace): New macro.
(target_enable_btrace): New macro.
(target_disable_btrace): New macro.
(target_read_btrace): New macro.
* gdbthread.h (struct thread_info): Add btrace field.
* server.c: Include btrace-common.h.
(handle_btrace_general_set): New function.
(handle_btrace_enable): New function.
(handle_btrace_disable): New function.
(handle_general_set): Call handle_btrace_general_set.
(handle_qxfer_btrace): New function.
(struct qxfer qxfer_packets[]): Add btrace entry.
* inferiors.c (remove_thread): Disable btrace.
* linux-low: Include linux-btrace.h.
(linux_low_enable_btrace): New function.
(linux_low_read_btrace): New function.
(linux_target_ops): Add btrace ops.
* configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
Add srv_linux_btrace=yes.
(x86_64-*-linux*): Add linux-btrace.o.
Add srv_linux_btrace=yes.
* configure.ac: Define HAVE_LINUX_BTRACE.
* config.in: Regenerated.
* configure: Regenerated.
2013-03-11 Markus Metzger <markus.t.metzger@intel.com>
* server.c (handle_qxfer): Preserve error message if -3 is
returned.
(qxfer): Document the -3 return value.
2013-03-11 Markus Metzger <markus.t.metzger@intel.com>
* Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
(linux_btrace_h): New variable.
(linux-btrace.o): New rule.
2013-03-08 Stan Shebs <stan@codesourcery.com>
2012-03-08 Stan Shebs <stan@codesourcery.com> Hafiz Abid Qadeer <abidh@codesourcery.com> gdb/ * NEWS: Mention set and show trace-buffer-size commands. Mention new packet. * target.h (struct target_ops): New method to_set_trace_buffer_size. (target_set_trace_buffer_size): New macro. * target.c (update_current_target): Set up new method. * tracepoint.c (trace_buffer_size): New global. (start_tracing): Send it to the target. (set_trace_buffer_size): New function. (_initialize_tracepoint): Add new setshow for trace-buffer-size. * remote.c (remote_set_trace_buffer_size): New function. (_initialize_remote): Use it. (QTBuffer:size) New remote command. (PACKET_QTBuffer_size): New enum. (remote_protocol_features): Add an entry for PACKET_QTBuffer_size. gdb/gdbserver/ * tracepoint.c (trace_buffer_size): New global. (DEFAULT_TRACE_BUFFER_SIZE): New define. (init_trace_buffer): Change to one-argument function. Allocate trace buffer memory. (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to handle QTBuffer:size packet. (cmd_bigqtbuffer_size): New function. (initialize_tracepoint): Call init_trace_buffer with DEFAULT_TRACE_BUFFER_SIZE. * server.c (handle_query): Add QTBuffer:size in the supported packets. gdb/doc/ * gdb.texinfo (Starting and Stopping Trace Experiments): Document trace-buffer-size set and show commands. (Tracepoint Packets): Document QTBuffer:size. (General Query Packets): Document QTBuffer:size. gdb/testsuite/ * gdb.trace/trace-buffer-size.exp: New file. * gdb.trace/trace-buffer-size.c: New file.
2013-03-08 16:06:39 +01:00
Hafiz Abid Qadeer <abidh@codesourcery.com>
* tracepoint.c (trace_buffer_size): New global.
(DEFAULT_TRACE_BUFFER_SIZE): New define.
(init_trace_buffer): Change to one-argument function. Allocate
trace buffer memory.
(handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
handle QTBuffer:size packet.
(cmd_bigqtbuffer_size): New function.
(initialize_tracepoint): Call init_trace_buffer with
DEFAULT_TRACE_BUFFER_SIZE.
* server.c (handle_query): Add QTBuffer:size in the
supported packets.
2013-03-07 Yao Qi <yao@codesourcery.com>
* tracepoint.c (cur_action, cur_step_action): Make them unsigned.
(cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
of -1.
(cmd_qtsp): Adjust condition. Do post increment.
Set cur_action and cur_step_action back to 0.
2013-03-07 Jeremy Bennett <jeremy.bennett@embecosm.com>
PR server/15236
* linux-low.c (linux_write_memory): Return early success if LEN is
zero.
2013-03-05 Corinna Vinschen <vinschen@redhat.de>
2013-03-05 16:18:10 +01:00
* configure.srv: Add x86_64-*-cygwin* as target.
2013-02-28 Tom Tromey <tromey@redhat.com>
* configure.ac: Invoke AC_SYS_LARGEFILE.
* configure, config.in: Rebuild.
2013-02-28 Corinna Vinschen <vinschen@redhat.com>
* win32-low.c: Throughout, fix format strings and casts of
printf-like functions to avoid type related warnings on all
platforms.
(get_child_debug_event): Print dwDebugEventCode as hex since
that's how it's usually documented.
2013-02-28 Yao Qi <yao@codesourcery.com>
* tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
pulongest.
2013-02-27 Jiong Wang <jiwang@tilera.com>
* Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
(reg-tilegx32.c): New rule.
* configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
* linux-tile-low.c (tile_arch_setup): New function. Invoke
different register info initializer according to elf class.
(init_registers_tilgx32): New function. The tilegx32 register info
initializer.
(tile_fill_gregset): Use "uint_reg_t" to represent register size.
(tile_store_gregset): Likewise.
2013-02-27 Yao Qi <yao@codesourcery.com>
* server.c (process_point_options): Print debug message when
debug_threads is true.
2013-02-26 Yao Qi <yao@codesourcery.com>
* tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
2013-02-19 Pedro Alves <palves@redhat.com>
Kai Tietz <ktietz@redhat.com>
PR gdb/15161
* server.c (handle_query) <CRC check>: Use unpack_varlen_hex
instead of strtoul to extract address from packet.
(process_serial_event) <'z'>: Likewise.
2013-02-18 Yao Qi <yao@codesourcery.com>
* linux-bfin-low.c (the_low_target): Use NULL instead of 0.
2013-02-14 Pedro Alves <palves@redhat.com>
Plug memory leak.
* tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
2013-02-14 Pedro Alves <palves@redhat.com>
* tracepoint.c (cmd_qtdpsrc): Use savestring.
2013-02-14 Pedro Alves <palves@redhat.com>
* tracepoint.c (save_string): Delete.
(add_tracepoint_action): Use savestring instead of save_string.
Consistent use of (C) after "Copyright". While writing the previous patch, I noticed that we're not consistent with the (C) in the copyright header. The maintainers manual prefers having it, though also says it's optional. We have over 10x more files with (C) than without in gdb's code, so I spent a few minutes grepping and fixing. Funny enough, the testsuite has it backwards. I'll leave that for another time. gdb/ 2013-02-12 Pedro Alves <palves@redhat.com> * amd64-darwin-tdep.c: Add (C) after Copyright. * cli/cli-cmds.h: Ditto. * cli/cli-decode.c: Ditto. * cli/cli-decode.h: Ditto. * cli/cli-dump.c: Ditto. * cli/cli-dump.h: Ditto. * cli/cli-interp.c: Ditto. * cli/cli-logging.c: Ditto. * cli/cli-script.c: Ditto. * cli/cli-script.h: Ditto. * cli/cli-setshow.c: Ditto. * cli/cli-setshow.h: Ditto. * cli/cli-utils.c: Ditto. * cli/cli-utils.h: Ditto. * config/alpha/nm-osf3.h: Ditto. * config/djgpp/djconfig.sh: Ditto. * config/i386/nm-fbsd.h: Ditto. * config/i386/nm-i386gnu.h: Ditto. * config/nm-linux.h: Ditto. * config/nm-nto.h: Ditto. * config/rs6000/nm-rs6000.h: Ditto. * config/sparc/nm-sol2.h: Ditto. * darwin-nat-info.c: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * gdb-demangle.h: Ditto. * i386-darwin-nat.c: Ditto. * i386-darwin-tdep.c: Ditto. * linux-fork.h: Ditto. * m32c-tdep.c: Ditto. * microblaze-linux-tdep.c: Ditto. * microblaze-rom.c: Ditto. * microblaze-tdep.c: Ditto. * microblaze-tdep.h: Ditto. * mips-linux-tdep.h: Ditto. * ppc-ravenscar-thread.c: Ditto. * ppc-ravenscar-thread.h: Ditto. * prologue-value.c: Ditto. * prologue-value.h: Ditto. * ravenscar-thread.c: Ditto. * ravenscar-thread.h: Ditto. * sparc-ravenscar-thread.c: Ditto. * sparc-ravenscar-thread.h: Ditto. * tilegx-linux-tdep.c: Ditto. * unwind_stop_reasons.def: Ditto. * windows-nat.h: Ditto. * xtensa-linux-tdep.c: Ditto. * xtensa-xtregs.c: Ditto. * regformats/regdat.sh: Ditto. * regformats/regdef.h: Ditto. gdb/gdbserver/ 2013-02-12 Pedro Alves <palves@redhat.com> * linux-xtensa-low.c: Ditto. * xtensa-xtregs.c: Ditto.
2013-02-12 20:03:57 +01:00
2013-02-12 Pedro Alves <palves@redhat.com>
* linux-xtensa-low.c: Ditto.
* xtensa-xtregs.c: Ditto.
2013-02-12 Sanimir Agovic <sanimir.agovic@intel.com>
* thread-db.c (thread_db_get_tls_address): NULL pointer check
thread_db.
2013-02-07 Marcus Shawcroft <marcus.shawcroft@arm.com>
* linux-aarch64-low.c (aarch64_arch_setup): Clamp
aarch64_num_wp_regs and aarch64_num_bp_regs to
AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
2013-02-07 Marcus Shawcroft <marcus.shawcroft@arm.com>
* linux-aarch64-low.c (ps_get_thread_area): Replace
PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
2013-02-04 Jim MacArthur <jim.macarthur@arm.com>
Marcus Shawcroft <marcus.shawcroft@arm.com>
Nigel Stephens <nigel.stephens@arm.com>
Yufeng Zhang <yufeng.zhang@arm.com>
* Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
(aarch64.c, aarch64-without-fpu.c): New targets.
* configure.srv (aarch64*-*-linux*): New.
* linux-aarch64-low.c: New file.
2013-02-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
2013-02-12 16:18:33 +01:00
* linux-low.c (handle_extended_wait, linux_create_inferior)
(linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
(dequeue_one_deferred_signal, linux_resume_one_thread)
(fetch_register, linux_write_memory, linux_enable_event_reporting)
(linux_tracefork_grandchild, linux_test_for_tracefork)
(linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
where the argument is 0.
2013-01-25 Yao Qi <yao@codesourcery.com>
* event-loop.c: Include "queue.h".
(gdb_event_p): New typedef.
(struct gdb_event) <next_event>: Remove.
(event_queue): Change to QUEUE(gdb_event_p).
(async_queue_event): Remove.
(gdb_event_xfree): New.
(initialize_event_loop): New.
(process_event): Use API from QUEUE.
(wait_for_event): Likewise.
* server.c (main): Call initialize_event_loop.
* server.h (initialize_event_loop): Declare.
2013-01-18 Yao Qi <yao@codesourcery.com>
* ax.h (struct eval_agent_expr_context): New.
(gdb_eval_agent_expr): Update declaration.
* ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
TFRAME. Add new argument CTX.
* server.h (struct eval_agent_expr_context): Declare.
(agent_mem_read, agent_tsv_read): Update declaration.
(agent_mem_read_string): Likewise.
* tracepoint.c (eval_tracepoint_agent_expr): Remove.
(add_traceframe_block): Add new argument TPOINT.
Increase TPOINT->traceframe_usage.
(do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
eval_tracepoint_agent_expr.
(condition_true_at_tracepoint): Likewise.
(agent_mem_read): Remove argument TFRAME. Add argument CTX.
(agent_mem_read_string, agent_tsv_read): Likewise.
2013-01-16 Yao Qi <yao@codesourcery.com>
* linux-low.c (linux_resume_one_lwp): Don't check
'lwp->bp_reinsert != 0'.
2013-01-07 Joel Brobecker <brobecker@adacore.com>
Pedro Alves <palves@redhat.com>
* lynx-low.c (ptrace_request_to_str): Define a temporary
macro and use it to simplify this function's implementation.
2013-01-07 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
sets errno.
2013-01-07 Joel Brobecker <brobecker@adacore.com>
* configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
2013-01-07 Joel Brobecker <brobecker@adacore.com>
* configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
2013-01-07 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_resume): Use the resume_info parameter
to determine the ptid for the lynx_ptrace call, unless
it is equal to minus_one_ptid, in which case we use the
ptid of the current_inferior.
(lynx_wait_1): After having received a thread create/exit
event, resume the inferior's execution using the signaling
thread's ptid, rather than the old ptid.
2013-01-07 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_resume): Delete variable ret.
2013-01-01 Joel Brobecker <brobecker@adacore.com>
* gdbreplay.c (gdbreplay_version): Update copyright year.
* server.c (gdbserver_version): Likewise.
2012-12-17 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_wait_1): Add debug trace before adding
new thread.
2012-12-17 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (ptrace_request_to_str): Add handling for
PTRACE_GETTRACESIG.
2012-12-17 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_attach): Delete variable new_process.
2012-12-17 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (lynx_create_inferior): Delete variable
new_process.
2012-12-17 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (ptrace_request_to_str): Do not handle
PTRACE_GETTHREADLIST if this macro does not exist.
2012-12-15 Yao Qi <yao@codesourcery.com>
* Makefile.in (OBS): Add notif.o.
* notif.c, notif.h: New.
* server.c: Include "notif.h".
(struct vstop_notif) <next>: Remove.
<base>: New field.
(queue_stop_reply): Update.
(push_event, send_next_stop_reply): Remove.
(discard_queued_stop_replies): Update.
(notif_stop): New variable.
(handle_v_stopped): Remove.
(handle_v_requests): Don't call handle_v_stopped. Call
handle_ack_notif instead.
(queue_stop_reply_callback): Call notif_event_enque instead
of queue_stop_reply.
(handle_status): Don't call send_next_stop_reply, call
notif_write_event instead.
(kill_inferior_callback): Likewise.
(detach_or_kill_inferior_callback): Likewise.
(main): Call initialize_notif.
(process_serial_event): Call QUEUE_is_empty.
(handle_target_event): Call notif_push instead of push event.
* server.h (push_event): Remove declaration.
* Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre) (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New macros. (.c.o): Rewrite. (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o) (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o) (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o) (amd64-linux-ipa.o, ax.o): Rewrite. (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o) (proc-service.o, regcache.o, remote-utils.o, server.o, target.o) (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove. (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o) (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o) (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite. (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o) (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o) (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o) (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o) (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o) (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o) (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o) (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o) (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o) (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o) (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o) (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o) (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o) (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o) (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o) (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o) (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o) (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o) (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o) (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o) (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o) (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o) (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o) (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o) (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o) (reg-tilegx.o): Remove. (all_object_files): New macro. Include .deps files. * aclocal.m4, configure: Rebuild. * acinclude.m4: Include depstand.m4, lead-dot.m4. * configure.ac: Invoke ZW_CREATE_DEPDIR, ZW_PROG_COMPILER_DEPENDENCIES. Compute GMAKE condition.
2012-12-10 21:16:14 +01:00
2012-12-10 Tom Tromey <tromey@redhat.com>
* Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
(COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
macros.
(.c.o): Rewrite.
(ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
(common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
(i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
(amd64-linux-ipa.o, ax.o): Rewrite.
(event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
(proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
(thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
(signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
(gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
(format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
(i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
(linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
(linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
(linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
(linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
(linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
(nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
(win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
(arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
(reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
(i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
(reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
(mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
(powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
(powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
(powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
(powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
(powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
(powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
(s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
(s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
(s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
(tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
(amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
(x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
(reg-tilegx.o): Remove.
(all_object_files): New macro.
Include .deps files.
* aclocal.m4, configure: Rebuild.
* acinclude.m4: Include depstand.m4, lead-dot.m4.
* configure.ac: Invoke ZW_CREATE_DEPDIR,
ZW_PROG_COMPILER_DEPENDENCIES. Compute GMAKE condition.
2012-12-05 Tom Tromey <tromey@redhat.com>
PR gdb/14917:
* server.h (current_insn_ptr, emit_error): Declare 'extern'.
2012-12-18 09:01:42 +01:00
2012-11-28 Markus Metzger <markus.t.metzger@intel.com>
* configure.ac: Check for linux/perf_event.h.
* config.in: Regenerated.
* configure: Regenerated.
2012-11-26 Maxime Villard <rustyBSD@gmx.fr>
* hostio.c (handle_readlink): Decrease buffer size
parameter passed to readlink by one byte.
2012-11-26 Yao Qi <yao@codesourcery.com>
* configure.ac (build_warnings): Append '-Wempty-body'.
* configure: Regenerated.
* linux-low.c (linux_create_inferior): Use braces for empty 'if'
body.
2012-11-15 Pierre Muller <muller@sourceware.org>
* configure.ac (AC_CHECK_HEADERS): Add wait.h header.
* config.in: Regenerate.
* configure: Regenerate.
* linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
Use "gdb_wait.h" header instead of <sys/wait.h> header.
* lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
* remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
header.
* server.c: Remove HAVE_WAIT_H conditional. Use "gdb_wait.h" header
instead of <sys/wait.h> header.
* spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
2012-12-18 09:01:42 +01:00
2012-11-13 Markus Metzger <markus.t.metzger@intel.com>
* Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
(various make rules): Remove -DGDBSERVER
2012-11-09 Yao Qi <yao@codesourcery.com>
* spu-low.c (current_ptid): Move it to ..
* gdbthread.h: ... here. New.
* remote-utils.c (read_ptid): Use macro 'current_ptid'.
* server.c (myresume, process_serial_event): Likewise.
* thread-db.c (thread_db_find_new_threads): Likewise.
* tracepoint.c (run_inferior_command): Likewise.
2012-10-01 Andrew Burgess <aburgess@broadcom.com>
* server.c (handle_search_memory_1): Include access length in
warning message.
2012-09-05 Michael Brandt <michael.brandt@axis.com>
* linux-crisv32-low.c: Fix compile errors.
2012-09-04 Yao Qi <yao@codesourcery.com>
* tracepoint.c (cmd_qtsv): Adjust debug message.
Don't check CUR_TPOINT.
2012-08-28 Yao Qi <yao@codesourcery.com>
* ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
* server.h: Include 'libiberty.h' and 'ansidecl.h'.
(ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
Remove declarations of xmalloc, xreallloc, xstrdup and
freeargv.
* Makefile.in (libiberty_h): New.
(server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
(linux-bfin-low.o): Append dependency 'libiberty.h'.
2012-08-23 Yao Qi <yao@codesourcery.com>
* server.h: Remove declaration of 'xsnprintf'.
2012-08-22 Keith Seitz <keiths@redhat.com>
* server.h: Include build-gnulib-gbserver/config.h.
* gdbreplay.c: Likewise.
2012-08-08 Doug Evans <dje@google.com>
* Makefile.in (SFILES): Add gdb_vecs.c.
(OBS): Add gdb_vecs.o.
(gdb_vecs_h, host_defs_h): New variables.
(thread-db.o): Add $(gdb_vecs_h) dependency.
(gdb_vecs.o): New rule.
* thread-db.c: #include "gdb_vecs.h".
(thread_db_load_search): Use a vector to iterate over path elements.
Handle text appearing after "$pdir".
* configure.ac: Add check for strstr.
* config.in: Regenerate.
* configure: Regenerate.
2012-08-02 Ulrich Weigand <ulrich.weigand@linaro.org>
* hostio.c (handle_pread): If pread fails, fall back to attempting
lseek/read.
(handle_pwrite): Likewise for pwrite.
2012-08-01 Ulrich Weigand <ulrich.weigand@linaro.org>
* linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
between unsupported TYPE and unimplementable ADDR/LEN combination.
(arm_insert_point): Act on new return value.
2012-07-31 Pedro Alves <palves@redhat.com>
* server.c (process_point_options): Only skip tokens if we find
one that is unrecognized. Don't treat 'X' specially while
skipping unrecognized tokens.
2012-07-30 Ulrich Weigand <ulrich.weigand@linaro.org>
* linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
to 4-byte-align HW breakpoint addresses for Thumb.
2012-07-27 Yao Qi <yao@codesourcery.com>
PR remote/14161.
* server.h: Declare gdb_agent_about_to_close.
* target.c (kill_inferior): Include "agent.h".
New. Send command 'kill'.
* target.h (kill_inferior): Removed macro.
* tracepoint.c (gdb_agent_about_to_close): New.
(gdb_agent_helper_thread): Handle command 'close'.
Wait endlessly until the inferior stops.
Install gdb_agent_remove_socket to atexit hook.
(agent_socket_name): New static variable.
(gdb_agent_socket_init): Replace local variable 'name' with
'agent_socket_name'.
(gdb_agent_remove_socket): New.
2012-07-27 Yao Qi <yao@codesourcery.com>
* server.c (process_point_options): Stop at 'X' when parsing.
2012-07-19 Michael Eager <eager@eagercon.com>
2013-08-21 23:31:45 +02:00
* i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
to hw_execute.
* linux-x86-low.c (x86_insert_point, x86_remove_point):
Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
hardware breakpoint.
2012-07-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdbserver/linux-low.c (initialize_low): Call
linux_ptrace_init_warnings.
2012-07-02 Doug Evans <dje@google.com>
* mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
pointer to int.
Add target-side support for dynamic printf. * NEWS: Mention the additional style. * breakpoint.h (struct bp_target_info): New fields tcommands, persist. (struct bp_location): New field cmd_bytecode. * breakpoint.c: Include format.h. (disconnected_dprintf): New global. (parse_cmd_to_aexpr): New function. (build_target_command_list): New function. (insert_bp_location): Call it. (remove_breakpoints_pid): Skip dprintf breakpoints. (print_one_breakpoint_location): Ditto. (dprintf_style_agent): New global. (dprintf_style_enums): Add dprintf_style_agent. (update_dprintf_command_list): Add agent case. (agent_printf_command): New function. (_initialize_breakpoint): Add new commands. * common/ax.def (printf): New bytecode. * ax.h (ax_string): Declare. * ax-gdb.h (gen_printf): Declare. * ax-gdb.c: Include cli-utils.h, format.h. (gen_printf): New function. (maint_agent_print_command): New function. (_initialize_ax_gdb): Add maint agent-printf command. * ax-general.c (ax_string): New function. (ax_print): Add printf disassembly. * Makefile.in (SFILES): Add format.c (COMMON_OBS): Add format.o. * common/format.h: New file. * common/format.c: New file. * printcmd.c: Include format.h. (ui_printf): Call parse_format_string. * remote.c (remote_state): New field breakpoint_commands. (PACKET_BreakpointCommands): New enum. (remote_breakpoint_commands_feature): New function. (remote_protocol_features): Add new BreakpointCommands entry. (remote_can_run_breakpoint_commands): New function. (remote_add_target_side_commands): New function. (remote_insert_breakpoint): Call it. (remote_insert_hw_breakpoint): Ditto. (_initialize_remote): Add new packet configuration for target-side breakpoint commands. * target.h (struct target_ops): New field to_can_run_breakpoint_commands. (target_can_run_breakpoint_commands): New macro. * target.c (update_current_target): Handle to_can_run_breakpoint_commands. [gdbserver] * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define. (ax.o): Add it to build rule. (ax-ipa.o): Ditto. (OBS): Add format.o. (IPA_OBS): Add format.o. * server.c (handle_query): Claim support for breakpoint commands. (process_point_options): Add command case. (process_serial_event): Leave running if there are printfs in effect. * mem-break.h (any_persistent_commands): Declare. (add_breakpoint_commands): Declare. (gdb_no_commands_at_breakpoint): Declare. (run_breakpoint_commands): Declare. * mem-break.c (struct point_command_list): New struct. (struct breakpoint): New field command_list. (any_persistent_commands): New function. (add_commands_to_breakpoint): New function. (add_breakpoint_commands): New function. (gdb_no_commands_at_breakpoint): New function. (run_breakpoint_commands): New function. * linux-low.c (linux_wait_1): Test for and run breakpoint commands locally. * ax.c: Include format.h. (ax_printf): New function. (gdb_eval_agent_expr): Add printf opcode. [doc] * gdb.texinfo (Dynamic Printf): Mention agent style and disconnected dprintf. (Maintenance Commands): Describe maint agent-printf. (General Query Packets): Mention BreakpointCommands feature. (Packets): Document commands extension to Z0 packet. * agentexpr.texi (Bytecode Descriptions): Document printf bytecode. [testsuite] * gdb.base/dprintf.exp: Add agent style tests.
2012-07-02 17:29:39 +02:00
2012-07-02 Stan Shebs <stan@codesourcery.com>
* Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
(ax.o): Add it to build rule.
(ax-ipa.o): Ditto.
(OBS): Add format.o.
(IPA_OBS): Add format.o.
* server.c (handle_query): Claim support for breakpoint commands.
(process_point_options): Add command case.
(process_serial_event): Leave running if there are printfs in
effect.
* mem-break.h (any_persistent_commands): Declare.
(add_breakpoint_commands): Declare.
(gdb_no_commands_at_breakpoint): Declare.
(run_breakpoint_commands): Declare.
* mem-break.c (struct point_command_list): New struct.
(struct breakpoint): New field command_list.
(any_persistent_commands): New function.
(add_commands_to_breakpoint): New function.
(add_breakpoint_commands): New function.
(gdb_no_commands_at_breakpoint): New function.
(run_breakpoint_commands): New function.
* linux-low.c (linux_wait_1): Test for and run breakpoint commands
locally.
* ax.c: Include format.h.
(ax_printf): New function.
(gdb_eval_agent_expr): Add printf opcode.
2012-06-13 Yao Qi <yao@codesourcery.com>
* server.c (start_inferior): Remove duplicated writes to fields
'last_resume_kind' and 'last_status' of 'current_inferior'.
2012-06-12 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* linux-low.c (linux_set_resume_request): Simplify predicate. Add
comment.
* server.c (handle_v_cont): Extend comment.
2012-06-11 Yao Qi <yao@codesourcery.com>
* linux-low.c (linux_attach): Add 'static'.
2012-06-06 Yao Qi <yao@codesourcery.com>
* ax.c (gdb_eval_agent_expr): Print `top' in hex.
2012-06-01 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix gcc -flto compilation warning.
* server.c (main): Make variable multi_mode and attach volatile.
2012-05-30 Thiago Jung Bauermann <thiago.bauermann@linaro.org>
* linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
if the platform doesn't know about it.
2012-05-30 Jeff Kenton <jkenton@tilera.com>
* Makefile.in (SFILES): Add linux-tile-low.c.
(linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
* configure.srv: Handle tilegx-*-linux*.
* linux-tile-low.c: New file.
2012-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
gdb/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. gdb/gdbserver/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. include/gdb/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 * gdb/signals.def: Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/arm/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/avr/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/common/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/cr16/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/d10v/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/erc32/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/m32c/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/ppc/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/rl78/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/rx/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
2012-05-24 18:51:47 +02:00
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
2013-02-12 16:18:33 +01:00
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
gdb/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. gdb/gdbserver/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. include/gdb/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 * gdb/signals.def: Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/arm/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/avr/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/common/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/cr16/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/d10v/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/erc32/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/m32c/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/ppc/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/rl78/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/rx/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
2012-05-24 18:51:47 +02:00
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace target_signal with gdb_signal throughout.
2012-05-22 Maciej W. Rozycki <macro@codesourcery.com>
* linux-low.c (linux_store_registers): Avoid the copying sequence
when no data has been retrieved by ptrace.
2012-05-22 Will Deacon <will.deacon@arm.com>
* linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
Include asm/ptrace.h.
(PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
already defined.
2012-05-21 Maciej W. Rozycki <macro@codesourcery.com>
* linux-low.c (linux_store_registers): Don't re-retrieve data
with ptrace that has already been obtained from /proc. Always
copy any data retrieved with ptrace to the buffer supplied.
2012-05-11 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* linux-low.c (enum stopping_threads_kind): New.
(stopping_threads): Change type to `enum stopping_threads_kind'.
(handle_extended_wait): If stopping and suspending threads, leave
the new_lwp suspended too.
(linux_wait_for_event): Adjust.
(stop_all_lwps): Set `stopping_threads' to
STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
whether we're suspending threads or just stopping them. Assert no
recursion happens.
2012-04-29 Yao Qi <yao@codesourcery.com>
* server.h: Move some code to ...
* gdbthread.h: ... here. New.
* Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
(remote-utils.o, server.o, target.o tracepoint.o): Likewise.
(nto-low.o, win32-low.o): Likewise.
* inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
* regcache.c, remote-utils.c, server.c: Likewise.
* target.c, tracepoint.c, win32-low.c: Likewise.
2012-04-24 Thiago Jung Bauermann <thiago.bauermann@linaro.org>
* linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
(PTRACE_ARG4_TYPE): Likewise.
(PTRACE_XFER_TYPE): Likewise.
* linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
ptrace to PTRACE_ARG3_TYPE.
* linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
(PTRACE_ARG4_TYPE): Likewise.
(PTRACE_XFER_TYPE): Likewise.
(linux_detach_one_lwp): Cast fourth argument of
ptrace to long then PTRACE_ARG4_TYPE.
(regsets_fetch_inferior_registers): Cast third argument of
ptrace to long then PTRACE_ARG3_TYPE.
(regsets_store_inferior_registers): Likewise.
2012-04-20 Pedro Alves <palves@redhat.com>
* configure: Regenerate.
2012-04-19 Pedro Alves <palves@redhat.com> gdb/ * Makefile.in (GNULIB_BUILDDIR): New. (LIBGNU, INCGNU, GNULIB_H): Adjust. (SUBDIRS): Add $(GNULIB_BUILDDIR). (CLEANDIRS). Remove gnulib/import. (REQUIRED_SUBDIRS): Replace gnulib/import with $(GNULIB_BUILDDIR). (all-lib): Ditto. (distclean): Remove the $(GNULIB_BUILDDIR) directory. (gnulib/import/Makefile): Replace gnulib/import with $(GNULIB_BUILDDIR). Set CONFIG_FILES to just Makefile. (ACLOCAL_AMFLAGS): Remove '-I gnulib/import/m4'. (aclocal_m4_deps): Remove the gnulib dependencies. Add acx_configure_dir.m4. * acinclude.m4: Include acx_configure_dir.m4. * acx_configure_dir.m4: New file. * aclocal.m4: Regenerate. * configure.ac: Remove gl_EARLY, gl_INIT and AM_INIT_AUTOMAKE calls. Configure gnulib using ACX_CONFIGURE_DIR. (GNULIB): New variable. (GNULIB_STDINT_H): Adjust. (AC_OUTPUT): Don't output gnulib/Makefile. * gdb/defs.h: Include build-gnulib/config.h. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * gnulib/Makefile.in: New file. * gnulib/configure.ac: New file. * gnulib/aclocal.m4: New file. * gnulib/config.in: New file. * gnulib/configure: New file. * gnulib/: Re-run gnulib-tool to adjust. gdb/gdbserver/ * Makefile.in (GNULIB_BUILDDIR): New. (LIBGNU, INCGNU, GNULIB_H): Adjust. (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New. (all, install-only, uninstall, clean-info, all-lib, clean): No longer pass GNULIB_FLAGS_TO_PASS. Use subdir_do. (maintainer-clean realclean distclean): Use subdir_do. (subdir_do): New. (gnulib/import/Makefile): Adjust. Replace gnulib/import with $(GNULIB_BUILDDIR). Don't pass argument to config.status. * acinclude.m4: Include acx_configure_dir.m4. * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE calls. Call AC_PROG_RANLIB. Configure gnulib using ACX_CONFIGURE_DIR. (GNULIB): New. (GNULIB_STDINT_H): Adjust. (AC_OUTPUT): Don't output gnulib/Makefile anymore. * gdbreplay.c: Include build-gnulib/config.h. * server.h: Likewise. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate.
2012-04-19 21:34:52 +02:00
2012-04-19 Pedro Alves <palves@redhat.com>
2013-02-12 16:18:33 +01:00
* Makefile.in (GNULIB_BUILDDIR): New.
2012-04-19 Pedro Alves <palves@redhat.com> gdb/ * Makefile.in (GNULIB_BUILDDIR): New. (LIBGNU, INCGNU, GNULIB_H): Adjust. (SUBDIRS): Add $(GNULIB_BUILDDIR). (CLEANDIRS). Remove gnulib/import. (REQUIRED_SUBDIRS): Replace gnulib/import with $(GNULIB_BUILDDIR). (all-lib): Ditto. (distclean): Remove the $(GNULIB_BUILDDIR) directory. (gnulib/import/Makefile): Replace gnulib/import with $(GNULIB_BUILDDIR). Set CONFIG_FILES to just Makefile. (ACLOCAL_AMFLAGS): Remove '-I gnulib/import/m4'. (aclocal_m4_deps): Remove the gnulib dependencies. Add acx_configure_dir.m4. * acinclude.m4: Include acx_configure_dir.m4. * acx_configure_dir.m4: New file. * aclocal.m4: Regenerate. * configure.ac: Remove gl_EARLY, gl_INIT and AM_INIT_AUTOMAKE calls. Configure gnulib using ACX_CONFIGURE_DIR. (GNULIB): New variable. (GNULIB_STDINT_H): Adjust. (AC_OUTPUT): Don't output gnulib/Makefile. * gdb/defs.h: Include build-gnulib/config.h. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * gnulib/Makefile.in: New file. * gnulib/configure.ac: New file. * gnulib/aclocal.m4: New file. * gnulib/config.in: New file. * gnulib/configure: New file. * gnulib/: Re-run gnulib-tool to adjust. gdb/gdbserver/ * Makefile.in (GNULIB_BUILDDIR): New. (LIBGNU, INCGNU, GNULIB_H): Adjust. (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New. (all, install-only, uninstall, clean-info, all-lib, clean): No longer pass GNULIB_FLAGS_TO_PASS. Use subdir_do. (maintainer-clean realclean distclean): Use subdir_do. (subdir_do): New. (gnulib/import/Makefile): Adjust. Replace gnulib/import with $(GNULIB_BUILDDIR). Don't pass argument to config.status. * acinclude.m4: Include acx_configure_dir.m4. * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE calls. Call AC_PROG_RANLIB. Configure gnulib using ACX_CONFIGURE_DIR. (GNULIB): New. (GNULIB_STDINT_H): Adjust. (AC_OUTPUT): Don't output gnulib/Makefile anymore. * gdbreplay.c: Include build-gnulib/config.h. * server.h: Likewise. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate.
2012-04-19 21:34:52 +02:00
(LIBGNU, INCGNU, GNULIB_H): Adjust.
2013-02-12 16:18:33 +01:00
(SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
(all, install-only, uninstall, clean-info, all-lib, clean): No
longer pass GNULIB_FLAGS_TO_PASS. Use subdir_do.
(maintainer-clean realclean distclean): Use subdir_do.
(subdir_do): New.
(gnulib/import/Makefile): Adjust. Replace gnulib/import with
2012-04-19 Pedro Alves <palves@redhat.com> gdb/ * Makefile.in (GNULIB_BUILDDIR): New. (LIBGNU, INCGNU, GNULIB_H): Adjust. (SUBDIRS): Add $(GNULIB_BUILDDIR). (CLEANDIRS). Remove gnulib/import. (REQUIRED_SUBDIRS): Replace gnulib/import with $(GNULIB_BUILDDIR). (all-lib): Ditto. (distclean): Remove the $(GNULIB_BUILDDIR) directory. (gnulib/import/Makefile): Replace gnulib/import with $(GNULIB_BUILDDIR). Set CONFIG_FILES to just Makefile. (ACLOCAL_AMFLAGS): Remove '-I gnulib/import/m4'. (aclocal_m4_deps): Remove the gnulib dependencies. Add acx_configure_dir.m4. * acinclude.m4: Include acx_configure_dir.m4. * acx_configure_dir.m4: New file. * aclocal.m4: Regenerate. * configure.ac: Remove gl_EARLY, gl_INIT and AM_INIT_AUTOMAKE calls. Configure gnulib using ACX_CONFIGURE_DIR. (GNULIB): New variable. (GNULIB_STDINT_H): Adjust. (AC_OUTPUT): Don't output gnulib/Makefile. * gdb/defs.h: Include build-gnulib/config.h. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * gnulib/Makefile.in: New file. * gnulib/configure.ac: New file. * gnulib/aclocal.m4: New file. * gnulib/config.in: New file. * gnulib/configure: New file. * gnulib/: Re-run gnulib-tool to adjust. gdb/gdbserver/ * Makefile.in (GNULIB_BUILDDIR): New. (LIBGNU, INCGNU, GNULIB_H): Adjust. (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New. (all, install-only, uninstall, clean-info, all-lib, clean): No longer pass GNULIB_FLAGS_TO_PASS. Use subdir_do. (maintainer-clean realclean distclean): Use subdir_do. (subdir_do): New. (gnulib/import/Makefile): Adjust. Replace gnulib/import with $(GNULIB_BUILDDIR). Don't pass argument to config.status. * acinclude.m4: Include acx_configure_dir.m4. * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE calls. Call AC_PROG_RANLIB. Configure gnulib using ACX_CONFIGURE_DIR. (GNULIB): New. (GNULIB_STDINT_H): Adjust. (AC_OUTPUT): Don't output gnulib/Makefile anymore. * gdbreplay.c: Include build-gnulib/config.h. * server.h: Likewise. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate.
2012-04-19 21:34:52 +02:00
$(GNULIB_BUILDDIR). Don't pass argument to config.status.
2013-02-12 16:18:33 +01:00
* acinclude.m4: Include acx_configure_dir.m4.
* configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
calls. Call AC_PROG_RANLIB. Configure gnulib using
ACX_CONFIGURE_DIR.
(GNULIB): New.
(GNULIB_STDINT_H): Adjust.
(AC_OUTPUT): Don't output gnulib/Makefile anymore.
* gdbreplay.c: Include build-gnulib/config.h.
* server.h: Likewise.
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
2012-04-19 Pedro Alves <palves@redhat.com> gdb/ * Makefile.in (GNULIB_BUILDDIR): New. (LIBGNU, INCGNU, GNULIB_H): Adjust. (SUBDIRS): Add $(GNULIB_BUILDDIR). (CLEANDIRS). Remove gnulib/import. (REQUIRED_SUBDIRS): Replace gnulib/import with $(GNULIB_BUILDDIR). (all-lib): Ditto. (distclean): Remove the $(GNULIB_BUILDDIR) directory. (gnulib/import/Makefile): Replace gnulib/import with $(GNULIB_BUILDDIR). Set CONFIG_FILES to just Makefile. (ACLOCAL_AMFLAGS): Remove '-I gnulib/import/m4'. (aclocal_m4_deps): Remove the gnulib dependencies. Add acx_configure_dir.m4. * acinclude.m4: Include acx_configure_dir.m4. * acx_configure_dir.m4: New file. * aclocal.m4: Regenerate. * configure.ac: Remove gl_EARLY, gl_INIT and AM_INIT_AUTOMAKE calls. Configure gnulib using ACX_CONFIGURE_DIR. (GNULIB): New variable. (GNULIB_STDINT_H): Adjust. (AC_OUTPUT): Don't output gnulib/Makefile. * gdb/defs.h: Include build-gnulib/config.h. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * gnulib/Makefile.in: New file. * gnulib/configure.ac: New file. * gnulib/aclocal.m4: New file. * gnulib/config.in: New file. * gnulib/configure: New file. * gnulib/: Re-run gnulib-tool to adjust. gdb/gdbserver/ * Makefile.in (GNULIB_BUILDDIR): New. (LIBGNU, INCGNU, GNULIB_H): Adjust. (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New. (all, install-only, uninstall, clean-info, all-lib, clean): No longer pass GNULIB_FLAGS_TO_PASS. Use subdir_do. (maintainer-clean realclean distclean): Use subdir_do. (subdir_do): New. (gnulib/import/Makefile): Adjust. Replace gnulib/import with $(GNULIB_BUILDDIR). Don't pass argument to config.status. * acinclude.m4: Include acx_configure_dir.m4. * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE calls. Call AC_PROG_RANLIB. Configure gnulib using ACX_CONFIGURE_DIR. (GNULIB): New. (GNULIB_STDINT_H): Adjust. (AC_OUTPUT): Don't output gnulib/Makefile anymore. * gdbreplay.c: Include build-gnulib/config.h. * server.h: Likewise. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate.
2012-04-19 21:34:52 +02:00
2012-04-19 Pedro Alves <palves@redhat.com>
* Makefile.in (LIBGNU, INCGNU): Adjust.
(GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
(all, install-only, uninstall, clean-info, all-lib, clean)
(maintainer-clean, Makefile, gnulib/Makefile): Adjust.
* configure.ac: Adjust AC_OUTPUT output.
* aclocal.m4: Regenerate.
* configure: Regenerate.
2012-04-19 Pedro Alves <palves@redhat.com>
* Makefile.in (generated_files): New.
(server_h): Remove the explicit dependency on config.h, and depend
on $generated_files.
2012-04-19 Pedro Alves <palves@redhat.com>
* Makefile.in (INCGNU): Add -Ignulib.
2012-04-19 Pedro Alves <palves@redhat.com>
* Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
(INCGNU): ... this, and spell out -I here.
(GNULIB_LIB): Rename to ...
(LIBGNU): ... this.
(INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
2012-04-19 Pedro Alves <palves@redhat.com>
* config.in: Regenerate.
2012-04-19 Pedro Alves <palves@redhat.com>
* configure.ac: Remove AC_CHECK_DECLS check for memmem.
* server.h (memmem): Remove declaration.
* config.in: Regenerate.
* configure: Regenerate.
2012-04-19 Yao Qi <yao@codesourcery.com>
* Makefile.in (SFILES): Add common/vec.c.
(OBS): Add vec.o.
(vec.o): New rule.
2012-04-19 Yao Qi <yao@codesourcery.com>
* remote-utils.c (prepare_resume_reply): Replace with macro
target_core_of_thread.
* server.c (handle_qxfer_threads_proper): Likewise.
* target.h (traget_core_of_thread): New macro.
2012-04-18 Pedro Alves <palves@redhat.com>
* aclocal.m4: Regenerate.
* configure: Regenerate.
2012-04-16 Yao Qi <yao@codesourcery.com>
* tracepoint.c (cmd_qtstart): Download tracepoints even when they are
duplicated on address.
2012-04-16 Yao Qi <yao@codesourcery.com>
* tracepoint.c (COPY_FIELD_TO_BUF): New macro.
(struct tracepoint_action_ops) <send>: New field.
(m_tracepoint_action_send, r_tracepoint_action_send): New.
(agent_expr_send, x_tracepoint_action_send): New.
(l_tracepoint_action_send): New.
(cmd_qtdp): Download and install tracepoint
according to `use_agent'.
(run_inferior_command): Add one more parameter `len'.
Update callers.
(tracepoint_send_agent): New.
(cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
2012-04-16 Yao Qi <yao@codesourcery.com>
* tracepoint.c (download_tracepoints): Moved to ...
(cmd_qtstart): ... here.
2012-04-14 Yao Qi <yao@codesourcery.com>
* tracepoint.c: Include inttypes.h.
(struct collect_memory_action): Use sized types.
(struct tracepoint): Likewise.
(cmd_qtdp, stop_tracing): Update print specifiers.
(cmd_qtp, response_tracepoint): Likewise.
(collect_data_at_tracepoint): Likewise.
(collect_data_at_step): Likewise.
2012-04-14 Yao Qi <yao@codesourcery.com>
Import gnulib module inttypes.
* aclocal.m4, config.in, configure: Regenerated.
2012-04-14 Yao Qi <yao@codesourcery.com>
* Makefile.in (maintainer-clean, realclean, distclean): Remove
Makefile and config.status at last.
2012-04-13 Yao Qi <yao@codesourcery.com>
* tracepoint.c: Include stdint.h unconditionally.
2012-04-13 Thiago Jung Bauermann <thiago.bauermann@linaro.org>
* acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
on BFD_HAVE_SYS_PROCFS_TYPE.
* configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
* configure: Regenerate.
* config.in: Likewise.
2012-04-13 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (clean): Also remove x32.c x32-linux.c
x32-avx.c x32-avx-linux.c.
(x32.o): New target.
(x32.c): Likewise.
(x32-linux.o): Likewise.
(x32-linux.c): Likewise.
(x32-avx.o): Likewise.
(x32-avx.c): Likewise.
(x32-avx-linux.o): Likewise.
(x32-avx-linux.c): Likewise.
* configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
(srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
(srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
(srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
(srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
i386/x32-avx-linux.xml.
* linux-x86-low.c (init_registers_x32_linux): New prototype.
(init_registers_x32_avx_linux): Likwise.
(x86_linux_update_xmltarget): Call init_registers_x32_linux
or init_registers_x32_avx_linux if linux_is_elf64 is false.
2012-04-13 Pedro Alves <palves@redhat.com>
* Makefile.in (GNULIB_FLAGS_TO_PASS): New.
(FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
(all, uninstall, clean-info, all-lib, clean, maintainer-clean)
(realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
the sub-make.
2012-04-12 H.J. Lu <hongjiu.lu@intel.com>
* linux-x86-low.c (compat_x32_clock_t): New.
(compat_x32_siginfo_t): Likewise.
(compat_x32_siginfo_from_siginfo): Likewise.
(siginfo_from_compat_x32_siginfo): Likewise.
(linux_is_elf64): Likewise.
(x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
and siginfo_from_compat_x32_siginfo for x32.
(x86_arch_setup): Set linux_is_elf64.
2012-04-12 H.J. Lu <hongjiu.lu@intel.com>
PR gdb/13969
* linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
e_machine field.
(linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
* linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
* linux-x86-low.c (x86_arch_setup): Check if GDBserver is
compatible with process.
2012-04-12 Yao Qi <yao@codesourcery.com>
* Makefile.in: Define abs_top_srcdir and abs_srcdir.
(INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
(install-only, install-info, clean): Handle sub dir gnulib.
(all-lib, am--refresh): New targets.
(memmem.o): Remove target.
* configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
Invoke gl_EARLY. Invoke AC_CHECK_PROGS for make.
(AC_REPLACE_FUNCS): Remove memmem.
Invoke gl_INIT and AM_INIT_AUTOMAKE.
(AC_OUTPUT): Generate Makefile in gnulib/.
* aclocal.m4, config.in, configure: Regenerated.
2012-04-10 Maciej W. Rozycki <macro@codesourcery.com>
* linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
2012-04-05 Pedro Alves <palves@redhat.com>
-Werror=strict-aliasing
* spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
pointer.
2012-04-04 Pedro Alves <palves@redhat.com>
* linux-sparc-low.c (sparc_fill_gregset_to_stack)
(sparc_store_gregset_from_stack, sparc_store_gregset)
(sparc_breakpoint_at): Fix formatting.
2012-03-30 Thiago Jung Bauermann <thiago.bauermann@linaro.org>
* configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
are available.
* linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
[HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
* config.in: Regenerate.
* configure: Likewise.
2012-03-29 Pedro Alves <palves@redhat.com>
* linux-low.c (regsets_store_inferior_registers) [__sparc__]:
Correct ptrace arguments.
2012-03-28 Pedro Alves <palves@redhat.com>
* linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
(IA64_GR0_REGNUM, IA64_FR0_REGNUM)
(IA64_FR1_REGNUM): New defines.
(ia64_fetch_register): New.
(the_low_target): Install it.
* linux-low.h (struct linux_target_ops) <fetch_register>: New
field.
* linux-low.c (linux_fetch_registers): Try the
the_low_target.fetch_register hook first.
* linux-arm-low.c (the_low_target): Adjust.
* linux-bfin-low.c (the_low_target): Adjust.
* linux-cris-low.c (the_low_target): Adjust.
* linux-crisv32-low.c (the_low_target): Adjust.
* linux-m32r-low.c (the_low_target): Adjust.
* linux-m68k-low.c (the_low_target): Adjust.
* linux-mips-low.c (the_low_target): Adjust.
* linux-ppc-low.c (the_low_target): Adjust.
* linux-s390-low.c (the_low_target): Adjust.
* linux-sh-low.c (the_low_target): Adjust.
* linux-sparc-low.c (the_low_target): Adjust.
* linux-tic6x-low.c (the_low_target): Adjust.
* linux-x86-low.c (the_low_target): Adjust.
* linux-xtensa-low.c (the_low_target): Adjust.
2012-03-26 Pedro Alves <palves@redhat.com>
* server.c (handle_qxfer_libraries): Don't bail early if
the_target->qxfer_libraries_svr4 is not NULL.
2012-03-26 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
2012-03-23 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_qxfer_libraries_svr4): Terminate the
"library-list-svr4" element's start tag when the the DSO list is
empty.
2012-03-23 Pedro Alves <palves@redhat.com>
* linux-low.c (read_one_ptr): Read the inferior's pointer through
a variable whose type size is the same as the inferior's pointer
size.
2012-03-21 Thomas Schwinge <thomas@codesourcery.com>
* linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
struct siginfo.
* linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
* linux-x86-low.c (x86_siginfo_fixup): Likewise.
* linux-low.h: Include <signal.h>.
(struct siginfo): Remove forward declaration.
(struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
struct siginfo.
2012-03-21 05:51:36 +01:00
2012-03-21 Mike Frysinger <vapier@gentoo.org>
* .gitignore: Ignore more files.
2012-03-19 Pedro Alves <palves@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* server.c (cont_thread, general_thread): Add describing comments.
(start_inferior): Clear `cont_thread'.
(handle_v_cont): Don't set `cont_thread' if resuming all threads
of a process.
2012-03-15 Yao Qi <yao@codesourcery.com>
* tracepoint.c (install_tracepoint): Move duplicated tracepoint
handling to ...
(cmd_qtdp): ... here.
2012-03-15 Yao Qi <yao@codesourcery.com>
* tracepoint.c (struct tracepoint_action_ops): New.
(struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
(m_tracepoint_action_download): New.
(r_tracepoint_action_download): New.
(x_tracepoint_action_download): New.
(l_tracepoint_action_download): New.
(add_tracepoint_action): Install `action->ops' according type.
(download_tracepoint_1): Move code `download' function pointer
of various tracepoint_action_ops.
2012-03-13 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-low.c (linux_attach_lwp_1): New variable buffer. Call
linux_ptrace_attach_warnings.
2012-03-13 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (linux-ptrace.o): New.
* configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
(cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
(m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
(s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
(x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
of these targets.
* linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
2012-03-08 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
Fix PR server/13392.
* linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
offset of JMP insn.
* tracepoint.c (remove_tracepoint): New.
(cmd_qtdp): Call remove_tracepoint when failed to install.
2012-03-07 Pedro Alves <palves@redhat.com>
* linux-low.c (get_detach_signal): New.
(linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
Pass on pending signals to PTRACE_DETACH. Check the result of the
ptrace call.
* server.c (program_signals, program_signals_p): New.
(handle_general_set): Handle QProgramSignals.
* server.h (program_signals, program_signals_p): Declare.
2012-03-05 Pedro Alves <palves@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
New comment why.
2012-03-03 Yao Qi <yao@codesourcery.com>
* tracepoint.c (tracepoint_look_up_symbols): Update call to
agent_look_up_symbols.
2012-03-03 Yao Qi <yao@codesourcery.com>
* Makefile.in (linux-low.o): Keep dependence on agent.h.
(linux-x86-low.o): Likewise.
* server.h: Remove in_process_agent_loaded.
* tracepoint.c (in_process_agent_loaded): Removed. Moved it
common/agent.c.
Update callers.
2012-03-03 Yao Qi <yao@codesourcery.com>
* tracepoint.c (gdb_agent_capability): New global.
(in_process_agent_loaded_ust): Renamed to
`in_process_agent_supports_ust'.
Update callers.
(in_process_agent_supports_ust): Call agent_capability_check.
(clear_installed_tracepoints): Assert that agent supports
agent.
2012-03-03 Yao Qi <yao@codesourcery.com>
* linux-low.c (linux_supports_agent): New.
(linux_target_ops): Initialize field `supports_agent' with
linux_supports_agent.
* target.h (struct target_ops) <supports_agent>: New.
(target_supports_agent): New macro.
* server.c (handle_general_set): Handle packet 'QAgent'.
(handle_query): Send `QAgent+'.
* Makefile.in (server.o): Depends on agent.h.
2012-03-03 Yao Qi <yao@codesourcery.com>
* Makefile.in (OBS): Add agent.o.
Add new rule for agent.o.
Track dependence of tracepoint.c on agent.h.
* tracepoint.c (run_inferior_command_1):
(run_inferior_command): Call agent_run_command.
(gdb_ust_connect_sync_socket): Deleted. Move it to
common/agent.c.
(resume_thread, stop_thread): Likewise.
(gdb_ust_socket_init): Renamed to ...
(gdb_agent_socket_init): ... New.
(gdb_ust_thread): Renamed to ...
(gdb_agent_helper_thread): ... New.
(gdb_ust_init): Move some code to ...
(gdb_agent_init): ... here. New.
[HAVE_UST]: Call gdb_ust_init.
(initialize_tracepoint_ftlib): Call gdb_agent_init.
* configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
* config.in, configure: Regenerated.
2012-03-02 Pedro Alves <palves@redhat.com>
* inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
* linux-low.c (struct simple_pid_list): New.
(stopped_pids): New a struct simple_pid_list pointer.
(add_to_pid_list, pull_pid_from_list): New.
(handle_extended_wait): Don't assume the first signal new children
report is SIGSTOP. Adjust call to pull_pid_from_list.
(linux_wait_for_lwp): Adjust.
2012-03-02 Yao Qi <yao@codesourcery.com>
* tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
debug log.
2012-03-02 Yao Qi <yao@codesourcery.com>
* tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
`stop_pc' and `tpoint'. Update caller.
gdb/ * features/mips-dsp.xml: New file. * features/mips64-dsp.xml: New file. * features/mips-dsp-linux.xml: New file. * features/mips64-dsp-linux.xml: New file. * features/Makefile (WHICH): Add mips-dsp-linux and mips64-dsp-linux. (mips-dsp-expedite, mips64-dsp-expedite): New variables. * features/mips-dsp-linux.c: New file. * features/mips64-dsp-linux.c: New file. * regformats/mips-dsp-linux.dat: New file. * regformats/mips64-dsp-linux.dat: New file. * mips-linux-nat.c (mips_linux_register_addr): Handle DSP registers. (mips64_linux_register_addr): Likewise. (mips64_linux_regsets_fetch_registers): Likewise. (mips64_linux_regsets_store_registers): Likewise. (mips64_linux_fetch_registers): Update call to mips64_linux_regsets_fetch_registers. (mips64_linux_store_registers): Update call to mips64_linux_regsets_store_registers. (mips_linux_read_description): Probe for DSP registers. (_initialize_mips_linux_nat): Call initialize_tdesc_mips_dsp_linux and initialize_tdesc_mips64_dsp_linux. * mips-linux-tdep.c (supply_gregset, mips64_supply_gregset): Remove padding of no longer used embedded register slots. * mips-linux-tdep.h (DSP_BASE, DSP_CONTROL): New macros. (MIPS_RESTART_REGNUM): Redefine enum value. * mips-tdep.c (mips_generic_reg_names): Remove trailing null strings. (mips_tx39_reg_names): Likewise. (mips_linux_reg_names): New array of register names for Linux targets. (mips_register_name): Check for a null pointer in mips_processor_reg_names and return an empty string. (mips_register_type): Exclude embedded registers for the IRIX and Linux ABIs. (mips_pseudo_register_type): Likewise. Use dynamic numbers to refer to FP registers, LO, HI, BadVAddr, Cause and PC. Handle DSP registers. (mips_stab_reg_to_regnum): Handle DSP accumulators. (mips_dwarf_dwarf2_ecoff_reg_to_regnum): Likewise. (mips_gdbarch_init): Likewise. Initialize internal register indices for the Linux ABI. Use dynamic numbers to refer to registers, as applicable, while parsing the target description. * mips-tdep.h (struct mips_regnum): Add dspacc/dspctl offsets. gdb/doc/ * gdb.texinfo (MIPS Features): Add org.gnu.gdb.mips.dsp. gdb/gdbserver/ * linux-low.h (linux_target_ops): Add regset_bitmap member. * linux-low.c (use_linux_regsets): New macro. [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise. [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise. (linux_register_in_regsets): New function. (usr_fetch_inferior_registers): Skip registers covered by regsets. (usr_store_inferior_registers): Likewise. (usr_fetch_inferior_registers): New macro. (usr_store_inferior_registers): Likewise. (linux_fetch_registers): Handle mixed regset/non-regset targets. (linux_store_registers): Likewise. * linux-mips-low.c (init_registers_mips_dsp_linux): New prototype. (init_registers_mips64_dsp_linux): Likewise. (init_registers_mips_linux): New macro. (init_registers_mips_dsp_linux): Likewise. (mips_dsp_num_regs): Likewise. (DSP_BASE, DSP_CONTROL): New fallback macros. (mips_base_regs): New macro. (mips_regmap): Use it. Fix the size. (mips_dsp_regmap): New variable. (mips_dsp_regset_bitmap): Likewise. (mips_arch_setup): New function. (mips_cannot_fetch_register): Use the_low_target.regmap rather than mips_regmap. (mips_cannot_store_register): Likewise. (the_low_target): Update .arch_setup, .num_regs and .regmap initializers. Add .regset_bitmap initializer. * linux-arm-low.c (the_low_target): Add .regset_bitmap initializer. * linux-bfin-low.c (the_low_target): Likewise. * linux-cris-low.c (the_low_target): Likewise. * linux-crisv32-low.c (the_low_target): Likewise. * linux-ia64-low.c (the_low_target): Likewise. * linux-m32r-low.c (the_low_target): Likewise. * linux-m68k-low.c (the_low_target): Likewise. * linux-ppc-low.c (the_low_target): Likewise. * linux-s390-low.c (the_low_target): Likewise. * linux-sh-low.c (the_low_target): Likewise. * linux-sparc-low.c (the_low_target): Likewise. * linux-tic6x-low.c (the_low_target): Likewise. * linux-x86-low.c (the_low_target): Likewise. * linux-xtensa-low.c (the_low_target): Likewise. * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and mips64-dsp-linux.o to srv_regobj. Add mips-dsp-linux.xml, mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to srv_xmlfiles. * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets. (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise. gdb/testsuite/ * gdb.xml/tdesc-regs.exp: Add "mips-dsp.xml" to the list of MIPS core registers.
2012-03-01 23:19:48 +01:00
2012-03-01 Maciej W. Rozycki <macro@codesourcery.com>
* linux-low.h (linux_target_ops): Add regset_bitmap member.
* linux-low.c (use_linux_regsets): New macro.
[!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
[!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
(linux_register_in_regsets): New function.
(usr_fetch_inferior_registers): Skip registers covered by
regsets.
(usr_store_inferior_registers): Likewise.
(usr_fetch_inferior_registers): New macro.
(usr_store_inferior_registers): Likewise.
(linux_fetch_registers): Handle mixed regset/non-regset targets.
(linux_store_registers): Likewise.
* linux-mips-low.c (init_registers_mips_dsp_linux): New
prototype.
(init_registers_mips64_dsp_linux): Likewise.
(init_registers_mips_linux): New macro.
(init_registers_mips_dsp_linux): Likewise.
(mips_dsp_num_regs): Likewise.
(DSP_BASE, DSP_CONTROL): New fallback macros.
(mips_base_regs): New macro.
(mips_regmap): Use it. Fix the size.
(mips_dsp_regmap): New variable.
(mips_dsp_regset_bitmap): Likewise.
(mips_arch_setup): New function.
(mips_cannot_fetch_register): Use the_low_target.regmap rather
than mips_regmap.
(mips_cannot_store_register): Likewise.
(the_low_target): Update .arch_setup, .num_regs and .regmap
initializers. Add .regset_bitmap initializer.
* linux-arm-low.c (the_low_target): Add .regset_bitmap
initializer.
* linux-bfin-low.c (the_low_target): Likewise.
* linux-cris-low.c (the_low_target): Likewise.
* linux-crisv32-low.c (the_low_target): Likewise.
* linux-ia64-low.c (the_low_target): Likewise.
* linux-m32r-low.c (the_low_target): Likewise.
* linux-m68k-low.c (the_low_target): Likewise.
* linux-ppc-low.c (the_low_target): Likewise.
* linux-s390-low.c (the_low_target): Likewise.
* linux-sh-low.c (the_low_target): Likewise.
* linux-sparc-low.c (the_low_target): Likewise.
* linux-tic6x-low.c (the_low_target): Likewise.
* linux-x86-low.c (the_low_target): Likewise.
* linux-xtensa-low.c (the_low_target): Likewise.
* configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
mips64-dsp-linux.o to srv_regobj. Add mips-dsp-linux.xml,
mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
srv_xmlfiles.
* Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
(mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
2012-02-29 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
`step_over_finished' is true.
2012-02-27 Pedro Alves <palves@redhat.com>
* linux-low.c (pid_is_stopped): Delete, moved to common/.
(linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
2012-02-27 Pedro Alves <palves@redhat.com>
PR server/9684
* linux-low.c (pid_is_stopped): New.
(linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
2012-02-25 Luis Machado <lgustavo@codesourcery.com>
* mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
of conditions.
2012-02-24 Maciej W. Rozycki <macro@codesourcery.com>
* linux-mips-low.c (mips_regmap): Correct the index of $f9.
2012-02-24 Luis Machado <lgustavo@codesourcery>
* server.c (handle_query): Advertise support for target-side
breakpoint condition evaluation.
(process_point_options): New function.
(process_serial_event): When inserting a breakpoint, check for
a target-side condition that should be evaluated.
* mem-break.c: Include regcache.h and ax.h.
(point_cond_list_t): New data structure.
(breakpoint) <cond_list>: New field.
(find_gdb_breakpoint_at): Make non-static.
(delete_gdb_breakpoint_at): Clear any target-side
conditions.
(clear_gdb_breakpoint_conditions): New function.
(add_condition_to_breakpoint): Likewise.
(add_breakpoint_condition): Likewise.
(gdb_condition_true_at_breakpoint): Likewise.
(gdb_breakpoint_here): Return result directly instead
of going through a local variable.
* mem-break.h (find_gdb_breakpoint_at): New prototype.
(clear_gdb_breakpoint_conditions): Likewise.
(add_breakpoint_condition): Likewise.
(gdb_condition_true_at_breakpoint): Likewise.
* linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
(need_step_over_p): Take target-side breakpoint condition into
consideration.
2012-02-24 Luis Machado <lgustavo@codesourcery> * server.h: Include tracepoint.h. (agent_mem_read, agent_get_trace_state_variable_value, agent_set_trace_state_variable_value, agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr, get_set_tsv_func_addr): New prototypes. * ax.h: New include file. * ax.c: New source file. * tracepoint.c: Include ax.h. (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes, agent_expr, eval_result_type): Move to ax.h. (parse_agent_expr): Rename to ... (gdb_parse_agent_expr): ... this, make it non-static and move to ax.h. (unparse_agent_expr) Rename to ... (gdb_unparse_agent_expr): ... this, make it non-static and move to ax.h. (eval_agent_expr): Rename to ... (eval_tracepoint_agent_expr): ... this. (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove forward declarations. (add_tracepoint_action): Call gdb_parse_agent_expr (...). (agent_get_trace_state_variable_value): New function. (agent_set_trace_state_variable_value): New function. (cmd_qtdp): Call gdb_parse_agent_expr (...). (response_tracepoint): Call gdb_unparse_agent_expr (...). (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...). (condition_true_at_tracepoint): Likewise. (parse_agent_expr): Rename to ... (gdb_parse_agent_expr): ... this and move to ax.c. (unparse_agent_expr): Rename to ... (gdb_unparse_agent_expr): ... this and move to ax.c. (gdb_agent_op_name): Move to ax.c. (eval_agent_expr): Rename to ... (gdb_eval_agent_expr): ... this, use regcache passed as parameter and move to ax.c. (eval_tracepoint_agent_expr): New function. (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make non-static. (current_insn_ptr, emit_error, struct bytecode_address): Move to ax.c. (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const, emit_reg, emit_pop, emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust, emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto, emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c. (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions. (compile_bytecodes): Remove forward declaration. (is_goto_target): Move to ax.c. (compile_bytecodes): Move to ax.c and call agent_get_trace_state_variable_value (...) and agent_set_trace_state_variable_value (...). * Makefile.in: Update ax.c and IPA dependencies.
2012-02-24 16:13:37 +01:00
2012-02-24 Luis Machado <lgustavo@codesourcery>
* server.h: Include tracepoint.h.
(agent_mem_read, agent_get_trace_state_variable_value,
agent_set_trace_state_variable_value,
agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
get_set_tsv_func_addr): New prototypes.
* ax.h: New include file.
* ax.c: New source file.
* tracepoint.c: Include ax.h.
(gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
agent_expr, eval_result_type): Move to ax.h.
(parse_agent_expr): Rename to ...
(gdb_parse_agent_expr): ... this, make it non-static and move
to ax.h.
(unparse_agent_expr) Rename to ...
(gdb_unparse_agent_expr): ... this, make it non-static and move
to ax.h.
(eval_agent_expr): Rename to ...
(eval_tracepoint_agent_expr): ... this.
(agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
forward declarations.
(add_tracepoint_action): Call gdb_parse_agent_expr (...).
(agent_get_trace_state_variable_value): New function.
(agent_set_trace_state_variable_value): New function.
(cmd_qtdp): Call gdb_parse_agent_expr (...).
(response_tracepoint): Call gdb_unparse_agent_expr (...).
(do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
(condition_true_at_tracepoint): Likewise.
(parse_agent_expr): Rename to ...
(gdb_parse_agent_expr): ... this and move to ax.c.
(unparse_agent_expr): Rename to ...
(gdb_unparse_agent_expr): ... this and move to ax.c.
(gdb_agent_op_name): Move to ax.c.
(eval_agent_expr): Rename to ...
(gdb_eval_agent_expr): ... this, use regcache passed as parameter
and move to ax.c.
(eval_tracepoint_agent_expr): New function.
(agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
2013-02-12 16:18:33 +01:00
non-static.
2012-02-24 Luis Machado <lgustavo@codesourcery> * server.h: Include tracepoint.h. (agent_mem_read, agent_get_trace_state_variable_value, agent_set_trace_state_variable_value, agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr, get_set_tsv_func_addr): New prototypes. * ax.h: New include file. * ax.c: New source file. * tracepoint.c: Include ax.h. (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes, agent_expr, eval_result_type): Move to ax.h. (parse_agent_expr): Rename to ... (gdb_parse_agent_expr): ... this, make it non-static and move to ax.h. (unparse_agent_expr) Rename to ... (gdb_unparse_agent_expr): ... this, make it non-static and move to ax.h. (eval_agent_expr): Rename to ... (eval_tracepoint_agent_expr): ... this. (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove forward declarations. (add_tracepoint_action): Call gdb_parse_agent_expr (...). (agent_get_trace_state_variable_value): New function. (agent_set_trace_state_variable_value): New function. (cmd_qtdp): Call gdb_parse_agent_expr (...). (response_tracepoint): Call gdb_unparse_agent_expr (...). (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...). (condition_true_at_tracepoint): Likewise. (parse_agent_expr): Rename to ... (gdb_parse_agent_expr): ... this and move to ax.c. (unparse_agent_expr): Rename to ... (gdb_unparse_agent_expr): ... this and move to ax.c. (gdb_agent_op_name): Move to ax.c. (eval_agent_expr): Rename to ... (gdb_eval_agent_expr): ... this, use regcache passed as parameter and move to ax.c. (eval_tracepoint_agent_expr): New function. (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make non-static. (current_insn_ptr, emit_error, struct bytecode_address): Move to ax.c. (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const, emit_reg, emit_pop, emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust, emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto, emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c. (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions. (compile_bytecodes): Remove forward declaration. (is_goto_target): Move to ax.c. (compile_bytecodes): Move to ax.c and call agent_get_trace_state_variable_value (...) and agent_set_trace_state_variable_value (...). * Makefile.in: Update ax.c and IPA dependencies.
2012-02-24 16:13:37 +01:00
(current_insn_ptr, emit_error, struct bytecode_address): Move to
ax.c.
(emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
(get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
(compile_bytecodes): Remove forward declaration.
(is_goto_target): Move to ax.c.
(compile_bytecodes): Move to ax.c and call
agent_get_trace_state_variable_value (...) and
agent_set_trace_state_variable_value (...).
* Makefile.in: Update ax.c and IPA dependencies.
2012-02-24 Pedro Alves <palves@redhat.com>
* tracepoint.c (cmd_bigqtbuffer): Rename as ...
(cmd_bigqtbuffer_circular): ... this. Only handle
'QTBuffer:circular:'.
(handle_tracepoint_general_set): Adjust.
2012-02-16 Yao Qi <yao@codesourcery.com>
* inferiors.c: Move code to ...
* dll.c: .... here. New.
* server.h: Declare clear_dlls.
* Makefile.in (SFILES): Add dll.c.
(OBS): Add dll.o
(dll.o): New rule.
2012-02-11 Yao Qi <yao@codesourcery.com>
* server.c: (handle_monitor_command): Add a new parameter
`own_buf'.
(handle_query): Update caller.
2012-02-09 Joel Brobecker <brobecker@adacore.com>
* configure.ac: Add readlink to AC_CHECK_FUNCS list.
* configure, config.in: Regenerate.
* hostio.c: Provide an alternate implementation if HAVE_READLINK
is not defined.
2012-02-02 Pedro Alves <palves@redhat.com>
Try SIGKILL first, then PTRACE_KILL.
* linux-low.c (linux_kill_one_lwp): New.
(linux_kill_one_lwp): Rename to ...
(kill_one_lwp_callback): ... this. Use the new
linux_kill_one_lwp.
2012-02-02 Pedro Alves <palves@redhat.com>
* tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
inferior.
2012-01-27 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_child_pid_to_exec_file): Delete.
(elf_64_file_p): Make static.
(linux_pid_exe_is_elf_64_file): New.
* linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
Delete declarations.
(linux_pid_exe_is_elf_64_file): Declare.
* linux-x86-low.c (x86_arch_setup): Use
linux_pid_exe_is_elf_64_file.
2012-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-low.c (linux_wait_for_event_1): Rename to ...
(linux_wait_for_event): ... here and merge it with former
linux_wait_for_event - new variable wait_ptid, use it.
(linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
2012-01-23 Pedro Alves <palves@redhat.com>
* server.c (main): Avoid yet another case of infinite loop while
detaching/killing after a longjmp.
2012-01-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup.
* linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
2012-01-20 Ulrich Weigand <ulrich.weigand@linaro.org>
* hostio.c (handle_readlink): New function.
(handle_vFile): Call it to handle "vFile:readlink" packets.
2012-01-20 Pedro Alves <palves@redhat.com>
Ulrich Weigand <ulrich.weigand@linaro.org>
* server.c (handle_v_requests): Only support vAttach and vRun to
start multiple processes when in extended protocol mode.
2012-01-17 Pedro Alves <palves@redhat.com>
* tracepoint.c (initialize_tracepoint): Use mmap instead of
memalign plus mprotect to allocate the scratch buffer.
2012-01-13 Pedro Alves <palves@redhat.com>
* server.c (attach_inferior): Clear `cont_thread'.
2012-01-13 Pedro Alves <palves@redhat.com>
* server.c (main): Avoid infinite loop while detaching/killing
after a longjmp.
2012-01-09 Doug Evans <dje@google.com>
* server.c (start_inferior): Set last_ptid in --wrapper case.
2012-01-06 Yao Qi <yao@codesourcery.com>
* tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
defined.
[IN_PROCESS_AGENT] (debug_agent): New global variable.
2012-01-04 Yao Qi <yao@codesourcery.com>
* tracepoint.c (cmd_qtdp): Print debug message
for static tracepoint.
2012-01-04 Yao Qi <yao@codesourcery.com>
* tracepoint.c (trace_vdebug): Differentiate debug message
between gdbserver and IPA.
2012-01-03 Yao Qi <yao@codesourcery.com>
* tracepoint.c (tracepoint_was_hit): Don't collect for
static tracepoint.
2012-01-02 16:37:37 +01:00
2012-01-02 Joel Brobecker <brobecker@adacore.com>
* terminal.h: Reformat copyright header.
2012-01-02 Joel Brobecker <brobecker@adacore.com>
* server.c (gdbserver_version): Update copyright year.
* gdbreplay.c (gdbreplay_version): Likewise.
2011-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-low.c (linux_create_inferior): Put empty if clause for write.
Revert:
2011-12-18 Hui Zhu <teawater@gmail.com>
* linux-low.c (linux_create_inferior): Save return value to ret.
2011-12-18 Hui Zhu <teawater@gmail.com>
* linux-low.c (linux_create_inferior): Save return value to ret.
2011-12-16 Doug Evans <dje@google.com>
* linux-low.c (linux_create_inferior): If stdio connection,
redirect stdin from /dev/null, stdout to stderr.
* remote-utils.c (remote_is_stdio): New static global.
(remote_connection_is_stdio): New function.
(remote_prepare): Handle stdio connection.
(remote_open): Ditto.
(remote_close): Don't close stdin for stdio connections.
(read_prim,write_prim): New functions. Replace all calls to
read/write to these.
* server.c (main): Watch for "-" argument. Move call to
remote_prepare before start_inferior.
* server.h (STDIO_CONNECTION_NAME): New macro.
(remote_connection_is_stdio): Declare.
* remote-utils.c (prepare_resume_reply): Remove extraneous \n
in debugging output.
2011-12-15 Yao Qi <yao@codesourcery.com>
* tracepoint.c: Include sys/syscall.h.
(gdb_ust_thread): Remove preprocessor conditional.
2011-12-14 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_detach_one_lwp): Call
the_low_target.prepare_to_resume before detaching.
2011-12-14 Yao Qi <yao@codesourcery.com>
* tracepoint.c (gdb_ust_thread): Don't ignore return value
of write.
2011-12-14 Yao Qi <yao@codesourcery.com>
* i386-low.c (i386_low_stopped_data_address): Initialize local
variable `control'.
2011-12-13 Pedro Alves <pedro@codesourcery.com>
PR remote/13492
* i386-low.c (i386_low_stopped_data_address): Avoid fetching
DR_CONTROL unless necessary. Extend comments.
* linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
DR0-3 if not used. If any watchpoint was set, clear DR_STATUS.
2011-12-13 Yao Qi <yao@codesourcery.com>
* tracepoint.c (trace_buffer_alloc): Replace magic numbers with
macros.
(upload_fast_traceframes, upload_fast_traceframes): Likewise.
2011-12-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
Print new debug message for such case.
2011-12-06 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix overlapping memcpy.
* mem-break.c (set_raw_breakpoint_at): New variable buf. Use it for
the read_inferior_memory transfer.
(delete_fast_tracepoint_jump): New variable buf. Use it for the
write_inferior_memory transfer.
(set_fast_tracepoint_jump): New variable buf. Use it for the
read_inferior_memory and write_inferior_memory transfers.
(uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
(delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
Use it for the write_inferior_memory transfer.
(check_mem_read, check_mem_write): New gdb_asserts for overlapping
buffers.
2011-12-06 Maciej W. Rozycki <macro@codesourcery.com>
* linux-low.c (fetch_register, store_register): Make code
consistent, fix formatting.
2011-12-06 Maciej W. Rozycki <macro@codesourcery.com>
* linux-low.c (usr_store_inferior_registers): Factor out code
to handle individual registers into...
(store_register): ... this new function.
ChangeLog: * s390-tdep.h (S390_ORIG_R2_REGNUM): Define. (S390_LAST_BREAK_REGNUM): Likewise. (S390_SYSTEM_CALL_REGNUM): Likewise. (S390_NUM_REGS): Update. (s390_regmap_last_break): Add declaration. (s390x_regmap_last_break): Likewise. (s390_regmap_system_call): Likewise. (tdesc_s390_linux32v1): Add declaration. (tdesc_s390_linux32v2): Likewise. (tdesc_s390_linux64v1): Likewise. (tdesc_s390_linux64v2): Likewise. (tdesc_s390x_linux64v1): Likewise. (tdesc_s390x_linux64v2): Likewise. * s390-tdep.c: Include new target description files "features/s390-linux32v1.c", "features/s390-linux32v2.c", "features/s390-linux64v1.c", "features/s390-linux64v2.c", "features/s390x-linux64v1.c", and "features/s390x-linux64v2.c". (s390_cannot_store_register): New function. (s390_write_pc): Likewise. (s390_dwarf_regmap): Add fields for new registers. (s390_regmap_gregset): Likewise. (s390x_regmap_gregset): Likewise. (s390_regmap_fpregset): Likewise. (s390_regmap_upper): Likewise. (s390_regmap_last_break): New variable. (s390x_regmap_last_break): Likewise. (s390_regmap_system_call): Likewise. (s390_last_break_regset): Likewise. (s390x_last_break_regset): Likewise. (s390_system_call_regset): Likewise. (s390_upper_regset_sections): Rename to ... (s390_linux64_regset_sections): ... this. (s390_linux32_regset_sections): New variable. (s390x_linux64_regset_sections): Likewise. (s390_linux32v1_regset_sections): Likewise. (s390_linux32v2_regset_sections): Likewise. (s390_linux64v1_regset_sections): Likewise. (s390_linux64v2_regset_sections): Likewise. (s390x_linux64v1_regset_sections): Likewise. (s390x_linux64v2_regset_sections): Likewise. (s390_regset_from_core_section): Handle .reg-s390-last-break and .reg-s390-system-call core file sections. (s390_core_read_description): Check for presence of .reg-s390-last-break and .reg-s390-system-call core file sections and return appropriate target description. (s390_gdbarch_init): Detect Linux-specific registers "orig_r2", "last_break" and "system_call" in target description. Install appropriate gdbarch_core_regset_sections array. Call set_gdbarch_cannot_store_register and set_gdbarch_write_pc. (_initialize_s390_tdep): Initialize additional target descriptions. * s390-nat.c: Include "elf/common.h". (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined. (have_regset_last_break): New static variable. (have_regset_system_call): Likewise. (s390_native_supply): Handle S390_ORIG_R2_REGNUM. (s390_native_collect): Likewise. (fetch_regset, store_regset, check_regset): New functions. (s390_linux_fetch_inferior_registers): Handle S390_LAST_BREAK_REGNUM and S390_SYSTEM_CALL_REGNUM. (s390_linux_store_inferior_registers): Likewise. (s390_read_description): Check for presence of NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL regsets and use appropriate description. * features/Makefile (WHICH): Add s390-linux32v1, s390-linux64v1, s390x-linux64v1, s390-linux32v2, s390-linux64v2, and s390x-linux64v2. (s390-linux32v1-expedite): Define. (s390-linux32v2-expedite): Likewise. (s390-linux64v1-expedite): Likewise. (s390-linux64v2-expedite): Likewise. (s390x-linux64v1-expedite): Likewise. (s390x-linux64v2-expedite): Likewise. * features/s390-linux32.xml: Add orig_r2 register. * features/s390-linux64.xml: Likewise. * features/s390x-linux64.xml: Likewise. * features/s390-linux32v1.xml: New file. * features/s390-linux32v2.xml: Likewise. * features/s390-linux64v1.xml: Likewise. * features/s390-linux64v2.xml: Likewise. * features/s390x-linux64v1.xml: Likewise. * features/s390x-linux64v2.xml: Likewise. * features/s390-linux32.c: Regenerate. * features/s390-linux64.c: Likewise. * features/s390x-linux64.c: Likewise. * features/s390-linux32v1.c: New generated file. * features/s390-linux32v2.c: Likewise. * features/s390-linux64v1.c: Likewise. * features/s390-linux64v2.c: Likewise. * features/s390x-linux64v1.c: Likewise. * features/s390x-linux64v2.c: Likewise. * regformats/s390-linux32.dat: Regenerate. * regformats/s390-linux64.dat: Regenerate. * regformats/s390x-linux64.dat: Regenerate. * regformats/s390-linux32v1.dat: New generated file. * regformats/s390-linux32v2.dat: Likewise. * regformats/s390-linux64v1.dat: Likewise. * regformats/s390-linux64v2.dat: Likewise. * regformats/s390x-linux64v1.dat: Likewise. * regformats/s390x-linux64v2.dat: Likewise. gdbserver/ChangeLog: * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules. (s390-linux32v2.o, s390-linux32v2.c): Likewise. (s390-linux64v1.o, s390-linux64v1.c): Likewise. (s390-linux64v2.o, s390-linux64v2.c): Likewise. (s390x-linux64v1.o, s390x-linux64v1.c): Likewise. (s390x-linux64v2.o, s390x-linux64v2.c): Likewise. * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects. (srv_xmlfiles): Add new XML files. * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>, and <sys/uio.h>. (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined. (init_registers_s390_linux32v1): Add prototype. (init_registers_s390_linux32v2): Likewise. (init_registers_s390_linux64v1): Likewise. (init_registers_s390_linux64v2): Likewise. (init_registers_s390x_linux64v1): Likewise. (init_registers_s390x_linux64v2): Likewise. (s390_num_regs): Increment to 52. (s390_regmap): Add orig_r2 register. (s390_num_regs_3264): Increment to 68. (s390_regmap_3264): Add orig_r2 register. (s390_collect_ptrace_register): Handle orig_r2 register. (s390_supply_ptrace_register): Likewise. (s390_fill_last_break): New function. (s390_store_last_break): Likewise. (s390_fill_system_call): New function. (s390_store_system_call): Likewise. (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL register sets. (s390_check_regset): New function. (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL regsets and use appropriate description. Update target_regsets for available register sets. testsuite/ChangeLog: * gdb.base/callfuncs.exp (fetch_all_registers): Filter out read-only last_break register on s390*-*-* targets.
2011-12-06 15:14:50 +01:00
2011-12-06 Ulrich Weigand <uweigand@de.ibm.com>
* Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
(s390-linux32v2.o, s390-linux32v2.c): Likewise.
(s390-linux64v1.o, s390-linux64v1.c): Likewise.
(s390-linux64v2.o, s390-linux64v2.c): Likewise.
(s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
(s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
* configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
(srv_xmlfiles): Add new XML files.
* linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
and <sys/uio.h>.
(PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
(init_registers_s390_linux32v1): Add prototype.
(init_registers_s390_linux32v2): Likewise.
(init_registers_s390_linux64v1): Likewise.
(init_registers_s390_linux64v2): Likewise.
(init_registers_s390x_linux64v1): Likewise.
(init_registers_s390x_linux64v2): Likewise.
(s390_num_regs): Increment to 52.
(s390_regmap): Add orig_r2 register.
(s390_num_regs_3264): Increment to 68.
(s390_regmap_3264): Add orig_r2 register.
(s390_collect_ptrace_register): Handle orig_r2 register.
(s390_supply_ptrace_register): Likewise.
(s390_fill_last_break): New function.
(s390_store_last_break): Likewise.
(s390_fill_system_call): New function.
(s390_store_system_call): Likewise.
(target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
register sets.
(s390_check_regset): New function.
(s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
NT_S390_SYSTEM_CALL regsets and use appropriate description.
Update target_regsets for available register sets.
gdb/ * Makefile.in (XMLFILES): Add library-list-svr4.dtd. * features/library-list-svr4.dtd: New file. * remote.c (PACKET_qXfer_libraries_svr4): New. (remote_protocol_features): new entry for PACKET_qXfer_libraries_svr4. (remote_xfer_partial): Handle TARGET_OBJECT_LIBRARIES_SVR4. * solib-svr4.c (struct svr4_library_list): New. [HAVE_LIBEXPAT]: Include xml-support.h. [HAVE_LIBEXPAT] (svr4_library_list_start_library) [HAVE_LIBEXPAT] (svr4_library_list_start_list, svr4_library_attributes) [HAVE_LIBEXPAT] (svr4_library_list_children) [HAVE_LIBEXPAT] (svr4_library_list_attributes) [HAVE_LIBEXPAT] (svr4_library_list_elements, svr4_parse_libraries) [HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries) [!HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries): New. (svr4_read_so_list): Extend the corruption message by addresses. (svr4_current_sos): New variable library_list, call svr4_current_sos_via_xfer_libraries. * target.h (enum target_object): New TARGET_OBJECT_LIBRARIES_SVR4. gdb/gdbserver/ * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug) (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4): New. (struct linux_target_ops): Install linux_qxfer_libraries_svr4. * linux-low.h (struct process_info_private): New member r_debug. * server.c (handle_qxfer_libraries): Call the_target->qxfer_libraries_svr4. (handle_qxfer_libraries_svr4): New function. (qxfer_packets): New entry "libraries-svr4". (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4. * target.h (struct target_ops): New member qxfer_libraries_svr4. * remote.c (remote_xfer_partial): Call add_packet_config_cmd for PACKET_qXfer_libraries_svr4. gdb/doc/ * gdb.texinfo (Requirements, Remote Protocol): Reference also `Library List Format for SVR4 Targets'. (General Query Packets): New item qXfer:libraries-svr4:read. (Library List Format for SVR4 Targets): New node. gdb/testsuite/ * gdb.base/solib-corrupted.exp: Suppress test on is_remote target. (corrupted list): Adjust the expectation.
2011-12-02 23:26:54 +01:00
2011-12-02 Paul Pluzhnikov <ppluzhnikov@google.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
(read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
New.
(struct linux_target_ops): Install linux_qxfer_libraries_svr4.
* linux-low.h (struct process_info_private): New member r_debug.
* server.c (handle_qxfer_libraries): Call
the_target->qxfer_libraries_svr4.
(handle_qxfer_libraries_svr4): New function.
(qxfer_packets): New entry "libraries-svr4".
(handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
* target.h (struct target_ops): New member qxfer_libraries_svr4.
* remote.c (remote_xfer_partial): Call add_packet_config_cmd for
PACKET_qXfer_libraries_svr4.
2011-11-30 Ulrich Weigand <uweigand@de.ibm.com>
* linux-s390-low.c (s390_collect_ptrace_register): Fully convert
PSW address/mask between 8-byte and 16-byte formats.
(s390_supply_ptrace_register): Likewise.
(s390_get_pc, s390_set_pc): 4-byte PSW address always includes
basic addressing mode bit.
2011-11-24 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
* NEWS: Mention tracepoint additions. * breakpoint.h (struct tracepoint): New field traceframe_usage. * breakpoint.c (print_one_breakpoint_location): Identify tracepoints as such when reporting hit counts, report trace buffer usage. (create_tracepoint_from_upload): Copy status info. * tracepoint.h (struct trace_status): Rename error_desc to stop_desc, add fields user_name, notes, start_time, stop_time. (struct uploaded_tp): Add fields hit_count, traceframe_usage. * tracepoint.c (trace_user): New global. (trace_notes): New global. (trace_stop_notes): New global. (start_tracing): Add argument and trace note handling. (stop_tracing): Ditto. (trace_start_command): Add notes argument. (trace_stop_command): Ditto. (trace_status_command): Report additional status info. (trace_status_mi): Similarly. (trace_save): Update, record tracepoint status. (set_disconnected_tracing): Call target method directly. (send_disconnected_tracing_value): Remove. (set_trace_user): New function. (set_trace_notes): New function. (set_trace_stop_notes): New function. (parse_trace_status): Handle additional status. (parse_tracepoint_status): New function. (parse_tracepoint_definition): Call it. (tfile_get_tracepoint_status): New function. (init_tfile_ops): Use it. (_initialize_tracepoint): Add new setshows. * target.h (struct target_ops): New methods to_get_tracepoint_status and to_set_trace_notes. (target_get_tracepoint_status): New macro. (target_set_trace_notes): New macro. * target.c (update_current_target): Add new methods. * remote.c (remote_get_tracepoint_status): New function. (remote_set_trace_notes): New function. (init_remote_ops): Add them. * mi/mi-main.c (mi_cmd_trace_start): Add argument to call. (mi_cmd_trace_stop): Ditto. * tracepoint.c (struct tracepoint): New field traceframe_usage. (tracing_start_time): New global. (tracing_stop_time): New global. (tracing_user_name): New global. (tracing_notes): New global. (tracing_stop_note): New global. (cmd_qtstart): Set traceframe_usage, start_time. (stop_tracing): Set stop_time. (cmd_qtstatus): Report additional status. (cmd_qtp): New function. (handle_tracepoint_query): Call it. (cmd_qtnotes): New function. (handle_tracepoint_general_set): Call it. (get_timestamp): Rename from tsv_get_timestamp. * gdb.texinfo (Starting and Stopping Trace Experiments): Document note-related options and variables. (Tracepoint Packets): Document packet changes. * gdb.trace/tstatus.exp: New. * gdb.trace/actions.c: Include string.h.
2011-11-21 00:59:49 +01:00
2011-11-17 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (struct tracepoint): New field traceframe_usage.
(tracing_start_time): New global.
(tracing_stop_time): New global.
(tracing_user_name): New global.
(tracing_notes): New global.
(tracing_stop_note): New global.
(cmd_qtstart): Set traceframe_usage, start_time.
(stop_tracing): Set stop_time.
(cmd_qtstatus): Report additional status.
(cmd_qtp): New function.
(handle_tracepoint_query): Call it.
(cmd_qtnotes): New function.
(handle_tracepoint_general_set): Call it.
(get_timestamp): Rename from tsv_get_timestamp.
2011-11-14 Stan Shebs <stan@codesourcery.com> Kwok Cheung Yeung <kcy@codesourcery.com> * NEWS: Document shorter fast tracepoints and qTMinFTPILen packet. * i386-tdep.c (i386_fast_tracepoint_valid_at): Query target for the minimum instruction size for fast tracepoints. * target.h (struct target_ops): Add new method to_get_min_fast_tracepoint_insn_len. (target_get_min_fast_tracepoint_insn_len): New. * target.c (update_current_target): Set up new target operation. * remote.c (remote_write_bytes_aux): Fix typo. (remote_get_min_fast_tracepoint_insn_len): New. (init_remote_ops): Initialize new field. * gdb.texinfo (Create and Delete Tracepoints): Describe what is needed to get shorter fast tracepoints. (Tracepoint Packets): Document new qTMinFTPILen packet. * linux-x86-low.c (small_jump_insn): New. (i386_install_fast_tracepoint_jump_pad): Add arguments for trampoline and error message, build a trampoline and issue a small jump instruction to it. (x86_install_fast_tracepoint_jump_pad): Add arguments for trampoline and error message. (x86_get_min_fast_tracepoint_insn_len): New. (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len. * linux-low.h (struct linux_target_ops): Add arguments to install_fast_tracepoint_jump_pad operation, add new operation. * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add arguments. (linux_get_min_fast_tracepoint_insn_len): New function. (linux_target_op): Add new operation. * tracepoint.c (gdb_trampoline_buffer): New IPA variable. (gdb_trampoline_buffer_end): Ditto. (gdb_trampoline_buffer_error): Ditto. (struct ipa_sym_addresses): Add fields for new IPA variables. (symbol_list): Add entries for new IPA variables. (struct tracepoint): Add fields to hold the address range of the trampoline used by the tracepoint. (trampoline_buffer_head): New static variable. (trampoline_buffer_tail): Ditto. (claim_trampoline_space): New function. (have_fast_tracepoint_trampoline_buffer): New function. (clone_fast_tracepoint): Fill in trampoline fields of tracepoint structure. (install_fast_tracepoint): Ditto, also add error buffer argument. (cmd_qtminftpilen): New function. (handle_tracepoint_query): Add response to qTMinFTPILen packet. (fast_tracepoint_from_trampoline_address): New function. (fast_tracepoint_collecting): Handle trampoline as part of jump pad space. (set_trampoline_buffer_space): New function. (initialize_tracepoint): Initialize new IPA variables. * target.h (struct target_ops): Add arguments to install_fast_tracepoint_jump_pad operation, add new get_min_fast_tracepoint_insn_len operation. (target_get_min_fast_tracepoint_insn_len): New. (install_fast_tracepoint_jump_pad): Add arguments. * server.h (IPA_BUFSIZ): Define. * linux-i386-ipa.c: Include extra header files. (initialize_fast_tracepoint_trampoline_buffer): New function. (initialize_low_tracepoint): Call it. * server.h (set_trampoline_buffer_space): Declare. (claim_trampoline_space): Ditto. (have_fast_tracepoint_trampoline_buffer): Ditto. * gdb.trace/ftrace.c: New. * gdb.trace/ftrace.exp: New.
2011-11-14 21:07:25 +01:00
2011-11-14 Stan Shebs <stan@codesourcery.com>
Kwok Cheung Yeung <kcy@codesourcery.com>
* linux-x86-low.c (small_jump_insn): New.
(i386_install_fast_tracepoint_jump_pad): Add arguments for
trampoline and error message, build a trampoline and issue a small
jump instruction to it.
(x86_install_fast_tracepoint_jump_pad): Add arguments for
trampoline and error message.
(x86_get_min_fast_tracepoint_insn_len): New.
(the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
* linux-low.h (struct linux_target_ops): Add arguments to
install_fast_tracepoint_jump_pad operation, add new operation.
* linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
arguments.
(linux_get_min_fast_tracepoint_insn_len): New function.
(linux_target_op): Add new operation.
* tracepoint.c (gdb_trampoline_buffer): New IPA variable.
(gdb_trampoline_buffer_end): Ditto.
(gdb_trampoline_buffer_error): Ditto.
(struct ipa_sym_addresses): Add fields for new IPA variables.
(symbol_list): Add entries for new IPA variables.
(struct tracepoint): Add fields to hold the address range of the
trampoline used by the tracepoint.
(trampoline_buffer_head): New static variable.
(trampoline_buffer_tail): Ditto.
(claim_trampoline_space): New function.
(have_fast_tracepoint_trampoline_buffer): New function.
(clone_fast_tracepoint): Fill in trampoline fields of tracepoint
structure.
(install_fast_tracepoint): Ditto, also add error buffer argument.
(cmd_qtminftpilen): New function.
(handle_tracepoint_query): Add response to qTMinFTPILen packet.
(fast_tracepoint_from_trampoline_address): New function.
(fast_tracepoint_collecting): Handle trampoline as part of jump
pad space.
(set_trampoline_buffer_space): New function.
(initialize_tracepoint): Initialize new IPA variables.
* target.h (struct target_ops): Add arguments to
install_fast_tracepoint_jump_pad operation, add new
get_min_fast_tracepoint_insn_len operation.
(target_get_min_fast_tracepoint_insn_len): New.
(install_fast_tracepoint_jump_pad): Add arguments.
* server.h (IPA_BUFSIZ): Define.
* linux-i386-ipa.c: Include extra header files.
(initialize_fast_tracepoint_trampoline_buffer): New function.
(initialize_low_tracepoint): Call it.
* server.h (set_trampoline_buffer_space): Declare.
(claim_trampoline_space): Ditto.
(have_fast_tracepoint_trampoline_buffer): Ditto.
gdb/ * remote.c (struct remote_state): <install_in_trace> new field. (PACKET_InstallInTrace): New enum value. (remote_install_in_trace_feature): Support InstallInTrace. (remote_supports_install_in_trace): Likewise. (remote_protocol_features): Likewise. (_initialize_remote): Likewise. (remote_can_download_tracepoint): New. * target.h (struct target): New field `to_can_download_tracepoint'. (target_can_download_tracepoint): New macro. * target.c (update_current_target): Update. * breakpoint.h (struct bp_location): Add comment on field `duplicate'. (should_be_inserted): Don't differentiate breakpoint and tracepoint. (remove_breakpoints): Don't remove tracepoints. (tracepoint_locations_match ): New. (breakpoint_locations_match): Call it. (disable_breakpoints_in_unloaded_shlib): Handle tracepoint. (download_tracepoint_locations): New. (update_global_location_list): Call it. * tracepoint.c (find_matching_tracepoint): Delete. (find_matching_tracepoint_location): Renamed from find_matching_tracepoint. Return bp_location rather than tracepoint. (merge_uploaded_tracepoints): Set `inserted' field to 1 if tracepoint is found. gdb/doc/ * gdb.texinfo (Create and Delete Tracepoints): Describe changed behavior of tracepoint. (General Query Packets): New feature InstallInTrace. (Remote Configuration): Document "set remote install-in-trace-packet". gdb/gdbserver/ * server.c (handle_query): Handle InstallInTrace for qSupported. * tracepoint.c (add_tracepoint): Sort list. (install_tracepoint, download_tracepoint): New. (cmd_qtdp): Call them to install and download tracepoints. (sort_tracepoints): Removed. (cmd_qtstart): Update. gdb/testsuite/ * gdb.trace/change-loc-1.c: New. * gdb.trace/change-loc-2.c: New. * gdb.trace/change-loc.c: New. * gdb.trace/change-loc.exp: New. * gdb.trace/change-loc.h: New. * gdb.trace/trace-break.c (marker): Define new symbol. * gdb.trace/trace-break.exp (break_trace_same_addr_5): New. (break_trace_same_addr_6): New.
2011-11-14 16:18:54 +01:00
2011-11-14 Yao Qi <yao@codesourcery.com>
* server.c (handle_query): Handle InstallInTrace for qSupported.
* tracepoint.c (add_tracepoint): Sort list.
(install_tracepoint, download_tracepoint): New.
(cmd_qtdp): Call them to install and download tracepoints.
(sort_tracepoints): Removed.
(cmd_qtstart): Update.
2011-11-14 Yao Qi <yao@codesourcery.com>
* mem-break.c (inc_ref_fast_tracepoint_jump): New.
* mem-break.h: Declare.
* tracepoint.c (cmd_qtstart): Move some code to ...
(clone_fast_tracepoint, install_fast_tracepoint): ... here.
New.
(download_tracepoints): Move some code to ...
(download_tracepoint_1): ... here. New.
2011-11-08 Yao Qi <yao@codesourcery.com>
* remote-utils.c (relocate_instruction): A comment fix.
2011-11-07 Joel Brobecker <brobecker@adacore.com>
* win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
(i386_dr_low_get_control, i386_dr_low_get_status): Use
dr_status_mirror and dr_control_mirror from debug_reg_state.
(i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
(i386_initial_stuff): Remove use of deleted globals.
(i386_get_thread_context, i386_set_thread_context,
i386_thread_added): Use dr_status_mirror and dr_control_mirror
from debug_reg_state.
2011-11-05 Yao Qi <yao@codesourcery.com>
* tracepoint.c (gdb_collect): Loop over tracepoints of same
address as TPOINT's.
2011-11-02 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (agent_mem_read_string): New function.
(eval_agent_expr): Call it for tracenz.
* server.c (handle_query): Report support for tracenz.
2011-11-02 Yao Qi <yao@codesourcery.com>
* tracepoint.c (cmd_qtstart): Remove unused local variables.
2011-11-02 Yao Qi <yao@codesourcery.com>
* target.h: Fix a typo in comment.
2011-10-31 Pedro Alves <pedro@codesourcery.com>
* mem-break.c (check_mem_write): Add `myaddr' parameter. Don't
clobber the breakpoints' shadows with fast tracepoint jumps.
* mem-break.h (check_mem_write): Add `myaddr' parameter.
* target.c (write_inferior_memory): Also pass MYADDR down to
check_mem_write.
* inferior.h (disable_randomization): Declare. * infrun.c (disable_randomization): New global variable. (show_disable_randomization): New function. (set_disable_randomization): Likewise. (_initialize_infrun): Install set/show disable-randomization commands. * linux-nat.c (disable_randomization): Remove. (show_disable_randomization): Likewise. (set_disable_randomization): Likewise. (_initialize_linux_nat): No longer install set/show disable-randomization commands here. (linux_nat_supports_disable_randomization): New function. (linux_nat_add_target): Install it. * remote.c (PACKET_QDisableRandomization): New enum value. (remote_protocol_packets): Support QDisableRandomization. (_initialize_remote): Likewise. (remote_supports_disable_randomization): New function. (init_remote_ops): Install it. (extended_remote_supports_disable_randomization): New function. (init_extended_remote_ops): Install it. (extended_remote_disable_randomization): New function. (extended_remote_create_inferior_1): Call it. * target.h (struct target_ops): Add to_supports_disable_randomization. (target_supports_disable_randomization): Add prototype. * target.c (target_supports_disable_randomization): New function. (find_default_supports_disable_randomization): Likewise. (init_dummy_target): Install it. doc/ * gdb.texinfo (Starting your Program): "set disable-randomization" is no longer Linux-specific. (Remote Configuration): Document "set remote disable-randomization-packet". (General Query Packets): Document "QDisableRandomization" packet and add it to "qSupported" list. gdbserver/ * configure.ac: Check support for personality routine. * configure: Regenerate. * config.in: Likewise. * linux-low.c: Include <sys/personality.h>. Define ADDR_NO_RANDOMIZE if necessary. (linux_create_inferior): Disable address space randomization when forking inferior, if requested. (linux_supports_disable_randomization): New function. (linux_target_ops): Install it. * server.h (disable_randomization): Declare. * server.c (disable_randomization): New global variable. (handle_general_set): Handle QDisableRandomization. (handle_query): Likewise for qSupported. (main): Support --disable-randomization and --no-disable-randomization command line arguments. * target.h (struct target_ops): Add supports_disable_randomization. (target_supports_disable_randomization): New macro.
2011-10-07 14:06:48 +02:00
2011-10-07 Ulrich Weigand <ulrich.weigand@linaro.org>
* configure.ac: Check support for personality routine.
* configure: Regenerate.
* config.in: Likewise.
* linux-low.c: Include <sys/personality.h>.
Define ADDR_NO_RANDOMIZE if necessary.
(linux_create_inferior): Disable address space randomization when
forking inferior, if requested.
(linux_supports_disable_randomization): New function.
(linux_target_ops): Install it.
* server.h (disable_randomization): Declare.
* server.c (disable_randomization): New global variable.
(handle_general_set): Handle QDisableRandomization.
(handle_query): Likewise for qSupported.
(main): Support --disable-randomization and --no-disable-randomization
command line arguments.
* target.h (struct target_ops): Add supports_disable_randomization.
(target_supports_disable_randomization): New macro.
2011-09-29 Mike Frysinger <vapier@gentoo.org>
* linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
ifdef check.
[PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
[!PT_GETDSBT] (target_loadmap): New definition.
(LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
(linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
and PT_GETDSBT to LINUX_LOADMAP.
[!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
(linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
2011-09-21 18:49:14 +02:00
2011-09-21 Ulrich Weigand <ulrich.weigand@linaro.org>
* linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
(arm_linux_hwbp_cap): New static variable.
(arm_linux_get_hwbp_cap): Replace by ...
(arm_linux_init_hwbp_cap): ... this new function.
(arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
(arm_linux_get_hw_watchpoint_count): Likewise.
(arm_linux_get_hw_watchpoint_max_length): Likewise.
(arm_arch_setup): Call arm_linux_init_hwbp_cap.
(arm_prepare_to_resume): Use perror_with_name instead of error.
2011-09-21 18:49:14 +02:00
2011-09-21 Ulrich Weigand <ulrich.weigand@linaro.org>
* linux-arm-low.c: Include <signal.h>.
(PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
(struct arm_linux_hwbp_cap): New data type.
(arm_hwbp_type, arm_hwbp_control_t): New typedefs.
(struct arm_linux_hw_breakpoint): New data type.
(MAX_BPTS, MAX_WPTS): Define.
(struct arch_process_info, struct arch_lwp_info): New data types.
(arm_linux_get_hwbp_cap): New function.
(arm_linux_get_hw_breakpoint_count): Likewise.
(arm_linux_get_hw_watchpoint_count): Likewise.
(arm_linux_get_hw_watchpoint_max_length): Likewise.
(arm_hwbp_control_initialize): Likewise.
(arm_hwbp_control_is_enabled): Likewise.
(arm_hwbp_control_is_initialized): Likewise.
(arm_hwbp_control_disable): Likewise.
(arm_linux_hw_breakpoint_equal): Likewise.
(arm_linux_hw_point_initialize): Likewise.
(struct update_registers_data): New data structure.
(update_registers_callback: New function.
(arm_insert_point): Likewise.
(arm_remove_point): Likewise.
(arm_stopped_by_watchpoint): Likewise.
(arm_stopped_data_address): Likewise.
(arm_new_process): Likewise.
(arm_new_thread): Likewise.
(arm_prepare_to_resume): Likewise.
(the_low_target): Register arm_insert_point, arm_remove_point,
arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
arm_new_thread, and arm_prepare_to_resume.
2011-09-15 Stan Shebs <stan@codesourcery.com>
* server.h (struct emit_ops): Add compare-goto fields.
* tracepoint.c (gdb_agent_op_sizes): New table.
(emit_eq_goto): New function.
(emit_ne_goto): New function.
(emit_lt_goto): New function.
(emit_le_goto): New function.
(emit_gt_goto): New function.
(emit_ge_goto): New function.
(is_goto_target): New function.
(compile_bytecodes): Recognize special cases of compare-goto
combinations and call specialized emitters for them.
* linux-x86-low.c (amd64_emit_eq_goto): New function.
(amd64_emit_ne_goto): New function.
(amd64_emit_lt_goto): New function.
(amd64_emit_le_goto): New function.
(amd64_emit_gt_goto): New function.
(amd64_emit_ge_goto): New function.
(amd64_emit_ops): Add the new functions.
(i386_emit_eq_goto): New function.
(i386_emit_ne_goto): New function.
(i386_emit_lt_goto): New function.
(i386_emit_le_goto): New function.
(i386_emit_gt_goto): New function.
(i386_emit_ge_goto): New function.
(i386_emit_ops): Add the new functions.
2011-09-08 Stan Shebs <stan@codesourcery.com>
* linux-x86-low.c (i386_emit_prologue): Save %ebx.
(i386_emit_epilogue): Restore %ebx.
2011-08-31 Jie Zhang <jzhang918@gmail.com>
* server.c (step_thread): Remove definition.
(process_serial_event): Don't handle Hs.
* server.h (step_thread): Remove declaration.
* target.c (set_desired_inferior): Remove use of step_thread.
2011-08-24 Luis Machado <lgustavo@codesourcery.com>
* linux-low.c: Include linux-procfs.h.
(linux_attach_lwp_1): Update comments.
(linux_attach): Scan for existing threads when attaching to a
process that is the tgid.
* Makefile.in: Update dependencies.
2011-08-24 Luis Machado <lgustavo@codesourcery.com>
* configure.srv: Add linux-procfs.o dependencies.
2011-08-14 Yao Qi <yao@codesourcery.com>
* target.h (struct target_ops): Fix indent.
* win32-low.c (win32_target_ops): Fix comment.
2011-08-14 Andrew Jenner <andrew@codesourcery.com>
Yao Qi <yao@codesourcery.com>
* Makefile.in (clean): Remove tic6x-*.c files.
(linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
(tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
(tic6x-c64xp-linux.c): Likewise.
* configure.srv: Add support for tic6x-*-uclinux.
* linux-tic6x-low.c: New.
* linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
2011-08-14 Andrew Stubbs <ams@codesourcery.com>
Yao Qi <yao@codesourcery.com>
* target.h (struct target_ops): Add read_loadmap.
* linux-low.c (struct target_loadseg): New type.
(struct target_loadmap): New type.
(linux_read_loadmap): New function.
(linux_target_ops): Add linux_read_loadmap.
* server.c (handle_query): Support qXfer:fdpic:read packet.
2013-02-12 16:18:33 +01:00
* win32-low.c (win32_target_ops): Initialize field `read_loadmap'
to NULL.
2011-08-05 16:21:07 +02:00
2011-08-05 Eli Zaretskii <eliz@gnu.org>
* win32-low.c: Include <stdint.h>.
2011-07-22 Pedro Alves <pedro@codesourcery.com> gdb/testsuite/ * gdb.arch/i386-dr3-watch.exp: Test that the i386 watchpoints backend doesn't leave used debug registers behind. gdb/gdbserver/ * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info to the inferior here. (i386_remove_aligned_watchpoint): Ditto. (i386_handle_nonaligned_watchpoint): Return immediate on fail to fit part of the watchpoint in the debug registers. (i386_update_inferior_debug_regs): New. (i386_low_insert_watchpoint): Work on a local mirror of the debug registers, and only update the inferior on success. (i386_low_remove_watchpoint): Ditto. gdb/ * i386-nat.c (I386_DR_VACANT, I386_DR_LOCAL_ENABLE) (I386_DR_GLOBAL_ENABLE, I386_DR_DISABLE, I386_DR_SET_RW_LEN) (I386_DR_GET_RW_LEN, I386_DR_WATCH_HIT): Add state parameter and adjust. (dr_mirror, dr_status_mirror, dr_control_mirror): Delete. (struct i386_debug_reg_state): New. (i386_init_dregs): New. (dr_mirror): New. (i386_cleanup_dregs): Use i386_init_dregs. (i386_show_dr): Add state parameter and adjust. (i386_insert_aligned_watchpoint): Ditto. Don't pass the info to the inferior here. (i386_remove_aligned_watchpoint): Likewise. (i386_handle_nonaligned_watchpoint): Add state parameter and adjust. (i386_update_inferior_debug_regs): New. (i386_insert_watchpoint): Work on a local mirror of the debug registers, and only update the inferior on success. (i386_remove_watchpoint): Ditto. (i386_region_ok_for_watchpoint): Adjust. (i386_stopped_data_address): Adjust. (i386_insert_hw_breakpoint): Adjust. (i386_remove_hw_breakpoint): Adjust.
2011-07-22 18:58:32 +02:00
2011-07-22 Pedro Alves <pedro@codesourcery.com>
* i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
to the inferior here.
(i386_remove_aligned_watchpoint): Ditto.
(i386_handle_nonaligned_watchpoint): Return immediate on fail to
fit part of the watchpoint in the debug registers.
(i386_update_inferior_debug_regs): New.
(i386_low_insert_watchpoint): Work on a local mirror of the debug
registers, and only update the inferior on success.
(i386_low_remove_watchpoint): Ditto.
2011-07-22 Kwok Cheung Yeung <kcy@codesourcery.com> gdb/ * defs.h: Add guard against inclusion in gdbserver. (struct ptid, ptid_t): Move to common/ptid.h. (xfree, xzalloc, xasprintf, xvasprintf, xstrprintf, xstrvprintf, xsnprintf, internal_error): Move to common/common-utils.h. (nomem): Delete. * gdb_assert.h: Move into common/ sub-directory. * gdb_locale.h: Ditto. * gdb_dirent.h: Ditto. * inferior.h (minus_one_ptid, null_ptid, ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid): Move into common/ptid.h. * xml-support.c (xml_escape_text): Move into common/xml-utils.c. (gdb_xml_create_parser_and_cleanup_1, xml_fetch_context_from_file): Change nomem to malloc_failure. * xml-support.h (xml_escape_text): Move into common/xml-utils.h. * utils.c (nomem): Rename to malloc_failure. (xmalloc, xzalloc, xrealloc, xcalloc, xfree, xstrprintf, xasprintf, xvasprintf, xstrvprintf, xsnprintf): Move to common/common-utils.c. (gdb_buildargv): Change nomem to malloc_failure. * infrun.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid): Move into common/ptid.c. (initialize_infrun): Delete initialization of null_ptid and minus_one_ptid. * linux-nat.c (linux_nat_xfer_osdata): Defer to linux_common_xfer_osdata. * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c, common/ptid.c and common/buffer.c. (HFILES_NO_SRCDIR): Add common/common-utils.h, common/xml-utils.h, common/ptid.h, common/buffer.h and common/linux-osdata.h. (COMMON_OBS): Add xml-utils.o, common-utils.o, buffer.o and ptid.o. (common-utils.o, xml-utils.o, ptid.o, buffer.o, linux-osdata.o): New rules. * common/gdb_assert.h: New. * common/gdb_dirent.h: New. * common/gdb_locale.h: New. * common/buffer.c: New. * common/buffer.h: New. * common/ptid.c: New. * common/ptid.h: New. * common/xml-utils.c: New. * common/xml-utils.h: New. * common/common-utils.c: New. * common/common-utils.h: New. * common/linux-osdata.c: New. * common/linux-osdata.h: New. * config/alpha/alpha-linux.mh (NATDEPFILES): Add linux-osdata.o. * config/arm/linux.mh (NATDEPFILES): Ditto. * config/i386/linux.mh (NATDEPFILES): Ditto. * config/i386/linux64.mh (NATDEPFILES): Ditto. * config/ia64/linux.mh (NATDEPFILES): Ditto. * config/m32r/linux.mh (NATDEPFILES): Ditto. * config/m68k/linux.mh (NATDEPFILES): Ditto. * config/mips/linux.mh (NATDEPFILES): Ditto. * config/pa/linux.mh (NATDEPFILES): Ditto. * config/powerpc/linux.mh (NATDEPFILES): Ditto. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Ditto. * config/s390/s390.mh (NATDEPFILES): Ditto. * config/sparc/linux.mh (NATDEPFILES): Ditto. * config/sparc/linux64.mh (NATDEPFILES): Ditto. * config/xtensa/linux.mh (NATDEPFILES): Ditto. gdbserver/ * linux-low.c (compare_ints, unique, list_threads, show_process, linux_core_of_thread): Delete. (linux_target_ops): Change linux_core_of_thread to linux_common_core_of_thread. (linux_qxfer_osdata): Defer to linux_common_xfer_osdata. * utils.c (malloc_failure): Change type of argument. (xmalloc, xrealloc, xcalloc, xsnprintf): Delete. * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c, common/linux-osdata.c, common/ptid.c and common/buffer.c. (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o. (IPA_OBJS): Add common-utils-ipa.o. (ptid_h, linux_osdata_h): New macros. (server_h): Add common/common-utils.h, common/xml-utils.h, common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and common/ptid.h. (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o): New rules. (linux-low.o): Add common/linux-osdata.h as a dependency. * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets. * configure.ac: Add AC_HEADER_DIRENT check. * config.in: Regenerate. * configure: Regenerate. * remote-utils.c (xml_escape_text): Delete. (buffer_grow, buffer_free, buffer_init, buffer_finish, buffer_xml_printf): Move to common/buffer.c. * server.c (main): Remove call to initialize_inferiors. * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid, ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text, internal_error, gdb_assert, gdb_assert_fail): Delete. (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish, buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to common/buffer.h. * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid, initialize_inferiors): Delete.
2011-07-22 01:46:12 +02:00
2011-07-22 Kwok Cheung Yeung <kcy@codesourcery.com>
* linux-low.c (compare_ints, unique, list_threads, show_process,
linux_core_of_thread): Delete.
(linux_target_ops): Change linux_core_of_thread to
linux_common_core_of_thread.
(linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
* utils.c (malloc_failure): Change type of argument.
(xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
* Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
common/linux-osdata.c, common/ptid.c and common/buffer.c.
(OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
(IPA_OBJS): Add common-utils-ipa.o.
(ptid_h, linux_osdata_h): New macros.
(server_h): Add common/common-utils.h, common/xml-utils.h,
common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
common/ptid.h.
(common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
ptid.o, buffer.o): New rules.
(linux-low.o): Add common/linux-osdata.h as a dependency.
* configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
* configure.ac: Add AC_HEADER_DIRENT check.
* config.in: Regenerate.
* configure: Regenerate.
* remote-utils.c (xml_escape_text): Delete.
(buffer_grow, buffer_free, buffer_init, buffer_finish,
buffer_xml_printf): Move to common/buffer.c.
* server.c (main): Remove call to initialize_inferiors.
* server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
internal_error, gdb_assert, gdb_assert_fail): Delete.
(struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
common/buffer.h.
* inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
initialize_inferiors): Delete.
2011-07-20 Pedro Alves <pedro@codesourcery.com>
* tracepoint.c (tracepoint_look_up_symbols): Return upon the first
symbol error.
2011-05-31 Pedro Alves <pedro@codesourcery.com>
* linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
assertion.
* win32-i386-low.c (i386_dr_low_get_addr): Ditto.
2011-05-26 Yao Qi <yao@codesourcery.com>
* Makefile.in (thread-db.o): Track dependence to
common/gdb_thread_db.h.
* thread-db.c: include gdb_thread_db.h from right place.
2011-05-16 Adrian Cornish <gnu@bluedreamer.com>
* linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
__FILE__ and __LINE__ to internal_error.
2011-05-13 Doug Evans <dje@google.com>
* thread-db.c (try_thread_db_load_from_sdir): New function.
(try_thread_db_load_from_dir): New function.
(thread_db_load_search): Handle $sdir, ignore $pdir.
Remove trying of system directories if search of
libthread-db-search-path fails, that is now done via $sdir.
Add support for enabling and disabling tracepoints while a trace experiment is still running. gdb/ * breakpoint.c (disable_breakpoint): Disable all locations associated with a tracepoint on target if a trace experiment is running. (disable_command): Disable a specific tracepoint location on target if a trace experiment is running. (do_enable_breakpoint): Enable all locations associated with a tracepoint on target if a trace experiment is running. (enable_command) Enable a specific tracepoint location on target if a trace experiment is running. * target.c (update_current_target): Add INHERIT and de_fault clauses for to_supports_enable_disable_tracepoint, to_enable_tracepoint and to_disable_tracepoint. * target.h: Add declaration of struct bp_location. (struct target_ops): Add new functions to_supports_enable_disable_tracepoint, to_enable_tracepoint and to_disable_tracepoint to target operations. (target_supports_enable_disable_tracepoint): New macro. (target_enable_tracepoint): New macro. (target_disable_tracepoint): New macro. * remote.c (struct remote_state): Add new field. (remote_enable_disable_tracepoint_feature): New. (remote_protocol_features): Add new entry. (remote_supports_enable_disable_tracepoint): New. (remote_enable_tracepoint): New. (remote_disable_tracepoint): New. (init_remote_ops): Add remote_enable_tracepoint, remote_disable_tracepoint and remote_supports_enable_disable_tracepoint to remote operations. * tracepoint.c (start_tracing): Allow tracing to start without any tracepoints enabled with just a warning if they can be re-enabled later. * NEWS: Add news item for the new behaviour of the enable and disable GDB commands when applied to tracepoints. Add news items for the new remote packets QTEnable and QTDisable. gdb/doc/ * gdb.texinfo: Document change in the behaviour of the enable and disable GDB commands when applied to tracepoints. Document the EnableDisableTracepoints remote stub feature. Document QTEnable and QTDisable in the list of tracepoint packets. gdb/gdbserver/ * server.c (handle_query): Add EnableDisableTracepoints to the list of supported features. * tracepoint.c (clear_installed_tracepoints): Uninstall disabled tracepoints. (cmd_qtenable_disable): New. (cmd_qtstart): Install tracepoints even if disabled. (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on receiving a QTEnable or QTDisable packet. (gdb_collect): Skip data collection if fast tracepoint is disabled. (ust_marker_to_static_tracepoint): Do not ignore disabled static tracepoints. (gdb_probe): Skip data collection if static tracepoint is disabled.
2011-05-12 14:09:17 +02:00
2011-05-12 Kwok Cheung Yeung <kcy@codesourcery.com>
* server.c (handle_query): Add EnableDisableTracepoints to the list
of supported features.
2013-02-12 16:18:33 +01:00
* tracepoint.c (clear_installed_tracepoints): Uninstall disabled
Add support for enabling and disabling tracepoints while a trace experiment is still running. gdb/ * breakpoint.c (disable_breakpoint): Disable all locations associated with a tracepoint on target if a trace experiment is running. (disable_command): Disable a specific tracepoint location on target if a trace experiment is running. (do_enable_breakpoint): Enable all locations associated with a tracepoint on target if a trace experiment is running. (enable_command) Enable a specific tracepoint location on target if a trace experiment is running. * target.c (update_current_target): Add INHERIT and de_fault clauses for to_supports_enable_disable_tracepoint, to_enable_tracepoint and to_disable_tracepoint. * target.h: Add declaration of struct bp_location. (struct target_ops): Add new functions to_supports_enable_disable_tracepoint, to_enable_tracepoint and to_disable_tracepoint to target operations. (target_supports_enable_disable_tracepoint): New macro. (target_enable_tracepoint): New macro. (target_disable_tracepoint): New macro. * remote.c (struct remote_state): Add new field. (remote_enable_disable_tracepoint_feature): New. (remote_protocol_features): Add new entry. (remote_supports_enable_disable_tracepoint): New. (remote_enable_tracepoint): New. (remote_disable_tracepoint): New. (init_remote_ops): Add remote_enable_tracepoint, remote_disable_tracepoint and remote_supports_enable_disable_tracepoint to remote operations. * tracepoint.c (start_tracing): Allow tracing to start without any tracepoints enabled with just a warning if they can be re-enabled later. * NEWS: Add news item for the new behaviour of the enable and disable GDB commands when applied to tracepoints. Add news items for the new remote packets QTEnable and QTDisable. gdb/doc/ * gdb.texinfo: Document change in the behaviour of the enable and disable GDB commands when applied to tracepoints. Document the EnableDisableTracepoints remote stub feature. Document QTEnable and QTDisable in the list of tracepoint packets. gdb/gdbserver/ * server.c (handle_query): Add EnableDisableTracepoints to the list of supported features. * tracepoint.c (clear_installed_tracepoints): Uninstall disabled tracepoints. (cmd_qtenable_disable): New. (cmd_qtstart): Install tracepoints even if disabled. (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on receiving a QTEnable or QTDisable packet. (gdb_collect): Skip data collection if fast tracepoint is disabled. (ust_marker_to_static_tracepoint): Do not ignore disabled static tracepoints. (gdb_probe): Skip data collection if static tracepoint is disabled.
2011-05-12 14:09:17 +02:00
tracepoints.
2013-02-12 16:18:33 +01:00
(cmd_qtenable_disable): New.
(cmd_qtstart): Install tracepoints even if disabled.
(handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
receiving a QTEnable or QTDisable packet.
(gdb_collect): Skip data collection if fast tracepoint is disabled.
(ust_marker_to_static_tracepoint): Do not ignore disabled static
tracepoints.
(gdb_probe): Skip data collection if static tracepoint is disabled.
Add support for enabling and disabling tracepoints while a trace experiment is still running. gdb/ * breakpoint.c (disable_breakpoint): Disable all locations associated with a tracepoint on target if a trace experiment is running. (disable_command): Disable a specific tracepoint location on target if a trace experiment is running. (do_enable_breakpoint): Enable all locations associated with a tracepoint on target if a trace experiment is running. (enable_command) Enable a specific tracepoint location on target if a trace experiment is running. * target.c (update_current_target): Add INHERIT and de_fault clauses for to_supports_enable_disable_tracepoint, to_enable_tracepoint and to_disable_tracepoint. * target.h: Add declaration of struct bp_location. (struct target_ops): Add new functions to_supports_enable_disable_tracepoint, to_enable_tracepoint and to_disable_tracepoint to target operations. (target_supports_enable_disable_tracepoint): New macro. (target_enable_tracepoint): New macro. (target_disable_tracepoint): New macro. * remote.c (struct remote_state): Add new field. (remote_enable_disable_tracepoint_feature): New. (remote_protocol_features): Add new entry. (remote_supports_enable_disable_tracepoint): New. (remote_enable_tracepoint): New. (remote_disable_tracepoint): New. (init_remote_ops): Add remote_enable_tracepoint, remote_disable_tracepoint and remote_supports_enable_disable_tracepoint to remote operations. * tracepoint.c (start_tracing): Allow tracing to start without any tracepoints enabled with just a warning if they can be re-enabled later. * NEWS: Add news item for the new behaviour of the enable and disable GDB commands when applied to tracepoints. Add news items for the new remote packets QTEnable and QTDisable. gdb/doc/ * gdb.texinfo: Document change in the behaviour of the enable and disable GDB commands when applied to tracepoints. Document the EnableDisableTracepoints remote stub feature. Document QTEnable and QTDisable in the list of tracepoint packets. gdb/gdbserver/ * server.c (handle_query): Add EnableDisableTracepoints to the list of supported features. * tracepoint.c (clear_installed_tracepoints): Uninstall disabled tracepoints. (cmd_qtenable_disable): New. (cmd_qtstart): Install tracepoints even if disabled. (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on receiving a QTEnable or QTDisable packet. (gdb_collect): Skip data collection if fast tracepoint is disabled. (ust_marker_to_static_tracepoint): Do not ignore disabled static tracepoints. (gdb_probe): Skip data collection if static tracepoint is disabled.
2011-05-12 14:09:17 +02:00
2011-05-10 Doug Evans <dje@google.com>
* thread-db.c (thread_db_handle_monitor_command): Handle elided path.
2011-05-04 Doug Evans <dje@google.com>
* linux-low.c (linux_join): Skip process lookup.
* spu-low.c (spu_join): Ditto.
* server.c (join_inferiors_callback): Delete.
(process_serial_event): For 'D' packet (detach) call join_inferior
directly.
2011-05-04 Joseph Myers <joseph@codesourcery.com>
* README: Don't mention xscale*-*-linux*.
* configure.srv (xscale*-*-linux*): Don't handle target.
2011-04-27 Nathan Froyd <froydnj@codesourcery.com>
* linux-x86-low.c (amd64_emit_const): Call memcpy instead of
casting pointers.
(amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
(i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
(i386_emit_void_call_2): Likewise.
2011-04-26 Yao Qi <yao@codesourcery.com>
2013-02-12 16:18:33 +01:00
* linux-low.c: Move common macros to linux-ptrace.h.
Include linux-ptrace.h.
* Makefile.in (linux_ptrace_h): New.
(linux-low.o): Depends on linux-ptrace.h.
2011-04-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
RUN_ONCE. Comment for the LISTEN_DESC delete_file_handler call.
(remote_prepare): New function with most of the TCP code from ...
(remote_open): ... here. Detect PORT here unconditionally. Move also
setting transport_is_reliable.
* server.c (run_once): New variable.
(gdbserver_usage): Document it.
(main): Set run_once for `--once'. Call remote_prepare. Exit after
the first run if RUN_ONCE.
* server.h (run_once, remote_prepare): New declarations.
gdb * windows-tdep.c (windows_xfer_shared_library): * windows-nat.c (get_module_name, windows_make_so): * v850-tdep.c (v850_handle_pushm): * utils.c (null_cleanup, gdb_realpath): * ui-out.c (get_next_header): * tracepoint.c (clear_traceframe_info): * symtab.c (lookup_symtab): * serial.h (struct serial_ops): * mipsread.c (read_alphacoff_dynamic_symtab): * infcmd.c (print_return_value): * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): * f-exp.y (parse_number): * exceptions.c (catch_exceptions): * dummy-frame.c (dummy_frame_this_id): * defs.h (struct cleanup): * breakpoint.c (disable_breakpoints_in_unloaded_shlib): * arm-tdep.c (arm_push_dummy_call): * amd64-tdep.h (amd64_collect_xsave): * amd64-tdep.c (amd64_collect_xsave): * alpha-tdep.c (alpha_heuristic_frame_unwind_cache): * README (typing): Remove duplicate words. * cli/cli-decode.c (lookup_cmd_composition): Add comma. * infrun.c (siginfo_value_read): Fix typo. * solib-frv.c (frv_fdpic_find_global_pointer): Likewise. * top.c (source_line_number): Add comma. gdb/doc * gdbint.texinfo (Register Information Functions): Remove duplicate "the". * gdb.texinfo (Emacs): Remove duplicate "to". (GDB/MI Variable Objects): Remove duplicate "the". (General Query Packets): Likewise. gdb/testsuite * gdb.mi/mi-nsmoribund.exp: * gdb.hp/gdb.objdbg/objdbg01.exp: * gdb.base/structs.exp (test_struct_returns): * gdb.base/call-sc.exp (test_scalar_returns): * gdb.base/bigcore.exp: Remove duplicate words. gdb/gdbserver * win32-low.c (handle_load_dll): Remove duplicate "the".
2011-04-19 20:04:11 +02:00
2011-04-19 Tom Tromey <tromey@redhat.com>
* win32-low.c (handle_load_dll): Remove duplicate "the".
2011-04-07 Pierre Muller <muller@ics.u-strasbg.fr>
Remove support for old Cygwin 1.5 versions.
* win32-low.c (win32_create_inferior): Use new cygwin_path_list
function to avoid warning.
(win32_add_one_solib): Use cygwin_conv_path function to avoid
warning.
2011-03-18 Pierre Muller <muller@ics.u-strasbg.fr>
* gdbserver/server.h (Macro _): Define it if not available.
2011-03-14 Michael Snyder <msnyder@vmware.com>
2011-03-14 22:33:24 +01:00
* hostio.c (handle_close): Remove unnecessary null test.
2011-03-10 Joel Brobecker <brobecker@adacore.com>
* Makefile.in (maintainer-clean realclean distclean): Remove
"make ... subdir_do" command.
2011-03-14 22:33:24 +01:00
2011-03-10 Michael Snyder <msnyder@vmware.com>
* tracepoint.c (tracepoint_finish_step): Fix loop variable.
* server.c (handle_v_run): Free alloced buffer on early return.
2011-03-09 Yao Qi <yao@codesourcery.com>
Revert:
2011-03-04 Yao Qi <yao@codesourcery.com>
* Makefile.in: Remove GNU make feature --directory.
2011-03-05 Yao Qi <yao@codesourcery.com>
* Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
(subdir_do): New make target. Copied from gdb/Makefile.
(maintainer-clean, realclean, distclean, clean): Call corresponding
make targets in common/Makefile.
2011-02-11 Yao Qi <yao@codesourcery.com>
* configure.ac: Call AC_PROG_RANLIB.
* Makefile.in: Remove signals.o from OBS. Link libcommon.a.
* configure: Regenerate.
2011-03-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
2011-03-06 Yao Qi <yao@codesourcery.com>
* Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
2011-03-05 Yao Qi <yao@codesourcery.com>
* Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
(subdir_do): New make target. Copied from gdb/Makefile.
(maintainer-clean, realclean, distclean, clean): Call corresponding
make targets in common/Makefile.
2011-03-04 Yao Qi <yao@codesourcery.com>
* Makefile.in: Remove GNU make feature --directory.
2011-03-14 22:33:24 +01:00
2011-03-04 Michael Snyder <msnyder@vmware.com>
* server.c (queue_stop_reply): Call xmalloc not malloc.
2011-03-02 Michael Snyder <msnyder@vmware.com>
* linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
2011-02-28 Michael Snyder <msnyder@vmware.com>
* tracepoint.c (cmd_qtv): Discard unused value 'packet'.
(cmd_qtframe): Ditto.
(cmd_qtbuffer): Ditto.
(cmd_bigqtbuffer): Ditto.
* utils.c (decimal2str): Initialize 'width' to nine, then
don't mess with it.
2011-02-28 Ulrich Weigand <uweigand@de.ibm.com>
* hostio.c (require_data): Free *data, not data.
2011-02-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* hostio.c (require_data): Use free, not xfree.
2011-02-27 Michael Snyder <msnyder@vmware.com>
* server.c (handle_query): Discard unused value.
* hostio.c (require_data): Free malloc memory before returning
error.
2011-02-26 Michael Snyder <msnyder@vmware.com>
* linux-low.c (list_threads): Call closedir for dirent.
2011-02-27 Michael Snyder <msnyder@vmware.com>
* i386-low.c (i386-length_and_rw_bits): Comment the fact that
a case statement falls through.
* linux-low.c (linux_xfer_siginfo): Fix fencepost error.
* linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
in comparison.
2011-02-26 Michael Snyder <msnyder@vmware.com>
* utils.c (decimal2str): Eliminate dead code and dead param.
(pulongest): Drop dead param from call to decimal2str.
(plongest): Ditto.
2011-02-24 Joel Brobecker <brobecker@adacore.com>
Revert the following patch (not approved yet):
2011-02-21 Hui Zhu <teawater@gmail.com>
* tracepoint.c (tp_printf): New function.
(eval_agent_expr): Handle gdb_agent_op_printf.
2011-02-21 Hui Zhu <teawater@gmail.com>
* tracepoint.c (tp_printf): New function.
(eval_agent_expr): Handle gdb_agent_op_printf.
2011-02-18 Tom Tromey <tromey@redhat.com>
* Makefile.in (tracepoint-ipa.o): Depend on ax.def.
(tracepoint.o): Likewise.
* tracepoint.c (enum gdb_agent_op): Use ax.def.
(gdb_agent_op_names): Likewise.
2011-02-18 Tom Tromey <tromey@redhat.com>
* tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
gdb_agent_op_rot>: New constants.
(gdb_agent_op_names): Add pick and roll.
(eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
cases.
2011-02-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* aclocal.m4: Regenerated with aclocal-1.11.1.
gdb/ * target.h (struct traceframe_info): Forward declare. (enum target_object): Add TARGET_OBJECT_TRACEFRAME_INFO. (struct target_ops) <to_traceframe_info>: New field. (target_traceframe_info): New. * target.c (update_current_target): Inherit and default to_traceframe_info. * remote.c (PACKET_qXfer_traceframe_info): New. (remote_protocol_features): Register qXfer:traceframe-info:read. (remote_xfer_partial): Handle TARGET_OBJECT_TRACEFRAME_INFO. (remote_traceframe_info): New. (init_remote_ops): Install it. (_initialize_remote): Install "set/show remote traceframe-info" commands. * tracepoint.h (parse_traceframe_info): Declare. * tracepoint.c (struct mem_range): New. (mem_range_s): New typedef. (struct traceframe_info): New. (traceframe_info): New global. (free_traceframe_info): New function. (clear_traceframe_info): New function. (start_tracing, tfind_1, set_traceframe_number): Clear traceframe info. (build_traceframe_info): New function. (tfile_traceframe_info): New function. (init_tfile_ops): Install tfile_traceframe_info. (traceframe_info_start_memory, free_result): New functions. (memory_attributes, traceframe_info_elements): New globals. (parse_traceframe_info, get_traceframe_info): New functions. * features/traceframe-info.dtd: New file. * Makefile.in (XMLFILES): Add traceframe-info.dtd. gdb/gdbserver/ * server.c (handle_qxfer_traceframe_info): New. (qxfer_packets): Register "traceframe-info". (handle_query): Report support for qXfer:traceframe-info:read+. * tracepoint.c (match_blocktype): New. (traceframe_find_block_type): Rename to ... (traceframe_walk_blocks): ... this. Add callback filter argument, and use it. (traceframe_find_block_type): New, reimplemented on top of traceframe_walk_blocks. (build_traceframe_info_xml): New. (traceframe_read_info): New. * server.h (traceframe_read_info): Declare. gdb/doc/ * gdb.texinfo (Remote Configuration): Mention set/show remote traceframe-info. (Tools/Packages Optional for Building GDB): Mention that expat is used for traceframe info. (Remote Protocol) <Menu>: Add "Traceframe Info Format". (General Query Packets) <qSupported>: Describe the qXfer:traceframe-info:read feature. (qXfer::read): Describe qXfer:traceframe-info:read. (Traceframe Info Format): New section.
2011-02-14 12:13:12 +01:00
2011-02-14 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_qxfer_traceframe_info): New.
(qxfer_packets): Register "traceframe-info".
(handle_query): Report support for qXfer:traceframe-info:read+.
* tracepoint.c (match_blocktype): New.
(traceframe_find_block_type): Rename to ...
(traceframe_walk_blocks): ... this. Add callback filter argument,
and use it.
(traceframe_find_block_type): New, reimplemented on top of
traceframe_walk_blocks.
(build_traceframe_info_xml): New.
(traceframe_read_info): New.
* server.h (traceframe_read_info): Declare.
2011-02-11 Yao Qi <yao@codesourcery.com>
* configure.ac: Call AC_PROG_RANLIB.
* Makefile.in: Remove signals.o from OBS. Link libcommon.a.
* configure: Regenerate.
2011-02-07 Pedro Alves <pedro@codesourcery.com>
* server.c (gdb_read_memory): Change return semantics to allow
partial transfers.
(handle_search_memory_1): Adjust.
(process_serial_event) <'m' packet>: Handle partial transfers.
* tracepoint.c (traceframe_read_mem): Handle partial transfers.
2011-01-28 Pedro Alves <pedro@codesourcery.com>
* regcache.c (init_register_cache): Initialize
regcache->register_status.
(free_register_cache): Release regcache->register_status.
(regcache_cpy): Copy register_status.
(registers_to_string): Print 'x's for unavailable registers.
(supply_register): Mark the register's status valid or
unavailable, depending on whether a buffer was passed in or not.
(supply_register_zeroed): New.
(supply_regblock): Mark the registers' status valid or
unavailable, depending on whether a buffer was passed in or not.
* regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
(struct regcache): New `register_status' field.
(supply_register_zeroed): Declare.
* i387-fp.c (i387_xsave_to_cache): Zero out registers using
supply_register_zeroed, rather than passing a NULL buffer to
supply_register.
* tracepoint.c (fetch_traceframe_registers): Update comment.
2011-01-28 Pedro Alves <pedro@codesourcery.com>
* i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
buffer explicit.
2011-01-25 Pedro Alves <pedro@codesourcery.com>
* server.h (decode_xfer_write): Change prototype.
* remote-utils.c (decode_xfer_write): Remove `annex' parameter,
and don't extract the annex here.
* server.c (decode_xfer_read): Remove `annex' parameter,
and don't extract the annex here.
(decode_xfer): New.
(struct qxfer): New.
(handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
(handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
(handle_qxfer_statictrace): New functions, abstracted out from
handle_query, and made to use the struct qxfer interface.
(handle_threads_qxfer_proper): Rename to ...
(handle_qxfer_threads_proper): ... this.
(handle_threads_qxfer): Rename to ...
(handle_qxfer_threads): ... this. Adjust.
(qxfer_packets): New array.
(handle_qxfer): New function.
(handle_query): Use handle_qxfer.
2011-01-05 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* gdbreplay.c: Shorten lines of >= 80 columns.
* linux-low.c: Ditto.
* linux-ppc-low.c: Ditto.
* linux-s390-low.c: Ditto.
* linux-sparc-low.c: Ditto.
* linux-x86-low.c: Ditto.
* linux-xtensa-low.c: Ditto.
* mem-break.c: Ditto.
* nto-low.c: Ditto.
* regcache.h: Ditto.
* remote-utils.c: Ditto.
* server.c: Ditto.
* server.h: Ditto.
* thread-db.c: Ditto.
* tracepoint.c: Ditto.
* utils.c: Ditto.
* win32-low.h: Ditto.
2011-01-05 Joel Brobecker <brobecker@adacore.com>
* gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
update.
2011-01-01 Joel Brobecker <brobecker@adacore.com>
* server.c (gdbserver_version): Update copyright year in version
output.
* gdbreplay.c (gdbreplay_version): Ditto.
2010-12-29 Jie Zhang <jie.zhang@analog.com>
* configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
* linux-bfin-low.c: New file.
* linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
PT_DATA_ADDR for BFIN targets.
* Makefile.in (SFILES): Add linux-bfin-low.c.
(clean): Remove reg-bfin.c.
(linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
* README: Mention supported Blackfin targets.
2010-12-23 22:13:24 +01:00
2010-12-23 Mike Frysinger <vapier@gentoo.org>
* .gitignore: New file.
2010-11-16 Mike Frysinger <vapier@gentoo.org>
* linux-low.c (linux_tracefork_child): Add char* cast to arg.
2010-10-22 Jie Zhang <jie@codesourcery.com>
* Makefile.in: Add FLAGS_TO_PASS variable.
(install): Remove dependency of install-only and recursively
invoke make for install-only.
2010-10-04 Doug Evans <dje@google.com>
* Makefile.in (uninstall): Use $(DESTDIR).
2010-09-24 Pedro Alves <pedro@codesourcery.com>
PR gdb/11842
* linux-x86-low.c (compat_siginfo_from_siginfo)
(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
si_code is < 0. Check for si_code == SI_TIMER before checking for
si_code < 0.
2010-09-13 Joel Brobecker <brobecker@adacore.com>
* lynx-i386-low.c: New file.
* configure.srv: Add handling of i[34567]86-*-lynxos* targets.
2010-09-13 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c (ptrace_request_to_str): Remove handling for
request values that have been removed in LynxOS 5.x.
2010-09-13 Joel Brobecker <brobecker@adacore.com>
* lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
<ptrace.h>
2010-09-09 Nathan Sidwell <nathan@codesourcery.com>
* configure.ac: Add --enable-inprocess-agent option.
* configure: Rebuilt.
2010-09-06 Yao Qi <yao@codesourcery.com>
* linux-low.c (linux_kill): Remove unused variable.
(linux_stabilize_threads): Likewise.
* server.c (start_inferior): Likewise.
(queue_stop_reply_callback): Likewise.
* tracepoint.c (do_action_at_tracepoint): Likewise.
2010-09-06 Yao Qi <yao@codesourcery.com>
* linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
on return.
2010-09-06 Jan Kratochvil <jan.kratochvil@redhat.com>
* target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
2010-09-06 Pedro Alves <pedro@codesourcery.com>
* Makefile.in (install-only): Replace $IPA_DEPFILES with
"$(IPA_DEPFILES)".
2010-09-01 Joel Brobecker <brobecker@adacore.com>
* gdbserver/lynx-low.c, gdbserver/lynx-low.h,
gdbserver/lynx-ppc-low.c: New files.
* Makefile.in (lynx_low_h): New variable.
(lynx-low.o, lynx-ppc-low.o): New rules.
* configure.ac: On LynxOS, link with -lnetinet.
* configure.srv: Add handling of powerpc-*-lynxos* targets.
* configure: regenerate.
2010-09-01 Joel Brobecker <brobecker@adacore.com>
* Makefile.in (vasprintf.o, vsnprintf.o): New rules.
* configure.ac: Add check for vasprintf and vsnprintf.
* configure, config.in: Regenerate.
* server.h (vasprintf, vsnprintf): Add conditional declarations.
2010-09-01 Joel Brobecker <brobecker@adacore.com>
* gdbreplay.c: Move include of alloca.h up, next to include of
malloc.h.
* server.h: Add include of malloc.h.
* mem-break.c: Remove include of malloc.h.
* server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
2010-09-01 Joel Brobecker <brobecker@adacore.com>
* Makefile.in (memmem.o): Build with -Wno-error.
2010-09-01 Joel Brobecker <brobecker@adacore.com>
* utils.c (xsnprintf): Make non-static.
* server.h: Add xsnprintf declaration.
* linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
replace calls to snprintf by calls to xsnprintf throughout.
2010-09-01 Joel Brobecker <brobecker@adacore.com>
* configure.ac: Add configure check for alloca.
* configure, config.in: Regenerate.
* server.h: Include alloca.h if it exists.
* gdbreplay.c: Include alloca.h if it exists.
2010-08-28 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (__SIGRTMIN): Define if not already defined.
(linux_create_inferior): Check for __ANDROID__ rather than
__SIGRTMIN.
(enqueue_one_deferred_signal): Don't requeue non-RT signals that
are already deferred.
(linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
(linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
stopped and already has a pending signal to report.
(proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
a pending signal to report or is moving out of a jump pad.
(linux_init_signals): Check for __ANDROID__ rather than
__SIGRTMIN.
2010-08-28 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_stabilize_threads): Wrap debug output in a
debug_threads check. Avoid a linear search when not doing debug
output.
2010-08-27 Pedro Alves <pedro@codesourcery.com>
* event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
(struct gdb_event) <fd>: Change type to gdb_fildes_t.
(struct file_handler) <fd>: Change type to gdb_fildes_t.
(process_event): Change local fd's type to gdb_fildes_t.
(create_file_handler): Adjust prototype.
(delete_file_handler): Adjust prototype.
(handle_file_event): Adjust prototype. Use pfildes.
(create_file_event): Adjsut prototype.
* remote-utils.c (remote_desc, listen_desc): Change type to
gdb_fildes_t.
* server.h: New gdb_fildes_t typedef.
[USE_WIN32API]: Include winsock2.h.
(delete_file_handler, add_file_handler): Adjust prototypes.
(pfildes): Declare.
* utils.c (pfildes): New.
2010-08-27 Pedro Alves <pedro@codesourcery.com>
* configure.ac (build_warnings): Add -Wno-char-subscripts.
* configure: Regenerate.
2010-08-27 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_unprepare_to_access_memory): Rename to ...
(linux_done_accessing_memory): ... this.
(linux_target_ops): Adjust.
* linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
* nto-low.c (nto_target_ops): Adjust comment.
* server.c (gdb_read_memory, gdb_write_memory): Adjust.
* spu-low.c (spu_target_ops): Adjust comment.
* target.h (target_ops): Rename unprepare_to_access_memory field
to done_accessing_memory.
(unprepare_to_access_memory): Rename to ...
(done_accessing_memory): ... this.
2010-08-26 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_prepare_to_access_memory): New.
(linux_unprepare_to_access_memory): New.
(linux_target_ops): Install them.
* server.c (read_memory): Rename to ...
(gdb_read_memory): ... this. Use
prepare_to_access_memory/prepare_to_access_memory.
(write_memory): Rename to ...
(gdb_write_memory): ... this. Use
prepare_to_access_memory/prepare_to_access_memory.
(handle_search_memory_1): Adjust.
(process_serial_event): Adjust.
* target.h (struct target_ops): New fields
prepare_to_access_memory and unprepare_to_access_memory.
(prepare_to_access_memory, unprepare_to_access_memory): New.
* linux-x86-low.c (x86_insert_point, x86_remove_point): Use
prepare_to_access_memory/prepare_to_access_memory.
* nto-low.c (nto_target_ops): Adjust.
* spu-low.c (spu_target_ops): Adjust.
* win32-low.c (win32_target_ops): Adjust.
2010-08-26 Pedro Alves <pedro@codesourcery.com>
* Makefile.in (WARN_CFLAGS): Get it from configure.
(WERROR_CFLAGS): New.
(INTERNAL_CFLAGS): Add WERROR_CFLAGS.
* configure.ac: Introduce --enable-werror, which adds -Werror to
the compiler command line. Enabled by default. Disable with
--disable-werror. Add -Wdeclaration-after-statement
Wpointer-arith and -Wformat-nonliteral to warning flags.
* configure: Regenerate.
2010-08-26 Pedro Alves <pedro@codesourcery.com>
* mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
2010-08-26 Pedro Alves <pedro@codesourcery.com>
* gdbreplay.c (remote_error): New.
(gdbchar): New.
(expect): Use gdbchar. Check for error reading from GDB.
Clarify sync error output.
(play): Check for errors writing to GDB.
* linux-low.c (sigchld_handler): Really ignore `write' errors.
* remote-utils.c (getpkt): Check for errors writing to the remote
descriptor.
2010-08-25 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_wait_1): Move non-debugging code out of
`debug_threads' control.
2010-08-25 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_wait_1): Don't set last_status here.
* server.c (push_event, queue_stop_reply_callback): Assert we're
not pushing a TARGET_WAITKIND_IGNORE event.
(start_inferior, start_inferior, attach_inferior, handle_v_cont)
(myresume, handle_target_event): Set the thread's last_resume_kind
and last_status from the target returned status.
2010-08-25 Pedro Alves <pedro@codesourcery.com>
PR threads/10729
* linux-x86-low.c (update_debug_registers_callback): New.
(i386_dr_low_set_addr): Use it.
(i386_dr_low_get_addr): New.
(i386_dr_low_set_control): Use update_debug_registers_callback.
(i386_dr_low_get_control): New.
(i386_dr_low_get_status): Adjust.
* linux-low.c (linux_stop_lwp): New.
* linux-low.h (linux_stop_lwp): Declare.
* i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
argument instead of a i386_debug_reg_state.
(I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
a i386_debug_reg_state.
(i386_insert_aligned_watchpoint): Adjust.
(i386_remove_aligned_watchpoint): Adjust.
(i386_low_stopped_data_address): Read the debug registers from the
inferior instead of from the mirrors.
* i386-low.h (struct i386_debug_reg_state): Extend comment.
(i386_dr_low_get_addr): Declare.
(i386_dr_low_get_control): Declare.
(i386_dr_low_get_status): Change prototype.
* win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
(i386_dr_low_get_addr): New.
(i386_dr_low_get_control): New.
(i386_dr_low_get_status): Adjust prototype. Return
dr_status_mirror.
(i386_initial_stuff): Clear dr_status_mirror and
dr_control_mirror.
(i386_get_thread_context): Adjust.
(i386_set_thread_context): Adjust.
(i386_thread_added): Adjust.
2010-08-24 Pedro Alves <pedro@codesourcery.com>
* linux-low.h (linux_thread_area): Delete declaration.
2010-08-11 Thomas Schwinge <thomas@codesourcery.com>
* linux-low.c (linux_wait_1): Correctly return the ptid of the child
after its termination.
2010-08-09 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (gdb_wants_lwp_stopped): Delete.
(gdb_wants_all_stopped): Delete.
(linux_wait_1): Don't call them.
* server.c (handle_v_cont): Tag all threads as want-stopped.
(gdb_wants_thread_stopped): Fix comments. Tag the thread that
stopped as "client-wants-stopped".
2010-07-31 Pedro Alves <pedro@codesourcery.com>
* Makefile.in (signals_h): New.
(server_h): Depend on it.
(server.o): Don't depend on $(signals_def).
(signals.o): Depend on $(signals_def).
2010-07-31 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (signals_def): New.
(server_h): Append include/gdb/signals.h and signals_def.
(server.o): Append signals_def.
2010-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* server.c (handle_target_event): Use target_signal_to_host for
resume_info.sig initialization.
* target.h (struct thread_resume) <sig>: New comment.
2010-07-20 Ozkan Sezer <sezeroz@gmail.com>
* server.c (handle_query): strcpy() the returned string from paddress()
instead of sprintf().
* utils.c (paddress): Return phex_nz().
2010-07-07 Joel Brobecker <brobecker@adacore.com>
* server.c (handle_v_cont): Call mourn_inferior if process
just exited.
(myresume): Likewise.
Static tracepoints support, and UST integration. gdb/gdbserver/ * configure.ac: Handle --with-ust. substitute ustlibs and ustinc. * mem-break.c (uninsert_all_breakpoints) (reinsert_all_breakpoints): New. * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints): * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New. (gdb_agent_ust_loaded, helper_thread_id) (gdb_agent_helper_thread_id): New macros. (struct ipa_sym_addresses): Add addr_ust_loaded, addr_helper_thread_id, addr_cmd_buf. (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf. (in_process_agent_loaded_ust): New. (write_e_ust_not_loaded): New. (maybe_write_ipa_ust_not_loaded): New. (struct collect_static_trace_data_action): New. (enum tracepoint_type) <static_tracepoint>: New. (struct tracepoint) <handle>: Mention static tracepoints. (struct static_tracepoint_ctx): New. (CMD_BUF_SIZE): New. (add_tracepoint_action): Handle static tracepoint actions. (unprobe_marker_at): New. (clear_installed_tracepoints): Handle static tracepoints. (cmd_qtdp): Handle static tracepoints. (probe_marker_at): New. (cmd_qtstart): Handle static tracepoints. (response_tracepoint): Handle static tracepoints. (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New. (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat. (get_context_regcache): Handle static tracepoints. (do_action_at_tracepoint): Handle static tracepoint actions. (traceframe_find_block_type): Handle static trace data blocks. (traceframe_read_sdata): New. (download_tracepoints): Download static tracepoint actions. [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h. (GDB_PROBE_NAME): New. (ust_ops): New. (GET_UST_SYM): New. (USTF): New. (dlsym_ust): New. (ust_marker_to_static_tracepoint): New. (gdb_probe): New. (collect_ust_data_at_tracepoint): New. (gdb_ust_probe): New. (UNIX_PATH_MAX, SOCK_DIR): New. (gdb_ust_connect_sync_socket): New. (resume_thread, stop_thread): New. (run_inferior_command): New. (init_named_socket): New. (gdb_ust_socket_init): New. (cstr_to_hexstr): New. (next_st): New. (first_marker, next_marker): New. (response_ust_marker): New. (cmd_qtfstm, cmd_qtsstm): New. (unprobe_marker_at, probe_marker_at): New. (cmd_qtstmat, gdb_ust_thread): New. (gdb_ust_init): New. (initialize_tracepoint_ftlib): Call gdb_ust_init. * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h (ST_REGENTRY): New. (x86_64_st_collect_regmap): New. (X86_64_NUM_ST_COLLECT_GREGS): New. (AMD64_RIP_REGNUM): New. (supply_static_tracepoint_registers): New. * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h (ST_REGENTRY): New. (i386_st_collect_regmap): New. (i386_NUM_ST_COLLECT_GREGS): New. (supply_static_tracepoint_registers): New. * server.c (handle_query): Handle qXfer:statictrace:read. <qSupported>: Report support for StaticTracepoints, and qXfer:statictrace:read features. * server.h (traceframe_read_sdata) (supply_static_tracepoint_registers): Declare. * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex) (unpack_varlen_hex): Include in IPA build. * Makefile.in (ustlibs, ustinc): New. (IPA_OBJS): Add remote-utils-ipa.o. ($(IPA_LIB)): Link -ldl and -lpthread. (UST_CFLAGS): New. (IPAGENT_CFLAGS): Add UST_CFLAGS. * config.in, configure: Regenerate. gdb/ * NEWS: Mention new support for static tracepoints. (New packets): Mention qTfSTM, qTsSTM, qTSTMat and qXfer:statictrace:read. (New features in the GDB remote stub, GDBserver): Mention static tracepoints support using an UST based backend. (New commands): Mention "info static-tracepoint-markers" and "strace". * breakpoint.c (is_marker_spec): New. (is_tracepoint): Handle static tracepoints. (validate_commands_for_breakpoint): Static tracepoints can't do while-stepping. (static_tracepoints_here): New. (bpstat_what): Handle static tracepoints. (print_one_breakpoint_location, allocate_bp_location, mention): Ditto. (create_breakpoint_sal): Ditto. (decode_static_tracepoint_spec): New. (create_breakpoint): Replace `hardwareflag', and `traceflag' with `type_wanted'. Adjust. Handle static tracepoint marker locations. (break_command_1): Adjust. (update_static_tracepoint): New. (update_breakpoint_locations): Handle static tracepoints. (breakpoint_re_set_one): Handle static tracepoint marker locations. (disable_command, enable_command): Handle static tracepoints. (trace_command, ftrace_command): Adjust. (strace_command): New. (create_tracepoint_from_upload): Adjust. (save_breakpoints): Handle static tracepoints. (_initialize_breakpoint): Install the "strace" command. * breakpoint.h (enum bptype): New bp_static_tracepoint type. (struct breakpoint): New fields static_trace_marker_id and static_trace_marker_id_idx. (breakpoints_here_p): Declare. (create_breakpoint): Adjust. (static_tracepoints_here): Declare. * remote.c (struct remote_state) <static_tracepoints>: New field. (PACKET_qXfer_statictrace_read, PACKET_StaticTracepoints): New. (remote_static_tracepoint_marker_at): New. (remote_static_tracepoint_markers_by_strid): New. (remote_static_tracepoint_feature): New. (remote_disconnected_tracing_feature): Handle "StaticTracepoints". (remote_xfer_partial): Handle TARGET_OBJECT_STATIC_TRACE_DATA. (remote_supports_static_tracepoints): New. (remote_download_tracepoint): Download static tracepoints. (init_remote_ops): Install remote_static_tracepoint_marker_at and remote_static_tracepoint_markers_by_strid. (_initialize_remote): Install set|show remote static-tracepoints, and set|show remote read-sdata-object commands. * target.c (update_current_target): Inherit and default to_static_tracepoint_marker_at, and to_static_tracepoint_markers_by_strid. * target.h (static_tracepoint_marker): Forward declare. (enum target_object): New object TARGET_OBJECT_STATIC_TRACE_DATA. (static_tracepoint_marker_p): New typedef. (DEF_VEC_P(static_tracepoint_marker_p)): New VEC type. (struct target_ops): New fields to_static_tracepoint_marker_at and to_static_tracepoint_markers_by_strid. (target_static_tracepoint_marker_at) (target_static_tracepoint_markers_by_strid): New. * tracepoint.c: Include source.h. (validate_actionline): Handle $_sdata. (struct collection_list): New field strace_data. (add_static_trace_data): New. (clear_collection_list): Clear strace_data. (stringify_collection_list): Account for a possible static trace data collection. (encode_actions_1): Encode an $_sdata collection. (parse_tracepoint_definition): Handle static tracepoints. (parse_static_tracepoint_marker_definition): New. (release_static_tracepoint_marker): New. (print_one_static_tracepoint_marker): New. (info_static_tracepoint_markers_command): New. (sdata_make_value): New. (_initialize_tracepoint): Create the $_sdata convenience variable. Add the "info static-tracepoint-markers" command. Mention $_sdata in the "collect" command's help output. * tracepoint.h (struct static_tracepoint_marker): New. (parse_static_tracepoint_marker_definition) (release_static_tracepoint_marker): Declare. * mi/mi-cmd-break.c (mi_cmd_break_insert): Adjust. * python/py-breakpoint.c (bppy_new): Adjust. doc/ * gdb.texinfo (Convenience Variables): Document $_sdata. (Commands to Set Tracepoints): Describe static tracepoints. Add `Listing Static Tracepoint Markers' menu entry. Document "strace". (Tracepoint Action Lists): Document collecting $_sdata. (Listing Static Tracepoint Markers): New subsection. (Tracepoints support in gdbserver): Mention static tracepoints. (remote packets, enabling and disabling): Mention read-sdata-object. (General Query Packets) <qSupported>: Document qXfer:sdata:read and StaticTracepoint. Mention qTfSTM, qTsSTM and qTSTMat as tracepoint packets. Document qXfer:sdata:read. (Tracepoint packets): Document qTfSTM, qTsSTM and qTSTMat.
2010-07-01 12:36:12 +02:00
2010-07-01 Pedro Alves <pedro@codesourcery.com>
Static tracepoints, and integration with UST.
* configure.ac: Handle --with-ust. substitute ustlibs and ustinc.
* mem-break.c (uninsert_all_breakpoints)
(reinsert_all_breakpoints): New.
* mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
* tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
(gdb_agent_ust_loaded, helper_thread_id)
(gdb_agent_helper_thread_id): New macros.
(struct ipa_sym_addresses): Add addr_ust_loaded,
addr_helper_thread_id, addr_cmd_buf.
(symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
(in_process_agent_loaded_ust): New.
(write_e_ust_not_loaded): New.
(maybe_write_ipa_ust_not_loaded): New.
(struct collect_static_trace_data_action): New.
(enum tracepoint_type) <static_tracepoint>: New.
(struct tracepoint) <handle>: Mention static tracepoints.
(struct static_tracepoint_ctx): New.
(CMD_BUF_SIZE): New.
(add_tracepoint_action): Handle static tracepoint actions.
(unprobe_marker_at): New.
(clear_installed_tracepoints): Handle static tracepoints.
(cmd_qtdp): Handle static tracepoints.
(probe_marker_at): New.
(cmd_qtstart): Handle static tracepoints.
(response_tracepoint): Handle static tracepoints.
(cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
(handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
(get_context_regcache): Handle static tracepoints.
(do_action_at_tracepoint): Handle static tracepoint actions.
(traceframe_find_block_type): Handle static trace data blocks.
(traceframe_read_sdata): New.
(download_tracepoints): Download static tracepoint actions.
[HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
(GDB_PROBE_NAME): New.
(ust_ops): New.
(GET_UST_SYM): New.
(USTF): New.
(dlsym_ust): New.
(ust_marker_to_static_tracepoint): New.
(gdb_probe): New.
(collect_ust_data_at_tracepoint): New.
(gdb_ust_probe): New.
(UNIX_PATH_MAX, SOCK_DIR): New.
(gdb_ust_connect_sync_socket): New.
(resume_thread, stop_thread): New.
(run_inferior_command): New.
(init_named_socket): New.
(gdb_ust_socket_init): New.
(cstr_to_hexstr): New.
(next_st): New.
(first_marker, next_marker): New.
(response_ust_marker): New.
(cmd_qtfstm, cmd_qtsstm): New.
(unprobe_marker_at, probe_marker_at): New.
(cmd_qtstmat, gdb_ust_thread): New.
(gdb_ust_init): New.
(initialize_tracepoint_ftlib): Call gdb_ust_init.
* linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
(ST_REGENTRY): New.
(x86_64_st_collect_regmap): New.
(X86_64_NUM_ST_COLLECT_GREGS): New.
(AMD64_RIP_REGNUM): New.
(supply_static_tracepoint_registers): New.
* linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
(ST_REGENTRY): New.
(i386_st_collect_regmap): New.
(i386_NUM_ST_COLLECT_GREGS): New.
(supply_static_tracepoint_registers): New.
* server.c (handle_query): Handle qXfer:statictrace:read.
<qSupported>: Report support for StaticTracepoints, and
qXfer:statictrace:read features.
* server.h (traceframe_read_sdata)
(supply_static_tracepoint_registers): Declare.
* remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
(unpack_varlen_hex): Include in IPA build.
* Makefile.in (ustlibs, ustinc): New.
(IPA_OBJS): Add remote-utils-ipa.o.
($(IPA_LIB)): Link -ldl and -lpthread.
(UST_CFLAGS): New.
(IPAGENT_CFLAGS): Add UST_CFLAGS.
* config.in, configure: Regenerate.
2010-06-20 Ian Lance Taylor <iant@google.com>
Pedro Alves <pedro@codesourcery.com>
* linux-x86-low.c (always_true): Delete.
(EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
trying to fool the compiler with always_true.
2010-06-20 Pedro Alves <pedro@codesourcery.com>
* tracepoint.c (condition_true_at_tracepoint): Don't run compiled
conditions in gdbserver.
2010-06-19 Ulrich Weigand <uweigand@de.ibm.com>
* spu-low.c (spu_read_memory): Wrap around local store limit.
(spu_write_memory): Likewise.
2010-06-15 Pedro Alves <pedro@codesourcery.com>
* linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
(i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
LONGEST uses.
* server.h (struct emit_ops): Replace int64_t uses with LONGEST
uses.
* tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
uses with LONGEST uses.
gdb/ 2010-06-14 Pedro Alves <pedro@codesourcery.com> * NEWS: Mention GDBserver's JIT compilation of tracepoint bytecode. gdb/gdbserver/ 2010-06-14 Stan Shebs <stan@codesourcery.com> Pedro Alves <pedro@codesourcery.com> Bytecode compiler. * linux-x86-low.c: Include limits.h. (add_insns): New. (always_true): New. (EMIT_ASM): New. (EMIT_ASM32): New. (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add) (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh) (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext, (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or) (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal, (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref, (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address) (amd64_emit_const, amd64_emit_call, amd64_emit_reg) (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext) (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1) (amd64_emit_void_call_2): New. (amd64_emit_ops): New. (i386_emit_prologue, i386_emit_epilogue, i386_emit_add) (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed) (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not) (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor) (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed) (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto) (i386_emit_goto, i386_write_goto_address, i386_emit_const) (i386_emit_call, i386_emit_reg, i386_emit_pop) (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap) (i386_emit_stack_adjust, i386_emit_int_call_1) (i386_emit_void_call_2): New. (i386_emit_ops): New. (x86_emit_ops): New. (the_low_target): Install x86_emit_ops. * server.h (struct emit_ops): New. (get_raw_reg_func_addr): Declare. (current_insn_ptr, emit_error): Declare. * tracepoint.c (get_raw_reg, get_trace_state_variable_value) (set_trace_state_variable_value): New defines. (struct ipa_sym_addresses): New fields addr_get_raw_reg, addr_get_trace_state_variable_value and addr_set_trace_state_variable_value. (symbol_list): New fields for get_raw_reg, get_trace_state_variable_value and set_trace_state_variable_value. (condfn): New typedef. (struct tracepoint): New field `compiled_cond'. (do_action_at_tracepoint): Clear compiled_cond. (get_trace_state_variable_value, set_trace_state_variable_value): Export in the IPA. (condition_true_at_tracepoint): If there's a compiled condition, run that. (current_insn_ptr, emit_error): New globals. (struct bytecode_address): New. (get_raw_reg_func_addr): New. (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul) (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext) (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor) (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned) (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const) (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap) (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New. (compile_tracepoint_condition, compile_bytecodes): New. * target.h (emit_ops): Forward declare. (struct target_ops): New field emit_ops. (target_emit_ops): New. * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New. * linux-i386-ipa.c (gdb_agent_get_raw_reg): New. * linux-low.c (linux_emit_ops): New. (linux_target_ops): Install it. * linux-low.h (struct linux_target_ops): New field emit_ops.
2010-06-15 00:16:09 +02:00
2010-06-14 Stan Shebs <stan@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
Bytecode compiler.
* linux-x86-low.c: Include limits.h.
(add_insns): New.
(always_true): New.
(EMIT_ASM): New.
(EMIT_ASM32): New.
(amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
(amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
(amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
(amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
(amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
(amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
(amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
(amd64_emit_const, amd64_emit_call, amd64_emit_reg)
(amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
(amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
(amd64_emit_void_call_2): New.
(amd64_emit_ops): New.
(i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
(i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
(i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
(i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
(i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
(i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
(i386_emit_goto, i386_write_goto_address, i386_emit_const)
(i386_emit_call, i386_emit_reg, i386_emit_pop)
(i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
(i386_emit_stack_adjust, i386_emit_int_call_1)
(i386_emit_void_call_2): New.
(i386_emit_ops): New.
(x86_emit_ops): New.
(the_low_target): Install x86_emit_ops.
* server.h (struct emit_ops): New.
(get_raw_reg_func_addr): Declare.
(current_insn_ptr, emit_error): Declare.
* tracepoint.c (get_raw_reg, get_trace_state_variable_value)
(set_trace_state_variable_value): New defines.
(struct ipa_sym_addresses): New fields addr_get_raw_reg,
addr_get_trace_state_variable_value and
addr_set_trace_state_variable_value.
(symbol_list): New fields for get_raw_reg,
get_trace_state_variable_value and set_trace_state_variable_value.
(condfn): New typedef.
(struct tracepoint): New field `compiled_cond'.
(do_action_at_tracepoint): Clear compiled_cond.
(get_trace_state_variable_value, set_trace_state_variable_value):
Export in the IPA.
(condition_true_at_tracepoint): If there's a compiled condition,
run that.
(current_insn_ptr, emit_error): New globals.
(struct bytecode_address): New.
(get_raw_reg_func_addr): New.
(emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
(emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
(emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
(emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
(emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
(emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
(emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
(compile_tracepoint_condition, compile_bytecodes): New.
* target.h (emit_ops): Forward declare.
(struct target_ops): New field emit_ops.
(target_emit_ops): New.
* linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
* linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
* linux-low.c (linux_emit_ops): New.
(linux_target_ops): Install it.
* linux-low.h (struct linux_target_ops): New field emit_ops.
2010-06-14 Ulrich Weigand <uweigand@de.ibm.com>
* linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
* linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
gdb/gdbserver/ 2010-06-01 Pedro Alves <pedro@codesourcery.com> Stan Shebs <stan@codesourcery.com> * Makefile.in (IPA_DEPFILES, extra_libraries): New. (all): Depend on $(extra_libraries). (install-only): Install the IPA. (IPA_OBJS, IPA_LIB): New. (clean): Remove the IPA lib. (IPAGENT_CFLAGS): New. (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o) (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o) (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules. * linux-amd64-ipa.c, linux-i386-ipa.c: New files. * configure.ac: Check for atomic builtins support in the compiler. (IPA_DEPFILES, extra_libraries): Define. * configure.srv (ipa_obj): Add description. (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define. (i[34567]86-*-linux*): Set ipa_obj. (x86_64-*-linux*): Set ipa_obj. * linux-low.c (stabilizing_threads): New. (supports_fast_tracepoints): New. (linux_detach): Stabilize threads before detaching. (handle_tracepoints): Handle internal tracing breakpoints. Assert the lwp is either not stabilizing, or is moving out of a jump pad. (linux_fast_tracepoint_collecting): New. (maybe_move_out_of_jump_pad): New. (enqueue_one_deferred_signal): New. (dequeue_one_deferred_signal): New. (linux_wait_for_event_1): If moving out of a jump pad, defer pending signals to later. (linux_stabilize_threads): New. (linux_wait_1): Check if threads need moving out of jump pads, and do it if so. (stuck_in_jump_pad_callback): New. (move_out_of_jump_pad_callback): New. (lwp_running): New. (linux_resume_one_lwp): Handle moving out of jump pads. (linux_set_resume_request): Dequeue deferred signals. (need_step_over_p): Also step over fast tracepoint jumps. (start_step_over): Also uninsert fast tracepoint jumps. (finish_step_over): Also reinsert fast tracepoint jumps. (linux_install_fast_tracepoint_jump): New. (linux_target_ops): Install linux_stabilize_threads and linux_install_fast_tracepoint_jump_pad. * linux-low.h (linux_target_ops) <get_thread_area, install_fast_tracepoint_jump_pad>: New fields. (struct lwp_info) <collecting_fast_tracepoint, pending_signals_to_report, exit_jump_pad_bkpt>: New fields. (linux_get_thread_area): Declare. * linux-x86-low.c (jump_insn): New. (x86_get_thread_area): New. (append_insns): New. (push_opcode): New. (amd64_install_fast_tracepoint_jump_pad): New. (i386_install_fast_tracepoint_jump_pad): New. (x86_install_fast_tracepoint_jump_pad): New. (the_low_target): Install x86_get_thread_area and x86_install_fast_tracepoint_jump_pad. * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory. (struct fast_tracepoint_jump): New. (fast_tracepoint_jump_insn): New. (fast_tracepoint_jump_shadow): New. (find_fast_tracepoint_jump_at): New. (fast_tracepoint_jump_here): New. (delete_fast_tracepoint_jump): New. (set_fast_tracepoint_jump): New. (uninsert_fast_tracepoint_jumps_at): New. (reinsert_fast_tracepoint_jumps_at): New. (set_breakpoint_at): Use write_inferior_memory. (uninsert_raw_breakpoint): Use write_inferior_memory. (check_mem_read): Mask out fast tracepoint jumps. (check_mem_write): Mask out fast tracepoint jumps. * mem-break.h (struct fast_tracepoint_jump): Forward declare. (set_fast_tracepoint_jump): Declare. (delete_fast_tracepoint_jump) (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at) (reinsert_fast_tracepoint_jumps_at): Declare. * regcache.c: Don't compile many functions when building the in-process agent library. (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating the register buffer in the heap. (free_register_cache): If the register buffer isn't owned by the regcache, don't free it. (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate pre-existing register caches. * remote-utils.c (convert_int_to_ascii): Constify `from' parameter type. (convert_ascii_to_int): : Constify `from' parameter type. (decode_M_packet, decode_X_packet): Replace the `to' parameter by a `to_p' pointer to pointer parameter. If TO_P is NULL, malloc the needed buffer in-place. (relocate_instruction): New. * server.c (handle_query) <qSymbols>: If the target supports tracepoints, give it a chance of looking up symbols. Report support for fast tracepoints. (handle_status): Stabilize threads. (process_serial_event): Adjust. * server.h (struct fast_tracepoint_jump): Forward declare. (struct process_info) <fast_tracepoint_jumps>: New field. (convert_ascii_to_int, convert_int_to_ascii): Adjust. (decode_X_packet, decode_M_packet): Adjust. (relocate_instruction): Declare. (in_process_agent_loaded): Declare. (tracepoint_look_up_symbols): Declare. (struct fast_tpoint_collect_status): Declare. (fast_tracepoint_collecting): Declare. (force_unlock_trace_buffer): Declare. (handle_tracepoint_bkpts): Declare. (initialize_low_tracepoint) (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare. * target.h (struct target_ops) <stabilize_threads, install_fast_tracepoint_jump_pad>: New fields. (stabilize_threads, install_fast_tracepoint_jump_pad): New. * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h. [HAVE_STDINT_H]: Include stdint.h. (trace_debug_1): Rename to ... (trace_vdebug): ... this. (trace_debug): Rename to ... (trace_debug_1): ... this. Add `level' parameter. (trace_debug): New. (ATTR_USED, ATTR_NOINLINE): New. (IP_AGENT_EXPORT): New. (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) (collecting, gdb_collect, stop_tracing, flush_trace_buffer) (about_to_request_buffer_space, trace_buffer_is_full) (stopping_tracepoint, expr_eval_result, error_tracepoint) (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr) (trace_buffer_lo, trace_buffer_hi, traceframe_read_count) (traceframe_write_count, traceframes_created) (trace_state_variables) New renaming defines. (struct ipa_sym_addresses): New. (STRINGIZE_1, STRINGIZE, IPA_SYM): New. (symbol_list): New. (ipa_sym_addrs): New. (all_tracepoint_symbols_looked_up): New. (in_process_agent_loaded): New. (write_e_ipa_not_loaded): New. (maybe_write_ipa_not_loaded): New. (tracepoint_look_up_symbols): New. (debug_threads) [IN_PROCESS_AGENT]: New. (read_inferior_memory) [IN_PROCESS_AGENT]: New. (UNKNOWN_SIDE_EFFECTS): New. (stop_tracing): New. (flush_trace_buffer): New. (stop_tracing_bkpt): New. (flush_trace_buffer_bkpt): New. (read_inferior_integer): New. (read_inferior_uinteger): New. (read_inferior_data_pointer): New. (write_inferior_data_pointer): New. (write_inferior_integer): New. (write_inferior_uinteger): New. (struct collect_static_trace_data_action): Delete. (enum tracepoint_type): New. (struct tracepoint) <type>: New field `type'. <actions_str, step_actions, step_actions_str>: Only include in GDBserver. <orig_size, obj_addr_on_target, adjusted_insn_addr> <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields. (tracepoints): Use IP_AGENT_EXPORT. (last_tracepoint): Don't include in the IPA. (stopping_tracepoint): Use IP_AGENT_EXPORT. (trace_buffer_is_full): Use IP_AGENT_EXPORT. (alloced_trace_state_variables): New. (trace_state_variables): Use IP_AGENT_EXPORT. (traceframe_t): Delete unused variable. (circular_trace_buffer): Don't include in the IPA. (trace_buffer_start): Delete. (struct trace_buffer_control): New. (trace_buffer_free): Delete. (struct ipa_trace_buffer_control): New. (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV) (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT): New. (trace_buffer_ctrl): New. (TRACE_BUFFER_CTRL_CURR): New. (trace_buffer_start, trace_buffer_free, trace_buffer_end_free): Reimplement as macros. (trace_buffer_wrap): Delete. (traceframe_write_count, traceframe_read_count) (traceframes_created, tracing): Use IP_AGENT_EXPORT. (struct tracepoint_hit_ctx) <type>: New field. (struct fast_tracepoint_ctx): New. (memory_barrier): New. (cmpxchg): New. (record_tracepoint_error): Update atomically in the IPA. (clear_inferior_trace_buffer): New. (about_to_request_buffer_space): New. (trace_buffer_alloc): Handle GDBserver and inferior simulatenous updating the same buffer. (add_tracepoint): Default the tracepoint's type to trap tracepoint, and orig_size to -1. (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated internal variables. (create_trace_state_variable): New parameter `gdb'. Handle it. (clear_installed_tracepoints): Clear fast tracepoint jumps. (cmd_qtdp): Handle fast tracepoints. (cmd_qtdv): Adjust. (max_jump_pad_size): New. (gdb_jump_pad_head): New. (get_jump_space_head): New. (claim_jump_space): New. (sort_tracepoints): New. (MAX_JUMP_SIZE): New. (cmd_qtstart): Handle fast tracepoints. Sync tracepoints with the IPA. (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected support. Upload fast traceframes, and delete internal IPA breakpoints. (stop_tracing_handler): New. (flush_trace_buffer_handler): New. (cmd_qtstop): Upload fast tracepoints. (response_tracepoint): Handle fast tracepoints. (tracepoint_finished_step): Upload fast traceframes. Set the tracepoint hit context's tracepoint type. (handle_tracepoint_bkpts): New. (tracepoint_was_hit): Set the tracepoint hit context's tracepoint type. Add comment about fast tracepoints. (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the non-existing action_str field. (get_context_regcache): Handle fast tracepoints. (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC to the regcache. (fast_tracepoint_from_jump_pad_address): New. (fast_tracepoint_from_ipa_tpoint_address): New. (collecting_t): New. (force_unlock_trace_buffer): New. (fast_tracepoint_collecting): New. (collecting): New. (gdb_collect): New. (write_inferior_data_ptr): New. (target_tp_heap): New. (target_malloc): New. (download_agent_expr): New. (UALIGN): New. (download_tracepoints): New. (download_trace_state_variables): New. (upload_fast_traceframes): New. (IPA_FIRST_TRACEFRAME): New. (IPA_NEXT_TRACEFRAME_1): New. (IPA_NEXT_TRACEFRAME): New. [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h. [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer) (gdb_jump_pad_buffer_end): New. [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New. (initialize_tracepoint): Adjust. [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch buffer. Initialize the low module. * utils.c (PREFIX, TOOLNAME): New. (malloc_failure): Use PREFIX. (error): In the IPA, an error causes an exit. (fatal, warning): Use PREFIX. (internal_error): Use TOOLNAME. (NUMCELLS): Increase to 10. * configure, config.in: Regenerate. gdb/ 2010-06-01 Pedro Alves <pedro@codesourcery.com> * NEWS: Mention gdbserver fast tracepoints support. gdb/doc/ 2010-06-01 Pedro Alves <pedro@codesourcery.com> * gdb.texinfo (Set Tracepoints): Mention tracepoints support in gdbserver, and add cross reference. (Tracepoints support in gdbserver): New subsection.
2010-06-01 15:20:52 +02:00
2010-06-01 Pedro Alves <pedro@codesourcery.com>
Stan Shebs <stan@codesourcery.com>
* Makefile.in (IPA_DEPFILES, extra_libraries): New.
(all): Depend on $(extra_libraries).
(install-only): Install the IPA.
(IPA_OBJS, IPA_LIB): New.
(clean): Remove the IPA lib.
(IPAGENT_CFLAGS): New.
(tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
(regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
(linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
* linux-amd64-ipa.c, linux-i386-ipa.c: New files.
* configure.ac: Check for atomic builtins support in the compiler.
(IPA_DEPFILES, extra_libraries): Define.
* configure.srv (ipa_obj): Add description.
(ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
(i[34567]86-*-linux*): Set ipa_obj.
(x86_64-*-linux*): Set ipa_obj.
* linux-low.c (stabilizing_threads): New.
(supports_fast_tracepoints): New.
(linux_detach): Stabilize threads before detaching.
(handle_tracepoints): Handle internal tracing breakpoints. Assert
the lwp is either not stabilizing, or is moving out of a jump pad.
(linux_fast_tracepoint_collecting): New.
(maybe_move_out_of_jump_pad): New.
(enqueue_one_deferred_signal): New.
(dequeue_one_deferred_signal): New.
(linux_wait_for_event_1): If moving out of a jump pad, defer
pending signals to later.
(linux_stabilize_threads): New.
(linux_wait_1): Check if threads need moving out of jump pads, and
do it if so.
(stuck_in_jump_pad_callback): New.
(move_out_of_jump_pad_callback): New.
(lwp_running): New.
(linux_resume_one_lwp): Handle moving out of jump pads.
(linux_set_resume_request): Dequeue deferred signals.
(need_step_over_p): Also step over fast tracepoint jumps.
(start_step_over): Also uninsert fast tracepoint jumps.
(finish_step_over): Also reinsert fast tracepoint jumps.
(linux_install_fast_tracepoint_jump): New.
(linux_target_ops): Install linux_stabilize_threads and
linux_install_fast_tracepoint_jump_pad.
* linux-low.h (linux_target_ops) <get_thread_area,
install_fast_tracepoint_jump_pad>: New fields.
(struct lwp_info) <collecting_fast_tracepoint,
pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
(linux_get_thread_area): Declare.
* linux-x86-low.c (jump_insn): New.
(x86_get_thread_area): New.
(append_insns): New.
(push_opcode): New.
(amd64_install_fast_tracepoint_jump_pad): New.
(i386_install_fast_tracepoint_jump_pad): New.
(x86_install_fast_tracepoint_jump_pad): New.
(the_low_target): Install x86_get_thread_area and
x86_install_fast_tracepoint_jump_pad.
* mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
(struct fast_tracepoint_jump): New.
(fast_tracepoint_jump_insn): New.
(fast_tracepoint_jump_shadow): New.
(find_fast_tracepoint_jump_at): New.
(fast_tracepoint_jump_here): New.
(delete_fast_tracepoint_jump): New.
(set_fast_tracepoint_jump): New.
(uninsert_fast_tracepoint_jumps_at): New.
(reinsert_fast_tracepoint_jumps_at): New.
(set_breakpoint_at): Use write_inferior_memory.
(uninsert_raw_breakpoint): Use write_inferior_memory.
(check_mem_read): Mask out fast tracepoint jumps.
(check_mem_write): Mask out fast tracepoint jumps.
* mem-break.h (struct fast_tracepoint_jump): Forward declare.
(set_fast_tracepoint_jump): Declare.
(delete_fast_tracepoint_jump)
(fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
(reinsert_fast_tracepoint_jumps_at): Declare.
* regcache.c: Don't compile many functions when building the
in-process agent library.
(init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
the register buffer in the heap.
(free_register_cache): If the register buffer isn't owned by the
regcache, don't free it.
(set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
pre-existing register caches.
* remote-utils.c (convert_int_to_ascii): Constify `from' parameter
type.
(convert_ascii_to_int): : Constify `from' parameter type.
(decode_M_packet, decode_X_packet): Replace the `to' parameter by
a `to_p' pointer to pointer parameter. If TO_P is NULL, malloc
the needed buffer in-place.
(relocate_instruction): New.
* server.c (handle_query) <qSymbols>: If the target supports
tracepoints, give it a chance of looking up symbols. Report
support for fast tracepoints.
(handle_status): Stabilize threads.
(process_serial_event): Adjust.
* server.h (struct fast_tracepoint_jump): Forward declare.
(struct process_info) <fast_tracepoint_jumps>: New field.
(convert_ascii_to_int, convert_int_to_ascii): Adjust.
(decode_X_packet, decode_M_packet): Adjust.
(relocate_instruction): Declare.
(in_process_agent_loaded): Declare.
(tracepoint_look_up_symbols): Declare.
(struct fast_tpoint_collect_status): Declare.
(fast_tracepoint_collecting): Declare.
(force_unlock_trace_buffer): Declare.
(handle_tracepoint_bkpts): Declare.
(initialize_low_tracepoint)
(supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
* target.h (struct target_ops) <stabilize_threads,
install_fast_tracepoint_jump_pad>: New fields.
(stabilize_threads, install_fast_tracepoint_jump_pad): New.
* tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
[HAVE_STDINT_H]: Include stdint.h.
(trace_debug_1): Rename to ...
(trace_vdebug): ... this.
(trace_debug): Rename to ...
(trace_debug_1): ... this. Add `level' parameter.
(trace_debug): New.
(ATTR_USED, ATTR_NOINLINE): New.
(IP_AGENT_EXPORT): New.
(gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
(collecting, gdb_collect, stop_tracing, flush_trace_buffer)
(about_to_request_buffer_space, trace_buffer_is_full)
(stopping_tracepoint, expr_eval_result, error_tracepoint)
(tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
(trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
(traceframe_write_count, traceframes_created)
(trace_state_variables)
New renaming defines.
(struct ipa_sym_addresses): New.
(STRINGIZE_1, STRINGIZE, IPA_SYM): New.
(symbol_list): New.
(ipa_sym_addrs): New.
(all_tracepoint_symbols_looked_up): New.
(in_process_agent_loaded): New.
(write_e_ipa_not_loaded): New.
(maybe_write_ipa_not_loaded): New.
(tracepoint_look_up_symbols): New.
(debug_threads) [IN_PROCESS_AGENT]: New.
(read_inferior_memory) [IN_PROCESS_AGENT]: New.
(UNKNOWN_SIDE_EFFECTS): New.
(stop_tracing): New.
(flush_trace_buffer): New.
(stop_tracing_bkpt): New.
(flush_trace_buffer_bkpt): New.
(read_inferior_integer): New.
(read_inferior_uinteger): New.
(read_inferior_data_pointer): New.
(write_inferior_data_pointer): New.
(write_inferior_integer): New.
(write_inferior_uinteger): New.
(struct collect_static_trace_data_action): Delete.
(enum tracepoint_type): New.
(struct tracepoint) <type>: New field `type'.
2013-02-12 16:18:33 +01:00
<actions_str, step_actions, step_actions_str>: Only include in
GDBserver.
gdb/gdbserver/ 2010-06-01 Pedro Alves <pedro@codesourcery.com> Stan Shebs <stan@codesourcery.com> * Makefile.in (IPA_DEPFILES, extra_libraries): New. (all): Depend on $(extra_libraries). (install-only): Install the IPA. (IPA_OBJS, IPA_LIB): New. (clean): Remove the IPA lib. (IPAGENT_CFLAGS): New. (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o) (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o) (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules. * linux-amd64-ipa.c, linux-i386-ipa.c: New files. * configure.ac: Check for atomic builtins support in the compiler. (IPA_DEPFILES, extra_libraries): Define. * configure.srv (ipa_obj): Add description. (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define. (i[34567]86-*-linux*): Set ipa_obj. (x86_64-*-linux*): Set ipa_obj. * linux-low.c (stabilizing_threads): New. (supports_fast_tracepoints): New. (linux_detach): Stabilize threads before detaching. (handle_tracepoints): Handle internal tracing breakpoints. Assert the lwp is either not stabilizing, or is moving out of a jump pad. (linux_fast_tracepoint_collecting): New. (maybe_move_out_of_jump_pad): New. (enqueue_one_deferred_signal): New. (dequeue_one_deferred_signal): New. (linux_wait_for_event_1): If moving out of a jump pad, defer pending signals to later. (linux_stabilize_threads): New. (linux_wait_1): Check if threads need moving out of jump pads, and do it if so. (stuck_in_jump_pad_callback): New. (move_out_of_jump_pad_callback): New. (lwp_running): New. (linux_resume_one_lwp): Handle moving out of jump pads. (linux_set_resume_request): Dequeue deferred signals. (need_step_over_p): Also step over fast tracepoint jumps. (start_step_over): Also uninsert fast tracepoint jumps. (finish_step_over): Also reinsert fast tracepoint jumps. (linux_install_fast_tracepoint_jump): New. (linux_target_ops): Install linux_stabilize_threads and linux_install_fast_tracepoint_jump_pad. * linux-low.h (linux_target_ops) <get_thread_area, install_fast_tracepoint_jump_pad>: New fields. (struct lwp_info) <collecting_fast_tracepoint, pending_signals_to_report, exit_jump_pad_bkpt>: New fields. (linux_get_thread_area): Declare. * linux-x86-low.c (jump_insn): New. (x86_get_thread_area): New. (append_insns): New. (push_opcode): New. (amd64_install_fast_tracepoint_jump_pad): New. (i386_install_fast_tracepoint_jump_pad): New. (x86_install_fast_tracepoint_jump_pad): New. (the_low_target): Install x86_get_thread_area and x86_install_fast_tracepoint_jump_pad. * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory. (struct fast_tracepoint_jump): New. (fast_tracepoint_jump_insn): New. (fast_tracepoint_jump_shadow): New. (find_fast_tracepoint_jump_at): New. (fast_tracepoint_jump_here): New. (delete_fast_tracepoint_jump): New. (set_fast_tracepoint_jump): New. (uninsert_fast_tracepoint_jumps_at): New. (reinsert_fast_tracepoint_jumps_at): New. (set_breakpoint_at): Use write_inferior_memory. (uninsert_raw_breakpoint): Use write_inferior_memory. (check_mem_read): Mask out fast tracepoint jumps. (check_mem_write): Mask out fast tracepoint jumps. * mem-break.h (struct fast_tracepoint_jump): Forward declare. (set_fast_tracepoint_jump): Declare. (delete_fast_tracepoint_jump) (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at) (reinsert_fast_tracepoint_jumps_at): Declare. * regcache.c: Don't compile many functions when building the in-process agent library. (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating the register buffer in the heap. (free_register_cache): If the register buffer isn't owned by the regcache, don't free it. (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate pre-existing register caches. * remote-utils.c (convert_int_to_ascii): Constify `from' parameter type. (convert_ascii_to_int): : Constify `from' parameter type. (decode_M_packet, decode_X_packet): Replace the `to' parameter by a `to_p' pointer to pointer parameter. If TO_P is NULL, malloc the needed buffer in-place. (relocate_instruction): New. * server.c (handle_query) <qSymbols>: If the target supports tracepoints, give it a chance of looking up symbols. Report support for fast tracepoints. (handle_status): Stabilize threads. (process_serial_event): Adjust. * server.h (struct fast_tracepoint_jump): Forward declare. (struct process_info) <fast_tracepoint_jumps>: New field. (convert_ascii_to_int, convert_int_to_ascii): Adjust. (decode_X_packet, decode_M_packet): Adjust. (relocate_instruction): Declare. (in_process_agent_loaded): Declare. (tracepoint_look_up_symbols): Declare. (struct fast_tpoint_collect_status): Declare. (fast_tracepoint_collecting): Declare. (force_unlock_trace_buffer): Declare. (handle_tracepoint_bkpts): Declare. (initialize_low_tracepoint) (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare. * target.h (struct target_ops) <stabilize_threads, install_fast_tracepoint_jump_pad>: New fields. (stabilize_threads, install_fast_tracepoint_jump_pad): New. * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h. [HAVE_STDINT_H]: Include stdint.h. (trace_debug_1): Rename to ... (trace_vdebug): ... this. (trace_debug): Rename to ... (trace_debug_1): ... this. Add `level' parameter. (trace_debug): New. (ATTR_USED, ATTR_NOINLINE): New. (IP_AGENT_EXPORT): New. (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) (collecting, gdb_collect, stop_tracing, flush_trace_buffer) (about_to_request_buffer_space, trace_buffer_is_full) (stopping_tracepoint, expr_eval_result, error_tracepoint) (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr) (trace_buffer_lo, trace_buffer_hi, traceframe_read_count) (traceframe_write_count, traceframes_created) (trace_state_variables) New renaming defines. (struct ipa_sym_addresses): New. (STRINGIZE_1, STRINGIZE, IPA_SYM): New. (symbol_list): New. (ipa_sym_addrs): New. (all_tracepoint_symbols_looked_up): New. (in_process_agent_loaded): New. (write_e_ipa_not_loaded): New. (maybe_write_ipa_not_loaded): New. (tracepoint_look_up_symbols): New. (debug_threads) [IN_PROCESS_AGENT]: New. (read_inferior_memory) [IN_PROCESS_AGENT]: New. (UNKNOWN_SIDE_EFFECTS): New. (stop_tracing): New. (flush_trace_buffer): New. (stop_tracing_bkpt): New. (flush_trace_buffer_bkpt): New. (read_inferior_integer): New. (read_inferior_uinteger): New. (read_inferior_data_pointer): New. (write_inferior_data_pointer): New. (write_inferior_integer): New. (write_inferior_uinteger): New. (struct collect_static_trace_data_action): Delete. (enum tracepoint_type): New. (struct tracepoint) <type>: New field `type'. <actions_str, step_actions, step_actions_str>: Only include in GDBserver. <orig_size, obj_addr_on_target, adjusted_insn_addr> <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields. (tracepoints): Use IP_AGENT_EXPORT. (last_tracepoint): Don't include in the IPA. (stopping_tracepoint): Use IP_AGENT_EXPORT. (trace_buffer_is_full): Use IP_AGENT_EXPORT. (alloced_trace_state_variables): New. (trace_state_variables): Use IP_AGENT_EXPORT. (traceframe_t): Delete unused variable. (circular_trace_buffer): Don't include in the IPA. (trace_buffer_start): Delete. (struct trace_buffer_control): New. (trace_buffer_free): Delete. (struct ipa_trace_buffer_control): New. (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV) (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT): New. (trace_buffer_ctrl): New. (TRACE_BUFFER_CTRL_CURR): New. (trace_buffer_start, trace_buffer_free, trace_buffer_end_free): Reimplement as macros. (trace_buffer_wrap): Delete. (traceframe_write_count, traceframe_read_count) (traceframes_created, tracing): Use IP_AGENT_EXPORT. (struct tracepoint_hit_ctx) <type>: New field. (struct fast_tracepoint_ctx): New. (memory_barrier): New. (cmpxchg): New. (record_tracepoint_error): Update atomically in the IPA. (clear_inferior_trace_buffer): New. (about_to_request_buffer_space): New. (trace_buffer_alloc): Handle GDBserver and inferior simulatenous updating the same buffer. (add_tracepoint): Default the tracepoint's type to trap tracepoint, and orig_size to -1. (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated internal variables. (create_trace_state_variable): New parameter `gdb'. Handle it. (clear_installed_tracepoints): Clear fast tracepoint jumps. (cmd_qtdp): Handle fast tracepoints. (cmd_qtdv): Adjust. (max_jump_pad_size): New. (gdb_jump_pad_head): New. (get_jump_space_head): New. (claim_jump_space): New. (sort_tracepoints): New. (MAX_JUMP_SIZE): New. (cmd_qtstart): Handle fast tracepoints. Sync tracepoints with the IPA. (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected support. Upload fast traceframes, and delete internal IPA breakpoints. (stop_tracing_handler): New. (flush_trace_buffer_handler): New. (cmd_qtstop): Upload fast tracepoints. (response_tracepoint): Handle fast tracepoints. (tracepoint_finished_step): Upload fast traceframes. Set the tracepoint hit context's tracepoint type. (handle_tracepoint_bkpts): New. (tracepoint_was_hit): Set the tracepoint hit context's tracepoint type. Add comment about fast tracepoints. (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the non-existing action_str field. (get_context_regcache): Handle fast tracepoints. (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC to the regcache. (fast_tracepoint_from_jump_pad_address): New. (fast_tracepoint_from_ipa_tpoint_address): New. (collecting_t): New. (force_unlock_trace_buffer): New. (fast_tracepoint_collecting): New. (collecting): New. (gdb_collect): New. (write_inferior_data_ptr): New. (target_tp_heap): New. (target_malloc): New. (download_agent_expr): New. (UALIGN): New. (download_tracepoints): New. (download_trace_state_variables): New. (upload_fast_traceframes): New. (IPA_FIRST_TRACEFRAME): New. (IPA_NEXT_TRACEFRAME_1): New. (IPA_NEXT_TRACEFRAME): New. [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h. [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer) (gdb_jump_pad_buffer_end): New. [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New. (initialize_tracepoint): Adjust. [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch buffer. Initialize the low module. * utils.c (PREFIX, TOOLNAME): New. (malloc_failure): Use PREFIX. (error): In the IPA, an error causes an exit. (fatal, warning): Use PREFIX. (internal_error): Use TOOLNAME. (NUMCELLS): Increase to 10. * configure, config.in: Regenerate. gdb/ 2010-06-01 Pedro Alves <pedro@codesourcery.com> * NEWS: Mention gdbserver fast tracepoints support. gdb/doc/ 2010-06-01 Pedro Alves <pedro@codesourcery.com> * gdb.texinfo (Set Tracepoints): Mention tracepoints support in gdbserver, and add cross reference. (Tracepoints support in gdbserver): New subsection.
2010-06-01 15:20:52 +02:00
<orig_size, obj_addr_on_target, adjusted_insn_addr>
<adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
(tracepoints): Use IP_AGENT_EXPORT.
(last_tracepoint): Don't include in the IPA.
(stopping_tracepoint): Use IP_AGENT_EXPORT.
(trace_buffer_is_full): Use IP_AGENT_EXPORT.
(alloced_trace_state_variables): New.
(trace_state_variables): Use IP_AGENT_EXPORT.
(traceframe_t): Delete unused variable.
(circular_trace_buffer): Don't include in the IPA.
(trace_buffer_start): Delete.
(struct trace_buffer_control): New.
(trace_buffer_free): Delete.
(struct ipa_trace_buffer_control): New.
(GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
(GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
New.
(trace_buffer_ctrl): New.
(TRACE_BUFFER_CTRL_CURR): New.
(trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
Reimplement as macros.
(trace_buffer_wrap): Delete.
(traceframe_write_count, traceframe_read_count)
(traceframes_created, tracing): Use IP_AGENT_EXPORT.
(struct tracepoint_hit_ctx) <type>: New field.
(struct fast_tracepoint_ctx): New.
(memory_barrier): New.
(cmpxchg): New.
(record_tracepoint_error): Update atomically in the IPA.
(clear_inferior_trace_buffer): New.
(about_to_request_buffer_space): New.
(trace_buffer_alloc): Handle GDBserver and inferior simulatenous
updating the same buffer.
(add_tracepoint): Default the tracepoint's type to trap
tracepoint, and orig_size to -1.
(get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
internal variables.
(create_trace_state_variable): New parameter `gdb'. Handle it.
(clear_installed_tracepoints): Clear fast tracepoint jumps.
(cmd_qtdp): Handle fast tracepoints.
(cmd_qtdv): Adjust.
(max_jump_pad_size): New.
(gdb_jump_pad_head): New.
(get_jump_space_head): New.
(claim_jump_space): New.
(sort_tracepoints): New.
(MAX_JUMP_SIZE): New.
(cmd_qtstart): Handle fast tracepoints. Sync tracepoints with the
IPA.
(stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
support. Upload fast traceframes, and delete internal IPA
breakpoints.
(stop_tracing_handler): New.
(flush_trace_buffer_handler): New.
(cmd_qtstop): Upload fast tracepoints.
(response_tracepoint): Handle fast tracepoints.
(tracepoint_finished_step): Upload fast traceframes. Set the
tracepoint hit context's tracepoint type.
(handle_tracepoint_bkpts): New.
(tracepoint_was_hit): Set the tracepoint hit context's tracepoint
type. Add comment about fast tracepoints.
(collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
non-existing action_str field.
(get_context_regcache): Handle fast tracepoints.
(do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
to the regcache.
(fast_tracepoint_from_jump_pad_address): New.
(fast_tracepoint_from_ipa_tpoint_address): New.
(collecting_t): New.
(force_unlock_trace_buffer): New.
(fast_tracepoint_collecting): New.
(collecting): New.
(gdb_collect): New.
(write_inferior_data_ptr): New.
(target_tp_heap): New.
(target_malloc): New.
(download_agent_expr): New.
(UALIGN): New.
(download_tracepoints): New.
(download_trace_state_variables): New.
(upload_fast_traceframes): New.
(IPA_FIRST_TRACEFRAME): New.
(IPA_NEXT_TRACEFRAME_1): New.
(IPA_NEXT_TRACEFRAME): New.
[IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
[IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
(gdb_jump_pad_buffer_end): New.
[IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
(initialize_tracepoint): Adjust.
[IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
buffer. Initialize the low module.
* utils.c (PREFIX, TOOLNAME): New.
(malloc_failure): Use PREFIX.
(error): In the IPA, an error causes an exit.
(fatal, warning): Use PREFIX.
(internal_error): Use TOOLNAME.
(NUMCELLS): Increase to 10.
* configure, config.in: Regenerate.
2010-06-01 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_query) <qSupported>: Do two passes over the
qSupported string to avoid nesting strtok.
2010-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
(CDEPS): New.
* configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping. Test also
-Wl,--dynamic-list.
* configure: Regenerate.
* proc-service.list: New.
2010-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
New comment.
2010-05-26 Ozkan Sezer <sezeroz@gmail.com>
* gdbreplay.c (remote_open): Check error return from socket() call by
its equality to -1 not by it being negative.
* remote-utils.c (remote_open): Likewise.
2010-05-23 11:22:56 +02:00
2010-05-23 Pedro Alves <pedro@codesourcery.com>
* config.h: Regenerate.
2010-05-19 Maxim Kuvyrkov <maxim@codesourcery.com>
* linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
doesn't provide PTRACE_GET_THREAD_AREA.
2010-05-19 Maxim Kuvyrkov <maxim@codesourcery.com>
* linux-m68k-low.c: Include <asm/ptrace.h>
(ps_get_thread_area): Implement.
2010-05-03 Doug Evans <dje@google.com>
* event-loop.c (struct callback_event): New struct.
(callback_list): New global.
(append_callback_event, delete_callback_event): New functions.
(process_callback): New function.
(start_event_loop): Call it.
* remote-utils.c (NOT_SCHEDULED): Define.
(readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
moved out of readchar.
(readchar): Rewrite. Call reschedule before returning.
(reset_readchar): New function.
(remote_close): Call it.
(process_remaining, reschedule): New functions.
* server.h (callback_handler_func): New typedef.
(append_callback_event, delete_callback_event): Declare.
2010-05-03 Pedro Alves <pedro@codesourcery.com>
* proc-service.c (ps_pglobal_lookup): Use
thread_db_look_up_one_symbol.
* remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
parameter. Use it instead of all_symbols_looked_up.
* server.h (struct process_info) <all_symbols_looked_up>: Delete
field.
(all_symbols_looked_up): Don't declare.
(look_up_one_symbol): Add new `may_ask_gdb' parameter.
* thread-db.c (struct thread_db) <all_symbols_looked_up>: New
field.
(thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
Set all_symbols_looked_up here.
(thread_db_look_up_one_symbol): New.
(thread_db_get_tls_address): Adjust.
(thread_db_load_search, try_thread_db_load_1): Always allocate the
thread_db object on the heap, and tentatively set it in the
process structure.
(thread_db_init): Don't set all_symbols_looked_up here.
* linux-low.h (thread_db_look_up_one_symbol): Declare.
* linux-low.c (linux_kill, linux_detach): Adjust. (status_pending_p_callback): Remove redundant statement. Check for !TARGET_WAITIKIND_IGNORE, instead of TARGET_WAITKIND_STOPPED. (handle_tracepoints): Make sure LWP is locked. Adjust. (linux_wait_for_event_1): Adjust. (linux_cancel_breakpoints): New. (unsuspend_one_lwp): New. (unsuspend_all_lwps): New. (linux_wait_1): If finishing a step-over, unsuspend all lwps. (send_sigstop_callback): Change return type to int, add new `except' parameter and handle it. (suspend_and_send_sigstop_callback): New. (stop_all_lwps): Add new `suspend' and `expect' parameters, and pass them down. If SUSPEND, also increment the lwp's suspend count. (linux_resume_one_lwp): Add notice about resuming a suspended LWP. (need_step_over_p): Don't consider suspended LWPs. (start_step_over): Adjust. (proceed_one_lwp): Change return type to int, add new `except' parameter and handle it. (unsuspend_and_proceed_one_lwp): New. (proceed_all_lwps): Use find_inferior instead of for_each_inferior. (unstop_all_lwps): Add `unsuspend' parameter. If UNSUSPEND, them also decrement the suspend count of LWPs. Pass `except' down, instead of hacking its suspend count. (linux_pause_all): Add `freeze' parameter. Adjust. (linux_unpause_all): New. (linux_target_ops): Install linux_unpause_all. * server.c (handle_status): Adjust. * target.h (struct target_ops): New fields `unpause_all' and `cancel_breakpoints'. Add new parameter to `pause_all'. (pause_all): Add new `freeze' parameter. (unpause_all): New. (cancel_breakpoints): New. * tracepoint.c (clear_installed_tracepoints): Pause threads, and cancel breakpoints. (cmd_qtstart): Pause threads. (stop_tracing): Pause threads, and cancel breakpoints. * win32-low.c (win32_target_ops): Adjust.
2010-05-03 06:02:20 +02:00
2010-05-03 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_kill, linux_detach): Adjust.
(status_pending_p_callback): Remove redundant statement. Check
for !TARGET_WAITIKIND_IGNORE, instead of
TARGET_WAITKIND_STOPPED.
(handle_tracepoints): Make sure LWP is locked. Adjust.
(linux_wait_for_event_1): Adjust.
(linux_cancel_breakpoints): New.
(unsuspend_one_lwp): New.
(unsuspend_all_lwps): New.
(linux_wait_1): If finishing a step-over, unsuspend all lwps.
(send_sigstop_callback): Change return type to int, add new
`except' parameter and handle it.
(suspend_and_send_sigstop_callback): New.
(stop_all_lwps): Add new `suspend' and `expect' parameters, and
pass them down. If SUSPEND, also increment the lwp's suspend
count.
(linux_resume_one_lwp): Add notice about resuming a suspended LWP.
(need_step_over_p): Don't consider suspended LWPs.
(start_step_over): Adjust.
(proceed_one_lwp): Change return type to int, add new `except'
parameter and handle it.
(unsuspend_and_proceed_one_lwp): New.
(proceed_all_lwps): Use find_inferior instead of
for_each_inferior.
(unstop_all_lwps): Add `unsuspend' parameter. If UNSUSPEND, them
also decrement the suspend count of LWPs. Pass `except' down,
instead of hacking its suspend count.
(linux_pause_all): Add `freeze' parameter. Adjust.
(linux_unpause_all): New.
(linux_target_ops): Install linux_unpause_all.
* server.c (handle_status): Adjust.
* target.h (struct target_ops): New fields `unpause_all' and
`cancel_breakpoints'. Add new parameter to `pause_all'.
(pause_all): Add new `freeze' parameter.
(unpause_all): New.
(cancel_breakpoints): New.
* tracepoint.c (clear_installed_tracepoints): Pause threads, and
cancel breakpoints.
(cmd_qtstart): Pause threads.
(stop_tracing): Pause threads, and cancel breakpoints.
* win32-low.c (win32_target_ops): Adjust.
2010-05-03 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_wait_for_event_1): Move passing the signal to
the inferior right away from here...
(linux_wait_1): ... to here, and adjust to check the thread's
last_resume_kind instead of the lwp's step or stop_expected flags.
2010-05-02 Pedro Alves <pedro@codesourcery.com>
* README: Use consistent `GDB' and `GDBserver' spellings.
2010-05-02 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
(linux_kill): Stop all lwps here. Don't delete the main lwp here.
(linux_detach_one_lwp): Assume the lwp is stopped.
(any_thread_of): Delete.
(linux_detach): Stop all lwps here. Don't blindly delete all
breakpoints.
(delete_lwp_callback): New.
(linux_mourn): Delete all lwps of the process that is gone.
(linux_wait_1): Don't delete the last lwp of the process here.
* mem-break.h (mark_breakpoints_out): Declare.
* mem-break.c (mark_breakpoints_out): New.
(free_all_breakpoints): Use it.
* server.c (handle_target_event): If the process is gone, mark
breakpoints out.
* thread-db.c (struct thread_db) <create_bp>: New field.
(thread_db_enable_reporting): Fix prototype. Store a thread event
breakpoint reference in the thread_db struct.
(thread_db_load_search): Clear the thread_db object.
(try_thread_db_load_1): Ditto.
(switch_to_process): New.
(disable_thread_event_reporting): Use it.
(remove_thread_event_breakpoints): New.
(thread_db_detach, thread_db_mourn): Use it.
2010-05-01 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_enable_event_reporting): New.
(linux_wait_for_event_1, handle_extended_wait): Use it.
2010-04-30 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_kill_one_lwp, linux_kill)
(linux_detach_one_lwp): Adjust to send_sigstop interface change.
(send_sigstop): Take an lwp_info as parameter instead. Queue a
SIGSTOP even if the LWP is stopped.
(send_sigstop_callback): New.
(stop_all_lwps): Use send_sigstop_callback instead.
(linux_resume_one_thread): Adjust.
(proceed_one_lwp): Still proceed an LWP that the client has
requested to stop, if we haven't reported it as stopped yet. Make
sure that LWPs the client want stopped, have a pending SIGSTOP.
2010-04-26 Doug Evans <dje@google.com>
* server.c (handle_general_set): Make static.
* remote-utils.c (putpkt_binary_1): Call readchar instead of read.
Print received char after testing for error/eof instead of before.
(input_interrupt): Tweak comment.
2010-04-23 Doug Evans <dje@google.com>
* server.c (start_inferior): Print inferior argv if --debug.
2010-04-21 Aleksandar Ristovski <aristovski@qnx.com>
* Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
* nto-x86-low.c: Include server.h
2010-04-20 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
be consistent with other sources of this directory.
(init_registers_amd64): Correct name of source file of this function
in the comment.
2010-04-19 Pierre Muller <muller@ics.u-strasbg.fr>
* configure.srv (x86_64-*-mingw*): New configuration for Windows
64-bit executables.
2010-04-19 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-i386-low.c: Add 64-bit support.
(CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
(init_registers_amd64): Declare.
(mappings): Add 64-bit version of array.
(init_windows_x86): New function.
(the_low_target): Change init_arch field to init_windows_x86.
2010-04-19 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-low.c: Adapt to support also 64-bit architecture.
(child_xfer_memory): Use uintptr_t type for local variable `addr'.
(get_image_name): Use SIZE_T type for local variable `done'.
(psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
(toolhelp_get_dll_name): Idem.
(handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
Use uintptr_t typecast to avoid warning.
(handle_unload_dll): Use uintptr_t typecast to avoid warning.
(handle_exception): Use phex_nz to avoid warning.
(win32_wait): Remove unused local variable `process'.
2010-04-19 Pierre Muller <muller@ics.u-strasbg.fr>
* configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
`amd64-avx.o'.
2010-04-17 Pierre Muller <muller@ics.u-strasbg.fr>
* configure.ac: Use `ws2_32' library for srv_mingw.
* configure: Regenerate.
* gdbreplay.c: Include winsock2.h instead of winsock.h.
* remote-utils.c: Likewise.
2010-04-17 H.J. Lu <hongjiu.lu@intel.com>
* linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
if __x86_64__ is defined.
2010-04-16 18:22:15 +02:00
2010-04-16 Pierre Muller <muller@ics.u-strasbg.fr>
* configure: Regenerate.
Support for Windows OS Thread Information Block. * NEWS: Document new feature. * remote.c (PACKET_qGetTIBAddr): New enum element. (remote_get_tib_address): New function. (init_remote_ops): Set to_get_tib_address field to remote_get_tib_address. (_initialize_remote): Add add_packet_config_cmd for PACKET_qGetTIBAddr. * target.c (update_current_target): Set default value for new to_get_tib_address field. * target.h (target_ops): New field to_get_tib_address. (target_get_tib_address): New macro. * windows-nat.c (thread_info): Add thread_local_base field. (windows_add_thread): Add tlb argument of type 'void *'. (fake_create_process): Adapt windows_add_thread call. (get_windows_debug_event): Idem. (windows_get_tib_address): New function. (init_windows_ops): Set to_get_tib_address field to remote_get_tib_address. (_initialize_windows_nat): Replace info_w32_cmdlist initialization by a call to init_w32_command_list. (info_w32_command, info_w32_cmdlist): Removed from here... to windows-tdep.c file. * windows-tdep.h (info_w32_cmdlist): Declare. (init_w32_command_list): New external function declaration. * windows-tdep.c: Add several headers. (info_w32_cmdlist): to here, made global. (thread_information_32): New struct. (thread_information_64): New struct. (TIB_NAME): New char array. (MAX_TIB32, MAX_TIB64, FULL_TIB_SIZE): New constants. (maint_display_all_tib): New static variable. (windows_get_tlb_type): New function. (tlb_value_read, tlb_value_write): New functions. (tlb_value_funcs): New static struct. (tlb_make_value): New function. (display_one_tib): New function. (display_tib): New function. (show_maint_show_all_tib):New function. (info_w32_command): Moved from windows-nat.c. (init_w32_command_list): New function. (_initialize_windows_tdep): New function. New "maint set/show show-all-tib" command New "$_tlb" internal variable. gdbserver/ChangeLog entry: * server.c (handle_query): Handle 'qGetTIBAddr' query. * target.h (target_ops): New get_tib_address field. * win32-low.h (win32_thread_info): Add thread_local_base field. * win32-low.c (child_add_thread): Add tlb argument. Set thread_local_base field to TLB. (get_child_debug_event): Adapt to child_add_thread change. (win32_get_tib_address): New function. (win32_target_ops): Set get_tib_address field to win32_get_tib_address. * linux-low.c (linux_target_ops): Set get_tib_address field to NULL. doc/ChangeLog entry: gdb.texinfo ($_tlb): Document new automatic convinience variable. (info w32 thread-information-block): Document new command. (qGetTIBAddress): Document new gdbserver query. (maint set/show show-all-tib): Document new command.
2010-04-16 09:49:37 +02:00
2010-04-16 Pierre Muller <muller@ics.u-strasbg.fr>
* server.c (handle_query): Handle 'qGetTIBAddr' query.
* target.h (target_ops): New get_tib_address field.
* win32-low.h (win32_thread_info): Add thread_local_base field.
* win32-low.c (child_add_thread): Add tlb argument.
Set thread_local_base field to TLB.
(get_child_debug_event): Adapt to child_add_thread change.
(win32_get_tib_address): New function.
(win32_target_ops): Set get_tib_address field to
win32_get_tib_address.
* linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
2010-04-12 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_mourn): Also remove the process.
* server.c (handle_target_event): Don't remove the process here.
* nto-low.c (nto_mourn): New.
(nto_target_ops): Install it.
* spu-low.c (spu_mourn): New.
(spu_target_ops): Install it.
* win32-low.c (win32_mourn): New.
(win32_target_ops): Install it.
2010-04-12 Pedro Alves <pedro@codesourcery.com>
* server.h (buffer_xml_printf): Remove redundant `;'.
2010-04-12 Pedro Alves <pedro@codesourcery.com>
* regcache.c (set_register_cache): Invalidate regcaches before
changing the register cache layout.
(regcache_invalidate_one): Allow a NULL regcache.
* linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
regcaches before changing the register cache layout or the target
regsets.
2010-04-12 H.J. Lu <hongjiu.lu@intel.com>
* linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
variable warning on Linux/x86-64.
GDBserver disconnected tracing support. * linux-low.c (linux_remove_process): Delete. (add_lwp): Don't set last_resume_kind here. (linux_kill): Use `mourn'. (linux_detach): Use `thread_db_detach', and `mourn'. (linux_mourn): New. (linux_attach_lwp_1): Adjust comment. (linux_attach): last_resume_kind moved the thread_info; adjust. (status_pending_p_callback): Adjust. (linux_wait_for_event_1): Adjust. (count_events_callback, select_singlestep_lwp_callback) (select_event_lwp_callback, cancel_breakpoints_callback) (db_wants_lwp_stopped, linux_wait_1, need_step_over_p) (proceed_one_lwp): Adjust. (linux_async): Add debug output. (linux_thread_stopped): New. (linux_pause_all): New. (linux_target_ops): Install linux_mourn, linux_thread_stopped and linux_pause_all. * linux-low.h (struct lwp_info): Delete last_resume_kind field. (thread_db_free): Delete declaration. (thread_db_detach, thread_db_mourn): Declare. * thread-db.c (thread_db_init): Use thread_db_mourn. (thread_db_free): Delete, split in two. (disable_thread_event_reporting): New. (thread_db_detach): New. (thread_db_mourn): New. * server.h (struct thread_info) <last_resume_kind>: New field. <attached>: Add comment. <gdb_detached>: New field. (handler_func): Change return type to int. (handle_serial_event, handle_target_event): Ditto. (gdb_connected): Declare. (tracing): Delete. (disconnected_tracing): Declare. (stop_tracing): Declare. * server.c (handle_query) <qSupported>: Report support for disconnected tracing. (queue_stop_reply_callback): Account for running threads. (gdb_wants_thread_stopped): New. (gdb_wants_all_threads_stopped): New. (gdb_reattached_process): New. (handle_status): Clear the `gdb_detached' flag of all processes. In all-stop, stop all threads. (main): Be sure to leave tfind mode. Handle disconnected tracing. (process_serial_event): If the remote connection breaks, or if an exit was forced with "monitor exit", force an event loop exit. Handle disconnected tracing on detach. (handle_serial_event): Adjust. (handle_target_event): If GDB isn't connected, forward events back to the inferior, unless the last process exited, in which case, exit gdbserver. Adjust interface. * remote-utils.c (remote_open): Don't block in accept. Instead register an event loop source on the listen socket file descriptor. Refactor bits into ... (listen_desc): ... this new global. (gdb_connected): ... this new function. (enable_async_notification): ... this new function. (handle_accept_event): ... this new function. (remote_close): Clear remote_desc. * inferiors.c (add_thread): Set the new thread's last_resume_kind. * target.h (struct target_ops) <mourn, thread_stopped, pause_all>: New fields. (mourn_inferior): Define. (target_process_qsupported): Avoid the dangling else problem. (thread_stopped): Define. (pause_all): Define. (target_waitstatus_to_string): Declare. * target.c (target_waitstatus_to_string): New. * tracepoint.c (tracing): Make extern. (disconnected_tracing): New. (stop_tracing): Make extern. Handle tracing stops due to GDB disconnecting. (cmd_qtdisconnected): New. (cmd_qtstatus): Report disconnected tracing status in trace reply. (handle_tracepoint_general_set): Handle QTDisconnected. * event-loop.c (event_handler_func): Change return type to int. (process_event): Bail out if the event handler wants the event loop to stop. (handle_file_event): Ditto. (start_event_loop): Bail out if the event handler wants the event loop to stop. * nto-low.c (nto_target_ops): Adjust. * spu-low.c (spu_wait): Don't remove the process here. (spu_target_ops): Adjust. * win32-low.c (win32_wait): Don't remove the process here. (win32_target_ops): Adjust.
2010-04-11 18:33:56 +02:00
2010-04-11 Pedro Alves <pedro@codesourcery.com>
GDBserver disconnected tracing support.
* linux-low.c (linux_remove_process): Delete.
(add_lwp): Don't set last_resume_kind here.
(linux_kill): Use `mourn'.
(linux_detach): Use `thread_db_detach', and `mourn'.
(linux_mourn): New.
(linux_attach_lwp_1): Adjust comment.
(linux_attach): last_resume_kind moved the thread_info; adjust.
(status_pending_p_callback): Adjust.
(linux_wait_for_event_1): Adjust.
(count_events_callback, select_singlestep_lwp_callback)
(select_event_lwp_callback, cancel_breakpoints_callback)
(db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
(proceed_one_lwp): Adjust.
(linux_async): Add debug output.
(linux_thread_stopped): New.
(linux_pause_all): New.
(linux_target_ops): Install linux_mourn, linux_thread_stopped and
linux_pause_all.
* linux-low.h (struct lwp_info): Delete last_resume_kind field.
(thread_db_free): Delete declaration.
(thread_db_detach, thread_db_mourn): Declare.
* thread-db.c (thread_db_init): Use thread_db_mourn.
(thread_db_free): Delete, split in two.
(disable_thread_event_reporting): New.
(thread_db_detach): New.
(thread_db_mourn): New.
* server.h (struct thread_info) <last_resume_kind>: New field.
<attached>: Add comment.
<gdb_detached>: New field.
(handler_func): Change return type to int.
(handle_serial_event, handle_target_event): Ditto.
(gdb_connected): Declare.
(tracing): Delete.
(disconnected_tracing): Declare.
(stop_tracing): Declare.
* server.c (handle_query) <qSupported>: Report support for
disconnected tracing.
(queue_stop_reply_callback): Account for running threads.
(gdb_wants_thread_stopped): New.
(gdb_wants_all_threads_stopped): New.
(gdb_reattached_process): New.
(handle_status): Clear the `gdb_detached' flag of all processes.
In all-stop, stop all threads.
(main): Be sure to leave tfind mode. Handle disconnected tracing.
(process_serial_event): If the remote connection breaks, or if an
exit was forced with "monitor exit", force an event loop exit.
Handle disconnected tracing on detach.
(handle_serial_event): Adjust.
(handle_target_event): If GDB isn't connected, forward events back
to the inferior, unless the last process exited, in which case,
exit gdbserver. Adjust interface.
* remote-utils.c (remote_open): Don't block in accept. Instead
register an event loop source on the listen socket file
descriptor. Refactor bits into ...
(listen_desc): ... this new global.
(gdb_connected): ... this new function.
(enable_async_notification): ... this new function.
(handle_accept_event): ... this new function.
(remote_close): Clear remote_desc.
* inferiors.c (add_thread): Set the new thread's last_resume_kind.
* target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
New fields.
(mourn_inferior): Define.
(target_process_qsupported): Avoid the dangling else problem.
(thread_stopped): Define.
(pause_all): Define.
(target_waitstatus_to_string): Declare.
* target.c (target_waitstatus_to_string): New.
* tracepoint.c (tracing): Make extern.
(disconnected_tracing): New.
(stop_tracing): Make extern. Handle tracing stops due to GDB
disconnecting.
(cmd_qtdisconnected): New.
(cmd_qtstatus): Report disconnected tracing status in trace reply.
(handle_tracepoint_general_set): Handle QTDisconnected.
* event-loop.c (event_handler_func): Change return type to int.
(process_event): Bail out if the event handler wants the event
loop to stop.
(handle_file_event): Ditto.
(start_event_loop): Bail out if the event handler wants the event
loop to stop.
* nto-low.c (nto_target_ops): Adjust.
* spu-low.c (spu_wait): Don't remove the process here.
(spu_target_ops): Adjust.
* win32-low.c (win32_wait): Don't remove the process here.
(win32_target_ops): Adjust.
2010-04-11 Pedro Alves <pedro@codesourcery.com>
* regcache.c (realloc_register_cache): Invalidate inferior's
regcache before recreating it.
2010-04-09 Pedro Alves <pedro@codesourcery.com>
* tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
gdb/gdbserver/ * server.h (LONGEST): New. (struct thread_info) <while_stepping>: New field. (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz): Declare. (initialize_tracepoint, handle_tracepoint_general_set) (handle_tracepoint_query, tracepoint_finished_step) (tracepoint_was_hit, release_while_stepping_state_list): (current_traceframe): Declare. * server.c (handle_general_set): Handle tracepoint packets. (read_memory): New. (write_memory): New. (handle_search_memory_1): Use read_memory. (handle_query): Report support for conditional tracepoints, trace state variables, and tracepoint sources. Handle tracepoint queries. (main): Initialize the tracepoints module. (process_serial_event): Handle traceframe reads/writes. * linux-low.c (handle_tracepoints): New. (linux_wait_1): Call it. (linux_resume_one_lwp): Handle while-stepping. (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New. (linux_target_ops): Install them. * linux-low.h (struct linux_target_ops) <supports_tracepoints>: New field. * linux-x86-low.c (x86_supports_tracepoints): New. (the_low_target). Install it. * mem-break.h (delete_breakpoint): Declare. * mem-break.c (delete_breakpoint): Make external. * target.h (struct target_ops): Add `supports_tracepoints', `read_pc', and `write_pc' fields. (target_supports_tracepoints): Define. * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two) (phex_nz): New. * regcache.h (struct regcache) <registers_owned>: New field. (init_register_cache, regcache_cpy): Declare. (regcache_read_pc, regcache_write_pc): Declare. (register_cache_size): Declare. (supply_regblock): Declare. * regcache.c (init_register_cache): New. (new_register_cache): Use it. (regcache_cpy): New. (register_cache_size): New. (supply_regblock): New. (regcache_read_pc, regcache_write_pc): New. * tracepoint.c: New. * Makefile.in (OBS): Add tracepoint.o. (tracepoint.o): New rule. gdb/ * regformats/regdat.sh: Include server.h. Don't include regcache.h.
2010-04-09 05:40:00 +02:00
2010-04-09 Stan Shebs <stan@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
* server.h (LONGEST): New.
(struct thread_info) <while_stepping>: New field.
(unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
Declare.
(initialize_tracepoint, handle_tracepoint_general_set)
(handle_tracepoint_query, tracepoint_finished_step)
(tracepoint_was_hit, release_while_stepping_state_list):
(current_traceframe): Declare.
* server.c (handle_general_set): Handle tracepoint packets.
(read_memory): New.
(write_memory): New.
(handle_search_memory_1): Use read_memory.
(handle_query): Report support for conditional tracepoints, trace
state variables, and tracepoint sources. Handle tracepoint
queries.
(main): Initialize the tracepoints module.
(process_serial_event): Handle traceframe reads/writes.
* linux-low.c (handle_tracepoints): New.
(linux_wait_1): Call it.
(linux_resume_one_lwp): Handle while-stepping.
(linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
(linux_target_ops): Install them.
* linux-low.h (struct linux_target_ops) <supports_tracepoints>:
New field.
* linux-x86-low.c (x86_supports_tracepoints): New.
(the_low_target). Install it.
* mem-break.h (delete_breakpoint): Declare.
* mem-break.c (delete_breakpoint): Make external.
* target.h (struct target_ops): Add `supports_tracepoints',
`read_pc', and `write_pc' fields.
(target_supports_tracepoints): Define.
* utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
(phex_nz): New.
* regcache.h (struct regcache) <registers_owned>: New field.
(init_register_cache, regcache_cpy): Declare.
(regcache_read_pc, regcache_write_pc): Declare.
(register_cache_size): Declare.
(supply_regblock): Declare.
* regcache.c (init_register_cache): New.
(new_register_cache): Use it.
(regcache_cpy): New.
(register_cache_size): New.
(supply_regblock): New.
(regcache_read_pc, regcache_write_pc): New.
2010-08-27 14:02:20 +02:00
gdb/gdbserver/ * server.h (LONGEST): New. (struct thread_info) <while_stepping>: New field. (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz): Declare. (initialize_tracepoint, handle_tracepoint_general_set) (handle_tracepoint_query, tracepoint_finished_step) (tracepoint_was_hit, release_while_stepping_state_list): (current_traceframe): Declare. * server.c (handle_general_set): Handle tracepoint packets. (read_memory): New. (write_memory): New. (handle_search_memory_1): Use read_memory. (handle_query): Report support for conditional tracepoints, trace state variables, and tracepoint sources. Handle tracepoint queries. (main): Initialize the tracepoints module. (process_serial_event): Handle traceframe reads/writes. * linux-low.c (handle_tracepoints): New. (linux_wait_1): Call it. (linux_resume_one_lwp): Handle while-stepping. (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New. (linux_target_ops): Install them. * linux-low.h (struct linux_target_ops) <supports_tracepoints>: New field. * linux-x86-low.c (x86_supports_tracepoints): New. (the_low_target). Install it. * mem-break.h (delete_breakpoint): Declare. * mem-break.c (delete_breakpoint): Make external. * target.h (struct target_ops): Add `supports_tracepoints', `read_pc', and `write_pc' fields. (target_supports_tracepoints): Define. * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two) (phex_nz): New. * regcache.h (struct regcache) <registers_owned>: New field. (init_register_cache, regcache_cpy): Declare. (regcache_read_pc, regcache_write_pc): Declare. (register_cache_size): Declare. (supply_regblock): Declare. * regcache.c (init_register_cache): New. (new_register_cache): Use it. (regcache_cpy): New. (register_cache_size): New. (supply_regblock): New. (regcache_read_pc, regcache_write_pc): New. * tracepoint.c: New. * Makefile.in (OBS): Add tracepoint.o. (tracepoint.o): New rule. gdb/ * regformats/regdat.sh: Include server.h. Don't include regcache.h.
2010-04-09 05:40:00 +02:00
* tracepoint.c: New.
* Makefile.in (OBS): Add tracepoint.o.
(tracepoint.o): New rule.
Support i386 without SSE. gdb/ 2010-04-08 H.J. Lu <hongjiu.lu@intel.com> * i386-linux-nat.c (have_ptrace_getfpxregs): Initialize to -1 if HAVE_PTRACE_GETFPXREGS is defined. (i386_linux_read_description): Set have_ptrace_getfpxregs and have_ptrace_getregset to 0 if ptrace PTRACE_GETFPXREGS failed. * i386-linux-tdep.c: Include "features/i386/i386-mmx-linux.c" (i386_linux_core_read_description): Return tdesc_i386_mmx_linux if .reg-xfp section doesn't exist. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_mmx_linux. * i386-linux-tdep.h (tdesc_i386_mmx_linux): New. * i386-tdep.c: Include "features/i386/i386-mmx.c". (i386_go32_init_abi): Set tdesc to tdesc_i386_mmx. (i386_validate_tdesc_p): Make org.gnu.gdb.i386.sse optional. Set xcr0 to I386_XSTATE_X87_MASK if SSE isn't available. (i386_gdbarch_init): Update comments. (_initialize_i386_tdep): Call initialize_tdesc_i386_mmx. * common/i386-xstate.h (I386_XSTATE_X87_MASK): New. * config/djgpp/fnchange.lst: Add i386 MMX XML files. * features/Makefile (i386/i386-mmx-expedite): New. (i386/i386-mmx-linux-expedite): Likewise. ($(outdir)/i386/i386-mmx.dat): Likewise. ($(outdir)/i386/i386-mmx-linux.dat): Likewise. * features/i386/i386-mmx-linux.c: New. * features/i386/i386-mmx-linux.xml: Likewise. * features/i386/i386-mmx.c: Likewise. * features/i386/i386-mmx.xml: Likewise. * regformats/i386/i386-mmx-linux.dat: Likewise. * regformats/i386/i386-mmx.dat: Likewise. * features/Makefile (WHICH): Add i386/i386-mmx and i386/i386-mmx-linux. gdb/doc/ 2010-04-08 H.J. Lu <hongjiu.lu@intel.com> * gdb.texinfo (i386 Features): Make org.gnu.gdb.i386.avx optional. Make org.gnu.gdb.i386.avx requires org.gnu.gdb.i386.avx. gdb/gdbserver/ 2010-04-08 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c. (i386-mmx.o): New. (i386-mmx.c): Likewise. (i386-mmx-linux.o): Likewise. (i386-mmx-linux.c): Likewise. * configure.srv (srv_i386_regobj): Add i386-mmx.o. (srv_i386_linux_regobj): Add i386-mmx-linux.o. (srv_i386_xmlfiles): Add i386/i386-mmx.xml. (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml. * linux-x86-low.c (init_registers_i386_mmx_linux): New. (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
2010-04-09 00:32:38 +02:00
2010-04-08 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
(i386-mmx.o): New.
(i386-mmx.c): Likewise.
(i386-mmx-linux.o): Likewise.
(i386-mmx-linux.c): Likewise.
* configure.srv (srv_i386_regobj): Add i386-mmx.o.
(srv_i386_linux_regobj): Add i386-mmx-linux.o.
(srv_i386_xmlfiles): Add i386/i386-mmx.xml.
(srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
* linux-x86-low.c (init_registers_i386_mmx_linux): New.
(x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
Add x86 AVX support to gdbserver. 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Updated. (i386-avx.o): New. (i386-avx.c): Likewise. (i386-avx-linux.o): Likewise. (i386-avx-linux.c): Likewise. (amd64-avx.o): Likewise. (amd64-avx.c): Likewise. (amd64-avx-linux.o): Likewise. (amd64-avx-linux.c): Likewise. * configure.srv (srv_i386_regobj): Add i386-avx.o. (srv_i386_linux_regobj): Add i386-avx-linux.o. (srv_amd64_regobj): Add amd64-avx.o. (srv_amd64_linux_regobj): Add amd64-avx-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml. (srv_i386_xmlfiles): Add i386/i386-avx.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml. * i387-fp.c: Include "i386-xstate.h". (i387_xsave): New. (i387_cache_to_xsave): Likewise. (i387_xsave_to_cache): Likewise. (x86_xcr0): Likewise. * i387-fp.h (i387_cache_to_xsave): Likewise. (i387_xsave_to_cache): Likewise. (x86_xcr0): Likewise. * linux-arm-low.c (target_regsets): Initialize nt_type to 0. * linux-crisv32-low.c (target_regsets): Likewise. * linux-m68k-low.c (target_regsets): Likewise. * linux-mips-low.c (target_regsets): Likewise. * linux-ppc-low.c (target_regsets): Likewise. * linux-s390-low.c (target_regsets): Likewise. * linux-sh-low.c (target_regsets): Likewise. * linux-sparc-low.c (target_regsets): Likewise. * linux-xtensa-low.c (target_regsets): Likewise. * linux-low.c: Include <sys/uio.h>. (regsets_fetch_inferior_registers): Support nt_type. (regsets_store_inferior_registers): Likewise. (linux_process_qsupported): New. (linux_target_ops): Add linux_process_qsupported. * linux-low.h (regset_info): Add nt_type. (linux_target_ops): Add process_qsupported. * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h" and <sys/uio.h>. (init_registers_i386_avx_linux): New. (init_registers_amd64_avx_linux): Likewise. (xmltarget_i386_linux_no_xml): Likewise. (xmltarget_amd64_linux_no_xml): Likewise. (PTRACE_GETREGSET): Likewise. (PTRACE_SETREGSET): Likewise. (x86_fill_xstateregset): Likewise. (x86_store_xstateregset): Likewise. (use_xml): Likewise. (x86_linux_update_xmltarget): Likewise. (x86_linux_process_qsupported): Likewise. (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type. (x86_arch_setup): Don't call init_registers_amd64_linux nor init_registers_i386_linux here. Call x86_linux_update_xmltarget. (the_low_target): Add x86_linux_process_qsupported. * server.c (handle_query): Call target_process_qsupported. * target.h (target_ops): Add process_qsupported. (target_process_qsupported): New.
2010-04-07 20:49:46 +02:00
2010-04-07 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (clean): Updated.
(i386-avx.o): New.
(i386-avx.c): Likewise.
(i386-avx-linux.o): Likewise.
(i386-avx-linux.c): Likewise.
(amd64-avx.o): Likewise.
(amd64-avx.c): Likewise.
(amd64-avx-linux.o): Likewise.
(amd64-avx-linux.c): Likewise.
* configure.srv (srv_i386_regobj): Add i386-avx.o.
(srv_i386_linux_regobj): Add i386-avx-linux.o.
(srv_amd64_regobj): Add amd64-avx.o.
(srv_amd64_linux_regobj): Add amd64-avx-linux.o.
(srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
(srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
(srv_i386_xmlfiles): Add i386/i386-avx.xml.
(srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
(srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
(srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
* i387-fp.c: Include "i386-xstate.h".
(i387_xsave): New.
(i387_cache_to_xsave): Likewise.
(i387_xsave_to_cache): Likewise.
(x86_xcr0): Likewise.
* i387-fp.h (i387_cache_to_xsave): Likewise.
(i387_xsave_to_cache): Likewise.
(x86_xcr0): Likewise.
* linux-arm-low.c (target_regsets): Initialize nt_type to 0.
* linux-crisv32-low.c (target_regsets): Likewise.
* linux-m68k-low.c (target_regsets): Likewise.
* linux-mips-low.c (target_regsets): Likewise.
* linux-ppc-low.c (target_regsets): Likewise.
* linux-s390-low.c (target_regsets): Likewise.
* linux-sh-low.c (target_regsets): Likewise.
* linux-sparc-low.c (target_regsets): Likewise.
* linux-xtensa-low.c (target_regsets): Likewise.
* linux-low.c: Include <sys/uio.h>.
(regsets_fetch_inferior_registers): Support nt_type.
(regsets_store_inferior_registers): Likewise.
(linux_process_qsupported): New.
(linux_target_ops): Add linux_process_qsupported.
* linux-low.h (regset_info): Add nt_type.
(linux_target_ops): Add process_qsupported.
* linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
and <sys/uio.h>.
(init_registers_i386_avx_linux): New.
(init_registers_amd64_avx_linux): Likewise.
(xmltarget_i386_linux_no_xml): Likewise.
(xmltarget_amd64_linux_no_xml): Likewise.
(PTRACE_GETREGSET): Likewise.
(PTRACE_SETREGSET): Likewise.
(x86_fill_xstateregset): Likewise.
(x86_store_xstateregset): Likewise.
(use_xml): Likewise.
(x86_linux_update_xmltarget): Likewise.
(x86_linux_process_qsupported): Likewise.
(target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
(x86_arch_setup): Don't call init_registers_amd64_linux nor
init_registers_i386_linux here. Call
x86_linux_update_xmltarget.
(the_low_target): Add x86_linux_process_qsupported.
* server.c (handle_query): Call target_process_qsupported.
* target.h (target_ops): Add process_qsupported.
(target_process_qsupported): New.
2010-04-03 Pedro Alves <pedro@codesourcery.com>
* inferiors.c (add_thread): Set last_status kind to
TARGET_WAITKIND_IGNORE.
* linux-low.c (cancel_breakpoint): Remove unnecessary regcache
fetch. Use ptid_of. Avoid unnecessary get_lwp_thread calls.
(linux_wait_1): Move `thread' local definition to block that uses
it. Don't NULL initialize `event_child'.
(linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
* linux-x86-low.c (x86_breakpoint_at): Read raw memory.
2010-04-01 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
an extended waitstatus, or by a watchpoint.
(cancel_breakpoints_callback): Don't cancel a breakpoint if the
thread was stepping or has been stopped by a watchpoint.
2010-04-01 Pedro Alves <pedro@codesourcery.com>
* mem-break.c (struct raw_breakpoint): New field shlib_disabled.
(set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
of another, then delete the previous, and validate all
breakpoints.
(validate_inserted_breakpoint): New.
(delete_disabled_breakpoints): New.
(validate_breakpoints): New.
(check_mem_read): Validate breakpoints before trusting their
shadow. Delete disabled breakpoints.
(check_mem_write): Validate breakpoints before trusting they
should be inserted. Delete disabled breakpoints.
* mem-break.h (validate_breakpoints):
* server.c (handle_query): Validate breakpoints when we see a
qSymbol query.
* linux-low.c (linux_wait_1): Avoid setting need_step_over is there's a GDB breakpoint at stop_pc. Always report a trap to GDB if we could tell there's a GDB breakpoint at stop_pc. (need_step_over_p): Don't do a step over if we find a GDB breakpoint at the resume PC. * mem-break.c (struct raw_breakpoint): New. (enum bkpt_type): New type `gdb_breakpoint'. (struct breakpoint): Delete the `PC', `old_data' and `inserted' fields. New field `raw'. (find_raw_breakpoint_at): New. (set_raw_breakpoint_at): Handle refcounting. Create a raw breakpoint instead. (set_breakpoint_at): Adjust. (delete_raw_breakpoint): New. (release_breakpoint): New. (delete_breakpoint): Rename to... (delete_breakpoint_1): ... this. Add proc parameter. Use release_breakpoint. Return ENOENT. (delete_breakpoint): Reimplement. (find_breakpoint_at): Delete. (find_gdb_breakpoint_at): New. (delete_breakpoint_at): Delete. (set_gdb_breakpoint_at): New. (delete_gdb_breakpoint_at): New. (gdb_breakpoint_here): New. (set_reinsert_breakpoint): Use release_breakpoint. (uninsert_breakpoint): Rename to ... (uninsert_raw_breakpoint): ... this. (uninsert_breakpoints_at): Adjust to handle raw breakpoints. (reinsert_raw_breakpoint): Change parameter type to raw_breakpoint. (reinsert_breakpoints_at): Adjust to handle raw breakpoints instead. (check_breakpoints): Adjust. Use release_breakpoint. (breakpoint_here): Rewrite using find_raw_breakpoint_at. (breakpoint_inserted_here): Ditto. (check_mem_read): Adjust to iterate over raw breakpoints instead. Don't trust the breakpoint's shadow if it is not inserted. (check_mem_write): Adjust to iterate over raw breakpoints instead. (delete_all_breakpoints): Adjust. (free_all_breakpoints): Mark all breakpoints as uninserted, and use delete_breakpoint_1. * mem-break.h (breakpoints_supported): Delete declaration. (set_gdb_breakpoint_at): Declare. (gdb_breakpoint_here): Declare. (delete_breakpoint_at): Delete. (delete_gdb_breakpoint_at): Declare. * server.h (struct raw_breakpoint): Forward declare. (struct process_info): New field `raw_breakpoints'. * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0 breakpoints.
2010-04-01 16:25:34 +02:00
2010-04-01 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_wait_1): Avoid setting need_step_over is
there's a GDB breakpoint at stop_pc. Always report a trap to GDB
if we could tell there's a GDB breakpoint at stop_pc.
(need_step_over_p): Don't do a step over if we find a GDB
breakpoint at the resume PC.
* mem-break.c (struct raw_breakpoint): New.
(enum bkpt_type): New type `gdb_breakpoint'.
(struct breakpoint): Delete the `PC', `old_data' and `inserted'
fields. New field `raw'.
(find_raw_breakpoint_at): New.
(set_raw_breakpoint_at): Handle refcounting. Create a raw
breakpoint instead.
(set_breakpoint_at): Adjust.
(delete_raw_breakpoint): New.
(release_breakpoint): New.
(delete_breakpoint): Rename to...
(delete_breakpoint_1): ... this. Add proc parameter. Use
release_breakpoint. Return ENOENT.
(delete_breakpoint): Reimplement.
(find_breakpoint_at): Delete.
(find_gdb_breakpoint_at): New.
(delete_breakpoint_at): Delete.
(set_gdb_breakpoint_at): New.
(delete_gdb_breakpoint_at): New.
(gdb_breakpoint_here): New.
(set_reinsert_breakpoint): Use release_breakpoint.
(uninsert_breakpoint): Rename to ...
(uninsert_raw_breakpoint): ... this.
(uninsert_breakpoints_at): Adjust to handle raw breakpoints.
(reinsert_raw_breakpoint): Change parameter type to
raw_breakpoint.
(reinsert_breakpoints_at): Adjust to handle raw breakpoints
instead.
(check_breakpoints): Adjust. Use release_breakpoint.
(breakpoint_here): Rewrite using find_raw_breakpoint_at.
(breakpoint_inserted_here): Ditto.
(check_mem_read): Adjust to iterate over raw breakpoints instead.
Don't trust the breakpoint's shadow if it is not inserted.
(check_mem_write): Adjust to iterate over raw breakpoints instead.
(delete_all_breakpoints): Adjust.
(free_all_breakpoints): Mark all breakpoints as uninserted, and
use delete_breakpoint_1.
* mem-break.h (breakpoints_supported): Delete declaration.
(set_gdb_breakpoint_at): Declare.
(gdb_breakpoint_here): Declare.
(delete_breakpoint_at): Delete.
(delete_gdb_breakpoint_at): Declare.
* server.h (struct raw_breakpoint): Forward declare.
(struct process_info): New field `raw_breakpoints'.
* linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
breakpoints.
2010-03-24 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (status_pending_p_callback): Fix comment.
(linux_wait_for_event_1): Move most of the internal breakpoint
handling from here...
(linux_wait_1): ... to here.
(count_events_callback): New.
(select_singlestep_lwp_callback): New.
(select_event_lwp_callback): New.
(cancel_breakpoints_callback): New.
(select_event_lwp): New.
(linux_wait_1): Simplify internal breakpoint handling. Give equal
priority to all LWPs that have had events that should be reported
to the client. Cancel breakpoints when about to reporting the
event to the client, not while stopping lwps. No longer cancel
finished single-steps here.
(cancel_finished_single_step): Delete.
(cancel_finished_single_steps): Delete.
2010-03-24 Pedro Alves <pedro@codesourcery.com>
* mem-break.c (enum bkpt_type): New.
(struct breakpoint): New field `type'.
(set_breakpoint_at): Change return type to struct breakpoint
pointer. Set type to `other_breakpoint' by default.
(delete_breakpoint): Rewrite, supporting more than one breakpoint
in the breakpoint list.
(delete_reinsert_breakpoints): Only delete reinsert breakpoints.
(reinsert_breakpoint): Rename to ...
(reinsert_raw_breakpoint): ... this.
(reinsert_breakpoints_at): Adjust.
* mem-break.h (struct breakpoint): Declare.
(set_breakpoint_at): Change return type to struct breakpoint
pointer.
2010-03-24 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_query): Assign, not compare.
Teach linux gdbserver to step-over-breakpoints. * linux-low.c (can_hardware_single_step): New. (supports_breakpoints): New. (handle_extended_wait): If stopping threads, read the stop pc of the new cloned LWP. (get_pc): New. (get_stop_pc): Add `lwp' parameter. Handle it. Bail out if the low target doesn't support retrieving the PC. (add_lwp): Set last_resume_kind to resume_continue. (linux_attach_lwp_1): Adjust comments. Always set stop_expected. (linux_attach): Don't clear stop_expected. Set the lwp's last_resume_kind to resume_stop. (linux_detach_one_lwp): Don't check for removed breakpoints. (check_removed_breakpoint): Delete. (status_pending_p): Rename to ... (status_pending_p_callback): ... this. Don't check for removed breakpoints. Don't consider threads that are stopped from GDB's perspective. (linux_wait_for_lwp): Always read the stop_pc here. (cancel_breakpoint): New. (step_over_bkpt): New global. (linux_wait_for_event_1): Implement stepping over breakpoints. (gdb_wants_lwp_stopped): New. (gdb_wants_all_stopped): New. (linux_wait_1): Tag threads as gdb-wants-stopped. Cancel finished single-step traps here. Store the thread's last reported target wait status. (send_sigstop): Don't clear stop_expected. Always set it, instead. (mark_lwp_dead): Remove reference to pending_is_breakpoint. (cancel_finished_single_step): New. (cancel_finished_single_steps): New. (wait_for_sigstop): Don't cancel finished single-step traps here. (linux_resume_one_lwp): Don't check for removed breakpoints. Don't set `step' on non-hardware step archs. (linux_set_resume_request): Ignore resume_stop requests if already stopping or stopped. Set the lwp's last_resume_kind. (resume_status_pending_p): Don't check for removed breakpoints. (need_step_over_p): New. (start_step_over): New. (finish_step_over): New. (linux_resume_one_thread): Always queue a sigstop for resume_stop requests. Clear the thread's last reported target waitstatus. Don't use the `suspended' flag. Don't consider pending breakpoints. (linux_resume): Start a step-over if necessary. (proceed_one_lwp): New. (proceed_all_lwps): New. (unstop_all_lwps): New. * linux-low.h (struct lwp_info): Rewrite comment for the `suspended' flag. Add the `stop_pc' field. Delete the `pending_stop_pc' field. Tweak the `stepping' flag's comment. Add `'last_resume_kind' and `need_step_over' fields. * inferiors.c (struct thread_info): Delete, moved elsewhere. * mem-break.c (struct breakpoint): Delete `reinserting' flag. Delete `breakpoint_to_reinsert' field. New flag `inserted'. (set_raw_breakpoint_at): New. (set_breakpoint_at): Rewrite to use it. (reinsert_breakpoint_handler): Delete. (set_reinsert_breakpoint): New. (reinsert_breakpoint_by_bp): Delete. (delete_reinsert_breakpoints): New. (uninsert_breakpoint): Rewrite. (uninsert_breakpoints_at): New. (reinsert_breakpoint): Rewrite. (reinsert_breakpoints_at): New. (check_breakpoints): Rewrite. (breakpoint_here): New. (breakpoint_inserted_here): New. (check_mem_read): Adjust. * mem-break.h (breakpoints_supported, breakpoint_here) (breakpoint_inserted_here, set_reinsert_breakpoint): Declare. (reinsert_breakpoint_by_bp): Delete declaration. (delete_reinsert_breakpoints): Declare. (reinsert_breakpoint): Delete declaration. (reinsert_breakpoints_at): Declare. (uninsert_breakpoint): Delete declaration. (uninsert_breakpoints_at): Declare. (check_breakpoints): Adjust prototype. * server.h: Adjust include order. (struct thread_info): Declare here. Add a `last_status' field.
2010-03-24 01:05:03 +01:00
2010-03-24 Pedro Alves <pedro@codesourcery.com>
Teach linux gdbserver to step-over-breakpoints.
* linux-low.c (can_hardware_single_step): New.
(supports_breakpoints): New.
(handle_extended_wait): If stopping threads, read the stop pc of
the new cloned LWP.
(get_pc): New.
(get_stop_pc): Add `lwp' parameter. Handle it. Bail out if the
low target doesn't support retrieving the PC.
(add_lwp): Set last_resume_kind to resume_continue.
(linux_attach_lwp_1): Adjust comments. Always set stop_expected.
(linux_attach): Don't clear stop_expected. Set the lwp's
last_resume_kind to resume_stop.
(linux_detach_one_lwp): Don't check for removed breakpoints.
(check_removed_breakpoint): Delete.
(status_pending_p): Rename to ...
(status_pending_p_callback): ... this. Don't check for removed
breakpoints. Don't consider threads that are stopped from GDB's
perspective.
(linux_wait_for_lwp): Always read the stop_pc here.
(cancel_breakpoint): New.
(step_over_bkpt): New global.
(linux_wait_for_event_1): Implement stepping over breakpoints.
(gdb_wants_lwp_stopped): New.
(gdb_wants_all_stopped): New.
(linux_wait_1): Tag threads as gdb-wants-stopped. Cancel finished
single-step traps here. Store the thread's last reported target
wait status.
(send_sigstop): Don't clear stop_expected. Always set it,
instead.
(mark_lwp_dead): Remove reference to pending_is_breakpoint.
(cancel_finished_single_step): New.
(cancel_finished_single_steps): New.
(wait_for_sigstop): Don't cancel finished single-step traps here.
(linux_resume_one_lwp): Don't check for removed breakpoints.
Don't set `step' on non-hardware step archs.
(linux_set_resume_request): Ignore resume_stop requests if already
stopping or stopped. Set the lwp's last_resume_kind.
(resume_status_pending_p): Don't check for removed breakpoints.
(need_step_over_p): New.
(start_step_over): New.
(finish_step_over): New.
(linux_resume_one_thread): Always queue a sigstop for resume_stop
requests. Clear the thread's last reported target waitstatus.
Don't use the `suspended' flag. Don't consider pending breakpoints.
(linux_resume): Start a step-over if necessary.
(proceed_one_lwp): New.
(proceed_all_lwps): New.
(unstop_all_lwps): New.
* linux-low.h (struct lwp_info): Rewrite comment for the
`suspended' flag. Add the `stop_pc' field. Delete the
`pending_stop_pc' field. Tweak the `stepping' flag's comment.
Add `'last_resume_kind' and `need_step_over' fields.
* inferiors.c (struct thread_info): Delete, moved elsewhere.
* mem-break.c (struct breakpoint): Delete `reinserting' flag.
Delete `breakpoint_to_reinsert' field. New flag `inserted'.
(set_raw_breakpoint_at): New.
(set_breakpoint_at): Rewrite to use it.
(reinsert_breakpoint_handler): Delete.
(set_reinsert_breakpoint): New.
(reinsert_breakpoint_by_bp): Delete.
(delete_reinsert_breakpoints): New.
(uninsert_breakpoint): Rewrite.
(uninsert_breakpoints_at): New.
(reinsert_breakpoint): Rewrite.
(reinsert_breakpoints_at): New.
(check_breakpoints): Rewrite.
(breakpoint_here): New.
(breakpoint_inserted_here): New.
(check_mem_read): Adjust.
* mem-break.h (breakpoints_supported, breakpoint_here)
(breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
(reinsert_breakpoint_by_bp): Delete declaration.
(delete_reinsert_breakpoints): Declare.
(reinsert_breakpoint): Delete declaration.
(reinsert_breakpoints_at): Declare.
(uninsert_breakpoint): Delete declaration.
(uninsert_breakpoints_at): Declare.
(check_breakpoints): Adjust prototype.
* server.h: Adjust include order.
(struct thread_info): Declare here. Add a `last_status' field.
2010-03-23 Michael Snyder <msnyder@vmware.com>
* server.c (crc32): New function.
(handle_query): Add handling for 'qCRC:' request.
2010-03-23 Pedro Alves <pedro@codesourcery.com>
* linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
lwp had been stopped by a watchpoint.
2010-03-16 Pedro Alves <pedro@codesourcery.com>
* server.h (internal_error): Declare.
(gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
* utils.c (internal_error): New function.
2010-03-15 Andreas Schwab <schwab@redhat.com>
* configure.srv: Fix typo setting srv_regobj.
2010-03-15 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (fetch_register): Avoid passing a non string literal
format to `error'.
(usr_store_inferior_registers): Ditto.
2010-03-14 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_write_memory): Bail out early if peeking
memory failed.
2010-03-14 Pedro Alves <pedro@codesourcery.com>
* linux-low.h (struct lwp_info): New fields
`stopped_by_watchpoint' and `stopped_data_address'.
* linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
here, and cache them in the lwp object.
(wait_for_sigstop): Check stopped_by_watchpoint lwp field
directly.
(linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
field.
(linux_stopped_by_watchpoint): Rewrite.
(linux_stopped_data_address): Rewrite.
2010-03-06 Simo Melenius <simo.melenius@iki.fi>
* linux-low.c (linux_wait_for_lwp): Fetch the regcache after
switching the current inferior, not before.
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
2010-03-01 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
i386-linux.c and amd64-linux.c.
(reg-i386.o): Removed.
(reg-i386.c): Likewise.
(reg-i386-linux.o): Likewise.
(reg-i386-linux.c): Likewise.
(reg-x86-64.o): Likewise.
(reg-x86-64.c): Likewise.
(reg-x86-64-linux.o): Likewise.
(reg-x86-64-linux.c): Likewise.
(i386.o): New.
(i386.c): Likewise.
(i386-linux.o): Likewise.
(i386-linux.c): Likewise.
(amd64.o): Likewise.
(amd64.c): Likewise.
(amd64-linux.o): Likewise.
(amd64-linux.c): Likewise.
* configure.srv (srv_i386_regobj): New.
(srv_i386_linux_regobj): Likewise.
(srv_amd64_regobj): Likewise.
(srv_amd64_linux_regobj): Likewise.
(srv_i386_32bit_xmlfiles): Likewise.
(srv_i386_64bit_xmlfiles): Likewise.
(srv_i386_xmlfiles): Likewise.
(srv_amd64_xmlfiles): Likewise.
(srv_i386_linux_xmlfiles): Likewise.
(srv_amd64_linux_xmlfiles): Likewise.
(i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set
srv_xmlfiles to $srv_i386_xmlfiles.
(i[34567]86-*-mingw32ce*): Likewise.
(i[34567]86-*-mingw*): Likewise.
(i[34567]86-*-nto*): Likewise.
(i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
and $srv_amd64_linux_regobj. Set srv_xmlfiles to
$srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
(x86_64-*-linux*): Likewise.
* linux-x86-low.c (init_registers_x86_64_linux): Removed.
(init_registers_amd64_linux): New.
(x86_arch_setup): Replace init_registers_x86_64_linux with
init_registers_amd64_linux.
2010-02-23 Maxim Kuvyrkov <maxim@codesourcery.com>
* configure.ac: Check for libdl. If it is not available link against
static libthread_db.
* configure: Regenerate.
2010-02-22 Pedro Alves <pedro@codesourcery.com>
PR9605
* i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
handing a read watchpoint.
(i386_low_insert_watchpoint): Read watchpoints aren't supported.
2010-02-12 Doug Evans <dje@google.com>
* linux-low.c (linux_supports_tracefork_flag): Document.
(linux_look_up_symbols): Add comment.
2010-02-03 H.J. Lu <hongjiu.lu@intel.com>
* regcache.c (supply_register): Clear regcache if buf is NULL.
2010-02-02 Nicolas Roche <roche@sourceware.org>
Joel Brobecker <brobecker@adacore.com>
* inferiors.c (find_inferior): Add function documentation.
(unloaded_dll): Handle the case where the unloaded dll has not
been previously registered in the dll list.
2010-02-01 Daniel Jacobowitz <dan@codesourcery.com>
* linux-arm-low.c (thumb_breakpoint_len): Delete.
(thumb2_breakpoint): New.
(arm_breakpoint_at): Check for Thumb-2 breakpoints.
2010-01-29 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (get_stop_pc): Check for SIGTRAP.
(linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
breakpoints.
2010-01-21 Pedro Alves <pedro@codesourcery.com>
* linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
2010-01-21 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-s390-low.c (s390_collect_ptrace_register)
(s390_supply_ptrace_register): Adjust it for the new regcache parameter.
2010-01-21 Doug Evans <dje@google.com>
* linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
(PTRACE_ARG4_TYPE): New macro.
(handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
(linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
(fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
(usr_store_inferior_registers): Ditto.
(linux_read_memory, linux_write_memory): Ditto.
(linux_test_for_tracefork): Ditto.
* linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
2010-01-21 Pedro Alves <pedro@codesourcery.com>
* proc-service.c (ps_lgetregs): Don't refetch registers from the
target.
2010-01-21 Pedro Alves <pedro@codesourcery.com>
* spu-low.c (spu_fetch_registers, spu_store_registers): Change
prototype to take a regcache. Adjust.
* regcache.h (struct thread_info): Forward declare. (struct regcache): New. (new_register_cache): Adjust prototype. (get_thread_regcache): Declare. (free_register_cache): Adjust prototype. (registers_to_string, registers_from_string): Ditto. (supply_register, supply_register_by_name, collect_register) (collect_register_as_string, collect_register_by_name): Ditto. * regcache.c (struct inferior_regcache_data): Delete. (get_regcache): Rename to ... (get_thread_regcache): ... this. Adjust. Switch inferior before fetching registers. (regcache_invalidate_one): Adjust. (regcache_invalidate): Fix prototype. (new_register_cache): Return the new register cache. (free_register_cache): Change prototype. (realloc_register_cache): Adjust. (registers_to_string): Change prototype to take a regcache. Adjust. (registers_from_string): Ditto. (register_data): Ditto. (supply_register): Ditto. (supply_register_by_name): Ditto. (collect_register): Ditto. (collect_register_as_string): Ditto. (collect_register_by_name): Ditto. * server.c (process_serial_event): Adjust. * linux-low.h (regset_fill_func, regset_store_func): Change prototype. (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register): Change prototype. * linux-low.c (get_stop_pc): Adjust. (check_removed_breakpoint): Adjust. (linux_wait_for_event): Adjust. (linux_resume_one_lwp): Adjust. (fetch_register): Add regcache parameter. Adjust. (usr_store_inferior_registers): Ditto. (regsets_fetch_inferior_registers): Ditto. (regsets_store_inferior_registers): Ditto. (linux_fetch_registers, linux_store_registers): Ditto. * i387-fp.c (i387_cache_to_fsave): Change prototype to take a regcache. Adjust. (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto. * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change prototype to take a regcache. (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto. * remote-utils.c (convert_ascii_to_int, outreg) (prepare_resume_reply): Change prototype to take a regcache. Adjust. * target.h (struct target_ops) <fetch_registers, store_registers>: Change prototype to take a regcache. (fetch_inferior_registers, store_inferior_registers): Change prototype to take a regcache. Adjust. * proc-service.c (ps_lgetregs): Adjust. * linux-x86-low.c (x86_fill_gregset, x86_store_gregset) (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset) (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to take a regcache. Adjust. * linux-arm-low.c (arm_fill_gregset, arm_store_gregset) (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset) (arm_store_vfpregset, arm_get_pc, arm_set_pc): (arm_breakpoint_at): Change prototype to take a regcache. Adjust. * linux-cris-low.c (cris_get_pc, cris_set_pc) (cris_cannot_fetch_register): (cris_breakpoint_at): Change prototype to take a regcache. Adjust. * linux-crisv32-low.c (cris_get_pc, cris_set_pc, cris_reinsert_addr, cris_write_data_breakpoint): Change prototype to take a regcache. Adjust. (cris_breakpoint_at, cris_insert_point, cris_remove_point): Adjust. * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to take a regcache. Adjust. * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset) (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc, (m68k_set_pc): Change prototype to take a regcache. Adjust. * linux-mips-low.c (mips_get_pc): (mips_set_pc): Change prototype to take a regcache. Adjust. (mips_reinsert_addr): Adjust. (mips_collect_register): Change prototype to take a regcache. Adjust. (mips_supply_register): (mips_collect_register_32bit, mips_supply_register_32bit) (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset) (mips_store_fpregset): Ditto. * linux-ppc-low.c (ppc_supply_ptrace_register, ppc_supply_ptrace_register): Ditto. (parse_spufs_run): Adjust. (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset) (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset) (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to take a regcache. Adjust. * linux-s390-low.c (s390_collect_ptrace_register) (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc) (s390_set_pc): Change prototype to take a regcache. Adjust. (s390_arch_setup): Adjust. * linux-sh-low.c (sh_get_pc, sh_breakpoint_at) (sh_fill_gregset): Change prototype to take a regcache. Adjust. * linux-sparc-low.c (sparc_fill_gregset_to_stack) (sparc_fill_gregset, sparc_store_gregset_from_stack) (sparc_store_gregset, sparc_get_pc): Change prototype to take a regcache. Adjust. (sparc_breakpoint_at): Adjust. * linux-xtensa-low.c (xtensa_fill_gregset): (xtensa_store_gregset): (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc) (xtensa_set_pc): Change prototype to take a regcache. Adjust. * nto-low.c (nto_fetch_registers, nto_store_registers): Change prototype to take a regcache. Adjust. * win32-arm-low.c (arm_fetch_inferior_register) (arm_store_inferior_register): Change prototype to take a regcache. Adjust. * win32-i386-low.c (i386_fetch_inferior_register) (i386_store_inferior_register): Change prototype to take a regcache. Adjust. * win32-low.c (child_fetch_inferior_registers) (child_store_inferior_registers): Change prototype to take a regcache. Adjust. (win32_wait): Adjust. (win32_fetch_inferior_registers): Change prototype to take a regcache. Adjust. (win32_store_inferior_registers): Adjust. * win32-low.h (struct win32_target_ops) <fetch_inferior_register, store_inferior_register>: Change prototype to take a regcache.
2010-01-20 23:55:38 +01:00
2010-01-20 Pedro Alves <pedro@codesourcery.com>
* regcache.h (struct thread_info): Forward declare.
(struct regcache): New.
(new_register_cache): Adjust prototype.
(get_thread_regcache): Declare.
(free_register_cache): Adjust prototype.
(registers_to_string, registers_from_string): Ditto.
(supply_register, supply_register_by_name, collect_register)
(collect_register_as_string, collect_register_by_name): Ditto.
* regcache.c (struct inferior_regcache_data): Delete.
(get_regcache): Rename to ...
(get_thread_regcache): ... this. Adjust. Switch inferior before
fetching registers.
(regcache_invalidate_one): Adjust.
(regcache_invalidate): Fix prototype.
(new_register_cache): Return the new register cache.
(free_register_cache): Change prototype.
(realloc_register_cache): Adjust.
(registers_to_string): Change prototype to take a regcache. Adjust.
(registers_from_string): Ditto.
(register_data): Ditto.
(supply_register): Ditto.
(supply_register_by_name): Ditto.
(collect_register): Ditto.
(collect_register_as_string): Ditto.
(collect_register_by_name): Ditto.
* server.c (process_serial_event): Adjust.
* linux-low.h (regset_fill_func, regset_store_func): Change
prototype.
(get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
Change prototype.
* linux-low.c (get_stop_pc): Adjust.
(check_removed_breakpoint): Adjust.
(linux_wait_for_event): Adjust.
(linux_resume_one_lwp): Adjust.
(fetch_register): Add regcache parameter. Adjust.
(usr_store_inferior_registers): Ditto.
(regsets_fetch_inferior_registers): Ditto.
(regsets_store_inferior_registers): Ditto.
(linux_fetch_registers, linux_store_registers): Ditto.
* i387-fp.c (i387_cache_to_fsave): Change prototype to take a
regcache. Adjust.
2013-02-12 16:18:33 +01:00
(i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
Ditto.
* regcache.h (struct thread_info): Forward declare. (struct regcache): New. (new_register_cache): Adjust prototype. (get_thread_regcache): Declare. (free_register_cache): Adjust prototype. (registers_to_string, registers_from_string): Ditto. (supply_register, supply_register_by_name, collect_register) (collect_register_as_string, collect_register_by_name): Ditto. * regcache.c (struct inferior_regcache_data): Delete. (get_regcache): Rename to ... (get_thread_regcache): ... this. Adjust. Switch inferior before fetching registers. (regcache_invalidate_one): Adjust. (regcache_invalidate): Fix prototype. (new_register_cache): Return the new register cache. (free_register_cache): Change prototype. (realloc_register_cache): Adjust. (registers_to_string): Change prototype to take a regcache. Adjust. (registers_from_string): Ditto. (register_data): Ditto. (supply_register): Ditto. (supply_register_by_name): Ditto. (collect_register): Ditto. (collect_register_as_string): Ditto. (collect_register_by_name): Ditto. * server.c (process_serial_event): Adjust. * linux-low.h (regset_fill_func, regset_store_func): Change prototype. (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register): Change prototype. * linux-low.c (get_stop_pc): Adjust. (check_removed_breakpoint): Adjust. (linux_wait_for_event): Adjust. (linux_resume_one_lwp): Adjust. (fetch_register): Add regcache parameter. Adjust. (usr_store_inferior_registers): Ditto. (regsets_fetch_inferior_registers): Ditto. (regsets_store_inferior_registers): Ditto. (linux_fetch_registers, linux_store_registers): Ditto. * i387-fp.c (i387_cache_to_fsave): Change prototype to take a regcache. Adjust. (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto. * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change prototype to take a regcache. (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto. * remote-utils.c (convert_ascii_to_int, outreg) (prepare_resume_reply): Change prototype to take a regcache. Adjust. * target.h (struct target_ops) <fetch_registers, store_registers>: Change prototype to take a regcache. (fetch_inferior_registers, store_inferior_registers): Change prototype to take a regcache. Adjust. * proc-service.c (ps_lgetregs): Adjust. * linux-x86-low.c (x86_fill_gregset, x86_store_gregset) (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset) (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to take a regcache. Adjust. * linux-arm-low.c (arm_fill_gregset, arm_store_gregset) (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset) (arm_store_vfpregset, arm_get_pc, arm_set_pc): (arm_breakpoint_at): Change prototype to take a regcache. Adjust. * linux-cris-low.c (cris_get_pc, cris_set_pc) (cris_cannot_fetch_register): (cris_breakpoint_at): Change prototype to take a regcache. Adjust. * linux-crisv32-low.c (cris_get_pc, cris_set_pc, cris_reinsert_addr, cris_write_data_breakpoint): Change prototype to take a regcache. Adjust. (cris_breakpoint_at, cris_insert_point, cris_remove_point): Adjust. * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to take a regcache. Adjust. * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset) (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc, (m68k_set_pc): Change prototype to take a regcache. Adjust. * linux-mips-low.c (mips_get_pc): (mips_set_pc): Change prototype to take a regcache. Adjust. (mips_reinsert_addr): Adjust. (mips_collect_register): Change prototype to take a regcache. Adjust. (mips_supply_register): (mips_collect_register_32bit, mips_supply_register_32bit) (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset) (mips_store_fpregset): Ditto. * linux-ppc-low.c (ppc_supply_ptrace_register, ppc_supply_ptrace_register): Ditto. (parse_spufs_run): Adjust. (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset) (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset) (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to take a regcache. Adjust. * linux-s390-low.c (s390_collect_ptrace_register) (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc) (s390_set_pc): Change prototype to take a regcache. Adjust. (s390_arch_setup): Adjust. * linux-sh-low.c (sh_get_pc, sh_breakpoint_at) (sh_fill_gregset): Change prototype to take a regcache. Adjust. * linux-sparc-low.c (sparc_fill_gregset_to_stack) (sparc_fill_gregset, sparc_store_gregset_from_stack) (sparc_store_gregset, sparc_get_pc): Change prototype to take a regcache. Adjust. (sparc_breakpoint_at): Adjust. * linux-xtensa-low.c (xtensa_fill_gregset): (xtensa_store_gregset): (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc) (xtensa_set_pc): Change prototype to take a regcache. Adjust. * nto-low.c (nto_fetch_registers, nto_store_registers): Change prototype to take a regcache. Adjust. * win32-arm-low.c (arm_fetch_inferior_register) (arm_store_inferior_register): Change prototype to take a regcache. Adjust. * win32-i386-low.c (i386_fetch_inferior_register) (i386_store_inferior_register): Change prototype to take a regcache. Adjust. * win32-low.c (child_fetch_inferior_registers) (child_store_inferior_registers): Change prototype to take a regcache. Adjust. (win32_wait): Adjust. (win32_fetch_inferior_registers): Change prototype to take a regcache. Adjust. (win32_store_inferior_registers): Adjust. * win32-low.h (struct win32_target_ops) <fetch_inferior_register, store_inferior_register>: Change prototype to take a regcache.
2010-01-20 23:55:38 +01:00
* i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
prototype to take a regcache.
(i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
* remote-utils.c (convert_ascii_to_int, outreg)
(prepare_resume_reply): Change prototype to take a regcache.
Adjust.
* target.h (struct target_ops) <fetch_registers, store_registers>:
Change prototype to take a regcache.
(fetch_inferior_registers, store_inferior_registers): Change
prototype to take a regcache. Adjust.
* proc-service.c (ps_lgetregs): Adjust.
* linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
(x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
(x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
take a regcache. Adjust.
* linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
(arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
(arm_store_vfpregset, arm_get_pc, arm_set_pc):
(arm_breakpoint_at): Change prototype to take a regcache. Adjust.
* linux-cris-low.c (cris_get_pc, cris_set_pc)
(cris_cannot_fetch_register):
(cris_breakpoint_at): Change prototype to take a regcache.
Adjust.
* linux-crisv32-low.c (cris_get_pc, cris_set_pc,
cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
to take a regcache. Adjust.
(cris_breakpoint_at, cris_insert_point, cris_remove_point):
Adjust.
* linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
take a regcache. Adjust.
* linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
(m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
(m68k_set_pc): Change prototype to take a regcache. Adjust.
* linux-mips-low.c (mips_get_pc):
(mips_set_pc): Change prototype to take a regcache. Adjust.
(mips_reinsert_addr): Adjust.
(mips_collect_register): Change prototype to take a regcache.
Adjust.
(mips_supply_register):
(mips_collect_register_32bit, mips_supply_register_32bit)
(mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
(mips_store_fpregset): Ditto.
2013-02-12 16:18:33 +01:00
* linux-ppc-low.c (ppc_supply_ptrace_register)
(ppc_supply_ptrace_register): Ditto.
* regcache.h (struct thread_info): Forward declare. (struct regcache): New. (new_register_cache): Adjust prototype. (get_thread_regcache): Declare. (free_register_cache): Adjust prototype. (registers_to_string, registers_from_string): Ditto. (supply_register, supply_register_by_name, collect_register) (collect_register_as_string, collect_register_by_name): Ditto. * regcache.c (struct inferior_regcache_data): Delete. (get_regcache): Rename to ... (get_thread_regcache): ... this. Adjust. Switch inferior before fetching registers. (regcache_invalidate_one): Adjust. (regcache_invalidate): Fix prototype. (new_register_cache): Return the new register cache. (free_register_cache): Change prototype. (realloc_register_cache): Adjust. (registers_to_string): Change prototype to take a regcache. Adjust. (registers_from_string): Ditto. (register_data): Ditto. (supply_register): Ditto. (supply_register_by_name): Ditto. (collect_register): Ditto. (collect_register_as_string): Ditto. (collect_register_by_name): Ditto. * server.c (process_serial_event): Adjust. * linux-low.h (regset_fill_func, regset_store_func): Change prototype. (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register): Change prototype. * linux-low.c (get_stop_pc): Adjust. (check_removed_breakpoint): Adjust. (linux_wait_for_event): Adjust. (linux_resume_one_lwp): Adjust. (fetch_register): Add regcache parameter. Adjust. (usr_store_inferior_registers): Ditto. (regsets_fetch_inferior_registers): Ditto. (regsets_store_inferior_registers): Ditto. (linux_fetch_registers, linux_store_registers): Ditto. * i387-fp.c (i387_cache_to_fsave): Change prototype to take a regcache. Adjust. (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto. * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change prototype to take a regcache. (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto. * remote-utils.c (convert_ascii_to_int, outreg) (prepare_resume_reply): Change prototype to take a regcache. Adjust. * target.h (struct target_ops) <fetch_registers, store_registers>: Change prototype to take a regcache. (fetch_inferior_registers, store_inferior_registers): Change prototype to take a regcache. Adjust. * proc-service.c (ps_lgetregs): Adjust. * linux-x86-low.c (x86_fill_gregset, x86_store_gregset) (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset) (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to take a regcache. Adjust. * linux-arm-low.c (arm_fill_gregset, arm_store_gregset) (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset) (arm_store_vfpregset, arm_get_pc, arm_set_pc): (arm_breakpoint_at): Change prototype to take a regcache. Adjust. * linux-cris-low.c (cris_get_pc, cris_set_pc) (cris_cannot_fetch_register): (cris_breakpoint_at): Change prototype to take a regcache. Adjust. * linux-crisv32-low.c (cris_get_pc, cris_set_pc, cris_reinsert_addr, cris_write_data_breakpoint): Change prototype to take a regcache. Adjust. (cris_breakpoint_at, cris_insert_point, cris_remove_point): Adjust. * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to take a regcache. Adjust. * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset) (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc, (m68k_set_pc): Change prototype to take a regcache. Adjust. * linux-mips-low.c (mips_get_pc): (mips_set_pc): Change prototype to take a regcache. Adjust. (mips_reinsert_addr): Adjust. (mips_collect_register): Change prototype to take a regcache. Adjust. (mips_supply_register): (mips_collect_register_32bit, mips_supply_register_32bit) (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset) (mips_store_fpregset): Ditto. * linux-ppc-low.c (ppc_supply_ptrace_register, ppc_supply_ptrace_register): Ditto. (parse_spufs_run): Adjust. (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset) (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset) (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to take a regcache. Adjust. * linux-s390-low.c (s390_collect_ptrace_register) (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc) (s390_set_pc): Change prototype to take a regcache. Adjust. (s390_arch_setup): Adjust. * linux-sh-low.c (sh_get_pc, sh_breakpoint_at) (sh_fill_gregset): Change prototype to take a regcache. Adjust. * linux-sparc-low.c (sparc_fill_gregset_to_stack) (sparc_fill_gregset, sparc_store_gregset_from_stack) (sparc_store_gregset, sparc_get_pc): Change prototype to take a regcache. Adjust. (sparc_breakpoint_at): Adjust. * linux-xtensa-low.c (xtensa_fill_gregset): (xtensa_store_gregset): (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc) (xtensa_set_pc): Change prototype to take a regcache. Adjust. * nto-low.c (nto_fetch_registers, nto_store_registers): Change prototype to take a regcache. Adjust. * win32-arm-low.c (arm_fetch_inferior_register) (arm_store_inferior_register): Change prototype to take a regcache. Adjust. * win32-i386-low.c (i386_fetch_inferior_register) (i386_store_inferior_register): Change prototype to take a regcache. Adjust. * win32-low.c (child_fetch_inferior_registers) (child_store_inferior_registers): Change prototype to take a regcache. Adjust. (win32_wait): Adjust. (win32_fetch_inferior_registers): Change prototype to take a regcache. Adjust. (win32_store_inferior_registers): Adjust. * win32-low.h (struct win32_target_ops) <fetch_inferior_register, store_inferior_register>: Change prototype to take a regcache.
2010-01-20 23:55:38 +01:00
(parse_spufs_run): Adjust.
(ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
(ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
(ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
take a regcache. Adjust.
* linux-s390-low.c (s390_collect_ptrace_register)
(s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
(s390_set_pc): Change prototype to take a regcache. Adjust.
(s390_arch_setup): Adjust.
* linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
(sh_fill_gregset): Change prototype to take a regcache. Adjust.
* linux-sparc-low.c (sparc_fill_gregset_to_stack)
(sparc_fill_gregset, sparc_store_gregset_from_stack)
(sparc_store_gregset, sparc_get_pc): Change prototype to take a
regcache. Adjust.
(sparc_breakpoint_at): Adjust.
* linux-xtensa-low.c (xtensa_fill_gregset):
(xtensa_store_gregset):
(xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
(xtensa_set_pc): Change prototype to take a regcache. Adjust.
* nto-low.c (nto_fetch_registers, nto_store_registers): Change
prototype to take a regcache. Adjust.
* win32-arm-low.c (arm_fetch_inferior_register)
(arm_store_inferior_register): Change prototype to take a
regcache. Adjust.
* win32-i386-low.c (i386_fetch_inferior_register)
(i386_store_inferior_register): Change prototype to take a
regcache. Adjust.
* win32-low.c (child_fetch_inferior_registers)
(child_store_inferior_registers): Change prototype to take a
regcache. Adjust.
(win32_wait): Adjust.
(win32_fetch_inferior_registers): Change prototype to take a
regcache. Adjust.
(win32_store_inferior_registers): Adjust.
* win32-low.h (struct win32_target_ops) <fetch_inferior_register,
store_inferior_register>: Change prototype to take a regcache.
2010-01-20 Doug Evans <dje@google.com>
* linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
#ifdef.
(linux_wait_for_event1, linux_init_signals): Ditto.
(W_STOPCODE): Provide definition if missing.
Implement core awareness. * bcache.c (compare_ints): Remove (print_percentage): Use compare_positive_ints. * defs.h (compare_positive_ints): Declare. * linux-nat.h (struct lin_lwp): New field core. (linux_nat_core_of_thread_1): Declare. * linux-nat.c (add_lwp): Init the 'core' field. (linux_nat_wait_1): Record the core. (linux_nat_core_of_thread_1, linux_nat_core_of_thread): New. (linux_nat_add_target): Register the above. * linux-thread-db.c (update_thread_core): New. (thread_db_find_new_threads): Update core information for every thread. * remote.c (struct private_thread_info): New. (free_private_thread_info, demand_private_info): New. (PACKET_qXfer_threads, use_osdata_threads): New. (struct thread_item, threads_parsing_context (start_thread, end_thread, thread_attributes) (thread_children, threads_children, threads_elements): New. (remote_threads_info): Try qXfer:threads before anything else. (remote_protocol_packets): Register qXfer:threads. (remote_open_1): Init use_osdata_threads. (struct stop_reply): New field 'core'. (remote_parse_stop_reply): Parse core number. (process_stop_reply): Record core number. (remote_xfer_partial): Handle qXfer:threads. (remote_core_of_thread): New. (init_remote_ops): Register remote_core_of_thread. (_initialize_remote): Register qXfer:read. * target.c (target_core_of_thread): New * target.h (enum target_object): New value TARGET_OBJECT_THREADS. (struct target_ops): New field to_core_of_threads. (target_core_of_thread): Declare. * gdbthread.h (struct thread_info): New field private_dtor. * thread.c (print_thread_info): Report the core. * ui-out.c (MAX_UI_OUT_LEVELS): Increase. * utils.c (compare_positive_ints): New. * features/threads.dtd: New. * mi/mi-interp.c (mi_on_normal_stop): Report the core. * mi/mi-main.c (struct collect_cores_data, collect_cores) (do_nothing, free_vector_of_osdata_items) (splay_tree_int_comparator, free_splay_tree): New. (print_one_inferior_data): Implemented printing of selected inferiors. Collect and print cores. (output_cores): New. (mi_cmd_list_thread_groups): Support --recurse. Permit specifying thread groups together with --available.
2010-01-12 22:40:25 +01:00
2010-01-13 Vladimir Prus <vladimir@codesourcery.com>
* linux-low.c (linux_core_of_thread): New.
(compare_ints, show_process, list_threads): New.
(linux_qxfer_osdata): Report threads and cores.
(linux_target_op): Register linux_core_of_thread.
* remote-utils.c (prepare_resume_reply): Report the core.
(buffer_xml_printf): Support %d specifier.
* server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
New.
(handle_query): Handle qXfer:threads. Announce availability
thereof.
* target.h (struct target_ops): New field core_of_thread.
* features/Makefile (WHICH): Add s390-linux32, s390-linux64, and s390x-linux64. (s390-linux32-expedite): Define. (s390-linux64-expedite): Define. (s390x-linux64-expedite): Define. * features/s390-acr.xml: New file. * features/s390-fpr.xml: New file. * features/s390-core32.xml: New file. * features/s390-core64.xml: New file. * features/s390x-core64.xml: New file. * features/s390-linux32.xml: New file. * features/s390-linux64.xml: New file. * features/s390x-linux64.xml: New file. * features/s390-linux32.c: New generated file. * features/s390-linux64.c: New generated file. * features/s390x-linux64.c: New generated file. * regformats/s390-linux32.dat: New generated file. * regformats/s390-linux64.dat: New generated file. * regformats/s390x-linux64.dat: New generated file. * regformats/reg-s390.dat: Remove. * regformats/reg-s390x.dat: Remove. * s390-nat.c: Include "auxv.h" and <elf.h>. (HWCAP_S390_HIGH_GPRS): Define if undefined. (s390_target_wordsize): New function. (s390_auxv_parse): Likewise. (s390_get_hwcap): Likewise. (s390_read_description): Likewise. (_initialize_s390_nat): Install s390_auxv_parse and s390_read_description. * s390-tdep.c: Include "features/s390-linux32.c", "features/s390-linux64.c", and "features/s390x-linux64.c". (struct gdbarch_tdep): Add gpr_full_regnum, pc_regnum, and cc_regnum. (s390_register_call_saved): New function. (s390_register_name): Remove. (s390_register_type): Remove. (s390_dwarf_regmap): Add lower half GPR pseudo DWARF CFI regnums. (s390_dwarf_reg_to_regnum): Remap GPR regnums to full GPRs. (s390_adjust_frame_regnum): Remap GPR regnums to lower halves for CFI. (s390_pseudo_register_name): New function. (s390_pseudo_register_type): New function. (s390_pseudo_register_read): Handle both 32-bit and 64-bit cases. Handle full GPR pesudos and varying pseudo register numbers. (s390_pseudo_register_write): Likewise (s390x_pseudo_register_read): Remove. (s390x_pseudo_register_write): Likewise. (s390_register_group): Remove. (s390_pseudo_register_group): New function. (s390_regmap_gregset): Add GPR upper halves. (s390x_regmap_gregset): Likewise. (s390_regmap_fpregset): Likewise. (s390_regmap_upper): New global variable. (s390_upper_regset): New global variable. (s390_upper_regset_sections): New global variable. (s390_regset_from_core_section): Handle GPR upper halves. (s390_core_read_description): New function. (s390_prologue_frame_unwind_cache): Set up ABI call-saved/clobbered register information. Handle varying pseudo register numbers. (s390_backchain_frame_unwind_cache): Likewise. (s390_frame_prev_register): Unwind full GPRs to show lower halves. (s390_stub_frame_unwind_cache): Handle varying pseudo register numbers. (s390_sigtramp_frame_unwind_cache): Unwind PSWM and PSWA as well as PC and CC pseudos. Unwind upper halves and full GPRs as appropriate. Handle varying pseudo register numbers. (s390_unwind_pc): Handle varying pseudo register numbers. (s390_dwarf2_prev_register): New function. (s390_dwarf2_frame_init_reg): Set up ABI call-saved/clobbered register information. Handle varying pseudo register numbers. Install s390_dwarf2_prev_register to unwind full GPRs. (s390_gdbarch_init): Handle target descriptions. Assign varying pseudo register numbers. Install s390_adjust_frame_regnum. (_initialize_s390_tdep): Initialize target descriptions. * s390-tdep.h (S390_R0_UPPER_REGNUM .. S390_R15_UPPER_REGNUM): Define. (S390_NUM_REGS): Redefine to include upper half registers. (S390_PC_REGNUM, S390_CC_REGNUM): Remove. (S390_NUM_PSEUDO_REGS, S390_NUM_TOTAL_REGS): Likewise. (tdesc_s390_linux32): Add declaration. (tdesc_s390_linux64): Likewise. (tdesc_s390x_linux64): Likewise. gdb/testsuite/ * gdb.xml/tdesc-regs.exp: Support s390*-*-* targets. gdbserver/ * Makefile.in (clean): Remove new generated files. (reg-s390.o, reg-s390.c): Remove rules. (reg-s390x.o, reg-s390x.c): Likewise. (s390-linux32.o, s390-linux32.c): Add rules. (s390-linux64.o, s390-linux64.c): Likewise. (s390x-linux64.o, s390x-linux64.c): Likewise. * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles. * linux-s390-low.c: Include <elf.h>. (HWCAP_S390_HIGH_GPRS): Define if undefined. (init_registers_s390): Remove prototype. (init_registers_s390x): Likewise. (init_registers_s390_linux32): Add prototype. (init_registers_s390_linux64): Likewise. (init_registers_s390x_linux64): Likewise. (s390_num_regs_3264): New define. (s390_regmap_3264): New global variable. (s390_cannot_fetch_register): Remove obsolete check. (s390_cannot_store_register): Likewise. (s390_collect_ptrace_register): Handle upper/lower register halves. (s390_supply_ptrace_register): Likewise. (s390_fill_gregset): Update to register number changes. (s390_get_hwcap): New routine. (s390_arch_setup): Detect 32-bit process running on 64-bit system. Install appropriate regmap and register set.
2010-01-04 16:03:01 +01:00
2010-01-04 Ulrich Weigand <uweigand@de.ibm.com>
* Makefile.in (clean): Remove new generated files.
(reg-s390.o, reg-s390.c): Remove rules.
(reg-s390x.o, reg-s390x.c): Likewise.
(s390-linux32.o, s390-linux32.c): Add rules.
(s390-linux64.o, s390-linux64.c): Likewise.
(s390x-linux64.o, s390x-linux64.c): Likewise.
* configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
* linux-s390-low.c: Include <elf.h>.
(HWCAP_S390_HIGH_GPRS): Define if undefined.
(init_registers_s390): Remove prototype.
(init_registers_s390x): Likewise.
(init_registers_s390_linux32): Add prototype.
(init_registers_s390_linux64): Likewise.
(init_registers_s390x_linux64): Likewise.
(s390_num_regs_3264): New define.
(s390_regmap_3264): New global variable.
(s390_cannot_fetch_register): Remove obsolete check.
(s390_cannot_store_register): Likewise.
(s390_collect_ptrace_register): Handle upper/lower register halves.
(s390_supply_ptrace_register): Likewise.
(s390_fill_gregset): Update to register number changes.
(s390_get_hwcap): New routine.
(s390_arch_setup): Detect 32-bit process running on 64-bit system.
Install appropriate regmap and register set.
2010-01-01 Joel Brobecker <brobecker@adacore.com>
* server.c (gdbserver_version): Update copyright year to 2010.
* gdbreplay.c (gdbreplay_version): Likewise.
2009-12-28 Doug Evans <dje@google.com>
* linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
elf/external.h. Include <elf.h> instead but only if necessary.
2009-12-28 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_remove_process): Remove `detaching'
parameter. Don't release/detach from thread_db here.
(linux_kill): Release/detach from thread_db here, ...
(linux_detach): ... and here, before actually detaching.
(linux_wait_1): ... and here, when a process exits.
* thread-db.c (any_thread_of): New.
(thread_db_free): Switch the current inferior to a thread of the
passed in process.
2009-12-21 Doug Evans <dje@google.com>
* linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
* linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
warning ifndef __NR_tkill. Move setting of errno there too.
Delete unnecessary resetting of errno after syscall.
Minor comment changes to match gdb/linux-nat.c:kill_lwp.
* configure.ac: Check for dladdr.
* config.in: Regenerate.
* configure: Regenerate.
* thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
(try_thread_db_load): Update.
* linux-low.c (my_waitpid): Delete unnecessary prototype.
2009-12-18 Doug Evans <dje@google.com>
* event-loop.c: Include unistd.h if it exists.
* linux-low.c (my_waitpid): Move definition away from being in
between linux_tracefork_child/linux_test_for_tracefork.
* gdb_proc_service.h (psaddr_t): Fix type.
* thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
signature to match glibc.
2009-12-16 Doug Evans <dje@google.com>
* linux-low.c (linux_read_memory): Fix argument to read.
2009-11-26 Pedro Alves <pedro@codesourcery.com>
* win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
events, don't leave current_inferior pointing at null.
2009-11-26 Pedro Alves <pedro@codesourcery.com>
* win32-low.c (LOG): Delete.
(OUTMSG): Output to stderr.
(OUTMSG2): Conditionalize on `debug_threads' variable, instead of
on compile time LOG macro.
(win32_wait): Fix debug output.
2009-11-26 Pedro Alves <pedro@codesourcery.com>
* win32-low.c (win32_add_one_solib): If the dll name is
"ntdll.dll", prepend the system directory to the dll path.
2009-11-17 Daniel Jacobowitz <dan@codesourcery.com>
* m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
2009-11-17 Nathan Sidwell <nathan@codesourcery.com>
2010-08-27 14:02:20 +02:00
Vladimir Prus <vladimir@codesourcery.com>
* Makefile.in (reg-cf.o, reg-cf.c): New targets.
* configure.ac: Check for __mcoldfire__ and set
gdb_cv_m68k_is_coldfire.
* configure.srv: Use gdb_cv_m68k_is_coldfire to select between
reg-cf.o and reg-m68k.o.
* configure: Regenerated.
2009-11-16 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_remove_process): Add `detaching' parameter.
Pass it to thread_db_free.
(linux_kill, linux_detach, linux_wait_1): Adjust to pass the
proper `detaching' argument to linux_remove_process.
* linux-low.h (thread_db_free): Add `detaching' parameter.
* thread-db.c (thread_db_init): Pass false as `detaching' argument
to thread_db_free.
(thread_db_free): Add `detaching' parameter. Only
call td_ta_clear_event if detaching from process.
2009-11-12 Maxim Kuvyrkov <maxim@codesourcery.com>
* thread-db.c (thread_db_free): Fix typo.
2009-11-11 Paul Pluzhnikov <ppluzhnikov@google.com>
PR gdb/10838
* thread-db.c (thread_db_free): Call td_ta_clear_event.
2009-11-03 Nathan Sidwell <nathan@codesourcery.com>
* configure.ac (i[34567]86-*): Check if we're targetting x86-64
with an i686 compiler.
* configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
needed.
* configure: Rebuilt.
2009-10-29 Sandra Loosemore <sandra@codesourcery.com>
PR gdb/10783
* server.c (handle_search_memory_1): Correct read_addr initialization
in loop for searching subsequent chunks.
2009-10-29 Paul Pluzhnikov <ppluzhnikov@google.com>
* configure.ac: New --with-libthread-db option.
* thread-db.c: Allow direct dependence on libthread_db.
(thread_db_free): Adjust.
* config.in: Regenerate.
* configure: Likewise.
2010-08-27 14:02:20 +02:00
2009-10-28 Paul Pluzhnikov <ppluzhnikov@google.com>
PR gdb/10757
* thread-db.c (attach_thread): New function.
(maybe_attach_thread): Return success/failure.
(find_new_threads_callback): Adjust.
2010-08-27 14:02:20 +02:00
(thread_db_find_new_threads): Loop until no new threads.
2009-10-13 Pedro Alves <pedro@codesourcery.com>
* proc-service.c (ps_lgetregs): Formatting.
2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com>
* acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
* configure.ac: Adjust.
* linux-low.h (struct process_info_private): Move members to struct
thread_db.
(thread_db_free, thread_db_handle_monitor_command): New prototype.
* linux-low.c (linux_remove_process): Adjust.
(linux_wait_for_event_1, linux_look_up_symbols): Likewise.
* server.c (handle_query): Move code ...
(handle_monitor_command): ... here. New function.
* target.h (struct target_ops): New member.
* thread-db.c (struct thread_db): New.
(libthread_db_search_path): New variable.
(thread_db_create_event, thread_db_enable_reporting)
(find_one_thread, maybe_attach_thread, find_new_threads_callback)
(thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
(try_thread_db_load_1, dladdr_to_soname): New functions.
(try_thread_db_load, thread_db_load_search): New functions.
(thread_db_init): Search for libthread_db.
(thread_db_free): New function.
(thread_db_handle_monitor_command): Likewise.
* config.in: Regenerate.
* configure: Regenerate.
2010-08-27 14:02:20 +02:00
2009-09-27 Ulrich Weigand <uweigand@de.ibm.com>
* spu-low.c (spu_kill): Wait for inferior to terminate.
Call clear_inferiors.
(spu_detach): Call clear_inferiors.
Regenerate tree using Autoconf 2.64 and Automake 1.11. config/: * override.m4 (_GCC_AUTOCONF_VERSION): Bump to 2.64. /: * configure: Regenerate. etc/: * configure: Regenerate. sim/common/: * config.in: Regenerate. * configure: Likewise. sim/iq2000/: * config.in: Regenerate. * configure: Likewise. sim/d10v/: * config.in: Regenerate. * configure: Likewise. sim/igen/: * config.in: Regenerate. * configure: Likewise. sim/m32r/: * config.in: Regenerate. * configure: Likewise. sim/frv/: * config.in: Regenerate. * configure: Likewise. sim/: * avr/config.in: Regenerate. * avr/configure: Likewise. * configure: Likewise. * cris/config.in: Likewise. * cris/configure: Likewise. sim/h8300/: * config.in: Regenerate. * configure: Likewise. sim/mn10300/: * config.in: Regenerate. * configure: Likewise. sim/ppc/: * config.in: Regenerate. * configure: Likewise. sim/erc32/: * config.in: Regenerate. * configure: Likewise. sim/arm/: * config.in: Regenerate. * configure: Likewise. sim/m68hc11/: * config.in: Regenerate. * configure: Likewise. sim/lm32/: * config.in: Regenerate. * configure: Likewise. sim/sh64/: * config.in: Regenerate. * configure: Likewise. sim/v850/: * config.in: Regenerate. * configure: Likewise. sim/cr16/: * config.in: Regenerate. * configure: Likewise. sim/moxie/: * config.in: Regenerate. * configure: Likewise. sim/m32c/: * config.in: Regenerate. * configure: Likewise. sim/mips/: * config.in: Regenerate. * configure: Likewise. sim/mcore/: * config.in: Regenerate. * configure: Likewise. sim/testsuite/d10v-elf/: * configure: Regenerate. sim/testsuite/: * configure: Regenerate. sim/testsuite/frv-elf/: * configure: Regenerate. sim/testsuite/m32r-elf/: * configure: Regenerate. sim/testsuite/mips64el-elf/: * configure: Regenerate. sim/sh/: * config.in: Regenerate. * configure: Likewise. gold/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. * testsuite/Makefile.in: Likewise. gprof/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * configure: Likewise. * gconfig.in: Likewise. opcodes/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. gas/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. * doc/Makefile.in: Likewise. ld/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. gdb/: * aclocal.m4: Regenerate. * config.in: Likewise. * configure: Likewise. * gnulib/Makefile.in: Likewise. gdb/doc/: * configure: Regenerate. gdb/gdbserver/: * aclocal.m4: Regenerate. * config.in: Likewise. * configure: Likewise. gdb/testsuite/: * configure: Regenerate. * gdb.hp/configure: Likewise. * gdb.hp/gdb.aCC/configure: Likewise. * gdb.hp/gdb.base-hp/configure: Likewise. * gdb.hp/gdb.compat/configure: Likewise. * gdb.hp/gdb.defects/configure: Likewise. * gdb.hp/gdb.objdbg/configure: Likewise. * gdb.stabs/configure: Likewise. binutils/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. * doc/Makefile.in: Likewise. bfd/: * Makefile.in: Regenerate. * aclocal.m4: Likewise. * config.in: Likewise. * configure: Likewise. bfd/doc/: * Makefile.in: Regenerate. readline/: * configure: Regenerate. readline/examples/rlfe/: * configure: Regenerate.
2009-08-22 18:56:56 +02:00
2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* aclocal.m4: Regenerate.
* config.in: Likewise.
* configure: Likewise.
2009-07-31 Ulrich Weigand <uweigand@de.ibm.com>
* linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
(parse_spufs_run): New function.
(ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
(ppc_breakpoint_at): Handle SPU breakpoints.
2009-07-31 Ulrich Weigand <uweigand@de.ibm.com>
* linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
(SPUFS_MAGIC): Define.
(spu_enumerate_spu_ids): New function.
(linux_qxfer_spu): New function.
(linux_target_ops): Install linux_qxfer_spu.
ChangeLog: * features/Makefile: Allow sub-platform specific expedite settings. (WHICH): Add rs6000/powerpc-cell32l and rs6000/powerpc-cell64l. (rs6000/powerpc-cell32l-expedite): Define. (rs6000/powerpc-cell64l-expedite): Likewise. * features/rs6000/powerpc-cell32l.xml: New file. * features/rs6000/powerpc-cell64l.xml: New file. * features/rs6000/powerpc-cell32l.c: New generated file. * features/rs6000/powerpc-cell64l.c: New generated file. * regformats/rs6000/powerpc-cell32l.dat: New generated file. * regformats/rs6000/powerpc-cell64l.dat: New generated file. * config/djgpp/fnchange.lst: Add mappings for new files. * ppc-linux-tdep.h (tdesc_powerpc_cell32l): Add prototype. (tdesc_powerpc_cell64l): Likewise. * ppc-linux-tdep.c: Include "features/rs6000/powerpc-cell32l.c" and "features/rs6000/powerpc-cell64l.c". (_initialize_ppc_linux_tdep): Initialize target descriptions. (ppc_linux_spu_section): New function. (ppc_linux_core_read_description): Detect Cell/B.E. core files. * ppc-linux-nat.c (PPC_FEATURE_CELL): Define. (ppc_linux_read_description): Detect Cell/B.E. architecture. * rs6000-tdep.c (rs6000_gdbarch_init): Do not trust BFD wordsize if exec file is not PowerPC architecture. gdbserver/ChangeLog: * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o and powerpc-cell64l.o to srv_regobj. Add rs6000/powerpc-cell32l.xml and rs6000/powerpc-cell64l.xml to srv_xmlfiles. * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules. (powerpc-cell64l.o, powerpc-cell64l.c): Likewise. (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c. * linux-ppc-low.c (PPC_FEATURE_CELL): Define. (init_registers_powerpc_cell32l): Add prototype. (init_registers_powerpc_cell64l): Likewise. (ppc_arch_setup): Detect Cell/B.E. architecture.
2009-07-31 17:23:21 +02:00
2009-07-31 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
and powerpc-cell64l.o to srv_regobj. Add rs6000/powerpc-cell32l.xml
and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
* Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
(powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
(clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
* linux-ppc-low.c (PPC_FEATURE_CELL): Define.
(init_registers_powerpc_cell32l): Add prototype.
(init_registers_powerpc_cell64l): Likewise.
(ppc_arch_setup): Detect Cell/B.E. architecture.
2009-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in (datarootdir): New variable.
* NEWS: Mention ARM VFP support. * target-descriptions.c (tdesc_register_type): Make public. (tdesc_unnumbered_register): New function. (tdesc_register_reggroup_p): Allow missing pseudo_register_reggroup_p. * target-descriptions.h (tdesc_register_type): Declare. (tdesc_unnumbered_register): Declare. * arm-tdep.c (arm_neon_quad_read, arm_neon_quad_write): New functions. (arm_push_dummy_call): Use arm_neon_quad_write. (arm_neon_double_type, arm_neon_quad_type): New functions. (arm_register_type): Handle VFP and NEON registers. Override the types of double-precision registers for NEON. Disable FPA registers if they are not present. (arm_dwarf_reg_to_regnum): Add current VFP and NEON register numbers. (arm_return_value): Use arm_neon_quad_write and arm_neon_quad_read. (arm_register_name): Handle VFP single and NEON quad registers. (arm_pseudo_read, arm_pseudo_write): New functions. (arm_gdbarch_init): Check for VFP and NEON in the target description. Assign numbers to double-precision registers. Register VFP and NEON pseudo registers. Remove a shadowed "i" variable. * arm-tdep.h (enum gdb_regnum): Add ARM_D0_REGNUM and ARM_D31_REGNUM. (struct gdbarch_tdep): Add have_neon_pseudos, have_neon, have_vfp_registers, have_vfp_pseudos, neon_double_type, and neon_quad_type. * features/Makefile: Make expedite settings only architecture specific. (WHICH): Add new ARM descriptions. * features/arm-with-neon.xml, features/arm-with-vfpv2.c, features/arm-with-vfpv3.c, features/arm-vfpv2.xml, features/arm-vfpv3.xml, features/arm-with-vfpv2.xml, features/arm-with-vfpv3.xml, features/arm-with-neon.c: New files. * regformats/arm-with-neon.dat, regformats/arm-with-vfpv2.dat, regformats/arm-with-vfpv3.dat: Generate. doc/ * gdb.texinfo (ARM Features): Document org.gnu.gdb.arm.vfp and org.gnu.gdb.arm.neon. gdbserver/ * linux-low.c (linux_write_memory): Update debugging output. * Makefile.in (clean): Add new descriptions. (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o) (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules. * configure.srv: Add new files for arm*-*-linux*. * linux-arm-low.c: Add new declarations. (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined. (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3) (HWCAP_VFPv3D16): New. (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT instead of __IWMMXT__. (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap) (arm_arch_setup): New. (target_regsets): Remove #ifdef. Add VFP regset. (the_low_target): Use arm_arch_setup. testsuite/ * gdb.base/float.exp: Handle VFP registers.
2009-07-28 20:26:51 +02:00
2009-07-28 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_write_memory): Update debugging output.
* Makefile.in (clean): Add new descriptions.
(arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
(arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
* configure.srv: Add new files for arm*-*-linux*.
* linux-arm-low.c: Add new declarations.
(PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
(arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
(HWCAP_VFPv3D16): New.
(arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
instead of __IWMMXT__.
(arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
(arm_arch_setup): New.
(target_regsets): Remove #ifdef. Add VFP regset.
(the_low_target): Use arm_arch_setup.
2009-07-28 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
the main thread again.
2009-07-06 Aleksandar Ristovski <aristovski@qnx.com>
Adding Neutrino gdbserver.
* configure: Regenerated.
* configure.ac: Add case for srv_qnx and set LIBS accordingly.
* configure.srv (i[34567]86-*-nto*): New target.
* nto-low.c, nto-low.h, nto-x86-low.c: New files.
* remote-utils.c [__QNX__]: Include sys/iomgr.h
(nto_comctrl) [__QNX__]: New function.
(enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
2009-07-06 00:58:53 +02:00
2009-07-05 Danny Backx <dannybackx@users.sourceforge.net>
* configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
srv_tgtobj.
2009-07-04 Danny Backx <dannybackx@users.sourceforge.net>
Pedro Alves <pedro@codesourcery.com>
* win32-i386-low.c (i386_get_thread_context): Handle systems that
don't support CONTEXT_EXTENDED_REGISTERS.
(i386_win32_breakpoint, i386_win32_breakpoint_len): New.
(the_low_target): Install them.
* win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
failing with ERROR_PIPE_NOT_CONNECTED.
Add h/w watchpoint support to x86-linux, win32-i386. * Makefile.in (SFILES): Add i386-low.c (i386_low_h): Define. (i386-low.o): Add dependencies. (linux-x86-low.o): Add i386-low.h dependency. (win32-i386-low.o): Ditto. * i386-low.c: New file. * i386-low.h: New file. * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj. (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto. * linux-low.c (linux_add_process): Initialize arch_private. (linux_remove_process): Free arch_private. (add_lwp): Initialize arch_private. (delete_lwp): Free arch_private. (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if provided. * linux-low.h (process_info_private): New member arch_private. (lwp_info): New member arch_private. (linux_target_ops): New members new_process, new_thread, prepare_to_resume. (ptid_of): New macro. * linux-x86-low.c: Include stddef.h, i386-low.h. (arch_process_info): New struct. (arch_lwp_info): New struct. (x86_linux_dr_get, x86_linux_dr_set): New functions. (i386_dr_low_set_addr, i386_dr_low_set_control): New functions. (i386_dr_low_get_status): New function. (x86_insert_point, x86_remove_point): New functions. (x86_stopped_by_watchpoint): New function. (x86_stopped_data_address): New function. (x86_linux_new_process, x86_linux_new_thread): New functions. (x86_linux_prepare_to_resume): New function. (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address, new_process, new_thread, prepare_to_resume. * server.c (debug_hw_points): New global. (monitor_show_help): Document set debug-hw-points. (handle_query): Process "set debug-hw-points". * server.h (debug_hw_points): Declare. (paddress): Declare. * utils.c (NUMCELLS, CELLSIZE): New macros. (get_sell, xsnprintf, paddress): New functions. * win32-arm-low.c (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address. * win32-i386-low.c: Include i386-low.h. (debug_reg_state): Replaces dr. (i386_dr_low_set_addr, i386_dr_low_set_control): New functions. (i386_dr_low_get_status): New function. (i386_insert_point, i386_remove_point): New functions. (i386_stopped_by_watchpoint): New function. (i386_stopped_data_address): New function. (i386_initial_stuff): Update. (get_thread_context,set_thread_context,i386_thread_added): Update. (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address. * win32-low.c (win32_insert_watchpoint): New function. (win32_remove_watchpoint): New function. (win32_stopped_by_watchpoint): New function. (win32_stopped_data_address): New function. (win32_target_ops): Add entries for insert_watchpoint, remove_watchpoint, stopped_by_watchpoint, stopped_data_address. * win32-low.h (win32_target_ops): New members insert_point, remove_point, stopped_by_watchpoint, stopped_data_address.
2009-06-30 18:35:25 +02:00
2009-06-30 Doug Evans <dje@google.com>
Pierre Muller <muller@ics.u-strasbg.fr>
Add h/w watchpoint support to x86-linux, win32-i386.
* Makefile.in (SFILES): Add i386-low.c
(i386_low_h): Define.
(i386-low.o): Add dependencies.
(linux-x86-low.o): Add i386-low.h dependency.
(win32-i386-low.o): Ditto.
* i386-low.c: New file.
* i386-low.h: New file.
* configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
(i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
* linux-low.c (linux_add_process): Initialize arch_private.
(linux_remove_process): Free arch_private.
(add_lwp): Initialize arch_private.
(delete_lwp): Free arch_private.
(linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
provided.
* linux-low.h (process_info_private): New member arch_private.
(lwp_info): New member arch_private.
(linux_target_ops): New members new_process, new_thread,
prepare_to_resume.
(ptid_of): New macro.
* linux-x86-low.c: Include stddef.h, i386-low.h.
(arch_process_info): New struct.
(arch_lwp_info): New struct.
(x86_linux_dr_get, x86_linux_dr_set): New functions.
(i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
(i386_dr_low_get_status): New function.
(x86_insert_point, x86_remove_point): New functions.
(x86_stopped_by_watchpoint): New function.
(x86_stopped_data_address): New function.
(x86_linux_new_process, x86_linux_new_thread): New functions.
(x86_linux_prepare_to_resume): New function.
(the_low_target): Add entries for insert_point, remove_point,
stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
prepare_to_resume.
* server.c (debug_hw_points): New global.
(monitor_show_help): Document set debug-hw-points.
(handle_query): Process "set debug-hw-points".
* server.h (debug_hw_points): Declare.
(paddress): Declare.
* utils.c (NUMCELLS, CELLSIZE): New macros.
(get_sell, xsnprintf, paddress): New functions.
* win32-arm-low.c (the_low_target): Add entries for insert_point,
remove_point, stopped_by_watchpoint, stopped_data_address.
* win32-i386-low.c: Include i386-low.h.
(debug_reg_state): Replaces dr.
(i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
(i386_dr_low_get_status): New function.
(i386_insert_point, i386_remove_point): New functions.
(i386_stopped_by_watchpoint): New function.
(i386_stopped_data_address): New function.
(i386_initial_stuff): Update.
(get_thread_context,set_thread_context,i386_thread_added): Update.
(the_low_target): Add entries for insert_point,
remove_point, stopped_by_watchpoint, stopped_data_address.
* win32-low.c (win32_insert_watchpoint): New function.
(win32_remove_watchpoint): New function.
(win32_stopped_by_watchpoint): New function.
(win32_stopped_data_address): New function.
(win32_target_ops): Add entries for insert_watchpoint,
remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
* win32-low.h (win32_target_ops): New members insert_point,
remove_point, stopped_by_watchpoint, stopped_data_address.
2009-06-25 Pedro Alves <pedro@codesourcery.com>
* server.c (process_serial_event): Re-return unsupported, not
error, if the type isn't recognized. Re-allow supporting only
insert or remove packets. Also call require_running for
breakpoints. Add missing break statement to default case. Tidy.
* target.h (struct target_ops): Rename insert_watchpoint to
insert_point, and remove_watchpoint to remove_point.
* linux-low.h (struct linux_target_ops): Likewise.
* linux-low.c (linux_insert_watchpoint): Rename to ...
(linux_insert_point): ... this. Adjust.
(linux_remove_watchpoint): Rename to ...
(linux_remove_point): ... this. Adjust.
(linux_target_ops): Adjust.
* linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
(cris_insert_point): ... this.
(cris_remove_watchpoint): Rename to ...
(cris_remove_point): ... this.
(the_low_target): Adjust.
2009-06-24 Pierre Muller <muller@ics.u-strasbg.fr>
* server.c (handle_v_kill): Pass signal_pid to
kill_inferior if multi_process is zero.
2009-06-23 Aleksandar Ristovski <aristovski@qnx.com>
* server.c (process_serial_event): Add support for Z0 and Z1 packet.
* target.h (target_ops): Comment for *_watchpoint to make it clear
the functions can get types '0' and '1'.
2009-06-22 Aleksandar Ristovski <aristovski@qnx.com>
* linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
* proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
* regcache.c (get_regcache): Likewise.
* spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
* win32-low.c (child_fetch_inferior_registers): Remove check for
regno 0.
2009-06-19 Aleksandar Ristovski <aristovski@qnx.com>
Pedro Alves <pedro@codesourcery.com>
* target.h (struct target_ops) <supports_multi_process>: New
callback.
(target_supports_multi_process): New.
* server.c (handle_query): Even if GDB reports support, only
enable multi-process if the target also supports it. Report
multi-process support only if the target backend supports it.
* linux-low.c (linux_supports_multi_process): New function.
(linux_target_ops): Install it as target_supports_multi_process
callback.
2009-05-24 Doug Evans <dje@google.com>
Global renaming of find_thread_pid to find_thread_ptid.
* server.h (find_thread_ptid): Renamed from find_thread_pid.
* inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
All callers updated.
* linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
to resume the newly created thread, don't call ptrace (PTRACE_CONT)
directly.
* linux-low.c (get_stop_pc): Print pc if debug_threads.
(check_removed_breakpoint, linux_wait_for_lwp): Ditto.
(linux_resume_one_lwp): Ditto.
2009-05-23 Doug Evans <dje@google.com>
* linux-low.c (linux_resume_one_lwp): Change type of first arg
from struct inferior_list_entry * to struct lwp_info *.
All callers updated.
2009-05-13 Doug Evans <dje@google.com>
* linux-x86-low.c: Don't include assert.h.
(x86_siginfo_fixup): Use fatal, not assert.
(x86_arch_setup): Fix comment.
2009-05-12 Doug Evans <dje@google.com>
Biarch support for i386/amd64 gdbserver.
* Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
Add linux-x86-low.c.
(linux-i386-low.o, linux-x86-64-low.o): Delete.
(linux-x86-low.o): Add.
* linux-x86-64-low.c: Delete.
* linux-i386-low.c: Delete.
* linux-x86-low.c: New file.
* configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
linux-x86-low.o.
(x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
linux-x86-low.o.
(x86_64-linux srv_regobj): Add reg-i386-linux.o.
* linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
(linux_child_pid_to_exec_file): New function.
(elf_64_header_p, elf_64_file_p): New functions.
(siginfo_fixup): New function.
(linux_xfer_siginfo): New local inf_siginfo. Call siginfo_fixup to
give target a chance to convert layout.
* linux-low.h (linux_target_ops): New member siginfo_fixup.
(linux_child_pid_to_exec_file, elf_64_file_p): Declare.
2009-05-07 Doug Evans <dje@google.com>
* linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
(regsets_store_inferior_registers): Ditto.
2009-05-06 Pedro Alves <pedro@codesourcery.com>
PR server/10048
* linux-low.c (must_set_ptrace_flags): Delete.
(linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
of the global.
(linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here. Set
`lwp->must_set_ptrace_flags' instead.
2009-05-06 19:34:13 +02:00
(linux_wait_for_event_1): Set ptrace options here.
(linux_wait_1): ... not here.
2009-04-30 Doug Evans <dje@google.com>
* inferiors.c (started_inferior_callback): New function.
(attached_inferior_callback): New function.
(have_started_inferiors_p, have_attached_inferiors_p): New functions.
* server.c (print_started_pid, print_attached_pid): New functions.
(detach_or_kill_for_exit): New function.
(main): Call it instead of for_each_inferior (kill_inferior_callback).
* server.h (have_started_inferiors_p): Declare.
(have_attached_inferiors_p): Declare.
* inferiors.c (remove_process): Fix memory leak, free process.
* linux-low.c (linux_remove_process): New function.
(linux_kill): Call it instead of remove_process.
(linux_detach, linux_wait_1): Ditto.
2009-04-19 Danny Backx <dannybackx@users.sourceforge.net>
* configure.srv: Add x86 Windows CE target.
2009-04-03 Ulrich Weigand <uweigand@de.ibm.com>
* inferiors.c (get_thread_process): Make global.
* server.h (get_thread_process): Add prototype.
* thread-db.c (find_one_thread): Use get_thread_process
instead of current_process.
(thread_db_get_tls_address): Do not crash if called when
thread layer is not yet initialized.
2009-04-03 Ulrich Weigand <uweigand@de.ibm.com>
* remote-utils.c (prepare_resume_reply): Null-terminate packet.
* spu-low.c (current_tid): Rename to ...
(current_ptid): ... this.
(fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
ptid_get_lwp (current_ptid) instead of current_tid.
(spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
instead of current_tid. Use find_process_pid to verify pid
argument is valid. Pass proper argument to remove_process.
(spu_thread_alive): Compare current_ptid instead of current_tid.
(spu_resume): Likewise.
2009-04-02 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (usr_store_inferior_registers): Declare local `pid'
variable.
2009-04-01 Pedro Alves <pedro@codesourcery.com> Implement the multiprocess extensions, and add linux multiprocess support. * server.h (ULONGEST): Declare. (struct ptid, ptid_t): New. (minus_one_ptid, null_ptid): Declare. (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp) (ptid_get_tid, ptid_equal, ptid_is_pid): Declare. (struct inferior_list_entry): Change `id' type from unsigned from to ptid_t. (struct sym_cache, struct breakpoint, struct process_info_private): Forward declare. (struct process_info): Declare. (current_process): Declare. (all_processes): Declare. (initialize_inferiors): Declare. (add_thread): Adjust to use ptid_t. (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto. (add_process, remove_process, find_thread_pid): Declare. (find_inferior_id): Adjust to use ptid_t. (cont_thread, general_thread, step_thread): Change type to ptid_t. (multi_process): Declare. (push_event): Adjust to use ptid_t. (read_ptid, write_ptid): Declare. (prepare_resume_reply): Adjust to use ptid_t. (clear_symbol_cache): Declare. * inferiors.c (all_processes): New. (null_ptid, minus_one_ptid): New. (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp) (ptid_get_tid, ptid_equal, ptid_is_pid): New. (add_thread): Change unsigned long to ptid. Remove gdb_id parameter. Adjust. (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid. (gdb_id_to_thread): Rename to ... (find_thread_pid): ... this. Change unsigned long to ptid. (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid. (loaded_dll, pull_pid_from_list): Adjust. (add_process, remove_process, find_process_pid) (get_thread_process, current_process, initialize_inferiors): New. * target.h (struct thread_resume) <thread>: Change type to ptid_t. (struct target_waitstatus) <related_pid>: Ditto. (struct target_ops) <kill, detach>: Add `pid' argument. Change return type to int. (struct target_ops) <join>: Add `pid' argument. (struct target_ops) <thread_alive>: Change pid's type to ptid_t. (struct target_ops) <wait>: Add `ptid' field. Change return type to ptid. (kill_inferior, detach_inferior, join_inferior): Add `pid' argument. (mywait): Add `ptid' argument. Change return type to ptid_t. (target_pid_to_str): Declare. * target.c (set_desired_inferior): Adjust to use ptids. (mywait): Add new `ptid' argument. Adjust. (target_pid_to_str): New. * mem-break.h (free_all_breakpoints): Declare. * mem-break.c (breakpoints): Delelete. (set_breakpoint_at, delete_breakpoint, find_breakpoint_at) (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust to use per-process breakpoint list. (free_all_breakpoints): New. * remote-utils.c (struct sym_cache) <name>: Drop `const'. (symbol_cache, all_symbols_looked_up): Delete. (hexchars): New. (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one, read_ptid): New. (prepare_resume_reply): Change ptid argument's type from unsigned long to ptid_t. Adjust. Implement W;process and X;process. (free_sym_cache, clear_symbol_cache): New. (look_up_one_symbol): Adjust to per-process symbol cache. * * server.c (cont_thread, general_thread, step_thread): Change type to ptid_t. (attached): Delete. (multi_process): New. (last_ptid): Change type to ptid_t. (struct vstop_notif) <ptid>: Change type to ptid_t. (queue_stop_reply, push_event): Change `ptid' argument's type to ptid_t. (discard_queued_stop_replies): Add `pid' argument. (start_inferior): Adjust to use ptids. Adjust to mywait interface changes. Don't reference the `attached' global. (attach_inferior): Adjust to mywait interface changes. (handle_query): Adjust to use ptids. Parse GDB's qSupported features. Handle and report "multiprocess+". Handle "qAttached:PID". (handle_v_cont): Adjust to use ptids. Adjust to mywait interface changes. (handle_v_kill): New. (handle_v_stopped): Adjust to use target_pid_to_str. (handle_v_requests): Allow multiple attaches and runs when multiprocess extensions are in effect. Handle "vKill". (myresume): Adjust to use ptids. (queue_stop_reply_callback): Add `arg' parameter. Handle it. (handle_status): Adjust to discard_queued_stop_replies interface change. (first_thread_of, kill_inferior_callback) (detach_or_kill_inferior_callback, join_inferiors_callback): New. (main): Call initialize_inferiors. Adjust to use ptids, killing and detaching from all inferiors. Handle multiprocess packet variants. * linux-low.h: Include gdb_proc_service.h. (struct process_info_private): New. (struct linux_target_ops) <pid_of>: Use ptid_get_pid. <lwpid_of>: Use ptid_get_lwp. (get_lwp_thread): Adjust. (struct lwp_info): Add `dead' member. (find_lwp_pid): Declare. * linux-low.c (thread_db_active): Delete. (new_inferior): Adjust comment. (inferior_pid): Delete. (linux_add_process): New. (handle_extended_wait): Adjust. (add_lwp): Change unsigned long to ptid. (linux_create_inferior): Add process to processes table. Adjust to use ptids. Don't set new_inferior here. (linux_attach_lwp): Rename to ... (linux_attach_lwp_1): ... this. Add `initial' argument. Handle it. Adjust to use ptids. (linux_attach_lwp): New. (linux_attach): Add process to processes table. Don't set new_inferior here. (struct counter): New. (second_thread_of_pid_p, last_thread_of_process_p): New. (linux_kill_one_lwp): Add `args' parameter. Handle it. Adjust to multiple processes. (linux_kill): Add `pid' argument. Handle it. Adjust to multiple processes. Remove process from process table. (linux_detach_one_lwp): Add `args' parameter. Handle it. Adjust to multiple processes. (any_thread_of): New. (linux_detach): Add `pid' argument, and handle it. Remove process from processes table. (linux_join): Add `pid' argument. Handle it. (linux_thread_alive): Change unsighed long argument to ptid_t. Consider dead lwps as not being alive. (status_pending_p): Rename `dummy' argument to `arg'. Filter out threads we're not interested in. (same_lwp, find_lwp_pid): New. (linux_wait_for_lwp): Change `pid' argument's type from int to ptid_t. Adjust. (linux_wait_for_event): Rename to ... (linux_wait_for_event_1): ... this. Change `pid' argument's type from int to ptid_t. Adjust. (linux_wait_for_event): New. (linux_wait_1): Add `ptid' argument. Change return type to ptid_t. Adjust. Use last_thread_of_process_p. Remove processes that exit from the process table. (linux_wait): Add `ptid' argument. Change return type to ptid_t. Adjust. (mark_lwp_dead): New. (wait_for_sigstop): Adjust to use ptids. If a process exits while stopping all threads, mark its main lwp as dead. (linux_set_resume_request, linux_resume_one_thread): Adjust to use ptids. (fetch_register, usr_store_inferior_registers) (regsets_fetch_inferior_registers) (regsets_store_inferior_registers, linux_read_memory) (linux_write_memory): Inline `inferior_pid'. (linux_look_up_symbols): Adjust to use per-process `thread_db_active'. (linux_request_interrupt): Adjust to use ptids. (linux_read_auxv): Inline `inferior_pid'. (initialize_low): Don't reference thread_db_active. * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove. * proc-service.c (ps_lgetregs): Use find_lwp_pid. (ps_getpid): Return the pid of the current inferior. * thread-db.c (proc_handle, thread_agent): Delete. (thread_db_create_event, thread_db_enable_reporting): Adjust to per-process data. (find_one_thread): Change argument type to ptid_t. Adjust to per-process data. (maybe_attach_thread): Adjust to per-process data and ptids. (thread_db_find_new_threads): Ditto. (thread_db_init): Ditto. * spu-low.c (spu_create_inferior, spu_attach): Add process to processes table. Adjust to use ptids. (spu_kill, spu_detach): Adjust interface. Remove process from processes table. (spu_join, spu_thread_alive): Adjust interface. (spu_wait): Adjust interface. Remove process from processes table. Adjust to use ptids. * win32-low.c (current_inferior_tid): Delete. (current_inferior_ptid): New. (debug_event_ptid): New. (thread_rec): Take a ptid. Adjust. (child_add_thread): Add `pid' argument. Adjust to use ptids. (child_delete_thread): Ditto. (do_initial_child_stuff): Add `attached' argument. Add process to processes table. (child_fetch_inferior_registers, child_store_inferior_registers): Adjust. (win32_create_inferior): Pass 0 to do_initial_child_stuff. (win32_attach): Pass 1 to do_initial_child_stuff. (win32_kill): Adjust interface. Remove process from processes table. (win32_detach): Ditto. (win32_join): Adjust interface. (win32_thread_alive): Take a ptid. (win32_resume): Adjust to use ptids. (get_child_debug_event): Ditto. (win32_wait): Adjust interface. Remove exiting process from processes table.
2009-04-02 00:50:24 +02:00
2009-04-01 Pedro Alves <pedro@codesourcery.com>
Implement the multiprocess extensions, and add linux multiprocess
support.
* server.h (ULONGEST): Declare.
(struct ptid, ptid_t): New.
(minus_one_ptid, null_ptid): Declare.
(ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
(ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
(struct inferior_list_entry): Change `id' type from unsigned from
to ptid_t.
(struct sym_cache, struct breakpoint, struct
process_info_private): Forward declare.
(struct process_info): Declare.
(current_process): Declare.
(all_processes): Declare.
(initialize_inferiors): Declare.
(add_thread): Adjust to use ptid_t.
(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
(add_process, remove_process, find_thread_pid): Declare.
(find_inferior_id): Adjust to use ptid_t.
(cont_thread, general_thread, step_thread): Change type to ptid_t.
(multi_process): Declare.
(push_event): Adjust to use ptid_t.
(read_ptid, write_ptid): Declare.
(prepare_resume_reply): Adjust to use ptid_t.
(clear_symbol_cache): Declare.
* inferiors.c (all_processes): New.
(null_ptid, minus_one_ptid): New.
(ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
(ptid_get_tid, ptid_equal, ptid_is_pid): New.
(add_thread): Change unsigned long to ptid. Remove gdb_id
parameter. Adjust.
(thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
(gdb_id_to_thread): Rename to ...
(find_thread_pid): ... this. Change unsigned long to ptid.
(gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
(loaded_dll, pull_pid_from_list): Adjust.
(add_process, remove_process, find_process_pid)
(get_thread_process, current_process, initialize_inferiors): New.
* target.h (struct thread_resume) <thread>: Change type to ptid_t.
(struct target_waitstatus) <related_pid>: Ditto.
(struct target_ops) <kill, detach>: Add `pid' argument. Change
return type to int.
(struct target_ops) <join>: Add `pid' argument.
(struct target_ops) <thread_alive>: Change pid's type to ptid_t.
(struct target_ops) <wait>: Add `ptid' field. Change return type
to ptid.
(kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
(mywait): Add `ptid' argument. Change return type to ptid_t.
(target_pid_to_str): Declare.
* target.c (set_desired_inferior): Adjust to use ptids.
(mywait): Add new `ptid' argument. Adjust.
(target_pid_to_str): New.
* mem-break.h (free_all_breakpoints): Declare.
* mem-break.c (breakpoints): Delelete.
(set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
(check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
to use per-process breakpoint list.
(free_all_breakpoints): New.
* remote-utils.c (struct sym_cache) <name>: Drop `const'.
(symbol_cache, all_symbols_looked_up): Delete.
(hexchars): New.
(ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
read_ptid): New.
(prepare_resume_reply): Change ptid argument's type from unsigned
long to ptid_t. Adjust. Implement W;process and X;process.
(free_sym_cache, clear_symbol_cache): New.
(look_up_one_symbol): Adjust to per-process symbol cache. *
* server.c (cont_thread, general_thread, step_thread): Change type
to ptid_t.
(attached): Delete.
(multi_process): New.
(last_ptid): Change type to ptid_t.
(struct vstop_notif) <ptid>: Change type to ptid_t.
(queue_stop_reply, push_event): Change `ptid' argument's type to
ptid_t.
(discard_queued_stop_replies): Add `pid' argument.
(start_inferior): Adjust to use ptids. Adjust to mywait interface
changes. Don't reference the `attached' global.
(attach_inferior): Adjust to mywait interface changes.
(handle_query): Adjust to use ptids. Parse GDB's qSupported
features. Handle and report "multiprocess+". Handle
"qAttached:PID".
(handle_v_cont): Adjust to use ptids. Adjust to mywait interface
changes.
(handle_v_kill): New.
(handle_v_stopped): Adjust to use target_pid_to_str.
(handle_v_requests): Allow multiple attaches and runs when
multiprocess extensions are in effect. Handle "vKill".
(myresume): Adjust to use ptids.
(queue_stop_reply_callback): Add `arg' parameter. Handle it.
(handle_status): Adjust to discard_queued_stop_replies interface
change.
(first_thread_of, kill_inferior_callback)
(detach_or_kill_inferior_callback, join_inferiors_callback): New.
(main): Call initialize_inferiors. Adjust to use ptids, killing
and detaching from all inferiors. Handle multiprocess packet
variants.
* linux-low.h: Include gdb_proc_service.h.
(struct process_info_private): New.
(struct linux_target_ops) <pid_of>: Use ptid_get_pid.
<lwpid_of>: Use ptid_get_lwp.
(get_lwp_thread): Adjust.
(struct lwp_info): Add `dead' member.
(find_lwp_pid): Declare.
* linux-low.c (thread_db_active): Delete.
(new_inferior): Adjust comment.
(inferior_pid): Delete.
(linux_add_process): New.
(handle_extended_wait): Adjust.
(add_lwp): Change unsigned long to ptid.
(linux_create_inferior): Add process to processes table. Adjust
to use ptids. Don't set new_inferior here.
(linux_attach_lwp): Rename to ...
(linux_attach_lwp_1): ... this. Add `initial' argument. Handle
it. Adjust to use ptids.
(linux_attach_lwp): New.
(linux_attach): Add process to processes table. Don't set
new_inferior here.
(struct counter): New.
(second_thread_of_pid_p, last_thread_of_process_p): New.
(linux_kill_one_lwp): Add `args' parameter. Handle it. Adjust to
multiple processes.
(linux_kill): Add `pid' argument. Handle it. Adjust to multiple
processes. Remove process from process table.
(linux_detach_one_lwp): Add `args' parameter. Handle it. Adjust
to multiple processes.
(any_thread_of): New.
(linux_detach): Add `pid' argument, and handle it. Remove process
from processes table.
(linux_join): Add `pid' argument. Handle it.
(linux_thread_alive): Change unsighed long argument to ptid_t.
Consider dead lwps as not being alive.
(status_pending_p): Rename `dummy' argument to `arg'. Filter out
threads we're not interested in.
(same_lwp, find_lwp_pid): New.
(linux_wait_for_lwp): Change `pid' argument's type from int to
ptid_t. Adjust.
(linux_wait_for_event): Rename to ...
(linux_wait_for_event_1): ... this. Change `pid' argument's type
from int to ptid_t. Adjust.
(linux_wait_for_event): New.
(linux_wait_1): Add `ptid' argument. Change return type to
ptid_t. Adjust. Use last_thread_of_process_p. Remove processes
that exit from the process table.
(linux_wait): Add `ptid' argument. Change return type to ptid_t.
Adjust.
(mark_lwp_dead): New.
(wait_for_sigstop): Adjust to use ptids. If a process exits while
stopping all threads, mark its main lwp as dead.
(linux_set_resume_request, linux_resume_one_thread): Adjust to use
ptids.
(fetch_register, usr_store_inferior_registers)
(regsets_fetch_inferior_registers)
(regsets_store_inferior_registers, linux_read_memory)
(linux_write_memory): Inline `inferior_pid'.
(linux_look_up_symbols): Adjust to use per-process
`thread_db_active'.
(linux_request_interrupt): Adjust to use ptids.
(linux_read_auxv): Inline `inferior_pid'.
(initialize_low): Don't reference thread_db_active.
* gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
* proc-service.c (ps_lgetregs): Use find_lwp_pid.
(ps_getpid): Return the pid of the current inferior.
* thread-db.c (proc_handle, thread_agent): Delete.
(thread_db_create_event, thread_db_enable_reporting): Adjust to
per-process data.
(find_one_thread): Change argument type to ptid_t. Adjust to
per-process data.
(maybe_attach_thread): Adjust to per-process data and ptids.
(thread_db_find_new_threads): Ditto.
(thread_db_init): Ditto.
* spu-low.c (spu_create_inferior, spu_attach): Add process to
processes table. Adjust to use ptids.
(spu_kill, spu_detach): Adjust interface. Remove process from
processes table.
(spu_join, spu_thread_alive): Adjust interface.
(spu_wait): Adjust interface. Remove process from processes
table. Adjust to use ptids.
* win32-low.c (current_inferior_tid): Delete.
(current_inferior_ptid): New.
(debug_event_ptid): New.
(thread_rec): Take a ptid. Adjust.
(child_add_thread): Add `pid' argument. Adjust to use ptids.
(child_delete_thread): Ditto.
(do_initial_child_stuff): Add `attached' argument. Add process to
processes table.
(child_fetch_inferior_registers, child_store_inferior_registers):
Adjust.
(win32_create_inferior): Pass 0 to do_initial_child_stuff.
(win32_attach): Pass 1 to do_initial_child_stuff.
(win32_kill): Adjust interface. Remove process from processes
table.
(win32_detach): Ditto.
(win32_join): Adjust interface.
(win32_thread_alive): Take a ptid.
(win32_resume): Adjust to use ptids.
(get_child_debug_event): Ditto.
(win32_wait): Adjust interface. Remove exiting process from
processes table.
Non-stop mode support. * server.h (non_stop): Declare. (gdb_client_data, handler_func): Declare. (delete_file_handler, add_file_handler, start_event_loop): Declare. (handle_serial_event, handle_target_event, push_event) (putpkt_notif): Declare. * target.h (enum resume_kind): New. (struct thread_resume): Replace `step' field by `kind' field. (TARGET_WNOHANG): Define. (struct target_ops) <wait>: Add `options' argument. <supports_non_stop, async, start_non_stop>: New fields. (target_supports_non_stop, target_async): New. (start_non_stop): Declare. (mywait): Add `options' argument. * target.c (mywait): Add `options' argument. Print child exit notifications here. (start_non_stop): New. * server.c (non_stop, own_buf, mem_buf): New globals. (struct vstop_notif): New. (notif_queue): New global. (queue_stop_reply, push_event, discard_queued_stop_replies) (send_next_stop_reply): New. (start_inferior): Adjust to use resume_kind. Adjust to mywait interface changes. (attach_inferior): In non-stop mode, don't wait for the target here. (handle_general_set): Handle QNonStop. (handle_query): When handling qC, return the current general thread, instead of the first thread of the list. (handle_query): If the backend supports non-stop mode, include QNonStop+ in the qSupported query response. (handle_v_cont): Adjust to use resume_kind. Handle resume_stop and non-stop mode. (handle_v_attach, handle_v_run): Handle non-stop mode. (handle_v_stopped): New. (handle_v_requests): Report support for vCont;t. Handle vStopped. (myresume): Adjust to use resume_kind. Handle non-stop. (queue_stop_reply_callback): New. (handle_status): Handle non-stop mode. (main): Clear non_stop flag on reconnection. Use the event-loop. Refactor serial protocol handling from here ... (process_serial_event): ... to this new function. When GDB selects any thread, select one here. In non-stop mode, wait until GDB acks all pending events before exiting. (handle_serial_event, handle_target_event): New. * remote-utils.c (remote_open): Install remote_desc in the event loop. (remote_close): Remove remote_desc from the event loop. (putpkt_binary): Rename to... (putpkt_binary_1): ... this. Add `is_notic' argument. Handle it. (putpkt_binary): New as wrapper around putpkt_binary_1. (putpkt_notif): New. (prepare_resume_reply): In non-stop mode, don't change the general_thread. * event-loop.c: New. * Makefile.in (OBJ): Add event-loop.o. (event-loop.o): New rule. * linux-low.h (pid_of): Moved here. (lwpid_of): New. (get_lwp_thread): Use lwpid_of. (struct lwp_info): Delete `lwpid' field. Add `suspended' field. * linux-low.c (pid_of): Delete. (inferior_pid): Use lwpid_of. (linux_event_pipe): New. (target_is_async_p): New. (delete_lwp): New. (handle_extended_wait): Use lwpid_of. (add_lwp): Don't set lwpid field. (linux_attach_lwp): Adjust debug output. Use lwpid_of. (linux_kill_one_lwp): If killing a running lwp, stop it first. Use lwpid_of. Adjust to linux_wait_for_event interface changes. (linux_detach_one_lwp): If detaching from a running lwp, stop it first. Adjust to linux_wait_for_event interface changes. Use lwpid_of. (linux_detach): Don't delete the main lwp here. (linux_join): Use my_waitpid. Avoid signal_pid. Use lwpid_of. (status_pending_p): Don't consider explicitly suspended lwps. (linux_wait_for_lwp): Take an integer pid instead of a lwp_info pointer. Add OPTIONS argument. Change return type to int. Use my_waitpid instead of sleeping. Handle WNOHANG. Use lwpid_of. (linux_wait_for_event): Take an integer pid instead of a lwp_info pointer. Add status pointer argument. Return a pid instead of a status. Use lwpid_of. Adjust to linux_wait_for_lwp interface changes. In non-stop mode, don't switch to a random thread. (linux_wait): Rename to... (linux_wait_1): ... this. Add target_options argument, and handle it. Adjust to use resume_kind. Use lwpid_of. In non-stop mode, don't handle the continue thread. Handle TARGET_WNOHANG. Merge clean exit and signal exit code. Don't stop all threads in non-stop mode. In all-stop mode, only stop all threads when reporting a stop to GDB. Handle explicit thread stop requests. (async_file_flush, async_file_mark): New. (linux_wait): New. (send_sigstop): Use lwpid_of. (wait_for_sigstop): Use lwpid_of. Adjust to linux_wait_for_event interface changes. In non-stop mode, don't switch to a random thread. (linux_resume_one_lwp): Use lwpid_of. (linux_continue_one_thread, linux_queue_one_thread): Merge into ... (linux_resume_one_thread): ... this. Handle resume_stop. In non-stop mode, don't look for pending flag in all threads. (resume_status_pending_p): Don't consider explicitly suspended threads. (my_waitpid): Reimplement. Emulate __WALL. (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo): Use lwpid_of. (sigchld_handler, linux_supports_non_stop, linux_async) (linux_start_non_stop): New. (linux_target_ops): Register linux_supports_non_stop, linux_async and linux_start_non_stop. (initialize_low): Install SIGCHLD handler. * thread-db.c (thread_db_create_event, find_one_thread) (thread_db_get_tls_address): Use lwpid_of. * win32-low.c (win32_detach): Adjust to use resume_kind. (win32_wait): Add `options' argument. * spu-low.c (spu_resume): Adjust to use resume_kind. (spu_wait): Add `options' argument.
2009-04-02 00:48:05 +02:00
2009-04-01 Pedro Alves <pedro@codesourcery.com>
Non-stop mode support.
* server.h (non_stop): Declare.
(gdb_client_data, handler_func): Declare.
(delete_file_handler, add_file_handler, start_event_loop):
Declare.
(handle_serial_event, handle_target_event, push_event)
(putpkt_notif): Declare.
* target.h (enum resume_kind): New.
(struct thread_resume): Replace `step' field by `kind' field.
(TARGET_WNOHANG): Define.
(struct target_ops) <wait>: Add `options' argument.
<supports_non_stop, async, start_non_stop>: New fields.
(target_supports_non_stop, target_async): New.
(start_non_stop): Declare.
(mywait): Add `options' argument.
* target.c (mywait): Add `options' argument. Print child exit
notifications here.
(start_non_stop): New.
* server.c (non_stop, own_buf, mem_buf): New globals.
(struct vstop_notif): New.
(notif_queue): New global.
(queue_stop_reply, push_event, discard_queued_stop_replies)
(send_next_stop_reply): New.
(start_inferior): Adjust to use resume_kind. Adjust to mywait
interface changes.
(attach_inferior): In non-stop mode, don't wait for the target
here.
(handle_general_set): Handle QNonStop.
(handle_query): When handling qC, return the current general
thread, instead of the first thread of the list.
(handle_query): If the backend supports non-stop mode, include
QNonStop+ in the qSupported query response.
(handle_v_cont): Adjust to use resume_kind. Handle resume_stop
and non-stop mode.
(handle_v_attach, handle_v_run): Handle non-stop mode.
(handle_v_stopped): New.
(handle_v_requests): Report support for vCont;t. Handle vStopped.
(myresume): Adjust to use resume_kind. Handle non-stop.
(queue_stop_reply_callback): New.
(handle_status): Handle non-stop mode.
(main): Clear non_stop flag on reconnection. Use the event-loop.
Refactor serial protocol handling from here ...
(process_serial_event): ... to this new function. When GDB
selects any thread, select one here. In non-stop mode, wait until
GDB acks all pending events before exiting.
(handle_serial_event, handle_target_event): New.
* remote-utils.c (remote_open): Install remote_desc in the event
loop.
(remote_close): Remove remote_desc from the event loop.
(putpkt_binary): Rename to...
(putpkt_binary_1): ... this. Add `is_notic' argument. Handle it.
(putpkt_binary): New as wrapper around putpkt_binary_1.
(putpkt_notif): New.
(prepare_resume_reply): In non-stop mode, don't change the
general_thread.
* event-loop.c: New.
* Makefile.in (OBJ): Add event-loop.o.
(event-loop.o): New rule.
* linux-low.h (pid_of): Moved here.
(lwpid_of): New.
(get_lwp_thread): Use lwpid_of.
(struct lwp_info): Delete `lwpid' field. Add `suspended' field.
* linux-low.c (pid_of): Delete.
(inferior_pid): Use lwpid_of.
(linux_event_pipe): New.
(target_is_async_p): New.
(delete_lwp): New.
(handle_extended_wait): Use lwpid_of.
(add_lwp): Don't set lwpid field.
(linux_attach_lwp): Adjust debug output. Use lwpid_of.
(linux_kill_one_lwp): If killing a running lwp, stop it first.
Use lwpid_of. Adjust to linux_wait_for_event interface changes.
(linux_detach_one_lwp): If detaching from a running lwp, stop it
first. Adjust to linux_wait_for_event interface changes. Use
lwpid_of.
(linux_detach): Don't delete the main lwp here.
(linux_join): Use my_waitpid. Avoid signal_pid. Use lwpid_of.
(status_pending_p): Don't consider explicitly suspended lwps.
(linux_wait_for_lwp): Take an integer pid instead of a lwp_info
pointer. Add OPTIONS argument. Change return type to int. Use
my_waitpid instead of sleeping. Handle WNOHANG. Use lwpid_of.
(linux_wait_for_event): Take an integer pid instead of a lwp_info
pointer. Add status pointer argument. Return a pid instead of a
status. Use lwpid_of. Adjust to linux_wait_for_lwp interface
changes. In non-stop mode, don't switch to a random thread.
(linux_wait): Rename to...
(linux_wait_1): ... this. Add target_options argument, and handle
it. Adjust to use resume_kind. Use lwpid_of. In non-stop mode,
don't handle the continue thread. Handle TARGET_WNOHANG. Merge
clean exit and signal exit code. Don't stop all threads in
non-stop mode. In all-stop mode, only stop all threads when
reporting a stop to GDB. Handle explicit thread stop requests.
(async_file_flush, async_file_mark): New.
(linux_wait): New.
(send_sigstop): Use lwpid_of.
(wait_for_sigstop): Use lwpid_of. Adjust to linux_wait_for_event
interface changes. In non-stop mode, don't switch to a random
thread.
(linux_resume_one_lwp): Use lwpid_of.
(linux_continue_one_thread, linux_queue_one_thread): Merge into ...
(linux_resume_one_thread): ... this. Handle resume_stop. In
non-stop mode, don't look for pending flag in all threads.
(resume_status_pending_p): Don't consider explicitly suspended
threads.
(my_waitpid): Reimplement. Emulate __WALL.
(linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
Use lwpid_of.
(sigchld_handler, linux_supports_non_stop, linux_async)
(linux_start_non_stop): New.
(linux_target_ops): Register linux_supports_non_stop, linux_async
and linux_start_non_stop.
(initialize_low): Install SIGCHLD handler.
* thread-db.c (thread_db_create_event, find_one_thread)
(thread_db_get_tls_address): Use lwpid_of.
* win32-low.c (win32_detach): Adjust to use resume_kind.
(win32_wait): Add `options' argument.
* spu-low.c (spu_resume): Adjust to use resume_kind.
(spu_wait): Add `options' argument.
2009-04-01 Pedro Alves <pedro@codesourcery.com>
Decouple target code from remote protocol.
* target.h (enum target_waitkind): New.
(struct target_waitstatus): New.
(struct target_ops) <wait>: Return an unsigned long. Take a
target_waitstatus pointer instead of a char pointer.
(mywait): Likewise.
* target.c (mywait): Change prototype to return an unsigned long.
Take a target_waitstatus pointer instead of a char pointer. Adjust.
* server.h (thread_from_wait, old_thread_from_wait): Delete
declarations.
(prepare_resume_reply): Change prototype to take a
target_waitstatus.
* server.c (thread_from_wait, old_thread_from_wait): Delete.
(last_status, last_ptid): New.
(start_inferior): Remove "statusptr" argument. Adjust. Return a
pid instead of a signal.
(attach_inferior): Remove "status" and "signal" parameters.
Adjust.
(handle_query): For qGetTLSAddr, parse the thread id with strtol,
not as an address.
(handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
(handle_v_requests, myresume): Remove "status" and "signal"
parameters. Adjust.
(handle_status): New.
(main): Delete local `status'. Adjust.
* remote-utils.c: Include target.h.
(prepare_resume_reply): Change prototype to take a
target_waitstatus. Adjust.
* linux-low.c (linux_wait): Adjust to new target_ops->wait
interface.
* spu-low.c (spu_wait): Adjust.
* win32-low.c (enum target_waitkind, struct target_waitstatus):
Delete.
(win32_wait): Adjust.
2009-04-01 Pedro Alves <pedro@codesourcery.com>
* target.h (struct thread_resume): Delete leave_stopped member.
(struct target_ops): Add a `n' argument to the `resume' callback.
* server.c (start_inferior): Adjust.
(handle_v_cont, myresume): Adjust.
* linux-low.c (check_removed_breakpoint): Adjust to resume
interface change, and to removed leave_stopped field.
(resume_ptr): Delete.
(struct thread_resume_array): New.
(linux_set_resume_request): Add new `arg' parameter. Adjust to
resume interface change.
(linux_continue_one_thread, linux_queue_one_thread)
(resume_status_pending_p): Check if the resume field is NULL
instead of checking the leave_stopped member.
(linux_resume): Adjust to the target resume interface change.
* spu-low.c (spu_resume): Adjust to the target resume interface
change.
* win32-low.c (win32_detach, win32_resume): Ditto.
2009-04-01 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_wait_for_event): Don't clear the `stepping'
flag.
(wait_for_sigstop): Don't leave a finished single-step SIGTRAP
pending.
(linux_continue_one_thread): Only preserve the stepping flag if
there's a pending breakpoint.
2009-03-31 Pedro Alves <pedro@codesourcery.com>
* server.c (main): After the inferior having exited, call
remote_close before exiting gdbserver.
2009-03-25 Thiago Jung Bauermann <bauerman@br.ibm.com>
Fix size of FPSCR in Power 7 processors.
* linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
(PPC_FEATURE_HAS_DFP): New #define.
(ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
size of the FPSCR.
2009-03-23 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_query) Whitespace and formatting.
2009-03-22 Pedro Alves <pedro@codesourcery.com>
* i387-fp.c, linux-arm-low.c, linux-cris-low.c,
linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
Makefile.in, configure.ac: Fix whitespace throughout.
* configure: Regenerate.
2009-03-22 Pedro Alves <pedro@codesourcery.com>
* inferiors.c (find_inferior): Make it safe for the callback
function to delete the currently iterated inferior.
2009-03-22 Pedro Alves <pedro@codesourcery.com>
* Makefile.in (linuw_low_h): Move higher.
(thread-db.o): Depend on $(linux_low_h).
Rename "process" to "lwp" throughout. * linux-low.c (all_processes): Rename to... (all_lwps): ... this. (inferior_pid, handle_extended_wait, get_stop_pc): Adjust. (add_process): Rename to ... (add_lwp): ... this. Adjust. (linux_create_inferior): Adjust. (linux_attach_lwp): Adjust. (linux_attach): Adjust. (linux_kill_one_process): Rename to ... (linux_kill_one_lwp): ... this. Adjust. (linux_kill): Adjust. (linux_detach_one_process): Rename to ... (linux_detach_one_lwp): ... this. Adjust. (linux_detach): Adjust. (check_removed_breakpoint): Adjust. (status_pending_p): Adjust. (linux_wait_for_process): Rename to ... (linux_wait_for_lwp): ... this. Adjust. (linux_wait_for_event): Adjust. (send_sigstop): Adjust. (wait_for_sigstop): Adjust. (stop_all_processes): Rename to ... (stop_all_lwps): ... this. (linux_resume_one_process): Rename to ... (linux_resume_one_lwp): ... this. Adjust. (linux_set_resume_request, linux_continue_one_thread) (linux_queue_one_thread, resume_status_pending_p) (usr_store_inferior_registers, regsets_store_inferior_registers) (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo): Adjust. * linux-low.h (get_process): Rename to ... (get_lwp): ... this. Adjust. (get_thread_process): Rename to ... (get_thread_lwp): ... this. Adjust. (get_process_thread): Rename to ... (get_lwp_thread): ... this. Adjust. (struct process_info): Rename to ... (struct lwp_info): ... this. (all_processes): Rename to ... (all_lwps): ... this. * proc-service.c (ps_lgetregs): Adjust. * thread-db.c (thread_db_create_event, find_one_thread) (maybe_attach_thread, thread_db_get_tls_address): Adjust.
2009-03-17 21:25:35 +01:00
2009-03-17 Pedro Alves <pedro@codesourcery.com>
Rename "process" to "lwp" throughout.
* linux-low.c (all_processes): Rename to...
(all_lwps): ... this.
(inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
(add_process): Rename to ...
(add_lwp): ... this. Adjust.
(linux_create_inferior): Adjust.
(linux_attach_lwp): Adjust.
(linux_attach): Adjust.
(linux_kill_one_process): Rename to ...
(linux_kill_one_lwp): ... this. Adjust.
(linux_kill): Adjust.
(linux_detach_one_process): Rename to ...
(linux_detach_one_lwp): ... this. Adjust.
(linux_detach): Adjust.
(check_removed_breakpoint): Adjust.
(status_pending_p): Adjust.
(linux_wait_for_process): Rename to ...
(linux_wait_for_lwp): ... this. Adjust.
(linux_wait_for_event): Adjust.
(send_sigstop): Adjust.
(wait_for_sigstop): Adjust.
(stop_all_processes): Rename to ...
(stop_all_lwps): ... this.
(linux_resume_one_process): Rename to ...
(linux_resume_one_lwp): ... this. Adjust.
(linux_set_resume_request, linux_continue_one_thread)
(linux_queue_one_thread, resume_status_pending_p)
(usr_store_inferior_registers, regsets_store_inferior_registers)
(linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
Adjust.
* linux-low.h (get_process): Rename to ...
(get_lwp): ... this. Adjust.
(get_thread_process): Rename to ...
(get_thread_lwp): ... this. Adjust.
(get_process_thread): Rename to ...
(get_lwp_thread): ... this. Adjust.
(struct process_info): Rename to ...
(struct lwp_info): ... this.
(all_processes): Rename to ...
(all_lwps): ... this.
* proc-service.c (ps_lgetregs): Adjust.
* thread-db.c (thread_db_create_event, find_one_thread)
(maybe_attach_thread, thread_db_get_tls_address): Adjust.
2009-03-14 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_query): Handle "qAttached".
2009-03-13 Nathan Sidwell <nathan@codesourcery.com>
* Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
GPLv3, update license URL.
2009-03-01 Doug Evans <dje@google.com>
2009-03-02 23:39:44 +01:00
* Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
(server_h): Add gdb_signals.h.
(signals.o): Update.
* server.h (target_signal_from_host,target_signal_to_host_p)
(target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
2009-02-14 Pierre Muller <muller@ics.u-strasbg.fr>
* remote-utils.c (getpkt): Also generate remote-debug
information if noack_mode is set.
2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/ * target.h (enum target_object): Add new TARGET_OBJECT_SIGNAL_INFO. * infrun.c (siginfo_value_read, siginfo_value_write): New. (siginfo_value_funcs): New. (siginfo_make_value): New. (_initialize_infrun): Create the $_siginfo convenience variable. * gdbtypes.h (append_composite_type_field_aligned): Declare. * gdbtypes.c (append_composite_type_field): Rename to... (append_composite_type_field_aligned): ... this. Add ALIGNMENT argument. Handle it. (append_composite_type_field): Rewrite on top of append_composite_type_field_aligned. * value.h (internalvar_make_value): New typedef. (struct internalvar) <make_value>: New field. (create_internalvar_type_lazy): Declare. * value.c (create_internalvar): Clear make_value. (create_internalvar_type_lazy): New. (value_of_internalvar): If make_value is set use it. (preserve_values): Skip internal variables that don't have a value. * gdbarch.sh (get_siginfo_type): New. * gdbarch.h, gdbarch.c: Regenerate. * linux-tdep.h, linux-tdep.c: New. * amd64-linux-tdep.c: Include "linux-tdep.h". (amd64_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * i386-linux-tdep.c: Include "linux-tdep.h". (i386_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * arm-linux-tdep.c: Include "linux-tdep.h". (i386_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * linux-nat.c (linux_xfer_siginfo): New. (linux_nat_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO. * remote.c (PACKET_qXfer_siginfo_read) (PACKET_qXfer_siginfo_write): New. (feature remote_protocol_features): Add "qXfer:siginfo:read" and "qXfer:siginfo:write" features. (remote_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO. (_initialize_remote): Add "set/show remote read-siginfo-object" and "set/show remote write-siginfo-object" commands. * Makefile.in (ALL_TARGET_OBS): Add linux-tdep.o. (HFILES_NO_SRCDIR): Add linux-tdep.h. (ALLDEPFILES): Add linux-tdep.c. * configure.tgt (arm*-*-linux* | arm*-*-uclinux*) (i[34567]86-*-linux*, x86_64-*-linux*): Add linux-tdep.o to gdb_target_obs. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/gdbserver/ * server.c (handle_query): Report qXfer:siginfo:read and qXfer:siginfo:write as supported and handle them. * target.h (struct target_ops) <qxfer_siginfo>: New field. * linux-low.c (linux_xfer_siginfo): New. (linux_target_ops): Set it. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/doc/ * gdb.texinfo (Signals): Document $_siginfo. (Convenience Variables): Mention $_siginfo. (Remote Configuration): Document qXfer:siginfo:read, qXfer:siginfo:write packets, and the read-siginfo-object, write-siginfo-object commands. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/testsuite/ * gdb.base/siginfo-obj.c, gdb.base/siginfo-obj.exp: New.
2009-02-06 23:59:01 +01:00
2009-02-06 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_query): Report qXfer:siginfo:read and
qXfer:siginfo:write as supported and handle them.
* target.h (struct target_ops) <qxfer_siginfo>: New field.
* linux-low.c (linux_xfer_siginfo): New.
(linux_target_ops): Set it.
2009-01-26 Pedro Alves <pedro@codesourcery.com>
* server.c (gdbserver_usage): Mention --remote-debug.
(main): Accept '--remote-debug' switch.
2009-01-18 Doug Evans <dje@google.com>
* regcache.c (new_register_cache): No need to check result of xcalloc.
* server.c (handle_search_memory): Back out calls to xmalloc,
result is checked and error is returned to user upon failure.
(handle_query): Ditto. Add more checks for result of malloc.
(handle_v_cont): Check result of malloc, report error back to
user upon failure.
(handle_v_run): Ditto. Call freeargv.
* server.h (freeargv): Declare.
* utils.c (freeargv): New fn.
2009-01-15 Doug Evans <dje@google.com>
* gdbreplay.c (perror_with_name): Make arg const char *.
* server.h (target_signal_to_name): Make return type const char *.
2009-01-15 23:18:54 +01:00
* thread-db.c (thread_db_err_str): Make return type const char *.
* utils.c (perror_with_name): Make arg const char *.
2009-01-14 Pedro Alves <pedro@codesourcery.com>
* win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
when handling a EXIT_PROCESS_DEBUG_EVENT.
2009-01-06 Joel Brobecker <brobecker@adacore.com>
* gdbreplay.c (gdbreplay_version): Update copyright year.
* server.c (gdbserver_version): Likewise.
2009-01-05 Doug Evans <dje@google.com>
* linux-low.c (linux_attach_lwp): Add some comments/fixmes.
(handle_extended_wait): Improve comment.
2008-12-13 Doug Evans <dje@google.com>
* utils.c (xmalloc,xcalloc,xstrdup): New fns.
* server.h (ATTR_MALLOC): New macro.
(xmalloc,xcalloc,xstrdup): Declare.
* hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
* inferiors.c: Ditto.
* linux-low.c: Ditto.
* mem-break.c: Ditto.
* regcache.c: Ditto.
* remote-utils.c: Ditto.
* server.c: Ditto.
* target.c: Ditto.
* win32-low.c: Ditto.
2008-12-12 Doug Evans <dje@google.com>
* linux-low.c (linux_wait_for_process): Don't clobber current_inferior
in debugging printf.
* linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
2008-12-09 Doug Evans <dje@google.com>
* linux-low.h (struct process_info): Delete member tid, unused.
* thread-db.c (find_one_thread): Update.
(maybe_attach_thread): Update.
2008-12-02 Pedro Alves <pedro@codesourcery.com>
2010-08-27 14:02:20 +02:00
* target.h (struct target_ops): Add qxfer_osdata member.
* linux-low.c: Include ctype.h and pwd.h and sys/types.h
and dirent.h.
(linux_qxfer_osdata): New functions.
(linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
callback.
* server.c (handle_query): Handle "qXfer:osdata:read:".
* remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
(buffer_xml_printf): New functions.
* server.h (struct buffer): New.
(buffer_grow_str, buffer_grow_str0): New macros.
(buffer_grow, buffer_free, buffer_init, buffer_finish)
(buffer_xml_printf): Declare.
2008-11-24 Doug Evans <dje@google.com>
* Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
2008-11-24 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (handle_v_run): Always use the supplied argument list.
2008-11-19 Bob Wilson <bob.wilson@acm.org>
2010-08-27 14:02:20 +02:00
* xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
(xtensa_regmap_table): Add entry for scompare1.
2010-08-27 14:02:20 +02:00
2008-11-18 Thiago Jung Bauermann <bauerman@br.ibm.com>
* Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
powerpc-isa205-64l.o, powerpc-isa205-64l.c,
powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
* configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
XML target descriptions.
* linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
when inferior is running on an ISA 2.05 or later processor. Add
special case to return offset for full 64-bit slot of FPSCR when
in 32-bits.
2008-11-14 Daniel Gutson <dgutson@codesourcery.com>
* Makefile.in (SFILES, clean): Added sparc64 files.
(reg-sparc64.o, reg-sparc64.c): New.
* configure.srv (sparc*-*-linux*): New configuration.
* linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
syscall arguments for SPARC.
(regsets_store_inferior_registers): Likewise.
* linux-sparc-low.c: New file.
2008-10-21 Doug Evans <dje@google.com>
* Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
(READLINE_DIR,READLINE_DEP): Delete.
(INTERNAL_CFLAGS): Update.
(LINTFLAGS): Update.
2008-10-10 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_v_run): If GDB didn't specify an argv, use the
whole argv from the last run, not just argv[0].
2008-09-08 Pedro Alves <pedro@codesourcery.com>
* regcache.c (new_register_cache): Return NULL if the register
cache size isn't known yet.
(free_register_cache): Avoid dereferencing a NULL regcache.
2008-09-04 Daniel Jacobowitz <dan@codesourcery.com>
* configure.srv: Merge MIPS and MIPS64.
2008-08-24 Maciej W. Rozycki <macro@linux-mips.org>
* Makefile.in (uninstall): Apply $(EXEEXT) too.
2008-08-18 Luis Machado <luisgpm@br.ibm.com>
* Makefile.in: Add required vsx dependencies.
* linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
Declare init_registers_powerpc_vsx32l.
Declare init_registers_powerpc_vsx64l.
Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
(ppc_arch_setup): Check for VSX in hwcap.
(ppc_fill_vsxregset): New function.
(ppc_store_vsxregset): New function.
Add new VSX entry in regset_info target_regsets.
* configure.srv: Add new VSX dependencies.
gdb/doc/ 2008-08-12 Sandra Loosemore <sandra@codesourcery.com> * gdb.texinfo (Remote Configuration): Document set remote noack-packet. (Remote Protocol): Add Packet Acknowledgment to menu. (Overview): Mention +/- can be disabled, and point to new section where this is discussed in detail. (General Query Packets): Document QStartNoAckMode packet, and corresponding qSupported reply. (Packet Acknowledgment): New section. gdb/ 2008-08-12 Pedro Alves <pedro@codesourcery.com> Add no-ack mode to the remote protocol --- optionally stop ACKing packets and responses when we have a reliable communication medium. Based on Apple's GDB, by Jason Molenda <jmolenda@apple.com> * remote.c (struct remote_state): Add noack_mode field. (PACKET_QStartNoAckMode): New. (remote_start_remote): Don't any outstanding packet here. (remote_open_1): Clear noack_mode. Ack any outstanding packet here. Activate noack mode if requested. (remote_protocol_features): Add QStartNoAckMode. (remote_open_1): (putpkt_binary): Don't send ack in noack mode. (read_frame): Don't recompute the checksum in noack mode. (getpkt_sane): Skip sending ack if in noack mode. (_initialize_remote): Add set/show remote noack mode. * NEWS: Note the new features. gdb/gdbserver/ 2008-08-12 Pedro Alves <pedro@codesourcery.com> * remote-utils.c (noack_mode, transport_is_reliable): New globals. (remote_open): Set or clear transport_is_reliable. (putpkt_binary): Don't expect acks in noack mode. (getpkt): Don't send ack/nac in noack mode. * server.c (handle_general_set): Handle QStartNoAckMode. (handle_query): If connected by tcp pass QStartNoAckMode+ in qSupported. (main): Reset noack_mode on every connection. * server.h (noack_mode): Declare.
2008-08-12 17:18:31 +02:00
2008-08-12 Pedro Alves <pedro@codesourcery.com>
* remote-utils.c (noack_mode, transport_is_reliable): New globals.
(remote_open): Set or clear transport_is_reliable.
(putpkt_binary): Don't expect acks in noack mode.
(getpkt): Don't send ack/nac in noack mode.
* server.c (handle_general_set): Handle QStartNoAckMode.
(handle_query): If connected by tcp pass QStartNoAckMode+ in
qSupported.
(main): Reset noack_mode on every connection.
* server.h (noack_mode): Declare.
gdb/ * aclocal.m4, configure: Rebuild. * configure.in: Call ZW_CREATE_DEPDIR, ZW_PROG_COMPILER_DEPENDENCIES, AC_PROG_MAKE_SET. (MAKE, GMAKE): New substs. * acinclude.m4: Include depstand.m4. * Makefile.in (DEPMODE, DEPDIR, COMPILE.post, COMPILE.pre, COMPILE, POSTCOMPILE, depcomp): New variables. Remove all _h variables. Remove many .o targets. ($(srcdir)/copying.c): avoid backslash-newline after comment sign (@maintainer_mode_true@). (HFILES_NO_SRCDIR): Regenerate. (generated_files): New variable. (all_gdbtk_cflags): Likewise. (.c.o): Rewrote. (init.o, version.o, copying.o): Remove. (distclean): Remove DEPDIR. (test-cp-name-parser.o, hpux-thread.o, main.o, monitor.o, printcmd.o, procfs.o, v850ice.o): Rewrite. (cli-cmds.o, cli-decode.o, cli-dump.o, cli-interp.o, cli-logging.o, cli-script.o, cli-setshow.o, cli-utils.o): Likewise. (gdbtk.o, gdbtk-bp.o, gdbtk-cmds.o, gdbtk-hooks.o, gdbtk-interp.o, gdbtk-main.o, gdbtk-register.o, gdbtk-stack.o, gdbtk-varobj.o, gdbtk-wrapper.o): Likewise. (mi-cmd-break.o, mi-cmd-disas.o, mi-cmd-env.o, mi-cmd-file.o, mi-cmds.o, mi-cmd-stack.o, mi-cmd-target.o, mi-cmd-var.o, mi-console.o, mi-getopt.o, mi-interp.o, mi-main.o, mi-out.o, mi-parse.o, mi-symbol-cmds.o, mi-common.o, signals.o, tui.o, tui-command.o, tui-data.o, tui-disasm.o, tui-file.o, tui-hooks.o, tui-interp.o, tui-io.o, tui-layout.o, tui-main.o, tui-out.o, tui-regs.o, tui-source.o, tui-stack.o, tui-win.o, tui-windata.o, tui-wingeneral.o, tui-winsource.o): Likewise. (all_object_files): New variable. ($(all_object_files)): New target. Include dependency files, when using GNU Make. gdb/gdbserver/ * Makefile.in (GDBREPLAY_OBS): New variable. (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
2008-08-08 00:49:10 +02:00
2008-08-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in (GDBREPLAY_OBS): New variable.
(gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
2008-08-05 Ulrich Weigand <uweigand@de.ibm.com>
Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_resume_one_process): Ignore ESRCH.
(usr_store_inferior_registers): Likewise.
(regsets_store_inferior_registers): Likewise.
2008-07-31 Rolf Jansen <rj@surtec.com>
Pedro Alves <pedro@codesourcery.com>
* configure.ac: Check for memmem declaration.
* server.c [HAVE_MALLOC_H]: Include malloc.h.
(disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
(disable_packet_qfThreadInfo): Unconditionally compile.
* server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
* configure, config.in: Regenerate.
2008-07-28 Doug Kwan <dougkwan@google.com>
* linux-low.c (sys/dir.h, sys/user.h): Remove includes.
(linux_write_memory): Remove declaration of errno.
2008-07-12 Ulrich Weigand <uweigand@de.ibm.com>
* linux-low.c (handle_extended_wait): Do not use "status"
variable uninitialized.
2008-07-07 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_v_attach): Inhibit reporting dll changes.
2008-06-27 Pedro Alves <pedro@codesourcery.com>
* remote-utils.c (prepare_resume_reply): If requested, don't
output "thread:TID" in the T stop reply.
* server.c (disable_packet_vCont, disable_packet_Tthread)
(disable_packet_qC, disable_packet_qfThreadInfo): New globals.
(handle_query): If requested, disable support for qC, qfThreadInfo
and qsThreadInfo.
(handle_v_requests): If requested, disable support for vCont.
(gdbserver_show_disableable): New.
(main): Handle --disable-packet and --disable-packet=LIST.
* server.h (disable_packet_vCont, disable_packet_Tthread)
(disable_packet_qC, disable_packet_qfThreadInfo): Declare.
2008-06-20 Carlos O'Donell <carlos@codesourcery.com>
* server.c (gdbserver_usage): Mention --version.
2008-06-07 00:19:50 +02:00
2008-06-06 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (gdbreplay.o): New rule.
2008-06-06 Joseph Myers <joseph@codesourcery.com>
* gdbreplay.c (gdbreplay_version): Say gdbreplay in version
message, not gdbserver.
2008-06-05 Vladimir Prus <vladimir@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * acinclude.m4: Include ../config/acx.m4. * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL. * configure, config.in: Regenerate. * main.c (print_gdb_help): Use REPORT_BUGS_TO for bug-reporting address. * top.c (print_gdb_version): Use PKGVERSION and REPORT_BUGS_TO. doc: 2008-06-05 Vladimir Prus <vladimir@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure.ac: Include ../../config/acx.m4. Use ACX_PKGVERSION and ACX_BUGURL. * configure: Regenerate. * Makefile.in (PKGVERSION, BUGURL_TEXI): Define. (GDBvn.texi): Define VERSION_PACKAGE, BUGURL and BUGURL_DEFAULT. * gdb.texinfo: Use VERSION_PACKAGE and BUGURL. Remove mailing-list-specific text about bug reporting unless BUGURL_DEFAULT. gdbserver: 2008-06-05 Vladimir Prus <vladimir@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * acinclude.m4: Include ../../config/acx.m4. * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL. * configure, config.in: Regenerate. * Makefile.in (gdbreplay$(EXEEXT)): Add version.o. * server.c (gdbserver_version): Print PKGVERSION. (gdbsrever_usage): Add stream parameter. Print REPORT_BUGS_TO. (main): Adjust gdbserver_usage calls. * gdbreplay.c (version, host_name): Add declarations. (gdbreplay_version, gdbreplay_usage): New. (main): Accept --version and --help options.
2008-06-06 00:36:57 +02:00
2008-06-05 Vladimir Prus <vladimir@codesourcery.com>
2010-08-27 14:02:20 +02:00
Nathan Sidwell <nathan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
2008-06-05 Vladimir Prus <vladimir@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * acinclude.m4: Include ../config/acx.m4. * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL. * configure, config.in: Regenerate. * main.c (print_gdb_help): Use REPORT_BUGS_TO for bug-reporting address. * top.c (print_gdb_version): Use PKGVERSION and REPORT_BUGS_TO. doc: 2008-06-05 Vladimir Prus <vladimir@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure.ac: Include ../../config/acx.m4. Use ACX_PKGVERSION and ACX_BUGURL. * configure: Regenerate. * Makefile.in (PKGVERSION, BUGURL_TEXI): Define. (GDBvn.texi): Define VERSION_PACKAGE, BUGURL and BUGURL_DEFAULT. * gdb.texinfo: Use VERSION_PACKAGE and BUGURL. Remove mailing-list-specific text about bug reporting unless BUGURL_DEFAULT. gdbserver: 2008-06-05 Vladimir Prus <vladimir@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * acinclude.m4: Include ../../config/acx.m4. * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL. * configure, config.in: Regenerate. * Makefile.in (gdbreplay$(EXEEXT)): Add version.o. * server.c (gdbserver_version): Print PKGVERSION. (gdbsrever_usage): Add stream parameter. Print REPORT_BUGS_TO. (main): Adjust gdbserver_usage calls. * gdbreplay.c (version, host_name): Add declarations. (gdbreplay_version, gdbreplay_usage): New. (main): Accept --version and --help options.
2008-06-06 00:36:57 +02:00
* acinclude.m4: Include ../../config/acx.m4.
* configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
* configure, config.in: Regenerate.
* Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
* server.c (gdbserver_version): Print PKGVERSION.
(gdbsrever_usage): Add stream parameter. Print REPORT_BUGS_TO.
(main): Adjust gdbserver_usage calls.
* gdbreplay.c (version, host_name): Add declarations.
(gdbreplay_version, gdbreplay_usage): New.
(main): Accept --version and --help options.
2008-06-04 Daniel Jacobowitz <dan@codesourcery.com>
* linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
(arm_breakpoint_at): Handle Thumb.
(the_low_target): Add comment.
2008-05-29 Ulrich Weigand <uweigand@de.ibm.com>
* linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
2008-05-09 Doug Evans <dje@google.com>
2008-05-09 20:08:56 +02:00
* server.h (decode_search_memory_packet): Declare.
* remote-utils.c (decode_search_memory_packet): New fn.
* server.c (handle_search_memory_1): New fn.
(handle_search_memory): New fn.
(handle_query): Process qSearch:memory packets.
2008-05-08 Ulrich Weigand <uweigand@de.ibm.com>
* regcache.c (registers_length): Remove.
(set_register_cache): Verify that PBUFSIZ is large enough to hold a
full register packet.
* regcache.h (registers_length): Remove prototype.
* server.h (PBUFSIZ): Define to 16384.
ChangeLog: * Makefile.in (ppc_linux_tdep_h): New macro. (powerpc_32l_c, powerpc_altivec32_c, powerpc_altivec32l_c): Likewise. (powerpc_64l_c, powerpc_altivec64_c, powerpc_altivec64l_c): Likewise. (powerpc_e500l_c): Likewise. (ppc-linux-nat.o): Update dependencies. (ppc-linux-tdep.o): Update dependencies. (rs6000-tdep.o): Update dependencies. * ppc-tdep.h (ppc_linux_memory_remove_breakpoint): Remove. (ppc_linux_svr4_fetch_link_map_offsets): Remove. (ppc_linux_gregset, ppc_linux_fpregset): Move to ppc-linux-tdep.h (ppc_supply_reg, ppc_collect_reg): Add prototypes. (tdesc_powerpc_e500): Remove. * rs6000.c: Include "features/rs6000/powerpc-altivec32.c" and "features/rs6000/powerpc-altivec64.c". (ppc_supply_reg, ppc_collect_reg): Make global. (variants): Use tdesc_powerpc_32 for "powerpc" and tdesc_powerpc_altivec64 for "powerpc64". (_initialize_rs6000_tdep): Initialize AltiVec descriptions. * ppc-linux-tdep.h: New file. * ppc-linux-tdep.c: Include "ppc-linux-tdep.c". Include "features/rs6000/powerpc-32l.c". Include "features/rs6000/powerpc-altivec32l.c". Include "features/rs6000/powerpc-64l.c". Include "features/rs6000/powerpc-altivec64l.c". Include "features/rs6000/powerpc-e500l.c". (ppc_linux_supply_gregset): New function. (ppc_linux_collect_gregset): Handle orig_r3 and trap registers. (ppc32_linux_gregset): Use ppc_linux_supply_gregset. (ppc64_linux_gregset): Likewise. (ppc_linux_sigtramp_cache): Handle orig_r3 and trap registers. (ppc_linux_trap_reg_p): New function. (ppc_linux_write_pc): New function. (ppc_linux_core_read_description): New function. (ppc_linux_init_abi): Install ppc_linux_write_pc and ppc_linux_core_read_description. Install orig_r3 and trap registers if present in the target description. (_initialize_ppc_linux_tdep): Initialize Linux target descriptions. * ppc-linux-nat.c: Include "ppc-linux-tdep.h". (PT_ORIG_R3, PT_TRAP): Define if necessary. (ppc_register_u_addr): Handle orig_r3 and trap registers. (fetch_ppc_registers): Likewise. (store_ppc_registers): Likewise. (store_register): Likewise. (ppc_linux_read_description): Check whether AltiVec is supported. Check whether inferior is 32-bit or 64-bit. Return the appropriate Linux target description. * features/Makefile (WHICH): Use rs6000/powerpc-32l and rs6000/powerpc-altivec32l instead of rs6000/powerpc-32. Use rs6000/powerpc-64l and rs6000/powerpc-altivec64l instead of rs6000/powerpc-64. Use rs6000/powerpc-e500l instead of rs6000/powerpc-e500. Update -expedite variables accordingly. * features/rs6000/power-spe.xml: Use regnum 73 for "acc". * features/rs6000/powerpc-32.xml: Do not include power-altivec.xml. * features/rs6000/powerpc-64.xml: Do not include power-altivec.xml. * features/rs6000/powerpc-e500.c: Regenerate. * features/rs6000/powerpc-32.c: Regenerate. * features/rs6000/powerpc-64.c: Regenerate. * features/rs6000/power-linux.xml: New file. * features/rs6000/power64-linux.xml: New file. * features/rs6000/powerpc-32l.xml: New file. * features/rs6000/powerpc-altivec32l.xml: New file. * features/rs6000/powerpc-64l.xml: New file. * features/rs6000/powerpc-altivec64l.xml: New file. * features/rs6000/powerpc-e500l.xml: New file. * features/rs6000/powerpc-32l.c: New (generated) file. * features/rs6000/powerpc-altivec32l.c: New (generated) file. * features/rs6000/powerpc-64l.c: New (generated) file. * features/rs6000/powerpc-altivec64l.c: New (generated) file. * features/rs6000/powerpc-e500l.xml: New (generated) file. * regformats/reg-ppc.dat: Remove. * regformats/reg-ppc64.dat: Remove. * regformats/rs6000/powerpc-32.dat: Remove. * regformats/rs6000/powerpc-64.dat: Remove. * regformats/rs6000/powerpc-e500.dat: Remove. * regformats/rs6000/powerpc-32l.dat: New (generated) file. * regformats/rs6000/powerpc-altivec32l.dat: New (generated) file. * regformats/rs6000/powerpc-64l.dat: New (generated) file. * regformats/rs6000/powerpc-altivec64l.dat: New (generated) file. * regformats/rs6000/powerpc-e500l.dat: New (generated) file. gdbserver/ChangeLog: * configure.srv (powerpc*-*-linux*): Set srv_regobj to powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o, powerpc-64l.o, and powerpc-altivec64l.o. Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml, rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml, rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml, rs6000/power-linux.xml, and rs6000/power64-linux.xml to srv_xmlfiles. * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ... (powerpc-32l.o, powerpc-32l.c): ... these new rules. (powerpc-32.o, powerpc-32.c): Remove, replace by ... (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules. (powerpc-e500.o, powerpc-e500.c): Remove, replace by ... (powerpc-e500l.o, powerpc-e500l.c): ... these new rules. (reg-ppc64.o, reg-ppc64.c): Remove, replace by ... (powerpc-64l.o, powerpc-64l.c): ... these new rules. (powerpc-64.o, powerpc-64.c): Remove, replace by ... (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules. (clean): Update. * linux-ppc-low.c (init_registers_ppc): Remove, replace by ... (init_registers_powerpc_32l): ... this new prototype. (init_registers_powerpc_32): Remove, replace by ... (init_registers_powerpc_altivec32l): ... this new prototype. (init_registers_powerpc_e500): Remove, replace by ... (init_registers_powerpc_e500l): ... this new prototype. (init_registers_ppc64): Remove, replace by ... (init_registers_powerpc_64l): ... this new prototype. (init_registers_powerpc_64): Remove, replace by ... (init_registers_powerpc_altivec64l): ... this new prototype. (ppc_num_regs): Set to 73. (PT_ORIG_R3, PT_TRAP): Define if necessary. (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap. (ppc_cannot_store_register): Handle orig_r3 and trap. (ppc_arch_setup): Update init_registers_... calls. (ppc_fill_gregset): Handle orig_r3 and trap. * inferiors.c (clear_inferiors): Reset current_inferior.
2008-05-03 19:16:44 +02:00
2008-05-03 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv (powerpc*-*-linux*): Set srv_regobj to
powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
powerpc-64l.o, and powerpc-altivec64l.o.
Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
rs6000/power-linux.xml, and rs6000/power64-linux.xml
to srv_xmlfiles.
* Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
(powerpc-32l.o, powerpc-32l.c): ... these new rules.
(powerpc-32.o, powerpc-32.c): Remove, replace by ...
(powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
(powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
(powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
(reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
(powerpc-64l.o, powerpc-64l.c): ... these new rules.
(powerpc-64.o, powerpc-64.c): Remove, replace by ...
(powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
(clean): Update.
* linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
(init_registers_powerpc_32l): ... this new prototype.
(init_registers_powerpc_32): Remove, replace by ...
(init_registers_powerpc_altivec32l): ... this new prototype.
(init_registers_powerpc_e500): Remove, replace by ...
(init_registers_powerpc_e500l): ... this new prototype.
(init_registers_ppc64): Remove, replace by ...
(init_registers_powerpc_64l): ... this new prototype.
(init_registers_powerpc_64): Remove, replace by ...
(init_registers_powerpc_altivec64l): ... this new prototype.
(ppc_num_regs): Set to 73.
(PT_ORIG_R3, PT_TRAP): Define if necessary.
(ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
(ppc_cannot_store_register): Handle orig_r3 and trap.
(ppc_arch_setup): Update init_registers_... calls.
(ppc_fill_gregset): Handle orig_r3 and trap.
* inferiors.c (clear_inferiors): Reset current_inferior.
2008-04-23 Paolo Bonzini <bonzini@gnu.org>
2010-08-27 14:02:20 +02:00
* acinclude.m4: Add override.m4.
* configure: Regenerate.
2008-04-21 Ulrich Weigand <uweigand@de.ibm.com>
* linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
initial call to init_register_ppc64.
2008-04-21 Ulrich Weigand <uweigand@de.ibm.com>
2013-02-12 16:18:33 +01:00
* configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
single powerpc*-*-linux* case.
(s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
2008-04-17 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
2010-08-27 14:02:20 +02:00
srv_regobj. Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
from reg_xmlfiles.
* linux-ppc-low.c: Include <elf.h>.
(PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
(ppc_hwcap): New global variable.
(ppc_regmap): Remove __SPE__ #ifdef sections.
(ppc_regmap_e500): New global variable.
(ppc_cannot_store_register): Update __SPE__ special case.
(ppc_get_hwcap): New function.
(ppc_arch_setup): Use it to determine whether inferior supports
AltiVec or SPE registers. Set the_low_target.regmap if appropriate.
(ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
Do not access registers if target does not support AltiVec.
(ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
Do not access registers if target does not support SPE.
(target_regsets): Unconditionally include AltiVec and SPE regsets.
2008-04-17 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (disabled_regsets, num_regsets): New.
(use_regsets_p): Delete.
(linux_wait_for_process): Clear disabled_regsets.
(regsets_fetch_inferior_registers): Check and set it.
(regsets_store_inferior_registers): Likewise.
(linux_fetch_registers, linux_store_registers): Do not use
use_regsets_p.
(initialize_low): Allocate disabled_regsets.
2008-04-14 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (LIBOBJS): New.
(OBS): Use LIBOBJS.
(memmem.o): New rule.
* configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
* configure: Regenerated.
2008-04-04 Ulrich Weigand <uweigand@de.ibm.com>
* server.c (handle_query): Never return "unsupported" for
qXfer:features:read queries.
2008-03-27 Ulrich Weigand <uweigand@de.ibm.com>
* server.c (get_features_xml): Fix inverted condition.
(handle_query): Always support qXfer:feature:read.
2008-03-10 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (wrapper_argv): New.
(start_inferior): Handle wrapper_argv. If set, expect an extra
trap.
(gdbserver_usage): Document --wrapper.
(main): Parse --wrapper.
2008-02-28 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv [powerpc64-*-linux*]: Add all files mentioned for
powerpc-*-linux* to srv_regobj and reg_xmlfiles.
* linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
(ppc_set_pc): Likewise.
(ppc_arch_setup): New function.
(ppc_fill_gregset): Call ppc_collect_ptrace_register instead
of collect_register.
2010-08-27 14:02:20 +02:00
(the_low_target): Use ppc_arch_setup as arch_setup initializer.
2008-02-28 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
instead of linux-ppc64-low.o.
* linux-ppc64-low.c: Remove file.
* Makefile.in (SFILES): Remove linux-ppc64-low.c.
(linux-ppc64-low.o): Remove rule.
* linux-ppc-low.c (init_registers_ppc64): Add prototype.
(init_registers_powerpc_64): Likewise.
(ppc_regmap): Conditionally define depending on __powerpc64__.
(ppc_cannot_store_register): Do not special-case "fpscr" when
compiled on __powerpc64__.
(ppc_collect_ptrace_register): New function.
(ppc_supply_ptrace_register): New function.
(ppc_breakpoint): Change type to "unsigned int".
(ppc_breakpoint_at): Change type of "insn" to "unsigned int".
(the_low_target): Conditionally provide initializers for the
2010-08-27 14:02:20 +02:00
arch_setup member depending on __powerpc64__. Install
collect_ptrace_register and supply_ptrace_register members.
ChangeLog: * features/Makefile (%.dat): Emit xmltarget statement. * regformats/regdat.sh: Support xmltarget and xmlarch statments. Generate code to set gdbserver_xmltarget in init_registers_${name}. * regformats/arm-with-iwmmxt.dat: Regenerate. * regformats/mips64-linux.dat: Regenerate. * regformats/mips-linux.dat: Regenerate. * regformats/rs6000/powerpc-32.dat: Regenerate. * regformats/rs6000/powerpc-64.dat: Regenerate. * regformats/rs6000/powerpc-e500.dat: Regenerate. * regformats/reg-arm.dat: Add xmlarch statement. * regformats/reg-i386.dat: Likewise. * regformats/reg-i386-linux.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-spu.dat: Likewise. gdbserver/ChangeLog: * regcache.h (gdbserver_xmltarget): Add extern declaration. * server.c (gdbserver_xmltarget): Define. (get_features_xml): Use it to replace "target.xml" and arch_string. * configure.srv: Remove srv_xmltarget. Add XML files that were mentioned there to srv_xmlfiles instead. Remove conditional tests on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set srv_xmlfiles and srv_regobj to include all possible choices. * configure.ac (srv_xmltarget): Remove. (srv_xmlfiles): Do not add "target.xml". (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove checks for supplementary target information. * configure: Regenerate. * Makefile.in (XML_TARGET): Remove. (target.xml): Remove rule. (clean): Do not clean up target.xml. (.PRECIOUS): Do not mention target.xml. * target.h (struct target_ops): Remove arch_string member. * linux-low.c (linux_arch_string): Remove. (linux_target_ops): Remove arch_string initializer. * linux-low.h (struct linux_target_ops): Remove arch_string member. * linux-i386-low.c (the_low_target): Remove arch_string initializer. * linux-x86-64-low.c (the_low_target): Remove arch_string initializer. * spu-low.c (spu_arch_string): Remove. (spu_target_ops): Remove arch_string initializer. * win32-low.c (win32_arch_string): Remove. (win32_target_ops): Remove arch_string initializer. * win32-low.h (struct win32_target_ops): Remove arch_string member. * win32-arm-low.c (the_low_target): Remove arch_string initializer. * win32-i368-low.c (the_low_target): Remove arch_string initializer.
2008-02-28 06:54:10 +01:00
2008-02-28 Ulrich Weigand <uweigand@de.ibm.com>
* regcache.h (gdbserver_xmltarget): Add extern declaration.
* server.c (gdbserver_xmltarget): Define.
(get_features_xml): Use it to replace "target.xml" and arch_string.
* configure.srv: Remove srv_xmltarget. Add XML files that were
mentioned there to srv_xmlfiles instead. Remove conditional tests
on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
srv_xmlfiles and srv_regobj to include all possible choices.
* configure.ac (srv_xmltarget): Remove.
(srv_xmlfiles): Do not add "target.xml".
(gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
checks for supplementary target information.
* configure: Regenerate.
* Makefile.in (XML_TARGET): Remove.
(target.xml): Remove rule.
(clean): Do not clean up target.xml.
(.PRECIOUS): Do not mention target.xml.
* target.h (struct target_ops): Remove arch_string member.
* linux-low.c (linux_arch_string): Remove.
(linux_target_ops): Remove arch_string initializer.
* linux-low.h (struct linux_target_ops): Remove arch_string member.
* linux-i386-low.c (the_low_target): Remove arch_string initializer.
* linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
* spu-low.c (spu_arch_string): Remove.
(spu_target_ops): Remove arch_string initializer.
* win32-low.c (win32_arch_string): Remove.
(win32_target_ops): Remove arch_string initializer.
* win32-low.h (struct win32_target_ops): Remove arch_string member.
* win32-arm-low.c (the_low_target): Remove arch_string initializer.
* win32-i368-low.c (the_low_target): Remove arch_string initializer.
2008-02-27 Ulrich Weigand <uweigand@de.ibm.com>
* linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
by collect_ptrace_register and supply_ptrace_register hooks.
* linux-low.c (fetch_register): Use supply_ptrace_register callback
instead of checking for the_low_target.left_pad_xfer.
(usr_store_inferior_registers): Use collect_ptrace_register callback
instead of checking for the_low_target.left_pad_xfer.
* linux-s390-low.c (s390_collect_ptrace_register): New function.
(s390_supply_ptrace_register): Likewise.
(s390_fill_gregset): Call s390_collect_ptrace_register.
(the_low_target): Update.
* linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
(ppc_supply_ptrace_register): Likewise.
(the_low_target): Update.
* linux-i386-low.c (the_low_target): Update.
* linux-x86-64-low.c (the_low_target): Update.
2008-02-27 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv [s390x-*-linux*]: Set srv_regobj to include both
reg-s390.o and reg-s390x.o.
* linux-low.c (new_inferior): New global variable.
(linux_create_inferior, linux_attach): Set it.
(linux_wait_for_process): Call the_low_target.arch_setup after the
target has stopped for the first time.
(initialize_low): Do not call the_low_target.arch_setup.
* linux-s390-low.c (s390_get_pc): Support bi-arch operation.
(s390_set_pc): Likewise.
(s390_arch_setup): New function.
(the_low_target): Use s390_arch_setup as arch_setup routine.
* regcache.c (realloc_register_cache): New function.
(set_register_cache): Call it for each existing regcache.
gdb/ChangeLog: * regformats/regdat.sh: Rename init_registers function in generated file to init_registers_${name}. * regformats/reg-crisv32.dat: Set "name" to crisv32. * regformats/reg-ppc64.dat: Set "name" to ppc64. * regformats/reg-s390x.dat: Set "name" to s390x. gdbserver/ChangeLog: * server.h (init_registers): Remove prototype. * linux-low.h (struct linux_target_ops): Add arch_setup field. * linux-low.c (initialize_low): Call the_low_target.arch_setup () instead of init_registers (). * linux-arm-low.c (init_registers_arm): Add prototype. (init_registers_arm_with_iwmmxt): Likewise. (the_low_target): Add initializer for arch_setup field. * linux-cris-low.c (init_registers_cris): Add prototype. (the_low_target): Add initializer for arch_setup field. * linux-crisv32-low.c (init_registers_crisv32): Add prototype. (the_low_target): Add initializer for arch_setup field. * linux-i386-low.c (init_registers_i386_linux): Add prototype. (the_low_target): Add initializer for arch_setup field. * linux-ia64-low.c (init_registers_ia64): Add prototype. (the_low_target): Add initializer for arch_setup field. * linux-m32r-low.c (init_registers_m32r): Add prototype. (the_low_target): Add initializer for arch_setup field. * linux-m68k-low.c (init_registers_m68k): Add prototype. (the_low_target): Add initializer for arch_setup field. * linux-mips-low.c (init_registers_mips_linux): Add prototype. (init_registers_mips64_linux): Likewise. (the_low_target): Add initializer for arch_setup field. * linux-ppc-low.c (init_registers_ppc): Add prototype. (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise. (the_low_target): Add initializer for arch_setup field. * linux-ppc64-low.c (init_registers_ppc64): Add prototype. (init_registers_powerpc_64): Likewise. (the_low_target): Add initializer for arch_setup field. * linux-s390-low.c (init_registers_s390): Add prototype. (init_registers_s390x): Likewise. (the_low_target): Add initializer for arch_setup field. * linux-sh-low.c (init_registers_sh): Add prototype. (the_low_target): Add initializer for arch_setup field. * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype. (the_low_target): Add initializer for arch_setup field. * linux-xtensa-low.c (init_registers_xtensa): Add prototype. (the_low_target): Add initializer for arch_setup field. * win32-low.h (struct win32_target_ops): Add arch_setup field. * win32-low.c (initialize_low): Call the_low_target.arch_setup () instead of init_registers (). * win32-arm-low.c (init_registers_arm): Add prototype. (the_low_target): Add initializer for arch_setup field. * win32-i386-low.c (init_registers_i386): Add prototype. (the_low_target): Add initializer for arch_setup field. * spu-low.c (init_registers_spu): Add prototype. (initialize_low): Call initialie_registers_spu () instead of initialize_registers ().
2008-02-27 04:27:40 +01:00
2008-02-27 Ulrich Weigand <uweigand@de.ibm.com>
* server.h (init_registers): Remove prototype.
* linux-low.h (struct linux_target_ops): Add arch_setup field.
* linux-low.c (initialize_low): Call the_low_target.arch_setup ()
instead of init_registers ().
* linux-arm-low.c (init_registers_arm): Add prototype.
(init_registers_arm_with_iwmmxt): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-cris-low.c (init_registers_cris): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-crisv32-low.c (init_registers_crisv32): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-i386-low.c (init_registers_i386_linux): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-ia64-low.c (init_registers_ia64): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-m32r-low.c (init_registers_m32r): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-m68k-low.c (init_registers_m68k): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-mips-low.c (init_registers_mips_linux): Add prototype.
(init_registers_mips64_linux): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-ppc-low.c (init_registers_ppc): Add prototype.
(init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-ppc64-low.c (init_registers_ppc64): Add prototype.
(init_registers_powerpc_64): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-s390-low.c (init_registers_s390): Add prototype.
(init_registers_s390x): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-sh-low.c (init_registers_sh): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-xtensa-low.c (init_registers_xtensa): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* win32-low.h (struct win32_target_ops): Add arch_setup field.
* win32-low.c (initialize_low): Call the_low_target.arch_setup ()
instead of init_registers ().
* win32-arm-low.c (init_registers_arm): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* win32-i386-low.c (init_registers_i386): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* spu-low.c (init_registers_spu): Add prototype.
(initialize_low): Call initialie_registers_spu () instead of
initialize_registers ().
2008-02-19 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_v_requests): When handling the vRun and vAttach
packets, if already debugging a process, don't kill it. Return an
error instead.
2008-02-17 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (handle_query): Correct length check.
2008-02-14 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (do_initial_child_stuff): Add process handle
parameter. Set current_process_handle and current_process_id from the
parameters. Clear globals.
(win32_create_inferior): Don't set current_process_handle and
current_process_id here. Instead pass them on the call to
do_initial_child_stuff.
(win32_attach): Likewise.
(win32_clear_inferiors): New.
(win32_kill): Don't close the current process handle or the
current thread handle here. Instead call win32_clear_inferiors.
(win32_detach): Don't open a new handle to the process. Call
win32_clear_inferiors.
(win32_join): Don't rely on current_process_handle; open a new
handle using the process id.
(win32_wait): Call win32_clear_inferiors when the inferior process
has exited.
2008-02-14 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (monitor_show_help): Add "exit".
2008-02-11 Maxim Grigoriev <maxim2405@gmail.com>
* Makefile.in (SFILES): Add linux-xtensa-low.c.
(clean): Add reg-xtensa.c.
(linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
* configure.srv (xtensa*-*-linux*) New target.
* linux-xtensa-low.c: New.
* xtensa-xtregs.c: New.
2008-02-01 Pedro Alves <pedro_alves@portugalmail.pt>
* hostio.c: Don't include errno.h.
(errno_to_fileio_errno): Move to hostio-errno.
* hostio.c: (hostio_error): Remove the error parameter. Defer the
error number outputting to the target->hostio_last_error callback.
(hostio_packet_error): Use FILEIO_EINVAL directly.
(handle_open, handle_pread, hostio_error, handle_unlink): Update
calls to hostio_error.
* hostio-errno.c: New.
* server.h (hostio_last_error_from_errno): Declare.
* target.h (target_ops): Add hostio_last_error member.
* linux-low.c (linux_target_op): Register hostio_last_error_from_errno
as hostio_last_error handler.
2010-08-27 14:02:20 +02:00
* spu-low.c (spu_target_ops): Likewise.
* win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
(wince_hostio_last_error): New functions.
(win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
as hostio_last_error handler.
(win32_target_ops) [!_WIN32_WCE]: Register
hostio_last_error_from_errno as hostio_last_error handler.
* Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
(hostio-errno.o): New rule.
* configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
* configure.srv (srv_hostio_err_objs): New variable. Default to
hostio-errno.o.
(arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
* configure: Regenerate.
* linux-low.c (linux_attach_lwp): Do not _exit after errors. (linux_kill, linux_detach): Clean up the process list. * remote-utils.c (remote_open): Improve port number parsing. (putpkt_binary, input_interrupt): Only send interrupts if the target is running. * server.c (extended_protocol): Make static. (attached): Define earlier. (exit_requested, response_needed, program_argv): New variables. (target_running): New. (start_inferior): Clear attached here. (attach_inferior): Set attached here. (require_running): Define. (handle_query): Use require_running and target_running. Implement "monitor exit". (handle_v_attach, handle_v_run): New. (handle_v_requests): Use require_running. Handle vAttach and vRun. (gdbserver_usage): Update. (main): Redo argument parsing. Handle --debug and --multi. Handle --attach along with other options or after the port. Save program_argv. Support no initial program. Resynchronize communication with GDB after an error. Handle "monitor exit". Use require_running and target_running. Always allow the extended protocol. Do not error out for Hc0 or Hc-1. Do not automatically restart in extended mode. * README: Refer to the GDB manual. Update --attach usage. * remote.c (struct remote_state): Add cached_wait_status. (remote_exec_file): New variable. (PACKET_vAttach, PACKET_vRun): New constants. (extended_remote_restart): Do not query for status. (struct start_remote_args): New. (remote_start_remote): Take it as a second argument. Check whether the target is running. Issue an error for non-running non-extended targets. Cache the wait status. Set inferior_ptid here. (remote_open_1): Prompt to disconnect non-running targets. Make sure the target is marked running. Do not set inferior_ptid here. Update call to remote_start_remote. Do not call remote_check_symbols if the target is not running. (remote_detach_1): Rename from remote_detach. Take an EXTENDED argument. Handle a non-running target. (remote_detach): Use it. (extended_remote_detach): New. (remote_disconnect): Fix typo. Use remoute_mourn_1. (extended_remote_attach_1, extended_remote_attach) (extended_async_remote_attach): New. (remote_vcont_resume): Remove unused variable. (remote_wait, remote_async_wait): Use any cached wait status. (putpkt_binary, getpkt): Clear any cached wait status. (extended_remoute_mourn_1): New. (extended_remote_mourn): Use it. (extended_async_remote_mourn, extended_remote_run): New. (extended_remote_create_inferior_1): New. (extended_remote_create_inferior): Use it. (extended_remote_async_create_inferior): Likewise. (remote_xfer_partial): Skip for non-executing targets. (init_extended_remote_ops): Set to_detach and to_attach. (init_extended_async_remote_ops): Likewise. Use extended_async_remote_mourn. (_initialize_remote): Register vAttach, vRun, and set remote exec-file. * NEWS: Mention vAttach, vRun, and gdbserver extended-remote support. * gdb.server/ext-attach.c, gdb.server/ext-attach.exp, gdb.server/ext-run.exp: New files. * lib/gdbserver-support.exp (gdbserver_download): New. (gdbserver_start): New. Update gdbserver expected output. (gdbserver_spawn): Use them. (gdbserver_start_extended): New. * gdb.texinfo (Using the `gdbserver' Program): Add security warning. Rearrange into subsections and subsubsections. Document --multi and --debug. Correct --with-sysroot typo. Update --attach usage. Make load reference clearer. Document monitor exit. (Remote Configuration): Document set remote exec-file, attach-packet, and run-packet. (Packets): Document vAttach and vRun.
2008-01-30 01:51:50 +01:00
2008-01-29 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_attach_lwp): Do not _exit after errors.
(linux_kill, linux_detach): Clean up the process list.
* remote-utils.c (remote_open): Improve port number parsing.
(putpkt_binary, input_interrupt): Only send interrupts if the target
is running.
* server.c (extended_protocol): Make static.
(attached): Define earlier.
(exit_requested, response_needed, program_argv): New variables.
(target_running): New.
(start_inferior): Clear attached here.
(attach_inferior): Set attached here.
(require_running): Define.
(handle_query): Use require_running and target_running. Implement
"monitor exit".
(handle_v_attach, handle_v_run): New.
(handle_v_requests): Use require_running. Handle vAttach and vRun.
(gdbserver_usage): Update.
(main): Redo argument parsing. Handle --debug and --multi. Handle
--attach along with other options or after the port. Save
program_argv. Support no initial program. Resynchronize
communication with GDB after an error. Handle "monitor exit".
Use require_running and target_running. Always allow the extended
protocol. Do not error out for Hc0 or Hc-1. Do not automatically
restart in extended mode.
* README: Refer to the GDB manual. Update --attach usage.
2007-12-20 Andreas Schwab <schwab@suse.de>
* linux-low.c (STACK_SIZE): Define.
(linux_tracefork_child): Use it. Use __clone2 on ia64.
(linux_test_for_tracefork): Likewise.
2007-12-18 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_wait_for_event): Update messages. Do not
reinsert auto-delete breakpoints.
* mem-break.c (struct breakpoint): Change return type of handler to
int.
(set_breakpoint_at): Update handler type.
(reinsert_breakpoint_handler): Return 1 instead of calling
delete_breakpoint.
(reinsert_breakpoint_by_bp): Check for the original breakpoint before
setting a new one.
(check_breakpoints): Delete auto-delete breakpoints and return 2.
* mem-break.h (set_breakpoint_at): Update handler type.
* thread-db.c (thread_db_create_event, thread_db_create_event): Update.
* win32-low.c (auto_delete_breakpoint): New.
(get_child_debug_event): Use it.
2007-12-16 Daniel Jacobowitz <dan@codesourcery.com>
* configure.ac: Check for pread and pwrite.
* hostio.c (handle_pread): Fall back to lseek and read.
(handle_pwrite): Fall back to lseek and write.
* config.in, configure: Regenerated.
2007-12-07 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (myresume): Add own_buf argument.
(main): Update calls.
2007-12-06 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
* remote-utils.c (remote_open): Do not call disable_async_io.
(block_async_io): Delete.
(unblock_async_io): Make static.
(initialize_async_io): New.
* server.c (handle_v_cont): Handle async I/O here.
(myresume): Likewise. Move other common resume tasks here...
(main): ... from here. Call initialize_async_io. Disable async
I/O before the main loop.
* server.h (initialize_async_io): Declare.
(block_async_io, unblock_async_io): Delete prototypes.
* spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
2007-12-06 Mick Davis <mickd@goanna.iinet.net.au>
* remote-utils.c (readchar): Allow binary data in received messages.
2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (attaching): New global.
(win32_create_inferior): Clear the `attaching' global.
(win32_attach): Set the `attaching' global.
(get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
attaching. Only set a breakpoint at the entry point if not
attaching.
2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt>
* server.c (main): Don't report dll events on the initial
connection on attaches.
2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt>
* server.c (main): Relax numerical bases supported for the pid of
the --attach command line argument.
2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (win32_attach): Call OpenProcess before
DebugActiveProcess, not after. Add last error output to error
call.
2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (win32_get_thread_context)
(win32_set_thread_context): New functions.
(thread_rec): Use win32_get_thread_context.
(continue_one_thread, win32_resume): Use win32_set_thread_context.
* win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
field.
2007-12-03 Leo Zayas
Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (soft_interrupt_requested, faked_breakpoint): New
global variables.
(child_add_thread): Minor cleanup.
(child_continue): Resume artificially suspended threads before
calling ContinueDebugEvent.
(suspend_one_thread): New.
(fake_breakpoint_event): New.
(get_child_debug_event): Change return type to int. Check here if
gdb sent an interrupt request. If a soft interrupt was requested,
fake a breakpoint event. Return 0 if there is no event to handle,
and 1 otherwise.
(win32_wait): Don't check here if gdb sent an interrupt request.
Ensure there is a valid event to handle.
(win32_request_interrupt): Add soft interruption method as last
resort.
2007-12-03 Leo Zayas
Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.h (win32_thread_info): Add descriptions to the
structure members. Replace `suspend_count' counter by a
`suspended' flag.
* win32-low.c (thread_rec): Update condition of when to get the
context from the inferior. Rely on ContextFlags being set if it
has already been retrieved. Only suspend the inferior thread if
we haven't already. Warn if that fails.
(continue_one_thread): s/suspend_count/suspended/. Only call
ResumeThread once. Warn if that fails.
2007-12-02 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (win32_wait): Don't read from the inferior when it
has already exited.
2007-12-02 Pedro Alves <pedro_alves@portugalmail.pt>
* Makefile.in (win32_low_h): New variable.
(win32-low.o): Add dependency on $(win32_low_h).
(win32-arm-low.o, win32-i386-low.o): New rules.
2007-12-01 06:00:04 +01:00
2007-11-30 Daniel Jacobowitz <dan@codesourcery.com>
* hostio.c: Correct copyright year.
* remote.c (remote_cmdlist): New variable. (PACKET_vFile_open, PACKET_vFile_pread, PACKET_vFile_pwrite) (PACKET_vFile_close, PACKET_vFile_unlink): New constants. (remote_buffer_add_string, remote_buffer_add_bytes) (remote_buffer_add_int, remote_hostio_parse_result) (remote_hostio_send_command, remote_hostio_open, remote_hostio_pwrite) (remote_hostio_pread, remote_hostio_close, remote_hostio_unlink) (remote_fileio_errno_to_host, remote_hostio_error, fclose_cleanup) (remote_hostio_close_cleanup, remote_file_put, remote_file_get) (remote_file_delete, remote_put_command, remote_get_command) (remote_delete_command, remote_command): New functions. (_initialize_remote): Register new packets and commands. * Makefile.in (gdb_fileio_h): New variable. (remote.o): Update. (SUBDIR_MI_OBS): Add mi-cmd-target.o. (SUBDIR_MI_SRCS): Add mi/mi-cmd-target.c. (mi-cmd-target.o): New rule. * mi/mi-cmd-target.c: New file. * mi/mi-cmds.c (mi_cmds): Add target-file-delete, target-file-get, and target-file-put. * mi/mi-cmds.h (mi_cmd_target_file_get, mi_cmd_target_file_put) (mi_cmd_target_file_delete): Declare. * remote.h (remote_file_put, remote_file_get, remote_file_delete): Declare. * NEWS: Describe new file transfer support. * gdb.texinfo (Debugging Programs with Multiple Processes): Correct formatting. (Remote Debugging): Add File Transfer section. (Remote Configuration): Document Host I/O packets. (GDB/MI): Add GDB/MI File Transfer Commands section. (Remote Protocol): Add Host I/O Packets section. (Packets): Add vFile. * Makefile.in (OBS): Add hostio.o. (hostio.o): New rule. * server.h (handle_vFile): Declare. * hostio.c: New file. * server.c (handle_v_requests): Take packet_len and new_packet_len for binary packets. Call handle_vFile. (main): Update call to handle_v_requests. * gdb.server/file-transfer.exp, gdb.server/transfer.txt, gdb.mi/mi-file-transfer.exp: New.
2007-11-30 22:50:19 +01:00
2007-11-30 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (OBS): Add hostio.o.
(hostio.o): New rule.
* server.h (handle_vFile): Declare.
* hostio.c: New file.
* server.c (handle_v_requests): Take packet_len and new_packet_len
for binary packets. Call handle_vFile.
(main): Update call to handle_v_requests.
2007-11-05 20:22:08 +01:00
2007-11-05 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c: Include <sched.h>.
2007-11-01 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_tracefork_grandchild): New.
(linux_tracefork_child): Use clone.
(linux_test_for_tracefork): Use clone; allocate and free a stack.
2007-10-31 Joel Brobecker <brobecker@adacore.com>
* Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
2007-10-24 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (handle_extended_wait): Handle unexpected signals.
* inferiors.c (change_inferior_id): Delete. (add_pid_to_list, pull_pid_from_list): New. * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG) (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK) (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE) (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK) (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE) (PTRACE_EVENT_EXIT, __WALL): Provide default definitions. (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables. (using_threads): Always set to 1. (handle_extended_wait): New. (add_process): Do not set TID. (linux_create_inferior): Set must_set_ptrace_flags. (linux_attach_lwp): Remove TID argument. Do not check using_threads. Use PTRACE_SETOPTIONS. Call new_thread_notify. Update all callers. (linux_thread_alive): Rename TID argument to LWPID. (linux_wait_for_process): Handle unknown processes. Do not use TID. (linux_wait_for_event): Do not use TID or check using_threads. Update call to dead_thread_notify. Call handle_extended_wait. (linux_create_inferior): Use PTRACE_SETOPTIONS. (send_sigstop): Delete sigstop_sent. (wait_for_sigstop): Avoid TID. (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid) (linux_test_for_tracefork): New. (linux_lookup_signals): Use thread_db_active and linux_supports_tracefork_flag. (initialize_low): Use thread_db_active and linux_test_for_tracefork. * linux-low.h (get_process_thread): Avoid TID. (struct process_ifo): Move thread_known and tid to the end. Remove sigstop_sent. (linux_attach_lwp, thread_db_init): Update prototypes. * server.h (change_inferior_id): Delete prototype. (add_pid_to_list, pull_pid_from_list): New prototypes. * thread-db.c (thread_db_use_events): New. (find_first_thread): Rename to... (find_one_thread): ...this. Update callers and messages. Do not call fatal. Check thread_db_use_events. Do not call change_inferior_id or new_thread_notify. (maybe_attach_thread): Update. Do not call new_thread_notify. (thread_db_init): Set thread_db_use_events. Check use_events. * utils.c (fatal, warning): Correct message prefix.
2007-10-23 22:05:03 +02:00
2007-10-23 Daniel Jacobowitz <dan@codesourcery.com>
* inferiors.c (change_inferior_id): Delete.
(add_pid_to_list, pull_pid_from_list): New.
* linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
(PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
(PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
(PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
(PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
(PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
(stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
(using_threads): Always set to 1.
(handle_extended_wait): New.
(add_process): Do not set TID.
(linux_create_inferior): Set must_set_ptrace_flags.
(linux_attach_lwp): Remove TID argument. Do not check using_threads.
Use PTRACE_SETOPTIONS. Call new_thread_notify. Update all callers.
(linux_thread_alive): Rename TID argument to LWPID.
(linux_wait_for_process): Handle unknown processes. Do not use TID.
(linux_wait_for_event): Do not use TID or check using_threads. Update
call to dead_thread_notify. Call handle_extended_wait.
(linux_create_inferior): Use PTRACE_SETOPTIONS.
(send_sigstop): Delete sigstop_sent.
(wait_for_sigstop): Avoid TID.
(linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
(linux_test_for_tracefork): New.
(linux_lookup_signals): Use thread_db_active and
linux_supports_tracefork_flag.
(initialize_low): Use thread_db_active and linux_test_for_tracefork.
* linux-low.h (get_process_thread): Avoid TID.
(struct process_ifo): Move thread_known and tid to the end. Remove
sigstop_sent.
(linux_attach_lwp, thread_db_init): Update prototypes.
* server.h (change_inferior_id): Delete prototype.
(add_pid_to_list, pull_pid_from_list): New prototypes.
* thread-db.c (thread_db_use_events): New.
(find_first_thread): Rename to...
(find_one_thread): ...this. Update callers and messages. Do not
call fatal. Check thread_db_use_events. Do not call
change_inferior_id or new_thread_notify.
(maybe_attach_thread): Update. Do not call new_thread_notify.
(thread_db_init): Set thread_db_use_events. Check use_events.
* utils.c (fatal, warning): Correct message prefix.
2007-10-15 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (clean): Remove new files.
(powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
(powerpc-64.o, powerpc-64.c): New rules.
* configure.srv: Use alternate register sets for powerpc64-*-linux*
with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
with SPE.
* linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
SPE targets.
(ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
(PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
(ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
(struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
(target_regsets): Add AltiVec and SPE register sets.
* configure.ac: Check for AltiVec and SPE.
* linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
(ppc_fill_vrregset, ppc_store_vrregset): New.
(target_regsets): Add AltiVec register set.
* configure: Regenerated.
2007-09-19 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (O_LARGEFILE): Define.
(linux_read_memory): Use /proc/PID/mem.
* configure.ac: Use AC_GNU_SOURCE. Check for pread64.
* configure, config.in: Regenerated.
2007-09-04 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_wait_for_event): Do not pass signals while
single-stepping.
2007-09-03 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (create_process): New.
(win32_create_inferior): Use create_process instead of
CreateProcess. If create_process failed retry appending an ".exe"
suffix. Store the GetLastError result immediatelly after
create_process calls and use it on the call to error.
2007-09-03 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
2007-08-23 Joel Brobecker <brobecker@adacore.com>
* configure.ac: Switch license to GPLv3.
2007-08-01 Michael Snyder <msnyder@access-company.com>
* remote-utils.c (putpkt_binary): Memory leak, free buf2.
2007-07-31 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
typedef.
(win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
(load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL. Get
CloseToolhelp32Snapshot.
(toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
CloseToolhelp32Snapshot.
2007-07-27 Michael Snyder <michael.snyder@access-company.com>
* server.c (main): Check for inferior exit before main loop.
2007-07-18 Pedro Alves <pedro_alves@portugalmail.pt>
* remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
instead of on tmp_desc.
2007-07-17 Pedro Alves <pedro_alves@portugalmail.pt> Daniel Jacobowitz <dan@codesourcery.com> * config/i386/cygwin.mt (TDEPFILES): Add solib-target.o. * coff-pe-read.c (read_pe_exported_syms): Delete verbose printf. * NEWS: Mention gdbserver DLL support. * gdb.base/unload.c (dlopen, dlsym, dlclose, dlerror): Define for __WIN32__. (SHLIB_NAME): Delete definition. Always pass dlerror to fprintf. * gdb.base/unload.exp: Use shared library test routines. * inferiors.c (all_dlls, dlls_changed, get_dll): New. (add_thread): Minor cleanups. (clear_inferiors): Move lower in the file. Clear the DLL list. (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New. * remote-utils.c (prepare_resume_reply): Check dlls_changed. (xml_escape_text): New. * server.c (handle_query): Handle qXfer:libraries:read. Report it for qSupported. (handle_v_cont): Report errors. (gdbserver_version): Update. (main): Correct size of own_buf. Do not report initial DLL events. * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll) (unloaded_dll, xml_escape_text): New. * win32-low.c (enum target_waitkind): Update comments. (win32_add_one_solib, get_image_name, winapi_EnumProcessModules) (winapi_GetModuleInformation, winapi_GetModuleFileNameExA) (win32_EnumProcessModules, win32_GetModuleInformation) (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name) (winapi_CreateToolhelp32Snapshot, winapi_Module32First) (winapi_Module32Next, win32_CreateToolhelp32Snapshot) (win32_Module32First, win32_Module32Next, load_toolhelp) (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New. (get_child_debug_event): Handle DLL events. (win32_wait): Likewise.
2007-07-17 14:51:41 +02:00
2007-07-17 Pedro Alves <pedro_alves@portugalmail.pt>
Daniel Jacobowitz <dan@codesourcery.com>
* inferiors.c (all_dlls, dlls_changed, get_dll): New.
(add_thread): Minor cleanups.
(clear_inferiors): Move lower in the file. Clear the DLL
list.
(free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
* remote-utils.c (prepare_resume_reply): Check dlls_changed.
(xml_escape_text): New.
* server.c (handle_query): Handle qXfer:libraries:read. Report it
for qSupported.
(handle_v_cont): Report errors.
(gdbserver_version): Update.
(main): Correct size of own_buf. Do not report initial DLL events.
* server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
(unloaded_dll, xml_escape_text): New.
* win32-low.c (enum target_waitkind): Update comments.
(win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
(winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
(win32_EnumProcessModules, win32_GetModuleInformation)
(win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
(winapi_CreateToolhelp32Snapshot, winapi_Module32First)
(winapi_Module32Next, win32_CreateToolhelp32Snapshot)
(win32_Module32First, win32_Module32Next, load_toolhelp)
(toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
(get_child_debug_event): Handle DLL events.
(win32_wait): Likewise.
2007-07-12 Daniel Jacobowitz <dan@codesourcery.com>
* configure.srv: Set srv_linux_regsets for sh*-*-linux*.
* linux-sh-low.c (sh_fill_gregset, target_regsets): New.
2007-07-08 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (handle_output_debug_string): Ignore event if not
waiting.
2007-07-08 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-arm-low.c (arm_wince_breakpoint): Fix typo.
2007-07-03 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (look_up_one_symbol): Handle 'm' packets.
2007-07-02 Daniel Jacobowitz <dan@codesourcery.com>
* inferiors.c (change_inferior_id): Add comment.
* linux-low.c (check_removed_breakpoint): Add an early
prototype. Improve debug output.
(linux_attach): Doc update.
(linux_detach_one_process, linux_detach): Clean up before releasing
each process.
(send_sigstop, wait_for_sigstop): Improve comments and debug output.
* linux-low.h (struct process_info): Doc improvement.
* mem-break.c (delete_all_breakpoints): New.
* mem-break.h (delete_all_breakpoints): New prototype.
* thread-db.c (find_first_thread): New.
(thread_db_create_event): Call it instead of
thread_db_find_new_threads. Clean up unused variables.
(maybe_attach_thread): Remove first thread handling.
(thread_db_find_new_threads): Use find_first_thread.
(thread_db_get_tls_address): Likewise.
2007-06-27 Daniel Jacobowitz <dan@codesourcery.com>
* thread-db.c (thread_db_find_new_threads): Add prototype.
(thread_db_create_event): Check for the main thread before adding
a new thread.
(maybe_attach_thread): Only enable event reporting if TID == 0.
(thread_db_get_tls_address): Check for new threads.
2007-06-20 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_create_inferior): Try execv before execvp.
* spu-low.c (spu_create_inferior): Likewise.
2007-06-13 Mike Frysinger <vapier@gentoo.org>
* linux-low.c (linux_create_inferior): Change execv to execvp.
* spu-low.c (spu_create_inferior): Likewies.
2007-06-13 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (clean): Clean new files instead of deleted ones.
(reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
(mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
rules.
* configure.srv: Specify XML files and new regformats for MIPS and
MIPS64 GNU/Linux.
* linux-mips-low.c (mips_num_regs): Set to only used registers.
(mips_regmap): Do not fetch $0. Remove unused registers. Add
an entry for the restart register.
(mips_cannot_fetch_register, mips_cannot_store_register)
(mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
register names to match the XML descriptions.
(mips_fill_gregset, mips_store_gregset): Likewise. Handle the
restart register instead of $0.
2007-06-12 Ulrich Weigand <uweigand@de.ibm.com>
Markus Deuling <deuling@de.ibm.com>
* remote-utils.c (decode_xfer_write): New function.
* server.h (decode_xfer_write): Add prototype.
* server.c (handle_query): Add PACKET_LEN argument. Support
qXfer:spu:read and qXfer:spu:write packets.
(main): Pass packet_len to handle_query.
* spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
* target.h (target_ops): Add qxfer_spu.
2007-06-12 Ulrich Weigand <uweigand@de.ibm.com>
* spu-low.c (spu_proc_xfer_spu): Do not return failure when
accessing non-seekable spufs files.
2007-05-16 Markus Deuling <deuling@de.ibm.com>
2010-08-27 14:02:20 +02:00
* server.c (handle_query): Add reply for qC packet.
2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt>
Leo Zayas <lerele@champenstudios@com>
* server.h (check_remote_input_interrupt_request): New function.
* remote_utils.c (INVALID_DESCRIPTOR): New define.
(remote_desc): Initialize with INVALID_DESCRIPTOR.
(input_interrupt): Expose on USE_WIN32API too. Fix whitespace.
(check_remote_input_interrupt_request): New function.
* server.h (check_remote_input_interrupt_request): Declare.
2007-05-16 22:17:01 +02:00
* win32-low.c (winapi_DebugBreakProcess,
winapi_GenerateConsoleCtrlEvent): New typedefs.
(get_child_debug_event): Lower Win32 debug event polling from 1 sec
to 250 ms.
(win32_wait): Check for remote interrupt request
with check_remote_input_interrupt_request.
(win32_request_interrupt): New function.
(win32_target_op): Set request_interrupt to win32_request_interrupt.
* win32-low.c (debug_registers_changed, debug_registers_used, CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS, CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete. (thread_rec): Get context using the low target. (child_add_thread): Call thread_added on the low target, which does the same thing. (regptr): Delete. (do_initial_child_stuff): Remove debug registers references. Set context using the low target. Resume threads after setting the contexts. (child_continue): Remove dead variable. Remove debug registers references. (child_fetch_inferior_registers): Go through the low target. (do_child_store_inferior_registers): Remove. (child_store_inferior_registers): Go through the low target. (win32_resume): Remove debug registers references. Set context using the low target. (handle_exception): Change return type to void. Don't record context here. Set status to TARGET_WAITKIND_SPURIOUS on a first chance exception. (get_child_debug_event): Change return type to void. Remove goto loop. Always return after waiting for debug event. (win32_wait): Convert to switch statement. Handle spurious events. * win32-i386-low.c (debug_registers_changed, debug_registers_used): New. (initial_stuff): Rename to ... (i386_initial_stuff): ... this. Clear debug registers state variables. (store_debug_registers): Delete. (i386_get_thread_context): New. (load_debug_registers): Delete. (i386_set_thread_context): New. (i386_thread_added): New. (single_step): Rename to ... (i386_single_step): ... this. (do_fetch_inferior_registers): Rename to ... (i386_fetch_inferior_register): ... this. (i386_store_inferior_register): New. (the_low_target): Adapt to new interface. * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define. (arm_get_thread_context): New. (arm_set_thread_context): New. (regptr): New. (do_fetch_inferior_registers): Rename to ... (arm_fetch_inferior_register): ... this. (arm_store_inferior_register): New. (arm_wince_breakpoint): Reimplement as unsigned long. (arm_wince_breakpoint_len): Define. (the_low_target): Adapt to new interface. * win32-low.h (target_ops): Remove regmap, store_debug_registers and load_debug_registers. Add get_thread_context, set_thread_context, thread_added and store_inferior_register. Rename fetch_inferior_registers to fetch_inferior_register. (regptr): Remove declaration.
2007-05-10 23:48:56 +02:00
2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (debug_registers_changed,
debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
(thread_rec): Get context using the low target.
(child_add_thread): Call thread_added on the low target,
which does the same thing.
(regptr): Delete.
(do_initial_child_stuff): Remove debug registers references.
Set context using the low target. Resume threads after
setting the contexts.
(child_continue): Remove dead variable. Remove debug
registers references.
(child_fetch_inferior_registers): Go through the low target.
(do_child_store_inferior_registers): Remove.
(child_store_inferior_registers): Go through the low target.
(win32_resume): Remove debug registers references.
Set context using the low target.
(handle_exception): Change return type to void. Don't record
context here. Set status to TARGET_WAITKIND_SPURIOUS on a
first chance exception.
2010-08-27 14:02:20 +02:00
(get_child_debug_event): Change return type to void. Remove
* win32-low.c (debug_registers_changed, debug_registers_used, CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS, CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete. (thread_rec): Get context using the low target. (child_add_thread): Call thread_added on the low target, which does the same thing. (regptr): Delete. (do_initial_child_stuff): Remove debug registers references. Set context using the low target. Resume threads after setting the contexts. (child_continue): Remove dead variable. Remove debug registers references. (child_fetch_inferior_registers): Go through the low target. (do_child_store_inferior_registers): Remove. (child_store_inferior_registers): Go through the low target. (win32_resume): Remove debug registers references. Set context using the low target. (handle_exception): Change return type to void. Don't record context here. Set status to TARGET_WAITKIND_SPURIOUS on a first chance exception. (get_child_debug_event): Change return type to void. Remove goto loop. Always return after waiting for debug event. (win32_wait): Convert to switch statement. Handle spurious events. * win32-i386-low.c (debug_registers_changed, debug_registers_used): New. (initial_stuff): Rename to ... (i386_initial_stuff): ... this. Clear debug registers state variables. (store_debug_registers): Delete. (i386_get_thread_context): New. (load_debug_registers): Delete. (i386_set_thread_context): New. (i386_thread_added): New. (single_step): Rename to ... (i386_single_step): ... this. (do_fetch_inferior_registers): Rename to ... (i386_fetch_inferior_register): ... this. (i386_store_inferior_register): New. (the_low_target): Adapt to new interface. * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define. (arm_get_thread_context): New. (arm_set_thread_context): New. (regptr): New. (do_fetch_inferior_registers): Rename to ... (arm_fetch_inferior_register): ... this. (arm_store_inferior_register): New. (arm_wince_breakpoint): Reimplement as unsigned long. (arm_wince_breakpoint_len): Define. (the_low_target): Adapt to new interface. * win32-low.h (target_ops): Remove regmap, store_debug_registers and load_debug_registers. Add get_thread_context, set_thread_context, thread_added and store_inferior_register. Rename fetch_inferior_registers to fetch_inferior_register. (regptr): Remove declaration.
2007-05-10 23:48:56 +02:00
goto loop. Always return after waiting for debug event.
(win32_wait): Convert to switch statement. Handle spurious
events.
* win32-i386-low.c (debug_registers_changed,
debug_registers_used): New.
(initial_stuff): Rename to ...
(i386_initial_stuff): ... this. Clear debug registers
state variables.
(store_debug_registers): Delete.
(i386_get_thread_context): New.
(load_debug_registers): Delete.
(i386_set_thread_context): New.
(i386_thread_added): New.
(single_step): Rename to ...
(i386_single_step): ... this.
(do_fetch_inferior_registers): Rename to ...
(i386_fetch_inferior_register): ... this.
(i386_store_inferior_register): New.
(the_low_target): Adapt to new interface.
* win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
(arm_get_thread_context): New.
(arm_set_thread_context): New.
(regptr): New.
(do_fetch_inferior_registers): Rename to ...
(arm_fetch_inferior_register): ... this.
(arm_store_inferior_register): New.
(arm_wince_breakpoint): Reimplement as unsigned long.
(arm_wince_breakpoint_len): Define.
(the_low_target): Adapt to new interface.
* win32-low.h (target_ops): Remove regmap, store_debug_registers and
load_debug_registers. Add get_thread_context, set_thread_context,
thread_added and store_inferior_register. Rename
fetch_inferior_registers to fetch_inferior_register.
(regptr): Remove declaration.
2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt>
* linux-low.c (linux_detach): Change return type to int. Return 0.
* spu-low.c (spu_detach): Likewise.
2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt>
* target.h (target_ops): Change return type of detach to int.
Add join.
(join_inferior): New.
* server.c (main): Don't skip detach support on mingw32.
If the inferior doesn't support detaching return error.
Call join_inferior instead of using waitpid.
* linux-low.c (linux_join): New.
(linux_target_op): Add linux_join.
* spu-low.c (spu_join): New.
(spu_target_ops): Add spu_join.
* win32-low.c (win32_detach): Adapt to new interface.
Reopen current_process_handle before detaching. Issue a child
resume before detaching.
(win32_join): New.
(win32_target_op): Add win32_join.
2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (win32-attach): Fix return value.
* target.h (target_ops): Describe ATTACH return values.
2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (GETPROCADDRESS): Define.
(winapi_DebugActiveProcessStop): Add WINAPI. typedef as pointer.
(winapi_DebugSetProcessKillOnExit): Likewise.
(win32_create_inferior): Force usage of ansi CreateProcessA.
(win32_attach): Use GETPROCADDRESS.
(win32_detach): Likewise.
2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c (win32_wait): Don't use WSTOPSIG.
2007-03-30 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c: Commit leftover changes from 2007-03-29.
2007-03-30 Daniel Jacobowitz <dan@codesourcery.com>
* i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
fields short instead of int. Add explicit padding.
(i387_cache_to_fsave): Remove unnecessary casts.
(i387_fsave_to_cache): Doc fix.
(i387_cache_to_fxsave): Remove unnecessary casts and masking.
2007-03-30 Daniel Jacobowitz <dan@codesourcery.com>
* i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
(i387_fxsave_to_cache): Check fp->ftag while building ftag value.
2007-03-29 Pedro Alves <pedro_alves@portugalmail.pt>
* configure.srv (arm*-*-mingw32ce*): Move near the other
arm targets.
gdb/ * arm-wince-tdep.c: New. * config/arm/wince.mt (DEPRECATED_TM_FILE): Use tm-arm.h. (MT_CFLAGS): Delete. (TM_CLIBS): Delete. (TDEPFILES): Add arm-wince-tdep.o, corelow.o, solib.o, solib-legacy.o, solib-svr4.o, and remove wince.o. * configure.tgt (arm*-*-mingw32ce*): Add. * signals/signals.c [HAVE_SIGNAL_H]: Check. (do_target_signal_to_host): Silence 'not used' warning. * config/arm/tm-wince.h: Remove. gdb/gdbserver/ * gdbserver/configure.ac: Add errno checking. (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h, sys/file.h and malloc.h. (AC_CHECK_DECLS): Add perror. (srv_mingwce): Handle. * gdbserver/configure.srv (i[34567]86-*-cygwin*): Add win32-i386-low.o to srv_tgtobj. (i[34567]86-*-mingw*): Likewise. (arm*-*-mingw32ce*): Add case. * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check. [__MINGW32CE__] (strerror): New function. [__MINGW32CE__] (errno): Define to GetLastError. [__MINGW32CE__] (COUNTOF): New macro. (remote_open): Remove extra close call. * mem-break.c (delete_breakpoint_at): New function. * mem-break.h (delete_breakpoint_at): Declare. * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check. [USE_WIN32API] (read, write): Add char* casts. * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check. * server.h: Include wincecompat.h on Windows CE. [HAVE_ERRNO_H]: Check. (perror): Declare if not declared. * utils.c: Add stdlib.h, errno.h and malloc.h includes. (perror_with_name): Remove errno declaration. * wincecompat.h: New. * wincecompat.c: New. * win32-low.h: New. * win32-arm-low.c: New. * win32-i386-low.c: New. (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h. (OUTMSG2): Make it safe. (_T): New macro. (COUNTOF): New macro. (NUM_REGS): Get it from the low target. (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0. (thread_rec): Let low target handle debug registers. (child_add_thread): Likewise. (child_init_thread_list): Likewise. (continue_one_thread): Likewise. (regptr): New. (do_child_fetch_inferior_registers): Move to ... * win32-i386-low.c: ... here, and rename to ... (do_fetch_inferior_registers): ... this. * win32-low.c (child_fetch_inferior_registers): Go through the low target. (do_child_store_inferior_registers): Use regptr. (strwinerror): New function. (win32_create_inferior): Handle Windows CE. Use strwinerror instead of strerror on Windows error codes. Add program to the error output. Don't close the main thread handle on Windows CE. (win32_attach): Use coredll.dll on Windows CE. (win32_kill): Close current process and current thread handles. (win32_detach): Use coredll.dll on Windows CE. (win32_resume): Let low target handle debug registers, and step request. (handle_exception): Add/Remove initial breakpoint. Avoid non-existant WSTOPSIG on Windows CE. (win32_read_inferior_memory): Cast to remove warning. (win32_arch_string): Go through the low target. (initialize_low): Call set_breakpoint_data with the low target's breakpoint. * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM, FOP_REGNUM, mappings): Move to ... * win32-i386-low.c: ... here. * win32-low.c (win32_thread_info): Move to ... * win32-low.h: ... here. * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c, win32-arm-low.c and wincecompat.c. (all:): Add $EXEEXT. (install-only:): Likewise. (gdbserver:): Likewise. (gdbreplay:): Likewise. * config.in: Regenerate. * configure: Regenerate.
2007-03-29 03:06:48 +02:00
2007-03-29 Pedro Alves <pedro_alves@portugalmail.pt>
2007-03-29 03:10:37 +02:00
* configure.ac: Add errno checking.
gdb/ * arm-wince-tdep.c: New. * config/arm/wince.mt (DEPRECATED_TM_FILE): Use tm-arm.h. (MT_CFLAGS): Delete. (TM_CLIBS): Delete. (TDEPFILES): Add arm-wince-tdep.o, corelow.o, solib.o, solib-legacy.o, solib-svr4.o, and remove wince.o. * configure.tgt (arm*-*-mingw32ce*): Add. * signals/signals.c [HAVE_SIGNAL_H]: Check. (do_target_signal_to_host): Silence 'not used' warning. * config/arm/tm-wince.h: Remove. gdb/gdbserver/ * gdbserver/configure.ac: Add errno checking. (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h, sys/file.h and malloc.h. (AC_CHECK_DECLS): Add perror. (srv_mingwce): Handle. * gdbserver/configure.srv (i[34567]86-*-cygwin*): Add win32-i386-low.o to srv_tgtobj. (i[34567]86-*-mingw*): Likewise. (arm*-*-mingw32ce*): Add case. * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check. [__MINGW32CE__] (strerror): New function. [__MINGW32CE__] (errno): Define to GetLastError. [__MINGW32CE__] (COUNTOF): New macro. (remote_open): Remove extra close call. * mem-break.c (delete_breakpoint_at): New function. * mem-break.h (delete_breakpoint_at): Declare. * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check. [USE_WIN32API] (read, write): Add char* casts. * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check. * server.h: Include wincecompat.h on Windows CE. [HAVE_ERRNO_H]: Check. (perror): Declare if not declared. * utils.c: Add stdlib.h, errno.h and malloc.h includes. (perror_with_name): Remove errno declaration. * wincecompat.h: New. * wincecompat.c: New. * win32-low.h: New. * win32-arm-low.c: New. * win32-i386-low.c: New. (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h. (OUTMSG2): Make it safe. (_T): New macro. (COUNTOF): New macro. (NUM_REGS): Get it from the low target. (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0. (thread_rec): Let low target handle debug registers. (child_add_thread): Likewise. (child_init_thread_list): Likewise. (continue_one_thread): Likewise. (regptr): New. (do_child_fetch_inferior_registers): Move to ... * win32-i386-low.c: ... here, and rename to ... (do_fetch_inferior_registers): ... this. * win32-low.c (child_fetch_inferior_registers): Go through the low target. (do_child_store_inferior_registers): Use regptr. (strwinerror): New function. (win32_create_inferior): Handle Windows CE. Use strwinerror instead of strerror on Windows error codes. Add program to the error output. Don't close the main thread handle on Windows CE. (win32_attach): Use coredll.dll on Windows CE. (win32_kill): Close current process and current thread handles. (win32_detach): Use coredll.dll on Windows CE. (win32_resume): Let low target handle debug registers, and step request. (handle_exception): Add/Remove initial breakpoint. Avoid non-existant WSTOPSIG on Windows CE. (win32_read_inferior_memory): Cast to remove warning. (win32_arch_string): Go through the low target. (initialize_low): Call set_breakpoint_data with the low target's breakpoint. * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM, FOP_REGNUM, mappings): Move to ... * win32-i386-low.c: ... here. * win32-low.c (win32_thread_info): Move to ... * win32-low.h: ... here. * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c, win32-arm-low.c and wincecompat.c. (all:): Add $EXEEXT. (install-only:): Likewise. (gdbserver:): Likewise. (gdbreplay:): Likewise. * config.in: Regenerate. * configure: Regenerate.
2007-03-29 03:06:48 +02:00
(AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
sys/file.h and malloc.h.
(AC_CHECK_DECLS): Add perror.
(srv_mingwce): Handle.
2007-03-29 03:10:37 +02:00
* configure.srv (i[34567]86-*-cygwin*): Add
gdb/ * arm-wince-tdep.c: New. * config/arm/wince.mt (DEPRECATED_TM_FILE): Use tm-arm.h. (MT_CFLAGS): Delete. (TM_CLIBS): Delete. (TDEPFILES): Add arm-wince-tdep.o, corelow.o, solib.o, solib-legacy.o, solib-svr4.o, and remove wince.o. * configure.tgt (arm*-*-mingw32ce*): Add. * signals/signals.c [HAVE_SIGNAL_H]: Check. (do_target_signal_to_host): Silence 'not used' warning. * config/arm/tm-wince.h: Remove. gdb/gdbserver/ * gdbserver/configure.ac: Add errno checking. (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h, sys/file.h and malloc.h. (AC_CHECK_DECLS): Add perror. (srv_mingwce): Handle. * gdbserver/configure.srv (i[34567]86-*-cygwin*): Add win32-i386-low.o to srv_tgtobj. (i[34567]86-*-mingw*): Likewise. (arm*-*-mingw32ce*): Add case. * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check. [__MINGW32CE__] (strerror): New function. [__MINGW32CE__] (errno): Define to GetLastError. [__MINGW32CE__] (COUNTOF): New macro. (remote_open): Remove extra close call. * mem-break.c (delete_breakpoint_at): New function. * mem-break.h (delete_breakpoint_at): Declare. * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check. [USE_WIN32API] (read, write): Add char* casts. * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check. * server.h: Include wincecompat.h on Windows CE. [HAVE_ERRNO_H]: Check. (perror): Declare if not declared. * utils.c: Add stdlib.h, errno.h and malloc.h includes. (perror_with_name): Remove errno declaration. * wincecompat.h: New. * wincecompat.c: New. * win32-low.h: New. * win32-arm-low.c: New. * win32-i386-low.c: New. (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h. (OUTMSG2): Make it safe. (_T): New macro. (COUNTOF): New macro. (NUM_REGS): Get it from the low target. (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0. (thread_rec): Let low target handle debug registers. (child_add_thread): Likewise. (child_init_thread_list): Likewise. (continue_one_thread): Likewise. (regptr): New. (do_child_fetch_inferior_registers): Move to ... * win32-i386-low.c: ... here, and rename to ... (do_fetch_inferior_registers): ... this. * win32-low.c (child_fetch_inferior_registers): Go through the low target. (do_child_store_inferior_registers): Use regptr. (strwinerror): New function. (win32_create_inferior): Handle Windows CE. Use strwinerror instead of strerror on Windows error codes. Add program to the error output. Don't close the main thread handle on Windows CE. (win32_attach): Use coredll.dll on Windows CE. (win32_kill): Close current process and current thread handles. (win32_detach): Use coredll.dll on Windows CE. (win32_resume): Let low target handle debug registers, and step request. (handle_exception): Add/Remove initial breakpoint. Avoid non-existant WSTOPSIG on Windows CE. (win32_read_inferior_memory): Cast to remove warning. (win32_arch_string): Go through the low target. (initialize_low): Call set_breakpoint_data with the low target's breakpoint. * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM, FOP_REGNUM, mappings): Move to ... * win32-i386-low.c: ... here. * win32-low.c (win32_thread_info): Move to ... * win32-low.h: ... here. * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c, win32-arm-low.c and wincecompat.c. (all:): Add $EXEEXT. (install-only:): Likewise. (gdbserver:): Likewise. (gdbreplay:): Likewise. * config.in: Regenerate. * configure: Regenerate.
2007-03-29 03:06:48 +02:00
win32-i386-low.o to srv_tgtobj.
(i[34567]86-*-mingw*): Likewise.
(arm*-*-mingw32ce*): Add case.
* gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
[__MINGW32CE__] (strerror): New function.
[__MINGW32CE__] (errno): Define to GetLastError.
[__MINGW32CE__] (COUNTOF): New macro.
(remote_open): Remove extra close call.
* mem-break.c (delete_breakpoint_at): New function.
* mem-break.h (delete_breakpoint_at): Declare.
* remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
[USE_WIN32API] (read, write): Add char* casts.
* server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
* server.h: Include wincecompat.h on Windows CE.
[HAVE_ERRNO_H]: Check.
(perror): Declare if not declared.
* utils.c: Add stdlib.h, errno.h and malloc.h includes.
(perror_with_name): Remove errno declaration.
* wincecompat.h: New.
* wincecompat.c: New.
* win32-low.h: New.
* win32-arm-low.c: New.
* win32-i386-low.c: New.
(win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
(OUTMSG2): Make it safe.
(_T): New macro.
(COUNTOF): New macro.
(NUM_REGS): Get it from the low target.
(CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
(thread_rec): Let low target handle debug registers.
(child_add_thread): Likewise.
(child_init_thread_list): Likewise.
(continue_one_thread): Likewise.
(regptr): New.
(do_child_fetch_inferior_registers): Move to ...
* win32-i386-low.c: ... here, and rename to ...
(do_fetch_inferior_registers): ... this.
2010-08-27 14:02:20 +02:00
* win32-low.c (child_fetch_inferior_registers):
gdb/ * arm-wince-tdep.c: New. * config/arm/wince.mt (DEPRECATED_TM_FILE): Use tm-arm.h. (MT_CFLAGS): Delete. (TM_CLIBS): Delete. (TDEPFILES): Add arm-wince-tdep.o, corelow.o, solib.o, solib-legacy.o, solib-svr4.o, and remove wince.o. * configure.tgt (arm*-*-mingw32ce*): Add. * signals/signals.c [HAVE_SIGNAL_H]: Check. (do_target_signal_to_host): Silence 'not used' warning. * config/arm/tm-wince.h: Remove. gdb/gdbserver/ * gdbserver/configure.ac: Add errno checking. (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h, sys/file.h and malloc.h. (AC_CHECK_DECLS): Add perror. (srv_mingwce): Handle. * gdbserver/configure.srv (i[34567]86-*-cygwin*): Add win32-i386-low.o to srv_tgtobj. (i[34567]86-*-mingw*): Likewise. (arm*-*-mingw32ce*): Add case. * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check. [__MINGW32CE__] (strerror): New function. [__MINGW32CE__] (errno): Define to GetLastError. [__MINGW32CE__] (COUNTOF): New macro. (remote_open): Remove extra close call. * mem-break.c (delete_breakpoint_at): New function. * mem-break.h (delete_breakpoint_at): Declare. * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check. [USE_WIN32API] (read, write): Add char* casts. * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check. * server.h: Include wincecompat.h on Windows CE. [HAVE_ERRNO_H]: Check. (perror): Declare if not declared. * utils.c: Add stdlib.h, errno.h and malloc.h includes. (perror_with_name): Remove errno declaration. * wincecompat.h: New. * wincecompat.c: New. * win32-low.h: New. * win32-arm-low.c: New. * win32-i386-low.c: New. (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h. (OUTMSG2): Make it safe. (_T): New macro. (COUNTOF): New macro. (NUM_REGS): Get it from the low target. (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0. (thread_rec): Let low target handle debug registers. (child_add_thread): Likewise. (child_init_thread_list): Likewise. (continue_one_thread): Likewise. (regptr): New. (do_child_fetch_inferior_registers): Move to ... * win32-i386-low.c: ... here, and rename to ... (do_fetch_inferior_registers): ... this. * win32-low.c (child_fetch_inferior_registers): Go through the low target. (do_child_store_inferior_registers): Use regptr. (strwinerror): New function. (win32_create_inferior): Handle Windows CE. Use strwinerror instead of strerror on Windows error codes. Add program to the error output. Don't close the main thread handle on Windows CE. (win32_attach): Use coredll.dll on Windows CE. (win32_kill): Close current process and current thread handles. (win32_detach): Use coredll.dll on Windows CE. (win32_resume): Let low target handle debug registers, and step request. (handle_exception): Add/Remove initial breakpoint. Avoid non-existant WSTOPSIG on Windows CE. (win32_read_inferior_memory): Cast to remove warning. (win32_arch_string): Go through the low target. (initialize_low): Call set_breakpoint_data with the low target's breakpoint. * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM, FOP_REGNUM, mappings): Move to ... * win32-i386-low.c: ... here. * win32-low.c (win32_thread_info): Move to ... * win32-low.h: ... here. * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c, win32-arm-low.c and wincecompat.c. (all:): Add $EXEEXT. (install-only:): Likewise. (gdbserver:): Likewise. (gdbreplay:): Likewise. * config.in: Regenerate. * configure: Regenerate.
2007-03-29 03:06:48 +02:00
Go through the low target.
(do_child_store_inferior_registers): Use regptr.
(strwinerror): New function.
(win32_create_inferior): Handle Windows CE.
Use strwinerror instead of strerror on Windows error
codes. Add program to the error output.
Don't close the main thread handle on Windows CE.
(win32_attach): Use coredll.dll on Windows CE.
(win32_kill): Close current process and current
thread handles.
(win32_detach): Use coredll.dll on Windows CE.
(win32_resume): Let low target handle debug registers, and
step request.
(handle_exception): Add/Remove initial breakpoint. Avoid
non-existant WSTOPSIG on Windows CE.
(win32_read_inferior_memory): Cast to remove warning.
(win32_arch_string): Go through the low target.
(initialize_low): Call set_breakpoint_data with the low
target's breakpoint.
* win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
FOP_REGNUM, mappings): Move to ...
* win32-i386-low.c: ... here.
* win32-low.c (win32_thread_info): Move to ...
* win32-low.h: ... here.
* Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
win32-arm-low.c and wincecompat.c.
(all:): Add $EXEEXT.
(install-only:): Likewise.
(gdbserver:): Likewise.
(gdbreplay:): Likewise.
* config.in: Regenerate.
* configure: Regenerate.
2007-03-28 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-low.c: Rename typedef thread_info to
win32_thread_info throughout.
2007-03-28 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-i386-low.c: Rename to ...
* win32-low.c: ... this.
* configure.srv: Replace win32-i386-low.o with win32-low.o.
* Makefile.in: Likewise.
2007-03-27 Pedro Alves <pedro_alves@portugalmail.pt>
* remote-utils.c (monitor_output): Constify msg parameter.
* server.h (monitor_output): Likewise.
* win32-i386-low.c (handle_output_debug_string): New.
(win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
handle_output_debug_string.
(get_child_debug_event): Likewise.
2007-03-27 Mat Hostetter <mat@lcs.mit.edu>
* server.c (main): Correct strtoul check.
2007-03-27 Jon Ringle <jon@ringle.org>
* linux-low.c: Check __ARCH_HAS_MMU__ also.
2007-03-27 Brooks Moses <brooks.moses@codesourcery.com>
* Makefile.in: Add dummy "pdf" and "install-pdf" targets.
2007-02-27 18:23:34 +01:00
2007-02-27 Daniel Jacobowitz <dan@codesourcery.com>
* terminal.h: Check HAVE_SGTTY_H.
2007-02-27 Mat Hostetter <mat@lcs.mit.edu>
* remote-utils.c (remote_open): Print out the assigned port number.
2007-02-26 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (monitor_output): New function.
* server.c (debug_threads): Define here.
(monitor_show_help): New function.
(handle_query): Handle qRcmd.
(main): Do not handle 'd' packet.
* server.h (debug_threads, remote_debug, monitor_output): Declare.
* linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
of debug_threads.
2007-02-25 Pedro Alves <pedro_alves@portugalmail.pt>
* Makefile.in (EXEEXT): New.
(clean): Use $(EXEEXT).
2007-02-25 Pedro Alves <pedro_alves@portugalmail.pt>
* target.h (target_ops): Rename send_signal to request_interrupt,
and remove enum target_signal parameter.
* linux-low.c (linux_request_interrupt): Rename from
linux_send_signal, and always send SIGINT.
* spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
and always send SIGINT.
* remote-utils.c (putpkt_binary): Call request_interrupt, instead
of send_signal.
(input_interrupt): Likewise.
2007-02-25 Pedro Alves <pedro_alves@portugalmail.pt>
* server.c (get_features_xml): Check if target implemented
arch_string.
* win32-i386-low.c (win32_arch_string): New.
(win32_target_ops): Add win32_arch_string as arch_string member.
2007-02-22 Markus Deuling <deuling@de.ibm.com>
* spu-low.c (spu_arch_string): New.
(spu_target_ops): Add spu_arch_string.
2007-02-16 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c: Remove HAVE_TERMINAL_H check.
* configure.ac: Do not check for terminal.h.
* configure, config.in: Regenerated.
2007-02-08 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (OBS): Add $(XML_BUILTIN).
(XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
(clean): Update.
(target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
(arm-with-iwmmxt.c): New.
* config.in, configure: Regenerate.
* configure.ac: Check for iWMMXt. Handle srv_xmltarget,
srv_xmlbuiltin, and srv_xmlfiles. Define USE_XML.
* configure.srv: Mention srv_xmltarget and srv_xmlfiles.
(arm*-*-linux*): Add iWMMXt and regset support.
* linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
(arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
(arm_store_wmmxregset, target_regsets): New.
* server.c (get_features_xml): Take annex argument. Check builtin
XML documents.
(handle_query): Handle multiple annexes.
2007-01-29 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c [USE_WIN32API] (read, write): Define.
(putpkt_binary, input_interrupt, readchar, getpkt): Use read and
write.
XML feature description support. * NEWS: Mention target descriptions, "set tdesc filename", "unset tdesc filename", "show tdesc filename", and qXfer:features:read. * arch-utils.c (choose_architecture_for_target): New function. (gdbarch_info_fill): Call it. * target-descriptions.c (struct property): Make members non-const. (struct target_desc): Add arch member. (target_description_filename): New variable. (target_find_description): Try via XML first. (tdesc_architecture): New. (free_target_description, make_cleanup_free_target_description): New. (set_tdesc_property): Call xstrdup. (set_tdesc_architecture, tdesc_set_cmdlist, tdesc_show_cmdlist) (tdesc_unset_cmdlist, unset_tdesc_cmd, unset_tdesc_filename_cmd) (set_tdesc_cmd, show_tdesc_cmd, set_tdesc_filename_cmd) (show_tdesc_filename_cmd, _initialize_target_descriptions): New. * target-descriptions.h (tdesc_architecture) (make_cleanup_free_target_description, set_tdesc_architecture): New prototypes. * Makefile.in (SFILES): Add xml-tdesc.c. (COMMON_OBS): Add xml-tdesc.o. (target-descriptions.o): Update. (xml-tdesc.o): New rule. * xml-tdesc.c, xml-tdesc.h: New files. * remote.c (PACKET_qXfer_features): New enum. (remote_protocol_features): Add qXfer:features:read. (remote_xfer_partial): Handle TARGET_OBJECT_AVAILABLE_FEATURES. (_initialize_remote): Register qXfer:features:read. * target.h (enum target_object): Add TARGET_OBJECT_AVAILABLE_FEATURES. * features/gdb-target.dtd: New file. * linux-i386-low.c (the_low_target): Set arch_string. * linux-x86-64-low.c (the_low_target): Likewise. * linux-low.c (linux_arch_string): New. (linux_target_ops): Add it. * linux-low.h (struct linux_target_ops): Add arch_string. * server.c (write_qxfer_response): Use const void * for DATA. (get_features_xml): New. (handle_query): Handle qXfer:features:read. Report it for qSupported. * target.h (struct target_ops): Add arch_string method. * gdb.texinfo (Target Descriptions): New section. (General Query Packets): Add QPassSignals anchor. Mention qXfer:features:read under qSupported. Expand mentions of qXfer:memory-map:read and QPassSignals. Document qXfer:features:read.
2007-01-09 23:55:10 +01:00
2007-01-09 Daniel Jacobowitz <dan@codesourcery.com>
* linux-i386-low.c (the_low_target): Set arch_string.
* linux-x86-64-low.c (the_low_target): Likewise.
* linux-low.c (linux_arch_string): New.
(linux_target_ops): Add it.
* linux-low.h (struct linux_target_ops): Add arch_string.
* server.c (write_qxfer_response): Use const void * for DATA.
(get_features_xml): New.
(handle_query): Handle qXfer:features:read. Report it for qSupported.
* target.h (struct target_ops): Add arch_string method.
2007-01-03 Denis Pilat <denis.pilat@st.com>
Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_kill): Handle being called with no threads.
* win32-i386-low.c (win32_kill): Likewise.
(get_child_debug_event): Clear current_process_handle.
2006-12-30 Denis PILAT <denis.pilat@st.com>
Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (remote_open): Check the type of specified
serial port devices before opening them.
* server.c (main): Kill the inferior if an error occurs during
the first remote_open.
2006-12-05 Markus Deuling <deuling@de.ibm.com>
* README: Update supported targets.
2006-11-28 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (clean): Remove reg-mips64.c.
(reg-mips64.c, reg-mips64.o): New rules.
* configure.srv: Handle mips64. Include regset support for mips.
* linux-mips-low.c (union mips_register): New.
(mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
(mips_breakpoint, mips_breakpoint_at): Use int.
(mips_collect_register, mips_supply_register)
(mips_collect_register_32bit, mips_supply_register_32bit)
(mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
(mips_store_fpregset, target_regsets): New.
* thread-db.c (thread_db_get_tls_address): Use uintptr_t.
2006-11-22 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv: Add target "spu*-*-*".
* Makefile.in (clean): Remove reg-spu.c.
(reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
* spu-low.c: New file.
2006-11-16 Daniel Jacobowitz <dan@codesourcery.com>
* configure.ac: Correct td_thr_tls_get_addr test.
* configure: Regenerated.
2006-11-16 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_wait_for_event): Reformat. Use the
pass_signals array.
* remote-utils.c (decode_address_to_semicolon): New.
* server.c (pass_signals, handle_general_set): New.
(handle_query): Mention QPassSignals for qSupported.
(main): Call handle_general_set.
* server.h (pass_signals, decode_address_to_semicolon): New.
2006-11-06 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (handle_query): Correct error handling for read_auxv.
2005-10-19 Ulrich Weigand <uweigand@de.ibm.com>
* configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
and srv_linux_thread_db to yes.
* linux-s390-low.c (s390_fill_gregset): New function.
(target_regsets): Define data structure.
2006-10-17 Daniel Jacobowitz <dan@codesourcery.com>
* acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
* configure.ac: Use it. Define HAVE_TD_THR_TLS_GET_ADDR.
* config.in, configure: Regenerated.
* inferiors.c (gdb_id_to_thread): New function.
(gdb_id_to_thread_id): Use it.
* linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
* linux-low.h (struct process_info): Add th member.
(thread_db_get_tls_address): New prototype.
* remote-utils.c (decode_address): Make non-static.
* server.c (handle_query): Handle qGetTLSAddr.
* server.h (gdb_id_to_thread, decode_address): New prototypes.
* target.h (struct target_ops): Add get_tls_address.
* thread-db.c (maybe_attach_thread): Save the thread handle.
(thread_db_get_tls_address): New.
2006-09-28 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
(linux_resume_one_process): Take a siginfo_t *. Update all
callers. Queue it if necessary. Use PTRACE_SETSIGINFO.
(struct pending_signals): Add a siginfo_t.
(linux_wait_for_process): Always set last_status.
(linux_wait_for_event): Use PTRACE_GETSIGINFO.
(linux_queue_one_thread): Use PTRACE_GETSIGINFO.
* linux-low.h (struct process_info): Add last_status.
2006-09-21 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (try_rle): New function.
(putpkt_binary): Use it.
2006-08-19 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (clean): Clean reg-x86-64-linux.c.
(reg-x86-64-linux.o, reg-x86-64-linux.c): New.
* configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
* linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
(x86_64_fill_gregset, x86_64_store_gregset): Skip floating
point registers.
2006-08-08 Richard Sandiford <richard@codesourcery.com>
* server.c (terminal_fd): New variable.
(old_foreground_pgrp): Likewise.
(restore_old_foreground_pgrp): New function.
(start_inferior): Record the terminal file descriptor in terminal_fd
and its original foreground group in old_foreground_pgrp. Register
restore_old_foreground_pgrp with atexit().
2006-07-26 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (handle_query): Correct qPart to qXfer.
2006-07-22 Daniel Jacobowitz <dan@codesourcery.com>
* configure.ac: Check for more headers which are missing on
Windows. Automatically supply -lwsock32 and USE_WIN32API.
* configure.srv: Add Cygwin and mingw32.
* remote-utils.c: Don't include headers unconditionally which
are missing on mingw32. Include <winsock.h> for mingw32.
(remote_open): Adjust for mingw32 support. Flush
standard error after writing to it.
(remote_close, putpkt_binary, input_interrupt, block_async_io)
(unblock_async_io, enable_async_io, disable_async_io)
(readchar, getpkt): Update for Winsock support.
(prepare_resume_reply): Expect a protocol signal number.
* server.c: Disable <sys/wait.h> on mingw32.
(start_inferior): Adjust for mingw32 support. Flush
standard error after writing to it.
(attach_inferior): Likewise. Use protocol signal
numbers.
(main): Skip 'D' packet on mingw32. Use protocol signal numbers
and names.
* win32-i386-low.c: New file.
* Makefile.in (XM_CLIBS): Set.
(gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
(win32-i386-low.o): New dependency rule.
* linux-low.c (linux_wait): Use target signal numbers.
* target.h (struct target_ops): Doc fix.
* server.h (target_signal_to_name): New prototype.
* gdbreplay.c: Don't include headers unconditionally which
are missing on mingw32. Include <winsock.h> for mingw32.
(remote_close, remote_open): Adjust for Winsock support.
* configure, config.in: Regenerated.
2006-07-12 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (decode_xfer_read, write_qxfer_response): New.
(handle_query): Take a packet length argument. Handle
qXfer:auxv:read instead of qPart:auxv:read. Mention it in
the qSupported response.
(main): Update call to handle_query.
2006-06-22 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (remote_escape_output, remote_unescape_input): New.
(putpkt_binary): Renamed from putpkt and adjusted for binary
data.
(putpkt): New wrapper for putpkt_binary.
(readchar): Don't mask off the high bit.
(decode_X_packet): New function.
* server.c (main): Call putpkt_binary if a handler sets the packet
length. Save the length of the incoming packet. Handle 'X'.
* server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
2006-06-21 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (handle_query): Handle qSupported.
2006-05-30 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (all_symbols_looked_up): New variable.
(look_up_one_symbol): Check it.
* server.h (look_up_one_symbol): New declaration.
* thread-db.c (thread_db_init): Set all_symbols_looked_up.
2006-05-30 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (linux-arm-low.o): Update dependencies.
2006-05-30 17:58:47 +02:00
* linux-arm-low.c: Include "gdb_proc_service.h".
(PTRACE_GET_THREAD_AREA): Define.
(ps_get_thread_area): New function.
2006-05-09 Nathan Sidwell <nathan@codesourcery.com>
* configure.srv (m68k*-*-uclinux*): New target.
* linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
(linux_resume_one_process): Remove extraneous cast.
(linux_read_offsets): New.
(linux_target_op): Add linux_read_offsets on mmuless systems.
* server.c (handle_query): Add qOffsets logic.
* target.h (struct target_ops): Add read_offsets.
2006-03-15 Daniel Jacobowitz <dan@codesourcery.com>
* linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
(PTRACE_GET_THREAD_AREA): Define.
(ps_get_thread_area): New function.
* Makefile.in (linux-i386-low.o, linux-mips-low.o)
(linux-x86-64-low.o): Update.
2006-03-15 Daniel Jacobowitz <dan@codesourcery.com>
* configure.ac: Remove checks for prfpregset_t.
* gdb_proc_service.h: New file.
* linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
new "gdb_proc_service.h".
* proc-service.c: Likewise.
(ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
(ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
* Makefile.in (gdb_proc_service_h): Updated.
* configure, config.in: Regenerated.
2006-03-03 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (prepare_resume_reply): Move declaration
of gdb_id_from_wait to the top of the block.
2006-02-15 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (regsets_store_inferior_registers): Read the regset
from the target before filling it.
2006-02-08 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (attach_inferior): Return SIGTRAP for a successful
attach.
2006-02-01 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (OBS): Add version.o.
(STAGESTUFF): Delete.
(version.o): Add dependencies.
(version.c): Replace rule.
(clean): Remove version.c.
* server.c (gdbserver_version): New.
(gdbserver_usage): Use printf.
(main): Handle --version and --help.
* server.h (version, host_name): Add declarations.
2005-12-23 Eli Zaretskii <eliz@gnu.org>
2010-08-27 14:02:20 +02:00
* linux-arm-low.c:
* linux-arm-low.c:
* inferiors.c:
* i387-fp.h:
* i387-fp.c:
* gdbreplay.c:
* regcache.c:
* proc-service.c:
* mem-break.h:
* mem-break.c:
* linux-x86-64-low.c:
* linux-sh-low.c:
* linux-s390-low.c:
* linux-ppc64-low.c:
* linux-ppc-low.c:
* linux-mips-low.c:
* linux-m68k-low.c:
* linux-m32r-low.c:
* linux-low.h:
* linux-low.c:
* linux-ia64-low.c:
* linux-i386-low.c:
* linux-crisv32-low.c:
* thread-db.c:
* terminal.h:
* target.h:
* target.c:
* server.h:
* server.c:
* remote-utils.c:
* regcache.h:
* utils.c:
* Makefile.in:
* configure.ac:
* gdbserver.1: Add (C) after Copyright. Update the FSF
address.
2005-11-13 Daniel Jacobowitz <dan@codesourcery.com>
* linux-arm-low.c (arm_eabi_breakpoint): New variable.
(arm_breakpoint_at): Recognize both breakpoints.
(the_low_target): Use the correct breakpoint instruction.
2005-11-02 Daniel Jacobowitz <dan@codesourcery.com>
* configure.srv (x86_64-*-linux*): Turn on thread_db support.
* linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
(x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
(the_low_target): Update.
2005-10-25 Andreas Schwab <schwab@suse.de>
* server.c (main): Allocate mem_buf with PBUFSIZ bytes.
* linux-ia64-low.c (ia64_regmap): Remove NAT registers.
(ia64_num_regs): Reduce to 462.
2005-09-17 Daniel Jacobowitz <dan@codesourcery.com>
* acinclude.m4: Correct quoting.
* aclocal.m4: Regenerated.
Suggested by SZOKOVACS Robert <szo@ies.hu>:
* thread-db.c (thread_db_err_str): Handle TD_VERSION.
(thread_db_init): Call thread_db_err_str.
* configure.ac: Check for TD_VERSION.
* config.in, configure: Regenerated.
2005-07-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-13 Daniel Jacobowitz <dan@codesourcery.com>
* configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
is not available. Define HAVE_PTRACE_GETREGS if it is.
* config.in, configure: Regenerated.
* configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
* linux-i386-low.c, linux-m68k-low.c: Update to use
HAVE_PTRACE_GETREGS.
* linux-low.c (regsets_fetch_inferior_registers)
(regsets_store_inferior_registers): Only return 0 if we processed
GENERAL_REGS.
* linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
* linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
2005-07-13 Daniel Jacobowitz <dan@codesourcery.com>
* inferiors.c (struct thread_info): Add gdb_id.
(add_thread): Add gdb_id argument.
(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
* linux-low.c (linux_create_inferior, linux_attach_lwp): Update
calls to add_thread.
* remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
* server.c (handle_query): Use thread_to_gdb_id.
(handle_v_cont, main): Use gdb_id_to_thread_id.
* server.h (add_thread): Update prototype.
(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
prototypes.
2005-07-13 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (fetch_register, usr_store_inferior_registers): Handle
left-padded registers.
* linux-low.h (struct linux_target_ops): Add left_pad_xfer.
* linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
2005-07-01 Steve Ellcey <sje@cup.hp.com>
* configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
* configure: Regenerate.
* config.in: Regenerate.
* server.h (NEED_DECLARATION_STRERROR):
Replace with !HAVE_DECL_STRERROR.
2005-06-16 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (linux_wait, linux_send_signal): Don't test
an unsigned long variable for > 0 if it could be MAX_ULONG.
* server.c (myresume): Likewise.
* target.c (set_desired_inferior): Likewise.
2005-06-13 Mark Kettenis <kettenis@gnu.org>
* configure.ac: Simplify and improve check for socklen_t.
* configure, config.in: Regenerate.
* acconfig.h: Remove. * configure.ac: Add a test for socklen_t. Use three-argument AC_DEFINE throughout. * config.in: Regenerated using autoheader 2.59. * configure: Regenerated. * gdbreplay.c (socklen_t): Provide a default. (remote_open): Use socklen_t. * remote-utils.c (socklen_t): Provide a default. (remote_open): Use socklen_t. (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use unsigned char. * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned char for buffers. * linux-low.c (linux_read_memory, linux_write_memory) (linux_read_auxv): Likewise. * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read) (check_mem_write): Likewise. * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write): Likewise. * regcache.c (struct inferior_rgcache_data, registers_to_string) (registers_from_string, register_data): Likewise. * server.c (handle_query, main): Likewise. * server.h (convert_ascii_to_int, convert_int_to_ascii) (decode_M_packet): Likewise. * target.c (read_inferior_memory, write_inferior_memory): Likewise. * target.h (struct target_ops): Update read_memory, write_memory, and read_auxv. (read_inferior_memory, write_inferior_memory): Update. * linux-low.h (struct linux_target_ops): Change type of breakpoint to unsigned char *. * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c, linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c, linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c, linux-s390-low.c, linux-sh-low.c: Update for changes in read_inferior_memory and the_low_target->breakpoint.
2005-06-13 03:59:22 +02:00
2005-06-12 Daniel Jacobowitz <dan@codesourcery.com>
* acconfig.h: Remove.
* configure.ac: Add a test for socklen_t. Use three-argument
AC_DEFINE throughout.
* config.in: Regenerated using autoheader 2.59.
* configure: Regenerated.
* gdbreplay.c (socklen_t): Provide a default.
(remote_open): Use socklen_t.
* remote-utils.c (socklen_t): Provide a default.
(remote_open): Use socklen_t.
(convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
unsigned char.
* i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
char for buffers.
* linux-low.c (linux_read_memory, linux_write_memory)
(linux_read_auxv): Likewise.
* mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
(check_mem_write): Likewise.
* mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
Likewise.
* regcache.c (struct inferior_rgcache_data, registers_to_string)
(registers_from_string, register_data): Likewise.
* server.c (handle_query, main): Likewise.
* server.h (convert_ascii_to_int, convert_int_to_ascii)
(decode_M_packet): Likewise.
* target.c (read_inferior_memory, write_inferior_memory): Likewise.
* target.h (struct target_ops): Update read_memory, write_memory,
and read_auxv.
(read_inferior_memory, write_inferior_memory): Update.
* linux-low.h (struct linux_target_ops): Change type of breakpoint
to unsigned char *.
* linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
linux-s390-low.c, linux-sh-low.c: Update for changes in
read_inferior_memory and the_low_target->breakpoint.
2005-05-28 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (SFILES): Add linux-ppc64-low.c.
(linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
* configure.srv: Add powerpc64-*-linux*.
* linux-ppc64-low.c: New file.
2005-05-23 Orjan Friberg <orjanf@axis.com>
* linux-cris-low.c: New file with support for CRIS.
* linux-crisv32-low.c: Ditto for CRISv32.
* Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
(clean): Add reg-cris.c and reg-crisv32.c.
2010-08-27 14:02:20 +02:00
Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
reg-crisv32.o, and reg-crisv32.c to make rules.
* configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
recognized targets.
2005-05-16 Ulrich Weigand <uweigand@de.ibm.com>
* linux-low.c (fetch_register): Ensure buffer size is a multiple
of sizeof (PTRACE_XFER_TYPE).
(usr_store_inferior_registers): Likewise. Zero out excess bytes.
2005-05-12 Orjan Friberg <orjanf@axis.com>
2010-08-27 14:02:20 +02:00
* target.h (struct target_ops): Add insert_watchpoint,
remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
pointers for hardware watchpoint support.
* linux-low.h (struct linux_target_ops): Ditto.
* linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
(linux_stopped_by_watchpoint, linux_stopped_data_address): New. Add
to linux_target_ops.
* remote-utils.c (prepare_resume_reply): Add watchpoint information to
reply packet.
* server.c (main): Recognize 'Z' and 'z' packets.
2005-05-10 Ulrich Weigand <uweigand@de.ibm.com>
* linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
(s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
(the_low_target): Add new members.
2005-05-04 Daniel Jacobowitz <dan@codesourcery.com>
* proc-service.c (ps_lgetregs): Search all_processes instead of
all_threads.
2005-05-04 Daniel Jacobowitz <dan@codesourcery.com>
* server.c (start_inferior): Change return type to int.
(attach_inferior): Change sigptr to int *.
(handle_v_cont, handle_v_requests): Change signal to int *.
(main): Change signal to int.
2005-04-15 Kei Sakamoto <sakamoto.kei@renesas.com>
* Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
* configure.srv: Add m32r*-*-linux*.
* linux-m32r-low.c: New file.
2005-03-04 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
2005-03-03 Daniel Jacobowitz <dan@codesourcery.com>
* inferiors.c (change_inferior_id, add_thread, find_inferior_id):
Take unsigned long arguments for PIDs.
* linux-low.c (add_process, linux_attach_lwp, linux_attach)
(linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
(wait_for_sigstop, linux_resume_one_process)
(regsets_fetch_inferior_registers, linux_send_signal)
(linux_read_auxv): Likewise. Update the types of variables holding
PIDs. Update format string specifiers.
* linux-low.h (struct process_info, linux_attach_lwp): Likewise.
* remote-utils.c (prepare_resume_reply): Likewise.
* server.c (cont_thread, general_thread, step_thread)
(thread_from_wait, old_thread_from_wait, signal_pid): Change type to
unsigned long.
(handle_query): Update format specifiers.
(handle_v_cont, main): Use strtoul for thread IDs.
* server.h (struct inferior_list_entry): Use unsigned long for ID.
(add_thread, find_inferior_id, change_inferior_id, cont_thread)
(general_thread, step_thread, thread_from_wait)
(old_thread_from_wait): Update.
* target.h (struct thread_resume): Use unsigned long for THREAD.
(struct target_ops): Use unsigned long for arguments to attach and
thread_alive.
2005-02-24 Daniel Jacobowitz <dan@codesourcery.com>
* acinclude.m4: Include bfd/bfd.m4 directly.
* configure.ac: Use AC_ARG_PROGRAM. Suggested by Aron Griffis
<agriffis@toolchain.org>.
* aclocal.m4, configure: Regenerated.
2005-01-07 Andrew Cagney <cagney@gnu.org>
* configure.ac: Rename configure.in, require autoconf 2.59.
* configure: Re-generate.
2004-12-08 Daniel Jacobowitz <dan@debian.org>
* acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area. Reset
LIBS when finished.
* aclocal.m4: Regenerated.
* configure: Regenerated.
2004-11-21 Andreas Schwab <schwab@suse.de>
* linux-m68k-low.c (m68k_num_gregs): Define.
(m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
(m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
(m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
(m68k_breakpoint_at): New. Add to the_low_target.
* configure.srv (m68*-*-linux*): Set srv_linux_regsets and
srv_linux_thread_db to yes.
2004-10-20 Joel Brobecker <brobecker@gnat.com>
* linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
(ARCH_SET_FS): Likewise.
(ARCH_GET_FS): Likewise.
(ARCH_GET_GS): Likewise.
2004-10-16 Daniel Jacobowitz <dan@debian.org>
* linux-i386-low.c (ps_get_thread_area): New.
* linux-x86-64-low.c (ps_get_thread_area): New.
* linux-low.c: Include <sys/syscall.h>.
(linux_kill_one_process): Don't kill the first thread here.
(linux_kill): Kill the first thread here.
(kill_lwp): New function.
(send_sigstop, linux_send_signal): Use it.
* proc-service.c: Clean up #ifdefs.
(fpregset_info): Delete.
(ps_lgetregs): Update and enable implementation.
(ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
implementations.
* remote-utils.c (struct sym_cache, symbol_cache): New.
(input_interrupt): Print a clearer message.
(async_io_enabled): New variable.
(enable_async_io, disable_async_io): Use it. Update comments.
(look_up_one_symbol): Use the symbol cache.
* thread-db.c (thread_db_look_up_symbols): New function.
(thread_db_init): Update comments. Call thread_db_look_up_symbols.
2004-10-16 Daniel Jacobowitz <dan@debian.org>
* configure.in: Test for -rdynamic.
* configure: Regenerated.
* Makefile (INTERNAL_LDFLAGS): New.
(gdbserver, gdbreplay): Use it.
Index: ChangeLog 2004-09-13 Andrew Cagney <cagney@gnu.org> * configure.in (frags): Replace TM_FILE with DEPRECATED_TM_FILE. * configure: Re-generate. * nlm/Makefile.in (TAGS): Update. * Makefile.in (TAGS): Update. * config/vax/nbsd.mt (TM_FILE): Update. * config/sparc/vxworks.mt (TM_FILE): Update. * config/sparc/sol2.mt (TM_FILE): Update. * config/sparc/sol2-64.mt (TM_FILE): Update. * config/sparc/obsd64.mt (TM_FILE): Update. * config/sparc/obsd.mt (TM_FILE): Update. * config/sparc/nbsd64.mt (TM_FILE): Update. * config/sparc/nbsd.mt (TM_FILE): Update. * config/sparc/linux64.mt (TM_FILE): Update. * config/sparc/linux.mt (TM_FILE): Update. * config/sparc/fbsd.mt (TM_FILE): Update. * config/sh/wince.mt (TM_FILE): Update. * config/sh/nbsd.mt (TM_FILE): Update. * config/sh/linux.mt (TM_FILE): Update. * config/sh/embed.mt (TM_FILE): Update. * config/s390/s390.mt (TM_FILE): Update. * config/rs6000/rs6000lynx.mt (TM_FILE): Update. * config/rs6000/rs6000.mt (TM_FILE): Update. * config/rs6000/aix4.mt (TM_FILE): Update. * config/powerpc/vxworks.mt (TM_FILE): Update. * config/powerpc/ppc-sim.mt (TM_FILE): Update. * config/powerpc/ppc-eabi.mt (TM_FILE): Update. * config/powerpc/obsd.mt (TM_FILE): Update. * config/powerpc/nbsd.mt (TM_FILE): Update. * config/powerpc/linux.mt (TM_FILE): Update. * config/powerpc/aix.mt (TM_FILE): Update. * config/pa/obsd.mt (TM_FILE): Update. * config/pa/linux.mt (TM_FILE): Update. * config/pa/hppahpux.mt (TM_FILE): Update. * config/pa/hppa64.mt (TM_FILE): Update. * config/pa/hppa.mt (TM_FILE): Update. * config/ns32k/nbsdaout.mt (TM_FILE): Update. * config/mips/wince.mt (TM_FILE): Update. * config/mips/vxmips.mt (TM_FILE): Update. * config/mips/nbsd.mt (TM_FILE): Update. * config/mips/linux.mt (TM_FILE): Update. * config/mips/irix6.mt (TM_FILE): Update. * config/mips/irix5.mt (TM_FILE): Update. * config/mips/embed.mt (TM_FILE): Update. * config/m68k/vxworks68.mt (TM_FILE): Update. * config/m68k/st2000.mt (TM_FILE): Update. * config/m68k/os68k.mt (TM_FILE): Update. * config/m68k/obsd.mt (TM_FILE): Update. * config/m68k/nbsd.mt (TM_FILE): Update. * config/m68k/monitor.mt (TM_FILE): Update. * config/m68k/linux.mt (TM_FILE): Update. * config/m68k/cisco.mt (TM_FILE): Update. * config/ia64/linux.mt (TM_FILE): Update. * config/ia64/aix.mt (TM_FILE): Update. * config/ia64/ia64.mt (TM_FILE): Update. * config/i386/vxworks.mt (TM_FILE): Update. * config/i386/obsd64.mt (TM_FILE): Update. * config/i386/obsd.mt (TM_FILE): Update. * config/i386/nto.mt (TM_FILE): Update. * config/i386/nbsd64.mt (TM_FILE): Update. * config/i386/nbsd.mt (TM_FILE): Update. * config/i386/linux64.mt (TM_FILE): Update. * config/i386/linux.mt (TM_FILE): Update. * config/i386/i386sol2.mt (TM_FILE): Update. * config/i386/i386lynx.mt (TM_FILE): Update. * config/i386/fbsd64.mt (TM_FILE): Update. * config/i386/fbsd.mt (TM_FILE): Update. * config/i386/cygwin.mt (TM_FILE): Update. * config/h8300/h8300.mt (TM_FILE): Update. * config/frv/frv.mt (TM_FILE): Update. * config/cris/cris.mt (TM_FILE): Update. * config/arm/wince.mt (TM_FILE): Update. * config/arm/nbsd.mt (TM_FILE): Update. * config/arm/linux.mt (TM_FILE): Update. * config/arm/embed.mt (TM_FILE): Update. * config/alpha/nbsd.mt (TM_FILE): Update. * config/alpha/fbsd.mt (TM_FILE): Update. * config/alpha/alpha.mt (TM_FILE): Update. * config/alpha/alpha-osf1.mt (TM_FILE): Update. * config/alpha/alpha-linux.mt (TM_FILE): Update. Index: gdbserver/ChangeLog 2004-09-02 Andrew Cagney <cagney@gnu.org> * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
2004-09-13 22:55:42 +02:00
2004-09-02 Andrew Cagney <cagney@gnu.org>
* Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
2004-03-23 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_wait): Clear all_processes list also.
2004-03-12 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c: Include <errno.h>. Remove extern declaration of
errno.
2004-03-12 Daniel Jacobowitz <drow@mvista.com>
* gdbreplay.c, server.h, utils.c: Update copyright years.
2004-03-04 Nathan J. Williams <nathanw@wasabisystems.com>
* server.c (main): Print child status or termination signal from
variable 'signal', not 'sig'.
2004-03-04 Nathan J. Williams <nathanw@wasabisystems.com>
* linux-low.c (linux_read_memory): Change return type to
int. Check for and return error from ptrace().
* target.c (read_inferior_memory): Change return type to int. Pass
back return status from the_target->read_memory().
* target.h (struct target_ops): Adapt *read_memory() prototype.
Update comment.
(read_inferior_memory): Adapt prototype.
* server.c (main): Return an error packet if
read_inferior_memory() returns an error.
2004-03-04 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
Unify with other clean targets.
2004-02-29 Daniel Jacobowitz <drow@mvista.com>
* server.c (handle_v_cont): Call set_desired_inferior.
2004-02-29 Daniel Jacobowitz <drow@mvista.com>
* remote-utils.c (prepare_resume_reply): Always supply "thread:".
2004-02-29 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_wait): Unblock async I/O.
(linux_resume): Block and enable async I/O.
* remote-utils.c (block_async_io, unblock_async_io): New functions.
* server.h (block_async_io, unblock_async_io): Add prototypes.
2004-02-29 Daniel Jacobowitz <drow@mvista.com>
* remote-utils.c (remote_open): Print a status notice after
opening a TCP port.
* server.c (attach_inferior): Print a status notice after
attaching.
2004-02-29 Daniel Jacobowitz <drow@mvista.com>
* linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
2004-02-26 Daniel Jacobowitz <drow@mvista.com>
* remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
error packet.
* server.c, target.h: Update copyright years.
2004-02-25 21:41:42 +01:00
2004-02-25 Roland McGrath <roland@redhat.com>
* target.h (struct target_ops): New member `read_auxv'.
* server.c (handle_query): Handle qPart:auxv:read: query using that.
* linux-low.c (linux_read_auxv): New function.
(linux_target_ops): Initialize `read_auxv' member to that.
2004-02-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Committed by Jim Blandy <jimb@redhat.com>.
* linux-s390-low.c (s390_num_regs): Update.
2004-02-25 21:41:42 +01:00
(s390_regmap): Remove control registers. Use __s390x__ predefine
instead of GPR_SIZE to distiguish s390 and s390x targets.
2004-01-31 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c: Update copyright year.
(check_removed_breakpoint): Clear pending_is_breakpoint.
(linux_set_resume_request, linux_queue_one_thread)
(resume_status_pending_p): New functions.
(linux_continue_one_thread): Use process->resume.
(linux_resume): Only resume threads if there are no pending events.
* linux-low.h (struct process_info): Add resume request
pointer.
2004-01-30 Daniel Jacobowitz <drow@mvista.com>
* regcache.c (new_register_cache): Clear the allocated register
buffer. Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2003-10-13 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_resume): Take a struct thread_resume *
argument.
(linux_wait): Update call.
(resume_ptr): New static variable.
(linux_continue_one_thread): Renamed from
linux_continue_one_process. Use resume_ptr.
(linux_resume): Use linux_continue_one_thread.
* server.c (handle_v_cont, handle_v_requests): New functions.
(myresume): New function.
(main): Handle 'v' case.
* target.h (struct thread_resume): New type.
(struct target_ops): Change argument of "resume" to struct
thread_resume *.
(myresume): Delete macro.
2003-08-08 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (install-only): Create dest dir. Support DESTDIR.
(uninstall): Support DESTDIR.
Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com>
* configure.srv: Add xscale*linux copy of arm*linux entry.
2003-07-24 Daniel Jacobowitz <drow@mvista.com>
* linux-arm-low.c (arm_reinsert_addr): New function.
(the_low_target): Add arm_reinsert_addr.
2003-07-08 Mark Kettenis <kettenis@gnu.org>
* mem-break.c: Remove whitespace at end of file.
2003-06-28 Daniel Jacobowitz <drow@mvista.com>
* configure.in: Check whether we need to prototype strerror.
* server.h: Optionally prototype strerror.
* gdbreplay.c (perror_with_name): Use strerror.
* linux-low.c (linux_attach_lwp): Use strerror.
* utils.c (perror_with_name): Use strerror.
* config.in, configure: Regenerated.
2003-06-28 Daniel Jacobowitz <drow@mvista.com>
* linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
2003-06-20 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in (SFILES): Update.
* low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
low-sun3.c: Remove files.
2003-06-17 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c: Move comment to linux_thread_alive where it belonged.
(linux_detach_one_process, linux_detach): New functions.
(linux_target_ops): Add linux_detach.
* server.c (main): Handle 'D' packet.
* target.h (struct target_ops): Add "detach" member.
(detach_inferior): Define.
2003-06-13 Mark Kettenis <kettenis@gnu.org>
From Kelley Cook <kelleycook@wideopenwest.com>:
* configure.srv: Accept i[34567]86 variants.
2003-06-05 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_wait_for_event): Correct comment typos.
(linux_resume_one_process): Call check_removed_breakpoint.
(linux_send_signal): New function.
(linux_target_ops): Add linux_send_signal.
* remote-utils.c (putpkt, input_interrupt): Use send_signal instead
of kill.
* target.h (struct target_ops): Add send_signal.
2003-05-29 Jim Blandy <jimb@redhat.com>
* linux-low.c (usr_store_inferior_registers): Transfer buf in
PTRACE_XFER_TYPE-sized chunks, not int-sized chunks. Otherwise,
if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
away part of the register's value.
2003-03-26 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_create_inferior): Use __SIGRTMIN.
(linux_wait_for_event, linux_init_signals): Likewise.
2003-03-17 Daniel Jacobowitz <drow@mvista.com>
* configure.in: Check for stdlib.h.
* configure: Regenerated.
* config.in: Regenerated.
2003-01-04 Andreas Schwab <schwab@suse.de>
* linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
2003-01-02 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Remove obsolete code.
2002-11-20 Daniel Jacobowitz <drow@mvista.com>
* linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
defined(PT_FPR0_HI).
2002-11-17 Stuart Hughes <seh@zee2.com>
* linux-arm-low.c (arm_num_regs): Increase.
(arm_regmap): Include status register.
2002-11-17 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (register_addr): Remove incorrect -1 check.
2002-08-29 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (linux_create_inferior): Call setpgid. Return
the new PID.
(unstopped_p, linux_signal_pid): Remove.
(linux_target_ops): Remove linux_signal_pid.
* remote-utils.c (putpkt, input_interrupt): Use signal_pid
global instead of target method.
* target.h (struct target_ops): Remove signal_pid. Update comment
for create_inferior.
* server.c (signal_pid): New variable.
(create_inferior): Set signal_pid. Block SIGTTOU and SIGTTIN in
2004-02-25 21:41:42 +01:00
gdbserver. Set the child to be the foreground process group.
(attach_inferior): Set signal_pid.
2002-08-23 Daniel Jacobowitz <drow@mvista.com>
* ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
2002-08-20 Jim Blandy <jimb@redhat.com>
* Makefile.in (LDFLAGS): Allow the configure script to establish a
default for this.
2002-08-01 Andrew Cagney <cagney@redhat.com>
* Makefile.in: Make chill references obsolete.
2002-07-24 Kevin Buettner <kevinb@redhat.com>
* configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
* configure: Regenerate.
* config.in: Regenerate.
2002-07-09 David O'Brien <obrien@FreeBSD.org>
* gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
(perror_with_name, remote_close, remote_open, expect, play): Static.
2002-07-04 Michal Ludvig <mludvig@suse.cz>
2004-02-25 21:41:42 +01:00
* linux-x86-64-low.c (x86_64_regmap): Make it an array of
byte offsets instead of an array of indexes.
(x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
2002-06-13 Daniel Jacobowitz <drow@mvista.com>
* regcache.c: Add comment.
2002-06-11 Daniel Jacobowitz <drow@mvista.com>
* thread-db.c: New file.
* proc-service.c: New file.
* acinclude.m4: New file.
* Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
proc-service.o, and thread-db.o.
(linux-low.o): Add USE_THREAD_DB.
* acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
* aclocal.m4: Regenerated.
* config.in: Regenerated.
* configure: Regenerated.
* configure.in: Check for proc_service.h, sys/procfs.h,
thread_db.h, and linux/elf.h headrs.
Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
PRFPREGSET_T_BROKEN. Introduce srv_thread_depfiles and USE_THREAD_DB.
Check for -lthread_db and thread support.
* configure.srv: Enable thread_db support for ARM, i386, MIPS,
PowerPC, and SuperH.
* i387-fp.c: Constify arguments.
* i387-fp.h: Likewise.
* inferiors.c: (struct thread_info): Renamed from
`struct inferior_info'. Remove PID member. Use generic inferior
list header. All uses updated.
(inferiors, signal_pid): Removed.
(all_threads): New variable.
(get_thread): Define.
(add_inferior_to_list): New function.
(for_each_inferior): New function.
(change_inferior_id): New function.
(add_inferior): Removed.
(remove_inferior): New function.
(add_thread): New function.
(free_one_thread): New function.
(remove_thread): New function.
(clear_inferiors): Use for_each_inferior and free_one_thread.
(find_inferior): New function.
(find_inferior_id): New function.
(inferior_target_data): Update argument type.
(set_inferior_target_data): Likewise.
(inferior_regcache_data): Likewise.
(set_inferior_regcache_data): Likewise.
* linux-low.c (linux_bp_reinsert): Remove.
(all_processes, stopping_threads, using_thrads)
(struct pending_signals, debug_threads, pid_of): New.
(inferior_pid): Replace with macro.
(struct inferior_linux_data): Remove.
(get_stop_pc, add_process): New functions.
(linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
Use add_process and add_thread.
(linux_attach_lwp): New function, based on old linux_attach. Use
add_process and add_thread. Set stop_expected for new threads.
(linux_attach): New function.
(linux_kill_one_process): New function.
(linux_kill): Kill all LWPs.
(linux_thread_alive): Use find_inferior_id.
(check_removed_breakpoints, status_pending_p): New functions.
(linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
Update. Use WNOHANG. Wait for cloned processes also. Update process
struct for the found process.
(linux_wait_for_event): New function.
(linux_wait): Use it. Support LWPs.
(send_sigstop, wait_for_sigstop, stop_all_processes)
(linux_resume_one_process, linux_continue_one_process): New functions.
(linux_resume): Support LWPs.
(REGISTER_RAW_SIZE): Remove.
(fetch_register): Use register_size instead. Call supply_register.
(usr_store_inferior_registers): Likewise. Call collect_register.
Fix recursive case.
(regsets_fetch_inferior_registers): Improve error message.
(regsets_store_inferior_registers): Add debugging.
(linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
(unstopped_p, linux_signal_pid): New functions.
(linux_target_ops): Add linux_signal_pid.
(linux_init_signals): New function.
(initialize_low): Call it. Initialize using_threads.
* regcache.c (inferior_regcache_data): Add valid
flag.
(get_regcache): Fetch registers lazily. Add fetch argument
and update all callers.
(regcache_invalidate_one, regcache_invalidate): New
functions.
(new_register_cache): Renamed from create_register_cache.
Return the new regcache.
(free_register_cache): Change argument to a void *.
(registers_to_string, registers_from_string): Call get_regcache
with fetch flag set.
(register_data): Make static. Pass fetch flag to get_regcache.
(supply_register): Call get_regcache with fetch flag clear.
(collect_register): Call get_regcache with fetch flag set.
(collect_register_as_string): New function.
* regcache.h: Update.
* remote-utils.c (putpkt): Flush after debug output and use
stderr.
Handle input interrupts while waiting for an ACK.
(input_interrupt): Use signal_pid method.
(getpkt): Flush after debug output and use stderr.
(outreg): Use collect_register_as_string.
(new_thread_notify, dead_thread_notify): New functions.
(prepare_resume_reply): Check using_threads. Set thread_from_wait
and general_thread.
(look_up_one_symbol): Flush after debug output.
* server.c (step_thread, server_waiting): New variables.
(start_inferior): Don't use signal_pid. Update call to mywait.
(attach_inferior): Update call to mywait.
(handle_query): Handle qfThreadInfo and qsThreadInfo.
(main): Don't fetch/store registers explicitly. Use
set_desired_inferior. Support proposed ``Hs'' packet. Update
calls to mywait.
* server.h: Update.
(struct inferior_list, struct_inferior_list_entry): New.
* target.c (set_desired_inferior): New.
(write_inferior_memory): Constify.
(mywait): New function.
* target.h: Update.
(struct target_ops): New signal_pid method.
(mywait): Removed macro, added prototype.
* linux-low.h (regset_func): Removed.
(regset_fill_func, regset_store_func): New.
(enum regset_type): New.
(struct regset_info): Add type field. Use new operation types.
(struct linux_target_ops): stop_pc renamed to get_pc.
Add decr_pc_after_break and breakpoint_at.
(get_process, get_thread_proess, get_process_thread)
(strut process_info, all_processes, linux_attach_lwp)
(thread_db_init): New.
* linux-arm-low.c (arm_get_pc, arm_set_pc,
arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
(the_low_target): Add new members.
* linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
(i386_store_fpxregset): Constify.
(target_regsets): Add new kind identifier.
(i386_get_pc): Renamed from i386_stop_pc. Simplify.
(i386_set_pc): Add debugging.
(i386_breakpoint_at): New function.
(the_low_target): Add new members.
* linux-mips-low.c (mips_get_pc, mips_set_pc)
(mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
(mips_breakpoint_at): New.
(the_low_target): Add new members.
* linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
(ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
(the_low_target): Add new members.
* linux-sh-low.c (sh_get_pc, sh_set_pc)
(sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
(the_low_target): Add new members.
* linux-x86-64-low.c (target_regsets): Add new kind
identifier.
2002-05-15 Daniel Jacobowitz <drow@mvista.com>
From Martin Pool <mbp@samba.org>:
* server.c (gdbserver_usage): New function.
(main): Call it.
2002-05-14 Daniel Jacobowitz <drow@mvista.com>
* mem-break.c (reinsert_breakpoint_by_bp): Correct typo
stop_at -> stop_pc.
2002-05-04 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Remove obsolete code.
2002-04-24 Michal Ludvig <mludvig@suse.cz>
* linux-low.c (regsets_fetch_inferior_registers),
(regsets_store_inferior_registers): Removed cast to int from
ptrace() calls.
* regcache.h: Added declaration of struct inferior_info.
2002-04-20 Daniel Jacobowitz <drow@mvista.com>
* inferiors.c (struct inferior_info): Add regcache_data.
(add_inferior): Call create_register_cache.
(clear_inferiors): Call free_register_cache.
(inferior_regcache_data, set_inferior_regcache_data): New functions.
* regcache.c (struct inferior_regcache_data): New.
(registers): Remove.
(get_regcache): New function.
(create_register_cache, free_register_cache): New functions.
(set_register_cache): Don't initialize the register cache here.
(registers_to_string, registers_from_string, register_data): Call
get_regcache.
* regcache.h: Add prototypes.
* server.h: Likewise.
2002-04-20 Daniel Jacobowitz <drow@mvista.com>
* mem-break.c: New file.
* mem-break.h: New file.
* Makefile.in: Add mem-break.o rule; update server.h
dependencies.
* inferiors.c (struct inferior_info): Add target_data
member.
(clear_inferiors): Free target_data member if set.
(inferior_target_data, set_inferior_target_data): New functions.
* linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
(i386_stop_pc, i386_set_pc): New. Add to the_low_target.
* linux-low.c (linux_bp_reinsert): New variable.
(struct inferior_linux_data): New.
(linux_create_inferior): Use set_inferior_target_data.
(linux_attach): Likewise. Call add_inferior.
(linux_wait_for_one_inferior): New function.
(linux_wait): Call it.
(linux_write_memory): Add const.
(initialize_low): Call set_breakpoint_data.
* linux-low.h (struct linux_target_ops): Add breakpoint
handling members.
* server.c (attach_inferior): Remove extra add_inferior
call.
* server.h: Include mem-break.h. Update inferior.c
prototypes.
* target.c (read_inferior_memory)
(write_inferior_memory): New functions.
* target.h (read_inferior_memory)
(write_inferior_memory): Change macros to prototypes.
(struct target_ops): Update comments. Add const to write_memory
definition.
2002-04-11 Daniel Jacobowitz <drow@mvista.com>
* linux-low.c (usr_store_inferior_registers): Support
registers which are allowed to fail to store.
* linux-low.h (linux_target_ops): Likewise.
* linux-ppc-low.c (ppc_regmap): Support FPSCR.
(ppc_cannot_store_register): FPSCR may not be storable.
2002-04-09 Daniel Jacobowitz <drow@mvista.com>
* server.h: Include <string.h> if HAVE_STRING_H.
* ChangeLog: Correct paths in last ChangeLog entry.
2002-04-09 Daniel Jacobowitz <drow@mvista.com>
* linux-low.h: Remove obsolete prototypes.
(struct linux_target_ops): New.
(extern the_low_target): New.
* linux-low.c (num_regs, regmap): Remove declarations.
(register_addr): Use the_low_target explicitly.
(fetch_register): Likewise.
(usr_fetch_inferior_registers): Likewise.
(usr_store_inferior_registers): Likewise.
* linux-arm-low.c (num_regs): Remove.
(arm_num_regs): Define.
(arm_regmap): Renamed from regmap, made static.
(arm_cannot_fetch_register): Renamed from cannot_fetch_register,
made static.
(arm_cannot_store_register): Renamed from cannot_store_register,
made static.
(the_low_target): New.
* linux-i386-low.c (num_regs): Remove.
(i386_num_regs): Define.
(i386_regmap): Renamed from regmap, made static.
(i386_cannot_fetch_register): Renamed from cannot_fetch_register,
made static.
(i386_cannot_store_register): Renamed from cannot_store_register,
made static.
(the_low_target): New.
* linux-ia64-low.c (num_regs): Remove.
(ia64_num_regs): Define.
(ia64_regmap): Renamed from regmap, made static.
(ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
made static.
(ia64_cannot_store_register): Renamed from cannot_store_register,
made static.
(the_low_target): New.
* linux-m68k-low.c (num_regs): Remove.
(m68k_num_regs): Define.
(m68k_regmap): Renamed from regmap, made static.
(m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
made static.
(m68k_cannot_store_register): Renamed from cannot_store_register,
made static.
(the_low_target): New.
* linux-mips-low.c (num_regs): Remove.
(mips_num_regs): Define.
(mips_regmap): Renamed from regmap, made static.
(mips_cannot_fetch_register): Renamed from cannot_fetch_register,
made static.
(mips_cannot_store_register): Renamed from cannot_store_register,
made static.
(the_low_target): New.
* linux-ppc-low.c (num_regs): Remove.
(ppc_num_regs): Define.
(ppc_regmap): Renamed from regmap, made static.
(ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
made static.
(ppc_cannot_store_register): Renamed from cannot_store_register,
made static.
(the_low_target): New.
* linux-s390-low.c (num_regs): Remove.
(s390_num_regs): Define.
(s390_regmap): Renamed from regmap, made static.
(s390_cannot_fetch_register): Renamed from cannot_fetch_register,
made static.
(s390_cannot_store_register): Renamed from cannot_store_register,
made static.
(the_low_target): New.
* linux-sh-low.c (num_regs): Remove.
(sh_num_regs): Define.
(sh_regmap): Renamed from regmap, made static.
(sh_cannot_fetch_register): Renamed from cannot_fetch_register,
made static.
(sh_cannot_store_register): Renamed from cannot_store_register,
made static.
(the_low_target): New.
* linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
(the_low_target): New.
2002-04-09 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in: Add stamp-h target.
* configure.in: Create stamp-h.
* configure: Regenerated.
2002-04-09 Daniel Jacobowitz <drow@mvista.com>
* inferiors.c: New file.
* target.c: New file.
* target.h: New file.
* Makefile.in: Add target.o and inferiors.o. Update
dependencies.
* linux-low.c (inferior_pid): New static variable,
moved from server.c.
(linux_create_inferior): Renamed from create_inferior.
Call add_inferior. Return 0 on success instead of a PID.
(linux_attach): Renamed from myattach.
(linux_kill): Renamed from kill_inferior. Call clear_inferiors ().
(linux_thread_alive): Renamed from mythread_alive.
(linux_wait): Renamed from mywait. Call clear_inferiors () if the
child dies.
(linux_resume): Renamed from myresume. Add missing ``return 0''.
(regsets_store_inferior_registers): Correct error message.
Add missing ``return 0''.
(linux_fetch_registers): Renamed from fetch_inferior_registers.
(linux_store_registers): Renamed from store_inferior_registers.
(linux_read_memory): Renamed from read_inferior_memory.
(linux_write_memory): Renamed from write_inferior_memory.
(linux_target_ops): New structure.
(initialize_low): Call set_target_ops ().
* remote-utils.c (unhexify): New function.
(hexify): New function.
(input_interrupt): Send signals to ``signal_pid''.
* server.c (inferior_pid): Remove.
(start_inferior): Update create_inferior call.
(attach_inferior): Call add_inferior.
(handle_query): New function.
(main): Call handle_query for `q' packets.
* server.h: Include "target.h". Remove obsolete prototypes.
Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
2002-04-09 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in: Add WARN_CFLAGS. Update configury
dependencies.
* configure.in: Check for <string.h>
* configure: Regenerate.
* config.in: Regenerate.
* gdbreplay.c: Include needed system headers.
(remote_open): Remove strchr prototype.
* linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
* regcache.c (supply_register): Change buf argument to const void *.
(supply_register_by_name): Likewise.
(collect_register): Change buf argument to void *.
(collect_register_by_name): Likewise.
* regcache.h: Add missing prototypes.
* remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
* server.c (handle_query): New function.
(attached): New static variable, moved out of main.
(main): Quiet longjmp clobber warnings.
* server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes.
* utils.c (error): Remove NORETURN.
(fatal): Likewise.