binutils-gdb/gdb/ChangeLog

16481 lines
600 KiB
Plaintext
Raw Normal View History

2014-12-18 Simon Marchi <simon.marchi@ericsson.com>
* elfread.c (elf_symfile_init): Remove stale comment.
(elf_symfile_read): Same.
* symfile.h (struct sym_fns): Same.
MIPS: Provide FPU info and decode FCSR in `info float' This patch is the V2. V1 can be found in https://sourceware.org/ml/gdb-patches/2012-05/msg00938.html V2 is to address Joel's comment <https://sourceware.org/ml/gdb-patches/2012-06/msg00289.html> about keeping dumping floating point registers. Additionally, command 'info float' prints bits on nan2008 and abs2008. ------------------------------------------------------------------ The change below provides a MIPS-specific handler for the: (gdb) info float command. It provides information about the FPU type available (if any), the FPU register width, and decodes the CP1 Floating Point Control and Status Register (FCSR): (gdb) print /x $fsr $1 = 0xff83ffff (gdb) info float fpu type: double-precision reg size: 32 bits cond : 0 1 2 3 4 5 6 7 cause : inexact uflow oflow div0 inval unimp mask : inexact uflow oflow div0 inval flags : inexact uflow oflow div0 inval rounding: -inf flush : zero One point to note about CP1.FCSR are the non-standard Flush-to-Nearest and Flush-Override bits. They are not a part of the MIPS architecture and take two positions reserved for an implementation-dependent use in the architecture. They are present in all the FPU implementations made by MIPS Technologies since the spin-off from SGI. I haven't been able to track down a single other MIPS FPU implementation that would make any use of these bits and they are required to be hardwired to zero by the architecture specification if unimplemented. Therefore I think it makes sense to report them in the current way. GDB has no guaranteed access to the CP0 Processor Identification (PRId) register to validate this feature properly and the ID information stored in the CP1 Floating Point Implementation Register (FIR) is from my experience not reliable enough (there's no Company ID available there for once unlike in CP0.PRId and Processor ID is not guaranteed to be unique). As a side note we should probably dump CP1.FIR information as well, as there's useful stuff indicating some FPU features there. That's material for another change however. gdb/ 2014-12-18 Nigel Stephens <nigel@mips.com> Maciej W. Rozycki <macro@codesourcery.com> * mips-tdep.c (print_fpu_flags): New function. (mips_print_float_info): Likewise. (mips_gdbarch_init): Install mips_print_float_info as gdbarch print_float_info routine. gdb/testsuite/ 2014-12-18 Nigel Stephens <nigel@mips.com> Maciej W. Rozycki <macro@codesourcery.com> * gdb.base/float.exp: Handle the new output from "info float" on MIPS targets.
2014-12-18 13:47:28 +01:00
2014-12-18 Nigel Stephens <nigel@mips.com>
Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.c (print_fpu_flags): New function.
(mips_print_float_info): Likewise.
(mips_gdbarch_init): Install mips_print_float_info as gdbarch
print_float_info routine.
2014-12-18 Yao Qi <yao@codesourcery.com>
* gdbarch.sh (print_float_info): Change its type from 'M' to 'm'.
* gdbarch.c: Re-generated.
* gdbarch.h: Likewise.
* infcmd.c (default_print_float_info): New function.
(print_float_info): Removed. Move code to
default_print_float_info.
(float_info): Adjust to call gdbarch_print_float_info.
* inferior.h (default_print_float_info): Declare it.
2014-12-18 Yao Qi <yao@codesourcery.com>
* h8300-tdep.c (h8300_print_float_info): Remove.
(h8300_gdbarch_init): Remove the call to
set_gdbarch_print_float_info.
2014-12-18 Doug Evans <xdje42@gmail.com>
* infcmd.c (jump_command): Minor simplification.
2014-12-18 Doug Evans <xdje42@gmail.com>
* language.c (language_lookup_primitive_type): Renamed from
language_lookup_primitive_type_by_name. All callers updated.
Fix MinGW compilation On Sun, 14 Dec 2014 07:00:28 +0100, Yao Qi wrote: The build on mingw host is broken because mingw has no mkdtemp. ../../../git/gdb/compile/compile.c: In function 'get_compile_file_tempdir': ../../../git/gdb/compile/compile.c:194:3: error: implicit declaration of function 'mkdtemp' [-Werror=implicit-function-declaration] tempdir_name = mkdtemp (tname); ^ ../../../git/gdb/compile/compile.c:194:16: error: assignment makes pointer from integer without a cast [-Werror] tempdir_name = mkdtemp (tname); ^ cc1: all warnings being treated as errors In the end I have managed to test it by Wine myself: $ wine build_win32/gdb/gdb.exe -q build_win32/gdb/gdb.exe -ex start -ex 'compile code 1' -ex 'set confirm no' -ex quit [...] Temporary breakpoint 1, main (argc=1, argv=0x241418) at ../../gdb/gdb.c:29 29 args.argc = argc; Could not load libcc1.so: Module not found. Even if it managed to load libcc1.so (it needs host-dependent name libcc1.dll) then it would soon end up at least on: default_infcall_mmap: error (_("This target does not support inferior memory allocation by mmap.")); As currently there is only: linux-tdep.c: set_gdbarch_infcall_mmap (gdbarch, linux_infcall_mmap); While one could debug Linux targets from MS-Windows host I find it somehow overcomplicated now when we are trying to get it running at least on native Linux x86*. The 'compile' project needs a larger port effort to run on MS-Windows. gdb/ChangeLog 2014-12-17 Jan Kratochvil <jan.kratochvil@redhat.com> Fix MinGW compilation. * compile/compile.c (get_compile_file_tempdir): Call error if !HAVE_MKDTEMP. * config.in: Regenerate. * configure: Regenerate. * configure.ac (AC_CHECK_FUNCS): Add mkdtemp. gdb/testsuite/ChangeLog 2014-12-17 Jan Kratochvil <jan.kratochvil@redhat.com> Fix MinGW compilation. * gdb.compile/compile-ops.exp: Update untested message if !skip_compile_feature_tests. * gdb.compile/compile-setjmp.exp: Likewise. * gdb.compile/compile-tls.exp: Likewise. * gdb.compile/compile.exp: Likewise. * lib/gdb.exp (skip_compile_feature_tests): Check also "Command not supported on this host".
2014-12-17 20:09:02 +01:00
2014-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix MinGW compilation.
* compile/compile.c (get_compile_file_tempdir): Call error if
!HAVE_MKDTEMP.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac (AC_CHECK_FUNCS): Add mkdtemp.
value_maybe_namespace_elt: Remove redundant call to lookup_static_symbol. Anytime you can remove a symbol lookup that loops over all objfiles is A Good Thing. The call to lookup_static_symbol in valops.c:value_maybe_namespace_elt is redundant with this call in cp_lookup_nested_symbol: /* Now search all static file-level symbols. We have to do this for things like typedefs in the class. We do not try to guess any imported namespace as even the fully specified namespace search is already not C++ compliant and more assumptions could make it too magic. */ size = strlen (parent_name) + 2 + strlen (nested_name) + 1; concatenated_name = alloca (size); xsnprintf (concatenated_name, size, "%s::%s", parent_name, nested_name); sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN); if (sym != NULL) return sym; Earlier in value_maybe_namespace_elt we do this: sym = cp_lookup_symbol_namespace (namespace_name, name, get_selected_block (0), VAR_DOMAIN); That sequence goes like: value_maybe_namespace_elt -> cp_lookup_symbol_namespace -> cp_lookup_symbol_in_namespace -> lookup_symbol_file -> cp_lookup_nested_symbol -> lookup_static_symbol The call was added in commit 41f62f3939b1c69e68ef5652feb44fef90eb85c9. https://sourceware.org/ml/gdb-patches/2010-06/msg00663.html With a part 2 here: https://sourceware.org/ml/gdb-patches/2010-06/msg00664.html At the time the call to lookup_static_symbol (spelled lookup_static_symbol_aux at the time) was needed. However, this patch, 8dea366bbed7986295681c101dcfbd35aeb6dfc4, https://sourceware.org/ml/gdb-patches/2012-11/msg00387.html augmented lookup_symbol_file to call cp_lookup_nested_symbol and introduced the redundancy. It's kinda buried, so it's totally not unexpected that this happened. gdb/ChangeLog: * valops.c (value_maybe_namespace_elt): Remove redundant call to lookup_static_symbol.
2014-12-17 09:30:29 +01:00
2014-12-17 Doug Evans <xdje42@gmail.com>
* valops.c (value_maybe_namespace_elt): Remove redundant call to
lookup_static_symbol.
2014-12-17 Doug Evans <xdje42@gmail.com>
New parameter "debug symbol-lookup".
* NEWS: Mention it.
* cp-namespace.c (cp_lookup_symbol_imports_or_template): Add debug
output.
(cp_lookup_symbol_namespace, cp_lookup_symbol_nonlocal): Ditto.
(cp_lookup_nested_symbol): Ditto.
* language.c (language_lookup_primitive_type_by_name): Add debug
output.
* minsyms.c (lookup_minimal_symbol): Add debug output.
* objfiles.c (objfile_debug_name): Moved here, and renamed ...
* symfile-debug.c (debug_objfile_name): ... from here. All callers
updated.
* objfiles.h (objfile_debug_name): Declare.
* symtab.h (symbol_lookup_debug): Declare.
* symtab.c (symbol_lookup_debug): New global.
(lookup_language_this): Add debug output.
(lookup_symbol_aux, lookup_symbol_in_block): Ditto.
(lookup_symbol_in_objfile_symtabs, lookup_symbol_via_quick_fns): Ditto.
(lookup_symbol_in_static_block, lookup_symbol_in_objfile): Ditto.
(_initialize_symtab): Add new parameter "debug symbol-lookup".
2014-12-16 Doug Evans <xdje42@gmail.com>
* buildsym.c: Add comments describing how the buildsym machinery
is used by the various file formats.
(really_free_pendings): Enhance function comment.
See pending_macros to NULL. Simplify resetting pending_addrmap.
Call free_buildsym_compunit.
(free_buildsym_compunit): Set current_subfile to NULL.
(prepare_for_building): New function.
(start_symtab): Call it. Remove call to set_last_source_file.
(restart_symtab): New arg "cust". All callers updated.
Simplify, call prepare_for_building. Re-initialize buildsym_compunit.
(reset_symtab_globals): Enhance function comment.
Set local_symbols, file_symbols, global_symbols to NULL.
Set pending_macros to NULL. Simplify resetting pending_addrmap.
Call free_buildysym_compunit.
(end_symtab_without_blockvector): Delete. All callers updated.
(end_symtab_with_blockvector): Remove redundant call to
free_buildsym_compunit.
(augment_type_symtab): Remove arg "cust". All callers updated.
(buildsym_init): Remove resetting of free_pendings, file_symbols,
global_symbols, pending_blocks, pending_macros. Instead make
handling consistent with pending_addrmap: Assert value was reset
at end of previous symtab building. Initialize context_stack here.
2014-12-16 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (cp_lookup_symbol_via_imports): Renamed from
cp_lookup_symbol_imports. All callers updated.
2014-12-16 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (cp_find_type_baseclass_by_name): Renamed from
find_type_baseclass_by_name. All callers updated.
2014-12-16 Doug Evans <xdje42@gmail.com>
* symtab.h (struct symbol_search) <symtab>: Delete. All uses updated.
* symtab.c (compare_search_syms): Use SYMBOL_SYMTAB accessor.
(print_symbol_info): Delete arg symtab. All callers updated.
(symtab_symbol_info): Use SYMBOL_SYMTAB accessor.
2014-12-16 Andreas Arnez <arnez@vnet.linux.ibm.com>
* user-regs.c (maintenance_print_user_registers): Swap "Nr" and
"Name" columns. Assure that the output is always indented.
[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>
* 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.
2014-12-16 Yao Qi <yao@codesourcery.com>
* NEWS: Move some entries to "Changes since GDB 7.8" section.
2014-12-16 Yao Qi <yao@codesourcery.com>
* linux-tdep.c (linux_infcall_mmap): Replace ARG_MAX with
ARG_LAST.
2014-12-15 Simon Marchi <simon.marchi@ericsson.com>
* inferior.c (find_inferior_ptid): New function.
* inferior.h (find_inferior_ptid): New declaration.
* ada-tasks.c (ada_get_task_number): Use find_inferior_ptid.
* corelow.c (core_pid_to_str): Same.
* darwin-nat.c (darwin_resume): Same.
* infrun.c (fetch_inferior_event): Same.
(get_inferior_stop_soon): Same.
(handle_inferior_event): Same.
(handle_signal_stop): Same.
* linux-nat.c (resume_lwp): Same.
(stop_wait_callback): Same.
* mi/mi-interp.c (mi_new_thread): Same.
(mi_thread_exit): Same.
* proc-service.c (ps_pglobal_lookup): Same.
* record-btrace.c (record_btrace_step_thread): Same.
* remote-sim.c (gdbsim_close_inferior): Same.
(gdbsim_resume): Same.
(gdbsim_stop): Same.
* sol2-tdep.c (sol2_core_pid_to_str): Same.
* target.c (memory_xfer_partial_1): Same.
(default_thread_address_space): Same.
* thread.c (thread_change_ptid): Same.
(switch_to_thread): Same.
(do_restore_current_thread_cleanup): Same.
Fix build with Python 3.4 (PR python/16784) The type of the function pointer PyOS_ReadlineFunctionPointer (part of the Python C API), which we use, slightly changed starting with Python 3.4. The signature went from PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); to PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); The parameter that changed is the prompt text. This commits adjust gdb accordingly by making the prompt_arg parameter const, as well as the fallouts of that. I needed to rework how annotations are added to the prompt, since the it is now const. If annotations are enabled, it will make a copy of the prompt overwrite the prompt variable that is used throughout the function. Otherwise, no copy is done and the original prompt_arg value is passed. I changed the signature of deprecated_readline_hook. I would've changed any user of it, but it seems like nothing is using it, Built-tested with python 2.7.x, 3.3.y and 3.4.z. gdb/ChangeLog: * defs.h (gdb_readline): Constify argument. (gdb_readline_wrapper): Same. (command_line_input): Same. (deprecated_readline_hook): Same. * top.c (deprecated_readline_hook): Same. (gdb_readline): Same. (gdb_readline_wrapper): Same. (command_line_input): Constify argument. Pass prompt to called functions instead of local_prompt, overwriting prompt if using annotations. * event-top.h (display_gdb_prompt): Constify argument. * event-top.c (display_gdb_prompt): Same. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Constify argument if building with Python 3.4 and up. Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
2014-12-15 17:38:03 +01:00
2014-12-15 Simon Marchi <simon.marchi@ericsson.com>
* defs.h (gdb_readline): Constify argument.
(gdb_readline_wrapper): Same.
(command_line_input): Same.
(deprecated_readline_hook): Same.
* top.c (deprecated_readline_hook): Same.
(gdb_readline): Same.
(gdb_readline_wrapper): Same.
(command_line_input): Constify argument. Pass prompt_arg to called
functions instead of local_prompt, overwriting prompt_arg if necessary.
* event-top.h (display_gdb_prompt): Constify argument.
* event-top.c (display_gdb_prompt): Same.
* python/py-gdb-readline.c (gdbpy_readline_wrapper): Constify argument
if building with Python 3.4 and up.
2014-12-15 Simon Marchi <simon.marchi@ericsson.com>
* python/lib/gdb/prompt.py (_prompt_pwd): Use os.getcwd() instead of
os.getcwdu().
2014-12-15 Catalin Udma <catalin.udma@freescale.com>
PR gdb/15684
* memattr.c (mem_info_command): Remove "unsigned long" casts.
2014-12-13 Doug Evans <xdje42@gmail.com>
* utils.c (make_hex_string): Fix off-by-one error.
Internal error trying to print uninitialized string. Trying to print the value of a string whose size is not known at compile-time before it gets assigned a value can lead to the following internal error: (gdb) p my_str $1 = /[...]/utils.c:1089: internal-error: virtual memory exhausted. What happens is that my_str is described as a reference to an array type whose bounds are dynamic. During the read of that variable's value (in default_read_var_value), we end up resolving dynamic types which, for reference types, makes us also resolve the target of that reference type. This means we resolve our variable to a reference to an array whose bounds are undefined, and unfortunately very far appart. So, when we pass that value to ada-valprint, and in particular to da_val_print_ref, we eventually try to allocate too large of a buffer corresponding to the (bogus) size of our array, hence the internal error. This patch fixes the problem by adding a size_check before trying to print the dereferenced value. To perform this check, a function that was previously specific to ada-lang.c (check_size) gets exported, and renamed to something less prone to name collisions (ada_ensure_varsize_limit). gdb/ChangeLog: * ada-lang.h (ada_ensure_varsize_limit): Declare. * ada-lang.c (check_size): Remove advance declaration. (ada_ensure_varsize_limit): Renames check_size. Replace calls to check_size by calls to ada_ensure_varsize_limit throughout. * ada-valprint.c (ada_val_print_ref): Add call to ada_ensure_varsize_limit. Add comment explaining why. gdb/testsuite/ChangeLog: * gdb.ada/str_uninit: New testcase.
2014-12-08 16:37:00 +01:00
2014-12-13 Joel Brobecker <brobecker@adacore.com>
* ada-lang.h (ada_ensure_varsize_limit): Declare.
* ada-lang.c (check_size): Remove advance declaration.
(ada_ensure_varsize_limit): Renames check_size.
Replace calls to check_size by calls to ada_ensure_varsize_limit
throughout.
* ada-valprint.c (ada_val_print_ref): Add call to
ada_ensure_varsize_limit. Add comment explaining why.
2014-12-13 Joel Brobecker <brobecker@adacore.com>
* utils.c (make_hex_string): Replace use of sprintf by use of
xsnprintf.
2014-12-13 Joel Brobecker <brobecker@adacore.com>
* compile/compile-object-load.c (link_callbacks_multiple_definition)
(link_callbacks_warning, link_callbacks_einfo): Remove trailing
newline at end of warning message.
2014-12-13 Joel Brobecker <brobecker@adacore.com>
* acx_configure_dir.m4 (ACX_CONFIGURE_DIR): Add support for
new "EXTRA-ARGS" parameter.
* configure.ac: If large-file support is disabled in GDB,
pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
* configure: Regenerate.
2014-12-13 Jan Kratochvil <jan.kratochvil@redhat.com>
PR symtab/17642
* gdbtypes.c (resolve_dynamic_type_internal): Apply check_typedef to
TYPE if not TYPE_CODE_TYPEDEF.
2014-12-13 Joel Brobecker <brobecker@adacore.com>
PR backtrace/16215:
* dwarf2-frame.c (dwarf2_frame_cfa): Remove the restriction
the frame unwinder must either be the dwarf2_frame_unwind
or the dwarf2_tailcall_frame_unwind. Verify that this_frame's
stack_addr is valid before calling get_frame_base. Throw
an error if not valid.
2014-12-12 Doug Evans <xdje42@gmail.com>
* valops.c (value_maybe_namespace_elt): Remove unnecessary test of
result != NULL.
2014-12-12 Doug Evans <xdje42@gmail.com>
* cp-support.h (cp_is_in_anonymous): Renamed from cp_is_anonymous.
All callers updated. Rename arg "namespace" to "symbol_name".
Give quick_symbol_functions "methods" a consistent naming scheme. Add missing function comments. gdb/ChangeLog: * psymtab.c (psym_map_symtabs_matching_filename): Renamed from partial_map_symtabs_matching_filename. All uses updated. (psym_find_pc_sect_compunit_symtab): Renamed from find_pc_sect_compunit_symtab_from_partial. All uses updated. Add function comment. (psym_lookup_symbol): Renamed from lookup_symbol_aux_psymtabs. All uses updated. Add function comment. (psym_relocate): Renamed from relocate_psymtabs. All uses updated. Add function comment. (psym_find_last_source_symtab): Renamed from find_last_source_symtab_from_partial. All uses updated. Add function comment. (psym_forget_cached_source_info): Renamed from forget_cached_source_info_partial. All uses updated. Add function comment. (psym_print_stats): Renamed from print_psymtab_stats_for_objfile. All uses updated. Add function comment. (psym_dump): Renamed from dump_psymtabs_for_objfile. All uses updated. Add function comment. (psym_expand_symtabs_for_function): Renamed from read_symtabs_for_function. All uses updated. Update function comment. (psym_expand_all_symtabs): Renamed from expand_partial_symbol_tables. All uses updated. Add function comment. (psym_expand_symtabs_with_fullname): Renamed from read_psymtabs_with_fullname. All uses updated. Add function comment. (psym_map_symbol_filenames): Renamed from map_symbol_filenames_psymtab. All uses updated. Add function comment. (psym_map_matching_symbols): Renamed from map_matching_symbols_psymtab. All uses updated. (psym_expand_symtabs_matching): Renamed from expand_symtabs_matching_via_partial. All uses updated. Add function comment. (psym_has_symbols): Renamed from objfile_has_psyms. All uses updated. Add function comment.
2014-12-13 07:27:23 +01:00
2014-12-12 Doug Evans <xdje42@gmail.com>
* psymtab.c (psym_map_symtabs_matching_filename): Renamed from
partial_map_symtabs_matching_filename. All uses updated.
(psym_find_pc_sect_compunit_symtab): Renamed from
find_pc_sect_compunit_symtab_from_partial. All uses updated.
Add function comment.
(psym_lookup_symbol): Renamed from lookup_symbol_aux_psymtabs.
All uses updated. Add function comment.
(psym_relocate): Renamed from relocate_psymtabs. All uses updated.
Add function comment.
(psym_find_last_source_symtab): Renamed from
find_last_source_symtab_from_partial. All uses updated.
Add function comment.
(psym_forget_cached_source_info): Renamed from
forget_cached_source_info_partial. All uses updated.
Add function comment.
(psym_print_stats): Renamed from print_psymtab_stats_for_objfile.
All uses updated. Add function comment.
(psym_dump): Renamed from dump_psymtabs_for_objfile. All uses
updated. Add function comment.
(psym_expand_symtabs_for_function): Renamed from
read_symtabs_for_function. All uses updated. Update function comment.
(psym_expand_all_symtabs): Renamed from expand_partial_symbol_tables.
All uses updated. Add function comment.
(psym_expand_symtabs_with_fullname): Renamed from
read_psymtabs_with_fullname. All uses updated. Add function comment.
(psym_map_symbol_filenames): Renamed from map_symbol_filenames_psymtab.
All uses updated. Add function comment.
(psym_map_matching_symbols): Renamed from map_matching_symbols_psymtab.
All uses updated.
(psym_expand_symtabs_matching): Renamed from
expand_symtabs_matching_via_partial. All uses updated.
Add function comment.
(psym_has_symbols): Renamed from objfile_has_psyms. All uses updated.
Add function comment.
the "compile" command This final patch adds the new "compile" command and subcommands, and all the machinery needed to make it work. A shared library supplied by gcc is used for all communications with gcc. Types and most aspects of symbols are provided directly by gdb to the compiler using this library. gdb provides some information about the user's code using plain text. Macros are emitted this way, and DWARF location expressions (and bounds for VLA) are compiled to C code. This hybrid approach was taken because, on the one hand, it is better to provide global declarations and such on demand; but on the other hand, for local variables, translating DWARF location expressions to C was much simpler than exporting a full compiler API to gdb -- the same result, only easier to implement, understand, and debug. In the ordinary mode, the user's expression is wrapped in a dummy function. After compilation, gdb inserts the resulting object code into the inferior, then calls this function. Access to local variables is provided by noting which registers are used by location expressions, and passing a structure of register values into the function. Writes to registers are supported by copying out these values after the function returns. This approach was taken so that we could eventually implement other more interesting features based on this same infrastructure; for example, we're planning to investigate inferior-side breakpoint conditions. gdb/ChangeLog 2014-12-12 Phil Muldoon <pmuldoon@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> * NEWS: Update. * symtab.h (struct symbol_computed_ops) <generate_c_location>: New field. * p-lang.c (pascal_language_defn): Update. * opencl-lang.c (opencl_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * m2-lang.c (m2_language_defn): Update. * language.h (struct language_defn) <la_get_compile_instance, la_compute_program>: New fields. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Update. * jv-lang.c (java_language_defn): Update. * go-lang.c (go_language_defn): Update. * f-lang.c (f_language_defn): Update. * dwarf2loc.h (dwarf2_compile_property_to_c): Declare. * dwarf2loc.c (dwarf2_compile_property_to_c) (locexpr_generate_c_location, loclist_generate_c_location): New functions. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Update. * defs.h (enum compile_i_scope_types): New. (enum command_control_type) <compile_control>: New constant. (struct command_line) <control_u>: New field. * d-lang.c (d_language_defn): Update. * compile/compile.c: New file. * compile/compile-c-support.c: New file. * compile/compile-c-symbols.c: New file. * compile/compile-c-types.c: New file. * compile/compile.h: New file. * compile/compile-internal.h: New file. * compile/compile-loc2c.c: New file. * compile/compile-object-load.c: New file. * compile/compile-object-load.h: New file. * compile/compile-object-run.c: New file. * compile/compile-object-run.h: New file. * cli/cli-script.c (multi_line_command_p, print_command_lines) (execute_control_command, process_next_line) (recurse_read_control_structure): Handle compile_control. * c-lang.h (c_get_compile_context, c_compute_program): Declare. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Update. * ada-lang.c (ada_language_defn): Update. * Makefile.in (SUBDIR_GCC_COMPILE_OBS, SUBDIR_GCC_COMPILE_SRCS): New variables. (SFILES): Add SUBDIR_GCC_COMPILE_SRCS. (HFILES_NO_SRCDIR): Add compile.h. (COMMON_OBS): Add SUBDIR_GCC_COMPILE_OBS. (INIT_FILES): Add SUBDIR_GCC_COMPILE_SRCS. (compile.o, compile-c-types.o, compile-c-symbols.o) (compile-object-load.o, compile-object-run.o, compile-loc2c.o) (compile-c-support.o): New targets. gdb/doc/ChangeLog 2014-12-12 Phil Muldoon <pmuldoon@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Altering): Update. (Compiling and Injecting Code): New node. gdb/testsuite/ChangeLog 2014-12-12 Phil Muldoon <pmuldoon@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> * configure.ac: Add gdb.compile/. * configure: Regenerate. * gdb.compile/Makefile.in: New file. * gdb.compile/compile-ops.exp: New file. * gdb.compile/compile-ops.c: New file. * gdb.compile/compile-tls.c: New file. * gdb.compile/compile-tls.exp: New file. * gdb.compile/compile-constvar.S: New file. * gdb.compile/compile-constvar.c: New file. * gdb.compile/compile-mod.c: New file. * gdb.compile/compile-nodebug.c: New file. * gdb.compile/compile-setjmp-mod.c: New file. * gdb.compile/compile-setjmp.c: New file. * gdb.compile/compile-setjmp.exp: New file. * gdb.compile/compile-shlib.c: New file. * gdb.compile/compile.c: New file. * gdb.compile/compile.exp: New file. * lib/gdb.exp (skip_compile_feature_tests): New proc.
2014-05-14 22:35:45 +02:00
2014-12-12 Phil Muldoon <pmuldoon@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
* NEWS: Update.
* symtab.h (struct symbol_computed_ops) <generate_c_location>: New
field.
* p-lang.c (pascal_language_defn): Update.
* opencl-lang.c (opencl_language_defn): Update.
* objc-lang.c (objc_language_defn): Update.
* m2-lang.c (m2_language_defn): Update.
* language.h (struct language_defn) <la_get_compile_instance,
la_compute_program>: New fields.
* language.c (unknown_language_defn, auto_language_defn)
(local_language_defn): Update.
* jv-lang.c (java_language_defn): Update.
* go-lang.c (go_language_defn): Update.
* f-lang.c (f_language_defn): Update.
* dwarf2loc.h (dwarf2_compile_property_to_c): Declare.
* dwarf2loc.c (dwarf2_compile_property_to_c)
(locexpr_generate_c_location, loclist_generate_c_location): New
functions.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Update.
* defs.h (enum compile_i_scope_types): New.
(enum command_control_type) <compile_control>: New constant.
(struct command_line) <control_u>: New field.
* d-lang.c (d_language_defn): Update.
* compile/compile.c: New file.
* compile/compile-c-support.c: New file.
* compile/compile-c-symbols.c: New file.
* compile/compile-c-types.c: New file.
* compile/compile.h: New file.
* compile/compile-internal.h: New file.
* compile/compile-loc2c.c: New file.
* compile/compile-object-load.c: New file.
* compile/compile-object-load.h: New file.
* compile/compile-object-run.c: New file.
* compile/compile-object-run.h: New file.
* cli/cli-script.c (multi_line_command_p, print_command_lines)
(execute_control_command, process_next_line)
(recurse_read_control_structure): Handle compile_control.
* c-lang.h (c_get_compile_context, c_compute_program): Declare.
* c-lang.c (c_language_defn, cplus_language_defn)
(asm_language_defn, minimal_language_defn): Update.
* ada-lang.c (ada_language_defn): Update.
* Makefile.in (SUBDIR_GCC_COMPILE_OBS, SUBDIR_GCC_COMPILE_SRCS):
New variables.
(SFILES): Add SUBDIR_GCC_COMPILE_SRCS.
(HFILES_NO_SRCDIR): Add compile.h.
(COMMON_OBS): Add SUBDIR_GCC_COMPILE_OBS.
(INIT_FILES): Add SUBDIR_GCC_COMPILE_SRCS.
(compile.o, compile-c-types.o, compile-c-symbols.o)
(compile-object-load.o, compile-object-run.o, compile-loc2c.o)
(compile-c-support.o): New targets.
2014-12-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* s390-linux-tdep.c (s390_gcc_target_options): New function.
(s390_gdbarch_init): Add it to gdbarch.
2014-12-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-tdep.c: Include objfiles.h and infcall.h.
(GDB_MMAP_MAP_PRIVATE, GDB_MMAP_MAP_ANONYMOUS, linux_infcall_mmap): New
function.
(linux_init_abi): Add linux_infcall_mmap to gdbarch.
2014-12-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2loc.h (dwarf2_reg_to_regnum_or_error): Declare.
* dwarf2loc.c (dwarf2_reg_to_regnum_or_error): Rename from
translate_register. Now public.
(dwarf2_compile_expr_to_ax): Update.
2014-12-12 Tom Tromey <tromey@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2loc.c (dwarf_expr_frame_base_1): Remove declaration.
(dwarf_expr_frame_base): Update caller.
(dwarf_expr_frame_base_1): Rename to ...
(func_get_frame_base_dwarf_block): ... this and make it public.
(dwarf2_compile_expr_to_ax, locexpr_describe_location_piece): Update
callers.
* dwarf2loc.h (func_get_frame_base_dwarf_block): New declaration.
2014-12-12 Tom Tromey <tromey@redhat.com>
* dwarf2loc.c (dwarf2_compile_expr_to_ax) <DW_OP_call_frame_cfa>:
Update.
* dwarf2-frame.c (dwarf2_fetch_cfa_info): New function, based on
dwarf2_compile_cfa_to_ax.
(dwarf2_compile_cfa_to_ax): Remove.
* dwarf2-frame.h (dwarf2_fetch_cfa_info): Declare.
(dwarf2_compile_cfa_to_ax): Remove.
2014-12-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* infcall.h (call_function_by_hand_dummy): Declare.
* infcall.c (call_function_by_hand): Use
call_function_by_hand_dummy.
(call_function_by_hand_dummy): Rename from call_function_by_hand.
Add arguments. Register a destructor.
add gnu_triplet_regexp gdbarch method gdb has to inform libcc1.so of the target being used, so that the correct compiler can be invoked. The compiler is invoked using the GNU configury triplet prefix, e.g., "x86_64-unknown-linux-gnu-gcc". In order for this to work we need to map the gdbarch to the GNU configury triplet arch. In most cases these are identical; however, the x86 family poses some problems, as the BFD arch names are quite different from the GNU triplet names. So, we introduce a new gdbarch method for this. A regular expression is used because there are various valid values for the arch prefix in the triplet. This patch also updates the osabi code to associate a regular expression with the OS ABI. I have only added a concrete value for Linux. Note that the "-gnu" part is optional, at least on Fedora it is omitted from the installed GCC executable's name. gdb/ChangeLog 2014-12-12 Tom Tromey <tromey@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * osabi.h (osabi_triplet_regexp): Declare. * osabi.c (struct osabi_names): New. (gdb_osabi_names): Change type to struct osabi_names. Update values. (gdbarch_osabi_name): Update. (osabi_triplet_regexp): New function. (osabi_from_tdesc_string, _initialize_gdb_osabi): Update. * i386-tdep.c (i386_gnu_triplet_regexp): New method. (i386_elf_init_abi, i386_go32_init_abi, i386_gdbarch_init): Call set_gdbarch_gnu_triplet_regexp. * gdbarch.sh (gnu_triplet_regexp): New method. * gdbarch.c, gdbarch.h: Rebuild. * arch-utils.h (default_gnu_triplet_regexp): Declare. * arch-utils.c (default_gnu_triplet_regexp): New function.
2014-06-13 17:28:24 +02:00
2014-12-12 Tom Tromey <tromey@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* osabi.h (osabi_triplet_regexp): Declare.
* osabi.c (struct osabi_names): New.
(gdb_osabi_names): Change type to struct osabi_names. Update
values.
(gdbarch_osabi_name): Update.
(osabi_triplet_regexp): New function.
(osabi_from_tdesc_string, _initialize_gdb_osabi): Update.
* i386-tdep.c (i386_gnu_triplet_regexp): New method.
(i386_elf_init_abi, i386_go32_init_abi, i386_gdbarch_init): Call
set_gdbarch_gnu_triplet_regexp.
* gdbarch.sh (gnu_triplet_regexp): New method.
* gdbarch.c, gdbarch.h: Rebuild.
* arch-utils.h (default_gnu_triplet_regexp): Declare.
* arch-utils.c (default_gnu_triplet_regexp): New function.
2014-12-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* arch-utils.c (default_infcall_mmap)
(default_gcc_target_options): New functions.
* arch-utils.h (GDB_MMAP_PROT_READ, GDB_MMAP_PROT_WRITE)
(GDB_MMAP_PROT_EXEC): Define.
(default_infcall_mmap, default_gcc_target_options): Declare.
* gdbarch.h: Rebuild.
* gdbarch.c: Rebuild.
* gdbarch.sh (infcall_mmap, gcc_target_options): New methods.
2014-12-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* dummy-frame.c (struct dummy_frame) <dtor, dtor_data>: New
fields.
(pop_dummy_frame): Call the destructor if it exists.
(register_dummy_frame_dtor, find_dummy_frame_dtor): New
functions.
* dummy-frame.h (dummy_frame_dtor_ftype): New typedef.
(register_dummy_frame_dtor, find_dummy_frame_dtor): Declare.
2014-12-12 Tom Tromey <tromey@redhat.com>
* gdbtypes.h (make_unqualified_type): Declare.
* gdbtypes.c (make_unqualified_type): New function.
2014-12-12 Tom Tromey <tromey@redhat.com>
* ui-file.h (ui_file_write_for_put): Declare.
* ui-file.c (ui_file_write_for_put): New function.
* mi/mi-out.c (do_write): Remove.
(mi_out_put): Use ui_file_write_for_put.
2014-12-12 Doug Evans <dje@google.com>
* NEWS: Mention gdb.lookup_objfile.
* python/python.c (GdbMethods): Add lookup_objfile.
* python/python-internal.h (gdbpy_lookup_objfile): Declare.
* python/py-objfile.c: #include "symtab.h".
(objfpy_build_id_ok, objfpy_build_id_matches): New functions.
(objfpy_lookup_objfile_by_name): New function.
(objfpy_lookup_objfile_by_build_id): New function.
(gdbpy_lookup_objfile): New function.
2014-12-12 Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.h (MSYMBOL_TARGET_FLAG_MIPS16): New macro.
(MSYMBOL_TARGET_FLAG_MICROMIPS): Likewise.
* mips-tdep.c (mips_elf_make_msymbol_special): Use the new
macros.
(msymbol_is_mips, msymbol_is_mips16, msymbol_is_micromips):
Likewise.
2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
* completer.c: Include "target.h", "reggroups.h", and
"user-regs.h".
(reg_or_group_completer): New.
* completer.h (reg_or_group_completer): Declare.
* infcmd.c (_initialize_infcmd): Set reg_or_group_completer for
the "info registers" and "info all-registers" commands and the
dbx-mode "lr" command.
2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
* user-regs.c: Include "arch-utils.h", "command.h", and
"cli/cli-cmds.h".
(maintenance_print_user_registers): New.
(_initialize_user_regs): Register new "maint print user-registers"
subcommand.
* NEWS: Mention new GDB command "maint print user-registers".
MIPS: Keep the ISA bit in compressed code addresses 1. Background information The MIPS architecture, as originally designed and implemented in mid-1980s has a uniform instruction word size that is 4 bytes, naturally aligned. As such all MIPS instructions are located at addresses that have their bits #1 and #0 set to zeroes, and any attempt to execute an instruction from an address that has any of the two bits set to one causes an address error exception. This may for example happen when a jump-register instruction is executed whose register value used as the jump target has any of these bits set. Then in mid 1990s LSI sought a way to improve code density for their TinyRISC family of MIPS cores and invented an alternatively encoded instruction set in a joint effort with MIPS Technologies (then a subsidiary of SGI). The new instruction set has been named the MIPS16 ASE (Application-Specific Extension) and uses a variable instruction word size, which is 2 bytes (as the name of the ASE suggests) for most, but there are a couple of exceptions that take 4 bytes, and then most of the 2-byte instructions can be treated with a 2-byte extension prefix to expand the range of the immediate operands used. As a result instructions are no longer 4-byte aligned, instead they are aligned to a multiple of 2. That left the bit #0 still unused for code references, be it for the standard MIPS (i.e. as originally invented) or for the MIPS16 instruction set, and based on that observation a clever trick was invented that on one hand allowed the processor to be seamlessly switched between the two instruction sets at any time at the run time while on the other avoided the introduction of any special control register to do that. So it is the bit #0 of the instruction address that was chosen as the selector and named the ISA bit. Any instruction executed at an even address is interpreted as a standard MIPS instruction (the address still has to have its bit #1 clear), any instruction executed at an odd address is interpreted as a MIPS16 instruction. To switch between modes ordinary jump instructions are used, such as used for function calls and returns, specifically the bit #0 of the source register used in jump-register instructions selects the execution (ISA) mode for the following piece of code to be interpreted in. Additionally new jump-immediate instructions were added that flipped the ISA bit to select the opposite mode upon execution. They were considered necessary to avoid the need to make register jumps in all cases as the original jump-immediate instructions provided no way to change the bit #0 at all. This was all important for cases where standard MIPS and MIPS16 code had to be mixed, either for compatibility with the existing binary code base or to access resources not reachable from MIPS16 code (the MIPS16 instruction set only provides access to general-purpose registers, and not for example floating-point unit registers or privileged coprocessor 0 registers) -- pieces of code in the opposite mode can be executed as ordinary subroutine calls. A similar approach has been more recently adopted for the MIPS16 replacement instruction set defined as the so called microMIPS ASE. This is another instruction set encoding introduced to the MIPS architecture. Just like the MIPS16 ASE, the microMIPS instruction set uses a variable-length encoding, where each instruction takes a multiple of 2 bytes. The ISA bit has been reused and for microMIPS-capable processors selects between the standard MIPS and the microMIPS mode instead. 2. Statement of the problem To put it shortly, MIPS16 and microMIPS code pointers used by GDB are different to these observed at the run time. This results in the same expressions being evaluated producing different results in GDB and in the program being debugged. Obviously it's the results obtained at the run time that are correct (they define how the program behaves) and therefore by definition the results obtained in GDB are incorrect. A bit longer description will record that obviously at the run time the ISA bit has to be set correctly (refer to background information above if unsure why so) or the program will not run as expected. This is recorded in all the executable file structures used at the run time: the dynamic symbol table (but not always the static one!), the GOT, and obviously in all the addresses embedded in code or data of the program itself, calculated by applying the appropriate relocations at the static link time. While a program is being processed by GDB, the ISA bit is stripped off from any code addresses, presumably to make them the same as the respective raw memory byte address used by the processor to access the instruction in the instruction fetch access cycle. This stripping is actually performed outside GDB proper, in BFD, specifically _bfd_mips_elf_symbol_processing (elfxx-mips.c, see the piece of code at the very bottom of that function, starting with an: "If this is an odd-valued function symbol, assume it's a MIPS16 or microMIPS one." comment). This function is also responsible for symbol table dumps made by `objdump' too, so you'll never see the ISA bit reported there by that tool, you need to use `readelf'. This is however unlike what is ever done at the run time, the ISA bit once present is never stripped off, for example a cast like this: (short *) main will not strip the ISA bit off and if the resulting pointer is intended to be used to access instructions as data, for example for software instruction decoding (like for fault recovery or emulation in a signal handler) or for self-modifying code then the bit still has to be stripped off by an explicit AND operation. This is probably best illustrated with a simple real program example. Let's consider the following simple program: $ cat foobar.c int __attribute__ ((mips16)) foo (void) { return 1; } int __attribute__ ((mips16)) bar (void) { return 2; } int __attribute__ ((nomips16)) foo32 (void) { return 3; } int (*foo32p) (void) = foo32; int (*foop) (void) = foo; int fooi = (int) foo; int main (void) { return foop (); } $ This is plain C with no odd tricks, except from the instruction mode attributes. They are not necessary to trigger this problem, I just put them here so that the program can be contained in a single source file and to make it obvious which function is MIPS16 code and which is not. Let's try it with Linux, so that everyone can repeat this experiment: $ mips-linux-gnu-gcc -mips16 -g -O2 -o foobar foobar.c $ Let's have a look at some interesting symbols: $ mips-linux-gnu-readelf -s foobar | egrep 'table|foo|bar' Symbol table '.dynsym' contains 7 entries: Symbol table '.symtab' contains 95 entries: 55: 00000000 0 FILE LOCAL DEFAULT ABS foobar.c 66: 0040068c 4 FUNC GLOBAL DEFAULT [MIPS16] 12 bar 68: 00410848 4 OBJECT GLOBAL DEFAULT 21 foo32p 70: 00410844 4 OBJECT GLOBAL DEFAULT 21 foop 78: 00400684 8 FUNC GLOBAL DEFAULT 12 foo32 80: 00400680 4 FUNC GLOBAL DEFAULT [MIPS16] 12 foo 88: 00410840 4 OBJECT GLOBAL DEFAULT 21 fooi $ Hmm, no sight of the ISA bit, but notice how foo and bar (but not foo32!) have been marked as MIPS16 functions (ELF symbol structure's `st_other' field is used for that). So let's try to run and poke at this program with GDB. I'll be using a native system for simplicity (I'll be using ellipses here and there to remove unrelated clutter): $ ./foobar $ echo $? 1 $ So far, so good. $ gdb ./foobar [...] (gdb) break main Breakpoint 1 at 0x400490: file foobar.c, line 23. (gdb) run Starting program: .../foobar Breakpoint 1, main () at foobar.c:23 23 return foop (); (gdb) Yay, it worked! OK, so let's poke at it: (gdb) print main $1 = {int (void)} 0x400490 <main> (gdb) print foo32 $2 = {int (void)} 0x400684 <foo32> (gdb) print foo32p $3 = (int (*)(void)) 0x400684 <foo32> (gdb) print bar $4 = {int (void)} 0x40068c <bar> (gdb) print foo $5 = {int (void)} 0x400680 <foo> (gdb) print foop $6 = (int (*)(void)) 0x400681 <foo> (gdb) A-ha! Here's the difference and finally the ISA bit! (gdb) print /x fooi $7 = 0x400681 (gdb) p/x $pc p/x $pc $8 = 0x400491 (gdb) And here as well... (gdb) advance foo foo () at foobar.c:4 4 } (gdb) disassemble Dump of assembler code for function foo: 0x00400680 <+0>: jr ra 0x00400682 <+2>: li v0,1 End of assembler dump. (gdb) finish Run till exit from #0 foo () at foobar.c:4 main () at foobar.c:24 24 } Value returned is $9 = 1 (gdb) continue Continuing. [Inferior 1 (process 14103) exited with code 01] (gdb) So let's be a bit inquisitive... (gdb) run Starting program: .../foobar Breakpoint 1, main () at foobar.c:23 23 return foop (); (gdb) Actually we do not like to run foo here at all. Let's run bar instead! (gdb) set foop = bar (gdb) print foop $10 = (int (*)(void)) 0x40068c <bar> (gdb) Hmm, no ISA bit. Is it going to work? (gdb) advance bar bar () at foobar.c:9 9 } (gdb) p/x $pc $11 = 0x40068c (gdb) disassemble Dump of assembler code for function bar: => 0x0040068c <+0>: jr ra 0x0040068e <+2>: li v0,2 End of assembler dump. (gdb) finish Run till exit from #0 bar () at foobar.c:9 Program received signal SIGILL, Illegal instruction. bar () at foobar.c:9 9 } (gdb) Oops! (gdb) p/x $pc $12 = 0x40068c (gdb) We're still there! (gdb) continue Continuing. Program terminated with signal SIGILL, Illegal instruction. The program no longer exists. (gdb) So let's try something else: (gdb) run Starting program: .../foobar Breakpoint 1, main () at foobar.c:23 23 return foop (); (gdb) set foop = foo (gdb) advance foo foo () at foobar.c:4 4 } (gdb) disassemble Dump of assembler code for function foo: => 0x00400680 <+0>: jr ra 0x00400682 <+2>: li v0,1 End of assembler dump. (gdb) finish Run till exit from #0 foo () at foobar.c:4 Program received signal SIGILL, Illegal instruction. foo () at foobar.c:4 4 } (gdb) continue Continuing. Program terminated with signal SIGILL, Illegal instruction. The program no longer exists. (gdb) The same problem! (gdb) run Starting program: /net/build2-lucid-cs/scratch/macro/mips-linux-fsf-gcc/isa-bit/foobar Breakpoint 1, main () at foobar.c:23 23 return foop (); (gdb) set foop = foo32 (gdb) advance foo32 foo32 () at foobar.c:14 14 } (gdb) disassemble Dump of assembler code for function foo32: => 0x00400684 <+0>: jr ra 0x00400688 <+4>: li v0,3 End of assembler dump. (gdb) finish Run till exit from #0 foo32 () at foobar.c:14 main () at foobar.c:24 24 } Value returned is $14 = 3 (gdb) continue Continuing. [Inferior 1 (process 14113) exited with code 03] (gdb) That did work though, so it's the ISA bit only! (gdb) quit Enough! That's the tip of the iceberg only though. So let's rebuild the executable with some dynamic symbols: $ mips-linux-gnu-gcc -mips16 -Wl,--export-dynamic -g -O2 -o foobar-dyn foobar.c $ mips-linux-gnu-readelf -s foobar-dyn | egrep 'table|foo|bar' Symbol table '.dynsym' contains 32 entries: 6: 004009cd 4 FUNC GLOBAL DEFAULT 12 bar 8: 00410b88 4 OBJECT GLOBAL DEFAULT 21 foo32p 9: 00410b84 4 OBJECT GLOBAL DEFAULT 21 foop 15: 004009c4 8 FUNC GLOBAL DEFAULT 12 foo32 17: 004009c1 4 FUNC GLOBAL DEFAULT 12 foo 25: 00410b80 4 OBJECT GLOBAL DEFAULT 21 fooi Symbol table '.symtab' contains 95 entries: 55: 00000000 0 FILE LOCAL DEFAULT ABS foobar.c 69: 004009cd 4 FUNC GLOBAL DEFAULT 12 bar 71: 00410b88 4 OBJECT GLOBAL DEFAULT 21 foo32p 72: 00410b84 4 OBJECT GLOBAL DEFAULT 21 foop 79: 004009c4 8 FUNC GLOBAL DEFAULT 12 foo32 81: 004009c1 4 FUNC GLOBAL DEFAULT 12 foo 89: 00410b80 4 OBJECT GLOBAL DEFAULT 21 fooi $ OK, now the ISA bit is there for a change, but the MIPS16 `st_other' attribute gone, hmm... What does `objdump' do then: $ mips-linux-gnu-objdump -Tt foobar-dyn | egrep 'SYMBOL|foo|bar' foobar-dyn: file format elf32-tradbigmips SYMBOL TABLE: 00000000 l df *ABS* 00000000 foobar.c 004009cc g F .text 00000004 0xf0 bar 00410b88 g O .data 00000004 foo32p 00410b84 g O .data 00000004 foop 004009c4 g F .text 00000008 foo32 004009c0 g F .text 00000004 0xf0 foo 00410b80 g O .data 00000004 fooi DYNAMIC SYMBOL TABLE: 004009cc g DF .text 00000004 Base 0xf0 bar 00410b88 g DO .data 00000004 Base foo32p 00410b84 g DO .data 00000004 Base foop 004009c4 g DF .text 00000008 Base foo32 004009c0 g DF .text 00000004 Base 0xf0 foo 00410b80 g DO .data 00000004 Base fooi $ Hmm, the attribute (0xf0, printed raw) is back, and the ISA bit gone again. Let's have a look at some DWARF-2 records GDB uses (I'll be stripping off a lot here for brevity) -- debug info: $ mips-linux-gnu-readelf -wi foobar Contents of the .debug_info section: [...] Compilation Unit @ offset 0x88: Length: 0xbb (32-bit) Version: 4 Abbrev Offset: 62 Pointer Size: 4 <0><93>: Abbrev Number: 1 (DW_TAG_compile_unit) <94> DW_AT_producer : (indirect string, offset: 0x19e): GNU C 4.8.0 20120513 (experimental) -meb -mips16 -march=mips32r2 -mhard-float -mllsc -mplt -mno-synci -mno-shared -mabi=32 -g -O2 <98> DW_AT_language : 1 (ANSI C) <99> DW_AT_name : (indirect string, offset: 0x190): foobar.c <9d> DW_AT_comp_dir : (indirect string, offset: 0x225): [...] <a1> DW_AT_ranges : 0x0 <a5> DW_AT_low_pc : 0x0 <a9> DW_AT_stmt_list : 0x27 <1><ad>: Abbrev Number: 2 (DW_TAG_subprogram) <ae> DW_AT_external : 1 <ae> DW_AT_name : foo <b2> DW_AT_decl_file : 1 <b3> DW_AT_decl_line : 1 <b4> DW_AT_prototyped : 1 <b4> DW_AT_type : <0xc2> <b8> DW_AT_low_pc : 0x400680 <bc> DW_AT_high_pc : 0x400684 <c0> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <c2> DW_AT_GNU_all_call_sites: 1 <1><c2>: Abbrev Number: 3 (DW_TAG_base_type) <c3> DW_AT_byte_size : 4 <c4> DW_AT_encoding : 5 (signed) <c5> DW_AT_name : int <1><c9>: Abbrev Number: 4 (DW_TAG_subprogram) <ca> DW_AT_external : 1 <ca> DW_AT_name : (indirect string, offset: 0x18a): foo32 <ce> DW_AT_decl_file : 1 <cf> DW_AT_decl_line : 11 <d0> DW_AT_prototyped : 1 <d0> DW_AT_type : <0xc2> <d4> DW_AT_low_pc : 0x400684 <d8> DW_AT_high_pc : 0x40068c <dc> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <de> DW_AT_GNU_all_call_sites: 1 <1><de>: Abbrev Number: 2 (DW_TAG_subprogram) <df> DW_AT_external : 1 <df> DW_AT_name : bar <e3> DW_AT_decl_file : 1 <e4> DW_AT_decl_line : 6 <e5> DW_AT_prototyped : 1 <e5> DW_AT_type : <0xc2> <e9> DW_AT_low_pc : 0x40068c <ed> DW_AT_high_pc : 0x400690 <f1> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <f3> DW_AT_GNU_all_call_sites: 1 <1><f3>: Abbrev Number: 5 (DW_TAG_subprogram) <f4> DW_AT_external : 1 <f4> DW_AT_name : (indirect string, offset: 0x199): main <f8> DW_AT_decl_file : 1 <f9> DW_AT_decl_line : 21 <fa> DW_AT_prototyped : 1 <fa> DW_AT_type : <0xc2> <fe> DW_AT_low_pc : 0x400490 <102> DW_AT_high_pc : 0x4004a4 <106> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <108> DW_AT_GNU_all_tail_call_sites: 1 [...] $ -- no sign of the ISA bit anywhere -- frame info: $ mips-linux-gnu-readelf -wf foobar [...] Contents of the .debug_frame section: 00000000 0000000c ffffffff CIE Version: 1 Augmentation: "" Code alignment factor: 1 Data alignment factor: -4 Return address column: 31 DW_CFA_def_cfa_register: r29 DW_CFA_nop 00000010 0000000c 00000000 FDE cie=00000000 pc=00400680..00400684 00000020 0000000c 00000000 FDE cie=00000000 pc=00400684..0040068c 00000030 0000000c 00000000 FDE cie=00000000 pc=0040068c..00400690 00000040 00000018 00000000 FDE cie=00000000 pc=00400490..004004a4 DW_CFA_advance_loc: 6 to 00400496 DW_CFA_def_cfa_offset: 32 DW_CFA_offset: r31 at cfa-4 DW_CFA_advance_loc: 6 to 0040049c DW_CFA_restore: r31 DW_CFA_def_cfa_offset: 0 DW_CFA_nop DW_CFA_nop DW_CFA_nop [...] $ -- no sign of the ISA bit anywhere -- range info (GDB doesn't use arange): $ mips-linux-gnu-readelf -wR foobar Contents of the .debug_ranges section: Offset Begin End 00000000 00400680 00400690 00000000 00400490 004004a4 00000000 <End of list> $ -- no sign of the ISA bit anywhere -- line info: $ mips-linux-gnu-readelf -wl foobar Raw dump of debug contents of section .debug_line: [...] Offset: 0x27 Length: 78 DWARF Version: 2 Prologue Length: 31 Minimum Instruction Length: 1 Initial value of 'is_stmt': 1 Line Base: -5 Line Range: 14 Opcode Base: 13 Opcodes: Opcode 1 has 0 args Opcode 2 has 1 args Opcode 3 has 1 args Opcode 4 has 1 args Opcode 5 has 1 args Opcode 6 has 0 args Opcode 7 has 0 args Opcode 8 has 0 args Opcode 9 has 1 args Opcode 10 has 0 args Opcode 11 has 0 args Opcode 12 has 1 args The Directory Table is empty. The File Name Table: Entry Dir Time Size Name 1 0 0 0 foobar.c Line Number Statements: Extended opcode 2: set Address to 0x400681 Special opcode 6: advance Address by 0 to 0x400681 and Line by 1 to 2 Special opcode 7: advance Address by 0 to 0x400681 and Line by 2 to 4 Special opcode 55: advance Address by 3 to 0x400684 and Line by 8 to 12 Special opcode 7: advance Address by 0 to 0x400684 and Line by 2 to 14 Advance Line by -7 to 7 Special opcode 131: advance Address by 9 to 0x40068d and Line by 0 to 7 Special opcode 7: advance Address by 0 to 0x40068d and Line by 2 to 9 Advance PC by 3 to 0x400690 Extended opcode 1: End of Sequence Extended opcode 2: set Address to 0x400491 Advance Line by 21 to 22 Copy Special opcode 6: advance Address by 0 to 0x400491 and Line by 1 to 23 Special opcode 60: advance Address by 4 to 0x400495 and Line by -1 to 22 Special opcode 34: advance Address by 2 to 0x400497 and Line by 1 to 23 Special opcode 62: advance Address by 4 to 0x40049b and Line by 1 to 24 Special opcode 32: advance Address by 2 to 0x40049d and Line by -1 to 23 Special opcode 6: advance Address by 0 to 0x40049d and Line by 1 to 24 Advance PC by 7 to 0x4004a4 Extended opcode 1: End of Sequence [...] -- a-ha, the ISA bit is there! However it's not always right for some reason, I don't have a small test case to show it, but here's an excerpt from MIPS16 libc, a prologue of a function: 00019630 <__libc_init_first>: 19630: e8a0 jrc ra 19632: 6500 nop 00019634 <_init>: 19634: f000 6a11 li v0,17 19638: f7d8 0b08 la v1,15e00 <_DYNAMIC+0x15c54> 1963c: f400 3240 sll v0,16 19640: e269 addu v0,v1 19642: 659a move gp,v0 19644: 64f6 save 48,ra,s0-s1 19646: 671c move s0,gp 19648: d204 sw v0,16(sp) 1964a: f352 984c lw v0,-27828(s0) 1964e: 6724 move s1,a0 and the corresponding DWARF-2 line info: Line Number Statements: Extended opcode 2: set Address to 0x19631 Advance Line by 44 to 45 Copy Special opcode 8: advance Address by 0 to 0x19631 and Line by 3 to 48 Special opcode 66: advance Address by 4 to 0x19635 and Line by 5 to 53 Advance PC by constant 17 to 0x19646 Special opcode 25: advance Address by 1 to 0x19647 and Line by 6 to 59 Advance Line by -6 to 53 Special opcode 33: advance Address by 2 to 0x19649 and Line by 0 to 53 Special opcode 39: advance Address by 2 to 0x1964b and Line by 6 to 59 Advance Line by -6 to 53 Special opcode 61: advance Address by 4 to 0x1964f and Line by 0 to 53 -- see that "Advance PC by constant 17" there? It clears the ISA bit, however code at 0x19646 is not standard MIPS code at all. For some reason the constant is always 17, I've never seen DW_LNS_const_add_pc used with any other value -- is that a binutils bug or what? 3. Solution: I think we should retain the value of the ISA bit in code references, that is effectively treat them as cookies as they indeed are (although trivially calculated) rather than raw memory byte addresses. In a perfect world both the static symbol table and the respective DWARF-2 records should be fixed to include the ISA bit in all the cases. I think however that this is infeasible. All the uses of `_bfd_mips_elf_symbol_processing' can not necessarily be tracked down. This function is used by `elf_slurp_symbol_table' that in turn is used by `bfd_canonicalize_symtab' and `bfd_canonicalize_dynamic_symtab', which are public interfaces. Similarly DWARF-2 records are used outside GDB, one notable if a bit questionable is the exception unwinder (libgcc/unwind-dw2.c) -- I have identified at least bits in `execute_cfa_program' and `uw_frame_state_for', both around the calls to `_Unwind_IsSignalFrame', that would need an update as they effectively flip the ISA bit freely; see also the comment about MASK_RETURN_ADDR in gcc/config/mips/mips.h. But there may be more places. Any change in how DWARF-2 records are produced would require an update there and would cause compatibility problems with libgcc.a binaries already distributed; given that this is a static library a complex change involving function renames would likely be required. I propose therefore to accept the existing inconsistencies and deal with them entirely within GDB. I have figured out that the ISA bit lost in various places can still be recovered as long as we have symbol information -- that'll have the `st_other' attribute correctly set to one of standard MIPS/MIPS16/microMIPS encoding. Here's the resulting change. It adds a couple of new `gdbarch' hooks, one to update symbol information with the ISA bit lost in `_bfd_mips_elf_symbol_processing', and two other ones to adjust DWARF-2 records as they're processed. The ISA bit is set in each address handled according to information retrieved from the symbol table for the symbol spanning the address if any; limits are adjusted based on the address they point to related to the respective base address. Additionally minimal symbol information has to be adjusted accordingly in its gdbarch hook. With these changes in place some complications with ISA bit juggling in the PC that never fully worked can be removed from the MIPS backend. Conversely, the generic dynamic linker event special breakpoint symbol handler has to be updated to call the minimal symbol gdbarch hook to record that the symbol is a MIPS16 or microMIPS address if applicable or the breakpoint will be set at the wrong address and either fail to work or cause SIGTRAPs (this is because the symbol is handled early on and bypasses regular symbol processing). 4. Results obtained The change fixes the example above -- to repeat only the crucial steps: (gdb) break main Breakpoint 1 at 0x400491: file foobar.c, line 23. (gdb) run Starting program: .../foobar Breakpoint 1, main () at foobar.c:23 23 return foop (); (gdb) print foo $1 = {int (void)} 0x400681 <foo> (gdb) set foop = bar (gdb) advance bar bar () at foobar.c:9 9 } (gdb) disassemble Dump of assembler code for function bar: => 0x0040068d <+0>: jr ra 0x0040068f <+2>: li v0,2 End of assembler dump. (gdb) finish Run till exit from #0 bar () at foobar.c:9 main () at foobar.c:24 24 } Value returned is $2 = 2 (gdb) continue Continuing. [Inferior 1 (process 14128) exited with code 02] (gdb) -- excellent! The change removes about 90 failures per MIPS16 multilib in mips-sde-elf testing too, results for MIPS16 are now similar to that for standard MIPS; microMIPS results are a bit worse because of host-I/O problems in QEMU used instead of MIPSsim for microMIPS testing only: === gdb Summary === # of expected passes 14299 # of unexpected failures 187 # of expected failures 56 # of known failures 58 # of unresolved testcases 11 # of untested testcases 52 # of unsupported tests 174 MIPS16: === gdb Summary === # of expected passes 14298 # of unexpected failures 187 # of unexpected successes 2 # of expected failures 54 # of known failures 58 # of unresolved testcases 12 # of untested testcases 52 # of unsupported tests 174 microMIPS: === gdb Summary === # of expected passes 14149 # of unexpected failures 201 # of unexpected successes 2 # of expected failures 54 # of known failures 58 # of unresolved testcases 7 # of untested testcases 53 # of unsupported tests 175 2014-12-12 Maciej W. Rozycki <macro@codesourcery.com> Maciej W. Rozycki <macro@mips.com> Pedro Alves <pedro@codesourcery.com> gdb/ * gdbarch.sh (elf_make_msymbol_special): Change type to `F', remove `predefault' and `invalid_p' initializers. (make_symbol_special): New architecture method. (adjust_dwarf2_addr, adjust_dwarf2_line): Likewise. (objfile, symbol): New declarations. * arch-utils.h (default_elf_make_msymbol_special): Remove prototype. (default_make_symbol_special): New prototype. (default_adjust_dwarf2_addr): Likewise. (default_adjust_dwarf2_line): Likewise. * mips-tdep.h (mips_unmake_compact_addr): New prototype. * arch-utils.c (default_elf_make_msymbol_special): Remove function. (default_make_symbol_special): New function. (default_adjust_dwarf2_addr): Likewise. (default_adjust_dwarf2_line): Likewise. * dwarf2-frame.c (decode_frame_entry_1): Call `gdbarch_adjust_dwarf2_addr'. * dwarf2loc.c (dwarf2_find_location_expression): Likewise. * dwarf2read.c (create_addrmap_from_index): Likewise. (process_psymtab_comp_unit_reader): Likewise. (add_partial_symbol): Likewise. (add_partial_subprogram): Likewise. (process_full_comp_unit): Likewise. (read_file_scope): Likewise. (read_func_scope): Likewise. Call `gdbarch_make_symbol_special'. (read_lexical_block_scope): Call `gdbarch_adjust_dwarf2_addr'. (read_call_site_scope): Likewise. (dwarf2_ranges_read): Likewise. (dwarf2_record_block_ranges): Likewise. (read_attribute_value): Likewise. (dwarf_decode_lines_1): Call `gdbarch_adjust_dwarf2_line'. (new_symbol_full): Call `gdbarch_adjust_dwarf2_addr'. * elfread.c (elf_symtab_read): Don't call `gdbarch_elf_make_msymbol_special' if unset. * mips-linux-tdep.c (micromips_linux_sigframe_validate): Strip the ISA bit from the PC. * mips-tdep.c (mips_unmake_compact_addr): New function. (mips_elf_make_msymbol_special): Set the ISA bit in the symbol's address appropriately. (mips_make_symbol_special): New function. (mips_pc_is_mips): Set the ISA bit before symbol lookup. (mips_pc_is_mips16): Likewise. (mips_pc_is_micromips): Likewise. (mips_pc_isa): Likewise. (mips_adjust_dwarf2_addr): New function. (mips_adjust_dwarf2_line): Likewise. (mips_read_pc, mips_unwind_pc): Keep the ISA bit. (mips_addr_bits_remove): Likewise. (mips_skip_trampoline_code): Likewise. (mips_write_pc): Don't set the ISA bit. (mips_eabi_push_dummy_call): Likewise. (mips_o64_push_dummy_call): Likewise. (mips_gdbarch_init): Install `mips_make_symbol_special', `mips_adjust_dwarf2_addr' and `mips_adjust_dwarf2_line' gdbarch handlers. * solib.c (gdb_bfd_lookup_symbol_from_symtab): Get target-specific symbol address adjustments. * gdbarch.h: Regenerate. * gdbarch.c: Regenerate. 2014-12-12 Maciej W. Rozycki <macro@codesourcery.com> gdb/testsuite/ * gdb.base/func-ptrs.c: New file. * gdb.base/func-ptrs.exp: New file.
2014-12-12 14:31:53 +01:00
2014-12-12 Maciej W. Rozycki <macro@codesourcery.com>
Maciej W. Rozycki <macro@mips.com>
Pedro Alves <pedro@codesourcery.com>
* gdbarch.sh (elf_make_msymbol_special): Change type to `F',
remove `predefault' and `invalid_p' initializers.
(make_symbol_special): New architecture method.
(adjust_dwarf2_addr, adjust_dwarf2_line): Likewise.
(objfile, symbol): New declarations.
* arch-utils.h (default_elf_make_msymbol_special): Remove
prototype.
(default_make_symbol_special): New prototype.
(default_adjust_dwarf2_addr): Likewise.
(default_adjust_dwarf2_line): Likewise.
* mips-tdep.h (mips_unmake_compact_addr): New prototype.
* arch-utils.c (default_elf_make_msymbol_special): Remove
function.
(default_make_symbol_special): New function.
(default_adjust_dwarf2_addr): Likewise.
(default_adjust_dwarf2_line): Likewise.
* dwarf2-frame.c (decode_frame_entry_1): Call
`gdbarch_adjust_dwarf2_addr'.
* dwarf2loc.c (dwarf2_find_location_expression): Likewise.
* dwarf2read.c (create_addrmap_from_index): Likewise.
(process_psymtab_comp_unit_reader): Likewise.
(add_partial_symbol): Likewise.
(add_partial_subprogram): Likewise.
(process_full_comp_unit): Likewise.
(read_file_scope): Likewise.
(read_func_scope): Likewise. Call `gdbarch_make_symbol_special'.
(read_lexical_block_scope): Call `gdbarch_adjust_dwarf2_addr'.
(read_call_site_scope): Likewise.
(dwarf2_ranges_read): Likewise.
(dwarf2_record_block_ranges): Likewise.
(read_attribute_value): Likewise.
(dwarf_decode_lines_1): Call `gdbarch_adjust_dwarf2_line'.
(new_symbol_full): Call `gdbarch_adjust_dwarf2_addr'.
* elfread.c (elf_symtab_read): Don't call
`gdbarch_elf_make_msymbol_special' if unset.
* mips-linux-tdep.c (micromips_linux_sigframe_validate): Strip
the ISA bit from the PC.
* mips-tdep.c (mips_unmake_compact_addr): New function.
(mips_elf_make_msymbol_special): Set the ISA bit in the symbol's
address appropriately.
(mips_make_symbol_special): New function.
(mips_pc_is_mips): Set the ISA bit before symbol lookup.
(mips_pc_is_mips16): Likewise.
(mips_pc_is_micromips): Likewise.
(mips_pc_isa): Likewise.
(mips_adjust_dwarf2_addr): New function.
(mips_adjust_dwarf2_line): Likewise.
(mips_read_pc, mips_unwind_pc): Keep the ISA bit.
(mips_addr_bits_remove): Likewise.
(mips_skip_trampoline_code): Likewise.
(mips_write_pc): Don't set the ISA bit.
(mips_eabi_push_dummy_call): Likewise.
(mips_o64_push_dummy_call): Likewise.
(mips_gdbarch_init): Install `mips_make_symbol_special',
`mips_adjust_dwarf2_addr' and `mips_adjust_dwarf2_line' gdbarch
handlers.
* solib.c (gdb_bfd_lookup_symbol_from_symtab): Get
target-specific symbol address adjustments.
* gdbarch.h: Regenerate.
* gdbarch.c: Regenerate.
Improve arm_skip_prologue by using arm_analyze_prologue Hi, I see many fails in dw2-dir-file-name.exp on arm target when test case is compiled with -marm, however, these fails are disappeared when test case is compiled with -mthumb. The difference of pass and fail shown below is that "0x000085d4 in" isn't printed out, but test case expects to see it. -Breakpoint 2, compdir_missing__ldir_missing__file_basename () at tmp-dw2-dir-file-name.c:999^M -(gdb) FAIL: gdb.dwarf2/dw2-dir-file-name.exp: compdir_missing__ldir_missing__file_basename: continue to breakpoint: compdir_missing__ldir_missing__file_basename +Breakpoint 2, 0x000085d4 in compdir_missing__ldir_missing__file_basename () at tmp-dw2-dir-file-name.c:999^M +(gdb) PASS: gdb.dwarf2/dw2-dir-file-name.exp: compdir_missing__ldir_missing__file_basename: continue to breakpoint: compdir_missing__ldir_missing__file_basename This difference is caused by setting breakpoint at the first instruction in the function (actually, the first instruction in prologue, at [1]), so that frame_show_address returns false, and print_frame doesn't print the address. 0x00008620 <+0>: push {r11} ; (str r11, [sp, #-4]!) <--[1] 0x00008624 <+4>: add r11, sp, #0 0x00008628 <+8>: ldr r3, [pc, #24] ; 0x8648 <compdir_missing__ldir_missing__file_basename+40> 0x0000862c <+12>: ldr r3, [r3] 0x00008630 <+16>: add r3, r3, #1 0x00008634 <+20>: ldr r2, [pc, #12] ; 0x8648 <compdir_missing__ldir_missing__file_basename+40> Then, it must be the arm_skip_prologue's fault that unable to skip instructions in prologue. At the end of arm_skip_prologue, it matches several instructions, such as "str r(0123),[r11,#-nn]" and "str r(0123),[sp,#nn]", but "push {r11}" isn't handled. These instruction matching code in arm_skip_prologue, which can be regarded as leftover of development for many years, should be merged to arm_analyze_prologue and use arm_analyze_prologue in arm_skip_prologue. Here is the something like the history of arm_{skip,scan,analyze}_prologue. Around 2002, there are arm_skip_prologue and arm_scan_prologue, but code are duplicated to some extent. When match an instruction, both functions should be modified, for example in Michael Snyder's patch https://sourceware.org/ml/gdb-patches/2002-05/msg00205.html and Michael expressed the willingness to merge both into one. Daniel added code call thumb_analyze_prologue in arm_skip_prologue in 2006, but didn't handle its counterpart arm_analyze_prologue, which is added in 2010 <https://sourceware.org/ml/gdb-patches/2010-03/msg00820.html> however, the instructions matching at the bottom of arm_skip_prologue wasn't cleaned up. This patch is to merge them into arm_analyze_prologue. gdb: 2014-12-12 Yao Qi <yao@codesourcery.com> PR tdep/14261 * arm-tdep.c (arm_skip_prologue): Remove unused local variable 'skip_pc'. Remove code skipping prologue instructions, use arm_analyze_prologue instead. (arm_analyze_prologue): Stop the scanning for unrecognized instruction when skipping prologue.
2014-11-27 04:37:54 +01:00
2014-12-12 Yao Qi <yao@codesourcery.com>
PR tdep/14261
* arm-tdep.c (arm_skip_prologue): Remove unused local variable
'skip_pc'. Remove code skipping prologue instructions, use
arm_analyze_prologue instead.
(arm_analyze_prologue): Stop the scanning for unrecognized
instruction when skipping prologue.
2014-12-12 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_instruction_restores_sp): New function.
(arm_analyze_prologue): Call arm_instruction_restores_sp.
(arm_in_function_epilogue_p): Move code to
arm_instruction_restores_sp.
2014-12-11 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (cp_lookup_nested_symbol): Fix comments.
2014-12-11 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_symbol_in_objfile_symtabs): Delete forward decl.
(symbol *lookup_symbol_via_quick_fns): Ditto.
(lookup_symbol_in_objfile): Add forward decl.
(lookup_global_symbol_from_objfile): Simplify, call
lookup_symbol_in_objfile.
2014-12-11 Doug Evans <xdje42@gmail.com>
* symtab.c (domain_name) <MODULE_DOMAIN>: Add missing case.
Only leave dprintf inserted if it is marked as persistent (PR breakpoints/17012) On Linux native, if dprintfs are inserted when detaching, they are left in the inferior which causes it to crash from a SIGTRAP. It also happens with dprintfs on remote targets, when set disconnected-dprintf is off. The rationale of the line modified by the patch was to leave dprintfs inserted in order to support disconnected dprintfs. However, not all dprintfs are persistent. Also, there's no reason other kinds of breakpoints can't be persistent either. So this replaces the bp_dprintf check with a check on whether the location is persistent. bl->target_info.persist will be 1 only if disconnected-dprintf is on and we are debugging a remote target. On native, it will always be 0, regardless of the value of disconnected-dprintf. This makes sense, since disconnected dprintfs are not supported by the native target. One issue about the test is that it does not pass when using --target_board=native-extended-gdbserver, partly due to bug 17302 [1]. One quick hack I tried for this was to add a useless "next" between the call to getpid() and detach, which avoids the bug. There is still one case where the test fails, and that is with: - breakpoint always-inserted on - dprintf-style agent - disconnected-dprintf on What happens is that my detach does not actually detach the process, because some persistent commands (the disconnected dprintf) is present. However since gdbserver is ran with --once, when gdb disconnects, gdbserver goes down and takes with it all the processes it spawned and that are still under its control (which includes my test process). When the test checks if the test process is still alive, it obvisouly fails. Investigating about that led me to ask a question on the ML [2] about the behavior of detach. Until the remote case is sorted out, the problematic test is marked as KFAIL. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=17302 [2] https://sourceware.org/ml/gdb/2014-08/msg00115.html gdb/Changelog: PR breakpoints/17012 * breakpoint.c (remove_breakpoints_pid): Skip removing breakpoint if it is marked as persistent. gdb/testsuite/ChangeLog: PR breakpoints/17012 * gdb.base/dprintf-detach.c: New file. * gdb.base/dprintf-detach.exp: New file.
2014-12-10 22:10:05 +01:00
2014-12-10 Simon Marchi <simon.marchi@ericsson.com>
PR breakpoints/17012
* breakpoint.c (remove_breakpoints_pid): Skip removing breakpoint if
it is marked as persistent.
2014-12-10 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (cp_lookup_symbol_nonlocal): Move definition,
closer to its subroutines.
2014-12-10 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (lookup_symbol_file): Move next to only caller.
2014-12-10 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (cp_lookup_symbol_imports): Make static.
2014-12-18 09:52:40 +01:00
* cp-support.h (cp_lookup_symbol_imports): Delete.
2014-12-10 Simon Marchi <simon.marchi@ericsson.com>
PR gdb/17627
* target.c (cleanup_restore_target_terminal): New function.
(make_cleanup_restore_target_terminal): New function.
* target.h (make_cleanup_restore_target_terminal): New declaration.
* mi/mi-interp.c (mi_thread_exit): Use the new cleanup.
2014-12-08 Doug Evans <dje@google.com>
* python/py-objfile.c (objfpy_get_owner): Increment refcount of result.
2014-12-08 Doug Evans <dje@google.com>
* NEWS: Mention gdb.Objfile.owner.
* python/py-objfile.c (objfpy_get_owner): New function.
(objfile_getset): Add "owner".
2014-12-05 Jan Kratochvil <jan.kratochvil@redhat.com>
* symtab.c (lookup_symbol_in_objfile_symtabs): New declaration.
(lookup_global_symbol_from_objfile): Call it.
2014-12-05 Jan Kratochvil <jan.kratochvil@redhat.com>
Remove const from struct objfile *.
* solib-darwin.c, solib-spu.c, solib-svr4.c, solib.c, solist.h,
symtab.c, symtab.h: In these files.
2014-12-05 Andreas From <andreas.from@ericsson.com>
* MAINTAINERS (Write After Approval): Add "Andreas From"
2014-12-05 Doug Evans <xdje42@gmail.com>
Revert:
PR symtab/17602
* linespec.c (iterate_name_matcher): Fix arguments to symbol_name_cmp.
2014-12-04 Doug Evans <dje@google.com>
* NEWS: Mention gdb.Objfile.add_separate_debug_file.
* python/py-objfile.c (objfpy_add_separate_debug_file): New function.
(objfile_getset): Add "add_separate_debug_file".
2014-12-04 Doug Evans <dje@google.com>
* NEWS: Mention gdb.Objfile.build_id.
* build-id.c (build_id_bfd_get): Make non-static.
* build-id.h (build_id_bfd_get): Add declaration.
* python/py-objfile.c: #include "build-id.h", "elf-bfd.h".
(OBJFPY_REQUIRE_VALID): New macro.
(objfpy_get_build_id): New function.
(objfile_getset): Add "build_id".
* utils.c (make_hex_string): New function.
* utils.h (make_hex_string): Add declaration.
Accelerate lookup_symbol_aux_objfile 85x During debugging I get 10-30 seconds for a response to simple commands like: (gdb) print vectorvar.size() With this patch the performance gets to 1-2 seconds which is somehow acceptable. The problem is that dwarf2_gdb_index_functions.lookup_symbol (quick_symbol_functions::lookup_symbol) may return (and returns) NULL even for symbols which are present in .gdb_index but which can be found in already expanded symtab. But searching in the already expanded symtabs is just too slow when there are 400000+ expanded symtabs. There would be needed some single global hash table for each objfile so that one does not have to iterate all symtabs. Which .gdb_index could perfectly serve for, just its lookup_symbol() would need to return authoritative yes/no answers. Even after such fix these two simple patches are useful for example for non-.gdb_index files. One can reproduce the slugging interactive GDB performance with: #include <string> using namespace std; string var; class C { public: void m() {} }; int main() { C c; c.m(); return 0; } g++ -o slow slow.C -Wall -g $(pkg-config --libs gtkmm-3.0) gdb ./slow -ex 'b C::m' -ex 'maintenance set per-command space' -ex 'maintenance set per-command symtab' -ex 'maintenance set per-command time' -ex r [...] (gdb) p <tab><tab> Display all 183904 possibilities? (y or n) n (gdb) p/r var $1 = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x3a4db073d8 <std::string::_Rep::_S_empty_rep_storage+24> ""}} Command execution time: 20.023000 (cpu), 20.118665 (wall) ^^^^^^^^^ Space used: 927997952 (+0 for this command) Without DWZ there are X global blocks for X primary symtabs for X CUs of objfile. With DWZ there are X+Y global blocks for X+Y primary symtabs for X+Y CUs where Y are 'DW_TAG_partial_unit's. For 'DW_TAG_partial_unit's (Ys) their blockvector is usually empty. But not always, I have found there typedef symbols, there can IMO be optimized-out static variables etc. Neither of the patches should cause any visible behavior change. gdb/ChangeLog 2014-12-04 Jan Kratochvil <jan.kratochvil@redhat.com> * block.c (block_lookup_symbol_primary): New function. * block.h (block_lookup_symbol_primary): New declaration. * symtab.c (lookup_symbol_in_objfile_symtabs): Assert BLOCK_INDEX. Call block_lookup_symbol_primary.
2014-12-04 08:26:26 +01:00
2014-12-04 Jan Kratochvil <jan.kratochvil@redhat.com>
* block.c (block_lookup_symbol_primary): New function.
* block.h (block_lookup_symbol_primary): New declaration.
* symtab.c (lookup_symbol_in_objfile_symtabs): Assert BLOCK_INDEX.
Call block_lookup_symbol_primary.
MIPS: Add support for microMIPS Linux signal trampolines The necessity for this change has been revealed in the course of investigation related to proposed changes in the treatment of the ISA bit encoded in function symbols on the MIPS target. This change adds support for Linux signal trampolines encoded with the microMIPS instruction set. Such trampolines are used by the Linux kernel if compiled as a microMIPS binary (even if the binary run/debugged itself contains no microMIPS code at all). To see if we need to check whether the execution mode selected matches the given trampoline I have checked what the bit patterns of all the trampoline sequences decode to in the opposite instruction set. This produced useless or at least unusual code in most cases, for example: microMIPS/EB, o32 sigreturn, decoded as MIPS code: 30401017 andi zero,v0,0x1017 00008b7c dsll32 s1,zero,0xd MIPS/EL, o32 sigreturn, decoded as microMIPS code: 1017 2402 addi zero,s7,9218 000c 0000 sll zero,t0,0x0 However in some corner cases reasonable code can mimic a trampoline, for example: MIPS/EB, n32 rt_sigreturn, decoded as microMIPS code: 2402 sll s0,s0,1 1843 0000 sb v0,0(v1) 000c 0f3c jr t0 -- here the first instruction is a 16-bit one, making things nastier even as there are some other microMIPS instructions whose first 16-bit halfword is 0x000c and therefore matches this whole trampoline pattern. To overcome this problem I have decided the signal trampoline unwinder has to ask the platform backend whether it can apply a given trampoline pattern to the code location being concerned or not. Anticipating the acceptance of the ISA bit proposal I decided the handler not to merely be a predicate, but also to be able to provide an adjusted PC if required. I decided that returning zero will mean that the trampoline pattern is not applicable and any other value is the adjusted PC to use; a handler may return the value requested if the trampoline pattern and the PC requested as-is are both accepted. This changes the semantics of the trampoline unwinder a bit in that the zero PC now has a special value. I think this should be safe as a NULL pointer is generally supposed to be invalid. * tramp-frame.h (tramp_frame): Add `validate' member. * tramp-frame.c (tramp_frame_start): Validate trampoline before scanning. * mips-linux-tdep.c (MICROMIPS_INST_LI_V0): New macro. (MICROMIPS_INST_POOL32A, MICROMIPS_INST_SYSCALL): Likewise. (mips_linux_o32_sigframe): Initialize `validate' member. (mips_linux_o32_rt_sigframe): Likewise. (mips_linux_n32_rt_sigframe): Likewise. (mips_linux_n64_rt_sigframe): Likewise. (micromips_linux_o32_sigframe): New variable. (micromips_linux_o32_rt_sigframe): Likewise. (micromips_linux_n32_rt_sigframe): Likewise. (micromips_linux_n64_rt_sigframe): Likewise. (mips_linux_o32_sigframe_init): Handle microMIPS trampolines. (mips_linux_n32n64_sigframe_init): Likewise. (mips_linux_sigframe_validate): New function. (micromips_linux_sigframe_validate): Likewise. (mips_linux_init_abi): Install microMIPS trampoline unwinders.
2014-12-03 20:19:41 +01:00
2014-12-03 Maciej W. Rozycki <macro@codesourcery.com>
* tramp-frame.h (tramp_frame): Add `validate' member.
* tramp-frame.c (tramp_frame_start): Validate trampoline before
scanning.
* mips-linux-tdep.c (MICROMIPS_INST_LI_V0): New macro.
(MICROMIPS_INST_POOL32A, MICROMIPS_INST_SYSCALL): Likewise.
(mips_linux_o32_sigframe): Initialize `validate' member.
(mips_linux_o32_rt_sigframe): Likewise.
(mips_linux_n32_rt_sigframe): Likewise.
(mips_linux_n64_rt_sigframe): Likewise.
(micromips_linux_o32_sigframe): New variable.
(micromips_linux_o32_rt_sigframe): Likewise.
(micromips_linux_n32_rt_sigframe): Likewise.
(micromips_linux_n64_rt_sigframe): Likewise.
(mips_linux_o32_sigframe_init): Handle microMIPS trampolines.
(mips_linux_n32n64_sigframe_init): Likewise.
(mips_linux_sigframe_validate): New function.
(micromips_linux_sigframe_validate): Likewise.
(mips_linux_init_abi): Install microMIPS trampoline unwinders.
2014-12-03 Ulrich Weigand  <uweigand@de.ibm.com>
* config/sparc/sol2.mh (NATDEPFILES): Remove core-regset.o.
* sparc-sol2-tdep.c: Include "regset.h".
(sparc32_sol2_supply_core_gregset): New function.
(sparc32_sol2_collect_core_gregset): Likewise.
(sparc32_sol2_supply_core_fpregset): Likewise.
(sparc32_sol2_collect_core_fpregset): Likewise.
(sparc32_sol2_gregset, sparc32_sol2_fpregset): New variables.
(sparc32_sol2_init_abi): Set tdep->gregset/sizeof_gregset and
tdep->fpregset/sizeof_fpregset.
* sparc64-sol2-tdep.c: Include "regset.h".
(sparc64_sol2_supply_core_gregset): New function.
(sparc64_sol2_collect_core_gregset): Likewise.
(sparc64_sol2_supply_core_fpregset): Likewise.
(sparc64_sol2_collect_core_fpregset): Likewise.
(sparc64_sol2_gregset, sparc64_sol2_fpregset): New variables.
(sparc64_sol2_init_abi): Set tdep->gregset/sizeof_gregset and
tdep->fpregset/sizeof_fpregset.
2014-12-03 Simon Marchi <simon.marchi@ericsson.com>
* common/cleanups.c (make_cleanup_dtor): Use typedef for dtor
type.
Remove cplus_specific from general_symbol_info. This patch reverts the addition of cplus_specific added here: 2010-07-16 Sami Wagiaalla <swagiaal@redhat.com> * symtab.h (symbol_set_demangled_name): Now takes an optional objfile* argument. (cplus_specific): New struct. * symtab.c (symbol_set_demangled_name): Updated. Use cplus_specific for cplus symbols. (symbol_get_demangled_name): Retrive the name from the cplus_specific struct for cplus symbols. (symbol_init_language_specific): Set cplus_specific for cplus symbols. (symbol_set_names): Pass objfile to symbol_set_demangled_name. * symtab.c (symbol_init_cplus_specific): New function. It was added in anticipation of improved template support: https://sourceware.org/ml/gdb-patches/2010-05/msg00594.html https://sourceware.org/ml/gdb-patches/2010-07/msg00284.html However, minsyms pay the price for this space too. For my standard benchmark this patch gets back 44MB of memory when gdb starts. [There's still ~440MB of memory used by the demangled ELF symbols of this benchmark, but that's another topic.] When the improved templated support is added, I wonder if this can be moved to struct symbol. Hmmm, we already have a special version of struct symbol for templates (struct template_symbol). gdb/ChangeLog: * symtab.c (symbol_init_cplus_specific): Delete. (symbol_set_demangled_name): Remove special c++ support. (symbol_get_demangled_name, symbol_set_language): Ditto. * symtab.h (struct cplus_specific): Delete. (struct general_symbol_info) <language_specific>: Remove cplus_specific.
2014-12-03 01:54:16 +01:00
2014-12-02 Doug Evans <dje@google.com>
* symtab.c (symbol_init_cplus_specific): Delete.
(symbol_set_demangled_name): Remove special c++ support.
(symbol_get_demangled_name, symbol_set_language): Ditto.
* symtab.h (struct cplus_specific): Delete.
(struct general_symbol_info) <language_specific>: Remove
cplus_specific.
2014-12-02 Doug Evans <dje@google.com>
PR symtab/17602
* linespec.c (iterate_name_matcher): Fix arguments to symbol_name_cmp.
2014-12-02 Doug Evans <dje@google.com>
PR symtab/17591
* dwarf2read.c (find_slot_in_mapped_hash): Use cp_remove_params
to strip parameters.
2014-12-02 Doug Evans <dje@google.com>
* dwarf2read.c (peek_die_abbrev): Improve error message text.
2014-12-02 Doug Evans <dje@google.com>
* valops.c (do_search_struct_field): Remove remnant of Chill support.
Ref: commit 4c2260aa5c261f7bfb26dcf3aa7c67876720b17e
2014-12-02 Simon Marchi <simon.marchi@ericsson.com>
* common/cleanups.c (make_cleanup_dtor): Fix comment typo.
New python events: inferior call, register/memory changed. gdb/ChangeLog: * NEWS: Mention new Python events. * Makefile.in (SUBDIR_PYTHON_OBS): Add py-infevents.o. (SUBDIR_PYTHON_SRCS): Add py-infevents.c. (py-infevents.o): New rule. * doc/observer.texi (inferior_call_pre, inferior_call_post) (memory_changed, register_changed): New observers. * infcall.c (call_function_by_hand): Notify observer before and after inferior call. * python/py-event.h (inferior_call_kind): New enum. (emit_inferior_call_event): New prototype. (emit_register_changed_event): New prototype. (emit_memory_changed_event): New prototype. * python/py-events.h (events_object): New registries inferior_call, memory_changed and register_changed. * python/py-evts.c (gdbpy_initialize_py_events): Add the inferior_call, memory_changed and register_changed registries. * python/py-infevents.c: New. * python/py-inferior.c (python_on_inferior_call_pre) (python_on_inferior_call_post, python_on_register_change) (python_on_memory_change): New functions. (gdbpy_initialize_inferior): Attach python handler to new observers. * python/py-infthread.c(gdbpy_create_ptid_object): New. (thpy_get_ptid) Use gdbpy_create_ptid_object. * python/python-internal.h: (gdbpy_create_ptid_object) (gdbpy_initialize_inferior_call_pre_event) (gdbpy_initialize_inferior_call_post_event) (gdbpy_initialize_register_changed_event) (gdbpy_initialize_memory_changed_event): New prototypes. * python/python.c (_initialize_python): Initialize new events. * valops.c (value_assign): Notify register_changed observer. gdb/doc/ChangeLog: * python.texi (Events In Python): Document new events InferiorCallPreEvent, InferiorCallPostEvent, MemoryChangedEvent and RegisterChangedEvent. gdb/testsuite/ChangeLog: * gdb.python/py-events.py (inferior_call_handler): New. (register_changed_handler, memory_changed_handler): New. (test_events.invoke): Register new handlers. * gdb.python/py-events.exp: Add tests for inferior call, memory_changed and register_changed events.
2014-12-02 20:15:29 +01:00
2014-12-02 Nick Bull <nicholaspbull@gmail.com>
* NEWS: Mention new Python events.
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-infevents.o.
(SUBDIR_PYTHON_SRCS): Add py-infevents.c.
(py-infevents.o): New rule.
* doc/observer.texi (inferior_call_pre, inferior_call_post)
(memory_changed, register_changed): New observers.
* infcall.c (call_function_by_hand): Notify observer before and
after inferior call.
* python/py-event.h (inferior_call_kind): New enum.
(emit_inferior_call_event): New prototype.
(emit_register_changed_event): New prototype.
(emit_memory_changed_event): New prototype.
* python/py-events.h (events_object): New registries
inferior_call, memory_changed and register_changed.
* python/py-evts.c (gdbpy_initialize_py_events): Add the
inferior_call, memory_changed and register_changed registries.
* python/py-infevents.c: New.
* python/py-inferior.c (python_on_inferior_call_pre)
(python_on_inferior_call_post, python_on_register_change)
(python_on_memory_change): New functions.
(gdbpy_initialize_inferior): Attach python handler to new
observers.
* python/py-infthread.c(gdbpy_create_ptid_object): New.
(thpy_get_ptid) Use gdbpy_create_ptid_object.
* python/python-internal.h:
(gdbpy_create_ptid_object)
(gdbpy_initialize_inferior_call_pre_event)
(gdbpy_initialize_inferior_call_post_event)
(gdbpy_initialize_register_changed_event)
(gdbpy_initialize_memory_changed_event): New prototypes.
* python/python.c (_initialize_python): Initialize new events.
* valops.c (value_assign): Notify register_changed observer.
2014-12-02 Doug Evans <dje@google.com>
* python/py-infthread.c: Whitespace fixes.
2014-12-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
* features/Makefile (s390-te-linux64-expedite): Replace
non-existant r14 and r15 by r14l and r15l, respectively.
* regformats/s390-te-linux64.dat: Regenerate.
2014-12-01 Simon Marchi <simon.marchi@ericsson.com>
* objfiles.c (allocate_objfile): Remove duplicate comment.
2014-12-01 Ulrich Weigand  <uweigand@de.ibm.com>
* config/i386/i386gnu.mh (NATDEPFILES): Remove core-regset.o.
* i386gnu-nat.c: Do not include <sys/procfs.h> or "gregset.h".
(CREG_OFFSET, creg_offset, CREG_ADDR): Remove.
(supply_gregset, supply_fpregset): Remove.
* i386gnu-tdep.c (i386gnu_gregset_reg_offset): New variable.
(i386gnu_init_abi): Set tdep->gregset_reg_offset, gregset_num_regs,
and sizeof_gregset.
2014-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
Add add-auto-load-scripts-directory.
* NEWS (Changes since GDB 7.8): Add add-auto-load-scripts-directory.
* auto-load.c (add_auto_load_dir): New function.
(_initialize_auto_load): Install it.
2014-11-30 Martin Galvan <martin.galvan@tallertechnologies.com> (tiny patch, obvious)
Pushed by Joel Brobecker <brobecker@adacore.com>.
* frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.
2014-11-29 Siva Chandra Reddy <sivachandra@google.com>
* eval.c (evaluate_subexp): Check that the thread stack temporaries
are not already enabled before enabling them.
2014-11-29 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_analyze_prologue): Move local variables
'framereg' and 'framesize' to inner block. Move code to
inner block too.
2014-11-28 Siva Chandra Reddy <sivachandra@google.com>
* eval.c: Include gdbthread.h.
(evaluate_subexp): Enable thread stack temporaries before
evaluating a complete expression and clean them up after the
evaluation is complete.
* gdbthread.h: Include common/vec.h.
(value_ptr): New typedef.
(VEC (value_ptr)): New vector type.
(value_vec): New typedef.
(struct thread_info): Add new fields stack_temporaries_enabled
and stack_temporaries.
(enable_thread_stack_temporaries)
(thread_stack_temporaries_enabled_p, push_thread_stack_temporary)
(get_last_thread_stack_temporary)
(value_in_thread_stack_temporaries): Declare.
* gdbtypes.c (class_or_union_p): New function.
* gdbtypes.h (class_or_union_p): Declare.
* infcall.c (call_function_by_hand): Store return values of class
type as temporaries on stack.
* thread.c (enable_thread_stack_temporaries): New function.
(thread_stack_temporaries_enabled_p, push_thread_stack_temporary)
(get_last_thread_stack_temporary): Likewise.
(value_in_thread_stack_temporaries): Likewise.
* value.c (value_force_lval): New function.
* value.h (value_force_lval): Declare.
2014-11-28 Pierre Muller <muller@sourceware.org>
Pushed by Joel Brobecker <brobecker@adacore.com>.
* amd64-tdep.c (amd64_dwarf_regmap array): Add missing MMX
registers.
2014-11-28 Ulrich Weigand  <uweigand@de.ibm.com>
* config/ia64/linux.mh (NATDEPFILES): Remove core-regset.o.
* config/sparc/linux.mh (NATDEPFILES): Likewise.
* config/sparc/linux64.mh (NATDEPFILES): Likewise.
* m68klinux-nat.c (fetch_core_registers): Remove.
(linux_elf_core_fns): Remove.
(_initialize_m68k_linux_nat): Do not call deprecated_add_core_fns.
2014-11-28 Joel Brobecker <brobecker@adacore.com>
* utils.c (gdb_realpath): Rework comment about handling on
Windows.
2014-11-28 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
rename.
* gnulib/aclocal.m4: Re-generated.
* gnulib/config.in: Re-generated.
* gnulib/configure: Re-generated.
* gnulib/import/Makefile.am: Re-generated.
* gnulib/import/Makefile.in: Re-generated.
* gnulib/import/m4/gnulib-cache.m4: Re-generated.
* gnulib/import/m4/gnulib-comp.m4: Re-generated.
* import/basename-lgpl.c: New file.
* import/dirname-lgpl.c: New file.
* import/dirname.h: New file.
* import/m4/dirname.m4: New file.
* import/m4/malloc.m4: New file.
* import/m4/rename.m4: New file.
* import/m4/rmdir.m4: New file.
* import/m4/stdio_h.m4: New file.
* import/malloc.c: New file.
* import/rename.c: New file.
* import/rmdir.c: New file.
* import/same-inode.h: New file.
* import/stdio.c: New file.
* import/stdio.in.h: New file.
* import/stripslash.c: New file.
2014-11-28 Yao Qi <yao@codesourcery.com>
* configure.ac (AC_CHECK_FUNCS): Remove canonicalize_file_name
and realpath.
* config.in: Re-generated.
* configure: Re-generated.
* utils.c (gdb_realpath): Remove code calling realpath,
canonicalize_file_name and pathconf.
[!_WIN32]: Call canonicalize_file_name.
2014-11-28 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
canonicalize-lgpl.
* aclocal.m4: Re-generated.
* config.in: Re-generated.
* configure: Re-generated.
* import/Makefile.am: Re-generated.
* import/Makefile.in: Re-generated.
* import/m4/gnulib-cache.m4: Re-generated.
* import/m4/gnulib-comp.m4: Re-generated.
* import/canonicalize-lgpl.c: New file.
* import/extra/snippet/_Noreturn.h: New file.
* import/m4/canonicalize.m4: New file.
* import/m4/double-slash-root.m4: New file.
* import/m4/eealloc.m4: New file.
* import/m4/malloca.m4: New file.
* import/m4/nocrash.m4: New file.
* import/m4/stdlib_h.m4: New file.
* import/malloca.c: New file.
* import/malloca.h: New file.
* import/malloca.valgrind: New file.
2014-11-28 Yao Qi <yao@codesourcery.com>
* configure.ac (AC_CHECK_FUNCS): Remove lstat.
* config.in, configure: Regenerate.
* symfile.c (find_separate_debug_file_by_debuglink): Remove
code checking HAVE_LSTAT is defined.
2014-11-28 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
lstat.
* gnulib/aclocal.m4: Re-generated.
* gnulib/config.in: Re-generated.
* gnulib/configure: Re-generated.
* gnulib/import/Makefile.am: Re-generated.
* gnulib/import/Makefile.in: Re-generated.
* gnulib/import/m4/gnulib-cache.m4: Re-generated.
* gnulib/import/m4/gnulib-comp.m4: Re-generated.
* gnulib/import/lstat.c: New file.
* gnulib/import/m4/lstat.m4: New file.
2014-11-28 Yao Qi <yao@codesourcery.com>
* configure.ac (AC_CHECK_FUNCS): Remove readlink.
* config.in, configure: Re-generate.
* inf-child.c (inf_child_fileio_readlink): Don't check
HAVE_READLINK is defined.
2014-11-28 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add readlink.
* gnulib/aclocal.m4: Re-generated.
* gnulib/config.in: Likewise.
* gnulib/configure: Likewise.
* gnulib/import/Makefile.am: Likewise.
* gnulib/import/Makefile.in: Likewise.
* gnulib/import/m4/gnulib-cache.m4: Likewise.
* gnulib/import/m4/gnulib-comp.m4: Likewise.
* gnulib/import/dosname.h: New file
* gnulib/import/m4/largefile.m4: New file.
* gnulib/import/m4/readlink.m4: New file.
* gnulib/import/m4/stat.m4: New file.
* gnulib/import/readlink.c: New file.
* gnulib/import/stat.c: New file.
2014-11-28 10:23:26 +01:00
2014-11-26 Mark Wielaard <mjw@redhat.com>
* dwarf2read.c (set_cu_language): Recognize DW_LANG_C11,
DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14.
2014-11-25 Sandra Loosemore <sandra@codesourcery.com>
* nios2-tdep.c (nios2_analyze_prologue): Replace restriction
that there can be only one stack adjustment in the prologue
with tests to detect specific disallowed stack adjustments.
2014-11-25 Sandra Loosemore <sandra@codesourcery.com>
* nios2-tdep.c (nios2_in_epilogue_p): Handle multiple stack
adjustments.
2014-11-25 Sandra Loosemore <sandra@codesourcery.com>
* nios2-tdep.c (nios2_fetch_insn): Move up in file. Disassemble
the instruction as well as reading it from memory.
(nios2_match_add): New.
(nios2_match_sub): New.
(nios2_match_addi): New.
(nios2_match_orhi): New.
(nios2_match_stw): New.
(nios2_match_ldw): New.
(nios2_match_rdctl): New.
(enum branch_condition): New.
(nios2_match_branch): New.
(nios2_match_jmpi): New.
(nios2_match_calli): New.
(nios2_match_jmpr): New.
(nios2_match_callr): New.
(nios2_match_break): New.
(nios2_match_trap): New.
(nios2_in_epilogue_p): Rewrite to use new functions.
(nios2_analyze_prologue): Likewise.
(nios2_skip_prologue): Delete unused local limit_pc.
(nios2_breakpoint_from_pc): Make R1-specific encodings explicit.
(nios2_get_next_pc): Rewrite to use new functions.
2014-11-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdbtypes.c (resolve_dynamic_type_internal): Reindent the code.
2014-11-24 Samuel Thibault <samuel.thibault@ens-lyon.org>
Pushed by Joel Brobecker <brobecker@adacore.com>
* gdb/gnu-nat.c (inf_validate_procinfo): Multiply the number of
elements pi_len by the size of the elements before calling
vm_deallocate.
(inf_validate_task_sc): Likewise, and properly deallocate the
noise array.
2014-11-23 Doug Evans <xdje42@gmail.com>
* gdbtypes.c (print_args): Renamed from print_arg_types. Print arg
number and name if present. All callers updated.
(dump_fn_fieldlists): Fix indentation of args.
2014-11-23 Patrick Palka <patrick@parcs.ath.cx>
* MAINTAINERS (Write After Approval): Add myself.
Always consider infcall breakpoints as non-permanent. A recent change... commit 1a853c5224e2b8fedfac6d029365522b83080b40 Date: Wed Nov 12 10:10:49 2014 +0000 Subject: make "permanent breakpoints" per location and disableable ... broke function calls on sparc-elf when running over QEMU. Any function call should demonstrate the problem. For instance, seen from the debugger: (gdb) call pn(1234) [Inferior 1 (Remote target) exited normally] The program being debugged exited while in a function called from GDB. Evaluation of the expression containing the function And seen from QEMU: qemu: fatal: Trap 0x02 while interrupts disabled, Error state [register dump removed] What happens in this case is that GDB sets the inferior function call by not only creating the dummy frame, but also writing a breakpoint instruction at the return address for our function call. See infcall.c: /* Write a legitimate instruction at the point where the infcall breakpoint is going to be inserted. While this instruction is never going to be executed, a user investigating the memory from GDB would see this instruction instead of random uninitialized bytes. We chose the breakpoint instruction as it may look as the most logical one to the user and also valgrind 3.7.0 needs it for proper vgdb inferior calls. If software breakpoints are unsupported for this target we leave the user visible memory content uninitialized. */ bp_addr_as_address = bp_addr; bp_bytes = gdbarch_breakpoint_from_pc (gdbarch, &bp_addr_as_address, &bp_size); if (bp_bytes != NULL) write_memory (bp_addr_as_address, bp_bytes, bp_size); This instruction triggers a change introduced by the commit above, where we consider bp locations as being permanent breakpoints if there is already a breakpoint instruction at that address: + if (bp_loc_is_permanent (loc)) + { + loc->inserted = 1; + loc->permanent = 1; + } As a result, when resuming the program's execution for the inferior function call, GDB decides that it does not need to insert a breakpoint at this address, expecting the target to just report a SIGTRAP when trying to execute that instruction. But unfortunately for us, at least some versions of QEMU for SPARC just terminate the execution entirely instead of reporting a breakpoint, thus producing the behavior reported here. Although it appears like QEMU might be misbehaving and should therefore be fixed (to be verified) from the user's point of view, the recent change does introduce a regression. So this patch tries to mitigate a bit the damage by handling such infcall breakpoints as special and making sure that they are never considered permanent, thus restoring the previous behavior specifically for those breakpoints. The option of not writing the breakpoint instructions in the first place was considered, and would probably work also. But the comment associated to it seems to indicate that there is still reason to keep it. gdb/ChangeLog: * breakpoint.c (bp_loc_is_permanent): Return 0 if LOC corresponds to a bp_call_dummy breakpoint type. Tested on x86_64-linux. Also testing on sparc-elf/QEMU using AdaCore's testsuite.
2014-11-20 17:41:25 +01:00
2014-11-23 Joel Brobecker <brobecker@adacore.com>
* breakpoint.c (bp_loc_is_permanent): Return 0 if LOC corresponds
to a bp_call_dummy breakpoint type.
2014-11-23 Patrick Palka <patrick@parcs.ath.cx>
* tui/tui-win.c (tui_initialize_win): Specify SA_RESTART when
registering the signal handler.
Fix the processing of Meta-key commands in TUI This patch fixes the annoying bug where key sequences such as Alt_F or Alt_B (go forward or backwards by a word) do not behave promptly in TUI. You have to press a third key in order for the key sequence to register. This is mostly ncurses' fault. Calling wgetch() normally causes ncurses to read only a single key from stdin. However if the key read is the start-sequence key (^[ a.k.a. ESC) then wgetch() reads TWO keys from stdin, storing the 2nd key into an internal FIFO buffer and returning the start-sequence key. The extraneous read of the 2nd key makes us miss its corresponding stdin event, so the event loop blocks until a third key is pressed. This explains why such key sequences do not behave promptly in TUI. To fix this issue, we must somehow compensate for the missed stdin event corresponding to the 2nd byte of a key sequence. This patch achieves this by hacking up the stdin event handler to conditionally execute the readline callback multiple times in a row. This is done via a new global variable, call_stdin_event_handler_again_p, which is set from tui_getc() when we receive a start-sequence key and notice extra pending input in the ncurses buffer. Tested on x86_64-unknown-linux-gnu. gdb/ChangeLog: * event-top.h (call_stdin_event_handler_again_p): Declare. * event-top.c (call_stdin_event_handler_again_p): Define. (stdin_event_handler): Use it. * tui/tui-io.c (tui_getc): Prepare to call the stdin event handler again if there is pending input following a start sequence.
2014-11-23 11:03:39 +01:00
2014-11-23 Patrick Palka <patrick@parcs.ath.cx>
* event-top.h (call_stdin_event_handler_again_p): Declare.
* event-top.c (call_stdin_event_handler_again_p): Define.
(stdin_event_handler): Use it.
* tui/tui-io.c (tui_getc): Prepare to call the stdin event
handler again if there is pending input following a
start sequence.
2014-11-23 Patrick Palka <patrick@parcs.ath.cx>
Pushed by Joel Brobecker <brobecker@adacore.com>
* linux-fork.c (checkpoint_command): Print index of new
checkpoint in response message.
2014-11-23 Yao Qi <yao@codesourcery.com>
* valprint.c (read_string): Move local variables 'found_nul',
'chunksize' and 'limit' to inner scope. Update comments.
2014-11-22 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_symbol_in_objfile_from_linkage_name): Improve
function comment.
(search_symbols): Fix comments and whitespace.
2014-11-22 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (cp_lookup_symbol_nonlocal): Fix comment.
2014-11-21 Doug Evans <dje@google.com>
* psymtab.c (psymtab_search_name): Fix whitespace.
2014-11-21 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
errno.
* gnulib/import/Makefile.am: Re-generated.
* gnulib/import/Makefile.in: Likewise.
* gnulib/import/m4/gnulib-cache.m4: Likewise.
2014-11-21 Yao Qi <yao@codesourcery.com>
* gdb_wchar.h: Include wchar.h and wctype.h.
[HAVE_ICONV && HAVE_BTOWC]: Don't check HAVE_WCHAR_T and don't
include wchar.h and wctype.h.
Don't check HAVE_WCHAR_H.
2014-11-21 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add wchar
and wctype-h.
* gnulib/import/Makefile.am: Re-generated.
* gnulib/import/Makefile.in: Likewise.
* gnulib/import/m4/gnulib-cache.m4: Likewise.
2014-11-21 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
memchr.
* gnulib/import/Makefile.am: Re-generated.
* gnulib/import/Makefile.in: Likewise.
* gnulib/import/m4/gnulib-cache.m4: Likewise.
2014-11-21 Yao Qi <yao@codesourcery.com>
* common/common-defs.h: Include alloca.h
* configure.ac: Don't invoke AC_FUNC_ALLOCA.
* configure: Re-generated.
* defs.h: Remove code handling alloca.
* utils.c (gdb_realpath): Don't check HAVE_ALLOCA is defined
or not.
2014-11-21 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULE): Add
alloca.
* gnulib/import/Makefile.am: Re-generated.
* gnulib/import/Makefile.in: Likewise..
* gnulib/import/m4/gnulib-cache.m4: Likewise.
2014-11-21 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh: Make IMPORTED_GNULIB_MODULES in
alphabetical order.
Handling of empty Ada ranges with a negative upper bound. Consider the following variable declaration: type Array_Type is array (Integer range <>) of Integer; Var: Array_Type (0 .. -1); "ptype var" prints the wrong upper bound for that array: (gdb) ptype var type = array (0 .. 4294967295) of integer The debugging info for the type of variable "Var" is as follow: <2><cf>: Abbrev Number: 13 (DW_TAG_structure_type) <d0> DW_AT_name : foo__var___PAD <3><db>: Abbrev Number: 14 (DW_TAG_member) <dc> DW_AT_name : F <e0> DW_AT_type : <0xa5> This is just an artifact from code generation, which is just a wrapper that we should ignore. The real type is the type of field "F" in that PAD type, which is described as: <2><a5>: Abbrev Number: 10 (DW_TAG_array_type) <a6> DW_AT_name : foo__TvarS <3><b6>: Abbrev Number: 11 (DW_TAG_subrange_type) <b7> DW_AT_type : <0xc1> <bb> DW_AT_lower_bound : 0 <bc> DW_AT_upper_bound : 0xffffffff Trouble occurs because DW_AT_upper_bound is encoded using a DW_FORM_data4, which is ambiguous regarding signedness. In that case, dwarf2read.c::dwarf2_get_attr_constant_value reads the value as unsigned, which is not what we want in this case. As it happens, we already have code dealing with this situation in dwarf2read.c::read_subrange_type which checks whether the subrange's type is signed or not, and if it is, fixes the bound's value by sign-extending it: if (high.kind == PROP_CONST && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; Unfortunately, what happens in our case is that the base type of the array's subrange type is marked as being unsigned, and so we never get to apply the sign extension. Following the DWARF trail, the range's base type is described as another subrange type... <2><c1>: Abbrev Number: 12 (DW_TAG_subrange_type) <c7> DW_AT_name : foo__TTvarSP1___XDLU_0__1m <cb> DW_AT_type : <0x2d> ... whose base type is, (finally), a basic type (signed): <1><2d>: Abbrev Number: 2 (DW_TAG_base_type) <2e> DW_AT_byte_size : 4 <2f> DW_AT_encoding : 5 (signed) <30> DW_AT_name : integer The reason why GDB thinks that foo__TTvarSP1___XDLU_0__1m (the base type of the array's range type) is an unsigned type is found in gdbtypes.c::create_range_type. We consider that a range type is unsigned iff its lower bound is >= 0: if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0) TYPE_UNSIGNED (result_type) = 1; That is normally sufficient, as one would expect the upper bound to always be greater or equal to the lower bound. But Ada actually allows the declaration of empty range types where the upper bound is less than the lower bound. In this case, the upper bound is negative, so we should not be marking the type as unsigned. This patch fixes the issue by simply checking the upper bound as well as the lower bound, and clears the range type's unsigned flag when it is found to be constant and negative. gdb/ChangeLog: * gdbtypes.c (create_range_type): Unset RESULT_TYPE's flag_unsigned if HIGH_BOUND is constant and negative. gdb/testsuite/ChangeLog: * gdb.ada/n_arr_bound: New testcase. Tested on x86_64-linux.
2014-10-03 00:17:49 +02:00
2014-11-21 Joel Brobecker <brobecker@adacore.com>
* gdbtypes.c (create_range_type): Unset RESULT_TYPE's
flag_unsigned if HIGH_BOUND is constant and negative.
2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/10737
* xml-syscall.c (set_xml_syscall_file_name): Remove "const"
modifier from "struct gdbarch" when compiling without Expat (XML)
support.
(get_syscall_by_number): Likewise.
(get_syscall_by_name): Likewise.
(get_syscall_names): Likewise.
Partial fix for PR breakpoints/10737: Make syscall info be per-arch instead of global This patch intends to partially fix PR breakpoints/10737, which is about making the syscall information (for the "catch syscall" command) be per-arch, instead of global. This is not a full fix because of the other issues pointed by Pedro here: <https://sourceware.org/bugzilla/show_bug.cgi?id=10737#c5> However, I consider it a good step towards the real fix. It will also help me fix <https://sourceware.org/bugzilla/show_bug.cgi?id=17402>. What this patch does, basically, is move the "syscalls_info" struct to gdbarch. Currently, the syscall information is stored in a global variable inside gdb/xml-syscall.c, which means that there is no easy way to correlate this info with the current target or architecture being used, for example. This causes strange behaviors, because the syscall info is not re-read when the arch changes. For example, if you put a syscall catchpoint in syscall 5 on i386 (syscall open), and then load a x86_64 program on GDB and put the same syscall 5 there (fstat on x86_64), you will still see that GDB tells you that it is catching "open", even though it is not. With this patch, GDB correctly says that it will be catching fstat syscalls. (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) catch syscall 5 Catchpoint 1 (syscall 'open' [5]) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) catch syscall 5 Catchpoint 2 (syscall 'open' [5]) But with the patch: (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) catch syscall 5 Catchpoint 1 (syscall 'open' [5]) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) catch syscall 5 Catchpoint 2 (syscall 'fstat' [5]) As I said, there are still some problems on the "catch syscall" mechanism, because (for example) the user should be able to "catch syscall open" on i386, and then expect "open" to be caught also on x86_64. Currently, it doesn't work. I intend to work on this later. gdb/ 2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/10737 * amd64-linux-tdep.c (amd64_linux_init_abi_common): Adjust call to set_xml_syscall_file_name to provide gdbarch. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * bfin-linux-tdep.c (bfin_linux_init_abi): Likewise. * breakpoint.c (print_it_catch_syscall): Adjust call to get_syscall_by_number to provide gdbarch. (print_one_catch_syscall): Likewise. (print_mention_catch_syscall): Likewise. (print_recreate_catch_syscall): Likewise. (catch_syscall_split_args): Adjust calls to get_syscall_by_number and get_syscall_by_name to provide gdbarch. (catch_syscall_completer): Adjust call to get_syscall_names to provide gdbarch. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * gdbarch.sh: Forward declare "struct syscalls_info". (xml_syscall_file): New variable. (syscalls_info): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Adjust call to set_xml_syscall_file_name to provide gdbarch. * mips-linux-tdep.c (mips_linux_init_abi): Likewise. * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * sparc-linux-tdep.c (sparc32_linux_init_abi): Likewise. * sparc64-linux-tdep.c (sparc64_linux_init_abi): Likewise. * xml-syscall.c: Include gdbarch.h. (set_xml_syscall_file_name): Accept gdbarch parameter. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. (my_gdb_datadir): Delete global variable. (struct syscalls_info) <my_gdb_datadir>: New variable. (struct syscalls_info) <sysinfo>: Rename variable to "syscalls_info". (sysinfo): Delete global variable. (have_initialized_sysinfo): Likewise. (xml_syscall_file): Likewise. (sysinfo_free_syscalls_desc): Rename to... (syscalls_info_free_syscalls_desc): ... this. (free_syscalls_info): Rename "sysinfo" to "syscalls_info". Adjust code to the new layout of "struct syscalls_info". (make_cleanup_free_syscalls_info): Rename parameter "sysinfo" to "syscalls_info". (syscall_create_syscall_desc): Likewise. (syscall_start_syscall): Likewise. (syscall_parse_xml): Likewise. (xml_init_syscalls_info): Likewise. Drop "const" from return value. (init_sysinfo): Rename to... (init_syscalls_info): ...this. Add gdbarch as a parameter. Adjust function to deal with gdbarch. (xml_get_syscall_number): Delete parameter sysinfo. Accept gdbarch as a parameter. Adjust code. (xml_get_syscall_name): Likewise. (xml_list_of_syscalls): Likewise. (set_xml_syscall_file_name): Accept gdbarch as parameter. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. * xml-syscall.h (set_xml_syscall_file_name): Likewise. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. gdb/testsuite/ 2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/10737 * gdb.base/catch-syscall.exp (do_syscall_tests): Call test_catch_syscall_multi_arch. (test_catch_syscall_multi_arch): New function.
2014-11-20 18:28:18 +01:00
2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/10737
* amd64-linux-tdep.c (amd64_linux_init_abi_common): Adjust call to
set_xml_syscall_file_name to provide gdbarch.
* arm-linux-tdep.c (arm_linux_init_abi): Likewise.
* bfin-linux-tdep.c (bfin_linux_init_abi): Likewise.
* breakpoint.c (print_it_catch_syscall): Adjust call to
get_syscall_by_number to provide gdbarch.
(print_one_catch_syscall): Likewise.
(print_mention_catch_syscall): Likewise.
(print_recreate_catch_syscall): Likewise.
(catch_syscall_split_args): Adjust calls to get_syscall_by_number
and get_syscall_by_name to provide gdbarch.
(catch_syscall_completer): Adjust call to get_syscall_names to
provide gdbarch.
* gdbarch.c: Regenerate.
* gdbarch.h: Likewise.
* gdbarch.sh: Forward declare "struct syscalls_info".
(xml_syscall_file): New variable.
(syscalls_info): Likewise.
* i386-linux-tdep.c (i386_linux_init_abi): Adjust call to
set_xml_syscall_file_name to provide gdbarch.
* mips-linux-tdep.c (mips_linux_init_abi): Likewise.
* ppc-linux-tdep.c (ppc_linux_init_abi): Likewise.
* s390-linux-tdep.c (s390_gdbarch_init): Likewise.
* sparc-linux-tdep.c (sparc32_linux_init_abi): Likewise.
* sparc64-linux-tdep.c (sparc64_linux_init_abi): Likewise.
* xml-syscall.c: Include gdbarch.h.
(set_xml_syscall_file_name): Accept gdbarch parameter.
(get_syscall_by_number): Likewise.
(get_syscall_by_name): Likewise.
(get_syscall_names): Likewise.
(my_gdb_datadir): Delete global variable.
(struct syscalls_info) <my_gdb_datadir>: New variable.
(struct syscalls_info) <sysinfo>: Rename variable to
"syscalls_info".
(sysinfo): Delete global variable.
(have_initialized_sysinfo): Likewise.
(xml_syscall_file): Likewise.
(sysinfo_free_syscalls_desc): Rename to...
(syscalls_info_free_syscalls_desc): ... this.
(free_syscalls_info): Rename "sysinfo" to "syscalls_info". Adjust
code to the new layout of "struct syscalls_info".
(make_cleanup_free_syscalls_info): Rename parameter "sysinfo" to
"syscalls_info".
(syscall_create_syscall_desc): Likewise.
(syscall_start_syscall): Likewise.
(syscall_parse_xml): Likewise.
(xml_init_syscalls_info): Likewise. Drop "const" from return value.
(init_sysinfo): Rename to...
(init_syscalls_info): ...this. Add gdbarch as a parameter.
Adjust function to deal with gdbarch.
(xml_get_syscall_number): Delete parameter sysinfo. Accept
gdbarch as a parameter. Adjust code.
(xml_get_syscall_name): Likewise.
(xml_list_of_syscalls): Likewise.
(set_xml_syscall_file_name): Accept gdbarch as parameter.
(get_syscall_by_number): Likewise.
(get_syscall_by_name): Likewise.
(get_syscall_names): Likewise.
* xml-syscall.h (set_xml_syscall_file_name): Likewise.
(get_syscall_by_number): Likewise.
(get_syscall_by_name): Likewise.
(get_syscall_names): Likewise.
Split struct symtab into two: struct symtab and compunit_symtab. Currently "symtabs" in gdb are stored as a single linked list of struct symtab that contains both symbol symtabs (the blockvectors) and file symtabs (the linetables). This has led to confusion, bugs, and performance issues. This patch is conceptually very simple: split struct symtab into two pieces: one part containing things common across the entire compilation unit, and one part containing things specific to each source file. Example. For the case of a program built out of these files: foo.c foo1.h foo2.h bar.c foo1.h bar.h Today we have a single list of struct symtabs: objfile -> foo.c -> foo1.h -> foo2.h -> bar.c -> foo1.h -> bar.h -> NULL where "->" means the "next" pointer in struct symtab. With this patch, that turns into: objfile -> foo.c(cu) -> bar.c(cu) -> NULL | | v v foo.c bar.c | | v v foo1.h foo1.h | | v v foo2.h bar.h | | v v NULL NULL where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects, and the files foo.c, etc. are struct symtab objects. So now, for example, when we want to iterate over all blockvectors we can now just iterate over the compunit_symtab list. Plus a lot of the data that was either unused or replicated for each symtab in a compilation unit now lives in struct compunit_symtab. E.g., the objfile pointer, the producer string, etc. I thought of moving "language" out of struct symtab but there is logic to try to compute the language based on previously seen files, and I think that's best left as is for now. With my standard monster benchmark with -readnow (which I can't actually do, but based on my calculations), whereas today the list requires 77MB to store all the struct symtabs, it now only requires 37MB. A modest space savings given the gigabytes needed for all the debug info, etc. Still, it's nice. Plus, whereas today we create a copy of dirname for each source file symtab in a compilation unit, we now only create one for the compunit. So this patch is basically just a data structure reorg, I don't expect significant performance improvements from it. Notes: 1) A followup patch can do a similar split for struct partial_symtab. I have left that until after I get the changes I want in to better utilize .gdb_index (it may affect how we do partial syms). 2) Another followup patch *could* rename struct symtab. The term "symtab" is ambiguous and has been a source of confusion. In this patch I'm leaving it alone, calling it the "historical" name of "filetabs", which is what they are now: just the file-name + line-table. gdb/ChangeLog: Split struct symtab into two: struct symtab and compunit_symtab. * amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit. * block.c (blockvector_for_pc_sect): Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (set_block_compunit_symtab): Renamed from set_block_symtab. Change "struct symtab *" argument to "struct compunit_symtab *". All callers updated. (get_block_compunit_symtab): Renamed from get_block_symtab. Change result to "struct compunit_symtab *". All callers updated. (find_iterator_compunit_symtab): Renamed from find_iterator_symtab. Change result to "struct compunit_symtab *". All callers updated. * block.h (struct global_block) <compunit_symtab>: Renamed from symtab. hange type to "struct compunit_symtab *". All uses updated. (struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab". Change type to "struct compunit_symtab *". All uses updated. * buildsym.c (struct buildsym_compunit): New struct. (subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete. (buildsym_compunit): New static global. (finish_block_internal): Update to fetch objfile from buildsym_compunit. (make_blockvector): Delete objfile argument. (start_subfile): Rewrite to use buildsym_compunit. Don't initialize debugformat, producer. (start_buildsym_compunit): New function. (free_buildsym_compunit): Renamed from free_subfiles_list. All callers updated. (patch_subfile_names): Rewrite to use buildsym_compunit. (get_compunit_symtab): New function. (get_macro_table): Delete argument comp_dir. All callers updated. (start_symtab): Change result to "struct compunit_symtab *". All callers updated. Create the subfile of the main source file. (watch_main_source_file_lossage): Rewrite to use buildsym_compunit. (reset_symtab_globals): Update. (end_symtab_get_static_block): Update to use buildsym_compunit. (end_symtab_without_blockvector): Rewrite. (end_symtab_with_blockvector): Change result to "struct compunit_symtab *". All callers updated. Update to use buildsym_compunit. Don't set symtab->dirname, instead set it in the compunit. Explicitly make sure main symtab is first in its list. Set debugformat, producer, blockvector, block_line_section, and macrotable in the compunit. (end_symtab_from_static_block): Change result to "struct compunit_symtab *". All callers updated. (end_symtab, end_expandable_symtab): Ditto. (set_missing_symtab): Change symtab argument to "struct compunit_symtab *". All callers updated. (augment_type_symtab): Ditto. (record_debugformat): Update to use buildsym_compunit. (record_producer): Update to use buildsym_compunit. * buildsym.h (struct subfile) <dirname>: Delete. <producer, debugformat>: Delete. <buildsym_compunit>: New member. (get_compunit_symtab): Declare. * dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed from primary_symtab. Change type to "struct compunit_symtab *". All uses updated. (dwarf2_start_symtab): Change result to "struct compunit_symtab *". All callers updated. (dwarf_decode_macros): Delete comp_dir argument. All callers updated. (struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. (dw2_instantiate_symtab): Change result to "struct compunit_symtab *". All callers updated. (dw2_find_last_source_symtab): Ditto. (dw2_lookup_symbol): Ditto. (recursively_find_pc_sect_compunit_symtab): Renamed from recursively_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (dw2_find_pc_sect_compunit_symtab): Renamed from dw2_find_pc_sect_symtab. Change result to "struct compunit_symtab *". All callers updated. (get_compunit_symtab): Renamed from get_symtab. Change result to "struct compunit_symtab *". All callers updated. (recursively_compute_inclusions): Change type of immediate_parent argument to "struct compunit_symtab *". All callers updated. (compute_compunit_symtab_includes): Renamed from compute_symtab_includes. All callers updated. Rewrite to compute includes of compunit_symtabs and not symtabs. (process_full_comp_unit): Update to work with struct compunit_symtab. (process_full_type_unit): Ditto. (dwarf_decode_lines_1): Delete argument comp_dir. All callers updated. (dwarf_decode_lines): Remove special case handling of main subfile. (macro_start_file): Delete argument comp_dir. All callers updated. (dwarf_decode_macro_bytes): Ditto. * guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to use struct compunit_symtab. * i386-tdep.c (i386_skip_prologue): Fetch producer from compunit. * jit.c (finalize_symtab): Build compunit_symtab. * jv-lang.c (get_java_class_symtab): Change result to "struct compunit_symtab *". All callers updated. * macroscope.c (sal_macro_scope): Fetch macro table from compunit. * macrotab.c (struct macro_table) <compunit_symtab>: Renamed from comp_dir. Change type to "struct compunit_symtab *". All uses updated. (new_macro_table): Change comp_dir argument to cust, "struct compunit_symtab *". All callers updated. * maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from nr_primary_symtabs. All uses updated. (count_symtabs_and_blocks): Update to handle compunits. (report_command_stats): Update output, "primary symtabs" renamed to "compunits". * mdebugread.c (new_symtab): Change result to "struct compunit_symtab *". All callers updated. (parse_procedure): Change type of search_symtab argument to "struct compunit_symtab *". All callers updated. * objfiles.c (objfile_relocate1): Loop over blockvectors in a separate loop. * objfiles.h (struct objfile) <compunit_symtabs>: Renamed from symtabs. Change type to "struct compunit_symtab *". All uses updated. (ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS. All uses updated. (ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS. All uses updated. (ALL_FILETABS): Renamed from ALL_SYMTABS. All uses updated. (ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS. All uses updated. * psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from symtab. Change type to "struct compunit_symtab *". All uses updated. * psymtab.c (psymtab_to_symtab): Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab_from_partial): Renamed from find_pc_sect_symtab_from_partial. Change result type to "struct compunit_symtab *". All callers updated. (lookup_symbol_aux_psymtabs): Change result type to "struct compunit_symtab *". All callers updated. (find_last_source_symtab_from_partial): Ditto. * python/py-symtab.c (stpy_get_producer): Fetch producer from compunit. * source.c (forget_cached_source_info_for_objfile): Fetch debugformat and macro_table from compunit. * symfile-debug.c (debug_qf_find_last_source_symtab): Change result type to "struct compunit_symtab *". All callers updated. (debug_qf_lookup_symbol): Ditto. (debug_qf_find_pc_sect_compunit_symtab): Renamed from debug_qf_find_pc_sect_symtab, change result type to "struct compunit_symtab *". All callers updated. * symfile.c (allocate_symtab): Delete objfile argument. New argument cust. (allocate_compunit_symtab): New function. (add_compunit_symtab_to_objfile): New function. * symfile.h (struct quick_symbol_functions) <lookup_symbol>: Change result type to "struct compunit_symtab *". All uses updated. <find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All uses updated. * symmisc.c (print_objfile_statistics): Compute blockvector count in separate loop. (dump_symtab_1): Update test for primary source symtab. (maintenance_info_symtabs): Update to handle compunit symtabs. (maintenance_check_symtabs): Ditto. * symtab.c (set_primary_symtab): Delete. (compunit_primary_filetab): New function. (compunit_language): New function. (iterate_over_some_symtabs): Change type of arguments "first", "after_last" to "struct compunit_symtab *". All callers updated. Update to loop over symtabs in each compunit. (error_in_psymtab_expansion): Rename symtab argument to cust, and change type to "struct compunit_symtab *". All callers updated. (find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_compunit_symtab): Renamed from find_pc_symtab. Change result type to "struct compunit_symtab *". All callers updated. (find_pc_sect_line): Only loop over symtabs within selected compunit instead of all symtabs in the objfile. * symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab. <compunit_symtab> New member. <block_line_section>: Moved to compunit_symtab. <locations_valid>: Ditto. <epilogue_unwind_valid>: Ditto. <macro_table>: Ditto. <dirname>: Ditto. <debugformat>: Ditto. <producer>: Ditto. <objfile>: Ditto. <call_site_htab>: Ditto. <includes>: Ditto. <user>: Ditto. <primary>: Delete (SYMTAB_COMPUNIT): New macro. (SYMTAB_BLOCKVECTOR): Update definition. (SYMTAB_OBJFILE): Update definition. (SYMTAB_DIRNAME): Update definition. (struct compunit_symtab): New type. Common members among all source symtabs within a compilation unit moved here. All uses updated. (COMPUNIT_OBJFILE): New macro. (COMPUNIT_FILETABS): New macro. (COMPUNIT_DEBUGFORMAT): New macro. (COMPUNIT_PRODUCER): New macro. (COMPUNIT_DIRNAME): New macro. (COMPUNIT_BLOCKVECTOR): New macro. (COMPUNIT_BLOCK_LINE_SECTION): New macro. (COMPUNIT_LOCATIONS_VALID): New macro. (COMPUNIT_EPILOGUE_UNWIND_VALID): New macro. (COMPUNIT_CALL_SITE_HTAB): New macro. (COMPUNIT_MACRO_TABLE): New macro. (ALL_COMPUNIT_FILETABS): New macro. (compunit_symtab_ptr): New typedef. (DEF_VEC_P (compunit_symtab_ptr)): New vector type. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Update expected output.
2014-11-20 16:42:48 +01:00
2014-11-20 Doug Evans <xdje42@gmail.com>
Split struct symtab into two: struct symtab and compunit_symtab.
* amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit.
* block.c (blockvector_for_pc_sect): Change "struct symtab *" argument
to "struct compunit_symtab *". All callers updated.
(set_block_compunit_symtab): Renamed from set_block_symtab. Change
"struct symtab *" argument to "struct compunit_symtab *".
All callers updated.
(get_block_compunit_symtab): Renamed from get_block_symtab. Change
result to "struct compunit_symtab *". All callers updated.
(find_iterator_compunit_symtab): Renamed from find_iterator_symtab.
Change result to "struct compunit_symtab *". All callers updated.
* block.h (struct global_block) <compunit_symtab>: Renamed from symtab.
hange type to "struct compunit_symtab *". All uses updated.
(struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab".
Change type to "struct compunit_symtab *". All uses updated.
* buildsym.c (struct buildsym_compunit): New struct.
(subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete.
(buildsym_compunit): New static global.
(finish_block_internal): Update to fetch objfile from
buildsym_compunit.
(make_blockvector): Delete objfile argument.
(start_subfile): Rewrite to use buildsym_compunit. Don't initialize
debugformat, producer.
(start_buildsym_compunit): New function.
(free_buildsym_compunit): Renamed from free_subfiles_list.
All callers updated.
(patch_subfile_names): Rewrite to use buildsym_compunit.
(get_compunit_symtab): New function.
(get_macro_table): Delete argument comp_dir. All callers updated.
(start_symtab): Change result to "struct compunit_symtab *".
All callers updated. Create the subfile of the main source file.
(watch_main_source_file_lossage): Rewrite to use buildsym_compunit.
(reset_symtab_globals): Update.
(end_symtab_get_static_block): Update to use buildsym_compunit.
(end_symtab_without_blockvector): Rewrite.
(end_symtab_with_blockvector): Change result to
"struct compunit_symtab *". All callers updated.
Update to use buildsym_compunit. Don't set symtab->dirname,
instead set it in the compunit.
Explicitly make sure main symtab is first in its list.
Set debugformat, producer, blockvector, block_line_section, and
macrotable in the compunit.
(end_symtab_from_static_block): Change result to
"struct compunit_symtab *". All callers updated.
(end_symtab, end_expandable_symtab): Ditto.
(set_missing_symtab): Change symtab argument to
"struct compunit_symtab *". All callers updated.
(augment_type_symtab): Ditto.
(record_debugformat): Update to use buildsym_compunit.
(record_producer): Update to use buildsym_compunit.
* buildsym.h (struct subfile) <dirname>: Delete.
<producer, debugformat>: Delete.
<buildsym_compunit>: New member.
(get_compunit_symtab): Declare.
* dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed
from primary_symtab. Change type to "struct compunit_symtab *".
All uses updated.
(dwarf2_start_symtab): Change result to "struct compunit_symtab *".
All callers updated.
(dwarf_decode_macros): Delete comp_dir argument. All callers updated.
(struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from
symtab. Change type to "struct compunit_symtab *". All uses updated.
(dw2_instantiate_symtab): Change result to "struct compunit_symtab *".
All callers updated.
(dw2_find_last_source_symtab): Ditto.
(dw2_lookup_symbol): Ditto.
(recursively_find_pc_sect_compunit_symtab): Renamed from
recursively_find_pc_sect_symtab. Change result to
"struct compunit_symtab *". All callers updated.
(dw2_find_pc_sect_compunit_symtab): Renamed from
dw2_find_pc_sect_symtab. Change result to
"struct compunit_symtab *". All callers updated.
(get_compunit_symtab): Renamed from get_symtab. Change result to
"struct compunit_symtab *". All callers updated.
(recursively_compute_inclusions): Change type of immediate_parent
argument to "struct compunit_symtab *". All callers updated.
(compute_compunit_symtab_includes): Renamed from
compute_symtab_includes. All callers updated. Rewrite to compute
includes of compunit_symtabs and not symtabs.
(process_full_comp_unit): Update to work with struct compunit_symtab.
(process_full_type_unit): Ditto.
(dwarf_decode_lines_1): Delete argument comp_dir. All callers updated.
(dwarf_decode_lines): Remove special case handling of main subfile.
(macro_start_file): Delete argument comp_dir. All callers updated.
(dwarf_decode_macro_bytes): Ditto.
* guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to
use struct compunit_symtab.
* i386-tdep.c (i386_skip_prologue): Fetch producer from compunit.
* jit.c (finalize_symtab): Build compunit_symtab.
* jv-lang.c (get_java_class_symtab): Change result to
"struct compunit_symtab *". All callers updated.
* macroscope.c (sal_macro_scope): Fetch macro table from compunit.
* macrotab.c (struct macro_table) <compunit_symtab>: Renamed from
comp_dir. Change type to "struct compunit_symtab *".
All uses updated.
(new_macro_table): Change comp_dir argument to cust,
"struct compunit_symtab *". All callers updated.
* maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from
nr_primary_symtabs. All uses updated.
(count_symtabs_and_blocks): Update to handle compunits.
(report_command_stats): Update output, "primary symtabs" renamed to
"compunits".
* mdebugread.c (new_symtab): Change result to
"struct compunit_symtab *". All callers updated.
(parse_procedure): Change type of search_symtab argument to
"struct compunit_symtab *". All callers updated.
* objfiles.c (objfile_relocate1): Loop over blockvectors in a
separate loop.
* objfiles.h (struct objfile) <compunit_symtabs>: Renamed from
symtabs. Change type to "struct compunit_symtab *". All uses updated.
(ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS.
All uses updated.
(ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS.
All uses updated.
(ALL_FILETABS): Renamed from ALL_SYMTABS. All uses updated.
(ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS. All uses updated.
* psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from
symtab. Change type to "struct compunit_symtab *". All uses updated.
* psymtab.c (psymtab_to_symtab): Change result type to
"struct compunit_symtab *". All callers updated.
(find_pc_sect_compunit_symtab_from_partial): Renamed from
find_pc_sect_symtab_from_partial. Change result type to
"struct compunit_symtab *". All callers updated.
(lookup_symbol_aux_psymtabs): Change result type to
"struct compunit_symtab *". All callers updated.
(find_last_source_symtab_from_partial): Ditto.
* python/py-symtab.c (stpy_get_producer): Fetch producer from compunit.
* source.c (forget_cached_source_info_for_objfile): Fetch debugformat
and macro_table from compunit.
* symfile-debug.c (debug_qf_find_last_source_symtab): Change result
type to "struct compunit_symtab *". All callers updated.
(debug_qf_lookup_symbol): Ditto.
(debug_qf_find_pc_sect_compunit_symtab): Renamed from
debug_qf_find_pc_sect_symtab, change result type to
"struct compunit_symtab *". All callers updated.
* symfile.c (allocate_symtab): Delete objfile argument.
New argument cust.
(allocate_compunit_symtab): New function.
(add_compunit_symtab_to_objfile): New function.
* symfile.h (struct quick_symbol_functions) <lookup_symbol>:
Change result type to "struct compunit_symtab *". All uses updated.
<find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab.
Change result type to "struct compunit_symtab *". All uses updated.
* symmisc.c (print_objfile_statistics): Compute blockvector count in
separate loop.
(dump_symtab_1): Update test for primary source symtab.
(maintenance_info_symtabs): Update to handle compunit symtabs.
(maintenance_check_symtabs): Ditto.
* symtab.c (set_primary_symtab): Delete.
(compunit_primary_filetab): New function.
(compunit_language): New function.
(iterate_over_some_symtabs): Change type of arguments "first",
"after_last" to "struct compunit_symtab *". All callers updated.
Update to loop over symtabs in each compunit.
(error_in_psymtab_expansion): Rename symtab argument to cust,
and change type to "struct compunit_symtab *". All callers updated.
(find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab.
Change result type to "struct compunit_symtab *". All callers updated.
(find_pc_compunit_symtab): Renamed from find_pc_symtab.
Change result type to "struct compunit_symtab *". All callers updated.
(find_pc_sect_line): Only loop over symtabs within selected compunit
instead of all symtabs in the objfile.
* symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab.
<compunit_symtab> New member.
<block_line_section>: Moved to compunit_symtab.
<locations_valid>: Ditto.
<epilogue_unwind_valid>: Ditto.
<macro_table>: Ditto.
<dirname>: Ditto.
<debugformat>: Ditto.
<producer>: Ditto.
<objfile>: Ditto.
<call_site_htab>: Ditto.
<includes>: Ditto.
<user>: Ditto.
<primary>: Delete
(SYMTAB_COMPUNIT): New macro.
(SYMTAB_BLOCKVECTOR): Update definition.
(SYMTAB_OBJFILE): Update definition.
(SYMTAB_DIRNAME): Update definition.
(struct compunit_symtab): New type. Common members among all source
symtabs within a compilation unit moved here. All uses updated.
(COMPUNIT_OBJFILE): New macro.
(COMPUNIT_FILETABS): New macro.
(COMPUNIT_DEBUGFORMAT): New macro.
(COMPUNIT_PRODUCER): New macro.
(COMPUNIT_DIRNAME): New macro.
(COMPUNIT_BLOCKVECTOR): New macro.
(COMPUNIT_BLOCK_LINE_SECTION): New macro.
(COMPUNIT_LOCATIONS_VALID): New macro.
(COMPUNIT_EPILOGUE_UNWIND_VALID): New macro.
(COMPUNIT_CALL_SITE_HTAB): New macro.
(COMPUNIT_MACRO_TABLE): New macro.
(ALL_COMPUNIT_FILETABS): New macro.
(compunit_symtab_ptr): New typedef.
(DEF_VEC_P (compunit_symtab_ptr)): New vector type.
[Ada] XA type is not redundant if the ranges' subtypes do not match Jan noticed that gdb.ada/arrayidx.exp regressed after I applied the following patch: commit 8908fca5772fcff9f7766158ba2aa59f5a2b1f68 Author: Joel Brobecker <brobecker@adacore.com> Date: Sat Sep 27 09:09:34 2014 -0700 Subject: [Ada] Ignore __XA types when redundant. What happens is that we're trying to print the value of r_two_three, which is defined as follow: type Index is (One, Two, Three); type RTable is array (Index range Two .. Three) of Integer; R_Two_Three : RTable := (2, 3); The expected output is: (gdb) p r_two_three $1 = (two => 2, 3) But after the patch above was applied, with the program program compiled using gcc-gnat-4.9.2-1.fc21.x86_64 (x86_64-linux), the output becomes: (gdb) p r_two_three $1 = (2, 3) (the name of the first bound is missing). The problem comes from the fact that the compiler described the array's index type as a plain base type, instead of as a subrange of the enumerated type. More particularly, this is what gcc-gnat-4.9.2-1.fc21.x86_64 generated: <3><7ce>: Abbrev Number: 9 (DW_TAG_array_type) <7cf> DW_AT_name : (indirect string, offset: 0xc13): p__rtable [...] <7d7> DW_AT_GNAT_descriptive_type: <0x98a> [...] <4><7df>: Abbrev Number: 8 (DW_TAG_subrange_type) <7e0> DW_AT_type : <0xa79> where DIE 0xa79 is: <1><a79>: Abbrev Number: 2 (DW_TAG_base_type) <a7a> DW_AT_byte_size : 8 <a7b> DW_AT_encoding : 7 (unsigned) <a7c> DW_AT_name : (indirect string, offset: 0xfc): sizetype The actual array subrange type can be found in the array's parallel XA type (the DW_AT_GNAT_descriptive_type). The recent commit correctly found that that bounds taken from the descriptive type are the same as bounds of our array's index type. But it failed to notice that ignoring this descriptive type would make us lose the actual array index type, making us think that we're printing an array indexed by integers. I hadn't seen that problem, because the compiler I used produced debugging info where the array's index type is correctly described: <3><79f>: Abbrev Number: 10 (DW_TAG_array_type) <7a0> DW_AT_name : (indirect string, offset: 0xb3d): p__rtable [...] <4><7b0>: Abbrev Number: 8 (DW_TAG_subrange_type) <7b1> DW_AT_type : <0x9b2> <7b5> DW_AT_upper_bound : 2 ... where DIE 0x9b2 leads us to ... <3><9b2>: Abbrev Number: 9 (DW_TAG_subrange_type) [...] <9b8> DW_AT_type : <0x962> <2><962>: Abbrev Number: 22 (DW_TAG_enumeration_type) <963> DW_AT_name : (indirect string, offset: 0xb34): p__index [...] This patch fixes the issue by also making sure that the subtype of the original range type does match the subtype found in the descriptive type. gdb/ChangeLog: * ada-lang.c (ada_is_redundant_range_encoding): Return 0 if the TYPE_CODE of range_type's base type does not match the TYPE_CODE of encoding_type's base type.
2014-11-20 09:10:41 +01:00
2014-11-20 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_is_redundant_range_encoding): Return 0
if the TYPE_CODE of range_type's base type does not match
the TYPE_CODE of encoding_type's base type.
[Ada] gdb.ada/complete.exp failure on x86_64-windows Using the example in gdb.ada/complete.exp, the following command on x86_64-windows returns one unwanted completion choice : (gdb) complete p pck p <pck_E>> [all following completions entries snipped, all expected] I tracked down this suprising entry to a minimal symbol whose name is ".refptr.pck_E". The problem occurs while trying to see if this symbol matches "pck" when doing wild-matching as we are doing here: /* Second: Try wild matching... */ if (!match && wild_match_p) { /* Since we are doing wild matching, this means that TEXT may represent an unqualified symbol name. We therefore must also compare TEXT against the unqualified name of the symbol. */ sym_name = ada_unqualified_name (ada_decode (sym_name)); if (strncmp (sym_name, text, text_len) == 0) match = 1; } What happens is that ada_decode correctly identifies the fact that SYM_NAME (".refptr.pck_E") is not following any GNAT encoding, and therefore returns that same name, but bracketed: "<.refptr.pck_E>". This is the convention we use for telling GDB that the decoded name is not a real Ada name - and therefore should not be encoded for operations such as name matching, symbol lookups, etc. So far, so good. Next is the call to ada_unqualified_name, which unfortunately does not notice that the decoded name it is being given isn't a natural symbol, and just blindly strips everything up to the last do, returning "pck_E>". And of course, "pck_E>" matches "pck" now, and so we end up accepting this symbol as a match. This patch fixes the problem by making ada_unqualified_name a little smarter by making sure that the given decoded symbol name does not start with '<'. gdb/ChangeLog: * ada-lang.c (ada_unqualified_name): Return DECODED_NAME if it starts with '<'. Tested on x86_64-windows using AdaCore's testsuite as well as on x86_64-linux.
2014-10-07 02:22:21 +02:00
2014-11-19 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_unqualified_name): Return DECODED_NAME if
it starts with '<'.
[Ada] Ignore __XA types when redundant. Consider the following code which declares a variable A2 which is an array of arrays of integers. type Array2_First is array (24 .. 26) of Integer; type Array2_Second is array (1 .. 2) of Array2_First; A1 : Array1_Second := ((10, 11, 12), (13, 14, 15)); Trying to print the type of that variable currently yields: (gdb) ptype A2 type = array (1 .. 2, 24 .. 26) of integer This is not correct, as this is the description of a two-dimension array, which is different from an array of arrays. The expected output is: (gdb) ptype a2 type = array (1 .. 2) of foo_n926_029.array2_first GDB's struct type currently handles multi-dimension arrays the same way arrays of arrays, where each dimension is stored as a sub-array. The ada-valprint module considers that consecutive array layers are in fact multi-dimension arrays. For array of arrays, a typedef layer is introduced between the two arrays, creating a break between each array type. In our situation, A2 is a described as a typedef of an array type... .uleb128 0x8 # (DIE (0x125) DW_TAG_variable) .ascii "a2\0" # DW_AT_name .long 0xfc # DW_AT_type .uleb128 0x4 # (DIE (0xfc) DW_TAG_typedef) .long .LASF5 # DW_AT_name: "foo__array2_second" .long 0x107 # DW_AT_type .uleb128 0x5 # (DIE (0x107) DW_TAG_array_type) .long .LASF5 # DW_AT_name: "foo__array2_second" .long 0xb4 # DW_AT_type .uleb128 0x6 # (DIE (0x114) DW_TAG_subrange_type) .long 0x11b # DW_AT_type .byte 0x2 # DW_AT_upper_bound .byte 0 # end of children of DIE 0x107 ... whose element type is, as expected, a typedef to the sub-array type: .uleb128 0x4 # (DIE (0xb4) DW_TAG_typedef) .long .LASF4 # DW_AT_name: "foo__array2_first" .long 0xbf # DW_AT_type .uleb128 0x9 # (DIE (0xbf) DW_TAG_array_type) .long .LASF4 # DW_AT_name: "foo__array2_first" .long 0xd8 # DW_AT_GNAT_descriptive_type .long 0x1c5 # DW_AT_type .uleb128 0xa # (DIE (0xd0) DW_TAG_subrange_type) .long 0xf0 # DW_AT_type .byte 0x18 # DW_AT_lower_bound .byte 0x1a # DW_AT_upper_bound .byte 0 # end of children of DIE 0xbf The reason why things fails is that, during expression evaluation, GDB tries to "fix" A1's type. Because the sub-array has a parallel (descriptive) type (DIE 0xd8), GDB thinks that our array's index type must be dynamic and therefore needs to be fixed. This in turn causes the sub-array to be "fixed", which itself results in the typedef layer to be stripped. However, looking closer at the parallel type, we see... .uleb128 0xb # (DIE (0xd8) DW_TAG_structure_type) .long .LASF8 # DW_AT_name: "foo__array2_first___XA" [...] .uleb128 0xc # (DIE (0xe4) DW_TAG_member) .long .LASF10 # DW_AT_name: "foo__Tarray2_firstD1___XDLU_24__26" ... that all it tells us is that the array bounds are 24 and 26, which is already correctly provided by the array's DW_TAG_subrange_type bounds, meaning that this parallel type is just redundant. Parallel types in general are slowly being removed in favor of standard DWARF constructs. But in the meantime, this patch kills two birds with one stone: 1. It recognizes this situation where the XA type is useless, and saves an unnecessary range-type fixing; 2. It fixes the issue at hand because ignoring the XA type results in no type fixing being required, which allows the typedef layer to be preserved. gdb/ChangeLog: * ada-lang.c (ada_is_redundant_range_encoding): New function. (ada_is_redundant_index_type_desc): New function. (to_fixed_array_type): Ignore parallel XA type if redundant. gdb/testsuite/ChangeLog: * gdb.ada/arr_arr: New testcase. Tested on x86_64-linux.
2014-09-27 18:09:34 +02:00
2014-11-19 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_is_redundant_range_encoding): New function.
(ada_is_redundant_index_type_desc): New function.
(to_fixed_array_type): Ignore parallel XA type if redundant.
varsize-limit error printing element of packed array... ... when that packed array is part of a discriminated record and one of the bounds is a discriminant. Consider the following code: type FUNNY_CHAR_T is (NUL, ' ', '"', '#', [etc]); type FUNNY_STR_T is array (POSITIVE range <>) of FUNNY_CHAR_T; pragma PACK (FUNNY_STR_T); type FUNNY_STRING_T (SIZE : NATURAL := 1) is record STR : FUNNY_STR_T (1 .. SIZE) := (others => '0'); LENGTH : NATURAL := 4; end record; TEST: FUNNY_STRING_T(100); GDB is able to print the value of variable "test" and "test.str". But not "test.str(1)": (gdb) p test $1 = (size => 100, str => (33 'A', nul <repeats 99 times>), length => 1) (gdb) p test.str $2 = (33 'A', nul <repeats 99 times>) (gdb) p test.str(1) object size is larger than varsize-limit The problem occurs during the phase where we are trying to resolve the expression subscript operation. On the one hand of the subscript operator, we have the result of the evaluation of "test.str", which is our packed array. We have the following code to handle packed arrays in particular: if (ada_is_constrained_packed_array_type (desc_base_type (value_type (argvec[0])))) argvec[0] = ada_coerce_to_simple_array (argvec[0]); This eventually leads to a call to constrained_packed_array_type to return the "simple array". This function relies on a parallel ___XA type, when available, to determine the bounds. In our case, we find type... failure__funny_string_t__T4b___XA" ... which has one field describing the bounds of our array as: failure__funny_string_t__T3b___XDLU_1__size The part that interests us is after the ___XD suffix or, in other words: "LU_1__size". What this means in GNAT encoding parlance is that the lower bound is 1, and that the upper bound is the value of "size". "size" is our discriminant in this case. Normally, we would access the record's discriminant in order to get the upper bound's value, but we do not have that information, here. We are in a mode where we are just trying to "fix" the type without an actual value. This is what the call to to_fixed_range_type is doing, and because the fix'ing fails, it ends up returning the ___XDLU type unmodified as our index type. This shouldn't be a problem, except that the later part of constrained_packed_array_type then uses that index_type to determine the array size, via a call to get_discrete_bounds. The problem is that the upper bound of the ___XDLU type is dynamic (in the DWARF sense) while get_discrete_bounds implicitly assumes that the bounds are static, and therefore accesses them using macros that assume the bounds values are constants: case TYPE_CODE_RANGE: *lowp = TYPE_LOW_BOUND (type); *highp = TYPE_HIGH_BOUND (type); This therefore returns a bogus value for the upper bound, leading to an unexpectedly large size for our array, which later triggers the varsize-limit guard we've seen above. This patch avoids the problem by adding special handling of dynamic range types. It also extends the documentation of the constrained_packed_array_type function to document what happens in this situation. gdb/ChangeLog: * ada-lang.c (constrained_packed_array_type): Set the length of the return array as if both bounds where zero if that returned array's index type is dynamic. gdb/testsuite/ChangeLog: * gdb.ada/pkd_arr_elem: New Testcase. Tested on x86_64-linux.
2014-09-12 03:38:04 +02:00
2014-11-19 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (constrained_packed_array_type): Set the length
of the return array as if both bounds where zero if that
returned array's index type is dynamic.
2014-11-19 Yao Qi <yao@codesourcery.com>
* config/i386/go32.mh (CC): Remove.
2014-11-18 Doug Evans <xdje42@gmail.com>
* symtab.h (SYMTAB_BLOCKVECTOR): Renamed from BLOCKVECTOR. All uses
updated.
2014-11-18 Doug Evans <xdje42@gmail.com>
* buildsym.c (buildsym_objfile): New static global.
(buildsym_comp_dir): New static global.
(finish_block_internal): Delete arg objfile. All callers updated.
(finish_block): Delete arg objfile. All callers updated.
(start_subfile): Delete arg dirname. All callers updated.
(patch_subfile_names): Update buildsym_comp_dir.
(get_macro_table): Delete arg objfile. All callers updated.
(start_symtab): New arg objfile. All callers updated.
Rename arg dirname to comp_dir.
(reset_symtab_globals): Initialize buildsym_objfile, buildsym_comp_dir.
(end_symtab_get_static_block): Delete arg objfile. All callers
updated.
(end_symtab_without_blockvector): Ditto.
(end_symtab_with_blockvector): Ditto.
(end_symtab_from_static_block): Ditto.
(end_symtab): Ditto.
(end_expandable_symtab): Ditto.
(augment_type_symtab): Ditto.
* coffread.c (coff_start_symtab): New arg objfile. All callers
updated.
2014-11-18 Doug Evans <xdje42@gmail.com>
* symtab.h (SYMTAB_LINETABLE): Renamed from LINETABLE. All uses
updated.
2014-11-18 Doug Evans <xdje42@gmail.com>
* symtab.h (SYMTAB_DIRNAME): New macro. All uses of member
symtab.dirname updated to use it.
2014-11-18 Doug Evans <xdje42@gmail.com>
* symtab.h (SYMTAB_OBJFILE): New macro. All uses of member
symtab.objfile updated to use it.
2014-11-18 Doug Evans <xdje42@gmail.com>
* buildsym.c (watch_main_source_file_lossage): Fix memory leak.
2014-11-18 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (cp_lookup_symbol_imports_or_template): Use
SYMBOL_OBJFILE.
* findvar.c (default_read_var_value): Ditto.
* jv-lang.c (add_class_symtab_symbol): Ditto.
* parse.c (operator_check_standard): Ditto.
* printcmd.c (address_info): Ditto.
* symtab.c (fixup_symbol_section): Ditto.
(skip_prologue_sal): Ditto.
* tracepoint.c (scope_info): Ditto.
* valops.c (find_function_in_inferior): Ditto.
* guile/scm-symbol.c (syscm_eq_symbol_smob): Ditto.
* python/py-symbol.c (set_symbol): Ditto.
Split up end_symtab_from_static_block into two. This patch is conceptually quite simple. If you look at end_symtab_from_static_block you'll see that the static_block == NULL case is completely different than the non-NULL case. There's a lot of complexity to handle the NULL case but it seems entirely unnecessary. For example, whether blockvector is NULL is decided at the start, before this for loop: for (subfile = subfiles; subfile; subfile = nextsub) Secondly, after the for loop, we test symtab for non-NULL here: /* Set this for the main source file. */ if (symtab) but symtab will only ever be non-NULL if blockvector was non-NULL. And if blockvector was non_NULL so will symtab. The other case to consider is these lines of code executed before the for loop: /* Read the line table if it has to be read separately. This is only used by xcoffread.c. */ if (objfile->sf->sym_read_linetable != NULL) objfile->sf->sym_read_linetable (objfile); /* Handle the case where the debug info specifies a different path for the main source file. It can cause us to lose track of its line number information. */ watch_main_source_file_lossage (); From my reading of the code, neither of these is useful in the static_block == NULL case. Thus we can make the code more readable by splitting these two cases up, which is what this patch does. gdb/ChangeLog: * buildsym.c (main_subfile): New static global. (free_subfiles_list): New function. (start_symtab): Set main_subfile. (restart_symtab): Replace init of subfiles, current_subfile with call to free_subfiles_list. (watch_main_source_file_lossage): Use main_subfile. (reset_symtab_globals): Replace init of current_subfile with call to free_subfiles_list. (end_symtab_without_blockvector, end_symtab_with_blockvector): New functions, split out from ... (end_symtab_from_static_block): ... here. Rewrite to call them.
2014-11-18 17:28:04 +01:00
2014-11-18 Doug Evans <xdje42@gmail.com>
* buildsym.c (main_subfile): New static global.
(free_subfiles_list): New function.
(start_symtab): Set main_subfile.
(restart_symtab): Replace init of subfiles, current_subfile with
call to free_subfiles_list.
(watch_main_source_file_lossage): Use main_subfile.
(reset_symtab_globals): Replace init of current_subfile with call
to free_subfiles_list.
(end_symtab_without_blockvector, end_symtab_with_blockvector): New
functions, split out from ...
(end_symtab_from_static_block): ... here. Rewrite to call them.
2014-11-18 Doug Evans <xdje42@gmail.com>
The result of symtab expansion is always a primary symtab.
* dwarf2read.c (dw2_instantiate_symtab): Add assert.
(dw2_lookup_symbol): Remove unnecessary test for primary symbol table.
* psymtab.c (lookup_symbol_aux_psymtabs): Ditto.
(psymtab_to_symtab): Add comment and assert.
(map_matching_symbols_psymtab): Remove unnecessary test for
non-primary symtab.
2014-11-15 Doug Evans <xdje42@gmail.com>
PR symtab/17559
* symtab.c (find_pc_line_symtab): New function.
* symtab.h (find_pc_line_symtab): Declare.
* disasm.c (gdb_disassembly): Call find_pc_line_symtab instead of
find_pc_symtab.
* tui/tui-disasm.c (tui_set_disassem_content): Ditto.
* tui/tui-hooks.c (tui_selected_frame_level_changed_hook): Ditto.
* tui/tui-source.c (tui_vertical_source_scroll): Ditto.
* tui/tui-win.c (make_visible_with_new_height): Ditto.
* tui/tui-winsource.c (tui_horizontal_source_scroll): Ditto.
(tui_display_main): Call find_pc_line_symtab instead of find_pc_line.
2014-11-15 Doug Evans <xdje42@gmail.com>
* symtab.c (expand_symtab_containing_pc): Renamed from
find_pc_sect_symtab_via_partial. All callers updated.
2014-11-15 Yao Qi <yao@codesourcery.com>
* go32-nat.c (go32_create_inferior): Add missing parenthesis.
2014-11-14 Joel Brobecker <brobecker@adacore.com>
* common/common-defs.h: Move <stdarg.h> #include ahead of
<stdio.h> #include.
handle 'iconv's that define EILSEQ to ENOENT We're currently pulling gnulib's errno module as a dependency of some other module. That provides an errno.h that defines EILSEQ to a distinct value if the system's errno.h doesn't define it already. However, GNU iconv does this: /* Get errno declaration and values. */ #include <errno.h> /* Some systems, like SunOS 4, don't have EILSEQ. Some systems, like BSD/OS, have EILSEQ in a different header. On these systems, define EILSEQ ourselves. */ #ifndef EILSEQ #define EILSEQ @EILSEQ@ #endif That's in: http://git.savannah.gnu.org/cgit/libiconv.git/tree/include/iconv.h.in The "different header" mentioned is wchar.h. This is handled in: http://git.savannah.gnu.org/cgit/libiconv.git/tree/m4/eilseq.m4 which defines @EILSEQ@ to ENOENT if EILSEQ isn't found in either errno.h or wchar.h. So if iconv sets errno to EILSEQ on such system's, it's really setting it to ENOENT. And when we check for EILSEQ, we're checking for gnulib's value. The result is we won't detect the error correctly. As we dropped support for both SunOS 4 or old BSD/OS, maybe we don't need to care about the wchar.h issue anymore. Still, AFAICS, gnulib's m4/errno_h.m4 doesn't know that EILSEQ may be defined in wchar.h, and so on such systems, ISTM gnulib ends up defining an incompatible EILSEQ itself, but I think that should be fixed on the gnulib side, by making it extract the EILSEQ value out of the system's wchar.h, like GNU iconv does. So that leaves handling the case of gnulib making up a EILSEQ value, which we take as meaning the system really doesn't really define it, which will be the same systems GNU iconv sets errno to ENOENT instead of EILSEQ. Looking at glibc's iconv it seems that ENOENT is never used there. It seems it's safe to always treat ENOENT the same as EILSEQ. The current EILSEQ definition under PHONY_ICONV is obviously stale as gnulib garantees there's always a EILSEQ defined. Tested on x86_64 Fedora 20. gdb/ 2014-11-14 Pedro Alves <palves@redhat.com> * charset.c [PHONY_ICONV && !EILSEQ] (EILSEQ): Don't define. [!PHONY_ICONV] (gdb_iconv): New function. [!PHONY_ICONV] (iconv): Redefine to gdb_iconv.
2014-11-14 16:58:09 +01:00
2014-11-14 Pedro Alves <palves@redhat.com>
* charset.c [PHONY_ICONV && !EILSEQ] (EILSEQ): Don't define.
[!PHONY_ICONV] (gdb_iconv): New function.
[!PHONY_ICONV] (iconv): Redefine to gdb_iconv.
2014-11-13 Doug Evans <dje@google.com>
PR symtab/17591
* dwarf2read.c (find_slot_in_mapped_hash): Handle
"(anonymous namespace)".
2014-11-13 Doug Evans <dje@google.com>
* dwarf2read.c (update_enumeration_type_from_children): Avoid
infinite loop.
2014-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS (maint set target-async): Fix typo.
2014-11-12 Pedro Alves <palves@redhat.com>
* infrun.c (enum infwait_states, infwait_state): Delete.
fix skipping permanent breakpoints The gdb.arch/i386-bp_permanent.exp test is currently failing an assertion recently added: (gdb) stepi ../../src/gdb/infrun.c:2237: internal-error: resume: Assertion `sig != GDB_SIGNAL_0' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) FAIL: gdb.arch/i386-bp_permanent.exp: Single stepping past permanent breakpoint. (GDB internal error) The assertion expects that the only reason we currently need to step a breakpoint instruction is when we have a signal to deliver. But when stepping a permanent breakpoint (with or without a signal) we also reach this code. The assertion is correct and the permanent breakpoints skipping code is wrong. Consider the case of the user doing "step/stepi" when stopped at a permanent breakpoint. GDB's `resume' calls the gdbarch_skip_permanent_breakpoint hook and then happily continues stepping: /* Normally, by the time we reach `resume', the breakpoints are either removed or inserted, as appropriate. The exception is if we're sitting at a permanent breakpoint; we need to step over it, but permanent breakpoints can't be removed. So we have to test for it here. */ if (breakpoint_here_p (aspace, pc) == permanent_breakpoint_here) { gdbarch_skip_permanent_breakpoint (gdbarch, regcache); } But since gdbarch_skip_permanent_breakpoint already advanced the PC manually, this ends up executing the instruction that is _after_ the breakpoint instruction. The user-visible result is that a single-step steps two instructions. The gdb.arch/i386-bp_permanent.exp test is actually ensuring that that's indeed how things work. It runs to an int3 instruction, does "stepi", and checks that "leave" was executed with that "stepi". Like this: (gdb) b *0x0804848c Breakpoint 2 at 0x804848c (gdb) c Continuing. Breakpoint 2, 0x0804848c in standard () (gdb) disassemble Dump of assembler code for function standard: 0x08048488 <+0>: push %ebp 0x08048489 <+1>: mov %esp,%ebp 0x0804848b <+3>: push %edi => 0x0804848c <+4>: int3 0x0804848d <+5>: leave 0x0804848e <+6>: ret 0x0804848f <+7>: nop (gdb) si 0x0804848e in standard () (gdb) disassemble Dump of assembler code for function standard: 0x08048488 <+0>: push %ebp 0x08048489 <+1>: mov %esp,%ebp 0x0804848b <+3>: push %edi 0x0804848c <+4>: int3 0x0804848d <+5>: leave => 0x0804848e <+6>: ret 0x0804848f <+7>: nop End of assembler dump. (gdb) One would instead expect that a stepi at 0x0804848c stops at 0x0804848d, _before_ the "leave" is executed. This commit changes GDB this way. Care is taken to make stepping into a signal handler when the step starts at a permanent breakpoint instruction work correctly. The patch adjusts gdb.arch/i386-bp_permanent.exp in this direction, and also makes it work on x86_64 (currently it only works on i*86). The patch also adds a new gdb.base/bp-permanent.exp test that exercises many different code paths related to stepping permanent breakpoints, including the stepping with signals cases. The test uses "hack/trick" to make it work on all (or most) platforms -- it doesn't really hard code a breakpoint instruction. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-11-12 Pedro Alves <palves@redhat.com> * infrun.c (resume): Clear the thread's 'stepped_breakpoint' flag. Rewrite stepping over a permanent breakpoint. (thread_still_needs_step_over, proceed): Don't set stepping_over_breakpoint for permanent breakpoints. (handle_signal_stop): Don't clear stepped_breakpoint. Also pull single-step breakpoints out of the target on hardware step targets. (process_event_stop_test): If stepping a permanent breakpoint doesn't hit the step-resume breakpoint, delete the step-resume breakpoint. (switch_back_to_stepped_thread): Also check if the stepped thread has advanced already on hardware step targets. (currently_stepping): Return true if the thread stepped a breakpoint. gdb/testsuite/ 2014-11-12 Pedro Alves <palves@redhat.com> * gdb.arch/i386-bp_permanent.c: New file. * gdb.arch/i386-bp_permanent.exp: Don't skip on x86_64. (srcfile): Set to i386-bp_permanent.c. (top level): Adjust to work in both 32-bit and 64-bit modes. Test that stepi does not execute the 'leave' instruction, instead of testing it does execute. * gdb.base/bp-permanent.c: New file. * gdb.base/bp-permanent.exp: New file.
2014-11-12 11:10:49 +01:00
2014-11-12 Pedro Alves <palves@redhat.com>
* infrun.c (resume): Clear the thread's 'stepped_breakpoint' flag.
Rewrite stepping over a permanent breakpoint.
(thread_still_needs_step_over, proceed): Don't set
stepping_over_breakpoint for permanent breakpoints.
(handle_signal_stop): Don't clear stepped_breakpoint. Also pull
single-step breakpoints out of the target on hardware step
targets.
(process_event_stop_test): If stepping a permanent breakpoint
doesn't hit the step-resume breakpoint, delete the step-resume
breakpoint.
(switch_back_to_stepped_thread): Also check if the stepped thread
has advanced already on hardware step targets.
(currently_stepping): Return true if the thread stepped a
breakpoint.
make "permanent breakpoints" per location and disableable "permanent"-ness is currently a property of the breakpoint. But, it should actually be an implementation detail of a _location_. Consider this bit in infrun.c: /* Normally, by the time we reach `resume', the breakpoints are either removed or inserted, as appropriate. The exception is if we're sitting at a permanent breakpoint; we need to step over it, but permanent breakpoints can't be removed. So we have to test for it here. */ if (breakpoint_here_p (aspace, pc) == permanent_breakpoint_here) { if (gdbarch_skip_permanent_breakpoint_p (gdbarch)) gdbarch_skip_permanent_breakpoint (gdbarch, regcache); else error (_("\ The program is stopped at a permanent breakpoint, but GDB does not know\n\ how to step past a permanent breakpoint on this architecture. Try using\n\ a command like `return' or `jump' to continue execution.")); } This will wrongly skip a non-breakpoint instruction if we have a multiple location breakpoint where the whole breakpoint was set to "permanent" because one of the locations happened to be permanent, even if the one GDB is resuming from is not. Related, because the permanent breakpoints are only marked as such in init_breakpoint_sal, we currently miss marking momentary breakpoints as permanent. A test added by a following patch trips on that. Making permanent-ness be per-location, and marking locations as such in add_location_to_breakpoint, the natural place to do this, fixes this issue... ... and then exposes a latent issue with mark_breakpoints_out. It's clearing the inserted flag of permanent breakpoints. This results in assertions failing like this: Breakpoint 1, main () at testsuite/gdb.base/callexit.c:32 32 return 0; (gdb) call callexit() [Inferior 1 (process 15849) exited normally] gdb/breakpoint.c:12854: internal-error: allegedly permanent breakpoint is not actually inserted A problem internal to GDB has been detected, further debugging may prove unreliable. The call dummy breakpoint, which is a momentary breakpoint, is set on top of a manually inserted breakpoint instruction, and so is now rightfully marked as a permanent breakpoint. See "Write a legitimate instruction at the point where the infcall breakpoint is going to be inserted." comment in infcall.c. Re. make_breakpoint_permanent. That's only called by solib-pa64.c. Permanent breakpoints were actually originally invented for HP-UX [1]. I believe that that call (the only one in the tree) is unnecessary nowadays, given that nowadays the core breakpoints code analyzes the instruction under the breakpoint to automatically detect whether it's setting a breakpoint on top of a breakpoint instruction in the program. I know close to nothing about HP-PA/HP-UX, though. [1] https://sourceware.org/ml/gdb-patches/1999-q3/msg00245.html, and https://sourceware.org/ml/gdb-patches/1999-q3/msg00242.html In addition to the per-location issue, "permanent breakpoints" are currently always displayed as enabled=='n': (gdb) b main Breakpoint 3 at 0x40053c: file ../../../src/gdb/testsuite/gdb.arch/i386-permbkpt.S, line 29. (gdb) info breakpoints Num Type Disp Enb Address What 3 breakpoint keep n 0x000000000040053c ../../../src/gdb/testsuite/gdb.arch/i386-permbkpt.S:29 But OTOH they're always enabled; there's no way to disable them... In turn, this means that if one adds commands to such a breakpoint, they're _always_ run: (gdb) start Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.arch/i386-permbkpt ... Temporary breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.arch/i386-permbkpt.S:29 29 int3 (gdb) b main Breakpoint 2 at 0x40053c: file ../../../src/gdb/testsuite/gdb.arch/i386-permbkpt.S, line 29. (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep n 0x000000000040053c ../../../src/gdb/testsuite/gdb.arch/i386-permbkpt.S:29 (gdb) commands Type commands for breakpoint(s) 2, one per line. End with a line saying just "end". >echo "hello!" >end (gdb) disable 2 (gdb) start The program being debugged has been started already. Start it from the beginning? (y or n) y Temporary breakpoint 3 at 0x40053c: file ../../../src/gdb/testsuite/gdb.arch/i386-permbkpt.S, line 29. Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.arch/i386-permbkpt Breakpoint 2, main () at ../../../src/gdb/testsuite/gdb.arch/i386-permbkpt.S:29 29 int3 "hello!"(gdb) IMO, one should be able to disable such a breakpoint, and GDB should then behave just like if the user hadn't created the breakpoint in the first place (that is, report a SIGTRAP). By making permanent-ness a property of the location, and eliminating the bp_permanent enum enable_state state ends up fixing that as well. No tests are added for these changes yet; they'll be added in a follow up patch, as skipping permanent breakpoints is currently broken and trips on an assertion in infrun. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ChangeLog: 2014-11-12 Pedro Alves <palves@redhat.com> Mark locations as permanent, not the whole breakpoint. * breakpoint.c (remove_breakpoint_1, remove_breakpoint): Adjust. (mark_breakpoints_out): Don't mark permanent breakpoints as uninserted. (breakpoint_init_inferior): Use mark_breakpoints_out. (breakpoint_here_p): Adjust. (bpstat_stop_status, describe_other_breakpoints): Remove handling of permanent breakpoints. (make_breakpoint_permanent): Mark each location as permanent, instead of marking the breakpoint. (add_location_to_breakpoint): If the location is permanent, mark it as such, and as inserted. (init_breakpoint_sal): Don't make the breakpoint permanent here. (bp_location_compare, update_global_location_list): Adjust. (update_breakpoint_locations): Don't make the breakpoint permanent here. (disable_breakpoint, enable_breakpoint_disp): Don't skip permanent breakpoints. * breakpoint.h (enum enable_state) <bp_permanent>: Delete field. (struct bp_location) <permanent>: New field. * guile/scm-breakpoint.c (bpscm_enable_state_to_string): Remove reference to bp_permanent.
2014-11-12 11:10:49 +01:00
2014-11-12 Pedro Alves <palves@redhat.com>
Mark locations as permanent, not the whole breakpoint.
* breakpoint.c (remove_breakpoint_1, remove_breakpoint): Adjust.
(mark_breakpoints_out): Don't mark permanent breakpoints as
uninserted.
(breakpoint_init_inferior): Use mark_breakpoints_out.
(breakpoint_here_p): Adjust.
(bpstat_stop_status, describe_other_breakpoints): Remove handling
of permanent breakpoints.
(make_breakpoint_permanent): Mark each location as permanent,
instead of marking the breakpoint.
(add_location_to_breakpoint): If the location is permanent, mark
it as such, and as inserted.
(init_breakpoint_sal): Don't make the breakpoint permanent here.
(bp_location_compare, update_global_location_list): Adjust.
(update_breakpoint_locations): Don't make the breakpoint permanent
here.
(disable_breakpoint, enable_breakpoint_disp): Don't skip permanent
breakpoints.
* breakpoint.h (enum enable_state) <bp_permanent>: Delete field.
(struct bp_location) <permanent>: New field.
* guile/scm-breakpoint.c (bpscm_enable_state_to_string): Remove
reference to bp_permanent.
add a default method for gdbarch_skip_permanent_breakpoint breakpoint.c uses gdbarch_breakpoint_from_pc to determine whether a breakpoint location points at a permanent breakpoint: static int bp_loc_is_permanent (struct bp_location *loc) { ... addr = loc->address; bpoint = gdbarch_breakpoint_from_pc (loc->gdbarch, &addr, &len); ... if (target_read_memory (loc->address, target_mem, len) == 0 && memcmp (target_mem, bpoint, len) == 0) retval = 1; ... So I think we should default the gdbarch_skip_permanent_breakpoint hook to advancing the PC by the length of the breakpoint instruction, as determined by gdbarch_breakpoint_from_pc. I believe that simple implementation does the right thing for most architectures. If there's an oddball architecture where that doesn't work, then it should override the hook, just like it should be overriding the hook if there was no default anyway. The only two implementation of skip_permanent_breakpoint are i386_skip_permanent_breakpoint, for x86, and hppa_skip_permanent_breakpoint, for PA-RISC/HP-UX The x86 implementation is trivial, and can clearly be replaced by the new default. I don't know about the HP-UX one though, I know almost nothing about PA. It may well be advancing the PC ends up being equivalent. Otherwise, it must be that "jump $pc_after_bp" doesn't work either... Tested on x86_64 Fedora 20 native and gdbserver. gdb/ 2014-11-12 Pedro Alves <palves@redhat.com> * arch-utils.c (default_skip_permanent_breakpoint): New function. * arch-utils.h (default_skip_permanent_breakpoint): New declaration. * gdbarch.sh (skip_permanent_breakpoint): Now an 'f' function. Install default_skip_permanent_breakpoint as default method. * i386-tdep.c (i386_skip_permanent_breakpoint): Delete function. (i386_gdbarch_init): Don't install it. * infrun.c (resume): Assume there's always a gdbarch_skip_permanent_breakpoint implementation. * gdbarch.h, gdbarch.c: Regenerate.
2014-11-12 11:10:48 +01:00
2014-11-12 Pedro Alves <palves@redhat.com>
* arch-utils.c (default_skip_permanent_breakpoint): New function.
* arch-utils.h (default_skip_permanent_breakpoint): New
declaration.
* gdbarch.sh (skip_permanent_breakpoint): Now an 'f' function.
Install default_skip_permanent_breakpoint as default method.
* i386-tdep.c (i386_skip_permanent_breakpoint): Delete function.
(i386_gdbarch_init): Don't install it.
* infrun.c (resume): Assume there's always a
gdbarch_skip_permanent_breakpoint implementation.
* gdbarch.h, gdbarch.c: Regenerate.
2014-11-11 Daniel Colascione <dancol@dancol.org>
Warn about cross-PID-namespace debugging.
* nat/linux-procfs.h (linux_proc_pid_get_ns): New prototype.
* nat/linux-procfs.c (linux_proc_pid_get_ns): New function.
* linux-thread-db.c (check_pid_namespace_match): New function.
(thread_db_inferior_created): Call it.
2014-11-10 Doug Evans <xdje42@gmail.com>
* symmisc.c (print_objfile_statistics): Remove trailing whitespace.
(maintenance_info_symtabs, maintenance_check_symtabs): Ditto.
2014-11-10 Doug Evans <xdje42@gmail.com>
* source.c (select_source_symtab): Rewrite to use ALL_SYMTABS.
2014-11-10 Doug Evans <xdje42@gmail.com>
PR symtab/17564
* symtab.c (lookup_symbol_in_all_objfiles): Delete.
(lookup_static_symbol): Move definition to new location and rewrite.
(lookup_symbol_in_objfile): New function.
(lookup_symbol_global_iterator_cb): Call it.
2014-11-10 Ulrich Weigand  <uweigand@de.ibm.com>
* eval.c (evaluate_subexp_standard): Work around GCC bug 63748.
Revert old nexti prologue check and eliminate in_prologue The in_prologue check in the nexti code is obsolete; this commit removes that, and then removes the in_prologue function as nothing else uses it. Looking at the code in GDB that makes use in_prologue, all we find is this one caller: if ((ecs->event_thread->control.step_over_calls == STEP_OVER_NONE) || ((ecs->event_thread->control.step_range_end == 1) && in_prologue (gdbarch, ecs->event_thread->prev_pc, ecs->stop_func_start))) { /* I presume that step_over_calls is only 0 when we're supposed to be stepping at the assembly language level ("stepi"). Just stop. */ /* Also, maybe we just did a "nexti" inside a prolog, so we thought it was a subroutine call but it was not. Stop as well. FENN */ /* And this works the same backward as frontward. MVS */ end_stepping_range (ecs); return; } This was added by: commit 100a02e1deec2f037a15cdf232f026dc79763bf8 ... From Fernando Nasser: * infrun.c (handle_inferior_event): Handle "nexti" inside function prologues. The mailing list thread is here: https://sourceware.org/ml/gdb-patches/2001-01/msg00047.html Not much discussion there, and no test, but looking at the code around what was patched in that revision, we see that the checks that detect whether the program has just stepped into a subroutine didn't rely on the unwinders at all back then. From 'git show 100a02e1:gdb/infrun.c': if (stop_pc == ecs->stop_func_start /* Quick test */ || (in_prologue (stop_pc, ecs->stop_func_start) && ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name)) || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name) || ecs->stop_func_name == 0) { /* It's a subroutine call. */ if ((step_over_calls == STEP_OVER_NONE) || ((step_range_end == 1) && in_prologue (prev_pc, ecs->stop_func_start))) { /* I presume that step_over_calls is only 0 when we're supposed to be stepping at the assembly language level ("stepi"). Just stop. */ /* Also, maybe we just did a "nexti" inside a prolog, so we thought it was a subroutine call but it was not. Stop as well. FENN */ stop_step = 1; print_stop_reason (END_STEPPING_RANGE, 0); stop_stepping (ecs); return; } Stripping the IN_SOLIB_RETURN_TRAMPOLINE checks for simplicity, we had: if (stop_pc == ecs->stop_func_start /* Quick test */ || in_prologue (stop_pc, ecs->stop_func_start) || ecs->stop_func_name == 0) { /* It's a subroutine call. */ That is, detecting a subroutine call was based on prologue detection back then. So the in_prologue check in the current tree only made sense back then as it was undoing a bad decision the in_prologue check that used to exist above did. Today, the check for a subroutine call relies on frame ids instead, which are stable throughout the function. So we can just remove the in_prologue check for nexti, and the whole in_prologue function along with it. Tested on x86_64 Fedora 20, and also by nexti-ing manually a prologue. gdb/ 2014-11-07 Pedro Alves <palves@redhat.com> * infrun.c (process_event_stop_test) <subroutine check>: Don't check if we did a "nexti" inside a prologue. * symtab.c (in_prologue): Delete function. * symtab.h (in_prologue): Delete declaration.
2014-11-07 14:53:01 +01:00
2014-11-07 Pedro Alves <palves@redhat.com>
* infrun.c (process_event_stop_test) <subroutine check>: Don't
check if we did a "nexti" inside a prologue.
* symtab.c (in_prologue): Delete function.
* symtab.h (in_prologue): Delete declaration.
2014-11-06 Doug Evans <xdje42@gmail.com>
* symtab.h (lookup_global_symbol): Improve function comment.
2014-11-06 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_global_symbol): Renamed from lookup_symbol_global.
All callers updated.
* symtab.h (lookup_global_symbol): Update decl.
(lookup_static_symbol): Move decl to better location.
2014-11-06 Doug Evans <xdje42@gmail.com>
* symtab.c (basic_lookup_symbol_nonlocal): Add comment.
2014-11-06 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_local_symbol): Renamed from lookup_symbol_aux_local.
All callers updated.
(lookup_symbol_in_all_objfiles): Renamed from
lookup_symbol_aux_symtabs. All callers updated.
(lookup_symbol_via_quick_fns): Renamed from lookup_symbol_aux_quick.
All callers updated.
(lookup_symbol_in_objfile_symtabs): Renamed from
lookup_symbol_aux_objfile. All callers updated.
2014-11-06 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_symbol_in_block): Renamed from
lookup_symbol_aux_block. All callers updated.
2014-11-06 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_static_symbol): Renamed from
lookup_static_symbol_aux. All callers updated.
(lookup_symbol_in_static_block): Renamed from lookup_symbol_static.
All callers updated.
2014-11-06 Doug Evans <xdje42@gmail.com>
* block.h (ALL_BLOCK_SYMBOLS_WITH_NAME): New macro.
* block.c (block_lookup_symbol): Use it.
* cp-support.c (make_symbol_overload_list_block): Use it.
* symtab.c (iterate_over_symbols): Use it.
2014-11-06 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_block_symbol): Moved to ...
* block.c (block_lookup_symbol): ... here and renamed.
All callers updated.
* block.h (block_lookup_symbol): Declare.
* symtab.h (lookup_block_symbol): Delete.
2014-11-06 Doug Evans <xdje42@gmail.com>
* ada-lang.c (ada_make_symbol_completion_list): Use
ALL_PRIMARY_SYMTABS instead of ALL_SYMTABS.
* symtab.c (lookup_objfile_from_block): Ditto.
2014-11-06 Doug Evans <xdje42@gmail.com>
* gdbtypes.h (TYPE_CODE_CLASS): Delete. All uses changed to use
TYPE_CODE_STRUCT.
2014-11-06 Doug Evans <xdje42@gmail.com>
* objfiles.c (get_objfile_arch): Constify.
* objfiles.h (get_objfile_arch): Update prototype.
* solib.c (solib_global_lookup): Fetch arch from objfile,
not target_gdbarch.
2014-11-06 Sandra Loosemore <sandra@codesourcery.com>
* nios2-tdep.c (wild_insn): Delete.
(profiler_insn, irqentry_insn): Delete.
(nios2_match_sequence): Delete.
(nios2_analyze_prologue): Update comments. Remove matching
of obsolete profiler_insn and irqentry_insn sequences.
2014-11-05 Alan Modra <amodra@gmail.com>
* charset.c (convert_between_encodings): Shrink obstack using
obstack_blank_fast.
* minsyms.c (install_minimal_symbols): Likewise.
* cp-valprint.c (cp_print_value_fields): Cast obstack_next_free
to char* before doing pointer arithmetic.
2014-11-04 Simon Marchi <simon.marchi@ericsson.com>
* tui/tui.c (tui_enable): Pass stdout and stdin to newterm.
2014-11-04 Pedro Alves <palves@redhat.com>
* breakpoint.c (breakpoint_thread_match): Delete function.
* breakpoint.h (breakpoint_thread_match): Delete declaration.
2014-11-03 Siva Chandra Reddy <sivachandra@google.com>
PR c++/17494
* eval.c (evaluate_subexp_standard): Evaluate the "object" and
the method args also under EVAL_SKIP when evaluating method
calls under EVAL_SKIP.
2014-11-02 Victor Kamensky <victor.kamensky@linaro.org>
* dwarf2loc.c (read_pieced_value): Do big endian
processing only if gdb_regnum is not -1.
(write_pieced_value): Ditto.
2014-11-02 Victor Kamensky <victor.kamensky@linaro.org>
* arm-linux-tdep.c (arm_linux_init_abi): Use
info.byte_order_for_code to choose endianity of breakpoint
instructions snippets.
2014-11-02 Victor Kamensky <victor.kamensky@linaro.org>
* arm-tdep.c (extract_arm_insn): Use
gdbarch_byte_order_for_code to read arm instruction.
2014-11-02 Doug Evans <xdje42@gmail.com>
* mdebugread.c (parse_procedure): Delete unnecessary forward decl.
2014-11-02 Doug Evans <xdje42@gmail.com>
* xcoffread.c (process_linenos): Delete unnecessary zeroing of
main_subfile before returning.
2014-10-31 Doug Evans <xdje42@gmail.com>
* objfiles.h (ALL_PSPACE_OBJFILES_SAFE): Delete, unused.
(ALL_PSPACE_SYMTABS, ALL_PSPACE_PRIMARY_SYMTABS): Ditto.
2014-10-31 Doug Evans <xdje42@gmail.com>
* valops.c (value_cast_pointers): Fix whitespace.
(typecmp, search_struct_method, value_struct_elt, find_oload_champ):
Ditto.
2014-10-30 Doug Evans <dje@google.com>
* NEWS: Mention ability add attributes to gdb.Objfile and
gdb.Progspace objects.
* python/py-objfile.c (objfile_object): New member dict.
(objfpy_dealloc): Py_XDECREF dict.
(objfpy_initialize): Initialize dict.
(objfile_getset): Add __dict__.
(objfile_object_type): Set tp_dictoffset member.
* python/py-progspace.c (progspace_object): New member dict.
(pspy_dealloc): Py_XDECREF dict.
(pspy_initialize): Initialize dict.
(pspace_getset): Add __dict__.
(pspace_object_type): Set tp_dictoffset member.
2014-10-30 Yao Qi <yao@codesourcery.com>
* python/lib/gdb/command/prompt.py (before_prompt_hook): Don't
replace '\\' with '\\\\'.
2014-10-29 Joel Brobecker <brobecker@adacore.com>
GDB 7.8.1 released.
This PR shows that GDB can easily trigger an assertion here, in infrun.c: 5392 /* Did we find the stepping thread? */ 5393 if (tp->control.step_range_end) 5394 { 5395 /* Yep. There should only one though. */ 5396 gdb_assert (stepping_thread == NULL); 5397 5398 /* The event thread is handled at the top, before we 5399 enter this loop. */ 5400 gdb_assert (tp != ecs->event_thread); 5401 5402 /* If some thread other than the event thread is 5403 stepping, then scheduler locking can't be in effect, 5404 otherwise we wouldn't have resumed the current event 5405 thread in the first place. */ 5406 gdb_assert (!schedlock_applies (currently_stepping (tp))); 5407 5408 stepping_thread = tp; 5409 } Like: gdb/infrun.c:5406: internal-error: switch_back_to_stepped_thread: Assertion `!schedlock_applies (1)' failed. The way the assertion is written is assuming that with schedlock=step we'll always leave threads other than the one with the stepping range locked, while that's not true with the "next" command. With schedlock "step", other threads still run unlocked when "next" detects a function call and steps over it. Whether that makes sense or not, still, it's documented that way in the manual. If another thread hits an event that doesn't cause a stop while the nexting thread steps over a function call, we'll get here and fail the assertion. The fix is just to adjust the assertion. Even though we found the stepping thread, we'll still step-over the breakpoint that just triggered correctly. Surprisingly, gdb.threads/schedlock.exp doesn't have any test that steps over a function call. This commits fixes that. This ensures that "next" doesn't switch focus to another thread, and checks whether other threads run locked or not, depending on scheduler locking mode and command. There's a lot of duplication in that file that this ends cleaning up. There's more that could be cleaned up, but that would end up an unrelated change, best done separately. This new coverage in schedlock.exp happens to trigger the internal error in question, like so: FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (1) (GDB internal error) FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (3) (GDB internal error) FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (5) (GDB internal error) FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (7) (GDB internal error) FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (9) (GDB internal error) FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next does not change thread (switched to thread 0) FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: current thread advanced - unlocked (wrong amount) That's because we have more than one thread running the same loop, and while one thread is stepping over a function call, the other thread hits the step-resume breakpoint of the first, which needs to be stepped over, and we end up in switch_back_to_stepped_thread exactly in the problem case. I think a simpler and more directed test is also useful, to not rely on internal breakpoint magics. So this commit also adds a test that has a thread trip on a conditional breakpoint that doesn't cause a user-visible stop while another thread is stepping over a call. That currently fails like this: FAIL: gdb.threads/next-bp-other-thread.exp: schedlock=step: next over function call (GDB internal error) Tested on x86_64 Fedora 20. gdb/ 2014-10-29 Pedro Alves <palves@redhat.com> PR gdb/17408 * infrun.c (switch_back_to_stepped_thread): Use currently_stepping instead of assuming a thread with a stepping range is always stepping. gdb/testsuite/ 2014-10-29 Pedro Alves <palves@redhat.com> PR gdb/17408 * gdb.threads/schedlock.c (some_function): New function. (call_function): New global. (MAYBE_CALL_SOME_FUNCTION): New macro. (thread_function): Call it. * gdb.threads/schedlock.exp (get_args): Add description parameter, and use it instead of a global counter. Adjust all callers. (get_current_thread): Use "find current thread" for test message here rather than having all callers pass down the same string. (goto_loop): New procedure, factored out from ... (my_continue): ... this. (step_ten_loops): Change parameter from test message to command to use. Adjust. (list_count): Delete global. (check_result): New procedure, factored out from duplicate top level code. (continue tests): Wrap in with_test_prefix. (test_step): New procedure, factored out from duplicate top level code. (top level): Test "step" in combination with all scheduler-locking modes. Test "next" in combination with all scheduler-locking modes, and in combination with stepping over a function call or not. * gdb.threads/next-bp-other-thread.c: New file. * gdb.threads/next-bp-other-thread.exp: New file.
2014-10-29 19:25:27 +01:00
2014-10-29 Pedro Alves <palves@redhat.com>
PR gdb/17408
* infrun.c (switch_back_to_stepped_thread): Use currently_stepping
instead of assuming a thread with a stepping range is always
stepping.
PR python/17372 - Python hangs when displaying help() This is more of a readline/terminal issue than a Python one. PR17372 is a regression in 7.8 caused by the fix for PR17072: commit 0017922d0292d8c374584f6100874580659c9973 Author: Pedro Alves <palves@redhat.com> Date: Mon Jul 14 19:55:32 2014 +0100 Background execution + pagination aborts readline/gdb gdb_readline_wrapper_line removes the handler after a line is processed. Usually, we'll end up re-displaying the prompt, and that reinstalls the handler. But if the output is coming out of handling a stop event, we don't re-display the prompt, and nothing restores the handler. So the next input wakes up the event loop and calls into readline, which aborts. ... gdb/ 2014-07-14 Pedro Alves <palves@redhat.com> PR gdb/17072 * top.c (gdb_readline_wrapper_line): Tweak comment. (gdb_readline_wrapper_cleanup): If readline is enabled, reinstall the input handler callback. The problem is that installing the input handler callback also preps the terminal, putting it in raw mode and with echo disabled, which is bad if we're going to call a command that assumes cooked/canonical mode, and echo enabled, like in the case of the PR, Python's interactive shell. Another example I came up with that doesn't depend on Python is starting a subshell with "(gdb) shell /bin/sh" from a multi-line command. Tests covering both these examples are added. The fix is to revert the original fix for PR gdb/17072, and instead restore the callback handler after processing an asynchronous target event. Furthermore, calling rl_callback_handler_install when we already have some input in readline's line buffer discards that input, which is obviously a bad thing to do while the user is typing. No specific test is added for that, because I first tried calling it even if the callback handler was still installed and that resulted in hundreds of failures in the testsuite. gdb/ 2014-10-29 Pedro Alves <palves@redhat.com> PR python/17372 * event-top.c (change_line_handler): Call gdb_rl_callback_handler_remove instead of rl_callback_handler_remove. (callback_handler_installed): New global. (gdb_rl_callback_handler_remove, gdb_rl_callback_handler_install) (gdb_rl_callback_handler_reinstall): New functions. (display_gdb_prompt): Call gdb_rl_callback_handler_remove and gdb_rl_callback_handler_install instead of rl_callback_handler_remove and rl_callback_handler_install. (gdb_disable_readline): Call gdb_rl_callback_handler_remove instead of rl_callback_handler_remove. * event-top.h (gdb_rl_callback_handler_remove) (gdb_rl_callback_handler_install) (gdb_rl_callback_handler_reinstall): New declarations. * infrun.c (reinstall_readline_callback_handler_cleanup): New cleanup function. (fetch_inferior_event): Install it. * top.c (gdb_readline_wrapper_line) Call gdb_rl_callback_handler_remove instead of rl_callback_handler_remove. (gdb_readline_wrapper_cleanup): Don't call rl_callback_handler_install. gdb/testsuite/ 2014-10-29 Pedro Alves <palves@redhat.com> PR python/17372 * gdb.python/python.exp: Test a multi-line command that spawns interactive Python. * gdb.base/multi-line-starts-subshell.exp: New file.
2014-10-23 18:13:35 +02:00
2014-10-29 Pedro Alves <palves@redhat.com>
PR python/17372
* event-top.c (change_line_handler): Call
gdb_rl_callback_handler_remove instead of
rl_callback_handler_remove.
(callback_handler_installed): New global.
(gdb_rl_callback_handler_remove, gdb_rl_callback_handler_install)
(gdb_rl_callback_handler_reinstall): New functions.
(display_gdb_prompt): Call gdb_rl_callback_handler_remove and
gdb_rl_callback_handler_install instead of
rl_callback_handler_remove and rl_callback_handler_install.
(gdb_disable_readline): Call gdb_rl_callback_handler_remove
instead of rl_callback_handler_remove.
* event-top.h (gdb_rl_callback_handler_remove)
(gdb_rl_callback_handler_install)
(gdb_rl_callback_handler_reinstall): New declarations.
* infrun.c (reinstall_readline_callback_handler_cleanup): New
cleanup function.
(fetch_inferior_event): Install it.
* top.c (gdb_readline_wrapper_line) Call
gdb_rl_callback_handler_remove instead of
rl_callback_handler_remove.
(gdb_readline_wrapper_cleanup): Don't call
rl_callback_handler_install.
Fix uninitialized value access when very first GDB command entered is <RET> While running GDB under Valgrind, I noticed that if the very first command entered is just <RET>, GDB accesses an uninitialized value: $ valgrind ./gdb -q -nx ==26790== Memcheck, a memory error detector ==26790== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==26790== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info ==26790== Command: ./gdb -q -nx ==26790== (gdb) ==26790== Conditional jump or move depends on uninitialised value(s) ==26790== at 0x619DFC: command_line_handler (event-top.c:588) ==26790== by 0x7813D5: rl_callback_read_char (callback.c:220) ==26790== by 0x6194B4: rl_callback_read_char_wrapper (event-top.c:166) ==26790== by 0x61988A: stdin_event_handler (event-top.c:372) ==26790== by 0x61847D: handle_file_event (event-loop.c:762) ==26790== by 0x617964: process_event (event-loop.c:339) ==26790== by 0x617A2B: gdb_do_one_event (event-loop.c:403) ==26790== by 0x617A7B: start_event_loop (event-loop.c:428) ==26790== by 0x6194E6: cli_command_loop (event-top.c:181) ==26790== by 0x60F86B: current_interp_command_loop (interps.c:317) ==26790== by 0x610A34: captured_command_loop (main.c:321) ==26790== by 0x60C728: catch_errors (exceptions.c:237) ==26790== (gdb) It's this check here: /* If we just got an empty line, and that is supposed to repeat the previous command, return the value in the global buffer. */ if (repeat && p == linebuffer && *p != '\\') { The problem is that linebuffer's contents were never initialized at this point. gdb/ 2014-10-29 Pedro Alves <palves@redhat.com> * event-top.c (command_line_handler): Clear the first byte of linebuffer, when it is first allocated.
2014-10-29 12:57:03 +01:00
2014-10-29 Pedro Alves <palves@redhat.com>
* event-top.c (command_line_handler): Clear the first byte of
linebuffer, when it is first allocated.
TUI: don't let exceptions escape while handling readline key bindings I noticed that with: $ TERM=dumb ./gdb -q -nx <c-x,a> Cannot enable the TUI: terminal doesn't support cursor addressing [TERM=dumb] (gdb) The next key the user types is silently eaten. The problem is that we're throwing an exception while in a readline callback that isn't prepared for that: (top-gdb) bt #0 tui_enable () at /home/pedro/gdb/mygit/build/../src/gdb/tui/tui.c:388 #1 0x000000000051f47b in tui_rl_switch_mode (notused1=1, notused2=1) at /home/pedro/gdb/mygit/build/../src/gdb/tui/tui.c:101 #2 0x0000000000768d6f in _rl_dispatch_subseq (key=1, map=0xd069c0 <emacs_ctlx_keymap>, got_subseq=0) at /home/pedro/gdb/mygit/build/../src/readline/readline.c:774 #3 0x0000000000768acb in _rl_dispatch_callback (cxt=0x1ce6190) at /home/pedro/gdb/mygit/build/../src/readline/readline.c:686 #4 0x000000000078120b in rl_callback_read_char () at /home/pedro/gdb/mygit/build/../src/readline/callback.c:170 #5 0x0000000000619445 in rl_callback_read_char_wrapper (client_data=0x0) at /home/pedro/gdb/mygit/build/../src/gdb/event-top.c:166 #6 0x000000000061981b in stdin_event_handler (error=0, client_data=0x0) at /home/pedro/gdb/mygit/build/../src/gdb/event-top.c:372 #7 0x000000000061840e in handle_file_event (data=...) at /home/pedro/gdb/mygit/build/../src/gdb/event-loop.c:762 #8 0x00000000006178f5 in process_event () at /home/pedro/gdb/mygit/build/../src/gdb/event-loop.c:339 #9 0x00000000006179bc in gdb_do_one_event () at /home/pedro/gdb/mygit/build/../src/gdb/event-loop.c:403 #10 0x0000000000617a0c in start_event_loop () at /home/pedro/gdb/mygit/build/../src/gdb/event-loop.c:428 Here, in _rl_dispatch_subseq: 769 770 rl_executing_keymap = map; 771 772 rl_dispatching = 1; 773 RL_SETSTATE(RL_STATE_DISPATCHING); 774 (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); 775 RL_UNSETSTATE(RL_STATE_DISPATCHING); 776 rl_dispatching = 0; 777 778 /* If we have input pending, then the last command was a prefix 779 command. Don't change the state of rl_last_func. Otherwise, GDB is called from line 774, but longjmp'ing at that point leaves rl_dispatching and RL_STATE_DISPATCHING set. Fix this by wrapping tui_rl_switch_mode in a TRY_CATCH. gdb/ 2014-10-29 Pedro Alves <palves@redhat.com> * tui/tui.c (tui_rl_switch_mode): Wrap tui_enable/tui_disable in TRY_CATCH.
2014-10-29 12:58:12 +01:00
2014-10-29 Pedro Alves <palves@redhat.com>
* tui/tui.c (tui_rl_switch_mode): Wrap tui_enable/tui_disable in
TRY_CATCH.
PR tui/16138 is about failure to initialize curses resulting in GDB exiting instead of throwing an error. E.g.: $ TERM=foo gdb (gdb) layout asm Error opening terminal: foo. $ The problem is that we're calling initscr to initialize the screen. As mentioned in http://pubs.opengroup.org/onlinepubs/7908799/xcurses/initscr.html: If errors occur, initscr() writes an appropriate error message to standard error and exits. ^^^^^ Instead, we should use newterm: "A program that needs an indication of error conditions, so it can continue to run in a line-oriented mode if the terminal cannot support a screen-oriented program, would also use this function." After the patch: $ TERM=foo gdb -q -nx (gdb) layout asm Cannot enable the TUI: error opening terminal [TERM=foo] (gdb) And then PR tui/17519 is about GDB not validating whether the terminal has the necessary capabilities when enabling the TUI. If one tries to enable the TUI with TERM=dumb (and e.g., from a shell within emacs), GDB ends up with a clear screen, the cursor is placed at the bottom/right corner of the screen, there's no prompt, typing shows no echo, and there's no indication of what's going on. c-x,a gets you out of the TUI, but it's completely non-obvious. After the patch, we get: $ TERM=dumb gdb -q -nx (gdb) layout asm Cannot enable the TUI: terminal doesn't support cursor addressing [TERM=dumb] (gdb) While at it, I've moved all the tui_allowed_p validation to tui_enable, and expanded the error messages. Previously we'd get: $ gdb -q -nx -i=mi (gdb) layout asm &"layout asm\n" &"TUI mode not allowed\n" ^error,msg="TUI mode not allowed" and: $ gdb -q -nx -ex "layout asm" > foo TUI mode not allowed While now we get: $ gdb -q -nx -i=mi (gdb) layout asm &"layout asm\n" &"Cannot enable the TUI when the interpreter is 'mi'\n" ^error,msg="Cannot enable the TUI when the interpreter is 'mi'" (gdb) and: $ gdb -q -nx -ex "layout asm" > foo Cannot enable the TUI when output is not a terminal Tested on x86_64 Fedora 20. gdb/ 2014-10-29 Pedro Alves <palves@redhat.com> PR tui/16138 PR tui/17519 * tui/tui-interp.c (tui_is_toplevel): Delete global. (tui_allowed_p): Delete function. * tui/tui.c: Include "interps.h". (tui_enable): Don't use tui_allowed_p. Error out here with detailed error messages if the TUI is the top level interpreter, or if output is not a terminal. Use newterm instead of initscr, and error out if initializing the terminal fails. Also error out if the terminal doesn't support cursor addressing. * tui/tui.h (tui_allowed_p): Delete declaration.
2014-10-29 15:49:05 +01:00
2014-10-29 Pedro Alves <palves@redhat.com>
PR tui/16138
PR tui/17519
* tui/tui-interp.c (tui_is_toplevel): Delete global.
(tui_allowed_p): Delete function.
* tui/tui.c: Include "interps.h".
(tui_enable): Don't use tui_allowed_p. Error out here with
detailed error messages if the TUI is the top level interpreter,
or if output is not a terminal. Use newterm instead of initscr,
and error out if initializing the terminal fails. Also error out if
the terminal doesn't support cursor addressing.
* tui/tui.h (tui_allowed_p): Delete declaration.
ARM: stricter __stack_chk_guard check during prologue analysis We are trying to insert a breakpoint on line 4 for the following Ada code. 3 procedure STR is 4 XX : String (1 .. Blocks.Sz) := (others => 'X'); -- STOP 5 K : Integer; 6 begin 7 K := 13; The code generated on ARM (-march=armv7-m) starts like this: (gdb) disass str'address Dump of assembler code for function _ada_str: --# Line str.adb:3 0x08000014 <+0>: push {r4, r7, lr} 0x08000016 <+2>: sub sp, #28 0x08000018 <+4>: add r7, sp, #0 0x0800001a <+6>: mov r3, sp 0x0800001c <+8>: mov r4, r3 --# Line str.adb:4 0x0800001e <+10>: ldr r3, [pc, #84] ; (0x8000074 <_ada_str+96>) 0x08000020 <+12>: ldr r3, [r3, #0] 0x08000022 <+14>: str r3, [r7, #20] 0x08000024 <+16>: ldr r3, [r7, #20] [...] When computing the address related to str.adb:4, GDB correctly resolves it to 0x0800001e first, but then considers the next 3 instructions as being part of the prologue because it thinks they are part of stack-protector code. As a result, instead of inserting the breakpoint at line 4, it skips those instruction and consequently the rest of the instructions until the start of the next line, which his line 7. The stack-protector code is expected to start like this... ldr Rn, .Label .... .Lable: .word __stack_chk_guard ... but the implementation actually accepts a sequence where the ldr location points to an address for which there is no symbol. It only aborts if the address points to a symbol which is not __stack_chk_guard. Since the __stack_chk_guard symbol is always expected to exist when used (it lives in .dynsym), this patch fixes the issue by requiring that the ldr gets the address of the __stack_chk_guard symbol. If the address could not be resolved, then it rejects the sequence as being stack-protector code. gdb/ChangeLog: * arm-tdep.c (arm_skip_stack_protector): Return early if address loaded by first "ldr" instruction does not have a corresponding minimal symbol. Update comment. Tested on arm-eabi using AdaCore's testsuite. Tested on arm-linux-gnueabi by Yao as well.
2014-10-23 17:25:20 +02:00
2014-10-29 Joel Brobecker <brobecker@adacore.com>
* arm-tdep.c (arm_skip_stack_protector): Return early if
address loaded by first "ldr" instruction does not have
a corresponding minimal symbol. Update comment.
Fix skipping stack protector on arm This patch fixes the bug in my patch skipping stack protector https://www.sourceware.org/ml/gdb-patches/2010-12/msg00110.html In my skipping stack protector patch, I misunderstood the constant vs. immediate on instruction encodings, and treated immediate as constant by mistake. The instruction 'ldr Rd, [PC, #immed]' loads the address of __stack_chk_guard to Rd, and #immed is an offset from PC. We should get the __stack_chk_guard from *(pc + #immed). As a result of this mistake, arm_analyze_load_stack_chk_guard returns the wrong address of __stack_chk_guard, and the symbol __stack_chk_guard can't be found. However, we continue to match the following instructions when symbol isn't found, so the code still works. In other words, the code just matches the instruction pattern without checking __stack_chk_guard symbol correctly. Joel's patch <https://sourceware.org/ml/gdb-patches/2014-10/msg00605.html> makes the heuristics stricter that we stop matching instructions if symbol __stack_chk_guard isn't found. Then the bug is exposed. This patch is to correct the load address computation for ldr instruction, and it fixes some fails in gdb.mi/gdb792.exp on armv4t both arm and thumb mode. Regression tested on arm-linux-gnueabi target with {armv4t, armv7-a} x {marm, mthumb} x {-fstack-protector,-fno-stack-protector} gdb: 2014-10-29 Yao Qi <yao@codesourcery.com> * arm-tdep.c (arm_analyze_load_stack_chk_guard): Compute the loaded address correctly of ldr instruction.
2014-10-29 06:39:16 +01:00
2014-10-29 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_analyze_load_stack_chk_guard): Compute the
loaded address correctly of ldr instruction.
PR gdb/12623: non-stop crashes inferior, PC adjustment and 1-byte insns TL;DR - if we step an instruction that is as long as decr_pc_after_break (1-byte on x86) right after removing the breakpoint at PC, in non-stop mode, adjust_pc_after_break adjusts the PC, but it shouldn't. In non-stop mode, when a breakpoint is removed, it is moved to the "moribund locations" list. This is because other threads that are running may have tripped on that breakpoint as well, and we haven't heard about it. When a trap is reported, we check if perhaps it was such a deleted breakpoint that caused the trap. If so, we also need to adjust the PC (decr_pc_after_break). Now, say that, on x86: - a breakpoint was placed at an address where we have an instruction of the same length as decr_pc_after_break on this arch (1 on x86). - the breakpoint is removed, and thus put on the moribund locations list. - the thread is single-stepped. As there's no breakpoint inserted at PC anymore, the single-step actually executes the 1-byte instruction normally. GDB should _not_ adjust the PC for the resulting SIGTRAP. But, adjust_pc_after_break confuses the step SIGTRAP reported for this single-step as being a SIGTRAP for the moribund location of the breakpoint that used to be at the previous PC, and so infrun applies the decr_pc_after_break adjustment incorrectly. The confusion comes from the special case mentioned in the comment: static void adjust_pc_after_break (struct execution_control_state *ecs) { ... As a special case, we could have hardware single-stepped a software breakpoint. In this case (prev_pc == breakpoint_pc), we also need to back up to the breakpoint address. */ if (thread_has_single_step_breakpoints_set (ecs->event_thread) || !ptid_equal (ecs->ptid, inferior_ptid) || !currently_stepping (ecs->event_thread) || (ecs->event_thread->stepped_breakpoint && ecs->event_thread->prev_pc == breakpoint_pc)) regcache_write_pc (regcache, breakpoint_pc); The condition that incorrectly triggers is the "ecs->event_thread->prev_pc == breakpoint_pc" one. Afterwards, the next resume resume re-executes an instruction that had already executed, which if you're lucky, results in the inferior crashing. If you're unlucky, you'll get silent bad behavior... The fix is to remember that we stepped a breakpoint. Turns out the only case we step a breakpoint instruction today isn't covered by the testsuite. It's the case of a 'handle nostop" signal arriving while a step is in progress _and_ we have a software watchpoint, which forces always single-stepping. This commit extends sigstep.exp to cover that, and adds a new test for the adjust_pc_after_break issue. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-10-28 Pedro Alves <palves@redhat.com> PR gdb/12623 * gdbthread.h (struct thread_info) <stepped_breakpoint>: New field. * infrun.c (resume) <stepping breakpoint instruction>: Set the thread's stepped_breakpoint field. Skip if reverse debugging. Add comment. (init_thread_stepping_state, handle_signal_stop): Clear the thread's stepped_breakpoint field. gdb/testsuite/ 2014-10-28 Pedro Alves <palves@redhat.com> PR gdb/12623 * gdb.base/sigstep.c (no_handler): New global. (main): If 'no_handler is true, set the signal handlers to SIG_IGN. * gdb.base/sigstep.exp (breakpoint_over_handler): Add with_sw_watch and no_handler parameters. Handle them. (top level) <stepping over handler when stopped at a breakpoint test>: Add a test axis for testing with a software watchpoint, and another for testing with the signal handler set to SIG_IGN. * gdb.base/step-sw-breakpoint-adjust-pc.c: New file. * gdb.base/step-sw-breakpoint-adjust-pc.exp: New file.
2014-10-28 14:42:11 +01:00
2014-10-28 Pedro Alves <palves@redhat.com>
PR gdb/12623
* gdbthread.h (struct thread_info) <stepped_breakpoint>: New
field.
* infrun.c (resume) <stepping breakpoint instruction>: Set the
thread's stepped_breakpoint field. Skip if reverse debugging.
Add comment.
(init_thread_stepping_state, handle_signal_stop): Clear the
thread's stepped_breakpoint field.
Workaround remote targets that report an empty list to qfThreadInfo In https://sourceware.org/ml/gdb-patches/2014-10/msg00652.html, Sandra shows a target that was broken by the recent update_thread_list optimization: (gdb) target remote qa8-centos32-cs:10514 ... (gdb) continue Continuing. Cannot execute this command without a live selected thread. (gdb) The error means that the current thread is in "exited" state when the continue command is processed. The root of the problem was found here: > Sending packet: $Hg0#df...Packet received: ... > Sending packet: $?#3f...Packet received: S00 > Sending packet: $qfThreadInfo#bb...Packet received: l > Sending packet: $Hc-1#09...Packet received: > Sending packet: $qC#b4...Packet received: unset This target doesn't really support threads (no thread indication in stop reply packets; no support for qC), but then supports qfThreadInfo, and returns an empty thread list to GDB. See https://sourceware.org/ml/gdb-patches/2014-10/msg00665.html for why the target does that. As remote_update_thread_list deletes threads from GDB's list that are not found in the thread list that the target reports, the result is that GDB deletes the "fake" main thread that GDB added itself. (As that thread is currently selected, it is marked "exited" instead of being deleted straight away.) This commit avoids deleting the main thread in this scenario. gdb/ 2014-10-27 Pedro Alves <palves@redhat.com> * remote.c (remote_thread_alive): New, factored out from ... (remote_thread_alive): ... this. (remote_update_thread_list): Bail out before deleting threads if the target returned an empty list, and, the current thread has a magic/fake ptid.
2014-10-28 12:35:10 +01:00
2014-10-27 Pedro Alves <palves@redhat.com>
* remote.c (remote_thread_alive): New, factored out from ...
(remote_thread_alive): ... this.
(remote_update_thread_list): Bail out before deleting threads if
the target returned an empty list, and, the current thread has a
magic/fake ptid.
stepi/nexti: skip signal handler if "handle nostop" signal arrives I noticed that "si" behaves differently when a "handle nostop" signal arrives while the step is in progress, depending on whether the program was stopped at a breakpoint when "si" was entered. Specifically, in case GDB needs to step off a breakpoint, the handler is skipped and the program stops in the next "mainline" instruction. Otherwise, the "si" stops in the first instruction of the signal handler. I was surprised the testsuite doesn't catch this difference. Turns out gdb.base/sigstep.exp covers a bunch of cases related to stepping and signal handlers, but does not test stepi nor nexti, only step/next/continue. My first reaction was that stopping in the signal handler was the correct thing to do, as it's where the next user-visible instruction that is executed is. I considered then "nexti" -- a signal handler could be reasonably considered a subroutine call to step over, it'd seem intuitive to me that "nexti" would skip it. But then, I realized that signals that arrive while a plain/line "step" is in progress _also_ have their handler skipped. A user might well be excused for being confused by this, given: (gdb) help step Step program until it reaches a different source line. And the signal handler's sources will be in different source lines, after all. I think that having to explain that "stepi" steps into handlers, (and that "nexti" wouldn't according to my reasoning above), while "step" does not, is a sign of an awkward interface. E.g., if a user truly is interested in stepping into signal handlers, then it's odd that she has to either force the signal to "handle stop", or recall to do "stepi" whenever such a signal might be delivered. For that use case, it'd seem nicer to me if "step" also stepped into handlers. This suggests to me that we either need a global "step-into-handlers" setting, or perhaps better, make "handle pass/nopass stop/nostop print/noprint" have have an additional axis - "handle stepinto/nostepinto", so that the user could configure whether handlers for specific signals should be stepped into. In any case, I think it's simpler (and thus better) for all step commands to behave the same. This commit thus makes "si/ni" skip handlers for "handle nostop" signals that arrive while the command was already in progress, like step/next do. To be clear, nothing changes if the program was stopped for a signal, and the user enters a stepping command _then_ -- GDB still steps into the handler. The change concerns signals that don't cause a stop and that arrive while the step is in progress. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-10-27 Pedro Alves <palves@redhat.com> * infrun.c (handle_signal_stop): Also skip handlers when a random signal arrives while handling a "stepi" or a "nexti". Set the thread's 'step_after_step_resume_breakpoint' flag. gdb/doc/ 2014-10-27 Pedro Alves <palves@redhat.com> * gdb.texinfo (Continuing and Stepping): Add cross reference to info on stepping and signal handlers. (Signals): Explain stepping and signal handlers. Add context index entry, and cross references. gdb/testsuite/ 2014-10-27 Pedro Alves <palves@redhat.com> * gdb.base/sigstep.c (dummy): New global. (main): Issue a couple writes to the new global. * gdb.base/sigstep.exp (get_next_pc, test_skip_handler): New procedures. (skip_over_handler): Use test_skip_handler. (top level): Call skip_over_handler for stepi and nexti too. (breakpoint_over_handler): Use test_skip_handler. (top level): Call breakpoint_over_handler for stepi and nexti too.
2014-10-27 21:24:59 +01:00
2014-10-27 Pedro Alves <palves@redhat.com>
* infrun.c (handle_signal_stop): Also skip handlers when a random
signal arrives while handling a "stepi" or a "nexti". Set the
thread's 'step_after_step_resume_breakpoint' flag.
2014-10-27 Luis Machado <lgustavo@codesourcery.com>
* arm-tdep.c (INSN_S_L_BIT_NUM): Document.
(arm_record_ld_st_imm_offset): Reimplement to cover all
load/store cases for ARM opcode 010.
(arm_record_ld_st_multiple): Reimplement to cover all
load/store cases for ARM opcode 100.
2014-10-26 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_symbol_aux_local): Fix typo in comment.
2014-10-26 Doug Evans <xdje42@gmail.com>
* symfile.h (struct quick_symbol_functions) <lookup_symbol>: Rename
parameter "kind" to "block_index".
* symtab.c (error_in_psymtab_expansion): Rename parameter "kind" to
"block_index".
(lookup_symbol_aux_quick, basic_lookup_transparent_type_quick): Ditto.
2014-10-26 Doug Evans <xdje42@gmail.com>
* block.h (ALL_BLOCK_SYMBOLS): Fix comment.
2014-10-26 Doug Evans <xdje42@gmail.com>
* block.c (allocate_block): Use OBSTACK_ZALLOC instead of
obstack_alloc.
2014-10-26 Doug Evans <xdje42@gmail.com>
* parser-defs.h (block_found): Move decl from here ...
* symtab.h (block_found): ... to here.
2014-10-26 Doug Evans <xdje42@gmail.com>
* symtab.h (struct field_of_this_result): Fix typo in comment.
(lookup_symbol_in_language): Move function comment here.
(lookup_symbol): Improve function comment.
(basic_lookup_symbol_nonlocal): Ditto.
(lookup_symbol_static, lookup_symbol_global): Ditto.
(lookup_symbol_aux_block): Ditto.
(lookup_language_this): Add function comment.
(lookup_static_symbol_aux): Explicitly mark as extern. Improve
function comment.
(lookup_block_symbol): Improve function comment.
(lookup_struct): Fix capitalization in function comment.
(lookup_transparent_type): Add function comment.
(lookup_global_symbol_from_objfile): Explicitly mark as extern.
Improve function comment.
(lookup_objfile_from_block): Add function comment.
* symtab.c (lookup_symbol_in_language): Update function comment.
(lookup_symbol, lookup_language_this): Ditto.
(lookup_static_symbol_aux, lookup_objfile_from_block): Ditto.
(lookup_symbol_aux_block, lookup_global_symbol_from_objfile): Ditto.
(basic_lookup_symbol_nonlocal): Ditto.
(lookup_symbol_static, lookup_symbol_global): Ditto.
(lookup_transparent_type, lookup_block_symbol): Ditto.
2014-10-25 Doug Evans <xdje42@gmail.com>
* symtab.c (types_info): Delete forward decl.
(functions_info, variables_info, sources_info): Ditto.
(_initialize_symtab): Rewrite forward decl to use
initialize_file_ftype.
2014-10-25 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_symbol_aux_quick): Set block_found upon success.
2014-10-25 Doug Evans <xdje42@gmail.com>
* dwarf2read.c (process_structure_scope): Remove second (nested) copy
of local var child_die.
Follow-fork message printing improvements This commit modifies the code that prints attach and detach messages related to following fork and vfork. The changes include using target_terminal_ours_for_output instead of target_terminal_ours, printing "vfork" instead of "fork" for all vfork-related messages, and using _() for the format strings of all of the messages. We also add a "detach" message for when a fork parent is detached. Previously in this case the only message was notification of attaching to the child. We still do not print any messages when following the parent and detaching the child (the default). The rationale for this is that from the user's perspective the new child was never attached. Note that all of these messages are only printed when 'verbose' is set or when debugging is turned on. The tests gdb.base/foll-fork.exp and gdb.base/foll-vfork.exp were modified to check for the new message. Tested on x64 Ubuntu Lucid, native only. gdb/ChangeLog: * infrun.c (follow_fork_inferior): Update fork message printing to use target_terminal_ours_for_output instead of target_terminal_ours, to use _() for all format strings, to print "vfork" instead of "fork" for vforks, and to add a detach message. (handle_vfork_child_exec_or_exit): Update message printing to use target_terminal_ours_for_output instead of target_terminal_ours, to use _() for all format strings, and to fix some formatting. gdb/testsuite/ChangeLog: * gdb.base/foll-fork.exp (test_follow_fork, catch_fork_child_follow): Check for updated fork messages emitted from infrun.c. * gdb.base/foll-vfork.exp (vfork_parent_follow_through_step, vfork_parent_follow_to_bp, vfork_and_exec_child_follow_to_main_bp, vfork_and_exec_child_follow_through_step): Check for updated vfork messages emitted from infrun.c.
2014-10-24 20:36:06 +02:00
2014-10-24 Don Breazeal <donb@codesourcery.com>
* infrun.c (follow_fork_inferior): Update fork message printing
to use target_terminal_ours_for_output instead of
target_terminal_ours, to use _() for all format strings, to print
"vfork" instead of "fork" for vforks, and to add a detach message.
(handle_vfork_child_exec_or_exit): Update message printing to use
target_terminal_ours_for_output instead of target_terminal_ours, to
use _() for all format strings, and to fix some formatting.
2014-10-24 Pedro Alves <palves@redhat.com>
* Makefile.in (ALLDEPFILES): Remove vax-nat.c.
* NEWS (Removed targets): Add VAX BSD and VAX Ultrix.
* config/vax/vax.mh: Delete.
* configure.host: Move vax-*-bsd* and vax-*-ultrix* to the
obsolete configurations section.
* configure.tgt (vax-*-*): Don't mention 4.2BSD nor Ultrix.
* vax-nat.c: Delete file.
2014-10-24 Pedro Alves <palves@redhat.com>
* NEWS (Removed targets): Add OS/arch column.
2014-10-24 Siva Chandra Reddy <sivachandra@google.com>
* gnu-v3-abi.c (gnuv3_pass_by_reference): Call TYPE_TARGET_TYPE
on the arg type of a constructor only if it is of reference type.
Refactoring/cleanup of nios2 opcodes and assembler code. 2014-10-23 Sandra Loosemore <sandra@codesourcery.com> include/opcode/ * nios2.h (enum iw_format_type): New. (struct nios2_opcode): Update comments. Add size and format fields. (NIOS2_INSN_OPTARG): New. (REG_NORMAL, REG_CONTROL, REG_COPROCESSOR): New. (struct nios2_reg): Add regtype field. (GET_INSN_FIELD, SET_INSN_FIELD): Delete. (IW_A_LSB, IW_A_MSB, IW_A_SZ, IW_A_MASK): Delete. (IW_B_LSB, IW_B_MSB, IW_B_SZ, IW_B_MASK): Delete. (IW_C_LSB, IW_C_MSB, IW_C_SZ, IW_C_MASK): Delete. (IW_IMM16_LSB, IW_IMM16_MSB, IW_IMM16_SZ, IW_IMM16_MASK): Delete. (IW_IMM26_LSB, IW_IMM26_MSB, IW_IMM26_SZ, IW_IMM26_MASK): Delete. (IW_OP_LSB, IW_OP_MSB, IW_OP_SZ, IW_OP_MASK): Delete. (IW_OPX_LSB, IW_OPX_MSB, IW_OPX_SZ, IW_OPX_MASK): Delete. (IW_SHIFT_IMM5_LSB, IW_SHIFT_IMM5_MSB): Delete. (IW_SHIFT_IMM5_SZ, IW_SHIFT_IMM5_MASK): Delete. (IW_CONTROL_REGNUM_LSB, IW_CONTROL_REGNUM_MSB): Delete. (IW_CONTROL_REGNUM_SZ, IW_CONTROL_REGNUM_MASK): Delete. (OP_MASK_OP, OP_SH_OP): Delete. (OP_MASK_IOP, OP_SH_IOP): Delete. (OP_MASK_IRD, OP_SH_IRD): Delete. (OP_MASK_IRT, OP_SH_IRT): Delete. (OP_MASK_IRS, OP_SH_IRS): Delete. (OP_MASK_ROP, OP_SH_ROP): Delete. (OP_MASK_RRD, OP_SH_RRD): Delete. (OP_MASK_RRT, OP_SH_RRT): Delete. (OP_MASK_RRS, OP_SH_RRS): Delete. (OP_MASK_JOP, OP_SH_JOP): Delete. (OP_MASK_IMM26, OP_SH_IMM26): Delete. (OP_MASK_RCTL, OP_SH_RCTL): Delete. (OP_MASK_IMM5, OP_SH_IMM5): Delete. (OP_MASK_CACHE_OPX, OP_SH_CACHE_OPX): Delete. (OP_MASK_CACHE_RRS, OP_SH_CACHE_RRS): Delete. (OP_MASK_CUSTOM_A, OP_SH_CUSTOM_A): Delete. (OP_MASK_CUSTOM_B, OP_SH_CUSTOM_B): Delete. (OP_MASK_CUSTOM_C, OP_SH_CUSTOM_C): Delete. (OP_MASK_CUSTOM_N, OP_SH_CUSTOM_N): Delete. (OP_<insn>, OPX_<insn>, OP_MATCH_<insn>, OPX_MATCH_<insn>): Delete. (OP_MASK_<insn>, OP_MASK): Delete. (GET_IW_A, GET_IW_B, GET_IW_C, GET_IW_CONTROL_REGNUM): Delete. (GET_IW_IMM16, GET_IW_IMM26, GET_IW_OP, GET_IW_OPX): Delete. Include nios2r1.h to define new instruction opcode constants and accessors. (nios2_builtin_opcodes): Rename to nios2_r1_opcodes. (bfd_nios2_num_builtin_opcodes): Rename to nios2_num_r1_opcodes. (bfd_nios2_num_opcodes): Rename to nios2_num_opcodes. (NUMOPCODES, NUMREGISTERS): Delete. * nios2r1.h: New file. opcodes/ * nios2-opc.c (nios2_builtin_regs): Add regtype field initializers. (nios2_builtin_opcodes): Rename to nios2_r1_opcodes. Use new MATCH_R1_<insn> and MASK_R1_<insn> macros in initializers. Add size and format initializers. Merge 'b' arguments into 'j'. (NIOS2_NUM_OPCODES): Adjust definition. (bfd_nios2_num_builtin_opcodes): Rename to nios2_num_r1_opcodes. (nios2_opcodes): Adjust. (bfd_nios2_num_opcodes): Rename to nios2_num_opcodes. * nios2-dis.c (INSNLEN): Update comment. (nios2_hash_init, nios2_hash): Delete. (OPCODE_HASH_SIZE): New. (nios2_r1_extract_opcode): New. (nios2_disassembler_state): New. (nios2_r1_disassembler_state): New. (nios2_init_opcode_hash): Add state parameter. Adjust to use it. (nios2_find_opcode_hash): Use state object. (bad_opcode): New. (nios2_print_insn_arg): Add op parameter. Use it to access format. Remove 'b' case. (nios2_disassemble): Remove special case for nop. Remove hard-coded instruction size. gas/ * config/tc-nios2.c (nios2_insn_infoS): Add constant_bits field. (nios2_arg_infoS, nios2_arg_hash, nios2_arg_lookup): Delete. (nios2_control_register_arg_p): Delete. (nios2_coproc_reg): Delete. (nios2_relax_frag): Remove hard-coded instruction size. (md_convert_frag): Use new insn accessor macros. (nios2_diagnose_overflow): Remove hard-coded instruction size. (md_apply_fix): Likewise. (bad_opcode): New. (nios2_parse_reg): New. (nios2_assemble_expression): Remove prev_reloc parameter. Adjust uses and callers. (nios2_assemble_arg_c): New. (nios2_assemble_arg_d): New. (nios2_assemble_arg_s): New. (nios2_assemble_arg_t): New. (nios2_assemble_arg_i): New. (nios2_assemble_arg_u): New. (nios2_assemble_arg_o): New. (nios2_assemble_arg_j): New. (nios2_assemble_arg_l): New. (nios2_assemble_arg_m): New. (nios2_assemble_args): New. (nios2_assemble_args_dst): Delete. (nios2_assemble_args_tsi): Delete. (nios2_assemble_args_tsu): Delete. (nios2_assemble_args_sto): Delete. (nios2_assemble_args_o): Delete. (nios2_assemble_args_is): Delete. (nios2_assemble_args_m): Delete. (nios2_assemble_args_s): Delete. (nios2_assemble_args_tis): Delete. (nios2_assemble_args_dc): Delete. (nios2_assemble_args_cs): Delete. (nios2_assemble_args_ds): Delete. (nios2_assemble_args_ldst): Delete. (nios2_assemble_args_none): Delete. (nios2_assemble_args_dsj): Delete. (nios2_assemble_args_d): Delete. (nios2_assemble_args_b): Delete. (nios2_arg_info_structs): Delete. (NIOS2_NUM_ARGS): Delete. (nios2_consume_arg): Remove insn parameter. Use new macros. Don't check register arguments here. Remove 'b' case. (nios2_consume_separator): Move check for missing separators to... (nios2_parse_args): ...here. Remove special case for optional arguments. (output_insn): Avoid using hard-coded insn size. (output_ubranch): Likewise. (output_cbranch): Likewise. (output_call): Use new macros. (output_addi): Likewise. (output_ori): Likewise. (output_xori): Likewise. (output_movia): Likewise. (md_begin): Remove nios2_arg_info_structs initialization. (md_assemble): Initialize constant_bits field. Use nios2_parse_args instead of looking up parse function in hash table. gdb/ * nios2-tdep.c (nios2_analyze_prologue): Use new instruction field accessors and constants from nios2 opcodes update. (nios2_get_next_pc): Likewise.
2014-10-23 18:54:15 +02:00
2014-10-23 Sandra Loosemore <sandra@codesourcery.com>
* nios2-tdep.c (nios2_analyze_prologue): Use new instruction field
accessors and constants from nios2 opcodes update.
(nios2_get_next_pc): Likewise.
2014-10-19 Doug Evans <xdje42@gmail.com>
* gdbthread.h (set_running): Fix comment.
(set_executing, finish_thread_state): Fix comment.
2014-10-18 Doug Evans <xdje42@gmail.com>
* linux-nat.c (linux_nat_wait_1): Make local prev_mask non-static.
2014-10-17 Doug Evans <dje@google.com>
* NEWS: Mention new event gdb.clear_objfiles.
* python/py-event.h (emit_clear_objfiles_event): Clear
* python/py-events.h (events_object): New member clear_objfiles.
* python/py-evts.c (gdbpy_initialize_py_events): Add clear_objfiles
event.
* python/py-inferior.c (python_new_objfile): If objfile is NULL,
emit clear_objfiles event.
* python/py-newobjfileevent.c (create_clear_objfiles_event_object): New
function.
(emit_clear_objfiles_event): New function.
(clear_objfiles): New event.
* python/python-internal.h (gdbpy_initialize_clear_objfiles_event):
Declare.
* python/python.c (_initialize_python): Call
gdbpy_initialize_clear_objfiles_event.
2014-10-17 Doug Evans <dje@google.com>
* NEWS: Mention new gdb.Objfile.progspace attribute.
* python/py-objfile.c (objfpy_get_progspace): New function.
(objfile_getset): New entry for "progspace".
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17471
* infcmd.c (strip_bg_char): Change prototype and rewrite. Now
returns a copy of the input.
(run_command_1, continue_command, step_1, jump_command)
(signal_command, until_command, advance_command, finish_command)
(attach_command): Adjust and install a cleanup to free the
stripped args.
PR gdb/17300: Input after "c -a" crashes readline/GDB If all threads in the target were already running when the user does "c -a", nothing puts the inferior's terminal settings in effect and removes stdin from the event loop, which we must when running a foreground command. The result is that user input afterwards crashes readline/gdb: (gdb) start Temporary breakpoint 1 at 0x4005d4: file continue-all-already-running.c, line 23. Starting program: continue-all-already-running Temporary breakpoint 1, main () at continue-all-already-running.c:23 23 sleep (10); (gdb) c -a& Continuing. (gdb) c -a Continuing. p 1 readline: readline_callback_read_char() called with no handler! Aborted (core dumped) $ Backtrace: Program received signal SIGABRT, Aborted. 0x0000003b36a35877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); (top-gdb) p 1 $1 = 1 (top-gdb) bt #0 0x0000003b36a35877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x0000003b36a36f68 in __GI_abort () at abort.c:89 #2 0x0000000000784aa9 in rl_callback_read_char () at readline/callback.c:116 #3 0x0000000000619181 in rl_callback_read_char_wrapper (client_data=0x0) at gdb/event-top.c:167 #4 0x0000000000619557 in stdin_event_handler (error=0, client_data=0x0) at gdb/event-top.c:373 #5 0x000000000061814a in handle_file_event (data=...) at gdb/event-loop.c:763 #6 0x0000000000617631 in process_event () at gdb/event-loop.c:340 #7 0x00000000006176f8 in gdb_do_one_event () at gdb/event-loop.c:404 #8 0x0000000000617748 in start_event_loop () at gdb/event-loop.c:429 #9 0x00000000006191b3 in cli_command_loop (data=0x0) at gdb/event-top.c:182 #10 0x000000000060f538 in current_interp_command_loop () at gdb/interps.c:318 #11 0x0000000000610701 in captured_command_loop (data=0x0) at gdb/main.c:323 #12 0x000000000060c3f5 in catch_errors (func=0x6106e6 <captured_command_loop>, func_args=0x0, errstring=0x9002c1 "", mask=RETURN_MASK_ALL) at gdb/exceptions.c:237 #13 0x0000000000611bff in captured_main (data=0x7fffffffd780) at gdb/main.c:1151 #14 0x000000000060c3f5 in catch_errors (func=0x610afe <captured_main>, func_args=0x7fffffffd780, errstring=0x9002c1 "", mask=RETURN_MASK_ALL) at gdb/exceptions.c:237 #15 0x0000000000611c28 in gdb_main (args=0x7fffffffd780) at gdb/main.c:1159 #16 0x000000000045ef97 in main (argc=5, argv=0x7fffffffd888) at gdb/gdb.c:32 (top-gdb) Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-10-17 Pedro Alves <palves@redhat.com> PR gdb/17300 * infcmd.c (continue_1): If continuing all threads in the foreground, make sure the inferior's terminal settings are put in effect. gdb/testsuite/ 2014-10-17 Pedro Alves <palves@redhat.com> PR gdb/17300 * gdb.base/continue-all-already-running.c: New file. * gdb.base/continue-all-already-running.exp: New file.
2014-10-17 14:31:25 +02:00
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17300
* infcmd.c (continue_1): If continuing all threads in the
foreground, make sure the inferior's terminal settings are put in
effect.
PR gdb/17472: With annotations, input while executing in the foreground crashes readline/GDB Jan caught an intermittent GDB crash with the annota1.exp test: Starting program: .../gdb/testsuite/gdb.base/annota1 ^M [...] FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout) [...] readline: readline_callback_read_char() called with no handler!^M ERROR: Process no longer exists All we need to is to continue the inferior in the foreground, and type a command while the inferior is running. E.g.: (gdb) set annotate 2 ▒▒pre-prompt (gdb) ▒▒prompt c ▒▒post-prompt Continuing. ▒▒starting ▒▒frames-invalid *inferior is running now* p 1<ret> readline: readline_callback_read_char() called with no handler! Aborted (core dumped) $ When we run a foreground execution command we call target_terminal_inferior to stop GDB from processing input, and to put the inferior's terminal settings in effect. Then we tell readline to hide the prompt with display_gdb_prompt, which clears readline's input callback too. When the target stops, we call target_terminal_ours, which re-installs stdin in the event loop, and then we redisplay the prompt, reinstalling the readline callbacks. However, when annotations are in effect, the "frames-invalid" annotation code calls target_terminal_ours after 'resume' had already called target_terminal_inferior: (top-gdb) bt #0 0x000000000056b82f in annotate_frames_invalid () at gdb/annotate.c:219 #1 0x000000000072e6cc in reinit_frame_cache () at gdb/frame.c:1705 #2 0x0000000000594bb9 in registers_changed_ptid (ptid=...) at gdb/regcache.c:612 #3 0x000000000064cca1 in target_resume (ptid=..., step=1, signal=GDB_SIGNAL_0) at gdb/target.c:2136 #4 0x00000000005f57af in resume (step=1, sig=GDB_SIGNAL_0) at gdb/infrun.c:2263 #5 0x00000000005f6051 in proceed (addr=18446744073709551615, siggnal=GDB_SIGNAL_DEFAULT, step=1) at gdb/infrun.c:2613 And then once we hide the prompt and remove readline's input handler callback, we're in a bad state. We end up with the target running supposedly in the foreground, but with stdin still installed on the event loop. Any input then calls into readline, which aborts because no rl_linefunc callback handler is installed: Program received signal SIGABRT, Aborted. 0x0000003b36a35877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); (top-gdb) bt #0 0x0000003b36a35877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x0000003b36a36f68 in __GI_abort () at abort.c:89 During symbol reading, debug info gives source 9 included from file at zero line 0. During symbol reading, debug info gives command-line macro definition with non-zero line 19: _STDC_PREDEF_H 1. #2 0x0000000000784a25 in rl_callback_read_char () at src/readline/callback.c:116 #3 0x0000000000619111 in rl_callback_read_char_wrapper (client_data=0x0) at src/gdb/event-top.c:167 #4 0x00000000006194e7 in stdin_event_handler (error=0, client_data=0x0) at src/gdb/event-top.c:373 #5 0x00000000006180da in handle_file_event (data=...) at src/gdb/event-loop.c:763 #6 0x00000000006175c1 in process_event () at src/gdb/event-loop.c:340 #7 0x0000000000617688 in gdb_do_one_event () at src/gdb/event-loop.c:404 #8 0x00000000006176d8 in start_event_loop () at src/gdb/event-loop.c:429 #9 0x0000000000619143 in cli_command_loop (data=0x0) at src/gdb/event-top.c:182 #10 0x000000000060f4c8 in current_interp_command_loop () at src/gdb/interps.c:318 #11 0x0000000000610691 in captured_command_loop (data=0x0) at src/gdb/main.c:323 #12 0x000000000060c385 in catch_errors (func=0x610676 <captured_command_loop>, func_args=0x0, errstring=0x900241 "", mask=RETURN_MASK_ALL) at src/gdb/exceptions.c:237 #13 0x0000000000611b8f in captured_main (data=0x7fffffffd7b0) at src/gdb/main.c:1151 #14 0x000000000060c385 in catch_errors (func=0x610a8e <captured_main>, func_args=0x7fffffffd7b0, errstring=0x900241 "", mask=RETURN_MASK_ALL) at src/gdb/exceptions.c:237 #15 0x0000000000611bb8 in gdb_main (args=0x7fffffffd7b0) at src/gdb/main.c:1159 #16 0x000000000045ef57 in main (argc=3, argv=0x7fffffffd8b8) at src/gdb/gdb.c:32 The fix is to make the annotation code call target_terminal_inferior again after printing, if the inferior's settings were in effect. While at it, when we're doing output only, instead of target_terminal_ours, we should call target_terminal_ours_for_output. The latter doesn't actually remove stdin from the event loop, and also leaves SIGINT forwarded to the target. New test included. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-10-17 Pedro Alves <palves@redhat.com> PR gdb/17472 * annotate.c (annotate_breakpoints_invalid): Use target_terminal_our_for_output instead of target_terminal_ours. Give back the terminal to the target. (annotate_frames_invalid): Likewise. gdb/testsuite/ 2014-10-17 Pedro Alves <palves@redhat.com> PR gdb/17472 * gdb.base/annota-input-while-running.c: New file. * gdb.base/annota-input-while-running.exp: New file.
2014-10-17 14:31:25 +02:00
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17472
* annotate.c (annotate_breakpoints_invalid): Use
target_terminal_our_for_output instead of target_terminal_ours.
Give back the terminal to the target.
(annotate_frames_invalid): Likewise.
Make common code handle target_terminal_* idempotency I found a place that should be giving back the terminal to the target, but only if the target was already owning it. So I need to add a getter for who owns the terminal. The trouble is that several places/target have their own globals to track this state: - inflow.c:terminal_is_ours - remote.c:remote_async_terminal_ours_p - linux-nat.c:async_terminal_is_ours - go32-nat.c:terminal_is_ours While one might think of adding a new target_ops method to query this, conceptually, this state isn't really part of a particular target_ops. Considering multi-target, the core shouldn't have to ask all targets to know whether it's GDB that owns the terminal. There's only one GDB (or rather, only one top level interpreter). So what this comment does is add a new global that is tracked by the core instead. A subsequent pass may later remove the other globals. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-10-17 Pedro Alves <palves@redhat.com> * target.c (enum terminal_state): New enum. (terminal_state): New global. (target_terminal_init): New function. (target_terminal_inferior): Skip if inferior already owns the terminal. (target_terminal_ours, target_terminal_ours_for_output): New functions. * target.h (target_terminal_init): Convert to function prototype. (target_terminal_ours_for_output): Convert to function prototype and tweak comment. (target_terminal_ours): Convert to function prototype and tweak comment. * windows-nat.c (do_initial_windows_stuff): Call target_terminal_init instead of child_terminal_init_with_pgrp.
2014-10-17 14:31:25 +02:00
2014-10-17 Pedro Alves <palves@redhat.com>
* target.c (enum terminal_state): New enum.
(terminal_state): New global.
(target_terminal_init): New function.
(target_terminal_inferior): Skip if inferior already owns the
terminal.
(target_terminal_ours, target_terminal_ours_for_output): New
functions.
* target.h (target_terminal_init): Convert to function prototype.
(target_terminal_ours_for_output): Convert to function prototype
and tweak comment.
(target_terminal_ours): Convert to function prototype and tweak
comment.
* windows-nat.c (do_initial_windows_stuff): Call
target_terminal_init instead of child_terminal_init_with_pgrp.
Delete Tru64 support This commit does most of the mechanical removal. IOW, the easy part. procfs.c isn't touched beyond removing a couple obvious bits that are guarded by a couple macros defined in config/alpha/nm-osf3.h. Going beyond that for procfs.c & co would be a harder excision that potentially affects Solaris. Some comments in the generic alpha code ABIs that may still be relevant and I wouldn't know what to do with them. That can always be done on a separate pass, preferably by someone who can test on alpha. A couple other spots have references to OSF/Tru64 and related files being removed, but it felt like removing them would make things worse, not better. We can revisit those when we next need to touch that code. I didn't remove a reference to osf in testsuite/lib/future.exp, as I believe that code is imported from DejaGNU. Built and tested on x86_64 Fedora 20, with --enable-targets=all. Tested that building for --target=alpha-osf3 on x86_64 Fedora 20 fails with: checking for default auto-load directory... $debugdir:$datadir/auto-load checking for default auto-load safe-path... $debugdir:$datadir/auto-load *** Configuration alpha-unknown-osf3 is obsolete. *** Support has been REMOVED. make[1]: *** [configure-gdb] Error 1 make[1]: Leaving directory `build-osf' make: *** [all] Error 2 gdb/ 2014-10-17 Pedro Alves <palves@redhat.com> * Makefile.in (ALL_64_TARGET_OBS): Remove alpha-osf1-tdep.o. (HFILES_NO_SRCDIR): Remove config/alpha/nm-osf3.h. (ALLDEPFILES): Remove alpha-nat.c, alpha-osf1-tdep.c and solib-osf.c. * NEWS: Mention that support for alpha*-*-osf* has been removed. * ada-lang.h [__alpha__ && __osf__] (ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS): Delete. * alpha-nat.c, alpha-osf1-tdep.c: Delete files. * alpha-tdep.c (alpha_gdbarch_init): Remove reference to GDB_OSABI_OSF1. * config/alpha/alpha-osf3.mh, config/alpha/nm-osf3.h: Delete files. * config/djgpp/fnchange.lst (config/alpha/alpha-osf1.mh) (config/alpha/alpha-osf2.mh, config/alpha/alpha-osf3.mh): Delete. * configure: Regenerate. * configure.ac: Remove references to osf. * configure.host: Handle alpha*-*-osf* in the obsolete hosts section. Remove all other references to osf. * configure.tgt: Add alpha*-*-osf* to the obsolete targets section. Remove all other references to osf. * dec-thread.c: Delete file. * defs.h (GDB_OSABI_OSF1): Delete. * inferior.h (START_INFERIOR_TRAPS_EXPECTED): New unconditionally defined. * osabi.c (gdb_osabi_names): Delete "OSF/1". * procfs.c (procfs_debug_inferior) [PROCFS_DONT_TRACE_FAULTS]: Delete code. (unconditionally_kill_inferior) [PROCFS_NEED_CLEAR_CURSIG_FOR_KILL]: Delete code. * solib-osf.c: Delete file. gdb/testsuite/ 2014-10-17 Pedro Alves <palves@redhat.com> * gdb.base/callfuncs.exp: emove references to osf. * gdb.base/sigall.exp: Likewise. * gdb.gdb/selftest.exp: Likewise. * gdb.hp/gdb.base-hp/callfwmall.exp: Likewise. * gdb.mi/non-stop.c: Likewise. * gdb.mi/pthreads.c: Likewise. * gdb.reverse/sigall-precsave.exp: Likewise. * gdb.reverse/sigall-reverse.exp: Likewise. * gdb.threads/pthreads.c: Likewise. * gdb.threads/pthreads.exp: Likewise. gdb/doc/ 2014-10-17 Pedro Alves <palves@redhat.com> * gdb.texinfo (Ada Tasks and Core Files): Delete mention of Tru64. (SVR4 Process Information): Delete mention of OSF/1.
2014-10-17 12:18:59 +02:00
2014-10-17 Pedro Alves <palves@redhat.com>
* Makefile.in (ALL_64_TARGET_OBS): Remove alpha-osf1-tdep.o.
(HFILES_NO_SRCDIR): Remove config/alpha/nm-osf3.h.
(ALLDEPFILES): Remove alpha-nat.c, alpha-osf1-tdep.c and
solib-osf.c.
* NEWS: Mention that support for alpha*-*-osf* has been removed.
* ada-lang.h [__alpha__ && __osf__]
(ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS): Delete.
* alpha-nat.c, alpha-osf1-tdep.c: Delete files.
* alpha-tdep.c (alpha_gdbarch_init): Remove reference to
GDB_OSABI_OSF1.
* config/alpha/alpha-osf3.mh, config/alpha/nm-osf3.h: Delete
files.
* config/djgpp/fnchange.lst (config/alpha/alpha-osf1.mh)
(config/alpha/alpha-osf2.mh, config/alpha/alpha-osf3.mh): Delete.
* configure: Regenerate.
* configure.ac: Remove references to osf.
* configure.host: Handle alpha*-*-osf* in the obsolete hosts
section. Remove all other references to osf.
* configure.tgt: Add alpha*-*-osf* to the obsolete targets section.
Remove all other references to osf.
* dec-thread.c: Delete file.
* defs.h (GDB_OSABI_OSF1): Delete.
* inferior.h (START_INFERIOR_TRAPS_EXPECTED): New unconditionally
defined.
* osabi.c (gdb_osabi_names): Delete "OSF/1".
* procfs.c (procfs_debug_inferior) [PROCFS_DONT_TRACE_FAULTS]:
Delete code.
(unconditionally_kill_inferior)
[PROCFS_NEED_CLEAR_CURSIG_FOR_KILL]: Delete code.
* solib-osf.c: Delete file.
2014-10-17 Pedro Alves <palves@redhat.com>
* remote.c (clear_threads_listing_context): Move higher up, out of
the HAVE_LIBEXPAT guard.
2014-10-16 Tristan Gingold <gingold@adacore.com>
* i386-darwin-nat.c (i386_darwin_fetch_inferior_registers)
(i386_darwin_store_inferior_registers): Sanitize gs and fs values
on amd64.
2014-10-15 Pedro Alves <palves@redhat.com>
* dec-thread.c (dec_thread_count_gdb_threads)
(dec_thread_add_gdb_thread): Delete.
(dec_thread_update_thread_list): Delete.
(dec_thread_find_new_threads): Rename to ...
(dec_thread_update_thread_list): ... this. Delete GDB-size
threads that are no longer found in dec_thread_list.
(resync_thread_list): Delete.
(dec_thread_wait): Call dec_thread_update_thread_list instead of
resync_thread_list.
remote: get rid of all the T packets when syncing the thread list This commit avoids the prune_threads call in the remote target's target_update_thread_list's implementation, eliminating all the "thread alive" RSP traffic (one packet per thread) whenever we fetch the thread list. IOW, this: Sending packet: $Tp2141.2150#82...Packet received: OK Sending packet: $Tp2141.214f#b7...Packet received: OK Sending packet: $Tp2141.2141#82...Packet received: OK ... more T packets; it's one per previously known live thread ... Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p2141.2141" core="2"/>\n<thread id="p2141.214f" core="1"/>\n<thread id="p2141.2150" core="2"/>\n</threads>\n Becomes: Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p2141.2141" core="2"/>\n<thread id="p2141.214f" core="1"/>\n<thread id="p2141.2150" core="2"/>\n</threads>\n Tested on x86_64 Fedora 20, native gdbserver: - tests the qXfer:threads:read method. Tested on x86_64 Fedora 20, native gdbserver with qXfer:threads:read force-disabled in gdbserver: - So that GDB falls back to the qfThreadInfo/qsThreadInfo method. And also manually smoked tested force disabling both qXfer:threads:read and qfThreadInfo/qsThreadInfo in gdbserver. gdb/ 2014-10-15 Pedro Alves <palves@redhat.com> * gdbthread.h (ALL_NON_EXITED_THREADS_SAFE): New macro. * remote.c (remote_update_thread_list): Skip calling prune_threads if any thread listing method is supported, and instead walk over the set of remote threads listed, deleting those that are not found in GDB's thread list.
2014-10-15 23:44:00 +02:00
2014-10-15 Pedro Alves <palves@redhat.com>
* gdbthread.h (ALL_NON_EXITED_THREADS_SAFE): New macro.
* remote.c (remote_update_thread_list): Skip calling prune_threads
if any thread listing method is supported, and instead walk over
the set of remote threads listed, deleting those that are not
found in GDB's thread list.
Push pruning old threads down to the target When GDB wants to sync the thread list with the target's (e.g., due to "info threads"), it calls update_thread_list: update_thread_list (void) { prune_threads (); target_find_new_threads (); update_threads_executing (); } And then prune_threads does: prune_threads (void) { struct thread_info *tp, *next; for (tp = thread_list; tp; tp = next) { next = tp->next; if (!thread_alive (tp)) delete_thread (tp->ptid); } } Calling thread_live on each thread one by one is expensive. E.g., on Linux, it ends up doing kill(SIG0) once for each thread. Not a big deal, but still a bunch of syscalls... With the remote target, it's cumbersome. That thread_alive call ends up generating one T packet per thread: Sending packet: $Tp2141.2150#82...Packet received: OK Sending packet: $Tp2141.214f#b7...Packet received: OK Sending packet: $Tp2141.2141#82...Packet received: OK Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p2141.2141" core="2"/>\n<thread id="p2141.214f" core="1"/>\n<thread id="p2141.2150" core="2"/>\n</threads>\n That seems a bit silly when target_find_new_threads method implementations will always fetch the whole current set of target threads, and then add those that are not in GDB's thread list, to GDB's thread list. This patch thus pushes down the responsibility of pruning dead threads to the target_find_new_threads method instead, so a target may implement pruning dead threads however it wants. Once we do that, target_find_new_threads becomes a misnomer, so the patch renames it to target_update_thread_list. The patch doesn't attempt to do any optimization to any target yet. It simply exports prune_threads, and makes all implementations of target_update_thread_list call that. It's meant to be a no-op. gdb/ 2014-10-15 Pedro Alves <palves@redhat.com> * ada-tasks.c (print_ada_task_info, task_command_1): Adjust. * bsd-uthread.c (bsd_uthread_find_new_threads): Rename to ... (bsd_uthread_update_thread_list): ... this. Call prune_threads. (bsd_uthread_target): Adjust. * corelow.c (core_open): Adjust. * dec-thread.c (dec_thread_find_new_threads): Update comment. (dec_thread_update_thread_list): New function. (init_dec_thread_ops): Adjust. * gdbthread.h (prune_threads): New declaration. * linux-thread-db.c (thread_db_find_new_threads): Rename to ... (thread_db_update_thread_list): ... this. Call prune_threads. (init_thread_db_ops): Adjust. * nto-procfs.c (procfs_find_new_threads): Rename to ... (procfs_update_thread_list): ... this. Call prune_threads. (procfs_attach, procfs_create_inferior, init_procfs_targets): Adjust. * obsd-nat.c (obsd_find_new_threads): Rename to ... (obsd_update_thread_list): ... this. Call prune_threads. (obsd_add_target): Adjust. * procfs.c (procfs_target): Adjust. (procfs_notice_thread): Update comment. (procfs_find_new_threads): Rename to ... (procfs_update_thread_list): ... this. Call prune_threads. * ravenscar-thread.c (ravenscar_update_inferior_ptid): Update comment. (ravenscar_wait): Adjust. (ravenscar_find_new_threads): Rename to ... (ravenscar_update_thread_list): ... this. Call prune_threads. (init_ravenscar_thread_ops): Adjust. * record-btrace.c (record_btrace_find_new_threads): Rename to ... (record_btrace_update_thread_list): ... this. Adjust comment. (init_record_btrace_ops): Adjust. * remote.c (remote_threads_info): Rename to ... (remote_update_thread_list): ... this. Call prune_threads. (remote_start_remote, extended_remote_attach_1, init_remote_ops): Adjust. * sol-thread.c (check_for_thread_db): Adjust. (sol_find_new_threads_callback): Rename to ... (sol_update_thread_list_callback): ... this. (sol_find_new_threads): Rename to ... (sol_update_thread_list): ... this. Call prune_threads. Adjust. (sol_get_ada_task_ptid, init_sol_thread_ops): Adjust. * target-delegates.c: Regenerate. * target.c (target_find_new_threads): Rename to ... (target_update_thread_list): ... this. * target.h (struct target_ops): Rename to_find_new_threads field to to_update_thread_list. (target_find_new_threads): Rename to ... (target_update_thread_list): ... this. * thread.c (prune_threads): Make extern. (update_thread_list): Adjust.
2014-10-15 23:44:00 +02:00
2014-10-15 Pedro Alves <palves@redhat.com>
* ada-tasks.c (print_ada_task_info, task_command_1): Adjust.
* bsd-uthread.c (bsd_uthread_find_new_threads): Rename to ...
(bsd_uthread_update_thread_list): ... this. Call prune_threads.
(bsd_uthread_target): Adjust.
* corelow.c (core_open): Adjust.
* dec-thread.c (dec_thread_find_new_threads): Update comment.
(dec_thread_update_thread_list): New function.
(init_dec_thread_ops): Adjust.
* gdbthread.h (prune_threads): New declaration.
* linux-thread-db.c (thread_db_find_new_threads): Rename to ...
(thread_db_update_thread_list): ... this. Call prune_threads.
(init_thread_db_ops): Adjust.
* nto-procfs.c (procfs_find_new_threads): Rename to ...
(procfs_update_thread_list): ... this. Call prune_threads.
(procfs_attach, procfs_create_inferior, init_procfs_targets):
Adjust.
* obsd-nat.c (obsd_find_new_threads): Rename to ...
(obsd_update_thread_list): ... this. Call prune_threads.
(obsd_add_target): Adjust.
* procfs.c (procfs_target): Adjust.
(procfs_notice_thread): Update comment.
(procfs_find_new_threads): Rename to ...
(procfs_update_thread_list): ... this. Call prune_threads.
* ravenscar-thread.c (ravenscar_update_inferior_ptid): Update
comment.
(ravenscar_wait): Adjust.
(ravenscar_find_new_threads): Rename to ...
(ravenscar_update_thread_list): ... this. Call prune_threads.
(init_ravenscar_thread_ops): Adjust.
* record-btrace.c (record_btrace_find_new_threads): Rename to ...
(record_btrace_update_thread_list): ... this. Adjust comment.
(init_record_btrace_ops): Adjust.
* remote.c (remote_threads_info): Rename to ...
(remote_update_thread_list): ... this. Call prune_threads.
(remote_start_remote, extended_remote_attach_1, init_remote_ops):
Adjust.
* sol-thread.c (check_for_thread_db): Adjust.
(sol_find_new_threads_callback): Rename to ...
(sol_update_thread_list_callback): ... this.
(sol_find_new_threads): Rename to ...
(sol_update_thread_list): ... this. Call prune_threads. Adjust.
(sol_get_ada_task_ptid, init_sol_thread_ops): Adjust.
* target-delegates.c: Regenerate.
* target.c (target_find_new_threads): Rename to ...
(target_update_thread_list): ... this.
* target.h (struct target_ops): Rename to_find_new_threads field
to to_update_thread_list.
(target_find_new_threads): Rename to ...
(target_update_thread_list): ... this.
* thread.c (prune_threads): Make extern.
(update_thread_list): Adjust.
Merge remote thread listing methods We have three methods to list the current remote thread list: 1. The qXfer:threads:read method (the preferred one nowadays), builds a remote thread list while parsing the XML, and then after the XML parsing is done, goes over the built list and adds threads GDB doesn't know about yet to GDB's list. 2. If the qXfer method isn't available, we fallback to using the qfThreadInfo/qsThreadInfo packets. When we do this, we adds threads to GDB's list immediately as we parse the qfThreadInfo/qsThreadInfo packet replies. 3. And then if the previous method isn't available either, we try the old deprecated qL packet. This path is already looking somewhat broken for not using remote_notice_new_inferior to add threads to GDB's list. This patch makes all variants work in two passes, like the qXfer method, and then makes all variants share the code path that adds threads to GDB's list. Tested on x86_64 Fedora 20 with native gdbserver. gdb/ 2014-10-15 Pedro Alves <palves@redhat.com> * remote.c (remote_get_threadlist, remote_threadlist_iterator): Add describing comment. Return -1 if the qL packet is not supported. (struct thread_item, thread_item_t): Move higher up in the file. Add comments. (struct threads_parsing_context): Move higher up in the file, add comments, and remote to ... (struct threads_listing_context): ... this. (remote_newthread_step): Don't add the thread to GDB's thread database here. Instead push it to the thread_listing_context list. (remote_find_new_threads): Rename to ... (remote_get_threads_with_ql): ... this. Add target_ops and targets_listing_context parameters. Pass down context. (start_thread): Adjust. (clear_threads_parsing_context): Rename to ... (clear_threads_listing_context): ... this. (remote_get_threads_with_qxfer): New, with parts salvaged from old remote_threads_info. (remote_get_threads_with_qthreadinfo): Ditto. (remote_threads_info): Reimplement.
2014-10-15 23:43:59 +02:00
2014-10-15 Pedro Alves <palves@redhat.com>
* remote.c (remote_get_threadlist, remote_threadlist_iterator):
Add describing comment. Return -1 if the qL packet is not
supported.
(struct thread_item, thread_item_t): Move higher up in
the file. Add comments.
(struct threads_parsing_context): Move higher up in
the file, add comments, and remote to ...
(struct threads_listing_context): ... this.
(remote_newthread_step): Don't add the thread to GDB's thread
database here. Instead push it to the thread_listing_context
list.
(remote_find_new_threads): Rename to ...
(remote_get_threads_with_ql): ... this. Add target_ops and
targets_listing_context parameters. Pass down context.
(start_thread): Adjust.
(clear_threads_parsing_context): Rename to ...
(clear_threads_listing_context): ... this.
(remote_get_threads_with_qxfer): New, with parts salvaged from old
remote_threads_info.
(remote_get_threads_with_qthreadinfo): Ditto.
(remote_threads_info): Reimplement.
2014-10-15 Pedro Alves <palves@redhat.com>
* infrun.c (resume): Don't force displaced-stepping for all
single-steps on software single-stepping archs.
Make single-step breakpoints be per-thread This patch finally makes each thread have its own set of single-step breakpoints. This paves the way to have multiple threads software single-stepping, though this patch doesn't flip that switch on yet. That'll be done on a subsequent patch. gdb/ 2014-10-15 Pedro Alves <palves@redhat.com> * breakpoint.c (single_step_breakpoints): Delete global. (insert_single_step_breakpoint): Adjust to store the breakpoint pointer in the current thread. (single_step_breakpoints_inserted, remove_single_step_breakpoints) (cancel_single_step_breakpoints): Delete functions. (breakpoint_has_location_inserted_here): Make extern. (single_step_breakpoint_inserted_here_p): Adjust to walk the breakpoint list. * breakpoint.h (breakpoint_has_location_inserted_here): New declaration. (single_step_breakpoints_inserted, remove_single_step_breakpoints) (cancel_single_step_breakpoints): Remove declarations. * gdbthread.h (struct thread_control_state) <single_step_breakpoints>: New field. (delete_single_step_breakpoints) (thread_has_single_step_breakpoints_set) (thread_has_single_step_breakpoint_here): New declarations. * infrun.c (follow_exec): Also clear the single-step breakpoints. (singlestep_breakpoints_inserted_p, singlestep_ptid) (singlestep_pc): Delete globals. (infrun_thread_ptid_changed): Remove references to removed globals. (resume_cleanups): Delete the current thread's single-step breakpoints. (maybe_software_singlestep): Remove references to removed globals. (resume): Adjust to use thread_has_single_step_breakpoints_set and delete_single_step_breakpoints. (init_wait_for_inferior): Remove references to removed globals. (delete_thread_infrun_breakpoints): Delete the thread's single-step breakpoints too. (delete_just_stopped_threads_infrun_breakpoints): Don't delete single-step breakpoints here. (delete_stopped_threads_single_step_breakpoints): New function. (adjust_pc_after_break): Adjust to use thread_has_single_step_breakpoints_set. (handle_inferior_event): Remove references to removed globals. Use delete_stopped_threads_single_step_breakpoints. (handle_signal_stop): Adjust to per-thread single-step breakpoints. Swap test order to do cheaper tests first. (switch_back_to_stepped_thread): Extend debug output. Remove references to removed globals. * record-full.c (record_full_wait_1): Adjust to per-thread single-step breakpoints. * thread.c (delete_single_step_breakpoints) (thread_has_single_step_breakpoints_set) (thread_has_single_step_breakpoint_here): New functions. (clear_thread_inferior_resources): Also delete the thread's single-step breakpoints.
2014-10-15 21:18:32 +02:00
2014-10-15 Pedro Alves <palves@redhat.com>
* breakpoint.c (single_step_breakpoints): Delete global.
(insert_single_step_breakpoint): Adjust to store the breakpoint
pointer in the current thread.
(single_step_breakpoints_inserted, remove_single_step_breakpoints)
(cancel_single_step_breakpoints): Delete functions.
(breakpoint_has_location_inserted_here): Make extern.
(single_step_breakpoint_inserted_here_p): Adjust to walk the
breakpoint list.
* breakpoint.h (breakpoint_has_location_inserted_here): New
declaration.
(single_step_breakpoints_inserted, remove_single_step_breakpoints)
(cancel_single_step_breakpoints): Remove declarations.
* gdbthread.h (struct thread_control_state)
<single_step_breakpoints>: New field.
(delete_single_step_breakpoints)
(thread_has_single_step_breakpoints_set)
(thread_has_single_step_breakpoint_here): New declarations.
* infrun.c (follow_exec): Also clear the single-step breakpoints.
(singlestep_breakpoints_inserted_p, singlestep_ptid)
(singlestep_pc): Delete globals.
(infrun_thread_ptid_changed): Remove references to removed
globals.
(resume_cleanups): Delete the current thread's single-step
breakpoints.
(maybe_software_singlestep): Remove references to removed globals.
(resume): Adjust to use thread_has_single_step_breakpoints_set and
delete_single_step_breakpoints.
(init_wait_for_inferior): Remove references to removed globals.
(delete_thread_infrun_breakpoints): Delete the thread's
single-step breakpoints too.
(delete_just_stopped_threads_infrun_breakpoints): Don't delete
single-step breakpoints here.
(delete_stopped_threads_single_step_breakpoints): New function.
(adjust_pc_after_break): Adjust to use
thread_has_single_step_breakpoints_set.
(handle_inferior_event): Remove references to removed globals.
Use delete_stopped_threads_single_step_breakpoints.
(handle_signal_stop): Adjust to per-thread single-step
breakpoints. Swap test order to do cheaper tests first.
(switch_back_to_stepped_thread): Extend debug output. Remove
references to removed globals.
* record-full.c (record_full_wait_1): Adjust to per-thread
single-step breakpoints.
* thread.c (delete_single_step_breakpoints)
(thread_has_single_step_breakpoints_set)
(thread_has_single_step_breakpoint_here): New functions.
(clear_thread_inferior_resources): Also delete the thread's
single-step breakpoints.
2014-10-15 Pedro Alves <palves@redhat.com>
* thread.c (delete_thread_breakpoint): New function.
(delete_step_resume_breakpoint)
(delete_exception_resume_breakpoint): Use it.
(delete_at_next_stop): New function.
(clear_thread_inferior_resources): Use delete_at_next_stop.
2014-10-15 Pedro Alves <palves@redhat.com>
* breakpoint.c (regular_breakpoint_inserted_here_p): Inline ...
(breakpoint_inserted_here_p): ... here. Remove special case for
software single-step breakpoints.
(find_non_raw_software_breakpoint_inserted_here): Inline ...
(software_breakpoint_inserted_here_p): ... here. Remove special
case for software single-step breakpoints.
(bp_target_info_copy_insertion_state)
(deprecated_insert_raw_breakpoint)
(deprecated_remove_raw_breakpoint): Delete functions.
* breakpoint.h (deprecated_insert_raw_breakpoint)
(deprecated_remove_raw_breakpoint): Remove declarations.
Put single-step breakpoints on the bp_location chain This patch makes single-step breakpoints "real" breakpoints on the global location list. There are several benefits to this: - It removes the currently limitation that only 2 single-step breakpoints can be inserted. See an example here of a discussion around a case that wants more than 2, possibly unbounded: https://sourceware.org/ml/gdb-patches/2014-03/msg00663.html - makes software single-step work on read-only code regions. The logic to convert a software breakpoint to a hardware breakpoint if the memory map says the breakpoint address is in read only memory is in insert_bp_location. Because software single-step breakpoints bypass all that go and straight to target_insert_breakpoint, we can't software single-step over read only memory. This patch removes that limitation, and adds a test that makes sure that works, by forcing a code region to read-only with "mem LOW HIGH ro" and then stepping through that. - Fixes PR breakpoints/9649 This is an assertion failure in insert_single_step_breakpoint in breakpoint.c, because we may leave stale single-step breakpoints behind on error. The tests for stepping through read-only regions exercise the root cause of the bug, which is that we leave single-step breakpoints behind if we fail to insert any single-step breakpoint. Deleting the single-step breakpoints in resume_cleanups, delete_just_stopped_threads_infrun_breakpoints, and fetch_inferior_event fixes this. Without that, we'd no longer hit the assertion, as that code is deleted, but we'd instead run into errors/warnings trying to insert/remove the stale breakpoints on next resume. - Paves the way to have multiple threads software single-stepping at the same time, leaving update_global_location_list to worry about duplicate locations. - Makes the moribund location machinery aware of software single-step breakpoints, paving the way to enable software single-step on non-stop, instead of forcing serialized displaced stepping for all single steps. - It's generaly cleaner. We no longer have to play games with single-step breakpoints inserted at the same address as regular breakpoints, like we recently had to do for 7.8. See this discussion: https://sourceware.org/ml/gdb-patches/2014-06/msg00052.html. Tested on x86_64 Fedora 20, on top of my 'single-step breakpoints on x86' series. gdb/ 2014-10-15 Pedro Alves <palves@redhat.com> PR breakpoints/9649 * breakpoint.c (single_step_breakpoints, single_step_gdbarch): Delete array globals. (single_step_breakpoints): New global. (breakpoint_xfer_memory): Remove special handling for single-step breakpoints. (update_breakpoints_after_exec): Delete bp_single_step breakpoints. (detach_breakpoints): Remove special handling for single-step breakpoints. (breakpoint_init_inferior): Delete bp_single_step breakpoints. (bpstat_stop_status): Add comment. (bpstat_what, bptype_string, print_one_breakpoint_location) (adjust_breakpoint_address, init_bp_location): Handle bp_single_step. (new_single_step_breakpoint): New function. (set_momentary_breakpoint, bkpt_remove_location): Remove special handling for single-step breakpoints. (insert_single_step_breakpoint, single_step_breakpoints_inserted) (remove_single_step_breakpoints, cancel_single_step_breakpoints): Rewrite. (detach_single_step_breakpoints, find_single_step_breakpoint): Delete functions. (breakpoint_has_location_inserted_here): New function. (single_step_breakpoint_inserted_here_p): Rewrite. * breakpoint.h: Remove FIXME. (enum bptype) <bp_single_step>: New enum value. (insert_single_step_breakpoint): Update comment. * infrun.c (resume_cleanups) (delete_step_thread_step_resume_breakpoint): Remove single-step breakpoints. (fetch_inferior_event): Install a cleanup that removes infrun breakpoints. (switch_back_to_stepped_thread) <expect thread advanced also>: Clear step-over info. gdb/testsuite/ 2014-10-15 Pedro Alves <palves@redhat.com> PR breakpoints/9649 * gdb.base/breakpoint-in-ro-region.c (main): Add more instructions. * gdb.base/breakpoint-in-ro-region.exp (probe_target_hardware_step): New procedure. (top level): Probe hardware stepping and hardware breakpoint support. Test stepping through a read-only region, with both "breakpoint auto-hw" on and off and both "always-inserted" on and off.
2014-10-15 21:18:31 +02:00
2014-10-15 Pedro Alves <palves@redhat.com>
PR breakpoints/9649
* breakpoint.c (single_step_breakpoints, single_step_gdbarch):
Delete array globals.
(single_step_breakpoints): New global.
(breakpoint_xfer_memory): Remove special handling for single-step
breakpoints.
(update_breakpoints_after_exec): Delete bp_single_step
breakpoints.
(detach_breakpoints): Remove special handling for single-step
breakpoints.
(breakpoint_init_inferior): Delete bp_single_step breakpoints.
(bpstat_stop_status): Add comment.
(bpstat_what, bptype_string, print_one_breakpoint_location)
(adjust_breakpoint_address, init_bp_location): Handle
bp_single_step.
(new_single_step_breakpoint): New function.
(set_momentary_breakpoint, bkpt_remove_location): Remove special
handling for single-step breakpoints.
(insert_single_step_breakpoint, single_step_breakpoints_inserted)
(remove_single_step_breakpoints, cancel_single_step_breakpoints):
Rewrite.
(detach_single_step_breakpoints, find_single_step_breakpoint):
Delete functions.
(breakpoint_has_location_inserted_here): New function.
(single_step_breakpoint_inserted_here_p): Rewrite.
* breakpoint.h: Remove FIXME.
(enum bptype) <bp_single_step>: New enum value.
(insert_single_step_breakpoint): Update comment.
* infrun.c (resume_cleanups)
(delete_step_thread_step_resume_breakpoint): Remove single-step
breakpoints.
(fetch_inferior_event): Install a cleanup that removes infrun
breakpoints.
(switch_back_to_stepped_thread) <expect thread advanced also>:
Clear step-over info.
2014-10-15 Pedro Alves <palves@redhat.com>
* infrun.c (delete_step_resume_breakpoint_callback): Delete.
(delete_thread_infrun_breakpoints): New function, with parts
salvaged from delete_step_resume_breakpoint_callback.
(delete_step_thread_step_resume_breakpoint): Delete.
(for_each_just_stopped_thread_callback_func): New typedef.
(for_each_just_stopped_thread): New function.
(delete_just_stopped_threads_infrun_breakpoints): New function.
(delete_step_thread_step_resume_breakpoint_cleanup): Rename to ...
(delete_just_stopped_threads_infrun_breakpoints_cleanup):
... this. Adjust.
(wait_for_inferior, fetch_inferior_event): Adjust to renames.
Rewrite non-continuable watchpoints handling When GDB finds out the target triggered a watchpoint, and the target has non-continuable watchpoints, GDB sets things up to step past the instruction that triggered the watchpoint. This is just like stepping past a breakpoint, but goes through a different mechanism - it resumes only the thread that needs to step past the watchpoint, but also switches a "infwait state" global, that has the effect that the next target_wait only wait for events only from that thread. This forcing of a ptid to pass to target_wait obviously becomes a bottleneck if we ever support stepping past different watchpoints simultaneously (in separate processes). It's also unnecessary -- the target should only return events for threads that have been resumed; if no other thread than the one we're stepping past the watchpoint has been resumed, then those other threads should not report events. If we couldn't assume that, then stepping past regular breakpoints would be broken for not likewise forcing a similar infwait_state. So this patch eliminates infwait_state, and instead teaches keep_going to mark step_over_info in a way that has the breakpoints module skip inserting watchpoints (because we're stepping past one), like it skips breakpoints when we're stepping past one. Tested on: - x86_64 Fedora 20 (continuable watchpoints) - PPC64 Fedora 18 (non-steppable watchpoints) gdb/ 2014-10-15 Pedro Alves <palves@redhat.com> * breakpoint.c (should_be_inserted): Don't insert watchpoints if trying to step past a non-steppable watchpoint. * gdbthread.h (struct thread_info) <stepping_over_watchpoint>: New field. * infrun.c (struct step_over_info): Add new field 'nonsteppable_watchpoint_p' and adjust comments. (set_step_over_info): New 'nonsteppable_watchpoint_p' parameter. Adjust. (clear_step_over_info): Clear nonsteppable_watchpoint_p as well. (stepping_past_nonsteppable_watchpoint): New function. (step_over_info_valid_p): Also return true if stepping past a nonsteppable watchpoint. (proceed): Adjust call to set_step_over_info. Remove reference to init_infwait_state. (init_wait_for_inferior): Remove reference to init_infwait_state. (waiton_ptid): Delete global. (struct execution_control_state) <stepped_after_stopped_by_watchpoint>: Delete field. (wait_for_inferior, fetch_inferior_event): Always pass minus_one_ptid to target_wait. (init_thread_stepping_state): Clear 'stepping_over_watchpoint' field. (init_infwait_state): Delete function. (handle_inferior_event): Remove infwait_state handling. (handle_signal_stop) <watchpoints handling>: Adjust after stepped_after_stopped_by_watchpoint removal. Don't remove breakpoints here nor set infwait_state. Set the thread's stepping_over_watchpoint flag, and call keep_going instead. (keep_going): Handle stepping_over_watchpoint. Adjust set_step_over_info calls. * infrun.h (stepping_past_nonsteppable_watchpoint): Declare function.
2014-10-15 21:18:30 +02:00
2014-10-15 Pedro Alves <palves@redhat.com>
* breakpoint.c (should_be_inserted): Don't insert watchpoints if
trying to step past a non-steppable watchpoint.
* gdbthread.h (struct thread_info) <stepping_over_watchpoint>: New
field.
* infrun.c (struct step_over_info): Add new field
'nonsteppable_watchpoint_p' and adjust comments.
(set_step_over_info): New 'nonsteppable_watchpoint_p' parameter.
Adjust.
(clear_step_over_info): Clear nonsteppable_watchpoint_p as well.
(stepping_past_nonsteppable_watchpoint): New function.
(step_over_info_valid_p): Also return true if stepping past a
nonsteppable watchpoint.
(proceed): Adjust call to set_step_over_info. Remove reference to
init_infwait_state.
(init_wait_for_inferior): Remove reference to init_infwait_state.
(waiton_ptid): Delete global.
(struct execution_control_state)
<stepped_after_stopped_by_watchpoint>: Delete field.
(wait_for_inferior, fetch_inferior_event): Always pass
minus_one_ptid to target_wait.
(init_thread_stepping_state): Clear 'stepping_over_watchpoint'
field.
(init_infwait_state): Delete function.
(handle_inferior_event): Remove infwait_state handling.
(handle_signal_stop) <watchpoints handling>: Adjust after
stepped_after_stopped_by_watchpoint removal. Don't remove
breakpoints here nor set infwait_state. Set the thread's
stepping_over_watchpoint flag, and call keep_going instead.
(keep_going): Handle stepping_over_watchpoint. Adjust
set_step_over_info calls.
* infrun.h (stepping_past_nonsteppable_watchpoint): Declare
function.
2014-10-15 Pedro Alves <palves@redhat.com>
* infrun.c (step_over_info_valid_p): New function.
(resume): Use step_over_info_valid_p instead of checking the
threads's trap_expected flag.
2014-10-15 Doug Evans <dje@google.com>
Walfred Tedeschi <walfred.tedeschi@intel.com>
PR python/17364
* python/lib/gdb/__init__.py (packages): Add "printer".
* python/lib/gdb/command/bound_registers.py: Moved to ...
* python/lib/gdb/printer/bound_registers.py: ... here.
Add printer to global set of builtin printers. Rename printer from
"bound" to "mpx_bound128".
* python/lib/gdb/printing.py (_builtin_pretty_printers): New global,
registered as global "builtin" printer.
(add_builtin_pretty_printer): New function.
* data-directory/Makefile.in (PYTHON_FILE_LIST): Update, and add
gdb/printer/__init__.py.
2014-10-15 Iain Buclaw <ibuclaw@gdcproject.org>
* Makefile.in (SFILES): Remove d-support.c.
(COMMON_OBS): Remove d-support.o.
* d-lang.h (d_parse_symbol): Remove declaration.
* d-lang.c (d_demangle): Use gdb_demangle to demangle D symbols.
* d-support.c: Remove file.
2014-10-15 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdb/infrun.c (process_event_stop_test): Apply
gdbarch_addr_bits_remove to longjmp resume address.
2014-10-15 Pedro Alves <palves@redhat.com>
* regformats/microblaze.dat: Delete file.
2014-10-15 Ajit Agarwal <ajitkum@xilinx.com>
* features/Makefile (microblaze-expedite): Replace pc with rpc.
* regformats/microblaze-with-stack-protect.dat: Regenerate.
2014-10-15 Siva Chandra Reddy <sivachandra@google.com>
* gnu-v3-abi.c (gnuv3_pass_by_reference): Treat dynamic classes
as non-trivial.
2014-10-15 Siva Chandra Reddy <sivachandra@google.com>
PR c++/13403
PR c++/15154
* gnu-v3-abi.c (gnuv3_pass_by_reference): Lookup copy constructors
with qualified args.
2014-10-14 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <BINOP_ADD>: Add handling
of the case where the second operand is a pointer.
<BINOP_SUB>: Likewise.
2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com>
* breakpoint.c (bkpt_probe_insert_location): Call set_semaphore
only if it is not NULL.
(bkpt_probe_remove_location): Likewise, for clear_semaphore.
* probe.h (struct probe_ops) <set_semaphore>: Update comment.
(struct probe_ops) <clear_semaphore>: Likewise.
* tracepoint.c (start_tracing): Call set_semaphore only if it is
not NULL.
(stop_tracing): Likewise, for clear_semaphore.
Explicitly use language_c when evaluating a SDT probe argument Joel contacted me offlist with a question about a warning that one of his customers was seeing. The message came from the new linker-debugger interface, which uses SDT probes internally. The warning said: (gdb) run [...] warning: Probes-based dynamic linker interface failed. Reverting to original interface. Argument to arithmetic operation not a number or boolean. This should not have happened in the environment the customer was using (RHEL-6.x), so I found it strange. Another thing caught my attention: the last message, saying "Argument to arithmetic operation not a number or boolean.". Joel kindly investigated the issue further, and found the answer for this. To quote him: (gdb) set lang c (gdb) p 48+$ebp $4 = (void *) 0xffffd0f8 So far so good. But... (gdb) set lang ada (gdb) p 48+$ebp Argument to arithmetic operation not a number or boolean. Ooops! Interestingly, if you revert the order of the operands... (gdb) p $ebp+48 $5 = (access void) 0xffffd0f8 So the problem is doing pointer arithmetics when the language is set to Ada. I remembered that, during the parsing and the evaluation of SDT probe arguments, the code sets the language as current_language, because, at that time, I thought it was not necessary to worry about the language given that the code implements its own parser. I was wrong. So here is a patch to fix that, by setting the language as C, which should guarantee that the maths are done in the right way (TM). It was somewhat hard to find a reproducer for this issue. In the end, what I had to do was to create a testcase that used the %ebp register on some displacement (e.g., "-4(%ebp)"), which finally triggered the bug. I am not sure why I could not trigger it when using other registers, but I did not want to spend too much time investigating this issue, which seemed like an Ada issue. Also, because of this peculiar way to trigger the problem, the testcase only covers x86-like targets (i.e., i*86 and x86_64 with -m32). Joel kindly tested this for me, and it worked. I also ran a full regression test here on my Fedora 20 x86_64, and everything is fine. I will push this patch in a few days if there are no comments. gdb/ChangeLog: 2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com> * stap-probe.c (stap_parse_argument): Initialize expout explicitly using language_c, instead of current_language. gdb/testsuite/ChangeLog: 2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.arch/stap-eval-lang-ada.S: Likewise. * gdb.arch/stap-eval-lang-ada.c: Likewise. * gdb.arch/stap-eval-lang-ada.exp: New file.
2014-10-14 20:31:09 +02:00
2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com>
* stap-probe.c (stap_parse_argument): Initialize expout explicitly
using language_c, instead of current_language.
2014-10-13 Doug Evans <dje@google.com>
2014-10-13 22:33:09 +02:00
* python/py-objfile.c (objfpy_initialize): New function.
(objfpy_new, objfile_to_objfile_object): Call it.
2014-10-13 22:33:09 +02:00
* python/py-progspace.c (pspy_initialize): New function.
(pspy_new, pspace_to_pspace_object): Call it.
2014-10-13 Miroslav Franc <mfranc@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Fix "save breakpoints" for "catch" command.
* break-catch-sig.c (signal_catchpoint_print_recreate): Add trailing
newline.
2014-10-12 Miroslav Franc <mfranc@redhat.com>
Fix "save breakpoints" for "disable $bpnum" command.
* breakpoint.c (save_breakpoints): Add $bpnum for disable.
Delete IRIX support This does most of the mechanical removal. IOW, the easy part. This doesn't touch procfs.c as that'd be a harder excision, potentially affecting Solaris. mips-tdep.c is left alone. E.g., I didn't delete the GDB_OSABI_IRIX enum value, nor references to it in mips-tdep.c. Some comments mentioning IRIX ABIs may still be relevant and I wouldn't know what to do with them. in That can always be done on a separate pass, preferably by someone who can test on MIPS. I didn't remove a reference to IRIX in testsuite/lib/future.exp, as I believe that code is imported from DejaGNU. Built and tested on x86_64 Fedora 20, with --enable-targets=all. Tested that building for --target=mips-sgi-irix6 on x86_64 Fedora 20 fails with: checking for default auto-load directory... $debugdir:$datadir/auto-load checking for default auto-load safe-path... $debugdir:$datadir/auto-load *** Configuration mips-sgi-irix6 is obsolete. *** Support has been REMOVED. make[1]: *** [configure-gdb] Error 1 make[1]: Leaving directory `/home/pedro/gdb/mygit/build-irix' make: *** [all] Error 2 gdb/ 2014-10-10 Pedro Alves <palves@redhat.com> * Makefile.in (ALL_TARGET_OBS): Remove mips-irix-tdep.o and solib-irix.o. (ALLDEPFILES): Remove mips-irix-tdep.c and solib-irix.c. (HFILES_NO_SRCDIR): Remove solib-irix.h. * NEWS: Mention that support for mips-sgi-irix5* mips-sgi-irix6* and been removed. * config/mips/irix5.mh, config/mips/irix6.mh: Delete files. * configure.ac: Remove references to IRIX. * configure.host: Add *-*-irix* to the obsolete hosts section. Remove all other references to irix. * irix5-nat.c, mips-irix-tdep.c, solib-irix.c, solib-irix.h: Delete files. gdb/testsuite/ 2014-10-10 Pedro Alves <palves@redhat.com> * gdb.base/bigcore.exp: Remove references to IRIX. * gdb.base/funcargs.exp: Likewise. * gdb.base/interrupt.exp: Likewise. * gdb.base/mips_pro.exp: Likewise. * gdb.base/nodebug.exp: Likewise. * gdb.base/setvar.exp: Likewise. * lib/gdb.exp (gdb_compile_shlib): Remove mips-sgi-irix* case.
2014-10-10 19:18:52 +02:00
2014-10-10 Pedro Alves <palves@redhat.com>
* Makefile.in (ALL_TARGET_OBS): Remove mips-irix-tdep.o and solib-irix.o.
(ALLDEPFILES): Remove mips-irix-tdep.c and solib-irix.c.
(HFILES_NO_SRCDIR): Remove solib-irix.h.
* NEWS: Mention that support for mips-sgi-irix5* mips-sgi-irix6*
and been removed.
* config/mips/irix5.mh, config/mips/irix6.mh: Delete files.
* configure.ac: Remove references to IRIX.
* configure.host: Add *-*-irix* to the obsolete hosts section.
Remove all other references to irix.
* irix5-nat.c, mips-irix-tdep.c, solib-irix.c, solib-irix.h:
Delete files.
2014-10-10 Ajit Agarwal <ajitkum@xilinx.com>
* microblaze-tdep.c (microblaze_gdbarch_init): If the description
isn't valid, release the tdesc arch data and return NULL.
Cache the vsyscall/vDSO range per-inferior We're now doing a vsyscall/vDSO address range lookup whenever we fetch shared libraries, either through an explicit "info shared", or when the target reports new libraries have been loaded, in order to filter out the vDSO from glibc's DSO list. Before we started doing that, GDB would only ever lookup the vsyscall's address range once in the process's lifetime. Looking up the vDSO address range requires an auxv lookup (which is already cached, so no problem), but also reading the process's mappings from /proc to find out the vDSO's mapping's size. That generates extra RSP traffic when remote debugging. Particularly annoying when the process's mappings grow linearly as more libraries are mapped in, and we went through the trouble of making incremental DSO list updates work against gdbserver (when the probes-based dynamic linker interface is available). The vsyscall/vDSO is mapped by the kernel when the process is initially mapped in, and doesn't change throughout the process's lifetime, so we can cache its address range. Caching at this level brings GDB back to one and only one vsyscall address range lookup per process. Tested on x86_64 Fedora 20. gdb/ 2014-10-10 Pedro Alves <palves@redhat.com> * linux-tdep.c: Include observer.h. (linux_inferior_data): New global. (struct linux_info): New structure. (invalidate_linux_cache_inf, linux_inferior_data_cleanup) (get_linux_inferior_data): New functions. (linux_vsyscall_range): Rename to ... (linux_vsyscall_range_raw): ... this. (linux_vsyscall_range): New function; handles caching. (_initialize_linux_tdep): Register linux_inferior_data. Install inferior_exit and inferior_appeared observers.
2014-10-10 16:57:14 +02:00
2014-10-10 Pedro Alves <palves@redhat.com>
* linux-tdep.c: Include observer.h.
(linux_inferior_data): New global.
(struct linux_info): New structure.
(invalidate_linux_cache_inf, linux_inferior_data_cleanup)
(get_linux_inferior_data): New functions.
(linux_vsyscall_range): Rename to ...
(linux_vsyscall_range_raw): ... this.
(linux_vsyscall_range): New function; handles caching.
(_initialize_linux_tdep): Register linux_inferior_data. Install
inferior_exit and inferior_appeared observers.
PR symtab/14466: Work around PR libc/13097 "linux-vdso.so.1" With upstream glibc, GDB prints: warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? A bug's been filed for glibc a few years back: http://sourceware.org/bugzilla/show_bug.cgi?id=13097 but it's still not resolved. It's not clear whether there's even consensus that this is indeed a glibc bug. It would actually be nice if GDB also listed the vDSO in the shared library list, but there are some design considerations with that: - the vDSO is mapped by the kernel, not userspace, therefore we should load its symbols right from the process's start of life, even before glibc / the userspace loader sets up the initial DSO list. The program might even be using a custom loader or no loader. - that kind of hints at that solib.c should handle retrieving shared library lists from more than one source, and that symfile-mem.c's loading of the vDSO would be converted to load and relocate the vDSO's bfd behind the target_so_ops interface. - and then, once glibc links in the vDSO to its DSO list, we'd need to either: a) somehow hand over the vDSO from one target_so_ops to the other b) simply keep hiding glibc's entry. And then b) seems the simplest. With that in mind, this patch simply discards the vDSO from glibc's reported shared library list. We can match the vDSO address range with the addresses found iterating the dynamic linker list, to tell which dynamic linker entry is the vDSO. Tested on x86_64 Fedora 20. gdb/ 2014-10-10 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> PR symtab/14466 * solib-svr4.c (svr4_read_so_list): Rename to ... (svr4_current_sos_1): ... this and change the function comment. (svr4_current_sos): New function. gdb/testsuite/ 2014-10-10 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> PR symtab/14466 * gdb.base/vdso-warning.c: New file. * gdb.base/vdso-warning.exp: New file.
2014-10-10 16:57:13 +02:00
2014-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <palves@redhat.com>
PR symtab/14466
* solib-svr4.c (svr4_read_so_list): Rename to ...
(svr4_current_sos_1): ... this and change the function comment.
(svr4_current_sos): New function.
2014-10-10 Pedro Alves <palves@redhat.com>
* arch-utils.c (default_vsyscall_range): New function.
* arch-utils.h (default_vsyscall_range): New declaration.
* gdbarch.sh (vsyscall_range): New hook.
* gdbarch.h, gdbarch.c: Regenerate.
* linux-tdep.c (linux_vsyscall_range): New function.
(linux_init_abi): Install linux_vsyscall_range as
vsyscall_range gdbarch hook.
* memrange.c (address_in_mem_range): New function.
* memrange.h (address_in_mem_range): New declaration.
* symfile-mem.c (find_vdso_size): Delete function.
(add_vsyscall_page): Use gdbarch_vsyscall_range.
2014-10-10 Pedro Alves <palves@redhat.com>
* infrun.c (normal_stop): Fix typo in comment.
2014-10-09 Sergio Durigan Junior <sergiodj@redhat.com>
PR tdep/9390
* xstorxstormy16-tdep.c (xstormy16_analyze_prologue): Fix possible
typo when using logical AND to determine instruction type.
2014-10-09 Yao Qi <yao@codesourcery.com>
* infrun.c (handle_signal_stop): Remove local variable
'printed'.
2014-10-08 Stan Shebs <stan@codesourcery.com>
* MAINTAINERS (GLOBAL MAINTAINERS): Add Yao Qi.
2014-10-08 Gary Benson <gbenson@redhat.com>
* fbsd-tdep.c: Do not include string.h or gdb_assert.h.
2014-10-08 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include common-exceptions.h.
* exceptions.h: Do not include common-exceptions.h.
2014-10-08 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include cleanups.h.
* common/common-exceptions.c: Do not include cleanups.h.
* utils.h: Likewise.
Remove spurious exceptions.h inclusions defs.h includes utils.h, and utils.h includes exceptions.h. All GDB .c files include defs.h as their first line, so no file other than utils.h needs to include exceptions.h. This commit removes all such inclusions. gdb/ChangeLog: * ada-lang.c: Do not include exceptions.h. * ada-valprint.c: Likewise. * amd64-tdep.c: Likewise. * auto-load.c: Likewise. * block.c: Likewise. * break-catch-throw.c: Likewise. * breakpoint.c: Likewise. * btrace.c: Likewise. * c-lang.c: Likewise. * cli/cli-cmds.c: Likewise. * cli/cli-interp.c: Likewise. * cli/cli-script.c: Likewise. * completer.c: Likewise. * corefile.c: Likewise. * corelow.c: Likewise. * cp-abi.c: Likewise. * cp-support.c: Likewise. * cp-valprint.c: Likewise. * darwin-nat.c: Likewise. * dwarf2-frame-tailcall.c: Likewise. * dwarf2-frame.c: Likewise. * dwarf2loc.c: Likewise. * dwarf2read.c: Likewise. * eval.c: Likewise. * event-loop.c: Likewise. * event-top.c: Likewise. * f-valprint.c: Likewise. * frame-unwind.c: Likewise. * frame.c: Likewise. * gdbtypes.c: Likewise. * gnu-v2-abi.c: Likewise. * gnu-v3-abi.c: Likewise. * guile/scm-auto-load.c: Likewise. * guile/scm-breakpoint.c: Likewise. * guile/scm-cmd.c: Likewise. * guile/scm-frame.c: Likewise. * guile/scm-lazy-string.c: Likewise. * guile/scm-param.c: Likewise. * guile/scm-symbol.c: Likewise. * guile/scm-type.c: Likewise. * hppa-hpux-tdep.c: Likewise. * i386-tdep.c: Likewise. * inf-loop.c: Likewise. * infcall.c: Likewise. * infcmd.c: Likewise. * infrun.c: Likewise. * interps.c: Likewise. * interps.h: Likewise. * jit.c: Likewise. * linespec.c: Likewise. * linux-nat.c: Likewise. * linux-thread-db.c: Likewise. * m32r-rom.c: Likewise. * main.c: Likewise. * memory-map.c: Likewise. * mi/mi-cmd-break.c: Likewise. * mi/mi-cmd-stack.c: Likewise. * mi/mi-interp.c: Likewise. * mi/mi-main.c: Likewise. * monitor.c: Likewise. * nto-procfs.c: Likewise. * objc-lang.c: Likewise. * p-valprint.c: Likewise. * parse.c: Likewise. * ppc-linux-tdep.c: Likewise. * printcmd.c: Likewise. * probe.c: Likewise. * python/py-auto-load.c: Likewise. * python/py-breakpoint.c: Likewise. * python/py-cmd.c: Likewise. * python/py-finishbreakpoint.c: Likewise. * python/py-frame.c: Likewise. * python/py-framefilter.c: Likewise. * python/py-function.c: Likewise. * python/py-gdb-readline.c: Likewise. * python/py-inferior.c: Likewise. * python/py-infthread.c: Likewise. * python/py-lazy-string.c: Likewise. * python/py-linetable.c: Likewise. * python/py-param.c: Likewise. * python/py-prettyprint.c: Likewise. * python/py-symbol.c: Likewise. * python/py-type.c: Likewise. * python/py-value.c: Likewise. * python/python-internal.h: Likewise. * python/python.c: Likewise. * record-btrace.c: Likewise. * record-full.c: Likewise. * regcache.c: Likewise. * remote-fileio.c: Likewise. * remote-mips.c: Likewise. * remote.c: Likewise. * rs6000-aix-tdep.c: Likewise. * rs6000-nat.c: Likewise. * skip.c: Likewise. * solib-darwin.c: Likewise. * solib-dsbt.c: Likewise. * solib-frv.c: Likewise. * solib-ia64-hpux.c: Likewise. * solib-spu.c: Likewise. * solib-svr4.c: Likewise. * solib.c: Likewise. * spu-tdep.c: Likewise. * stack.c: Likewise. * stap-probe.c: Likewise. * symfile-mem.c: Likewise. * symmisc.c: Likewise. * target.c: Likewise. * thread.c: Likewise. * top.c: Likewise. * tracepoint.c: Likewise. * tui/tui-interp.c: Likewise. * typeprint.c: Likewise. * utils.c: Likewise. * valarith.c: Likewise. * valops.c: Likewise. * valprint.c: Likewise. * value.c: Likewise. * varobj.c: Likewise. * windows-nat.c: Likewise. * xml-support.c: Likewise.
2014-10-08 10:33:22 +02:00
2014-10-08 Gary Benson <gbenson@redhat.com>
* ada-lang.c: Do not include exceptions.h.
* ada-valprint.c: Likewise.
* amd64-tdep.c: Likewise.
* auto-load.c: Likewise.
* block.c: Likewise.
* break-catch-throw.c: Likewise.
* breakpoint.c: Likewise.
* btrace.c: Likewise.
* c-lang.c: Likewise.
* cli/cli-cmds.c: Likewise.
* cli/cli-interp.c: Likewise.
* cli/cli-script.c: Likewise.
* completer.c: Likewise.
* corefile.c: Likewise.
* corelow.c: Likewise.
* cp-abi.c: Likewise.
* cp-support.c: Likewise.
* cp-valprint.c: Likewise.
* darwin-nat.c: Likewise.
* dwarf2-frame-tailcall.c: Likewise.
* dwarf2-frame.c: Likewise.
* dwarf2loc.c: Likewise.
* dwarf2read.c: Likewise.
* eval.c: Likewise.
* event-loop.c: Likewise.
* event-top.c: Likewise.
* f-valprint.c: Likewise.
* frame-unwind.c: Likewise.
* frame.c: Likewise.
* gdbtypes.c: Likewise.
* gnu-v2-abi.c: Likewise.
* gnu-v3-abi.c: Likewise.
* guile/scm-auto-load.c: Likewise.
* guile/scm-breakpoint.c: Likewise.
* guile/scm-cmd.c: Likewise.
* guile/scm-frame.c: Likewise.
* guile/scm-lazy-string.c: Likewise.
* guile/scm-param.c: Likewise.
* guile/scm-symbol.c: Likewise.
* guile/scm-type.c: Likewise.
* hppa-hpux-tdep.c: Likewise.
* i386-tdep.c: Likewise.
* inf-loop.c: Likewise.
* infcall.c: Likewise.
* infcmd.c: Likewise.
* infrun.c: Likewise.
* interps.c: Likewise.
* interps.h: Likewise.
* jit.c: Likewise.
* linespec.c: Likewise.
* linux-nat.c: Likewise.
* linux-thread-db.c: Likewise.
* m32r-rom.c: Likewise.
* main.c: Likewise.
* memory-map.c: Likewise.
* mi/mi-cmd-break.c: Likewise.
* mi/mi-cmd-stack.c: Likewise.
* mi/mi-interp.c: Likewise.
* mi/mi-main.c: Likewise.
* monitor.c: Likewise.
* nto-procfs.c: Likewise.
* objc-lang.c: Likewise.
* p-valprint.c: Likewise.
* parse.c: Likewise.
* ppc-linux-tdep.c: Likewise.
* printcmd.c: Likewise.
* probe.c: Likewise.
* python/py-auto-load.c: Likewise.
* python/py-breakpoint.c: Likewise.
* python/py-cmd.c: Likewise.
* python/py-finishbreakpoint.c: Likewise.
* python/py-frame.c: Likewise.
* python/py-framefilter.c: Likewise.
* python/py-function.c: Likewise.
* python/py-gdb-readline.c: Likewise.
* python/py-inferior.c: Likewise.
* python/py-infthread.c: Likewise.
* python/py-lazy-string.c: Likewise.
* python/py-linetable.c: Likewise.
* python/py-param.c: Likewise.
* python/py-prettyprint.c: Likewise.
* python/py-symbol.c: Likewise.
* python/py-type.c: Likewise.
* python/py-value.c: Likewise.
* python/python-internal.h: Likewise.
* python/python.c: Likewise.
* record-btrace.c: Likewise.
* record-full.c: Likewise.
* regcache.c: Likewise.
* remote-fileio.c: Likewise.
* remote-mips.c: Likewise.
* remote.c: Likewise.
* rs6000-aix-tdep.c: Likewise.
* rs6000-nat.c: Likewise.
* skip.c: Likewise.
* solib-darwin.c: Likewise.
* solib-dsbt.c: Likewise.
* solib-frv.c: Likewise.
* solib-ia64-hpux.c: Likewise.
* solib-spu.c: Likewise.
* solib-svr4.c: Likewise.
* solib.c: Likewise.
* spu-tdep.c: Likewise.
* stack.c: Likewise.
* stap-probe.c: Likewise.
* symfile-mem.c: Likewise.
* symmisc.c: Likewise.
* target.c: Likewise.
* thread.c: Likewise.
* top.c: Likewise.
* tracepoint.c: Likewise.
* tui/tui-interp.c: Likewise.
* typeprint.c: Likewise.
* utils.c: Likewise.
* valarith.c: Likewise.
* valops.c: Likewise.
* valprint.c: Likewise.
* value.c: Likewise.
* varobj.c: Likewise.
* windows-nat.c: Likewise.
* xml-support.c: Likewise.
2014-10-05 Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.c (add_offset_16): Rewrite to implement what the
name implies.
(extended_mips16_next_pc): Update accordingly.
MIPS: Correct heuristic prologue termination conditions This change addresses a regression in gdb.dwarf2/dw2-skip-prologue.exp across MIPS16 multilibs: (gdb) file .../gdb.dwarf2/dw2-skip-prologue Reading symbols from .../gdb.d/gdb.dwarf2/dw2-skip-prologue...done. (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break main warning: Breakpoint address adjusted from 0x00400725 to 0x00400721. Breakpoint 1 at 0x400721 (gdb) set remotetimeout 5 (gdb) kill The program is not being run. (gdb) [...] target remote ...:2345 Reading symbols from .../mips16/lib/ld.so.1...done. warning: Breakpoint address adjusted from 0x00400725 to 0x00400721. warning: Breakpoint address adjusted from 0x00400725 to 0x00400721. 0x2aaa8e81 in __start () from .../mips16/lib/ld.so.1 (gdb) continue Continuing. warning: Breakpoint address adjusted from 0x00400725 to 0x00400721. warning: Breakpoint 1 address previously adjusted from 0x00400725 to 0x00400721. Breakpoint 1, 0x00400721 in main () (gdb) break func Breakpoint 2 at 0x4006a1: func. (2 locations) (gdb) continue Continuing. warning: GDB can't find the start of the function at 0x4006dd. GDB is unable to find the start of the function at 0x4006dd and thus can't determine the size of that function's stack frame. This means that GDB may be unable to access that stack frame, or the frames below it. This problem is most likely caused by an invalid program counter or stack pointer. However, if you think GDB should simply search farther back from 0x4006dd for code which looks like the beginning of a function, you can increase the range of the search using the `set heuristic-fence-post' command. Program received signal SIGBUS, Bus error. 0x0040072b in main () (gdb) FAIL: gdb.dwarf2/dw2-skip-prologue.exp: continue to breakpoint: func -- notice the breakpoint adjustment messages that are already a bad sign. These happen when a breakpoint is requested in a branch delay slot and are not supposed to happen unless explicitly requested with an address pointing to a branch delay slot instruction. No symbol or line debug information is supposed to direct GDB to place a breakpoint in a delay slot. Here's how `main' looks like: 00400718 <main>: 400718: 64f5 save 40,ra,s0-s1 40071a: 1a00 01a8 jal 4006a0 <func> 40071e: 0104 addiu s1,sp,16 400720: 1a00 01b7 jal 4006dc <func+0x3c> 400724: 6702 move s0,v0 400726: e049 addu v0,s0,v0 400728: 65b9 move sp,s1 40072a: 6473 restore 24,ra,s0-s1 40072c: e8a0 jrc ra 40072e: 6500 nop -- so 0x400725 is the MIPS16 instruction address of the first MOVE instruction seen above, in a delay slot of the preceding JAL instruction indeed. This test case arranges for `main' to have no debug information so it is one of the heuristic prologue scanners, `mips16_scan_prologue' specifically in this case, that is responsible for finding the right location for the breakpoint to place. In this case the prologue really ends with the ADDIU instruction, reordered into the delay slot of the first JAL instruction. Of course we can't place the breakpoint for `main' after it as by doing so we'll let `func' to be called before hitting this breakpoint. So the breakpoint has to go at the JAL instruction instead, or 0x40071b. To make a general case out of it we must never consider any jump or branch instruction to be a part of a function's prologue. In the presence of a jump or branch at the beginning of a function the furthest instruction examined for the purpose of constructing frame information can be one in the delay slot of that jump or branch if present, and otherwise -- that is when the jump or branch is compact and has no delay slot -- the instruction immediately preceding the jump or branch. This change implements that approach across prologue scanners for the three instruction ISAs. In implementing it I have factored out code from the existing `*_instruction_has_delay_slot' handlers to be shared and a side effect for the microMIPS implementation is it now always fetches the second 16-bit halfword of 32-bit instructions even if it eventually is not going to be needed. I think it's an acceptable tradeoff for the purpose of code sharing. To make things more consistent I also carried logic from `micromips_scan_prologue' over to the other two scanners to accept (and ignore) a single non-prologue non-control transfer instruction reordered by the compiler into the prologue. While doing this I simplified the exit path from the scan loop such that `end_prologue_addr' is set only once. This made some concerns expressed in comments no longer applicable, although even before they were not valid. I have not fixed the logic around `load_immediate_bytes' in `mips32_scan_prologue' though, it remains broken, although I took care not to break it more. An approach similar to one taken for handling larger stack adjustments in `micromips_scan_prologue' will have to be eventually implemented here. For regression testing I used my usual choice of the mips-linux-gnu target and the following multilibs: -EB -EB -msoft-float -EB -mips16 -EB -mips16 -msoft-float -EB -mmicromips -EB -mmicromips -msoft-float -EB -mabi=n32 -EB -mabi=n32 -msoft-float -EB -mabi=64 -EB -mabi=64 -msoft-float and the -EL variants of same. That removed gdb.dwarf2/dw2-skip-prologue.exp failures across MIPS16 multilibs, the test log now shows: (gdb) file .../gdb.dwarf2/dw2-skip-prologue Reading symbols from .../gdb.d/gdb.dwarf2/dw2-skip-prologue...done. (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break main Breakpoint 1 at 0x40071b (gdb) set remotetimeout 5 (gdb) kill The program is not being run. (gdb) [...] target remote ...:2345 Reading symbols from .../mips16/lib/ld.so.1...done. 0x2aaa8e81 in __start () from .../mips16/lib/ld.so.1 (gdb) continue Continuing. Breakpoint 1, 0x0040071b in main () (gdb) break func Breakpoint 2 at 0x4006a1: func. (2 locations) (gdb) continue Continuing. Breakpoint 2, func (param=0) at main.c:5 5 This program is free software; you can redistribute it and/or modify (gdb) PASS: gdb.dwarf2/dw2-skip-prologue.exp: continue to breakpoint: func -- so things look like intended. That also did regress, again across MIPS16 multilibs, another test case, gdb.base/step-symless.exp: (gdb) file .../gdb.d/gdb.base/step-symless Reading symbols from .../gdb.base/step-symless...done. (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break main Breakpoint 1 at 0x4006d3 (gdb) set remotetimeout 5 (gdb) kill The program is not being run. (gdb) [...] target remote ...:2345 Reading symbols from .../mips16/lib/ld.so.1...done. 0x2aaa8e81 in __start () from .../mips16/lib/ld.so.1 (gdb) continue Continuing. Breakpoint 1, 0x004006d3 in main () (gdb) break symful Breakpoint 2 at 0x4006a5 (gdb) step Single stepping until exit from function main, which has no line number information. warning: GDB can't find the start of the function at 0x4006b9. GDB is unable to find the start of the function at 0x4006b9 and thus can't determine the size of that function's stack frame. This means that GDB may be unable to access that stack frame, or the frames below it. This problem is most likely caused by an invalid program counter or stack pointer. However, if you think GDB should simply search farther back from 0x4006b9 for code which looks like the beginning of a function, you can increase the range of the search using the `set heuristic-fence-post' command. 0x004006b9 in ?? () (gdb) FAIL: gdb.base/step-symless.exp: step -- but that is actually a good sign. Here `main', again, has no debug information and code involved looks like: 004006a0 <symful>: 4006a0: 6491 save 8,s1 4006a2: 673d move s1,sp 4006a4: b204 lw v0,4006b4 <symful+0x14> 4006a6: 9a40 lw v0,0(v0) 4006a8: 4261 addiu v1,v0,1 4006aa: b203 lw v0,4006b4 <symful+0x14> 4006ac: da60 sw v1,0(v0) 4006ae: 65b9 move sp,s1 4006b0: 6411 restore 8,s1 4006b2: e8a0 jrc ra 4006b4: 0041 addiu s0,sp,260 4006b6: 0860 la s0,400834 <__libc_start_main@mips16plt+0x54> 4006b8: 6491 save 8,s1 4006ba: 673d move s1,sp 4006bc: b204 lw v0,4006cc <symful+0x2c> 4006be: 9a40 lw v0,0(v0) 4006c0: 4261 addiu v1,v0,1 4006c2: b203 lw v0,4006cc <symful+0x2c> 4006c4: da60 sw v1,0(v0) 4006c6: 65b9 move sp,s1 4006c8: 6411 restore 8,s1 4006ca: e8a0 jrc ra 4006cc: 0041 addiu s0,sp,260 4006ce: 0860 la s0,40084c <__libc_start_main@mips16plt+0x6c> 004006d0 <main>: 4006d0: 64d4 save 32,ra,s1 4006d2: 1a00 01ae jal 4006b8 <symful+0x18> 4006d6: 0104 addiu s1,sp,16 4006d8: 1a00 01a8 jal 4006a0 <symful> 4006dc: 6500 nop 4006de: 6740 move v0,zero 4006e0: 65b9 move sp,s1 4006e2: 6452 restore 16,ra,s1 4006e4: e8a0 jrc ra 4006e6: 6500 nop 4006e8: 6500 nop 4006ea: 6500 nop 4006ec: 6500 nop 4006ee: 6500 nop -- and the original log: (gdb) file .../gdb.base/step-symless Reading symbols from .../gdb.base/step-symless...done. (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break main warning: Breakpoint address adjusted from 0x004006dd to 0x004006d9. Breakpoint 1 at 0x4006d9 (gdb) set remotetimeout 5 (gdb) kill The program is not being run. (gdb) [...] target remote ...:2345 Reading symbols from .../mips16/lib/ld.so.1...done. warning: Breakpoint address adjusted from 0x004006dd to 0x004006d9. warning: Breakpoint address adjusted from 0x004006dd to 0x004006d9. 0x2aaa8e81 in __start () from .../mips16/lib/ld.so.1 (gdb) continue Continuing. warning: Breakpoint address adjusted from 0x004006dd to 0x004006d9. warning: Breakpoint 1 address previously adjusted from 0x004006dd to 0x004006d9. Breakpoint 1, 0x004006d9 in main () (gdb) break symful Breakpoint 2 at 0x4006a5 (gdb) step Single stepping until exit from function main, which has no line number information. Breakpoint 2, 0x004006a5 in symful () (gdb) PASS: gdb.base/step-symless.exp: step So the breakpoint at `main' was actually set at an instruction after the call to `symful+0x18' aka `symless' and the test only passed because single-stepping through `symless' wasn't actually done at all. With this change in place this test fails for MIPS16 multilibs consistently with all the other multilibs where it already failed in this manner previously. * mips-tdep.c (mips16_instruction_is_compact_branch): New function. (micromips_instruction_is_compact_branch): Likewise. (mips16_scan_prologue): Terminate scanning upon seeing a branch or a compact jump, reaching a jump delay slot, or seeing a second non-prologue instruction. (micromips_scan_prologue): Also terminate scanning upon seeing a compact branch or jump, or reaching a branch or jump delay slot. (mips32_scan_prologue): Terminate scanning upon reaching a branch or jump delay slot, or seeing a second non-prologue instruction. (mips32_instruction_has_delay_slot): Retain instruction examination code only, update arguments accordingly and move instruction fetch pieces to... (mips32_insn_at_pc_has_delay_slot): ... this new function. (micromips_instruction_has_delay_slot): Likewise and to... (micromips_insn_at_pc_has_delay_slot): ... this new function. (mips16_instruction_has_delay_slot): Likewise and to... (mips16_insn_at_pc_has_delay_slot): ... this new function. (mips_single_step_through_delay): Update accordingly. (mips_adjust_breakpoint_address): Likewise.
2014-10-05 23:39:52 +02:00
2014-10-05 Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.c (mips16_instruction_is_compact_branch): New
function.
(micromips_instruction_is_compact_branch): Likewise.
(mips16_scan_prologue): Terminate scanning upon seeing a branch
or a compact jump, reaching a jump delay slot, or seeing a
second non-prologue instruction.
(micromips_scan_prologue): Also terminate scanning upon seeing a
compact branch or jump, or reaching a branch or jump delay slot.
(mips32_scan_prologue): Terminate scanning upon reaching a branch
or jump delay slot, or seeing a second non-prologue instruction.
(mips32_instruction_has_delay_slot): Retain instruction
examination code only, update arguments accordingly and move
instruction fetch pieces to...
(mips32_insn_at_pc_has_delay_slot): ... this new function.
(micromips_instruction_has_delay_slot): Likewise and to...
(micromips_insn_at_pc_has_delay_slot): ... this new function.
(mips16_instruction_has_delay_slot): Likewise and to...
(mips16_insn_at_pc_has_delay_slot): ... this new function.
(mips_single_step_through_delay): Update accordingly.
(mips_adjust_breakpoint_address): Likewise.
2014-10-05 Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.c (micromips_instruction_has_delay_slot): When
!mustbe32 also return 1 for 32-bit instructions.
(mips16_instruction_has_delay_slot): Likewise. Add an
explanatory comment.
2014-10-03 Maciej W. Rozycki <macro@codesourcery.com>
* elfread.c (elf_symtab_read): Also mark solib trampoline minimal
symbols special.
Avoid software breakpoint's instruction shadow inconsistency This change: commit b775012e845380ed4c7421a1b87caf7bfae39f5f Author: Luis Machado <luisgpm@br.ibm.com> Date: Fri Feb 24 15:10:59 2012 +0000 2012-02-24 Luis Machado <lgustavo@codesourcery.com> * remote.c (remote_supports_cond_breakpoints): New forward declaration. [...] changed the way breakpoints are inserted and removed such that `insert_bp_location' can now be called with the breakpoint being handled already in place, while previously the call was only ever made for breakpoints that have not been put in place. This in turn caused an issue for software breakpoints and targets for which a breakpoint's `placed_address' may not be the same as the original requested address. The issue is `insert_bp_location' overwrites the previously adjusted value in `placed_address' with the original address, that is only replaced back with the correct adjusted address later on when `gdbarch_breakpoint_from_pc' is called. Meanwhile there's a window where the value in `placed_address' does not correspond to data stored in `shadow_contents', leading to incorrect instruction bytes being supplied when `one_breakpoint_xfer_memory' is called to supply the instruction overlaid by the breakpoint. And this is exactly what happens on the MIPS target with software breakpoints placed in microMIPS code. In this case not only `placed_address' is not the original address because of the ISA bit, but `mips_breakpoint_from_pc' has to read the original instruction to determine which one of the two software breakpoint instruction encodings to choose as well. The 16-bit encoding is used to replace 16-bit instructions and similarly the 32-bit one is used with 32-bit instructions, to satisfy branch delay slot size requirements. The mismatch between `placed_address' and the address data in `shadow_contents' has been obtained from leads to the wrong encoding being used in some cases, which in the case of a 32-bit software breakpoint instruction replacing a 16-bit instruction causes corruption to the adjacent following instruction and leads the debug session astray if execution reaches there e.g. with a jump. To address this problem I made the change below, that adds a `reqstd_address' field to `struct bp_target_info' and leaves `placed_address' unchanged once it has been set. This ensures data in `shadow_contents' is always consistent with `placed_address'. This approach also has this good side effect that all the places that examine the breakpoint's address see a consistent value, either `reqstd_address' or `placed_address', as required. Currently some places see either the original or the adjusted address in `placed_address', depending on whether they have been called before `gdbarch_remote_breakpoint_from_pc' or afterwards. This is in particular true for subsequent calls to `gdbarch_remote_breakpoint_from_pc' itself, e.g. from `one_breakpoint_xfer_memory'. This is also important for places like `find_single_step_breakpoint' where a breakpoint's address is compared to the raw value of $pc. * breakpoint.h (bp_target_info): Add `reqstd_address' member, update comments. * breakpoint.c (one_breakpoint_xfer_memory): Use `reqstd_address' for the breakpoint's address. Don't preinitialize `placed_size'. (insert_bp_location): Set `reqstd_address' rather than `placed_address'. (bp_target_info_copy_insertion_state): Also copy `placed_address'. (bkpt_insert_location): Use `reqstd_address' for the breakpoint's address. (bkpt_remove_location): Likewise. (deprecated_insert_raw_breakpoint): Likewise. (deprecated_remove_raw_breakpoint): Likewise. (find_single_step_breakpoint): Likewise. * mem-break.c (default_memory_insert_breakpoint): Use `reqstd_address' for the breakpoint's address. Don't set `placed_address' or `placed_size' if breakpoint contents couldn't have been determined. * remote.c (remote_insert_breakpoint): Use `reqstd_address' for the breakpoint's address. (remote_insert_hw_breakpoint): Likewise. Don't set `placed_address' or `placed_size' if breakpoint couldn't have been set. * aarch64-linux-nat.c (aarch64_linux_insert_hw_breakpoint): Use `reqstd_address' for the breakpoint's address. * arm-linux-nat.c (arm_linux_hw_breakpoint_initialize): Likewise. * ia64-tdep.c (ia64_memory_insert_breakpoint): Likewise. * m32r-tdep.c (m32r_memory_insert_breakpoint): Likewise. * microblaze-linux-tdep.c (microblaze_linux_memory_remove_breakpoint): Likewise. * monitor.c (monitor_insert_breakpoint): Likewise. * nto-procfs.c (procfs_insert_breakpoint): Likewise. (procfs_insert_hw_breakpoint): Likewise. * ppc-linux-nat.c (ppc_linux_insert_hw_breakpoint): Likewise. * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Likewise. * remote-m32r-sdi.c (m32r_insert_breakpoint): Likewise. * remote-mips.c (mips_insert_breakpoint): Likewise. * x86-nat.c (x86_insert_hw_breakpoint): Likewise.
2014-10-03 13:44:58 +02:00
2014-10-03 Maciej W. Rozycki <macro@codesourcery.com>
* breakpoint.h (bp_target_info): Add `reqstd_address' member,
update comments.
* breakpoint.c (one_breakpoint_xfer_memory): Use `reqstd_address'
for the breakpoint's address. Don't preinitialize `placed_size'.
(insert_bp_location): Set `reqstd_address' rather than
`placed_address'.
(bp_target_info_copy_insertion_state): Also copy `placed_address'.
(bkpt_insert_location): Use `reqstd_address' for the breakpoint's
address.
(bkpt_remove_location): Likewise.
(deprecated_insert_raw_breakpoint): Likewise.
(deprecated_remove_raw_breakpoint): Likewise.
(find_single_step_breakpoint): Likewise.
* mem-break.c (default_memory_insert_breakpoint): Use
`reqstd_address' for the breakpoint's address. Don't set
`placed_address' or `placed_size' if breakpoint contents couldn't
have been determined.
* remote.c (remote_insert_breakpoint): Use `reqstd_address' for
the breakpoint's address.
(remote_insert_hw_breakpoint): Likewise. Don't set
`placed_address' or `placed_size' if breakpoint couldn't have been
set.
* aarch64-linux-nat.c (aarch64_linux_insert_hw_breakpoint): Use
`reqstd_address' for the breakpoint's address.
* arm-linux-nat.c (arm_linux_hw_breakpoint_initialize): Likewise.
* ia64-tdep.c (ia64_memory_insert_breakpoint): Likewise.
* m32r-tdep.c (m32r_memory_insert_breakpoint): Likewise.
* microblaze-linux-tdep.c
(microblaze_linux_memory_remove_breakpoint): Likewise.
* monitor.c (monitor_insert_breakpoint): Likewise.
* nto-procfs.c (procfs_insert_breakpoint): Likewise.
(procfs_insert_hw_breakpoint): Likewise.
* ppc-linux-nat.c (ppc_linux_insert_hw_breakpoint): Likewise.
* ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Likewise.
* remote-m32r-sdi.c (m32r_insert_breakpoint): Likewise.
* remote-mips.c (mips_insert_breakpoint): Likewise.
* x86-nat.c (x86_insert_hw_breakpoint): Likewise.
MIPS bit field failures in gdb.base/store.exp On MIPS64 little endian, attempting an assignment to a bit field that lives in a register yields the wrong result. It just corrupts the data in the register depending on the specific position of the bit field inside the structure. FAIL: gdb.base/store.exp: f_1.j FAIL: gdb.base/store.exp: f_1.k FAIL: gdb.base/store.exp: F_1.i FAIL: gdb.base/store.exp: F_1.j FAIL: gdb.base/store.exp: F_1.k FAIL: gdb.base/store.exp: f_2.j FAIL: gdb.base/store.exp: f_2.k FAIL: gdb.base/store.exp: F_2.i FAIL: gdb.base/store.exp: F_2.j FAIL: gdb.base/store.exp: F_2.k FAIL: gdb.base/store.exp: f_3.j FAIL: gdb.base/store.exp: f_3.k FAIL: gdb.base/store.exp: F_3.i FAIL: gdb.base/store.exp: F_3.j FAIL: gdb.base/store.exp: F_3.k FAIL: gdb.base/store.exp: f_4.j FAIL: gdb.base/store.exp: f_4.k FAIL: gdb.base/store.exp: F_4.i FAIL: gdb.base/store.exp: F_4.j FAIL: gdb.base/store.exp: F_4.k === gdb Summary === Now, GDB knows how to do bit field assignment properly, but MIPS is one of those architectures that uses a hook for the register-to-value conversion. Although we can properly tell when the type being passed is a structure or union, we cannot tell when it is a bit field, because the bit field data lives in a value structure. Such data only lives in a "type" structure when the parent structure is being referenced, thus you can collect them from the flds_bnds members. A bit field type structure looks pretty much the same as any other primitive type like int or char, so we can't distinguish them. Forcing more fields into the type structure wouldn't help much, because the type structs are shared. 2014-10-03 Luis Machado <lgustavo@codesourcery.com> * valops.c (value_assign): Check for bit field assignments before calling architecture-specific register value conversion functions.
2014-10-03 13:21:33 +02:00
2014-10-03 Luis Machado <lgustavo@codesourcery.com>
* valops.c (value_assign): Check for bit field assignments
before calling architecture-specific register value
conversion functions.
2014-10-03 Pierre Muller <muller@sourceware.org>
* dbxread.c (read_dbx_symtab): Also ignore N_BNSYM/N_ENSYM.
Fix non-stop regressions caused by "breakpoints always-inserted off" changes Commit a25a5a45 (Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto") regressed non-stop remote debugging. This was exposed by mi-nsintrall.exp intermittently failing with a spurious SIGTRAP. The problem is that when debugging with "target remote", new threads the target has spawned but have never reported a stop aren't visible to GDB until it explicitly resyncs its thread list with the target's. For example, in a program like this: int main (void) { pthread_t child_thread; pthread_create (&child_thread, NULL, child_function, NULL); return 0; <<<< set breakpoint here } If the user sets a breakpoint at the "return" statement, and runs the program, when that breakpoint hit is reported, GDB is only aware of the main thread. So if we base the decision to remove or insert breakpoints from the target based on whether all the threads we know about are stopped, we'll miss that child_thread is running, and thus we'll remove breakpoints from the target, even through they should still remain inserted, otherwise child_thread will miss them. The break-while-running.exp test actually should also be exposing this thread-list-out-of-synch problem. That test sets a breakpoint while the main thread is stopped, but other threads are running. Because other threads are running, the breakpoint is supposed to be inserted immediately. But, unless something forces a refetch of the thread list, like, e.g., "info threads", GDB won't be aware of the other threads that had been spawned by the main thread, and so won't insert new or old breakpoints in the target. And it turns out that the test is exactly doing an explicit "info threads", masking out the problem... This commit adjust the test to exercise the case of not issuing "info threads". The test then fails without the GDB fix. In the ni-nsintrall.exp case, what happens is that several threads hit the same breakpoint, and when the first thread reports the stop, because GDB wasn't aware other threads exist, all threads known to GDB are found stopped, so GDB removes the breakpoints from the target. The other threads follow up with SIGTRAPs too for that same breakpoint, which has already been removed. For the first few threads, the moribund breakpoints machinery suppresses the SIGTRAPs, but after a few events (precisely '3 * thread_count () + 1' at the time the breakpoint was removed, see update_global_location_list), the moribund breakpoint machinery is no longer aware of the removed breakpoint, and the SIGTRAP is reported as a spurious stop. The fix is naturally then to stop assuming that if no thread in the list is executing, then the target is fully stopped. We can't know that until we fully sync the thread list. Because updating the thread list on every stop would be too much RSP traffic, I chose instead to update it whenever we're about to present a stop to the user. Actually updating the thread list at that point happens to be an item I had added to the local/remote parity wiki page a while ago: Native GNU/Linux debugging adds new threads to the thread list as the program creates them "The [New Thread foo] messages". Remote debugging can't do that, and it's arguable whether we shouldn't even stop native debugging from doing that, as it hinders inferior performance. However, a related issue is that with remote targets (and gdbserver), even after the program stops, the user still needs to do "info threads" to pull an updated thread list. This, should most likely be addressed, so that GDB pulls the list itself, perhaps just before presenting a stop to the user. With that in place, the need to delay "Program received signal FOO" was actually caught by the manythreads.exp test. Without that bit, I was getting: [Thread 0x7ffff7f13700 (LWP 4499) exited] [New Thread 0x7ffff7f0b700 (LWP 4500)] ^C Program received signal SIGINT, Interrupt. [New Thread 0x7ffff7f03700 (LWP 4501)] <<< new output [Switching to Thread 0x7ffff7f0b700 (LWP 4500)] __GI___nptl_death_event () at events.c:31 31 { (gdb) FAIL: gdb.threads/manythreads.exp: stop threads 1 That is, I was now getting "New Thread" lines after the "Program received signal" line, and the test doesn't expect them. As the number of new threads discovered before and after the "Program received signal" output is unbounded, it's much nicer to defer "Program received signal" until after synching the thread list, thus close to the "switching to thread" output and "current frame/source" info: [Thread 0x7ffff7863700 (LWP 7647) exited] ^C[New Thread 0x7ffff786b700 (LWP 7648)] Program received signal SIGINT, Interrupt. [Switching to Thread 0x7ffff7fc4740 (LWP 6243)] __GI___nptl_create_event () at events.c:25 25 { (gdb) PASS: gdb.threads/manythreads.exp: stop threads 1 Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-10-02 Pedro Alves <palves@redhat.com> * breakpoint.c (breakpoints_should_be_inserted_now): Use threads_are_executing. * breakpoint.h (breakpoints_should_be_inserted_now): Add describing comment. * gdbthread.h (threads_are_executing): Declare. (handle_signal_stop) <random signals>: Don't print about the signal here if stopping. (end_stepping_range): Don't notify observers here. (normal_stop): Update the thread list. If stopped by a random signal or a stepping range ended, notify observers. * thread.c (threads_executing): New global. (init_thread_list): Clear 'threads_executing'. (set_executing): Set or clear 'threads_executing'. (threads_are_executing): New function. (update_threads_executing): New function. (update_thread_list): Use it. gdb/testsuite/ 2014-10-02 Pedro Alves <palves@redhat.com> * gdb.threads/break-while-running.exp (test): Add new 'update_thread_list' argument. Skip "info threads" if false. (top level): Add new 'update_thread_list' axis.
2014-10-02 10:55:38 +02:00
2014-10-02 Pedro Alves <palves@redhat.com>
* breakpoint.c (breakpoints_should_be_inserted_now): Use
threads_are_executing.
* breakpoint.h (breakpoints_should_be_inserted_now): Add
describing comment.
* gdbthread.h (threads_are_executing): Declare.
(handle_signal_stop) <random signals>: Don't print about the
signal here if stopping.
(end_stepping_range): Don't notify observers here.
(normal_stop): Update the thread list. If stopped by a random
signal or a stepping range ended, notify observers.
* thread.c (threads_executing): New global.
(init_thread_list): Clear 'threads_executing'.
(set_executing): Set or clear 'threads_executing'.
(threads_are_executing): New function.
(update_threads_executing): New function.
(update_thread_list): Use it.
PR17431: following execs with "breakpoint always-inserted on" Following an exec with "breakpoint always-inserted on" tries to insert breakpoints in the new image at the addresses the symbols had in the old image. With "always-inserted off", we see: gdb gdb.multi/multi-arch-exec -ex "set breakpoint always-inserted off" GNU gdb (GDB) 7.8.50.20140924-cvs ... (gdb) b main Breakpoint 1 at 0x400664: file gdb.multi/multi-arch-exec.c, line 24. ^^^^^^^^ (gdb) c The program is not being run. (gdb) r Starting program: testsuite/gdb.multi/multi-arch-exec Breakpoint 1, main () at gdb/testsuite/gdb.multi/multi-arch-exec.c:24 24 execl (BASEDIR "/multi-arch-exec-hello", (gdb) c Continuing. process 9212 is executing new program: gdb/testsuite/gdb.multi/multi-arch-exec-hello Breakpoint 1, main () at gdb/testsuite/gdb.multi/hello.c:40 40 bar(); (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x080484e4 in main at gdb/testsuite/gdb.multi/hello.c:40 ^^^^^^^^^^ breakpoint already hit 2 times (gdb) Note how main was 0x400664 in multi-arch-exec, and 0x080484e4 in gdb.multi/hello. With "always-inserted on", we get: Breakpoint 1, main () at gdb/testsuite/gdb.multi/multi-arch-exec.c:24 24 execl (BASEDIR "/multi-arch-exec-hello", (gdb) c Continuing. infrun: target_wait (-1, status) = infrun: 9444 [process 9444], infrun: status->kind = execd infrun: infwait_normal_state infrun: TARGET_WAITKIND_EXECD Warning: Cannot insert breakpoint 1. Cannot access memory at address 0x400664 (gdb) That is, GDB is trying to insert a breakpoint at 0x400664, after the exec, and then that address happens to not be mapped at all in the new image. The problem is that update_breakpoints_after_exec is creating breakpoints, which ends up in update_global_location_list immediately inserting breakpoints if "breakpoints always-inserted" is "on". update_breakpoints_after_exec is called very early when we see an exec event. At that point, we haven't loaded the symbols of the new post-exec image yet, and thus haven't reset breakpoint's addresses to whatever they may be in the new image. All we should be doing in update_breakpoints_after_exec is deleting breakpoints that no longer make sense after an exec. So the fix removes those breakpoint creations. The question is then, if not here, where are those breakpoints re-created? Turns out we don't need to do anything else, because at the end of follow_exec, we call breakpoint_re_set, whose tail is also creating exactly the same breakpoints update_breakpoints_after_exec is currently creating: breakpoint_re_set (void) { ... create_overlay_event_breakpoint (); create_longjmp_master_breakpoint (); create_std_terminate_master_breakpoint (); create_exception_master_breakpoint (); } A new test is added to exercise this. Tested on x86_64 Fedora 20. gdb/ 2014-10-02 Pedro Alves <palves@redhat.com> PR breakpoints/17431 * breakpoint.c (update_breakpoints_after_exec): Don't create overlay, longjmp, std terminate nor exception breakpoints here. gdb/testsuite/ 2014-10-02 Pedro Alves <palves@redhat.com> PR breakpoints/17431 * gdb.base/execl-update-breakpoints.c: New file. * gdb.base/execl-update-breakpoints.exp: New file.
2014-10-02 10:55:38 +02:00
2014-10-02 Pedro Alves <palves@redhat.com>
PR breakpoints/17431
* breakpoint.c (update_breakpoints_after_exec): Don't create
overlay, longjmp, std terminate nor exception breakpoints here.
Reduce Hg packet (select remote general thread) bouncing A patch I wrote made GDB pull the thread list sooner when debugging with target remote, and I noticed an intended consequence. GDB started bouncing around the currently selected remote/general thread more frequently. E.g.: Sending packet: $qTMinFTPILen#3b...Packet received: 5 +Sending packet: $Hgp726d.726d#53...Packet received: OK Sending packet: $m400680,40#2f...Packet received: 85c0741455bff00d60004889e5ffd05de97bffffff0f1f00e973ffffff0f1f00554889e5c745fc00000000c745fc01000000e900000000c745fc02000000b800 +Sending packet: $Hgp726d.7278#28...Packet received: OK Sending packet: $m4006b2,1#28...Packet received: e9 Fast tracepoint 2 at 0x4006b2: file gdb/testsuite/gdb.trace/range-stepping.c, line 53. Sending packet: $qTStatus#49...Packet received: T0;tnotrun:0;tframes:0;tcreated:0;tfree:500000;tsize:500000;circular:0;disconn:0;starttime:0;stoptime:0;username:;notes:: This ended up breaking "tstart" when one has fast tracepoints set, because gdbserver isn't expecting an Hg packet in response to qRelocInsn: (gdb) ftrace *set_point Fast tracepoint 3 at 0x4006b2: file gdb/testsuite/gdb.trace/range-stepping.c, line 53. (gdb) PASS: gdb.trace/range-stepping.exp: ftrace: ftrace *set_point tstart gdbserver: Malformed response to qRelocInsn, ignoring: Hgp2783.2783 Target does not support this command. (gdb) FAIL: gdb.trace/range-stepping.exp: ftrace: tstart remote_trace_start should probably start by making sure the remote current thread matches inferior_ptid (calling set_general_thread), but still, reducing unnecessary bouncing is a good idea. It happens because the memory/symbol/breakpoint routines use switch_to_program_space_and_thread to do something in the right context and then revert back to the previously current thread. The fix is to simply make any_thread_of_process, find_inferior_for_program_space, etc. give preference to the current thread/inferior it if matches. gdb/ 2014-10-02 Pedro Alves <palves@redhat.com> * gdbthread.h (any_thread_of_process, any_live_thread_of_process): Adjust comments. * inferior.c (find_inferior_for_program_space): Give preference to the current inferior. * inferior.h (find_inferior_for_program_space): Update comment. * progspace.c (switch_to_program_space_and_thread): Prefer the current inferior if it's bound to the program space requested. If the inferior found doesn't have a PID yet, don't bother looking up a thread. * progspace.h (switch_to_program_space_and_thread): Adjust comment. * thread.c (any_thread_of_process, any_live_thread_of_process): Give preference to the current thread.
2014-10-02 10:55:38 +02:00
2014-10-02 Pedro Alves <palves@redhat.com>
* gdbthread.h (any_thread_of_process, any_live_thread_of_process):
Adjust comments.
* inferior.c (find_inferior_for_program_space): Give preference to
the current inferior.
* inferior.h (find_inferior_for_program_space): Update comment.
* progspace.c (switch_to_program_space_and_thread): Prefer the
current inferior if it's bound to the program space requested. If
the inferior found doesn't have a PID yet, don't bother looking up
a thread.
* progspace.h (switch_to_program_space_and_thread): Adjust
comment.
* thread.c (any_thread_of_process, any_live_thread_of_process):
Give preference to the current thread.
Really fail inserting software breakpoints on read-only regions Currently, with "set breakpoint auto-hw off", we'll still try to insert a software breakpoint at addresses covered by supposedly read-only or inacessible regions: (top-gdb) mem 0x443000 0x450000 ro (top-gdb) set mem inaccessible-by-default off (top-gdb) disassemble Dump of assembler code for function main: 0x0000000000443956 <+34>: movq $0x0,0x10(%rax) => 0x000000000044395e <+42>: movq $0x0,0x18(%rax) 0x0000000000443966 <+50>: mov -0x24(%rbp),%eax 0x0000000000443969 <+53>: mov %eax,-0x20(%rbp) End of assembler dump. (top-gdb) b *0x0000000000443969 Breakpoint 5 at 0x443969: file ../../src/gdb/gdb.c, line 29. (top-gdb) c Continuing. warning: cannot set software breakpoint at readonly address 0x443969 Breakpoint 5, 0x0000000000443969 in main (argc=1, argv=0x7fffffffd918) at ../../src/gdb/gdb.c:29 29 args.argc = argc; (top-gdb) We warn, saying that the insertion can't be done, but then proceed attempting the insertion anyway, and in case of manually added regions, the insert actually succeeds. This is a regression; GDB used to fail inserting the breakpoint. More below. I stumbled on this as I wrote a test that manually sets up a read-only memory region with the "mem" command, in order to test GDB's behavior with breakpoints set on read-only regions, even when the real memory the breakpoints are set at isn't really read-only. I wanted that in order to add a test that exercises software single-stepping through read-only regions. Note that the memory regions that target_memory_map returns aren't like e.g., what would expect to see in /proc/PID/maps on Linux. Instead, they're the physical memory map from the _debuggers_ perspective. E.g., a read-only region would be real ROM or flash memory, while a read-only+execute mapping in /proc/PID/maps is still read-write to the debugger (otherwise the debugger wouldn't be able to set software breakpoints in the code segment). If one tries to manually write to memory that falls within a memory region that is known to be read-only, with e.g., "p foo = 1", then we hit a check in memory_xfer_partial_1 before the write mananges to make it to the target side. But writing a software/memory breakpoint nowadays goes through target_write_raw_memory, and unlike when writing memory with TARGET_OBJECT_MEMORY, nothing on the TARGET_OBJECT_RAW_MEMORY path checks whether we're trying to write to a read-only region. At the time "breakpoint auto-hw" was added, we didn't have the TARGET_OBJECT_MEMORY vs TARGET_OBJECT_RAW_MEMORY target object distinction yet, and the code path in memory_xfer_partial that blocks writes to read-only memory was hit for memory breakpoints too. With GDB 6.8 we had: warning: cannot set software breakpoint at readonly address 0000000000443943 Warning: Cannot insert breakpoint 1. Error accessing memory address 0x443943: Input/output error. So I started out by fixing this by adding the memory region validation to TARGET_OBJECT_RAW_MEMORY too. But later, when testing against GDBserver, I realized that that would only block software/memory breakpoints GDB itself inserts with gdb/mem-break.c. If a target has a to_insert_breakpoint method, the insertion request will still pass through to the target. So I ended up converting the "cannot set breakpoint" warning in breakpoint.c to a real error return, thus blocking the insertion sooner. With that, we'll end up no longer needing the TARGET_OBJECT_RAW_MEMORY changes once software single-step breakpoints are converted to real breakpoints. We need them today as software single-step breakpoints bypass insert_bp_location. But, it'll be best to leave that in as safeguard anyway, for other direct uses of TARGET_OBJECT_RAW_MEMORY. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-10-01 Pedro Alves <palves@redhat.com> * breakpoint.c (insert_bp_location): Error out if inserting a software breakpoint at a read-only address. * target.c (memory_xfer_check_region): New function, factored out from ... (memory_xfer_partial_1): ... this. Make the 'reg_len' local a ULONGEST. (target_xfer_partial) <TARGET_OBJECT_RAW_MEMORY>: Check the access against the memory region attributes. gdb/testsuite/ 2014-10-01 Pedro Alves <palves@redhat.com> * gdb.base/breakpoint-in-ro-region.c: New file. * gdb.base/breakpoint-in-ro-region.exp: New file.
2014-10-02 00:31:55 +02:00
2014-10-01 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location): Error out if inserting a
software breakpoint at a read-only address.
* target.c (memory_xfer_check_region): New function, factored out
from ...
(memory_xfer_partial_1): ... this. Make the 'reg_len' local a
ULONGEST.
(target_xfer_partial) <TARGET_OBJECT_RAW_MEMORY>: Check the access
against the memory region attributes.
2014-10-01 Simon Marchi <simon.marchi@ericsson.com>
* NEWS: Announce new exit-code field in -list-thread-groups
output.
* inferior.c (exit_inferior_1): Don't clear exit code.
(inferior_appeared): Clear exit code.
* mi/mi-main.c (print_one_inferior): Add printing of the exit
code.
Add read-only markers to generated gdb/regformats/ .dat files We have read-only markers in most generated sources already, so that Emacs/Vi users won't edit them accidentally, but were missing them on the generated gdb/regformats/ .dat files. gdb/ 2014-10-01 Pedro Alves <palves@redhat.com> * features/Makefile ($(outdir)/%.dat): Output "THIS FILE IS GENERATED" along with emacs/vi read-only markers. * regformats/aarch64.dat: Regenerate. * regformats/arm-with-iwmmxt.dat: Regenerate. * regformats/arm-with-neon.dat: Regenerate. * regformats/arm-with-vfpv2.dat: Regenerate. * regformats/arm-with-vfpv3.dat: Regenerate. * regformats/i386/amd64-avx-linux.dat: Regenerate. * regformats/i386/amd64-avx.dat: Regenerate. * regformats/i386/amd64-avx512-linux.dat: Regenerate. * regformats/i386/amd64-avx512.dat: Regenerate. * regformats/i386/amd64-linux.dat: Regenerate. * regformats/i386/amd64-mpx-linux.dat: Regenerate. * regformats/i386/amd64-mpx.dat: Regenerate. * regformats/i386/amd64.dat: Regenerate. * regformats/i386/i386-avx-linux.dat: Regenerate. * regformats/i386/i386-avx.dat: Regenerate. * regformats/i386/i386-avx512-linux.dat: Regenerate. * regformats/i386/i386-avx512.dat: Regenerate. * regformats/i386/i386-linux.dat: Regenerate. * regformats/i386/i386-mmx-linux.dat: Regenerate. * regformats/i386/i386-mmx.dat: Regenerate. * regformats/i386/i386-mpx-linux.dat: Regenerate. * regformats/i386/i386-mpx.dat: Regenerate. * regformats/i386/i386.dat: Regenerate. * regformats/i386/x32-avx-linux.dat: Regenerate. * regformats/i386/x32-avx.dat: Regenerate. * regformats/i386/x32-avx512-linux.dat: Regenerate. * regformats/i386/x32-avx512.dat: Regenerate. * regformats/i386/x32-linux.dat: Regenerate. * regformats/i386/x32.dat: Regenerate. * regformats/microblaze-with-stack-protect.dat: Regenerate. * regformats/mips-dsp-linux.dat: Regenerate. * regformats/mips-linux.dat: Regenerate. * regformats/mips64-dsp-linux.dat: Regenerate. * regformats/mips64-linux.dat: Regenerate. * regformats/nios2-linux.dat: Regenerate. * regformats/rs6000/powerpc-32.dat: Regenerate. * regformats/rs6000/powerpc-32l.dat: Regenerate. * regformats/rs6000/powerpc-64l.dat: Regenerate. * regformats/rs6000/powerpc-altivec32l.dat: Regenerate. * regformats/rs6000/powerpc-altivec64l.dat: Regenerate. * regformats/rs6000/powerpc-cell32l.dat: Regenerate. * regformats/rs6000/powerpc-cell64l.dat: Regenerate. * regformats/rs6000/powerpc-e500l.dat: Regenerate. * regformats/rs6000/powerpc-vsx32l.dat: Regenerate. * regformats/rs6000/powerpc-vsx64l.dat: Regenerate. * regformats/s390-linux32.dat: Regenerate. * regformats/s390-linux32v1.dat: Regenerate. * regformats/s390-linux32v2.dat: Regenerate. * regformats/s390-linux64.dat: Regenerate. * regformats/s390-linux64v1.dat: Regenerate. * regformats/s390-linux64v2.dat: Regenerate. * regformats/s390-te-linux64.dat: Regenerate. * regformats/s390x-linux64.dat: Regenerate. * regformats/s390x-linux64v1.dat: Regenerate. * regformats/s390x-linux64v2.dat: Regenerate. * regformats/s390x-te-linux64.dat: Regenerate. * regformats/tic6x-c62x-linux.dat: Regenerate. * regformats/tic6x-c62x.dat: Regenerate. * regformats/tic6x-c64x-linux.dat: Regenerate. * regformats/tic6x-c64x.dat: Regenerate. * regformats/tic6x-c64xp-linux.dat: Regenerate. * regformats/tic6x-c64xp.dat: Regenerate.
2014-10-01 14:40:13 +02:00
2014-10-01 Pedro Alves <palves@redhat.com>
* features/Makefile ($(outdir)/%.dat): Output "THIS FILE IS
GENERATED" along with emacs/vi read-only markers.
* regformats/aarch64.dat: Regenerate.
* regformats/arm-with-iwmmxt.dat: Regenerate.
* regformats/arm-with-neon.dat: Regenerate.
* regformats/arm-with-vfpv2.dat: Regenerate.
* regformats/arm-with-vfpv3.dat: Regenerate.
* regformats/i386/amd64-avx-linux.dat: Regenerate.
* regformats/i386/amd64-avx.dat: Regenerate.
* regformats/i386/amd64-avx512-linux.dat: Regenerate.
* regformats/i386/amd64-avx512.dat: Regenerate.
* regformats/i386/amd64-linux.dat: Regenerate.
* regformats/i386/amd64-mpx-linux.dat: Regenerate.
* regformats/i386/amd64-mpx.dat: Regenerate.
* regformats/i386/amd64.dat: Regenerate.
* regformats/i386/i386-avx-linux.dat: Regenerate.
* regformats/i386/i386-avx.dat: Regenerate.
* regformats/i386/i386-avx512-linux.dat: Regenerate.
* regformats/i386/i386-avx512.dat: Regenerate.
* regformats/i386/i386-linux.dat: Regenerate.
* regformats/i386/i386-mmx-linux.dat: Regenerate.
* regformats/i386/i386-mmx.dat: Regenerate.
* regformats/i386/i386-mpx-linux.dat: Regenerate.
* regformats/i386/i386-mpx.dat: Regenerate.
* regformats/i386/i386.dat: Regenerate.
* regformats/i386/x32-avx-linux.dat: Regenerate.
* regformats/i386/x32-avx.dat: Regenerate.
* regformats/i386/x32-avx512-linux.dat: Regenerate.
* regformats/i386/x32-avx512.dat: Regenerate.
* regformats/i386/x32-linux.dat: Regenerate.
* regformats/i386/x32.dat: Regenerate.
* regformats/microblaze-with-stack-protect.dat: Regenerate.
* regformats/mips-dsp-linux.dat: Regenerate.
* regformats/mips-linux.dat: Regenerate.
* regformats/mips64-dsp-linux.dat: Regenerate.
* regformats/mips64-linux.dat: Regenerate.
* regformats/nios2-linux.dat: Regenerate.
* regformats/rs6000/powerpc-32.dat: Regenerate.
* regformats/rs6000/powerpc-32l.dat: Regenerate.
* regformats/rs6000/powerpc-64l.dat: Regenerate.
* regformats/rs6000/powerpc-altivec32l.dat: Regenerate.
* regformats/rs6000/powerpc-altivec64l.dat: Regenerate.
* regformats/rs6000/powerpc-cell32l.dat: Regenerate.
* regformats/rs6000/powerpc-cell64l.dat: Regenerate.
* regformats/rs6000/powerpc-e500l.dat: Regenerate.
* regformats/rs6000/powerpc-vsx32l.dat: Regenerate.
* regformats/rs6000/powerpc-vsx64l.dat: Regenerate.
* regformats/s390-linux32.dat: Regenerate.
* regformats/s390-linux32v1.dat: Regenerate.
* regformats/s390-linux32v2.dat: Regenerate.
* regformats/s390-linux64.dat: Regenerate.
* regformats/s390-linux64v1.dat: Regenerate.
* regformats/s390-linux64v2.dat: Regenerate.
* regformats/s390-te-linux64.dat: Regenerate.
* regformats/s390x-linux64.dat: Regenerate.
* regformats/s390x-linux64v1.dat: Regenerate.
* regformats/s390x-linux64v2.dat: Regenerate.
* regformats/s390x-te-linux64.dat: Regenerate.
* regformats/tic6x-c62x-linux.dat: Regenerate.
* regformats/tic6x-c62x.dat: Regenerate.
* regformats/tic6x-c64x-linux.dat: Regenerate.
* regformats/tic6x-c64x.dat: Regenerate.
* regformats/tic6x-c64xp-linux.dat: Regenerate.
* regformats/tic6x-c64xp.dat: Regenerate.
2014-10-01 Pedro Alves <palves@redhat.com>
* features/Makefile: Update comments.
(XMLTOC): List all xml files we build C files from.
(clean-cfiles): New rule.
2014-10-01 Pedro Alves <palves@redhat.com>
* features/i386/amd64-avx512-linux.c: Regenerate.
* features/i386/amd64-avx512.c: Regenerate.
* features/i386/x32-avx512-linux.c: Regenerate.
* features/i386/x32-avx512.c: Regenerate.
2014-10-01 Pedro Alves <palves@redhat.com>
* features/Makefile (WHICH): Remove arm-with-m,
arm-with-m-fpa-layout and arm-with-m-vfp-d16.
2014-10-01 Pedro Alves <palves@redhat.com>
* features/Makefile (clean): New rule.
Fix features/i386/64bit-avx512.xml This file's format is invalid, as it's missing some end quotes. I noticed this because I tried to regenerate all the .dat files in gdb/regformats/. I got: sh ../../move-if-change ../regformats/i386/x32-avx.tmp ../regformats/i386/x32-avx.dat echo "# DO NOT EDIT: generated from i386/x32-avx512.xml" > ../regformats/i386/x32-avx512.tmp echo "name:`echo x32-avx512 | sed 's/-/_/g'`" >> ../regformats/i386/x32-avx512.tmp echo "xmltarget:x32-avx512.xml" >> ../regformats/i386/x32-avx512.tmp echo "expedite:rbp,rsp,rip" \ >> ../regformats/i386/x32-avx512.tmp xsltproc --path "/home/pedro/gdb/mygit/src/gdb/features" --xinclude number-regs.xsl i386/x32-avx512.xml | \ xsltproc sort-regs.xsl - | \ xsltproc gdbserver-regs.xsl - >> ../regformats/i386/x32-avx512.tmp i386/64bit-avx512.xml:81: parser error : Unescaped '<' not allowed in attributes values <reg name="zmm11h" bitsize="256" type="v2ui128/> ^ i386/64bit-avx512.xml:81: parser error : attributes construct error <reg name="zmm11h" bitsize="256" type="v2ui128/> ^ i386/64bit-avx512.xml:81: parser error : Couldn't find end of Start Tag reg line 80 <reg name="zmm11h" bitsize="256" type="v2ui128/> ^ i386/64bit-avx512.xml:82: parser error : Unescaped '<' not allowed in attributes values <reg name="zmm12h" bitsize="256" type="v2ui128/> ^ i386/64bit-avx512.xml:82: parser error : attributes construct error <reg name="zmm12h" bitsize="256" type="v2ui128/> ^ ... i386/x32-avx512.xml:17: element include: XInclude error : could not load i386/64bit-avx512.xml, and no fallback was found -:1: parser error : Document is empty ^ -:1: parser error : Start tag expected, '<' not found ^ unable to parse - -:1: parser error : Document is empty ^ -:1: parser error : Start tag expected, '<' not found ^ unable to parse - make: *** [../regformats/i386/x32-avx512.dat] Error 6 Interestingly, gdb/expat manages to grok the broken file. gdb/ 2014-10-01 Pedro Alves <palves@redhat.com> * features/i386/64bit-avx512.xml (zmm10h, zmm11h, zmm12h, zmm13h) (zmm14h): Add missing end quotes.
2014-10-01 11:06:04 +02:00
2014-10-01 Pedro Alves <palves@redhat.com>
* features/i386/64bit-avx512.xml (zmm10h, zmm11h, zmm12h, zmm13h)
(zmm14h): Add missing end quotes.
Aarch64: Make CPSR a 32-bit register again in the target description This reverts commit a4d9ba85 - 'AARCH64: Change cpsr type to be 64bit.'. Even though Linux's ptrace exposes CPSR as 64-bit, CPSR is really 32-bit, and basing GDB's fundamentals on a particular OS's ptrace(2) implementation is a bad idea. In addition, while that commit intended to fix big endian Aarch64, it ended up breaking floating point debugging against GDBserver, for both big and little endian, because it changed the CPSR to be 64-bit in the features/aarch64-core.xml file, but missed regenerating the regformats/aarch64.dat file. If we generate it now, we see this: diff --git c/gdb/regformats/aarch64.dat w/gdb/regformats/aarch64.dat index afe1028..0d32183 100644 --- c/gdb/regformats/aarch64.dat +++ w/gdb/regformats/aarch64.dat @@ -35,7 +35,7 @@ expedite:x29,sp,pc 64:x30 64:sp 64:pc -32:cpsr +64:cpsr 128:v0 128:v1 128:v2 IOW, that commit left regformats/aarch64.dat still considering CPSR as 32-bits. regformats/aarch64.dat is used by GDBserver for its internal regcache layout, and for the g/G packet register block. See the generated aarch64.c file in GDBserver's build dir. So the target description xml file that GDBserver reports to GDB is now claiming that CPSR is 64-bit, but what GDBserver actually puts in the g/G register packets is 32-bits. Because GDB thinks CPSR is 64-bit (because that's what the XML description says), GDB will be reading the remaining 32-bit bits of CPSR out of v0 (the register immediately afterwards), and then all the registers that follow CPSR in the register packet end up wrong in GDB, because they're being read from the wrong offsets... gdb/ 2014-10-01 Pedro Alves <palves@redhat.com> * features/aarch64-core.xml (cpsr): Change back to 32-bit. * features/aarch64.c: Regenerate.
2014-10-01 11:06:45 +02:00
2014-10-01 Pedro Alves <palves@redhat.com>
* features/aarch64-core.xml (cpsr): Change back to 32-bit.
* features/aarch64.c: Regenerate.
Refactor native follow-fork. This patch reorganizes the code that implements follow-fork and detach-on-fork in preparation for implementation of those features for the extended-remote target. The function linux-nat.c:linux_child_follow_fork contained target-independent code mixed in with target-dependent code. The target-independent pieces need to be accessible for the host-side implementation of follow-fork for extended-remote Linux targets. The changes are fairly mechanical. A new routine, follow_fork_inferior, is implemented in infrun.c, containing those parts of linux_child_follow_fork that manage inferiors and the inferior list. The parts of linux_child_follow_fork that deal with LWPs and target-specifics were left in-place. Although the order of some operations was changed, the resulting functionality was not. Modifications were made to the other native target follow-fork functions, inf_ttrace_follow_fork and inf_ptrace_follow_fork, that should allow them to work with follow_fork_inferior. Some other adjustments were necessary in inf-ttrace.c. The changes to inf-ttrace.c and inf-ptrace.c were not tested. gdb/ChangeLog: * inf-ptrace.c (inf_ptrace_follow_fork): Remove target-independent code so as to work with follow_fork_inferior. * inf-ttrace.c (inf_ttrace_follow_fork): Ditto. (inf_ttrace_create_inferior): Remove reference to inf_ttrace_vfork_ppid. (inf_ttrace_attach): Ditto. (inf_ttrace_detach): Ditto. (inf_ttrace_kill): Use current_inferior instead of inf_ttrace_vfork_ppid. (inf_ttrace_wait): Eliminate use of inf_ttrace_vfork_ppid, report TARGET_WAITKIND_VFORK_DONE event, delete HACK that switched the inferior away from the parent. * infrun.c (follow_fork): Call follow_fork_inferior instead of target_follow_fork. (follow_fork_inferior): New function. (follow_inferior_reset_breakpoints): Make function static. * infrun.h (follow_inferior_reset_breakpoints): Remove declaration. * linux-nat.c (linux_child_follow_fork): Move target-independent code to infrun.c:follow_fork_inferior.
2014-09-30 20:01:57 +02:00
2014-09-30 Don Breazeal <donb@codesourcery.com>
* inf-ptrace.c (inf_ptrace_follow_fork): Remove target-independent
code so as to work with follow_fork_inferior.
* inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
(inf_ttrace_create_inferior): Remove reference to
inf_ttrace_vfork_ppid.
(inf_ttrace_attach): Ditto.
(inf_ttrace_detach): Ditto.
(inf_ttrace_kill): Use current_inferior instead of
inf_ttrace_vfork_ppid.
(inf_ttrace_wait): Eliminate use of inf_ttrace_vfork_ppid, report
TARGET_WAITKIND_VFORK_DONE event, delete HACK that switched the
inferior away from the parent.
* infrun.c (follow_fork): Call follow_fork_inferior instead of
target_follow_fork.
(follow_fork_inferior): New function.
(follow_inferior_reset_breakpoints): Make function static.
* infrun.h (follow_inferior_reset_breakpoints): Remove declaration.
* linux-nat.c (linux_child_follow_fork): Move target-independent
code to infrun.c:follow_fork_inferior.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdbarch.sh (regset_from_core_section): Remove gdbarch method.
* gdbarch.c: Regenerate.
* gdbarch.h: Likewise.
* corelow.c (sniff_core_bfd): Drop presence check for deleted
gdbarch method 'regset_from_core_section'.
(get_core_register_section): Remove handling for the case that
regset == NULL and regset_from_core_section is defined.
(get_core_registers): Drop check for deleted method.
* procfs.c (procfs_do_thread_registers): Adjust comment.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* linux-nat.c (linux_nat_collect_thread_registers): Remove.
(linux_nat_make_corefile_notes): Remove.
(linux_target_install_ops): Do not set target method
'make_corefile_notes'.
* linux-tdep.c (struct linux_corefile_thread_data)<collect>:
Remove field.
(linux_corefile_thread_callback): Instead of args->collect, call
linux_collect_thread_registers.
(linux_make_corefile_notes): Remove 'collect' parameter. Return
NULL unless there is a regset iterator.
(linux_make_corefile_notes_1): Remove.
(linux_init_abi): Replace reference to linux_make_corefile_notes_1
by linux_make_corefile_notes.
* linux-tdep.h (linux_make_corefile_notes): Remove prototype.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* fbsd-nat.c (find_signalled_thread, find_stop_signal)
(fbsd_collect_regset_section_cb, fbsd_make_corefile_notes):
Remove.
* fbsd-nat.h (fbsd_make_corefile_notes): Remove prototype.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* xtensa-tdep.c (xtensa_regset_from_core_section): Remove.
(xtensa_iterate_over_regset_sections): New.
(xtensa_gdbarch_init): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* vax-tdep.c (vax_regset_from_core_section): Remove.
(vax_iterate_over_regset_sections): New.
(vax_gdbarch_init): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* tilegx-linux-tdep.c (TILEGX_LINUX_SIZEOF_GREGSET): New macro.
(tilegx_regset_from_core_section): Remove.
(tilegx_iterate_over_regset_sections): New.
(tilegx_linux_init_abi): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* sparc-tdep.c (sparc_regset_from_core_section): Remove.
(sparc_iterate_over_regset_sections): New.
(sparc32_gdbarch_init): Adjust gdbarch initialization.
* configure.tgt (gdb_target_obs): Add fbsd-tdep.o for SPARC FreeBSD
targets.
* sparc64fbsd-tdep.c (fbsd-tdep.h): Include.
(sparc64fbsd_init_abi): Call fbsd_init_abi.
* sparc64fbsd-nat.c (_initialize_sparc64fbsd_nat): Do not set
target method 'make_corefile_notes'.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* sh-linux-tdep.c (sh_linux_init_abi): Set tdep fields
'sizeof_gregset' and 'sizeof_fpregset'.
* sh-tdep.c (sh_regset_from_core_section): Remove.
(sh_iterate_over_regset_sections): New.
(sh_gdbarch_init): Adjust gdbarch initialization.
* sh-tdep.h (struct gdbarch_tdep): New fields sizeof_gregset and
sizeof_fpregset.
* shnbsd-tdep.c (shnbsd_init_abi): Set tdep field
'sizeof_gregset'.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* score-tdep.c (score7_linux_regset_from_core_section): Remove.
(score7_linux_iterate_over_regset_sections): New.
(score_gdbarch_init): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* configure.tgt (gdb_target_obs): Add fbsd-tdep.o for PowerPC
FreeBSD targets.
* ppcfbsd-nat.c (_initialize_ppcfbsd_nat): Do not set target
method 'make_corefile_notes'.
* ppcfbsd-tdep.c (fbsd-tdep.h): Include.
(ppcfbsd_regset_from_core_section): Remove.
(ppcfbsd_iterate_over_regset_sections): New.
(ppcfbsd_init_abi): Call fbsd_init_abi. Adjust gdbarch
initialization.
* ppcnbsd-tdep.c (ppcnbsd_regset_from_core_section): Remove.
(ppcnbsd_iterate_over_regset_sections): New.
(ppcnbsd_init_abi): Adjust.
* ppcobsd-tdep.c (ppcobsd_regset_from_core_section): Remove.
(ppcobsd_iterate_over_regset_sections): New.
(ppcobsd_init_abi): Adjust.
* rs6000-aix-tdep.c (rs6000_aix_regset_from_core_section): Remove.
(rs6000_aix_iterate_over_regset_sections): New.
(rs6000_aix_init_osabi): Adjust.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* nios2-linux-tdep.c (NIOS2_GREGS_SIZE): New macro.
(nios2_regset_from_core_section): Remove.
(nios2_iterate_over_regset_sections): New.
(nios2_linux_init_abi): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* mn10300-linux-tdep.c (am33_regset_from_core_section): Remove.
(am33_iterate_over_regset_sections): New.
(am33_linux_init_osabi): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* mips-linux-tdep.c (mips_linux_regset_from_core_section): Remove.
(mips_linux_iterate_over_regset_sections): New.
(mips_linux_init_abi): Adjust gdbarch initialization.
* mips64obsd-tdep.c (mips64obsd_regset_from_core_section): Remove.
(mips64obsd_iterate_over_regset_sections): New.
(mips64obsd_init_abi): Adjust.
* mipsnbsd-tdep.c (mipsnbsd_regset_from_core_section): Remove.
(mipsnbsd_iterate_over_regset_sections): New.
(mipsnbsd_init_abi): Adjust.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* m88k-tdep.c (m88k_regset_from_core_section): Remove.
(m88k_iterate_over_regset_sections): New.
(m88k_gdbarch_init): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* ia64-linux-tdep.c (ia64_linux_regset_from_core_section): Remove.
(ia64_linux_iterate_over_regset_sections): New.
(ia64_linux_init_abi): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* m68kbsd-tdep.c (m68kbsd_regset_from_core_section): Remove.
(m68kbsd_iterate_over_regset_sections): New.
(m68kbsd_init_abi): Adjust gdbarch initialization.
* m68klinux-tdep.c (m68k_linux_regset_from_core_section): Remove.
(m68k_linux_iterate_over_regset_sections): New.
(m68k_linux_init_abi): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* m32r-linux-tdep.c (M32R_LINUX_GREGS_SIZE): New macro.
(m32r_linux_regset_from_core_section): Remove.
(m32r_linux_iterate_over_regset_sections): New.
(m32r_linux_init_abi): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Remove.
(amd64obsd_iterate_over_regset_sections): New.
(amd64obsd_core_init_abi): Adjust gdbarch initialization.
* i386-cygwin-tdep.c (i386_windows_regset_from_core_section):
Remove.
(i386_cygwin_init_abi): Clear tdep->sizeof_fpregset. Drop
regset_from_core_section initialization.
* i386-tdep.c (i386_regset_from_core_section): Remove.
(i386_iterate_over_regset_sections): New.
(i386_gdbarch_init): Adjust gdbarch initialization.
* i386-tdep.h (i386_regset_from_core_section): Remove prototype.
(i386_iterate_over_regset_sections): New prototype.
* i386obsd-tdep.c (i386obsd_aout_regset_from_core_section):
Remove.
(i386obsd_aout_iterate_over_regset_sections): New.
(i386obsd_aout_init_abi): Adjust gdbarch initialization.
* configure.tgt (gdb_target_obs): Add fbsd-tdep.o for all x86 FreeBSD
targets.
* amd64fbsd-tdep.c (fbsd-tdep.h): Include.
(amd64fbsd_init_abi): Call fbsd_init_abi.
* i386fbsd-tdep.c (fbsd-tdep.h): Include.
(i386fbsd4_init_abi): Call fbsd_init_abi.
* amd64fbsd-nat.c (_initialize_amd64fbsd_nat): No longer set
target method 'make_corefile_notes'.
* i386fbsd-nat.c (_initialize_i386fbsd_nat): Likewise.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* hppa-hpux-tdep.c (hppa_hpux_regset_from_core_section): Remove.
(hppa_hpux_iterate_over_regset_sections): New.
(hppa_hpux_init_abi): Adjust gdbarch initialization.
* hppa-linux-tdep.c (hppa_linux_regset_from_core_section): Remove.
(hppa_linux_iterate_over_regset_sections): New.
(hppa_linux_init_abi): Adjust.
* hppanbsd-tdep.c (hppaobsd_regset_from_core_section): Remove.
(hppanbsd_iterate_over_regset_sections): New.
(hppanbsd_init_abi): Adjust.
* hppaobsd-tdep.c (hppaobsd_regset_from_core_section): Remove.
(hppaobsd_iterate_over_regset_sections): New.
(hppaobsd_init_abi): Adjust.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* frv-linux-tdep.c (frv_linux_regset_from_core_section): Remove.
(frv_linux_iterate_over_regset_sections): New.
(frv_linux_init_abi): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* arm-tdep.h (armbsd_regset_from_core_section): Remove prototype.
(armbsd_iterate_over_regset_sections): New prototype.
* armbsd-tdep.c (armbsd_regset_from_core_section): Remove.
(armbsd_iterate_over_regset_sections): New.
* armobsd-tdep.c (armobsd_init_abi): Adjust gdbarch
initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* alpha-linux-tdep.c (alpha_linux_regset_from_core_section): Remove.
(alpha_linux_iterate_over_regset_sections): New.
(alpha_linux_init_abi): Adjust gdbarch initialization.
* alphabsd-tdep.h (alphanbsd_regset_from_core_section): Remove
prototype.
(alphanbsd_iterate_over_regset_sections): New prototype.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* aarch64-linux-tdep.c (aarch64_linux_regset_from_core_section):
Remove.
(aarch64_linux_iterate_over_regset_sections): New.
(aarch64_linux_init_abi): Adjust gdbarch initialization.
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* fbsd-tdep.c: New file.
* fbsd-tdep.h: New file.
* Makefile.in (ALL_TARGET_OBS): Add fbsd-tdep.o.
(HFILES_NO_SRCDIR): Add fbsd-tdep.h.
(ALLDEPFILES): Add fbsd-tdep.c.
Add 'regset' parameter to 'iterate_over_regset_sections_cb' This adds the 'regset' parameter to the iterator callback. Consequently the 'regset_from_core_section' method is dropped for all targets that provide the iterator method. This change prepares for replacing regset_from_core_section everywhere, thereby eliminating one gdbarch interface. Since the iterator is usually no more complex than regset_from_core_section alone, targets that previously didn't define core_regset_sections will then gain multi-arch capable core file generation support without increased complexity. gdb/ChangeLog: * gdbarch.sh (iterate_over_regset_sections_cb): Add regset parameter. * gdbarch.h: Regenerate. * corelow.c (sniff_core_bfd): Don't sniff if gdbarch has a regset iterator. (get_core_register_section): Add parameter 'regset' and use it, if set. Add parameter 'min_size' and verify the bfd section size against it. (get_core_registers_cb): Add parameter 'regset' and pass it to get_core_register section. For the "standard" register sections ".reg" and ".reg2", set an appropriate default for human_name. (get_core_registers): Don't abort when the gdbarch has an iterator but no regset_from_core_section. Add NULL/0 for parameters 'regset'/'min_size' in calls to get_core_register_section. * linux-tdep.c (linux_collect_regset_section_cb): Add parameter 'regset' and use it instead of calling the regset_from_core_section gdbarch method. * i386-tdep.h (struct gdbarch_tdep): Add field 'fpregset'. * i386-tdep.c (i386_supply_xstateregset) (i386_collect_xstateregset, i386_xstateregset): Moved to i386-linux-tdep.c. (i386_regset_from_core_section): Drop handling for .reg-xfp and .reg-xstate. (i386_gdbarch_init): Set tdep field 'fpregset'. Enable generic core file support only if the regset iterator hasn't been set. * i386-linux-tdep.c (i386_linux_supply_xstateregset) (i386_linux_collect_xstateregset, i386_linux_xstateregset): New. Moved from i386-tdep.c and renamed to *_linux*. (i386_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * amd64-tdep.c (amd64_supply_xstateregset) (amd64_collect_xstateregset, amd64_xstateregset): Moved to amd64-linux-tdep.c. (amd64_regset_from_core_section): Remove. (amd64_init_abi): Set new tdep field 'fpregset'. No longer install an amd64-specific regset_from_core_section gdbarch method. * amd64-linux-tdep.c (amd64_linux_supply_xstateregset) (amd64_linux_collect_xstateregset, amd64_linux_xstateregset): New. Moved from amd64-tdep.c and renamed to *_linux*. (amd64_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * arm-linux-tdep.c (arm_linux_regset_from_core_section): Remove. (arm_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (arm_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * ppc-linux-tdep.c (ppc_linux_regset_from_core_section): Remove. (ppc_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (ppc_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * s390-linux-tdep.c (struct gdbarch_tdep): Remove the fields gregset, sizeof_gregset, fpregset, and sizeof_fpregset. (s390_regset_from_core_section): Remove. (s390_iterate_over_regset_sections): Add regset parameter to each callback invocation. (s390_gdbarch_init): No longer set the regset_from_core_section gdbarch method. Drop initialization of deleted tdep fields.
2014-09-12 10:42:48 +02:00
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdbarch.sh (iterate_over_regset_sections_cb): Add regset
parameter.
* gdbarch.h: Regenerate.
* corelow.c (sniff_core_bfd): Don't sniff if gdbarch has a regset
iterator.
(get_core_register_section): Add parameter 'regset' and use it, if
set. Add parameter 'min_size' and verify the bfd section size
against it.
(get_core_registers_cb): Add parameter 'regset' and pass it to
get_core_register section. For the "standard" register sections
".reg" and ".reg2", set an appropriate default for human_name.
(get_core_registers): Don't abort when the gdbarch has an iterator
but no regset_from_core_section. Add NULL/0 for parameters
'regset'/'min_size' in calls to get_core_register_section.
* linux-tdep.c (linux_collect_regset_section_cb): Add parameter
'regset' and use it instead of calling the
regset_from_core_section gdbarch method.
* i386-tdep.h (struct gdbarch_tdep): Add field 'fpregset'.
* i386-tdep.c (i386_supply_xstateregset)
(i386_collect_xstateregset, i386_xstateregset): Moved to
i386-linux-tdep.c.
(i386_regset_from_core_section): Drop handling for .reg-xfp and
.reg-xstate.
(i386_gdbarch_init): Set tdep field 'fpregset'. Enable generic
core file support only if the regset iterator hasn't been set.
* i386-linux-tdep.c (i386_linux_supply_xstateregset)
(i386_linux_collect_xstateregset, i386_linux_xstateregset): New.
Moved from i386-tdep.c and renamed to *_linux*.
(i386_linux_iterate_over_regset_sections): Add regset parameter to
each callback invocation. Allow any .reg-xstate size when reading
from a core file.
* amd64-tdep.c (amd64_supply_xstateregset)
(amd64_collect_xstateregset, amd64_xstateregset): Moved to
amd64-linux-tdep.c.
(amd64_regset_from_core_section): Remove.
(amd64_init_abi): Set new tdep field 'fpregset'. No longer
install an amd64-specific regset_from_core_section gdbarch method.
* amd64-linux-tdep.c (amd64_linux_supply_xstateregset)
(amd64_linux_collect_xstateregset, amd64_linux_xstateregset): New.
Moved from amd64-tdep.c and renamed to *_linux*.
(amd64_linux_iterate_over_regset_sections): Add regset parameter
to each callback invocation. Allow any .reg-xstate size when
reading from a core file.
* arm-linux-tdep.c (arm_linux_regset_from_core_section): Remove.
(arm_linux_iterate_over_regset_sections): Add regset parameter to
each callback invocation.
(arm_linux_init_abi): No longer set the regset_from_core_section
gdbarch method.
* ppc-linux-tdep.c (ppc_linux_regset_from_core_section): Remove.
(ppc_linux_iterate_over_regset_sections): Add regset parameter to
each callback invocation.
(ppc_linux_init_abi): No longer set the regset_from_core_section
gdbarch method.
* s390-linux-tdep.c (struct gdbarch_tdep): Remove the fields
gregset, sizeof_gregset, fpregset, and sizeof_fpregset.
(s390_regset_from_core_section): Remove.
(s390_iterate_over_regset_sections): Add regset parameter to each
callback invocation.
(s390_gdbarch_init): No longer set the regset_from_core_section
gdbarch method. Drop initialization of deleted tdep fields.
Replace 'core_regset_sections' by iterator method The core_regset_sections list in gdbarch (needed for multi-arch capable core file generation support) is replaced by an iterator method. Overall, this reduces the code a bit, and it allows for more flexibility. gdb/ChangeLog: * amd64-linux-tdep.c (amd64_linux_regset_sections): Remove. (amd64_linux_iterate_over_regset_sections): New. (amd64_linux_init_abi_common): Don't install the regset section list, but the new iterator in gdbarch. * arm-linux-tdep.c (arm_linux_fpa_regset_sections) (arm_linux_vfp_regset_sections): Remove. Move combined logic... (arm_linux_iterate_over_regset_sections): ...here. New function. (arm_linux_init_abi): Set iterator instead of section list. * corelow.c (get_core_registers_cb): New function, logic moved from... (get_core_registers): ...loop body here. Use new iterator method instead of walking through the regset section list. * gdbarch.sh: Remove 'core_regset_sections'. New method 'iterate_over_regset_sections'. New typedef 'iterate_over_regset_sections_cb'. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * i386-linux-tdep.c (i386_linux_regset_sections) (i386_linux_sse_regset_sections, i386_linux_avx_regset_sections): Remove. (i386_linux_iterate_over_regset_sections): New. (i386_linux_init_abi): Don't choose a regset section list, but install new iterator in gdbarch. * linux-tdep.c (struct linux_collect_regset_section_cb_data): New. (linux_collect_regset_section_cb): New function, logic moved from... (linux_collect_thread_registers): ...loop body here. Use iterator method instead of walking through list. (linux_make_corefile_notes_1): Check for presence of iterator method instead of regset section list. * ppc-linux-tdep.c (ppc_linux_vsx_regset_sections) (ppc_linux_vmx_regset_sections, ppc_linux_fp_regset_sections) (ppc64_linux_vsx_regset_sections, ppc64_linux_vmx_regset_sections) (ppc64_linux_fp_regset_sections): Remove. Move combined logic... (ppc_linux_iterate_over_regset_sections): ...here. New function. (ppc_linux_init_abi): Don't choose from above regset section lists, but install new iterator in gdbarch. * regset.h (struct core_regset_section): Remove. * s390-linux-tdep.c (struct gdbarch_tdep): Add new fields have_linux_v1, have_linux_v2, and have_tdb. (s390_linux32_regset_sections, s390_linux32v1_regset_sections) (s390_linux32v2_regset_sections, s390_linux64_regset_sections) (s390_linux64v1_regset_sections, s390_linux64v2_regset_sections) (s390x_linux64_regset_sections, s390x_linux64v1_regset_sections) (s390x_linux64v2_regset_sections): Remove. Move combined logic... (s390_iterate_over_regset_sections): ...here. New function. Use new tdep fields. (s390_gdbarch_init): Set new tdep fields. Don't choose from above regset section lists, but install new iterator.
2014-09-04 17:26:43 +02:00
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* amd64-linux-tdep.c (amd64_linux_regset_sections): Remove.
(amd64_linux_iterate_over_regset_sections): New.
(amd64_linux_init_abi_common): Don't install the regset section
list, but the new iterator in gdbarch.
* arm-linux-tdep.c (arm_linux_fpa_regset_sections)
(arm_linux_vfp_regset_sections): Remove. Move combined logic...
(arm_linux_iterate_over_regset_sections): ...here. New function.
(arm_linux_init_abi): Set iterator instead of section list.
* corelow.c (get_core_registers_cb): New function, logic moved
from...
(get_core_registers): ...loop body here. Use new iterator method
instead of walking through the regset section list.
* gdbarch.sh: Remove 'core_regset_sections'. New method
'iterate_over_regset_sections'. New typedef
'iterate_over_regset_sections_cb'.
* gdbarch.c: Regenerate.
* gdbarch.h: Likewise.
* i386-linux-tdep.c (i386_linux_regset_sections)
(i386_linux_sse_regset_sections, i386_linux_avx_regset_sections):
Remove.
(i386_linux_iterate_over_regset_sections): New.
(i386_linux_init_abi): Don't choose a regset section list, but
install new iterator in gdbarch.
* linux-tdep.c (struct linux_collect_regset_section_cb_data): New.
(linux_collect_regset_section_cb): New function, logic moved
from...
(linux_collect_thread_registers): ...loop body here. Use iterator
method instead of walking through list.
(linux_make_corefile_notes_1): Check for presence of iterator
method instead of regset section list.
* ppc-linux-tdep.c (ppc_linux_vsx_regset_sections)
(ppc_linux_vmx_regset_sections, ppc_linux_fp_regset_sections)
(ppc64_linux_vsx_regset_sections, ppc64_linux_vmx_regset_sections)
(ppc64_linux_fp_regset_sections): Remove. Move combined logic...
(ppc_linux_iterate_over_regset_sections): ...here. New function.
(ppc_linux_init_abi): Don't choose from above regset section
lists, but install new iterator in gdbarch.
* regset.h (struct core_regset_section): Remove.
* s390-linux-tdep.c (struct gdbarch_tdep): Add new fields
have_linux_v1, have_linux_v2, and have_tdb.
(s390_linux32_regset_sections, s390_linux32v1_regset_sections)
(s390_linux32v2_regset_sections, s390_linux64_regset_sections)
(s390_linux64v1_regset_sections, s390_linux64v2_regset_sections)
(s390x_linux64_regset_sections, s390x_linux64v1_regset_sections)
(s390x_linux64v2_regset_sections): Remove. Move combined logic...
(s390_iterate_over_regset_sections): ...here. New function. Use
new tdep fields.
(s390_gdbarch_init): Set new tdep fields. Don't choose from above
regset section lists, but install new iterator.
2014-09-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* solib-svr4.c (svr4_parse_libraries): Use "library-list-svr4.dtd".
2014-09-26 Simon Marchi <simon.marchi@ericsson.com>
* progspace.c (print_program_space): Don't prune program spaces
before printing them.
2014-09-25 Pedro Alves <palves@redhat.com>
* infrun.c (user_visible_resume_ptid): Don't check
singlestep_breakpoints_inserted_p.
2014-09-25 Pedro Alves <palves@redhat.com>
* breakpoint.c (should_be_inserted): Add debug output.
2014-09-25 Pedro Alves <palves@redhat.com>
* infrun.c (stepping_past_instruction_at)
(clear_exit_convenience_vars): Point at infrun.h instead of
inferior.h.
(handle_signal_stop): Fix typo.
2014-09-24 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (thumb_in_function_epilogue_p): Fix typo in the
bitmask.
2014-09-22 Gary Benson <gbenson@redhat.com>
* target.c (target_stop): Updated comment.
2014-09-22 Gary Benson <gbenson@redhat.com>
* target/target.h (target_stop_ptid): Renamed as...
(target_stop_and_wait): New function. Updated comment.
All uses updated.
(target_continue_ptid): Renamed as...
(target_continue_no_signal): New function. Updated comment.
All uses updated.
Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto" By default, GDB removes all breakpoints from the target when the target stops and the prompt is given back to the user. This is useful in case GDB crashes while the user is interacting, as otherwise, there's a higher chance breakpoints would be left planted on the target. But, as long as any thread is running free, we need to make sure to keep breakpoints inserted, lest a thread misses a breakpoint. With that in mind, in preparation for non-stop mode, we added a "breakpoint always-inserted on" mode. This traded off the extra crash protection for never having threads miss breakpoints, and in addition is more efficient if there's a ton of breakpoints to remove/insert at each user command (e.g., at each "step"). When we added non-stop mode, and for a period, we required users to manually set "always-inserted on" when they enabled non-stop mode, as otherwise GDB removes all breakpoints from the target as soon as any thread stops, which means the other threads still running will miss breakpoints. The test added by this patch exercises this. That soon revealed a nuisance, and so later we added an extra "breakpoint always-inserted auto" mode, that made GDB behave like "always-inserted on" when non-stop was enabled, and "always-inserted off" when non-stop was disabled. "auto" was made the default at the same time. In hindsight, this "auto" setting was unnecessary, and not the ideal solution. Non-stop mode does depends on breakpoints always-inserted mode, but only as long as any thread is running. If no thread is running, no breakpoint can be missed. The same is true for all-stop too. E.g., if, in all-stop mode, and the user does: (gdb) c& (gdb) b foo That breakpoint at "foo" should be inserted immediately, but it currently isn't -- currently it'll end up inserted only if the target happens to trip on some event, and is re-resumed, e.g., an internal breakpoint triggers that doesn't cause a user-visible stop, and so we end up in keep_going calling insert_breakpoints. The test added by this patch also covers this. IOW, no matter whether in non-stop or all-stop, if the target fully stops, we can remove breakpoints. And no matter whether in all-stop or non-stop, if any thread is running in the target, then we need breakpoints to be immediately inserted. And then, if the target has global breakpoints, we need to keep breakpoints even when the target is stopped. So with that in mind, and aiming at reducing all-stop vs non-stop differences for all-stop-on-stop-of-non-stop, this patch fixes "breakpoint always-inserted off" to not remove breakpoints from the target until it fully stops, and then removes the "auto" setting as unnecessary. I propose removing it straight away rather than keeping it as an alias, unless someone complains they have scripts that need it and that can't adjust. Tested on x86_64 Fedora 20. gdb/ 2014-09-22 Pedro Alves <palves@redhat.com> * NEWS: Mention merge of "breakpoint always-inserted" modes "off" and "auto" merged. * breakpoint.c (enum ugll_insert_mode): New enum. (always_inserted_mode): Now a plain boolean. (show_always_inserted_mode): No longer handle AUTO_BOOLEAN_AUTO. (breakpoints_always_inserted_mode): Delete. (breakpoints_should_be_inserted_now): New function. (insert_breakpoints): Pass UGLL_INSERT to update_global_location_list instead of calling insert_breakpoint_locations manually. (create_solib_event_breakpoint_1): New, factored out from ... (create_solib_event_breakpoint): ... this. (create_and_insert_solib_event_breakpoint): Use create_solib_event_breakpoint_1 instead of calling insert_breakpoint_locations manually. (update_global_location_list): Change parameter type from boolean to enum ugll_insert_mode. All callers adjusted. Adjust to use breakpoints_should_be_inserted_now and handle UGLL_INSERT. (update_global_location_list_nothrow): Change parameter type from boolean to enum ugll_insert_mode. (_initialize_breakpoint): "breakpoint always-inserted" option is now a boolean command. Update help text. * breakpoint.h (breakpoints_always_inserted_mode): Delete declaration. (breakpoints_should_be_inserted_now): New declaration. * infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>: Remove breakpoints_always_inserted_mode check. (normal_stop): Adjust to use breakpoints_should_be_inserted_now. * remote.c (remote_start_remote): Likewise. gdb/doc/ 2014-09-22 Pedro Alves <palves@redhat.com> * gdb.texinfo (Set Breaks): Document that "set breakpoint always-inserted off" is the default mode now. Delete documentation of "set breakpoint always-inserted auto". gdb/testsuite/ 2014-09-22 Pedro Alves <palves@redhat.com> * gdb.threads/break-while-running.exp: New file. * gdb.threads/break-while-running.c: New file.
2014-09-22 10:56:55 +02:00
2014-09-22 Pedro Alves <palves@redhat.com>
* NEWS: Mention merge of "breakpoint always-inserted" modes "off"
and "auto" merged.
* breakpoint.c (enum ugll_insert_mode): New enum.
(always_inserted_mode): Now a plain boolean.
(show_always_inserted_mode): No longer handle AUTO_BOOLEAN_AUTO.
(breakpoints_always_inserted_mode): Delete.
(breakpoints_should_be_inserted_now): New function.
(insert_breakpoints): Pass UGLL_INSERT to
update_global_location_list instead of calling
insert_breakpoint_locations manually.
(create_solib_event_breakpoint_1): New, factored out from ...
(create_solib_event_breakpoint): ... this.
(create_and_insert_solib_event_breakpoint): Use
create_solib_event_breakpoint_1 instead of calling
insert_breakpoint_locations manually.
(update_global_location_list): Change parameter type from boolean
to enum ugll_insert_mode. All callers adjusted. Adjust to use
breakpoints_should_be_inserted_now and handle UGLL_INSERT.
(update_global_location_list_nothrow): Change parameter type from
boolean to enum ugll_insert_mode.
(_initialize_breakpoint): "breakpoint always-inserted" option is
now a boolean command. Update help text.
* breakpoint.h (breakpoints_always_inserted_mode): Delete declaration.
(breakpoints_should_be_inserted_now): New declaration.
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>:
Remove breakpoints_always_inserted_mode check.
(normal_stop): Adjust to use breakpoints_should_be_inserted_now.
* remote.c (remote_start_remote): Likewise.
2014-09-22 Pedro Alves <palves@redhat.com>
* breakpoint.c (enum ugll_insert_mode): Add UGLL_INSERT.
(insert_breakpoints): Don't call insert_breakpoint_locations here.
Instead, pass UGLL_INSERT to update_global_location_list.
(update_global_location_list): Change parameter type from boolean
to enum ugll_insert_mode. All callers adjusted. Adjust to use
breakpoints_should_be_inserted_now and handle UGLL_INSERT.
(create_solib_event_breakpoint_1): New, factored out from ...
(create_solib_event_breakpoint): ... this.
(create_and_insert_solib_event_breakpoint): Use
create_solib_event_breakpoint_1 instead of calling
insert_breakpoint_locations manually.
(update_global_location_list): Handle UGLL_INSERT.
2014-09-22 Pedro Alves <palves@redhat.com>
* breakpoint.c (enum ugll_insert_mode): New enum.
(update_global_location_list)
(update_global_location_list_nothrow): Change parameter type from
boolean to enum ugll_insert_mode. All callers adjusted.
2014-09-19 Joel Brobecker <brobecker@adacore.com>
* MAINTAINERS: Add Sergio Durigan Junior as maintainer of
SystemTap support in GDB.
2014-09-19 Don Breazeal <donb@codesourcery.com>
* linux-nat.c (linux_handle_extended_wait): Call
linux_ptrace_get_extended_event.
(wait_lwp): Call linux_is_extended_waitstatus.
(linux_nat_filter_event): Call linux_ptrace_get_extended_event
and linux_is_extended_waitstatus.
* nat/linux-ptrace.c (linux_test_for_tracefork): Call
linux_ptrace_get_extended_event.
(linux_ptrace_get_extended_event): New function.
(linux_is_extended_waitstatus): New function.
* nat/linux-ptrace.h (linux_ptrace_get_extended_event)
(linux_is_extended_waitstatus): New declarations.
Check function is GC'ed I see the following fail on arm-none-eabi target, (gdb) b 24^M Breakpoint 1 at 0x4: file ../../../../git/gdb/testsuite/gdb.base/break-on-linker-gcd-function.cc, line 24.^M (gdb) FAIL: gdb.base/break-on-linker-gcd-function.exp: b 24 Currently, we are using flag has_section_at_zero to determine whether address zero in debug info means the corresponding code has been GC'ed, like this: case DW_LNE_set_address: address = read_address (abfd, line_ptr, cu, &bytes_read); if (address == 0 && !dwarf2_per_objfile->has_section_at_zero) { /* This line table is for a function which has been GCd by the linker. Ignore it. PR gdb/12528 */ However, this is incorrect on some bare metal targets, as .text section is located at 0x0, so dwarf2_per_objfile->has_section_at_zero is true. If a function is GC'ed by linker, the address is zero. GDB thinks address zero is a function's address rather than this function is GC'ed. In this patch, we choose 'lowpc' got in read_file_scope to check whether 'lowpc' is greater than zero. If it isn't, address zero really means the function is GC'ed. In this patch, we pass 'lowpc' in read_file_scope through handle_DW_AT_stmt_list and dwarf_decode_lines, and to dwarf_decode_lines_1 finally. This patch fixes the fail above. This patch also covers the path that partial symbol isn't used, which is tested by starting gdb with --readnow option. It is regression tested on x86-linux with target_board=dwarf4-gdb-index, and arm-none-eabi. OK to apply? gdb: 2014-09-19 Yao Qi <yao@codesourcery.com> * dwarf2read.c (dwarf_decode_lines): Update declaration. (handle_DW_AT_stmt_list): Add argument 'lowpc'. Update comments. Callers update. (dwarf_decode_lines): Likewise. (dwarf_decode_lines_1): Add argument 'lowpc'. Update comments. Skip the line table if 'lowpc' is greater than 'address'. Don't check dwarf2_per_objfile->has_section_at_zero. gdb/testsuite: 2014-09-19 Yao Qi <yao@codesourcery.com> * gdb.base/break-on-linker-gcd-function.exp: Move test into new proc set_breakpoint_on_gcd_function. Invoke set_breakpoint_on_gcd_function. Restart GDB with --readnow and invoke set_breakpoint_on_gcd_function again.
2014-08-04 08:57:22 +02:00
2014-09-19 Yao Qi <yao@codesourcery.com>
* dwarf2read.c (dwarf_decode_lines): Update declaration.
(handle_DW_AT_stmt_list): Add argument 'lowpc'. Update
comments. Callers update.
(dwarf_decode_lines): Likewise.
(dwarf_decode_lines_1): Add argument 'lowpc'. Update
comments. Skip the line table if 'lowpc' is greater than
'address'. Don't check
dwarf2_per_objfile->has_section_at_zero.
2014-09-18 Doug Evans <dje@google.com>
* NEWS: Mention new "producer" attribute of gdb.Symtab.
* python/py-symtab.c (stpy_get_producer): New function.
(symtab_object_getset): Add "producer" attribute.
2014-09-17 Ulrich Weigand  <uweigand@de.ibm.com>
PR gdb/17384
* corefile.c (struct captured_read_memory_integer_arguments): Remove.
(do_captured_read_memory_integer): Remove.
(safe_read_memory_integer): Use target_read_memory directly instead
of catching errors in do_captured_read_memory_integer.
2014-09-16 Maciej W. Rozycki <macro@codesourcery.com>
* CONTRIBUTE (Coding Standards): For internals refer to wiki,
not gdb/doc.
2014-09-16 Sergio Durigan Junior <sergiodj@redhat.com>
* objc-lang.c (find_implementation_from_class): Remove dead code.
2014-09-16 Sergio Durigan Junior <sergiodj@redhat.com>
PR cli/7233
* linux-nat.c (linux_nat_wait_1): Replace "fprintf (stderr..." by
"fprintf_unfiltered (gdb_stdlog...)".
Fix PR12526: -location watchpoints for bitfield arguments PR 12526 reports that -location watchpoints against bitfield arguments trigger false positives when bits around the bitfield, but not the bitfield itself, are modified. This happens because -location watchpoints naturally operate at the byte level, not at the bit level. When the address of a bitfield lvalue is taken, information about the bitfield (i.e. its offset and size) is lost in the process. This information must first be retained throughout the lifetime of the -location watchpoint. This patch achieves this by adding two new fields to the watchpoint struct: val_bitpos and val_bitsize. These fields are set when a watchpoint is first defined in watch_command_1. They are both equal to zero if the watchpoint is not a -location watchpoint or if the argument is not a bitfield. Then these bitfield parameters are used inside update_watchpoint and watchpoint_check to extract the actual value of the bitfield from the watchpoint address, with the help of a local helper function extract_bitfield_from_watchpoint_value. Finally when creating a HW breakpoint pointing to a bitfield, we optimize the address and length of the breakpoint. By skipping over the bytes that don't cover the bitfield, this step reduces the frequency at which a read watchpoint for the bitfield is triggered. It also reduces the number of times a false-positive call to check_watchpoint is triggered for a write watchpoint. gdb/ PR breakpoints/12526 * breakpoint.h (struct watchpoint): New fields val_bitpos and val_bitsize. * breakpoint.c (watch_command_1): Use these fields to retain bitfield information. (extract_bitfield_from_watchpoint_value): New function. (watchpoint_check): Use it. (update_watchpoint): Use it. Optimize the address and length of a HW watchpoint pointing to a bitfield. * value.h (unpack_value_bitfield): New prototype. * value.c (unpack_value_bitfield): Make extern. gdb/testsuite/ PR breakpoints/12526 * gdb.base/watch-bitfields.exp: New file. * gdb.base/watch-bitfields.c: New file.
2014-09-16 18:40:06 +02:00
2014-09-16 Patrick Palka <patrick@parcs.ath.cx>
PR breakpoints/12526
* breakpoint.h (struct watchpoint): New fields val_bitpos and
val_bitsize.
* breakpoint.c (watch_command_1): Use these fields to retain
bitfield information.
(extract_bitfield_from_watchpoint_value): New function.
(watchpoint_check): Use it.
(update_watchpoint): Use it. Optimize the address and length of a
HW watchpoint pointing to a bitfield.
* value.h (unpack_value_bitfield): New prototype.
* value.c (unpack_value_bitfield): Make extern.
2014-09-16 Samuel Thibault <samuel.thibault@ens-lyon.org>
* config/i386/i386gnu.mh (NATDEPFILES): Add x86-nat.o and
x86-dregs.o.
* gnu-nat.c (inf_threads): New function.
* gnu-nat.h (inf_threads_ftype): New typedef.
(inf_threads): New declaration.
* i386gnu-nat.c: Include "x86-nat.h" and "inf-child.h".
[i386_DEBUG_STATE] (i386_gnu_dr_get, i386_gnu_dr_set)
(i386_gnu_dr_set_control_one, i386_gnu_dr_set_control)
(i386_gnu_dr_set_addr_one, i386_gnu_dr_set_addr)
(i386_gnu_dr_get_reg, i386_gnu_dr_get_addr, 386_gnu_dr_get_status)
(i386_gnu_dr_get_control): New functions.
(reg_addr): New structure.
(_initialize_i386gnu_nat) [i386_DEBUG_STATE]: Initialize hardware
i386 debugging register hooks.
* NEWS: Mention this.
2014-08-13 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (arm_record_vdata_transfer_insn): Added record handler for
vector data transfer instructions.
(arm_record_coproc_data_proc): Updated.
2014-08-13 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (arm_record_asimd_vfp_coproc): Replace stub handler with
arm_record_exreg_ld_st_insn.
(arm_record_exreg_ld_st_insn): Add record handler for ex-register
load/store insns.
2014-08-13 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (arm_record_coproc_data_proc): Updated.
(arm_record_vfp_data_proc_insn): Added record handler for VFP data
processing instructions.
2014-08-13 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (thumb2_record_asimd_struct_ld_st): Add record handler
for advance SIMD struct ld/st insn.
(thumb2_record_decode_insn_handler): Replace stub handler with
thumb2_record_asimd_struct_ld_st.
2014-08-13 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (arm_record_coproc_data_proc): Add record handler stubs
for asimd, vfp and coprocessor insns.
(arm_record_asimd_vfp_coproc): Add record handler for asimd, vfp
and coprocessor insns.
(thumb2_record_coproc_insn): New function.
(thumb2_record_decode_insn_handler): Update coprocessor insns record
handlers.
(decode_insn): Install arm_record_asimd_vfp_coproc as handler for
opcode 110 insns.
2014-09-13 Doug Evans <xdje42@gmail.com>
* NEWS: Mention new "queue-signal" command.
* infcmd.c (queue_signal_command): New function.
(_initialize_infcmd): Add new queue-signal command.
2014-09-13 Doug Evans <xdje42@gmail.com>
* linux-nat.c (wait_lwp): Add debugging printf.
(linux_nat_wait_1): Ditto.
[IRIX] eliminate deprecated_insert_raw_breakpoint uses The IRIX support wants to set a breakpoint to be hit when the startup phase is complete, which is where shared libraries have been mapped in. AFAIU, for most IRIX ports, that location is the entry point. For MIPS IRIX however, GDB needs to set a breakpoint earlier, in __dbx_link, as explained by: #ifdef SYS_syssgi /* On mips-irix, we need to stop the inferior early enough during the startup phase in order to be able to load the shared library symbols and insert the breakpoints that are located in these shared libraries. Stopping at the program entry point is not good enough because the -init code is executed before the execution reaches that point. So what we need to do is to insert a breakpoint in the runtime loader (rld), more precisely in __dbx_link(). This procedure is called by rld once all shared libraries have been mapped, but before the -init code is executed. Unfortuantely, this is not straightforward, as rld is not part of the executable we are running, and thus we need the inferior to run until rld itself has been mapped in memory. For this, we trace all syssgi() syscall exit events. Each time we detect such an event, we iterate over each text memory maps, get its associated fd, and scan the symbol table for __dbx_link(). When found, we know that rld has been mapped, and that we can insert the breakpoint at the symbol address. Once the dbx_link() breakpoint has been inserted, the syssgi() notifications are no longer necessary, so they should be canceled. */ proc_trace_syscalls_1 (pi, SYS_syssgi, PR_SYSEXIT, FLAG_SET, 0); #endif The loop in irix_solib_create_inferior_hook then runs until whichever breakpoint is hit first, the one set by solib-irix.c or the one set by procfs.c. Note the comment in disable_break talks about __dbx_init, but I think that's a typo for __dbx_link: - /* Note that it is possible that we have stopped at a location that - is different from the location where we inserted our breakpoint. - On mips-irix, we can actually land in __dbx_init(), so we should - not check the PC against our breakpoint address here. See procfs.c - for more details. */ This looks very much like referring to the loop in irix_solib_create_inferior_hook stopping at __dbx_link instead of at the entry point. What this patch does is convert these deprecated raw breakpoints to standard solib_event breakpoints. When the first solib-event breakpoint is hit, we delete all solib-event breakpoints. We do that in the so_ops->handle_event hook. This allows getting rid of the loop in irix_solib_create_inferior_hook completely, which should allow properly handling signals and other events in the early startup phase, like in SVR4. Built on x86_64 Fedora 20 with --enable-targets=all (builds solib-irix.c). Joel tested that with an earlier version of this patch "info shared" after starting a program gave the same list of shared libraries as before. gdb/ChangeLog: 2014-09-12 Pedro Alves <palves@redhat.com> * breakpoint.c (remove_solib_event_breakpoints_at_next_stop) (create_and_insert_solib_event_breakpoint): New functions. * breakpoint.h (create_and_insert_solib_event_breakpoint) (remove_solib_event_breakpoints_at_next_stop): New declarations. * procfs.c (dbx_link_bpt_addr, dbx_link_bpt): Delete globals. (remove_dbx_link_breakpoint): Delete function. (insert_dbx_link_bpt_in_file): Use create_and_insert_solib_event_breakpoint instead of deprecated_insert_raw_breakpoint. (procfs_wait): Don't check whether we hit __dbx_link here. (procfs_mourn_inferior): Don't delete the __dbx_link breakpoint here. * solib-irix.c (base_breakpoint): Delete global. (disable_break): Delete function. (enable_break): Use create_solib_event_breakpoint instead of deprecated_insert_raw_breakpoint. (irix_solib_handle_event): New function. (irix_solib_create_inferior_hook): Don't run the target or disable the mapping-complete breakpoint here. (_initialize_irix_solib): Install irix_solib_handle_event as so_ops->handle_event hook.
2014-09-12 21:02:01 +02:00
2014-09-12 Pedro Alves <palves@redhat.com>
* breakpoint.c (remove_solib_event_breakpoints_at_next_stop)
(create_and_insert_solib_event_breakpoint): New functions.
* breakpoint.h (create_and_insert_solib_event_breakpoint)
(remove_solib_event_breakpoints_at_next_stop): New declarations.
* procfs.c (dbx_link_bpt_addr, dbx_link_bpt): Delete globals.
(remove_dbx_link_breakpoint): Delete function.
(insert_dbx_link_bpt_in_file): Use
create_and_insert_solib_event_breakpoint instead of
deprecated_insert_raw_breakpoint.
(procfs_wait): Don't check whether we hit __dbx_link here.
(procfs_mourn_inferior): Don't delete the __dbx_link breakpoint
here.
* solib-irix.c (base_breakpoint): Delete global.
(disable_break): Delete function.
(enable_break): Use create_solib_event_breakpoint
instead of deprecated_insert_raw_breakpoint.
(irix_solib_handle_event): New function.
(irix_solib_create_inferior_hook): Don't run the target or disable
the mapping-complete breakpoint here.
(_initialize_irix_solib): Install irix_solib_handle_event as
so_ops->handle_event hook.
2014-09-12 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Ulrich Weigand  <uweigand@de.ibm.com>
PR tdep/17379
* rs6000-tdep.c (rs6000_frame_cache): Use safe_read_memory_integer
instead of read_memory_unsigned_integer.
2014-09-12 Gary Benson <gbenson@redhat.com>
* nat/linux-waitpid.c: Include common-defs.h.
[GDBSERVER]: Add FIXME comment.
[!GDBSERVER]: Don't include defs.h or signal.h.
(linux_debug) [!GDBSERVER]: Remove empty block.
2014-09-12 Gary Benson <gbenson@redhat.com>
* nat/x86-dregs.c: Include common-defs.h and break-common.h.
Don't include defs.h or server.h.
2014-09-12 Gary Benson <gbenson@redhat.com>
* nat/linux-btrace.c: Include common-defs.h.
Don't include defs.h, server.h or gdbthread.h.
* nat/linux-btrace.h (struct target_ops): New forward declaration.
2014-09-12 Gary Benson <gbenson@redhat.com>
* common/agent.c: Include common-defs.h.
Don't include defs.h or server.h.
* common/buffer.c: Likewise.
* common/common-debug.c: Likewise.
* common/common-utils.c: Likewise.
* common/errors.c: Likewise.
* common/filestuff.c: Likewise.
* common/format.c: Likewise.
* common/gdb_vecs.c: Likewise.
* common/print-utils.c: Likewise.
* common/ptid.c: Likewise.
* common/rsp-low.c: Likewise.
* common/signals.c: Likewise.
* common/vec.c: Likewise.
* common/xml-utils.c: Likewise.
* nat/linux-osdata.c: Likewise.
* nat/linux-procfs.c: Likewise.
* nat/linux-ptrace.c: Likewise.
* nat/mips-linux-watch.c: Likewise.
* target/waitstatus.c: Likewise.
2014-09-12 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* common/common-regcache.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add common/common-regcache.h.
* regcache.h: Include common-regcache.h.
(regcache_read_pc): Don't declare.
* regcache.c (get_thread_regcache_for_ptid): New function.
* nat/linux-btrace.c: Don't include regcache.h.
Include common-regcache.h.
(perf_event_read_bts): Use get_thread_regcache_for_ptid.
2014-09-11 Thomas Schwinge <thomas@codesourcery.com>
* regcache.h (struct regset): Declare.
gdb/17347 - Regression: GDB stopped on run with attached process Doing: gdb --pid=PID -ex run Results in GDB getting a SIGTTIN, and thus ending stopped. That's usually indicative of a missing target_terminal_ours call. E.g., from the PR: $ sleep 1h & p=$!; sleep 0.1; gdb -batch sleep $p -ex run [1] 28263 [1] Killed sleep 1h [2]+ Stopped gdb -batch sleep $p -ex run The workaround is doing: gdb -ex "attach $PID" -ex "run" instead of gdb [-p] $PID -ex "run" With the former, gdb waits for the attach command to complete before moving on to the "run" command, because the interpreter is in sync mode at this point, within execute_command. But for the latter, attach_command is called directly from captured_main, and thus misses that waiting. IOW, "run" is running before the attach continuation has run, before the program stops and attach completes. The broken terminal settings are just one symptom of that. Any command that queries or requires input results in the same. The fix is to wait in catch_command_errors (which is specific to main.c nowadays), just like we wait in execute_command. gdb/ChangeLog: 2014-09-11 Pedro Alves <palves@redhat.com> PR gdb/17347 * main.c: Include "infrun.h". (catch_command_errors, catch_command_errors_const): Wait for the foreground command to complete. * top.c (maybe_wait_sync_command_done): New function, factored out from ... (maybe_wait_sync_command_done): ... here. * top.h (maybe_wait_sync_command_done): New declaration. gdb/testsuite/ChangeLog: 2014-09-11 Pedro Alves <palves@redhat.com> PR gdb/17347 * lib/gdb.exp (gdb_spawn_with_cmdline_opts): New procedure. * gdb.base/attach.exp (test_command_line_attach_run): New procedure. (top level): Call it.
2014-09-11 14:04:15 +02:00
2014-09-11 Pedro Alves <palves@redhat.com>
PR gdb/17347
* main.c: Include "infrun.h".
(catch_command_errors, catch_command_errors_const): Wait for the
foreground command to complete.
* top.c (maybe_wait_sync_command_done): New function, factored out
from ...
(maybe_wait_sync_command_done): ... here.
* top.h (maybe_wait_sync_command_done): New declaration.
2014-09-11 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* common/symbol.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add common/symbol.h.
* minsyms.c (find_minimal_symbol_address): New function.
* common/agent.c: Include common/symbol.h.
[!GDBSERVER]: Don't include objfiles.h.
(agent_look_up_symbols): Use find_minimal_symbol_address.
2014-09-11 Gary Benson <gbenson@redhat.com>
* target/target.h (target_stop_ptid, target_continue_ptid):
Declare.
* target.c (target_stop_ptid, target_continue_ptid): New
functions.
* common/agent.c [!GDBSERVER]: Don't include infrun.h.
(agent_run_command): Always use target_stop_ptid and
target_continue_ptid.
2014-09-11 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* target/target.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add target/target.h.
* target.h: Include target/target.h.
(target_read_memory, target_write_memory): Don't declare.
* target.c (target_read_uint32): New function.
* common/agent.c: Include target/target.h.
[!GDBSERVER]: Don't include target.h.
(helper_thread_id): Type changed to uint32_t.
(agent_get_helper_thread_id): Use target_read_uint32.
(agent_run_command): Always use target_read_memory and
target_write_memory.
(agent_capability): Type changed to uint32_t.
(agent_capability_check): Use target_read_uint32.
2014-09-11 Gary Benson <gbenson@redhat.com>
* common/common-debug.h (show_debug_regs): Declare.
* common/common-debug.c (show_debug_regs): Define.
* aarch64-linux-nat.c (debug_hw_points): Don't define. Replace
all uses with show_debug_regs. Replace all uses that considered
debug_hw_points as a multi-value integer with straight boolean
uses.
* x86-nat.c (debug_hw_points): Don't define. Replace all uses
with show_debug_regs.
* nat/x86-dregs.c (debug_hw_points): Don't declare. Replace
all uses with show_debug_regs.
* mips-linux-nat.c (maint_show_dr): Don't define. Replace all
uses with show_debug_regs.
2014-09-10 Ulrich Weigand  <uweigand@de.ibm.com>
* findvar.c (address_from_register): Handle targets requiring
a special conversion routine even for plain pointer types.
2014-09-10 Ulrich Weigand  <uweigand@de.ibm.com>
* rs6000-nat.c (exec_one_dummy_insn): Remove.
(store_register): Do not call exec_one_dummy_insn.
Ada: Print bounds/length of pointer to array with dynamic bounds Trying to print the bounds or the length of a pointer to an array whose bounds are dynamic results in the following error: (gdb) p foo.three_ptr.all'first Location address is not set. (gdb) p foo.three_ptr.all'length Location address is not set. This is because, after having dereferenced our array pointer, we use the type of the resulting array value, instead of the enclosing type. The former is the original type where the bounds are unresolved, whereas we need to get the actual array bounds. Similarly, trying to apply those attributes to the array pointer directly (without explicitly dereferencing it with the '.all' operator) yields the same kind of error: (gdb) p foo.three_ptr'first Location address is not set. (gdb) p foo.three_ptr'length Location address is not set. This is caused by the fact that the dereference was done implicitly in this case, and perform at the type level only, which is not sufficient in order to resolve the array type. This patch fixes both issues, thus allowing us to get the expected output: (gdb) p foo.three_ptr.all'first $1 = 1 (gdb) p foo.three_ptr.all'length $2 = 3 (gdb) p foo.three_ptr'first $3 = 1 (gdb) p foo.three_ptr'length $4 = 3 gdb/ChangeLog: * ada-lang.c (ada_array_bound): If ARR is a TYPE_CODE_PTR, dereference it first. Use value_enclosing_type instead of value_type. (ada_array_length): Likewise. gdb/testsuite/ChangeLog: * gdb.dwarf2/dynarr-ptr.exp: Add 'first, 'last and 'length tests.
2014-08-29 19:56:25 +02:00
2014-09-10 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_array_bound): If ARR is a TYPE_CODE_PTR,
dereference it first. Use value_enclosing_type instead of
value_type.
(ada_array_length): Likewise.
Ada subscripting of pointer to array with dynamic bounds Consider a pointer to an array which dynamic bounds, described in DWARF as follow: <1><25>: Abbrev Number: 4 (DW_TAG_array_type) <26> DW_AT_name : foo__array_type [...] <2><3b>: Abbrev Number: 5 (DW_TAG_subrange_type) [...] <40> DW_AT_lower_bound : 5 byte block: 97 38 1c 94 4 (DW_OP_push_object_address; DW_OP_lit8; DW_OP_minus; DW_OP_deref_size: 4) <46> DW_AT_upper_bound : 5 byte block: 97 34 1c 94 4 (DW_OP_push_object_address; DW_OP_lit4; DW_OP_minus; DW_OP_deref_size: 4) GDB is now able to correctly print the entire array, but not one element of the array. Eg: (gdb) p foo.three_ptr.all $1 = (1, 2, 3) (gdb) p foo.three_ptr.all(1) Cannot access memory at address 0xfffffffff4123a0c The problem occurs because we are missing a dynamic resolution of the variable's array type when subscripting the array. What the current code does is "fix"-ing the array type using the GNAT encodings, but that operation ignores any of the array's dynamic properties. This patch fixes the issue by using ada_value_ind to dereference the array pointer, which takes care of the array type resolution. It also continues to "fix" arrays described using GNAT encodings, so backwards compatibility is preserved. gdb/ChangeLog: * ada-lang.c (ada_value_ptr_subscript): Remove parameter "type". Adjust function implementation and documentation accordingly. (ada_evaluate_subexp) <OP_FUNCALL>: Only assign "type" if NOSIDE is EVAL_AVOID_SIDE_EFFECTS. Update call to ada_value_ptr_subscript. gdb/testsuite/ChangeLog: * gdb.dwarf2/dynarr-ptr.exp: Add subscripting tests.
2014-08-29 19:50:03 +02:00
2014-09-10 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_value_ptr_subscript): Remove parameter "type".
Adjust function implementation and documentation accordingly.
(ada_evaluate_subexp) <OP_FUNCALL>: Only assign "type" if
NOSIDE is EVAL_AVOID_SIDE_EFFECTS.
Update call to ada_value_ptr_subscript.
print PTR.all where PTR is an Ada thin pointer Consider the following declaration: type Array_Type is array (Natural range <>) of Integer; type Array_Ptr is access all Array_Type; for Array_Ptr'Size use 64; Three_Ptr : Array_Ptr := new Array_Type'(1 => 1, 2 => 2, 3 => 3); This creates a pointer to an array where the bounds are stored in a memory region just before the array itself (aka a "thin pointer"). In DWARF, this is described as a the usual pointer type to an array whose subrange has dynamic values for its bounds: <1><25>: Abbrev Number: 4 (DW_TAG_array_type) <26> DW_AT_name : foo__array_type [...] <2><3b>: Abbrev Number: 5 (DW_TAG_subrange_type) [...] <40> DW_AT_lower_bound : 5 byte block: 97 38 1c 94 4 (DW_OP_push_object_address; DW_OP_lit8; DW_OP_minus; DW_OP_deref_size: 4) <46> DW_AT_upper_bound : 5 byte block: 97 34 1c 94 4 (DW_OP_push_object_address; DW_OP_lit4; DW_OP_minus; DW_OP_deref_size: 4) GDB is currently printing the value of the array incorrectly: (gdb) p foo.three_ptr.all $1 = (26629472 => 1, 2, value.c:819: internal-error: value_contents_bits_eq: [...] The dereferencing (".all" operator) is done by calling ada_value_ind, which itself calls value_ind. It first produces a new value where the bounds of the array were correctly resolved to their actual value, but then calls readjust_indirect_value_type which replaces the resolved type by the original type. The problem starts when ada_value_print does not take this situation into account, and starts using the type of the resulting value, which has unresolved array bounds, instead of using the value's enclosing type. After fixing this issue, the debugger now correctly prints: (gdb) p foo.three_ptr.all $1 = (1, 2, 3) gdb/ChangeLog: * ada-valprint.c (ada_value_print): Use VAL's enclosing type instead of VAL's type. gdb/testsuite/ChangeLog: * gdb.dwarf2/dynarr-ptr.c: New file. * gdb.dwarf2/dynarr-ptr.exp: New file.
2014-08-29 17:50:13 +02:00
2014-09-10 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_value_print): Use VAL's enclosing type
instead of VAL's type.
2014-09-10 Joel Brobecker <brobecker@adacore.com>
* amd64-linux-nat.c: Add <sys/uio.h> #include.
2014-09-09 Doug Evans <xdje42@gmail.com>
PR guile/17367
* acinclude.m4 (GDB_GUILE_PROGRAM_NAMES): Pass guile version as
last parameter to pkg-config, not first.
* configure.ac: Pass --with-guile provided pkg-config path to
GDB_GUILE_PROGRAM_NAMES.
* configure: Regenerate.
2014-09-09 Gabriel Krisman Bertazi <gabriel@krisman.be>
* MAINTAINERS (Write After Approval): Add "Gabriel Krisman
Bertazi".
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
* mips-irix-tdep.c (mips_irix_elf_osabi_sniff_abi_tag_sections):
Exclude `.MIPS.abiflags', `.MIPS.options' and `.MIPS.stubs' from
the list of sections determining GDB_OSABI_IRIX.
2014-09-09 James Hogan <james.hogan@imgtec.com>
* MAINTAINERS (Write After Approval): Add "James Hogan".
2014-09-09 James Hogan <james.hogan@imgtec.com>
* trad-frame.h (trad_frame_set_reg_unknown): Remove declaration.
2014-09-09 Joel Brobecker <brobecker@adacore.com>
* i386-linux-nat.c, x86-linux-nat.c: Add <sys/uio.h> #include.
2014-09-08 Doug Evans <xdje42@gmail.com>
PR 17247
* guile.c: #include <signal.h>.
(_initialize_guile): Block SIGCHLD while initializing Guile.
Replaces the following, which is reverted.
2014-07-26 Doug Evans <xdje42@gmail.com>
PR 17185
* configure.ac: Add check for header gc/gc.h.
Add check for function setenv.
* configure: Regenerate.
* config.in: Regenerate.
* guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.
2014-09-08 Doug Evans <xdje42@gmail.com>
* guile/scm-cmd.c (gdbscm_parse_command_name): Replace magic number
with named constant. Fix style of pointer comparison.
* python/py-cmd.c (gdbpy_parse_command_name): Ditto.
2014-09-07 Gabriel Krisman Bertazi <gabriel@krisman.be>
PR gdb/17035
* cli/cli-cmds.c (show_user): Use cli_user_command_p to
decide whether we display the command on "show user".
* cli/cli-script.c (show_user_1): Only verify cmdlines after
printing command name.
* cli/cli-decode.h (cli_user_command_p): Declare new function.
* cli/cli-decode.c (cli_user_command_p): Create helper function
to verify whether cmd_list_element is a user-defined command.
2014-09-07 Jan Kratochvil <jan.kratochvil@redhat.com>
PR python/17355
* python/py-framefilter.c (py_print_single_arg): Handle NULL FA->VAL.
Fix goto out of TRY_CATCH.
2014-09-06 Doug Evans <xdje42@gmail.com>
Tom Tromey <tromey@redhat.com>
PR 15276
* NEWS: Mention $_caller_is, $_caller_matches, $_any_caller_is,
$_any_caller_matches.
* data-directory/Makefile.in (PYTHON_FILE_LIST): Add caller_is.py.
* python/lib/gdb/function/caller_is.py: New file.
2014-09-06 Doug Evans <xdje42@gmail.com>
* infcmd.c (program_info): Fix typo.
2014-09-05 Sergio Durigan Junior <sergiodj@redhat.com>
PR gdb/17235
* stap-probe.c (stap_parse_single_operand): Delete unused variable
'number'. New variable 'has_digit'. Rewrite code to deal with
subexpressions on SDT probes.
2014-09-04 Pedro Alves <palves@redhat.com>
* c-exp.y (parse_number): Skip handling base-switching prefixes if
the input is only one character long.
2014-09-04 Sergio Durigan Junior <sergiodj@redhat.com>
PR fortran/17237
* f-valprint.c (f_val_print): Specify the correct print option to
use when printing integer values.
2014-09-04 Gary Benson <gbenson@redhat.com>
* x86-linux-nat.c (x86_linux_dr_get, x86_linux_dr_set):
Remove code to cope with LWPs wrapped as PIDs.
Add assertions to ensure no wrapped LWPs are passed.
Regression for i686 gdb.dwarf2/pieces-optimized-out.exp Git 9a0dc9e3 regressed gdb.dwarf2/pieces-optimized-out.exp, visible on i686 (the test doesn't run on x86_64): (gdb) p s -$1 = {a = 5, b = <optimized out>, c = <optimized out>, d = <optimized out>} +$1 = {a = 5, b = <optimized out>, c = 0, d = 0} -(gdb) PASS: gdb.dwarf2/pieces-optimized-out.exp: print s +(gdb) FAIL: gdb.dwarf2/pieces-optimized-out.exp: print s The regression was caused by this removal in cp-valprint.c: @@ -293,12 +293,6 @@ cp_print_value_fields (struct type *type, struct type *real_type, { fputs_filtered (_("<synthetic pointer>"), stream); } - else if (!value_bits_valid (val, - TYPE_FIELD_BITPOS (type, i), - TYPE_FIELD_BITSIZE (type, i))) - { - val_print_optimized_out (val, stream); - } else { struct value_print_options opts = *options; The idea was that we'd just fallback to calling value_field_bitfield, which handles unavailable values (in unpack_value_bits_as_long_1) so should be able to handle optimized out values too. Alas, it doesn't. This is currently a bit too messy. Instead of teaching unpack_value_bits_as_long_1 about optimized out bits, let's bite the bullet and teach the value code to handle partially optimized out bitfield, by having it unpack a bitfield and then propagate the range metadata. Turns out the resulting code looks simpler and clearer. Tested on x86_64 Fedora 20, -m64/-m32. gdb/ChangeLog: * value.c (value_ranges_copy_adjusted): New function, factored out from ... (value_contents_copy_raw): ... here. (unpack_value_bits_as_long_1): Rename back to ... (unpack_bits_as_long): ... this. Remove 'original_value' and 'result' parameters. Change return type to LONGEST. (unpack_value_bits_as_long): Delete. (unpack_value_field_as_long_1): Delete. (unpack_value_field_as_long, unpack_field_as_long): Reimplement. (unpack_value_bitfield): New function. (value_field_bitfield): Reimplement using unpack_value_bitfield. (value_fetch_lazy): Use unpack_value_bitfield. * value.h (unpack_value_bits_as_long): Delete declaration.
2014-09-04 13:12:41 +02:00
2014-09-04 Pedro Alves <palves@redhat.com>
* value.c (value_ranges_copy_adjusted): New function, factored out
from ...
(value_contents_copy_raw): ... here.
(unpack_value_bits_as_long_1): Rename back to ...
(unpack_bits_as_long): ... this. Remove 'original_value' and
'result' parameters. Change return type to LONGEST.
(unpack_value_bits_as_long): Delete.
(unpack_value_field_as_long_1): Delete.
(unpack_value_field_as_long, unpack_field_as_long): Reimplement.
(unpack_value_bitfield): New function.
(value_field_bitfield): Reimplement using unpack_value_bitfield.
(value_fetch_lazy): Use unpack_value_bitfield.
* value.h (unpack_value_bits_as_long): Delete declaration.
2014-09-03 Sasha Smundak <asmundak@google.com>
* python/py-frame.c (frapy_read_register): New function.
2014-09-03 James Hogan <james.hogan@imgtec.com>
* mips-linux-nat.c (mips_linux_read_description): Reset errno to 0
prior to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
PR python/16699: GDB Python command completion with overriden complete vs. completer class This PR came from a Red Hat bug that was filed recently. I checked and it still exists on HEAD, so here's a proposed fix. Although this is marked as a Python backend bug, this is really about the completion mechanism used by GDB. Since this code reminds me of my first attempt to make a good noodle, it took me quite some time to fix it in a non-intrusive way. The problem is triggered when one registers a completion method inside a class in a Python script, rather than registering the command using a completer class directly. For example, consider the following script: class MyFirstCommand(gdb.Command): def __init__(self): gdb.Command.__init__(self,'myfirstcommand',gdb.COMMAND_USER,gdb.COMPLETE_FILENAME) def invoke(self,argument,from_tty): raise gdb.GdbError('not implemented') class MySecondCommand(gdb.Command): def __init__(self): gdb.Command.__init__(self,'mysecondcommand',gdb.COMMAND_USER) def invoke(self,argument,from_tty): raise gdb.GdbError('not implemented') def complete(self,text,word): return gdb.COMPLETE_FILENAME MyFirstCommand () MySecondCommand () When one loads this into GDB and tries to complete filenames for both myfirstcommand and mysecondcommand, she gets: (gdb) myfirstcommand /hom<TAB> (gdb) myfirstcommand /home/ ^ ... (gdb) mysecondcommand /hom<TAB> (gdb) mysecondcommand /home ^ (The "^" marks the final position of the cursor after the TAB). So we see that myfirstcommand honors the COMPLETE_FILENAME class (as specified in the command creation), but mysecondcommand does not. After some investigation, I found that the problem lies with the set of word break characters that is used for each case. The set should be the same for both commands, but it is not. During the process of deciding which type of completion should be used, the code in gdb/completer.c:complete_line_internal analyses the command that requested the completion and tries to determine the type of completion wanted by checking which completion function will be called (e.g., filename_completer for filenames, location_completer for locations, etc.). This all works fine for myfirstcommand, because immediately after the command registration the Python backend already sets its completion function to filename_completer (which then causes the complete_line_internal function to choose the right set of word break chars). However, for mysecondcommand, this decision is postponed to when the completer function is evaluated, and the Python backend uses an internal completer (called cmdpy_completer). complete_line_internal doesn't know about this internal completer, and can't choose the right set of word break chars in time, which then leads to a bad decision when completing the "/hom" word. So, after a few attempts, I decided to create another callback in "struct cmd_list_element" that will be responsible for handling the case when there is an unknown completer function for complete_line_internal to work with. So far, only the Python backend uses this callback, and only when the user provides a completer method instead of registering the command directly with a completer class. I think this is the best option because it not very intrusive (all the other commands will still work normally), but especially because the whole completion code is so messy that it would be hard to fix this without having to redesign things. I have regtested this on Fedora 18 x86_64, without regressions. I also included a testcase. gdb/ChangeLog: 2014-09-03 Sergio Durigan Junior <sergiodj@redhat.com> PR python/16699 * cli/cli-decode.c (set_cmd_completer_handle_brkchars): New function. (add_cmd): Set "completer_handle_brkchars" to NULL. * cli/cli-decode.h (struct cmd_list_element) <completer_handle_brkchars>: New field. * command.h (completer_ftype_void): New typedef. (set_cmd_completer_handle_brkchars): New prototype. * completer.c (set_gdb_completion_word_break_characters): New function. (complete_line_internal): Call "completer_handle_brkchars" callback from command. * completer.h: Include "command.h". (set_gdb_completion_word_break_characters): New prototype. * python/py-cmd.c (cmdpy_completer_helper): New function. (cmdpy_completer_handle_brkchars): New function. (cmdpy_completer): Adjust to use cmdpy_completer_helper. (cmdpy_init): Set completer_handle_brkchars to cmdpy_completer_handle_brkchars. gdb/testsuite/ChangeLog: 2014-09-03 Sergio Durigan Junior <sergiodj@redhat.com> PR python/16699 * gdb.python/py-completion.exp: New file. * gdb.python/py-completion.py: Likewise.
2014-09-03 22:30:28 +02:00
2014-09-03 Sergio Durigan Junior <sergiodj@redhat.com>
PR python/16699
* cli/cli-decode.c (set_cmd_completer_handle_brkchars): New
function.
(add_cmd): Set "completer_handle_brkchars" to NULL.
* cli/cli-decode.h (struct cmd_list_element)
<completer_handle_brkchars>: New field.
* command.h (completer_ftype_void): New typedef.
(set_cmd_completer_handle_brkchars): New prototype.
* completer.c (set_gdb_completion_word_break_characters): New
function.
(complete_line_internal): Call "completer_handle_brkchars"
callback from command.
* completer.h: Include "command.h".
(set_gdb_completion_word_break_characters): New prototype.
* python/py-cmd.c (cmdpy_completer_helper): New function.
(cmdpy_completer_handle_brkchars): New function.
(cmdpy_completer): Adjust to use cmdpy_completer_helper.
(cmdpy_init): Set completer_handle_brkchars to
cmdpy_completer_handle_brkchars.
2014-09-03 Gary Benson <gbenson@redhat.com>
* nat/x86-dregs.h (ALL_DEBUG_REGISTERS): Renamed as...
(ALL_DEBUG_ADDRESS_REGISTERS): New macro. All uses updated.
Loop conditions changed to equivalent form.
(struct x86_debug_reg_state): Updated dr_ref_count comment.
* x86-linux-nat.c (x86_linux_prepare_to_resume): Use
ALL_DEBUG_ADDRESS_REGISTERS.
2014-09-03 Joel Brobecker <brobecker@adacore.com>
* dwarf2loc.h (dwarf2_evaluate_property): Minor function
description fix.
2014-09-02 Doug Evans <dje@google.com>
* typeprint.c (find_global_typedef): Fix comment.
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-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.
2014-09-01 Maciej W. Rozycki <macro@codesourcery.com>
* varobj.c (_initialize_varobj): Move to the end of file.
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>
* 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.
2014-08-29 Gary Benson <gbenson@redhat.com>
* common/gdb_setjmp.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add common/gdb_setjmp.h.
* configure.ac: Move sigsetjmp check...
* common/common.m4: ...here.
* configure: Regenerate.
* cp-support.c (SIGJMP_BUF): Delete.
(SIGSETJMP): Likewise.
(SIGLONGJMP): Likewise.
* exceptions.h (gdb_setjmp.h): Include.
(setjmp.h): Do not include.
(EXCEPTIONS_SIGJMP_BUF): Delete.
(EXCEPTIONS_SIGSETJMP): Likewise.
(EXCEPTIONS_SIGLONGJMP): Likewise.
Replace all uses of EXCEPTIONS_SIG* macros with SIG* macros
from gdb_setjmp.h.
* exceptions.c: Likewise.
2014-08-29 Gary Benson <gbenson@redhat.com>
* cleanups.h: Moved to...
* common/cleanups.h: New file.
* cleanups.c: Moved to...
* common/cleanups.c: New file. Include common-defs.h and
cleanups.h. Do not include defs.h.
* Makefile.in (SFILES): Replace cleanups.c with common/cleanups.c.
(HFILES_NO_SRCDIR): Replace cleanups.h with common/cleanups.h.
(cleanups.o): New rule.
2014-08-29 Gary Benson <gbenson@redhat.com>
* common/errors.h (internal_warning): New declaration.
(internal_vwarning): Likewise.
* common/errors.c (internal_warning): New function.
* utils.h (internal_warning): Don't declare.
(internal_vwarning): Likewise.
* utils.c (internal_warning): Removed.
2014-08-29 Gary Benson <gbenson@redhat.com>
* main.c (captured_main): Use warning during startup.
Prefix startup warning messages with command name.
2014-08-29 Gary Benson <gbenson@redhat.com>
* main.c (captured_main): Handle usage errors with error.
2014-08-29 Gary Benson <gbenson@redhat.com>
* go32-nat.c (go32_create_inferior): Replace a fprintf/
exit pair with a call to error. Wrap the message with _().
2014-08-29 Gary Benson <gbenson@redhat.com>
* main.c (captured_main): Replace a fprintf/exit
pair with a call to error. Wrap the message with _().
2014-08-29 Gary Benson <gbenson@redhat.com>
* tui/tui-io.c (tui_initialize_io): Replace two fprintf/exit
pairs with calls to error. Wrap the message with _().
2014-08-29 Gary Benson <gbenson@redhat.com>
* utils.c (vwarning): Protect calls to target_terminal_ours
and wrap_here.
2014-08-29 Gary Benson <gbenson@redhat.com>
* exceptions.c (print_flush): Protect calls to
target_terminal_ours and wrap_here.
2014-08-29 Gary Benson <gbenson@redhat.com>
* utils.h (filtered_printing_initialized): New declaration.
* utils.c (abort_with_message): New function.
(internal_vproblem): Use abort_with_message for first level
recursive internal problems, and if gdb_stderr is not set up.
Protect calls to target_terminal_ours, begin_line and query.
2014-08-28 Doug Evans <dje@google.com>
* symtab.c (in_prologue): Move definition to better spot.
(skip_prologue_using_sal): Ditto.
2014-08-28 Doug Evans <dje@google.com>
* symtab.c (find_function_start_sal): Move definition to better spot.
arm software watchpoint: return to epilogue Hi, This patch is to handle a software watchpoint case that program returns to caller's epilogue, and it causes the fail in thumb mode, finish^M Run till exit from #0 func () at gdb/testsuite/gdb.base/watchpoint-cond-gone.c:26^M 0x000001f6 in jumper ()^M (gdb) FAIL: gdb.base/watchpoint-cond-gone.exp: Catch the no longer valid watchpoint In the test, jumper calls func, and programs returns from func to jumper's epilogue, IOW, the branch instruction is the last instruction of jumper's function body. jumper: ..... 0x000001f2 <+10>: bl 0x200 [1] <---- indirect call to func 0x000001f6 <+14>: mov sp, r7 [2] <---- start of the epilogue 0x000001f8 <+16>: add sp, #8 0x000001fa <+18>: pop {r7} 0x000001fc <+20>: pop {r0} 0x000001fe <+22>: bx r0 When the inferior returns from func back to jumper, it is expected that an expression of a software watchpoint becomes out-of-scope. GDB validates the expression by checking the corresponding frame, but this check is guarded by gdbarch_in_function_epilogue_p. See breakpoint.c:watchpoint_check. It doesn't work in this case, because program returns from func's epilogue back to jumper's epilogue [2], GDB thinks the program is still within the epilogue, but in fact it goes to a different one. When PC points at [2], the sp-restore instruction is to be executed, so the stack frame isn't destroyed yet and we can still use the frame mechanism reliably. Note that when PC points to the first instruction of restoring SP, it is part of epilogue, but we still return zero. When goes to the next instruction, the backward scan will still match the epilogue sequence correctly. The reason for doing this is to handle the "return-to-epilogue" case. What this patch does is to restrict the epilogue matching that let GDB think the first SP restore instruction isn't part of the epilogue, and fall back to use frame mechanism. We set 'found_stack_adjust' zero before backward scan, and we've done this for arm mode counterpart (arm_in_function_epilogue_p) too. The patch is tested in arm-none-eabi and arm-none-linux-gnueabi with various multilibs. OK to apply? gdb: 2014-08-28 Yao Qi <yao@codesourcery.com> * arm-tdep.c (thumb_in_function_epilogue_p): Don't set found_stack_adjust in forward scan. Remove condition check on found_stack_adjust which is always true. Indent the code.
2014-08-01 05:26:16 +02:00
2014-08-28 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (thumb_in_function_epilogue_p): Don't set
found_stack_adjust in forward scan. Remove condition check
on found_stack_adjust which is always true. Indent the code.
2014-08-28 Yao Qi <yao@codesourcery.com>
* dwarf2read.c (dwarf_decode_lines): Update declaration.
(handle_DW_AT_stmt_list): Remove comment about WANT_LINE_INFO.
(dwarf_decode_lines): Remove argument
want_line_info. Remove condition check on want_line_info.
Callers update.
2014-08-27 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf_record_line): Fix typo.
2014-08-27 19:01:01 +02:00
2014-08-27 Patrick Palka <patrick@parcs.ath.cx>
* target.h (struct target_ops::to_terminal_save_ours): Remove
declaration.
(target_terminal_save_ours): Remove macro.
* target-delegates.c: Regenerate.
* inf-child.c (inf_child_target): Don't set the nonexistent
field to_terminal_save_ours.
* inferior.h (child_terminal_save_ours): Remove declaration.
* terminal.h (gdb_save_tty_state): New declaration.
* inflow.c (child_terminal_save_ours): Rename to ...
(gdb_save_tty_state): ... this.
* tui/tui.c: Include terminal.h.
(tui_enable): Use gdb_save_tty_state instead of
target_terminal_save_ours.
(tui_disable): Likewise.
2014-08-25 Doug Evans <dje@google.com>
* linux-nat.c (linux_nat_close): Don't pass NULL for "this".
Pass NULL instead of 0 for context pointer.
2014-08-25 Yao Qi <yao@codesourcery.com>
* dwarf2read.c: Fix grammatical error.
2014-08-24 Yao Qi <yao@codesourcery.com>
* dwarf2read.c (scan_partial_symbols): Update comments.
Rename argument 'need_pc' with 'set_addrmap'.
add_partial_namespace): Rename argument 'need_pc' with
'set_addrmap'.
(add_partial_module): Likewise.
(add_partial_subprogram): Likewise. Update comments.
(dwarf2_name): Fix typo.
2014-08-22 Doug Evans <dje@google.com>
PR 17276
* dwarf2read.c (dwarf_record_line_p): New function.
(dwarf_decode_lines_1): Ignore subsequent line number entries
for the same line if any entry had a non-zero discriminator.
2014-08-22 Doug Evans <dje@google.com>
* buildsym.h (record_line_ftype): New typedef.
(record_line): Use it.
* dwarf2read.c (dwarf_record_line, dwarf_finish_line): New functions.
(dwarf_decode_lines_1): Call them.
Remove workaround to libbabeltrace 1.1.0 issue When GDB uses recent version of babeltrace, such as 1.2.x, we'll see such error emitted from babeltrace library, (gdb) target ctf .../gdb/testsuite/gdb.trace/actions.ctf [error] Invalid CTF stream: content size is smaller than packet headers. [error] Stream index creation error. [error] Open file stream error. The problem can be reproduce out of GDB too, using babeltrace, $ babeltrace ./fake-packet.ctf/ [error] Invalid CTF stream: content size is smaller than packet headers. [error] Stream index creation error. [error] Open file stream error. Recent babeltrace library becomes more strict on CTF, and complains about one "faked packet" GDB adds, when saving trace data in ctf format from GDB. babeltrace 1.1.0 has a bug that it can't read trace data smaller than a certain size (see https://bugs.lttng.org/issues/450). We workaround it in GDB to append some meaningless data in a faked packet to make sure trace file is large enough (see ctf.c:ctf_end). The babeltrace issue was fixed in 1.1.1 release. However, babeltrace recent release (since 1.1.2) starts to complain about such faked packet. Here is a table shows that whether faked packet or no faked packet is "supported" by various babeltrace releases, faked packet no faked packet 1.1.0 Yes No 1.1.1 Yes Yes 1.1.2 No Yes 1.2.0 No Yes We decide to get rid of this workaround in GDB, and people can build GDB with libbabeltrace >= 1.1.1. In this way, both configure and ctf.c is simpler. Run gdb.trace/* tests in the following combinations: wo/ this pattch 1.1.0 w/ this patch 1.1.1 w/ this patch 1.1.2 w/ this patch 1.2.0 No test results change. gdb: 2014-08-22 Yao Qi <yao@codesourcery.com> * ctf.c (CTF_FILE_MIN_SIZE): Remove. (ctf_end): Remove code.
2014-08-21 04:48:33 +02:00
2014-08-22 Yao Qi <yao@codesourcery.com>
* ctf.c (CTF_FILE_MIN_SIZE): Remove.
(ctf_end): Remove code.
2014-08-21 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-tdep.c (linux_corefile_thread_callback): Ignore THREAD_EXITED.
(linux_make_corefile_notes): call update_thread_list, protected against
exceptions.
infcmd.c: Remove stale TODO This TODO has been stale for over 2 years. In bd5635a1 (1991), we already see the comment, when we only had a bare attach_command: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* * TODO: * Should save/restore the tty state since it might be that the * program to be debugged was started on this tty and it wants * the tty in some state other than what we want. If it's running * on another terminal or without a terminal, then saving and * restoring the tty state is a harmless no-op. * This only needs to be done if we are attaching to a process. */ /* * attach_command -- * takes a program started up outside of gdb and ``attaches'' to it. * This stops it cold in its tracks and allows us to start tracing it. * For this to work, we must be able to send the process a * signal and we must have the same effective uid as the program. */ void attach_command (args, from_tty) char *args; int from_tty; { target_attach (args, from_tty); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Later in b5a3d2aa (1992) target_terminal_init, etc. calls are added to attach_command, and in 7e97eb28 (1992) we see: + /* If we attached to the process, we might or might not be sharing + a terminal. Avoid printing error msg if we are unable to set our + terminal's process group to his process group ID. */ + if (!attach_flag) { + OOPSY ("ioctl TIOCSPGRP"); Clearly the TODO has been stale for a long while. I considered preserving the text elsewhere, but then thought the comments in inflow.c already have all the necessary info. gdb/ChangeLog: * infcmd.c (attach_command): Remove comment.
2014-08-21 18:09:24 +02:00
2014-08-21 Pedro Alves <palves@redhat.com>
* infcmd.c (attach_command): Remove comment.
2014-08-21 Bin Cheng <bin.cheng@arm.com>
* aarch64-linux-nat.c (dr_changed_t): Change the type from
unsigned LONGEST to ULONGEST.
2014-08-20 Pedro Alves <palves@redhat.com>
* Makefile.in (check-read1): New rule.
2014-08-20 Joel Brobecker <brobecker@adacore.com>
* value.c (value_from_contents_and_address): Strip resolved_type's
typedef layers before checking its TYPE_DATA_LOCATION.
2014-08-20 Pedro Alves <palves@redhat.com>
* value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall.
2014-08-20 Yao Qi <yao@codesourcery.com>
* amd64-tdep.c (amd64_classify): Add a blank line after the
example. Move "*/" to a new line.
* arm-tdep.c (arm_vfp_cprc_sub_candidate): Likewise.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Likewise.
* dwarf2read.c (psymtab_include_file_name): Likewise.
Handle partially optimized out values similarly to unavailable values This fixes PR symtab/14604, PR symtab/14605, and Jan's test at https://sourceware.org/ml/gdb-patches/2014-07/msg00158.html, in a tree with bddbbed reverted: 2014-07-22 Pedro Alves <palves@redhat.com> * value.c (allocate_optimized_out_value): Don't mark value as non-lazy. The PRs are about variables described by the DWARF as being split over multiple registers using DWARF piece information, but some of those registers being marked as optimised out (not saved) by a later frame. GDB currently incorrectly mishandles these partially-optimized-out values. Even though we can usually tell from the debug info whether a local or global is optimized out, handling the case of a local living in a register that was not saved in a frame requires fetching the variable. GDB also needs to fetch a value to tell whether parts of it are "<unavailable>". Given this, it's not worth it to try to avoid fetching lazy optimized-out values based on debug info alone. So this patch makes GDB track which chunks of a value's contents are optimized out like it tracks <unavailable> contents. That is, it makes value->optimized_out be a bit range vector instead of a boolean, and removes the struct lval_funcs check_validity and check_any_valid hooks. Unlike Andrew's series which this is based on (at https://sourceware.org/ml/gdb-patches/2013-08/msg00300.html, note some pieces have gone in since), this doesn't merge optimized out and unavailable contents validity/availability behind a single interface, nor does it merge the bit range vectors themselves (at least yet). While it may be desirable to have a single entry point that returns existence of contents irrespective of what may make them invalid/unavailable, several places want to treat optimized out / unavailable / etc. differently, so each spot that potentially could use it will need to be careful considered on case-by-case basis, and best done as a separate change. This fixes Jan's test, because value_available_contents_eq wasn't considering optimized out value contents. It does now, and because of that it's been renamed to value_contents_eq. A new intro comment is added to value.h describing "<optimized out>", "<not saved>" and "<unavailable>" values. gdb/ PR symtab/14604 PR symtab/14605 * ada-lang.c (coerce_unspec_val_to_type): Use value_contents_copy_raw. * ada-valprint.c (val_print_packed_array_elements): Adjust. * c-valprint.c (c_val_print): Use value_bits_any_optimized_out. * cp-valprint.c (cp_print_value_fields): Let the common printing code handle optimized out values. (cp_print_value_fields_rtti): Use value_bits_any_optimized_out. * d-valprint.c (dynamic_array_type): Use value_bits_any_optimized_out. * dwarf2loc.c (entry_data_value_funcs): Remove check_validity and check_any_valid fields. (check_pieced_value_bits): Delete and inline ... (check_pieced_synthetic_pointer): ... here. (check_pieced_value_validity): Delete. (check_pieced_value_invalid): Delete. (pieced_value_funcs): Remove check_validity and check_any_valid fields. (read_pieced_value): Use mark_value_bits_optimized_out. (write_pieced_value): Switch to use mark_value_bytes_optimized_out. (dwarf2_evaluate_loc_desc_full): Copy the value contents instead of assuming the whole value is optimized out. * findvar.c (read_frame_register_value): Remove special handling of optimized out registers. (value_from_register): Use mark_value_bytes_optimized_out. * frame-unwind.c (frame_unwind_got_optimized): Use mark_value_bytes_optimized_out. * jv-valprint.c (java_value_print): Adjust. (java_print_value_fields): Let the common printing code handle optimized out values. * mips-tdep.c (mips_print_register): Remove special handling of optimized out registers. * opencl-lang.c (lval_func_check_validity): Delete. (lval_func_check_any_valid): Delete. (opencl_value_funcs): Remove check_validity and check_any_valid fields. * p-valprint.c (pascal_object_print_value_fields): Let the common printing code handle optimized out values. * stack.c (read_frame_arg): Remove special handling of optimized out values. Fetch both VAL and ENTRYVAL before comparing contents. Adjust to value_available_contents_eq rename. * valprint.c (valprint_check_validity) (val_print_scalar_formatted): Use value_bits_any_optimized_out. (val_print_array_elements): Adjust. * value.c (struct value) <optimized_out>: Now a VEC(range_s). (value_bits_any_optimized_out): New function. (value_entirely_covered_by_range_vector): New function, factored out from value_entirely_unavailable. (value_entirely_unavailable): Reimplement. (value_entirely_optimized_out): New function. (insert_into_bit_range_vector): New function, factored out from mark_value_bits_unavailable. (mark_value_bits_unavailable): Reimplement. (struct ranges_and_idx): New struct. (find_first_range_overlap_and_match): New function, factored out from value_available_contents_bits_eq. (value_available_contents_bits_eq): Rename to ... (value_contents_bits_eq): ... this. Check both unavailable contents and optimized out contents. (value_available_contents_eq): Rename to ... (value_contents_eq): ... this. (allocate_value_lazy): Remove reference to the old optimized_out boolean. (allocate_optimized_out_value): Use mark_value_bytes_optimized_out. (require_not_optimized_out): Adjust to check whether the optimized_out vec is empty. (ranges_copy_adjusted): New function, factored out from value_contents_copy_raw. (value_contents_copy_raw): Also copy the optimized out ranges. Assert the destination ranges aren't optimized out. (value_contents_copy): Update comment, remove call to require_not_optimized_out. (value_contents_equal): Adjust to check whether the optimized_out vec is empty. (set_value_optimized_out, value_optimized_out_const): Delete. (mark_value_bytes_optimized_out, mark_value_bits_optimized_out): New functions. (value_entirely_optimized_out, value_bits_valid): Delete. (value_copy): Take a VEC copy of the 'optimized_out' field. (value_primitive_field): Remove special handling of optimized out. (value_fetch_lazy): Assert that lazy values have no unavailable regions. Use value_bits_any_optimized_out. Remove some special handling for optimized out values. * value.h: Add intro comment about <optimized out> and <unavailable>. (struct lval_funcs): Remove check_validity and check_any_valid fields. (set_value_optimized_out, value_optimized_out_const): Remove. (mark_value_bytes_optimized_out, mark_value_bits_optimized_out): New declarations. (value_bits_any_optimized_out): New declaration. (value_bits_valid): Delete declaration. (value_available_contents_eq): Rename to ... (value_contents_eq): ... this, and extend comments. gdb/testsuite/ PR symtab/14604 PR symtab/14605 * gdb.dwarf2/dw2-op-out-param.exp: Remove kfail branches and use gdb_test.
2014-08-20 01:07:40 +02:00
2014-08-19 Andrew Burgess <aburgess@broadcom.com>
Pedro Alves <palves@redhat.com>
PR symtab/14604
PR symtab/14605
* ada-lang.c (coerce_unspec_val_to_type): Use
value_contents_copy_raw.
* ada-valprint.c (val_print_packed_array_elements): Adjust.
* c-valprint.c (c_val_print): Use value_bits_any_optimized_out.
* cp-valprint.c (cp_print_value_fields): Let the common printing
code handle optimized out values.
(cp_print_value_fields_rtti): Use value_bits_any_optimized_out.
* d-valprint.c (dynamic_array_type): Use
value_bits_any_optimized_out.
* dwarf2loc.c (entry_data_value_funcs): Remove check_validity and
check_any_valid fields.
(check_pieced_value_bits): Delete and inline ...
(check_pieced_synthetic_pointer): ... here.
(check_pieced_value_validity): Delete.
(check_pieced_value_invalid): Delete.
(pieced_value_funcs): Remove check_validity and check_any_valid
fields.
(read_pieced_value): Use mark_value_bits_optimized_out.
(write_pieced_value): Switch to use
mark_value_bytes_optimized_out.
(dwarf2_evaluate_loc_desc_full): Copy the value contents instead
of assuming the whole value is optimized out.
* findvar.c (read_frame_register_value): Remove special handling
of optimized out registers.
(value_from_register): Use mark_value_bytes_optimized_out.
* frame-unwind.c (frame_unwind_got_optimized): Use
mark_value_bytes_optimized_out.
* jv-valprint.c (java_value_print): Adjust.
(java_print_value_fields): Let the common printing code handle
optimized out values.
* mips-tdep.c (mips_print_register): Remove special handling of
optimized out registers.
* opencl-lang.c (lval_func_check_validity): Delete.
(lval_func_check_any_valid): Delete.
(opencl_value_funcs): Remove check_validity and check_any_valid
fields.
* p-valprint.c (pascal_object_print_value_fields): Let the common
printing code handle optimized out values.
* stack.c (read_frame_arg): Remove special handling of optimized
out values. Fetch both VAL and ENTRYVAL before comparing
contents. Adjust to value_available_contents_eq rename.
* valprint.c (valprint_check_validity)
(val_print_scalar_formatted): Use value_bits_any_optimized_out.
(val_print_array_elements): Adjust.
* value.c (struct value) <optimized_out>: Now a VEC(range_s).
(value_bits_any_optimized_out): New function.
(value_entirely_covered_by_range_vector): New function, factored
out from value_entirely_unavailable.
(value_entirely_unavailable): Reimplement.
(value_entirely_optimized_out): New function.
(insert_into_bit_range_vector): New function, factored out from
mark_value_bits_unavailable.
(mark_value_bits_unavailable): Reimplement.
(struct ranges_and_idx): New struct.
(find_first_range_overlap_and_match): New function, factored out
from value_available_contents_bits_eq.
(value_available_contents_bits_eq): Rename to ...
(value_contents_bits_eq): ... this. Check both unavailable
contents and optimized out contents.
(value_available_contents_eq): Rename to ...
(value_contents_eq): ... this.
(allocate_value_lazy): Remove reference to the old optimized_out
boolean.
(allocate_optimized_out_value): Use
mark_value_bytes_optimized_out.
(require_not_optimized_out): Adjust to check whether the
optimized_out vec is empty.
(ranges_copy_adjusted): New function, factored out from
value_contents_copy_raw.
(value_contents_copy_raw): Also copy the optimized out ranges.
Assert the destination ranges aren't optimized out.
(value_contents_copy): Update comment, remove call to
require_not_optimized_out.
(value_contents_equal): Adjust to check whether the optimized_out
vec is empty.
(set_value_optimized_out, value_optimized_out_const): Delete.
(mark_value_bytes_optimized_out, mark_value_bits_optimized_out):
New functions.
(value_entirely_optimized_out, value_bits_valid): Delete.
(value_copy): Take a VEC copy of the 'optimized_out' field.
(value_primitive_field): Remove special handling of optimized out.
(value_fetch_lazy): Assert that lazy values have no unavailable
regions. Use value_bits_any_optimized_out. Remove some special
handling for optimized out values.
* value.h: Add intro comment about <optimized out> and
<unavailable>.
(struct lval_funcs): Remove check_validity and check_any_valid
fields.
(set_value_optimized_out, value_optimized_out_const): Remove.
(mark_value_bytes_optimized_out, mark_value_bits_optimized_out):
New declarations.
(value_bits_any_optimized_out): New declaration.
(value_bits_valid): Delete declaration.
(value_available_contents_eq): Rename to ...
(value_contents_eq): ... this, and extend comments.
2014-08-19 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix -fsanitize=address on unreadable inferior strings.
* valprint.c (val_print_string): Fix access before BUFFER.
2014-08-19 Simon Marchi <simon.marchi@ericsson.com>
* target.c (target_struct_size): Remove.
(target_struct_allocsize): Remove.
(DEFAULT_ALLOCSIZE): Remove.
(target_ops_p): New typedef.
(DEF_VEC_P (target_ops_p)): New vector type.
(target_structs): Change type to VEC (target_ops_p).
(add_target_with_completer): Replace "push" code by VEC_safe_push.
(find_default_run_target): Rewrite for loop following changes to
target_structs.
2014-08-19 Joel Brobecker <brobecker@adacore.com>
* value.c (value_from_pointer): Remove use of resolve_dynamic_type.
Adjust code accordingly. Adjust function description comment.
Support _Complex in hard-VFP abi Hi, When we pass "-mfloat-abi=hard" flag in the GDB testing, we see the following fails, FAIL: gdb.base/callfuncs.exp: p t_float_complex_values(fc1, fc2) FAIL: gdb.base/callfuncs.exp: p t_float_complex_many_args(fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4) FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc1, dc2) FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc1, ldc2) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4) FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns float _Complex FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns double _Complex The hard-VFP ABI was supported by GDB overal, done by this patch https://sourceware.org/ml/gdb-patches/2009-07/msg00686.html but "vectors and complex types are not currently supported", mentioned in the patch. As a result, these tests fail. This patch is to support _Complex types in hard-VFP abi. As specified in "7.1.1, Procedure Call Standard for the ARM Arch", the layout of _Complex types is a struct, which is identical to the layout on amd64, so I copy Mark's comments to amd64 support. Regression tested on arm-none-eabi target. OK to apply? gdb: 2014-08-19 Yao Qi <yao@codesourcery.com> * arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex types.
2014-08-11 13:02:58 +02:00
2014-08-19 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
types.
2014-08-19 Alan Modra <amodra@gmail.com>
* acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl.
* config.in: Regenerate.
* configure: Regenerate.
2014-08-19 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* common/common-debug.h: New file.
* common/common-debug.c: Likewise.
* debug.c: Likewise.
* Makefile.in (SFILES): Add common/common-debug.c.
(HFILES_NO_SRCDIR): Add common/common-debug.h.
(COMMON_OBS): Add common-debug.o and debug.o.
(common-debug.o): New rule.
* common/common-defs.h: Include common-debug.h.
* common/agent.c (debug_agent_printf): New function.
(DEBUG_AGENT): Redefine.
* nat/i386-dregs.c (debug_printf): Undefine.
2014-08-19 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include print-utils.h.
* utils.h: Do not include print-utils.h.
2014-08-19 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* common/common-types.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add common/common-types.h.
* common/common-defs.h: Include common-types.h.
* defs.h (gdb_byte, CORE_ADDR, CORE_ADDR_MAX, LONGEST)
(ULONGEST): Remove.
2014-08-19 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* common/errors.h: New file.
* common/errors.c: Likewise.
* Makefile.in (SFILES): Add common/errors.c.
(HFILES_NO_SRCDIR): Add common/errors.h.
(COMMON_OBS): Add errors.o.
(errors.o): New rule.
* common/common-defs.h: Include errors.h.
* utils.h (perror_with_name, error, verror, warning, vwarning):
Don't declare.
* common/common-utils.h: (malloc_failure, internal_error):
Likewise.
2014-08-19 Gary Benson <gbenson@redhat.com>
* utils.c (internal_vproblem): Always print the message.
2014-08-18 Doug Evans <dje@google.com>
* ada-typeprint.c (print_range): Initialize lo,hi for gcc -Wall.
2014-08-18 Joel Brobecker <brobecker@adacore.com>
* ada-typeprint.c (type_is_full_subrange_of_target_type):
Return 0 if TYPE is dynamic.
(print_range): Add handling of dynamic ranges.
2014-08-18 Keven Boell <keven.boell@intel.com>
Joel Brobecker <brobecker@adacore.com>
* gdbtypes.h (struct main_type): Add field "data_location".
(TYPE_DATA_LOCATION, TYPE_DATA_LOCATION_BATON)
(TYPE_DATA_LOCATION_ADDR, TYPE_DATA_LOCATION_KIND): New macros.
* gdbtypes.c (is_dynamic_type): Return 1 if the type has
a dynamic data location.
(resolve_dynamic_type): Add DW_AT_data_location handling.
(copy_recursive, copy_type): Copy the data_location information
when present.
* dwarf2read.c (set_die_type): Add DW_AT_data_location handling.
* value.c (value_from_contents_and_address): Add
DW_AT_data_location handling.
2014-08-18 Keven Boell <keven.boell@intel.com>
Joel Brobecker <brobecker@adacore.com>
* dwarf2expr.h (struct dwarf_expr_context_funcs): Uncomment
field "get_object_address".
* dwarf2expr.c (execute_stack_op): Add handling for
DW_OP_push_object_address.
* dwarf2loc.h (dwarf2_evaluate_property): Add "address" field.
* dwarf2loc.c (struct dwarf_expr_baton): Add field "obj_address".
(dwarf_expr_push_dwarf_reg_entry_value): Set baton_local.obj_address.
(dwarf_expr_get_obj_addr): New function.
(dwarf_expr_ctx_funcs): Add get_object_address field.
(dwarf2_evaluate_loc_desc_full): Set baton.obj_address.
(dwarf2_locexpr_baton_eval): Add parameter "addr". Use it.
(dwarf2_evaluate_property): Add parameter "address". Use it.
(needs_get_obj_addr): New function.
(needs_frame_ctx_funcs): Add get_object_address field.
(dwarf2_compile_expr_to_ax): Add DW_OP_push_object_address handling.
* gdbtypes.c (resolve_dynamic_range): Add "addr" field. Use it.
(resolve_dynamic_array): Likewise.
2014-08-18 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>:
When noside is EVAL_AVOID_SIDE_EFFECTS, only return a statically
fixed value for records and unions for which some GNAT encodings
are present.
2014-08-18 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Slight code
rewrite to avoid "else if" and "else" constructs. Should be
a no-op in practice.
2014-08-18 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Fix identation
of lexical block.
2014-08-15 Siva Chandra Reddy <sivachandra@google.com>
PR c++/17132
* eval.c: Update all calls to find_overload_match.
* valarith.c: Likewise.
(value_user_defined_cpp_op, value_user_defined_op): New
argument NOSIDE. Update all callers.
* valops.c (find_overload_match): New argument NOSIDE.
* value.h (find_overload_match): Update signature.
2014-08-15 Siva Chandra Reddy <sivachandra@google.com>
* python/lib/gdb/command/xmethods.py (set_xm_status1): Use the
'items' methods instead of 'iteritems' method on dictionaries.
2014-08-15 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf_decode_lines_1): Move definition of adj_opcode
closer to use.
2014-08-15 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf_decode_lines_1): Add comment.
2014-08-15 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf_decode_lines_1): Delete local "column", unused.
2014-08-15 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf_decode_lines_1): Delete local basic_block,
unused.
2014-08-15 Eli Zaretskii <eliz@gnu.org>
* dcache.h: Include target.h, to avoid compile time warnings.
2014-08-15 Joel Brobecker <brobecker@adacore.com>
* gdbarch.sh: #include "frame.h" in gdbarch.h. Delete "struct
frame_info" partial declaration.
* gdbarch.h: Regenerate.
2014-08-15 Yao Qi <yao@codesourcery.com>
* dwarf2read.c (dwarf_decode_lines_1): Remove parameter 'pst'.
Add parameter 'decode_for_pst_p'. Callers update.
2014-08-13 Yao Qi <yao@codesourcery.com>
PR build/17104
* configure.ac: Use local variable 'pos'.
* configure: Regenerated.
2014-08-11 Doug Evans <dje@google.com>
* solib.c (solib_read_symbols): Delete "Loaded symbols for ..."
message, it is redundant with "Reading symbols from ..." message.
2014-08-10 Doug Evans <xdje42@gmail.com>
* linux-nat.c (linux_nat_thread_address_space): Delete dead code.
2014-08-09 Yao Qi <yao@codesourcery.com>
PR remote/9053
* remote.c (remote_xfer_partial): Remove dead code.
2014-07-18 10:14:27 +02:00
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* ia64-linux-tdep.c: Include "regset.h".
(ia64_linux_gregmap, ia64_linux_fpregmap): New register maps.
(IA64_LINUX_GREGS_SIZE, IA64_LINUX_FPREGS_SIZE): New macros.
(ia64_linux_supply_fpregset): New function.
(ia64_linux_gregset, ia64_linux_fpregset): New regsets.
(ia64_linux_regset_from_core_section): New function.
(ia64_linux_init_abi): Set regset_from_core_section gdbarch
method.
2014-07-17 10:35:43 +02:00
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* m68klinux-tdep.c: Include "regset.h".
(m68k_linux_gregmap, m68k_linux_fpregmap): New register maps.
(M68K_LINUX_GREGS_SIZE, M68K_LINUX_FPREGS_SIZE): New macros.
(m68k_linux_gregset, m68k_linux_fpregset): New regsets.
(m68k_linux_regset_from_core_section): New function.
(m68k_linux_init_abi): Set regset_from_core_section gdbarch
method.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* tilegx-linux-tdep.c (tilegx_linux_supply_regset): Delete
function. Move logic to...
(tilegx_linux_regmap): ... this new register map.
(tilegx_linux_regset): Refer to register map, replace supply
method by regcache_supply_regset, and add collect method.
* tilegx-tdep.h (enum tilegx_regnum): New enum value
TILEGX_FIRST_EASY_REGNUM.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* score-tdep.c (score7_linux_supply_gregset): Reduce to small stub
that calls regcache_supply_regset and handles the EPC register
separately. Move main logic to...
(score7_linux_gregmap): ... this new register map.
(SCORE7_LINUX_SIZEOF_GREGSET, SCORE7_LINUX_EPC_OFFSET): New macros.
(score7_linux_gregset): Refer to register map. Add collect method.
(score7_linux_regset_from_core_section): Replace
sizeof elf_gregset_t by SCORE7_LINUX_SIZEOF_GREGSET.
* score-tdep.h (enum gdb_regnum): New enum value SCORE_EPC_REGNUM.
(struct regset): Delete unused forward declaraction.
(struct pt_regs): Delete structure definition.
(elf_gregset_t): Delete typedef.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* nios2-linux-tdep.c (nios2_collect_gregset): New function.
(nios2_core_regset): Add collect method.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* m32r-linux-tdep.c (m32r_linux_supply_gregset): Make
platform-independent and don't write to read-only input buffer.
(m32r_linux_collect_gregset): New function.
(m32r_linux_gregset): Add collect method.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* hppa-linux-tdep.c (greg_map): Rename to...
(hppa_linux_gregmap): ... this. Also convert to
regcache_map_entry format.
(hppa_linux_supply_regset): Delete function.
(hppa_linux_supply_fpregset): Delete function. Move logic to...
(hppa_linux_fpregmap): ... this new register map.
(hppa_linux_regset, hppa_linux_fpregset): Refer to appropriate
register map, replace supply method by regcache_supply_regset, and
add collect method regcache_collect_regset.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* frv-linux-tdep.c (FRV_PT_PSR, FRV_PT_ISR, FRV_PT_CCR)
(FRV_PT_CCCR, FRV_PT_LR, FRV_PT_LCR, FRV_PT_PC, FRV_PT_GNER0)
(FRV_PT_GNER1, FRV_PT_IACC0H, FRV_PT_IACC0L, FRV_PT_GR)
(FRV_PT_TBR, FRV_PT_GR, FRV_PT_EXEC_FDPIC_LOADMAP)
(FRV_PT_INTERP_FDPIC_LOADMAP): Delete macros.
(frv_linux_gregmap, frv_linux_fpregmap): New register maps.
(frv_linux_supply_gregset): Replace main logic by call to
regcache_supply_regset, but keep clearing gr32-gr63.
(frv_linux_supply_fpregset): Delete function.
(frv_linux_gregset): Refer to appropriate register map and add
regcache_collect_regset as the collect method.
(frv_linux_fpregset): Likewise. Also exchange the supply method
by regcache_supply_regset.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* alpha-linux-tdep.c (alpha_linux_supply_gregset): Replace logic
by call to alpha_supply_int_regs.
(alpha_linux_collect_gregset): New function.
(alpha_linux_supply_fpregset): Replace logic by call to
alpha_supply_fp_regs.
(alpha_linux_collect_fpregset): New function.
(alpha_linux_gregset, alpha_linux_fpregset): Add collect method.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* aarch64-linux-nat.c (fill_gregset, fill_fpregset): Replace logic
by call to regcache_collect_regset.
(supply_gregset, supply_fpregset): Call regcache_supply_regset
instead of aarch64_linux_supply_gregset/_fpregset.
* aarch64-linux-tdep.c (AARCH64_LINUX_SIZEOF_GREGSET)
(AARCH64_LINUX_SIZEOF_FPREGSET): Delete macros here, move to
header file instead.
(aarch64_linux_supply_gregset, supply_gregset_from_core)
(aarch64_linux_suply_fpregset, supply_fpregset_from_core): Delete
functions. Move logic to ...
(aarch64_linux_gregmap, aarch64_linux_fpregmap): ... these new
register maps.
(aarch64_linux_gregset, aarch64_linux_fpregset): Make global,
refer to new register maps, replace *_regset_from_core by
regcache_supply_regset, and also use regcache_collect_regset.
* aarch64-linux-tdep.h: Include "regset.h".
(aarch64_linux_supply_gregset, aarch64_linux_supply_fpregset):
Delete prototypes.
(AARCH64_LINUX_SIZEOF_GREGSET, AARCH64_LINUX_SIZEOF_FPREGSET): New
macros, moved from C source file.
(aarch64_linux_gregset, aarch64_linux_fpregset): New global
variable declarations.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* s390-linux-nat.c: Include "regset.h".
(regmap_gregset): Delete macro.
(s390_64_regmap_gregset): New register map for
regcache_supply/_collect_regset.
(s390_64_gregset): New regset.
(S390_PSWM_OFFSET, S390_PSWA_OFFSET): New macros.
(regmap_fpregset): Delete macro.
(s390_native_supply, s390_native_collect): Delete functions.
(supply_gregset, fill_gregset): Replace s390-specific regmap
handling by a call to regcache_supply/_collect_regset.
(supply_fpregset, fill_fpregset): Call regcache_supply/
_collect_regset instead of s390_native_supply/_collect.
(fetch_regset, store_regset): Likewise. Also change the last
parameter to a regset instead of a regmap.
(s390_linux_fetch_inferior_registers)
(390_linux_store_inferior_registers): Adjust last parameter in
calls to fetch_regset and store_regset.
* s390-linux-tdep.c (s390_regmap_gregset): Rename to...
(s390_gregmap): ... this. Also make static const and convert to
regcache_map_entry format.
(s390x_regmap_gregset): Delete.
(s390_regmap_fpregset): Rename to...
(s390_fpregmap): ... this. Make static const and convert to
regcache_map_entry format.
(s390_regmap_upper, s390_regmap_last_break)
(s390x_regmap_last_break, s390_regmap_system_call)
(s390_regmap_tdb): Likewise.
(s390_supply_regset, s390_collect_regset): Remove functions.
(s390_supply_tdb_regset): Call regcache_supply_regset instead of
s390_supply_regset.
(s390_gregset, s390_fpregset, s390_upper_regset)
(s390_last_break_regset, s390x_last_break_regset)
(s390_system_call_regset, s390_tdb_regset): Make global and
replace s390_supply/_collect_regset by regcache_supply/
_collect_regset.
(s390x_gregset): Delete.
(s390_gdbarch_init): Replace s390x_gregset by s390_gregset.
* s390-linux-tdep.h (s390_regmap_gregset, s390x_regmap_gregset)
(s390_regmap_fpregset, s390_regmap_last_break)
(s390x_regmap_last_break, s390_regmap_system_call)
(s390_regmap_tdb): Delete global variable declarations.
(s390_gregset, s390_fpregset, s390_last_break_regset)
(s390x_last_break_regset, s390_system_call_regset)
(s390_tdb_regset): New global variable declarations.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* regcache.c: Include "regset.h".
(regcache_transfer_regset): New local function.
(regcache_supply_regset, regcache_collect_regset): New functions.
* regcache.h (struct regcache_map_entry): New structure.
(REGCACHE_MAP_SKIP): New enum value.
(regcache_supply_regset, regcache_collect_regset): New prototypes.
2014-08-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* regset.h (struct regset): Rename 'descr' field to 'regmap'.
* ppc-linux-tdep.c (ppc_linux_supply_gregset)
(ppc_linux_collect_gregset ): Likewise.
* rs6000-tdep.c (ppc_supply_gregset, ppc_supply_fpregset)
(ppc_supply_vrregset, ppc_collect_gregset, ppc_collect_fpregset)
(ppc_collect_vrregset): Likewise.
* s390-linux-tdep.c (s390_supply_regset, s390_collect_regset):
Likewise.
2014-08-07 Yao Qi <yao@codesourcery.com>
* corelow.c (core_xfer_partial): Replace 0 with TARGET_XFER_EOF.
* remote-m32r-sdi.c (m32r_xfer_memory): Likewise.
* remote.c (remote_read_bytes): Likewise.
2014-08-07 Yao Qi <yao@codesourcery.com>
* dwarf2read.c (struct dwarf2_per_cu_data) <u>: Tweak comments.
2014-08-07 Yao Qi <yao@codesourcery.com>
PR remote/17230
* remote-mips.c (mips_xfer_memory): Set *xfered_len and return
TARGET_XFER_OK instead of 0.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include errno.h.
* defs.h: Do not include errno.h.
* ada-typeprint.c: Likewise.
* c-typeprint.c: Likewise.
* core-regset.c: Likewise.
* corefile.c: Likewise.
* corelow.c: Likewise.
* event-loop.c: Likewise.
* f-typeprint.c: Likewise.
* gnu-nat.c: Likewise.
* go32-nat.c: Likewise.
* i386gnu-nat.c: Likewise.
* m2-typeprint.c: Likewise.
* nat/linux-btrace.c: Likewise.
* p-typeprint.c: Likewise.
* procfs.c: Likewise.
* remote-sim.c: Likewise.
* rs6000-nat.c: Likewise.
* target.c: Likewise.
* typeprint.c: Likewise.
* ui-file.c: Likewise.
* valops.c: Likewise.
* valprint.c: Likewise.
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>
* 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.
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>
* 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.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include common-utils.h.
* defs.h: Do not include common-utils.h.
* common/gdb_assert.h: Likewise.
* darwin-nat.h: Likewise.
* nat/linux-btrace.c: Likewise.
* target/waitstatus.h: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include ptid.h.
* defs.h: Do not include ptid.h.
* inferior.h: Likewise.
* infrun.h: Likewise.
* nat/linux-btrace.h: Likewise.
* nat/linux-osdata.h: Likewise.
* target/waitstatus.h: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include gdb_locale.h.
* defs.h: Do not include gdb_locale.h.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include gdb/signals.h.
* defs.h: Do not include gdb/signals.h.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include pathmax.h.
* defs.h: Do not include pathmax.h.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include libiberty.h.
* defs.h: Do not include libiberty.h.
* common/queue.h: Likewise.
* cp-name-parser.y: Likewise.
* mi/mi-cmd-catch.c: Likewise.
* python/python.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include ansidecl.h.
* defs.h: Do not include ansidecl.h.
* common/buffer.h: Likewise.
* common/common-utils.h: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include stddef.h.
* defs.h: Do not include stddef.h.
* common/common-utils.h: Likewise.
* amd64fbsd-nat.c: Likewise.
* bcache.c: Likewise.
* charset.c: Likewise.
* common/buffer.h: Likewise.
* common/vec.h: Likewise.
* i386bsd-nat.c: Likewise.
* nat/linux-btrace.h: Likewise.
* ppcfbsd-nat.c: Likewise.
* ppcnbsd-tdep.h: Likewise.
* ppcobsd-nat.c: Likewise.
* ppcobsd-tdep.h: Likewise.
* python/py-gdb-readline.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include stdarg.h.
* defs.h: Do not include stdarg.h.
* ada-lang.c: Likewise.
* common/common-utils.h: Likewise.
* guile/scm-string.c: Likewise.
* guile/scm-utils.c: Likewise.
* m32c-tdep.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include stdlib.h.
* defs.h: Do not include stdlib.h.
* addrmap.c: Likewise.
* bcache.c: Likewise.
* common/buffer.c: Likewise.
* common/common-utils.c: Likewise.
* cp-name-parser.y: Likewise.
* go32-nat.c: Likewise.
* mn10300-linux-tdep.c: Likewise.
* nat/linux-osdata.c: Likewise.
* tui/tui.c: Likewise.
* windows-nat.c: Likewise.
2014-08-07 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: Include stdio.h.
* defs.h: Do not include stdio.h.
* ada-lang.c: Likewise.
* common/buffer.c: Likewise.
* common/common-utils.c: Likewise.
* cp-name-parser.y: Likewise.
* gnu-nat.c: Likewise.
* go32-nat.c: Likewise.
* i386gnu-nat.c: Likewise.
* proc-api.c: Likewise.
* proc-events.c: Likewise.
* proc-flags.c: Likewise.
* proc-why.c: Likewise.
* python/python-internal.h: Likewise.
* target-memory.c: Likewise.
* tui/tui-io.c: Likewise.
* tui/tui.c: Likewise.
2014-08-06 Simon Marchi <simon.marchi@ericsson.com>
* solib-svr4.c (scan_dyntag): Rename dyntag and dyn_tag variables.
(scan_dyntag_auxv): Same.
2014-08-06 Yao Qi <yao@codesourcery.com>
* amd64-linux-nat.c: Remove duplicated include
"x86-linux-nat.h".
* i386-linux-nat.c: Likewise.
2014-08-06 Yao Qi <yao@codesourcery.com>
* dwarf2read.c (dwarf_decode_lines_1): Replace "Special
operand" with "Special opcode" in comments.
2014-08-05 Gary Benson <gbenson@redhat.com>
* interps.c (initialize_interps): Remove prototype.
(interpreter_initialized): Remove static global.
(interp_add): Do not call initialize_interps.
(initialize_interps): Remove function.
2014-08-05 Gary Benson <gbenson@redhat.com>
* utils.c (vwarning): Remove spurious va_end.
2014-08-05 Alan Modra <amodra@gmail.com>
* charset.c (convert_between_encodings): Cast result of obstack_base.
* cp-valprint.c (cp_print_value_fields): Use size_t locals.
* hppa-tdep.c (internalize_unwinds): Change "size" parm to size_t.
(read_unwind_info): Use size_t for some locals.
* jit.c (finalize_symtab): Likewise.
* utils.c (hashtab_obstack_allocate): Likewise.
* symmisc.c (print_objfile_statistics): Update format strings.
Fix incorrect placement of two Intel gdb/NEWS items there were two commits which placed new gdb/NEWS items to the bottom of the NEWS file (such as for gdb-4.0) instead at their right place under: *** Changes in GDB 7.8 https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff;f=gdb/NEWS;h=ae84e009b8008f9da2707829c0cbab358abc17fb;hp=a8ae8c7b7a5ddce9b5779914dd1e6a87463d7d60;hb=ca8941bbd088002cb8ff87abe16d02ecc8d58d1e;hpb=489e41ddf4bb5616a7471fb4072df5efbb9a706e commit ca8941bbd088002cb8ff87abe16d02ecc8d58d1e Author: Walfred Tedeschi <walfred.tedeschi@intel.com> Date: Tue Dec 3 13:31:03 2013 +0000 Documentation for MPX. Message-Id: <1386074172-14177-1-git-send-email-walfred.tedeschi@intel.com> https://sourceware.org/ml/gdb-patches/2013-12/msg00082.html and https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff;f=gdb/NEWS;h=a7067fdf9a7af422572a29d1fdd6ef011c87cd9f;hp=b72d64db313d0785edec19a9c4b441b854698e6a;hb=01f9f808e2e86187c95e7cff4aeb014a421a53ce;hpb=93ee1e3683a12f4774b8beb4f821910982e21ce2 commit 01f9f808e2e86187c95e7cff4aeb014a421a53ce Author: Michael Sturm <michael.sturm@intel.com> Date: Mon Dec 16 16:43:05 2013 +0100 Add AVX512 registers support to GDB and GDBserver. Message-Id: <1398258160-9070-4-git-send-email-michael.sturm@intel.com> https://sourceware.org/ml/gdb-patches/2013-12/msg00818.html gdb/ 2014-08-04 Jan Kratochvil <jan.kratochvil@redhat.com> * NEWS (Changes in GDB-4.0): Move Intel MPX and Intel AVX-512 items ... (Changes in GDB 7.8): ... here. Message-ID: <20140804165708.GA12824@host2.jankratochvil.net>
2014-08-04 21:32:06 +02:00
2014-08-04 Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS (Changes in GDB-4.0): Move Intel MPX and Intel AVX-512 items ...
(Changes in GDB 7.8): ... here.
2014-08-04 Tom Tromey <tromey@redhat.com>
* target.c (set_targetdebug): New function.
(initialize_targets): Pass set_targetdebug when creating "set
debug target".
Handle variable-sized fields in the interior of structure type In Ada, variable-sized field can be located at any position of a structure. Consider for instance the following declarations: Dyn_Size : Integer := 1; type Table is array (Positive range <>) of Integer; type Inner is record T1 : Table (1 .. Dyn_Size) := (others => 1); T2 : Table (1 .. Dyn_Size) := (others => 2); end record; type Inner_Array is array (1 .. 2) of Inner; type Outer is record I0 : Integer := 0; A1 : Inner_Array; Marker : Integer := 16#01020304#; end record; Rt : Outer; What this does is declare a variable "Rt" of type Outer, which contains 3 fields where the second (A1) is of type Inner_Array. type Inner_Array is an array with 2 elements of type Inner. Because type Inner contains two arrays whose upper bound depend on a variable, the size of the array, and therefore the size of type Inner is dynamic, thus making field A1 a dynamically-size field. When trying to print the value of Rt, we hit the following limitation: (gdb) print rt Attempt to resolve a variably-sized type which appears in the interior of a structure type The limitation was somewhat making sense in C, but needs to be lifted for Ada. This patch mostly lifts that limitation. As a result of this patch, the type length computation had to be reworked a little bit. gdb/ChangeLog: * gdbtypes.c (resolve_dynamic_struct): Do not generate an error if detecting a variable-sized field that is not the last field. Fix struct type length computation. gdb/testsuite/ChangeLog: * gdb.base/vla-datatypes.c (vla_factory): Add new variable inner_vla_struct_object_size. * gdb.base/vla-datatypes.exp: Adjust last test, and mark it as xfail.
2014-07-08 17:15:35 +02:00
2014-08-01 Joel Brobecker <brobecker@adacore.com>
* gdbtypes.c (resolve_dynamic_struct): Do not generate an error
if detecting a variable-sized field that is not the last field.
Fix struct type length computation.
2014-08-01 Joel Brobecker <brobecker@adacore.com>
* amd64-windows-tdep.c (amd64_windows_frame_decode_insns):
Add debug trace.
2014-08-01 Joel Brobecker <brobecker@adacore.com>
* amd64-windows-tdep.c (amd64_windows_frame_decode_insns):
Remove "+ 8" offset in computation of CHAIN_VMA.
2014-07-31 Doug Evans <dje@google.com>
* inflow.c (child_terminal_inferior): Add comment.
(child_terminal_ours_for_output): Add comment.
(child_terminal_ours): Add comment.
* linux-nat.c (linux_nat_terminal_inferior): Add comment.
(linux_nat_terminal_ours): Add comment.
2014-07-31 Gary Benson <gbenson@redhat.com>
* common/btrace-common.h: Do not include defs.h or server.h.
* nat/mips-linux-watch.h: Likewise.
* gdb-dlfcn.h: Do not include defs.h.
* tracefile.h: Likewise.
2014-07-30 Roland McGrath <mcgrathr@google.com>
* remote-sim.c (gdbsim_open): Apply constification to forward decl.
2014-07-30 Tom Tromey <tromey@redhat.com>
* bsd-kvm.c (bsd_kvm_open): Constify.
* corelow.c (core_open): Constify.
* ctf.c (ctf_open): Constify.
* dbug-rom.c (dbug_open): Constify.
* exec.c (exec_open): Constify.
* m32r-rom.c (m32r_open, mon2000_open): Constify.
* microblaze-rom.c (picobug_open): Constify.
* nto-procfs.c (procfs_open_1, procfs_open, procfs_native_open):
Constify.
* ppcbug-rom.c (ppcbug_open0, ppcbug_open1): Constify.
* record-btrace.c (record_btrace_open): Constify.
* record-full.c (record_full_core_open_1, record_full_open_1)
(record_full_open): Constify.
* remote-m32r-sdi.c (m32r_open): Constify.
* remote-mips.c (common_open, mips_open, pmon_open, ddb_open)
(rockhopper_open, lsi_open): Constify.
* remote-sim.c (gdbsim_open): Constify.
* remote.c (remote_open, extended_remote_open, remote_open_1):
Constify.
* target.h (struct target_ops) <to_open>: Make "arg" const.
* tracefile-tfile.c (tfile_open): Constify.
2014-07-30 Tom Tromey <tromey@redhat.com>
* breakpoint.c (map_breakpoint_numbers): Update.
* cli/cli-utils.c (get_number_trailer): Make "pp" const. Update.
(get_number_const): New function.
(get_number): Rewrite using get_number_const.
(init_number_or_range): Make "string" const.
(number_is_in_list): Make "list" const.
* cli/cli-utils.h (get_number_const): Declare.
(struct get_number_or_range_state) <string, end_ptr>: Now const.
(init_number_or_range, number_is_in_list): Update.
* printcmd.c (map_display_numbers): Update.
* value.c (value_from_history_ref): Constify.
* value.h (value_from_history_ref): Update.
2014-07-30 Tom Tromey <tromey@redhat.com>
* corefile.c (hook_type, call_extra_exec_file_hooks)
(specify_exec_file_hook): Constify.
* exec.c (exec_file_attach): Make "filename" const.
* gdbcore.h (deprecated_exec_file_display_hook)
(specify_exec_file_hook, exec_file_attach): Constify.
* main.c (captured_main): Use catch_command_errors_const.
2014-07-30 Tom Tromey <tromey@redhat.com>
* target.c (open_target): New function.
(add_target_with_completer, add_deprecated_target_alias): Use
set_cmd_sfunc, set_cmd_context.
(debug_to_open): Remove.
(setup_target_debug): Update.
2014-07-30 Yao Qi <yao@codesourcery.com>
* parser-defs.h (struct exp_descriptor) <operator_check>: Update
comments.
* parse.c (exp_iterate): Update comments.
2014-07-30 Gary Benson <gbenson@redhat.com>
* common/common-defs.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add common/common-defs.h.
* defs.h: Include common-defs.h.
Do not include config.h or build-gnulib/config.h.
2014-07-30 Gary Benson <gbenson@redhat.com>
* common/common-utils.h: Do not include config.h.
* nat/linux-btrace.h: Likewise.
2014-07-30 Gary Benson <gbenson@redhat.com>
* btrace.c: Include defs.h.
* common/ptid.c: Include defs.h or server.h as appropriate.
* nat/mips-linux-watch.c: Likewise.
2014-07-29 Tom Tromey <tromey@redhat.com>
* target.c (target_is_pushed): Simplify.
2014-07-29 Joel Brobecker <brobecker@adacore.com>
GDB 7.8 released.
Fix PR 17206 As reported in PR 17206, an internal error is triggered when command until is executed. In infcmd.c:until_next_command, step_range_end is set to 'pc', if (!func) { struct bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc); if (msymbol.minsym == NULL) error (_("Execution is not within a known function.")); tp->control.step_range_start = BMSYMBOL_VALUE_ADDRESS (msymbol); tp->control.step_range_end = pc; } and later in infrun.c:resume, the assert below is triggered in PR 17206. if (tp->control.may_range_step) { /* If we're resuming a thread with the PC out of the step range, then we're doing some nested/finer run control operation, like stepping the thread out of the dynamic linker or the displaced stepping scratch pad. We shouldn't have allowed a range step then. */ gdb_assert (pc_in_thread_step_range (pc, tp)); } In until_next_command, we set step range to [XXX, pc), so pc isn't within the range. pc_in_thread_step_range returns false and the assert is triggered. AFAICS, the range we want in until_next_command is [XXX, pc] instead of [XXX, pc), because we want to program step until greater than pc. This patch is to set step_range_end to 'pc + 1'. Running until-nodebug.exp with unpatched GDB will get the following fail, FAIL: gdb.base/until-nodebug.exp: until 2 (GDB internal error) and the fail goes away when the fix is applied. gdb: 2014-07-29 Yao Qi <yao@codesourcery.com> PR gdb/17206 * infcmd.c (until_next_command): Set step_range_end to PC + 1. gdb/testsuite: 2014-07-29 Yao Qi <yao@codesourcery.com> PR gdb/17206 * gdb.base/until-nodebug.exp: New.
2014-07-28 07:44:57 +02:00
2014-07-29 Yao Qi <yao@codesourcery.com>
PR gdb/17206
* infcmd.c (until_next_command): Set step_range_end to PC + 1.
2014-07-28 Doug Evans <xdje42@gmail.com>
PR guile/17203
* guile/scm-param.c (pascm_parameter_defined_p): New function.
(gdbscm_register_parameter_x): Call it. Raise error for pre-existing
parameters.
2014-07-28 Will Newton <will.newton@linaro.org>
* arm-linux-tdep.c (THUMB2_SET_R7_SIGRETURN1): New define.
(THUMB2_SET_R7_SIGRETURN2): Likewise.
(THUMB2_SET_R7_RT_SIGRETURN1): Likewise.
(THUMB2_SET_R7_RT_SIGRETURN2): Likewise.
(THUMB2_EABI_SYSCALL): Likewise.
(thumb2_eabi_linux_sigreturn_tramp_frame): Create new
struct tramp_frame.
(thumb2_eabi_linux_rt_sigreturn_tramp_frame): Likewise.
(arm_linux_init_abi): Add Thumb2 tramp frame unwinders.
2014-07-27 Doug Evans <xdje42@gmail.com>
* guile/scm-param.c (pascm_print_param_smob): Fix output.
2014-07-27 Doug Evans <xdje42@gmail.com>
* guile/guile.c (gdbscm_execute_gdb_command): Fix typo in comment.
2014-07-26 Ludovic Courtès <ludo@gnu.org>
Doug Evans <xdje42@gmail.com>
PR guile/17146
* acinclude.m4 (GDB_GUILE_PROGRAM_NAMES): New macro.
(GDB_GUILD_TARGET_FLAG, GDB_TRY_GUILD): New macros.
* configure.ac: Try to use guild to compile an scm file, if it fails
then disable guile support.
* configure: Regenerate.
* data-directory/Makefile.in (GUILE_SOURCE_FILES): Renamed from
GUILE_FILE_LIST.
(GUILE_COMPILED_FILES): New variable.
(GUILE_FILES) Update.
(GUILD, GUILD_TARGET_FLAG, GUILD_COMPILE_FLAGS): New variables.
(stamp-guile): Compile scm files.
* guile/guile.c (boot_guile_support): New function.
(standard_throw_args_p): New function.
(print_standard_throw_error, print_throw_error): New functions.
(handle_boot_error): New function.
(initialize_scheme_side): Rewrite to call boot_guile_support.
* guile/lib/gdb/boot.scm: Update %load-compiled-path. Load gdb.go.
* guile/lib/gdb/init.scm (%silence-compiler-warnings%): New function.
2014-07-26 Ludovic Courtès <ludo@gnu.org>
Doug Evans <xdje42@gmail.com>
PR guile/17146
* data-directory/Makefile.in (GUILE_FILES): Add support.scm.
* guile/lib/gdb/support.scm: New file.
* guile/guile.c (gdbscm_init_module_name): Change to "gdb".
* guile/lib/gdb.scm: Load gdb/init.scm as an include file.
All uses updated.
* guile/lib/gdb/init.scm (SCM_ARG1, SCM_ARG2): Moved to support.scm.
All uses updated.
(%assert-type): Ditto, and renamed to assert-type.
(%exception-print-style): Delete.
2014-07-26 Doug Evans <xdje42@gmail.com>
PR build/17105
* configure.ac: Add AM_CONDITIONALs for HAVE_PYTHON, HAVE_GUILE.
* configure: Regenerate.
* data-directory/Makefile.in (PYTHON_FILE_LIST): Renamed from
PYTHON_FILES.
(PYTHON_FILES): New variable.
(GUILE_FILE_LIST): Renamed from GUILE_FILES.
(GUILE_FILES): New variable.
(stamp-python, install-python, uninstall-python): Handle empty
file list.
(stamp-guile, install-guile, uninstall-guile): Ditto.
2014-07-26 Doug Evans <xdje42@gmail.com>
PR guile/17177
* guile/lib/gdb.scm (pretty-printers): Export.
(set-pretty-printers!): Export.
* guile/lib/gdb/printing.scm (gdb module): Update.
(prepend-pretty-printer!, append-pretty-printer!): Update.
* guile/scm-pretty-print.c (pretty_printer_list_name): Delete.
(pretty_printer_list_var): Delete.
(pretty_printer_list): New static global.
(gdbscm_pretty_printers): New function.
(gdbscm_set_pretty_printers_x): New function.
(ppscm_find_pretty_printer_from_gdb): Update.
(pretty_printer_functions): Add pretty-printers, set-pretty-printers!.
(gdbscm_initialize_pretty_printers): Update.
2014-07-26 Doug Evans <xdje42@gmail.com>
PR 17185
* configure.ac: Add check for header gc/gc.h.
Add check for function setenv.
* configure: Regenerate.
* config.in: Regenerate.
* guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.
2014-07-25 Maciej W. Rozycki <macro@codesourcery.com>
* mips-tdep.c (mips_gdbarch_init): Also check the compressed ISA
variation in gdbarch matching.
2014-07-25 Tom Tromey <tromey@redhat.com>
* exec.c (using_exec_ops): Remove.
(exec_close_1): Update. Remove extraneous block, reindent.
(add_target_sections): Use target_is_pushed.
2014-07-25 Pedro Alves <palves@redhat.com>
* go32-nat.c (go32_create_inferior): Pass 0 to clear_proceed_status.
* monitor.c (monitor_create_inferior): Likewise.
* remote-m32r-sdi.c (m32r_create_inferior): Likewise.
* remote-sim.c (gdbsim_create_inferior): Likewise.
* solib-irix.c (irix_solib_create_inferior_hook): Likewise.
* solib-osf.c (osf_solib_create_inferior_hook): Likewise.
* windows-nat.c (do_initial_windows_stuff): Likewise.
Always pass signals to the right thread Currently, GDB can pass a signal to the wrong thread in several different but related scenarios. E.g., if thread 1 stops for signal SIGFOO, the user switches to thread 2, and then issues "continue", SIGFOO is actually delivered to thread 2, not thread 1. This obviously messes up programs that use pthread_kill to send signals to specific threads. This has been a known issue for a long while. Back in 2008 when I made stop_signal be per-thread (2020b7ab), I kept the behavior -- see code in 'proceed' being removed -- wanting to come back to it later. The time has finally come now. The patch fixes this -- on resumption, intercepted signals are always delivered to the thread that had intercepted them. Another example: if thread 1 stops for a breakpoint, the user switches to thread 2, and then issues "signal SIGFOO", SIGFOO is actually delivered to thread 1, not thread 2, because 'proceed' first switches to thread 1 to step over its breakpoint... If the user deletes the breakpoint before issuing "signal FOO", then the signal is delivered to thread 2 (the current thread). "signal SIGFOO" can be used for two things: inject a signal in the program while the program/thread had stopped for none, bypassing "handle nopass"; or changing/suppressing a signal the program had stopped for. These scenarios are really two faces of the same coin, and GDB can't really guess what the user is trying to do. GDB might have intercepted signals in more than one thread even (see the new signal-command-multiple-signals-pending.exp test). At least in the inject case, it's obviously clear to me that the user means to deliver the signal to the currently selected thread, so best is to make the command's behavior consistent and easy to explain. Then, if the user is trying to suppress/change a signal the program had stopped for instead of injecting a new signal, but, the user had changed threads meanwhile, then she will be surprised that with: (gdb) continue Thread 1 stopped for signal SIGFOO. (gdb) thread 2 (gdb) signal SIGBAR ... GDB actually delivers SIGFOO to thread 1, and SIGBAR to thread 2 (with scheduler-locking off, which is the default, because then "signal" or any other resumption command resumes all threads). So the patch makes GDB detect that, and ask for confirmation: (gdb) thread 1 [Switching to thread 1 (Thread 10979)] (gdb) signal SIGUSR2 Note: Thread 3 previously stopped with signal SIGUSR2, User defined signal 2. Thread 2 previously stopped with signal SIGUSR1, User defined signal 1. Continuing thread 1 (the current thread) with specified signal will still deliver the signals noted above to their respective threads. Continue anyway? (y or n) All these scenarios are covered by the new tests. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2014-07-25 Pedro Alves <palves@redhat.com> * NEWS: Mention signal passing and "signal" command changes. * gdbthread.h (struct thread_suspend_state) <stop_signal>: Extend comment. * breakpoint.c (until_break_command): Adjust clear_proceed_status call. * infcall.c (run_inferior_call): Adjust clear_proceed_status call. * infcmd.c (proceed_thread_callback, continue_1, step_once) (jump_command): Adjust clear_proceed_status call. (signal_command): Warn if other thread that are resumed have signals that will be delivered. Adjust clear_proceed_status call. (until_next_command, finish_command) (proceed_after_attach_callback, attach_command_post_wait) (attach_command): Adjust clear_proceed_status call. * infrun.c (proceed_after_vfork_done): Likewise. (proceed_after_attach_callback): Adjust comment. (clear_proceed_status_thread): Clear stop_signal if not in pass state. (clear_proceed_status_callback): Delete. (clear_proceed_status): New 'step' parameter. Only clear the proceed status of threads the command being prepared is about to resume. (proceed): If passed in an explicit signal, override stop_signal with it. Don't pass the last stop signal to the thread we're resuming. (init_wait_for_inferior): Adjust clear_proceed_status call. (switch_back_to_stepped_thread): Clear the signal if it should not be passed. * infrun.h (clear_proceed_status): New 'step' parameter. (user_visible_resume_ptid): Add comment. * linux-nat.c (linux_nat_resume_callback): Don't check whether the signal is in pass state. * remote.c (append_pending_thread_resumptions): Likewise. * mi/mi-main.c (proceed_thread): Adjust clear_proceed_status call. gdb/doc/ 2014-07-25 Pedro Alves <palves@redhat.com> Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Signaling) <signal command>: Explain what happens with multi-threaded programs. gdb/testsuite/ 2014-07-25 Pedro Alves <palves@redhat.com> * gdb.threads/signal-command-handle-nopass.c: New file. * gdb.threads/signal-command-handle-nopass.exp: New file. * gdb.threads/signal-command-multiple-signals-pending.c: New file. * gdb.threads/signal-command-multiple-signals-pending.exp: New file. * gdb.threads/signal-delivered-right-thread.c: New file. * gdb.threads/signal-delivered-right-thread.exp: New file.
2014-07-25 17:57:31 +02:00
2014-07-25 Pedro Alves <palves@redhat.com>
* NEWS: Mention signal passing and "signal" command changes.
* gdbthread.h (struct thread_suspend_state) <stop_signal>: Extend
comment.
* breakpoint.c (until_break_command): Adjust clear_proceed_status
call.
* infcall.c (run_inferior_call): Adjust clear_proceed_status call.
* infcmd.c (proceed_thread_callback, continue_1, step_once)
(jump_command): Adjust clear_proceed_status call.
(signal_command): Warn if other thread that are resumed have
signals that will be delivered. Adjust clear_proceed_status call.
(until_next_command, finish_command)
(proceed_after_attach_callback, attach_command_post_wait)
(attach_command): Adjust clear_proceed_status call.
* infrun.c (proceed_after_vfork_done): Likewise.
(proceed_after_attach_callback): Adjust comment.
(clear_proceed_status_thread): Clear stop_signal if not in pass
state.
(clear_proceed_status_callback): Delete.
(clear_proceed_status): New 'step' parameter. Only clear the
proceed status of threads the command being prepared is about to
resume.
(proceed): If passed in an explicit signal, override stop_signal
with it. Don't pass the last stop signal to the thread we're
resuming.
(init_wait_for_inferior): Adjust clear_proceed_status call.
(switch_back_to_stepped_thread): Clear the signal if it should not
be passed.
* infrun.h (clear_proceed_status): New 'step' parameter.
(user_visible_resume_ptid): Add comment.
* linux-nat.c (linux_nat_resume_callback): Don't check whether the
signal is in pass state.
* remote.c (append_pending_thread_resumptions): Likewise.
* mi/mi-main.c (proceed_thread): Adjust clear_proceed_status call.
2014-07-25 Tom Tromey <tromey@redhat.com>
* target.h (target_stopped_data_address)
(target_watchpoint_addr_within_range): Use "->", not ".". Fix
parentheses.
2014-07-25 Pierre Langlois <pierre.langlois@embecosm.com>
* avr-tdep.c (avr_address_to_pointer): Clarify the conversion in the
comments.
(avr_pointer_to_address): Likewise.
2014-07-24 Tom Tromey <tromey@redhat.com>
* monitor.c (compile_pattern): Update.
* target.h (struct target_ops) <to_shortname, to_longname,
to_doc>: Now const.
2014-07-24 Tom Tromey <tromey@redhat.com>
* cli/cli-decode.c (add_cmd, add_prefix_cmd)
(add_abbrev_prefix_cmd, add_set_or_show_cmd, add_info)
(add_info_alias, add_com): Make "doc" const.
(print_doc_line): Make "str" const.
(delete_cmd): Update.
* cli/cli-decode.h (struct cmd_list_element) <doc>: Now const.
(print_doc_line): Update.
* cli/cli-script.c (document_command): Update.
* command.h (add_cmd, add_prefix_cmd, add_abbrev_prefix_cmd)
(add_com, add_info, add_info_alias): Update.
* guile/scm-cmd.c (cmdscm_destroyer): Update.
* python/py-cmd.c (cmdpy_destroyer): Update.
2014-07-24 Tom Tromey <tromey@redhat.com>
* cli/cli-decode.c (print_help_for_command): Make "prefix" const.
(add_prefix_cmd, add_abbrev_prefix_cmd, apropos_cmd, help_list)
(help_cmd_list): Constify.
(lookup_cmd): Update.
* cli/cli-decode.h (struct cmd_list_element) <prefixname>: Now
const.
(help_cmd_list, apropos_cmd): Update.
* cli/cli-script.c (show_user): Update.
* cli/cli-setshow.c (cmd_show_list): Make "prefix" const.
* cli/cli-setshow.h (cmd_show_list): Update.
* command.h (add_prefix_cmd, add_abbrev_prefix_cmd, help_list)
(cmd_show_list): Update.
* guile/scm-cmd.c (cmdscm_destroyer): Update.
* python/py-cmd.c (cmdpy_destroyer): Update.
2014-07-24 Tom Tromey <tromey@redhat.com>
* cli/cli-decode.c (deprecate_cmd): Make "replacement" const.
* cli/cli-decode.h (struct cmd_list_element) <replacement>: Now
const.
* command.h (deprecate_cmd): Update.
* maint.c (maintenance_do_deprecate): Add casts.
2014-07-24 Tom Tromey <tromey@redhat.com>
* cli/cli-decode.c (help_cmd): Make parameter "const".
* cli/cli-decode.h (help_cmd): Update.
2014-07-24 Tom Tromey <tromey@redhat.com>
* stack.c (up_silently_base, down_silently_base): Make argument
const.
2014-07-24 Tom Tromey <tromey@redhat.com>
* solib.c (solib_add): Make "pattern" const.
* solib.h (solib_add): Update.
2014-07-24 Tom Tromey <tromey@redhat.com>
* remote.c (remote_serial_open, print_packet, putpkt)
(putpkt_binary): Constify.
* remote.h (putpkt): Update.
2014-07-24 Tom Tromey <tromey@redhat.com>
* monitor.c (monitor_open): Make "args" const.
* monitor.h (monitor_open): Update.
2014-07-24 Tom Tromey <tromey@redhat.com>
* maint.c (match_bfd_flags): Make "string" const.
(print_bfd_section_info): Remove casts.
(print_objfile_section_info): Make "string" const.
2014-07-24 Tom Tromey <tromey@redhat.com>
* inf-child.c (inf_child_open_target): Make "arg" const.
* inf-child.h (inf_child_open_target): Update.
2014-07-24 Tom Tromey <tromey@redhat.com>
* environ.c (unset_in_environ): Make "var" const.
* environ.h (unset_in_environ): Update.
2014-07-24 Tom Tromey <tromey@redhat.com>
* cli/cli-dump.c (scan_expression_with_cleanup): Return const.
Make "cmd" const.
(scan_filename_with_cleanup): Likewise.
(dump_memory_to_file, dump_value_to_file, restore_binary_file):
Make arguments const.
(restore_command): Update.
Fix pagination crash when the TUI is active The TUI currently crashes when the user types <return> in response to a pagination prompt: $ gdb --tui ... *the TUI is now active* (gdb) set height 2 (gdb) help List of classes of commands: Program received signal SIGSEGV, Segmentation fault. strlen () at ../sysdeps/x86_64/strlen.S:106 106 movdqu (%rax), %xmm12 (top-gdb) bt #0 strlen () at ../sysdeps/x86_64/strlen.S:106 #1 0x000000000086be5f in xstrdup (s=0x0) at ../src/libiberty/xstrdup.c:33 #2 0x00000000005163f9 in tui_prep_terminal (notused1=1) at ../src/gdb/tui/tui-io.c:296 #3 0x000000000077a7ee in _rl_callback_newline () at ../src/readline/callback.c:82 #4 0x000000000077a853 in rl_callback_handler_install (prompt=0x0, linefunc=0x618b60 <command_line_handler>) at ../src/readline/callback.c:102 #5 0x0000000000718a5c in gdb_readline_wrapper_cleanup (arg=0xfd14d0) at ../src/gdb/top.c:788 #6 0x0000000000596d08 in do_my_cleanups (pmy_chain=0xcf0b38 <cleanup_chain>, old_chain=0x1043d10) at ../src/gdb/cleanups.c:155 #7 0x0000000000596d75 in do_cleanups (old_chain=0x1043d10) at ../src/gdb/cleanups.c:177 #8 0x0000000000718bd9 in gdb_readline_wrapper (prompt=0x7fffffffcfa0 "---Type <return> to continue, or q <return> to quit---") at ../src/gdb/top.c:835 #9 0x000000000071cf74 in prompt_for_continue () at ../src/gdb/utils.c:1894 #10 0x000000000071d434 in fputs_maybe_filtered (linebuffer=0x1043db0 "List of classes of commands:\n\n", stream=0xf72e20, filter=1) at ../src/gdb/utils.c:2111 #11 0x000000000071da0f in vfprintf_maybe_filtered (stream=0xf72e20, format=0x89aef8 "List of classes of %scommands:\n\n", args=0x7fffffffd118, filter=1) at ../src/gdb/utils.c:2339 #12 0x000000000071da4a in vfprintf_filtered (stream=0xf72e20, format=0x89aef8 "List of classes of %scommands:\n\n", args=0x7fffffffd118) at ../src/gdb/utils.c:2347 #13 0x000000000071dc72 in fprintf_filtered (stream=0xf72e20, format=0x89aef8 "List of classes of %scommands:\n\n") at ../src/gdb/utils.c:2399 #14 0x00000000004f90ab in help_list (list=0xe6d100, cmdtype=0x89ad8c "", class=all_classes, stream=0xf72e20) at ../src/gdb/cli/cli-decode.c:1038 #15 0x00000000004f8dba in help_cmd (arg=0x0, stream=0xf72e20) at ../src/gdb/cli/cli-decode.c:946 Git 0017922 added: @@ -776,6 +777,12 @@ gdb_readline_wrapper_cleanup (void *arg) gdb_assert (input_handler == gdb_readline_wrapper_line); input_handler = cleanup->handler_orig; + + /* Reinstall INPUT_HANDLER in readline, without displaying a + prompt. */ + if (async_command_editing_p) + rl_callback_handler_install (NULL, input_handler); and tui_prep_terminal simply misses handling the case of a NULL rl_prompt. I also checked that readline's sources do similar checks. gdb/ 2014-07-24 Pedro Alves <palves@redhat.com> * tui/tui-io.c (tui_prep_terminal): Handle NULL rl_prompt.
2014-07-24 16:51:21 +02:00
2014-07-24 Pedro Alves <palves@redhat.com>
* tui/tui-io.c (tui_prep_terminal): Handle NULL rl_prompt.
2014-07-24 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* nat/linux-ptrace.c (additional_flags): New global.
(linux_test_for_tracesysgood, linux_test_for_tracefork): Use
additional_flags; don't check GDBSERVER.
(linux_ptrace_set_additional_flags): New function.
* nat/linux-ptrace.h (linux_ptrace_set_additional_flags):
Declare.
* linux-nat.c (_initialize_linux_nat): Call
linux_ptrace_set_additional_flags.
auto-generate most target debug methods The target debug methods are inconsistently maintained. Most to_* methods have some kind of targetdebug awareness, but not all of them do. The ones that do vary in the quantity and quality of output they generate. This patch changes most of the target debug methods to be automatically generated. All the arguments are printed, and separate lines are printed for entering and existing the outermost call to the target stack. For example now you'd see: -> multi-thread->to_terminal_ours (...) -> multi-thread->to_is_async_p (...) <- multi-thread->to_is_async_p (0x1ebb580) = 1 <- multi-thread->to_terminal_ours (0x1ebb580) -> multi-thread->to_thread_address_space (...) <- multi-thread->to_thread_address_space (0x1ebb580, 26802) = 1 In this case you can see nested calls. The "multi-thread" on the left hand side is the topmost target's shortname. There are some oddities with this patch. I'm on the fence about it all, I really just wrote it on a whim. It's not simple to convert every possible method, since a few don't participate in target delegation. Printing is done by type, so I introduced some new debug-printing-specific typedefs to handle cases where it is nicer to do something else. On the plus side, this lays the groundwork for making targetdebug affect every layer of the target stack. The idea would be to wrap each target_ops in the stack with its own debug_target, and then you could see calls propagate down the stack and back up; I suppose with indentation to make it prettier. (That said there are some gotchas lurking in this idea due to target stack introspection.) Regtested on x86-64 Fedora 20. 2014-07-24 Tom Tromey <tromey@redhat.com> * make-target-delegates (munge_type, write_debugmethod): New functions. (debug_names): New global. ($TARGET_DEBUG_PRINTER): New global. (write_function_header): Strip TARGET_DEBUG_PRINTER from the type name. Write debug methods. Generate init_debug_target. * target-debug.h: New file. * target-delegates.c: Rebuild. * target.c: Include target-debug.h. (debug_target): Hoist definition. (target_kill, target_get_section_table, target_memory_map) (target_flash_erase, target_flash_done, target_detach) (target_disconnect, target_wait, target_resume) (target_pass_signals, target_program_signals, target_follow_fork) (target_mourn_inferior, target_search_memory) (target_thread_address_space, target_close) (target_find_new_threads, target_core_of_thread) (target_verify_memory, target_insert_mask_watchpoint) (target_remove_mask_watchpoint): Remove targetdebug code. (debug_to_post_attach, debug_to_prepare_to_store) (debug_to_files_info, debug_to_insert_breakpoint) (debug_to_remove_breakpoint, debug_to_can_use_hw_breakpoint) (debug_to_region_ok_for_hw_watchpoint) (debug_to_can_accel_watchpoint_condition) (debug_to_stopped_by_watchpoint, debug_to_stopped_data_address) (debug_to_watchpoint_addr_within_range) (debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint) (debug_to_insert_watchpoint, debug_to_remove_watchpoint) (debug_to_terminal_init, debug_to_terminal_inferior) (debug_to_terminal_ours_for_output, debug_to_terminal_ours) (debug_to_terminal_save_ours, debug_to_terminal_info) (debug_to_load, debug_to_post_startup_inferior) (debug_to_insert_fork_catchpoint) (debug_to_remove_fork_catchpoint) (debug_to_insert_vfork_catchpoint) (debug_to_remove_vfork_catchpoint) (debug_to_insert_exec_catchpoint) (debug_to_remove_exec_catchpoint, debug_to_has_exited) (debug_to_can_run, debug_to_thread_architecture, debug_to_stop) (debug_to_rcmd, debug_to_pid_to_exec_file): Remove. (setup_target_debug): Call init_debug_target. * target.h (TARGET_DEBUG_PRINTER): New macro. (struct target_ops) <to_resume, to_wait, to_pass_signals, to_program_signals>: Use TARGET_DEBUG_PRINTER.
2014-06-16 05:28:57 +02:00
2014-07-24 Tom Tromey <tromey@redhat.com>
* make-target-delegates (munge_type, write_debugmethod): New
functions.
(debug_names): New global.
($TARGET_DEBUG_PRINTER): New global.
(write_function_header): Strip TARGET_DEBUG_PRINTER from the type
name.
Write debug methods. Generate init_debug_target.
* target-debug.h: New file.
* target-delegates.c: Rebuild.
* target.c: Include target-debug.h.
(debug_target): Hoist definition.
(target_kill, target_get_section_table, target_memory_map)
(target_flash_erase, target_flash_done, target_detach)
(target_disconnect, target_wait, target_resume)
(target_pass_signals, target_program_signals, target_follow_fork)
(target_mourn_inferior, target_search_memory)
(target_thread_address_space, target_close)
(target_find_new_threads, target_core_of_thread)
(target_verify_memory, target_insert_mask_watchpoint)
(target_remove_mask_watchpoint): Remove targetdebug code.
(debug_to_post_attach, debug_to_prepare_to_store)
(debug_to_files_info, debug_to_insert_breakpoint)
(debug_to_remove_breakpoint, debug_to_can_use_hw_breakpoint)
(debug_to_region_ok_for_hw_watchpoint)
(debug_to_can_accel_watchpoint_condition)
(debug_to_stopped_by_watchpoint, debug_to_stopped_data_address)
(debug_to_watchpoint_addr_within_range)
(debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint)
(debug_to_insert_watchpoint, debug_to_remove_watchpoint)
(debug_to_terminal_init, debug_to_terminal_inferior)
(debug_to_terminal_ours_for_output, debug_to_terminal_ours)
(debug_to_terminal_save_ours, debug_to_terminal_info)
(debug_to_load, debug_to_post_startup_inferior)
(debug_to_insert_fork_catchpoint)
(debug_to_remove_fork_catchpoint)
(debug_to_insert_vfork_catchpoint)
(debug_to_remove_vfork_catchpoint)
(debug_to_insert_exec_catchpoint)
(debug_to_remove_exec_catchpoint, debug_to_has_exited)
(debug_to_can_run, debug_to_thread_architecture, debug_to_stop)
(debug_to_rcmd, debug_to_pid_to_exec_file): Remove.
(setup_target_debug): Call init_debug_target.
* target.h (TARGET_DEBUG_PRINTER): New macro.
(struct target_ops) <to_resume, to_wait, to_pass_signals,
to_program_signals>: Use TARGET_DEBUG_PRINTER.
Rationalize "fatal" error handling outside of gdbserver GDB and gdbserver have functions named "fatal" that are used in completely different ways. In gdbserver "fatal" is used to handle critical errors: it differs from "error" in that "fatal" causes gdbserver to exit whereas "error" does not. In GDB "fatal" is used to abort the current operation and return to the command level. This is implemented by throwing a non-error "RETURN_QUIT" exception. This commit removes GDB's "fatal" and "vfatal" functions entirely. The exception-throwing function "throw_vfatal" is renamed as "throw_vquit", and a new convenience function "throw_quit" is added. The small number of calls to "fatal" are replaced with calls to "throw_quit", making what is happening more obvious. This commit also modifies GDB's "throw_error" to call "throw_verror" rather than calling "throw_it" directly. This change means the assignment of RETURN_ERROR as the exception type now happens in precisely one place in GDB rather than two. gdb/ 2014-07-24 Gary Benson <gbenson@redhat.com> * exceptions.h (throw_vfatal): Renamed to... (throw_vquit): New declaration. (throw_quit): Likewise. * exceptions.c (throw_vfatal): Renamed to... (throw_vquit): New function. (throw_quit): Likewise. (throw_error): Call throw_verror rather than throw_it. * utils.h (vfatal): Removed. (fatal): Likewise. * utils.c (vfatal): Removed. (fatal): Likewise. (internal_verror): Replaced call to fatal with call to throw_quit. (quit): Replaced calls to fatal with calls to throw_quit.
2014-07-23 15:51:26 +02:00
2014-07-24 Gary Benson <gbenson@redhat.com>
* exceptions.h (throw_vfatal): Renamed to...
(throw_vquit): New declaration.
(throw_quit): Likewise.
* exceptions.c (throw_vfatal): Renamed to...
(throw_vquit): New function.
(throw_quit): Likewise.
(throw_error): Call throw_verror rather than throw_it.
* utils.h (vfatal): Removed.
(fatal): Likewise.
* utils.c (vfatal): Removed.
(fatal): Likewise.
(internal_verror): Replaced call to fatal with call to throw_quit.
(quit): Replaced calls to fatal with calls to throw_quit.
2014-07-23 Ajit Agarwal <ajitkum@xilinx.com>
* microblaze-tdep.c (microblaze_fetch_instruction): Use of
target_read_code.
2014-07-23 Chen Gang <gang.chen.5i5j@gmail.com>
* microblaze-tdep.c (microblaze_dwarf2_reg_to_regnum): Check whether
less than zero in conditional expression.
2014-07-23 Tom Tromey <tromey@redhat.com>
* make-target-delegates ($ARGS_PART): Match trailing close paren.
($INTRO_PART): Don't match whitespace.
($METHOD_TRAILER): Move earlier. Remove trailing semicolon and
argument matching.
($METHOD): Add $METHOD_TRAILER.
(trim): Rewrite.
(scan_target_h): New sub.
Change main loop not to collect state.
* target-delegates.c: Rebuild.
2014-07-23 Gary Benson <gbenson@redhat.com>
* cp-support.c (gdb_demangle): Fix build on systems without
sigaltstack.
Remove setting value address for reference entry value target data value. I cannot reproduce any wrong case having the code removed. I just do not find it correct to have it disabled. But at the same time I do like much / I do not find correct the code myself. It is a bit problematic to have struct value describing a memory content which is no longer present there. What happens there: ------------------------------------------------------------------------------ volatile int vv; static __attribute__((noinline)) int bar (int &ref) { ref = 20; vv++; /* break-here */ return ref; } int main (void) { int var = 10; return bar (var); } ------------------------------------------------------------------------------ <4><c7>: Abbrev Number: 13 (DW_TAG_GNU_call_site_parameter) <c8> DW_AT_location : 1 byte block: 55 (DW_OP_reg5 (rdi)) <ca> DW_AT_GNU_call_site_value: 2 byte block: 91 74 (DW_OP_fbreg: -12) <cd> DW_AT_GNU_call_site_data_value: 1 byte block: 3a (DW_OP_lit10) ------------------------------------------------------------------------------ gdb -ex 'b value_addr' -ex r --args ../gdb ./1 -ex 'watch vv' -ex r -ex 'p &ref@entry' -> 6 return ref; bar (ref=@0x7fffffffd944: 20, ref@entry=@0x7fffffffd944: 10) at 1.C:25 ------------------------------------------------------------------------------ At /* break-here */ struct value variable 'ref' is TYPE_CODE_REF. With FSF GDB HEAD: (gdb) x/gx arg1.contents 0x6004000a4ad0: 0x00007fffffffd944 (gdb) p ((struct value *)arg1.location.computed.closure).lval $1 = lval_memory (gdb) p/x ((struct value *)arg1.location.computed.closure).location.address $3 = 0x7fffffffd944 With your #if0-ed code: (gdb) x/gx arg1.contents 0x6004000a4ad0: 0x00007fffffffd944 (gdb) p ((struct value *)arg1.location.computed.closure).lval $8 = not_lval (gdb) p/x ((struct value *)arg1.location.computed.closure).location.address $9 = 0x0 I do not see how to access ((struct value *)arg1.location.computed.closure).location.address from GDB CLI. Trying (gdb) p &ref@entry will invoke value_addr()'s: if (TYPE_CODE (type) == TYPE_CODE_REF) /* Copy the value, but change the type from (T&) to (T*). We keep the same location information, which is efficient, and allows &(&X) to get the location containing the reference. */ and therefore the address gets fetched already from arg1.contents and not from ((struct value *)arg1.location.computed.closure).location.address . And for any other type than TYPE_CODE_REF this code you removed does not get executed at all. This DW_AT_GNU_call_site_data_value DWARF was meant primarily for Fortran but with -O0 entry values do not get produced and with -Og and higher Fortran always optimizes out the passing by reference. If you do not like the removed code there I am OK with removing it as I do not know how to make it's use reproducible for user anyway. In the worst case - if there really is some way how to exploit it - one should just get Attempt to take address of value not located in memory. instead of some wrong value and it may be easy to fix then. gdb/ 2014-07-22 Jan Kratochvil <jan.kratochvil@redhat.com> * dwarf2loc.c (value_of_dwarf_reg_entry): Remove setting value address for reference entry value target data value. Message-ID: <20140720150727.GA18488@host2.jankratochvil.net>
2014-07-22 22:15:27 +02:00
2014-07-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2loc.c (value_of_dwarf_reg_entry): Remove setting value address
for reference entry value target data value.
2014-07-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* stack.c (read_frame_arg): Verify value_optimized_out before calling
value_available_contents_eq.
Fix crash on optimized-out entry data values The tests at <https://sourceware.org/ml/gdb-patches/2014-07/msg00277.html> show that comparing a fully optimized out value's contents with a value that has not been optimized out, or is partially optimized out crashes GDB: (gdb) bt #0 __memcmp_sse4_1 () at ../sysdeps/x86_64/multiarch/memcmp-sse4.S:816 #1 0x00000000005a1914 in memcmp_with_bit_offsets (ptr1=0x202b2f0 "\n", offset1_bits=0, ptr2=0x0, offset2_bits=0, length_bits=32) at /home/pedro/gdb/mygit/build/../src/gdb/value.c:678 #2 0x00000000005a1a05 in value_available_contents_bits_eq (val1=0x2361ad0, offset1=0, val2=0x23683b0, offset2=0, length=32) at /home/pedro/gdb/mygit/build/../src/gdb/value.c:717 #3 0x00000000005a1c09 in value_available_contents_eq (val1=0x2361ad0, offset1=0, val2=0x23683b0, offset2=0, length=4) at /home/pedro/gdb/mygit/build/../src/gdb/value.c:769 #4 0x00000000006033ed in read_frame_arg (sym=0x1b78d20, frame=0x19bca50, argp=0x7fff4aba82b0, entryargp=0x7fff4aba82d0) at /home/pedro/gdb/mygit/build/../src/gdb/stack.c:416 #5 0x0000000000603abb in print_frame_args (func=0x1b78cb0, frame=0x19bca50, num=-1, stream=0x1aea450) at /home/pedro/gdb/mygit/build/../src/gdb/stack.c:671 #6 0x0000000000604ae8 in print_frame (frame=0x19bca50, print_level=0, print_what=SRC_AND_LOC, print_args=1, sal=...) at /home/pedro/gdb/mygit/build/../src/gdb/stack.c:1205 #7 0x0000000000604050 in print_frame_info (frame=0x19bca50, print_level=0, print_what=SRC_AND_LOC, print_args=1, set_current_sal=1) at /home/pedro/gdb/mygit/build/../src/gdb/stack.c:857 #8 0x00000000006029b3 in print_stack_frame (frame=0x19bca50, print_level=0, print_what=SRC_AND_LOC, set_current_sal=1) at /home/pedro/gdb/mygit/build/../src/gdb/stack.c:169 #9 0x00000000005fc4b8 in print_stop_event (ws=0x7fff4aba8790) at /home/pedro/gdb/mygit/build/../src/gdb/infrun.c:6068 #10 0x00000000005fc830 in normal_stop () at /home/pedro/gdb/mygit/build/../src/gdb/infrun.c:6214 The 'ptr2=0x0' in frame #1 is val2->contents, and since git 4f14910f: gdb/ChangeLog 2013-11-26 Andrew Burgess <aburgess@broadcom.com> * value.c (allocate_optimized_out_value): Mark value as non-lazy. ... a fully optimized-out value can have it's value contents buffer NULL. As a spotgap fix, revert 4f14910f, with a comment. A full fix would be too invasive for 7.8. gdb/ 2014-07-22 Pedro Alves <palves@redhat.com> * value.c (allocate_optimized_out_value): Don't mark value as non-lazy.
2014-07-22 20:56:28 +02:00
2014-07-22 Pedro Alves <palves@redhat.com>
* value.c (allocate_optimized_out_value): Don't mark value as
non-lazy.
2014-07-22 Jiong Wang <jiong.wang@arm.com>
* MAINTAINERS (Write After Approval): Update my email address.
2014-07-20 Doug Evans <dje@google.com>
PR server/17147
* remote.c (putpkt_binary): Add text to error message.
2014-07-20 Yao Qi <yao@codesourcery.com>
* eval.c: Remove "Chill" from comments.
* gdbtypes.h: Likewise.
* symtab.h: Likewise.
2014-07-20 Yao Qi <yao@codesourcery.com>
* std-operator.def: Update comments to TERNOP_SLICE.
2014-07-20 Yao Qi <yao@codesourcery.com>
* std-operator.def: Remove BINOP_RANGE.
* breakpoint.c (watchpoint_exp_is_const): Update.
* expprint.c (dump_subexp_body_standard): Likewise.
* eval.c (init_array_element): Remove dead code.
(evaluate_subexp_standard): Likewise.
2014-07-20 Yao Qi <yao@codesourcery.com>
* std-operator.def: Remove BINOP_IN.
* breakpoint.c (watchpoint_exp_is_const): Update.
* eval.c (evaluate_subexp_standard): Likewise.
* expprint.c (dump_subexp_body_standard): Likewise.
Fix for remote G Packet message too long error for baremetal. Prior to version MicroBlaze v8.10.a,EDK 13.1, XMD's gdbserver stub returned 57 registers in response to GDB's G request. Starting with version MicroBlaze v8.10.a, EDK 13.1, XMD added the slr and shr register, for a count of 59 registers. This patch adds these registers to the expected G response. This patch fixes the above problem for baremetal and also supports the backward compatibility. ChangeLog: 2014-07-02 Ajit Agarwal <ajitkum@xilinx.com> * microblaze-tdep.c (microblaze_register_names): Add the rshr and rslr register names. (microblaze_gdbarch_init): Use of tdesc_has_registers. Use of tdesc_find_feature. Use of tdesc_data_alloc. Use of tdesc_numbered_register. Use of microblaze_register_g_packet_guesses. Use of tdesc_use_registers. Use of set_gdbarch_register_type. (microblaze_register_g_packet_guesses): New. * microblaze-tdep.h (microblaze_reg_num): Add field MICROBLAZE_SLR_REGNUM MICROBLAZE_SHR_REGNUM MICROBLAZE_NUM_REGS and MICROBLAZE_NUM_CORE_REGS. (microblaze_frame_cache): Use of MICROBLAZE_NUM_REGS. * features/microblaze-core.xml: New file. * features/microblaze-stack-protect.xml: New file. * features/microblaze-with-stack-protect.c: New file. * features/microblaze-with-stack-protect.xml: New file. * features/microblaze.xml: New file. * features/microblaze.c: New file. * features/Makefile (microblaze-with-stack-protect): Add microblaze-with-stack-protect microblaze and microblaze-expedite. * regformats/microblaze-with-stack-protect.dat: New file. * regformats/microblaze.dat: New file. * doc/gdb.texinfo (MicroBlaze Features): New. Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
2014-07-20 02:47:52 +02:00
2014-07-19 Ajit Agarwal <ajitkum@xilinx.com>
* microblaze-tdep.c (microblaze_register_names): Add
the rshr and rslr register names.
(microblaze_gdbarch_init): Use of tdesc_has_registers.
Use of tdesc_find_feature. Use of tdesc_data_alloc.
Use of tdesc_numbered_register. Use of
microblaze_register_g_packet_guesses. Use of
tdesc_use_registers. Use of set_gdbarch_register_type.
(microblaze_register_g_packet_guesses): New.
* microblaze-tdep.h (microblaze_reg_num): Add
field MICROBLAZE_SLR_REGNUM MICROBLAZE_SHR_REGNUM
MICROBLAZE_NUM_REGS and MICROBLAZE_NUM_CORE_REGS.
(microblaze_frame_cache): Use of MICROBLAZE_NUM_REGS.
* features/microblaze-core.xml: New file.
* features/microblaze-stack-protect.xml: New file.
* features/microblaze-with-stack-protect.c: New file.
* features/microblaze-with-stack-protect.xml: New file.
* features/microblaze.xml: New file.
* features/microblaze.c: New file.
* features/Makefile (microblaze-with-stack-protect): Add
microblaze-with-stack-protect microblaze and microblaze-expedite.
* regformats/microblaze-with-stack-protect.dat: New file.
* regformats/microblaze.dat: New file.
* doc/gdb.texinfo (MicroBlaze Features): Added.
2014-07-18 Tom Tromey <tromey@redhat.com>
* exec.c (exec_ops): Now static.
* exec.h (exec_ops): Don't declare.
2014-07-18 Tom Tromey <tromey@redhat.com>
* spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Pass "self"
to find_target_beneath.
* ravenscar-thread.c (ravenscar_prepare_to_store): Pass "ops" to
find_target_beneath.
(ravenscar_mourn_inferior): Pass "self" to find_target_beneath.
2014-07-18 Tom Tromey <tromey@redhat.com>
PR gdb/17130:
* utils.c (quit): Use target_supports_terminal_ours.
* target.h (target_supports_terminal_ours): Declare.
* target.c (target_supports_delete_record): Don't check
to_delete_record against NULL.
(target_supports_terminal_ours): New function.
2014-07-18 Tom Tromey <tromey@redhat.com>
PR gdb/17130:
* spu-multiarch.c (spu_region_ok_for_hw_watchpoint)
(spu_fetch_registers, spu_store_registers, spu_xfer_partial)
(spu_search_memory, spu_mourn_inferior): Simplify delegation.
* linux-thread-db.c (thread_db_pid_to_str): Always delegate.
* windows-nat.c (windows_xfer_partial): Always delegate.
* record-btrace.c (record_btrace_xfer_partial): Simplify
delegation.
(record_btrace_fetch_registers, record_btrace_store_registers)
(record_btrace_prepare_to_store, record_btrace_resume)
(record_btrace_wait, record_btrace_find_new_threads)
(record_btrace_thread_alive): Likewise.
* procfs.c (procfs_xfer_partial): Always delegate.
* corelow.c (core_xfer_partial): Always delegate.
* sol-thread.c (sol_find_new_threads): Simplify delegation.
2014-07-18 Tom Tromey <tromey@redhat.com>
* exec.c (exec_make_note_section): Move earlier.
2014-07-17 Doug Evans <dje@google.com>
PR gdb/17170
* maint.c (count_symtabs_and_blocks): Handle NULL
current_program_space.
(report_command_stats): Check global enabled flag in addition to
recorded enabled flag.
(make_command_stats_cleanup): Handle msg_type == 0, startup.
2014-07-16 Pedro Alves <palves@redhat.com>
* linux-nat.c (kill_callback): Use kill_lwp, not kill.
2014-07-16 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_delete_record>: Reformat
comment.
2014-07-16 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
Add support for the __flash qualifier on AVR The __flash qualifier is part of the named address spaces for AVR [1]. It allows putting read-only data in the flash memory, normally reserved for code. When used together with a pointer, the DW_AT_address_class attribute is set to 1 and allows GDB to detect that when it will be dereferenced, the data will be loaded from the flash memory (with the LPM instruction). We can now properly debug the following code: ~~~ const __flash char data_in_flash = 0xab; int main (void) { const __flash char *pointer_to_flash = &data_in_flash; } ~~~ ~~~ (gdb) print pointer_to_flash $1 = 0x1e8 <data_in_flash> "\253" (gdb) print/x *pointer_to_flash $2 = 0xab (gdb) x/x pointer_to_flash 0x1e8 <data_in_flash>: 0xXXXXXXab ~~~ Whereas previously, GDB would revert to the default address space which is RAM and mapped in higher memory: ~~~ (gdb) print pointer_to_flash $1 = 0x8001e8 "" ~~~ [1] https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html 2014-07-15 Pierre Langlois <pierre.langlois@embecosm.com> gdb/ * avr-tdep.c (AVR_TYPE_ADDRESS_CLASS_FLASH): New macro. (AVR_TYPE_INSTANCE_FLAG_ADDRESS_CLASS_FLASH): Likewise. (avr_address_to_pointer): Check for AVR_TYPE_ADDRESS_CLASS_FLASH. (avr_pointer_to_address): Likewise. (avr_address_class_type_flags): New function. (avr_address_class_type_flags_to_name): Likewise. (avr_address_class_name_to_type_flags): Likewise. (avr_gdbarch_init): Set address_class_type_flags, address_class_type_flags_to_name and address_class_name_to_type_flags. gdb/testsuite/ * gdb.arch/avr-flash-qualifer.c: New. * gdb.arch/avr-flash-qualifer.exp: New.
2014-07-15 18:03:09 +02:00
2014-07-15 Pierre Langlois <pierre.langlois@embecosm.com>
* avr-tdep.c (AVR_TYPE_ADDRESS_CLASS_FLASH): New macro.
(AVR_TYPE_INSTANCE_FLAG_ADDRESS_CLASS_FLASH): Likewise.
(avr_address_to_pointer): Check for AVR_TYPE_ADDRESS_CLASS_FLASH.
(avr_pointer_to_address): Likewise.
(avr_address_class_type_flags): New function.
(avr_address_class_type_flags_to_name): Likewise.
(avr_address_class_name_to_type_flags): Likewise.
(avr_gdbarch_init): Set address_class_type_flags,
address_class_type_flags_to_name and
address_class_name_to_type_flags.
2014-07-15 Pedro Alves <palves@redhat.com>
* linux-nat.c (kill_callback): Save errno and work with saved
copy.
2014-07-15 Simon Marchi <simon.marchi@ericsson.com>
* expprint.c (dump_subexp_body_standard): Handle OP_STRING.
2014-07-14 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Report no hardware
breakpoint support correctly.
2014-07-14 Pedro Alves <palves@redhat.com>
* utils.c (prompt_for_continue): Call target_terminal_ours.
2014-07-14 Pedro Alves <palves@redhat.com>
* inf-loop.c (inferior_event_handler): Use TRY_CATCH instead of
catch_errors. Don't re-enable stdin or notify observers where,
and rethrow error.
(fetch_inferior_event_wrapper): Delete.
Remove the target from the event loop while in secondary prompts If a pagination prompt triggers while the target is running, and the target exits before the user responded to the pagination query, this happens: Starting program: foo ---Type <return> to continue, or q <return> to quit---No unwaited-for children left. Couldn't get registers: No such process. Couldn't get registers: No such process. Couldn't get registers: No such process. (gdb) Couldn't get registers: No such process. (gdb) To reiterate, the user hasn't replied to the pagination prompt above. A pagination query nests an event loop (in gdb_readline_wrapper). In async mode, in addition to stdin and signal handlers, we'll have the target also installed in the event loop still. So if the target reports an event, that wakes up the nested event loop, which calls into fetch_inferior_event etc. to handle the event which generates further output, all while we should be waiting for pagination confirmation... (TBC, any target event that generates output ends up spuriously waking up the pagination, though exits seem to be the worse kind.) I've played with a couple different approaches to fixing this, while at the same time trying to avoid being invasive. Both revolve around not listening to target events while in a pagination prompt (doing anything else I think would be a much bigger change). The approach taken just removes the target from the event loop while within gdb_readline_wrapper. The other approach used gdb_select directly, with only input_fd installed, but that had the issue that it didn't handle the async signal handlers, and turned out to be a bit more code than the first version. gdb/ 2014-07-14 Pedro Alves <palves@redhat.com> PR gdb/17072 * top.c: Include "inf-loop.h". (struct gdb_readline_wrapper_cleanup) <target_is_async_orig>: New field. (gdb_readline_wrapper_cleanup): Make the target async again, if it was async before. (gdb_readline_wrapper): Store whether the target is async, and make it sync. gdb/testsuite/ 2014-07-14 Pedro Alves <palves@redhat.com> PR gdb/17072 * gdb.base/paginate-inferior-exit.c: New file. * gdb.base/paginate-inferior-exit.exp: New file.
2014-07-14 20:55:32 +02:00
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* top.c: Include "inf-loop.h".
(struct gdb_readline_wrapper_cleanup) <target_is_async_orig>: New
field.
(gdb_readline_wrapper_cleanup): Make the target async again, if it
was async before.
(gdb_readline_wrapper): Store whether the target is async, and
make it sync.
Background execution + pagination aborts readline/gdb If pagination occurs as result of output sent as response to a target event while the target is executing in the background, subsequent input aborts readline/gdb: $ gdb program ... (gdb) continue& Continuing. (gdb) ---Type <return> to continue, or q <return> to quit--- *return* ---Type <return> to continue, or q <return> to quit--- Breakpoint 2, after_sleep () at paginate-bg-execution.c:21 ---Type <return> to continue, or q <return> to quit--- 21 return; /* after sleep */ p 1 readline: readline_callback_read_char() called with no handler! *abort/SIGABRT* $ gdb_readline_wrapper_line removes the handler after a line is processed. Usually, we'll end up re-displaying the prompt, and that reinstalls the handler. But if the output is coming out of handling a stop event, we don't re-display the prompt, and nothing restores the handler. So the next input wakes up the event loop and calls into readline, which aborts. We should do better with the prompt handling while the target is running (I think we should coordinate with readline, and hide/redisplay it around output), but that's a more invasive change better done post 7.8, so this patch is conservative and just reinstalls the handler as soon as we're out of the readline line callback. gdb/ 2014-07-14 Pedro Alves <palves@redhat.com> PR gdb/17072 * top.c (gdb_readline_wrapper_line): Tweak comment. (gdb_readline_wrapper_cleanup): If readline is enabled, reinstall the input handler callback. gdb/testsuite/ 2014-07-14 Pedro Alves <palves@redhat.com> PR gdb/17072 * gdb.base/paginate-bg-execution.c: New file. * gdb.base/paginate-bg-execution.exp: New file.
2014-07-14 20:55:32 +02:00
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* top.c (gdb_readline_wrapper_line): Tweak comment.
(gdb_readline_wrapper_cleanup): If readline is enabled, reinstall
the input handler callback.
Canceling pagination caused by execution command from command line aborts readline/gdb This fixes: $ ./gdb program -ex "set height 2" -ex "start" ... Reading symbols from /home/pedro/gdb/tests/threads...done. ---Type <return> to continue, or q <return> to quit---^CQuit << ctrl-c triggers a Quit *type something* readline: readline_callback_read_char() called with no handler! Aborted $ Usually, if an error propagates all the way to the top level, we'll re-enable stdin, in case the command that was running was a synchronous command. That's done in the event loop's actual loop (event-loop.c:start_event_loop). However, if a foreground execution command is run before the event loop starts and throws, nothing is presently reenabling stdin, which leaves sync_execution set. When we do start the event loop, because sync_execution is still (mistakenly) set, display_gdb_prompt removes the readline input callback, even though stdin is registered in the event loop. Any input from here on results in readline aborting. Such commands are run through catch_command_errors, catch_command_errors_const, so add the tweak there. gdb/ 2014-07-14 Pedro Alves <palves@redhat.com> PR gdb/17072 * main.c: Include event-top.h. (handle_command_errors): New function. (catch_command_errors, catch_command_errors_const): Use it. gdb/testsuite/ 2014-07-14 Pedro Alves <palves@redhat.com> PR gdb/17072 * gdb.base/paginate-execution-startup.c: New file. * gdb.base/paginate-execution-startup.exp: New file. * lib/gdb.exp (pagination_prompt): New global. (default_gdb_spawn): New procedure, factored out from default_gdb_spawn. (default_gdb_start): Adjust to call default_gdb_spawn. (gdb_spawn): New procedure.
2014-07-14 20:55:31 +02:00
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* main.c: Include event-top.h.
(handle_command_errors): New function.
(catch_command_errors, catch_command_errors_const): Use it.
2014-07-14 Pedro Alves <palves@redhat.com>
* exceptions.c (catch_command_errors, catch_command_errors_const):
Moved to main.c.
* exceptions.h (catch_command_errors_ftype)
(catch_command_errors_const_ftype): Moved to main.c.
(catch_command_errors, catch_command_errors_const): Delete
declarations.
* main.c (catch_command_errors_ftype)
(catch_command_errors_const_ftype): Moved here from exceptions.h.
(catch_command_errors, catch_command_errors_const)): Moved here
from exceptions.c and make static.
2014-07-14 Pedro Alves <palves@redhat.com>
* exceptions.c (print_any_exception): Delete.
(catch_exceptions_with_msg): Use exception_print instead of
print_any_exception.
(catch_errors): Use exception_fprintf instead of
print_any_exception.
(catch_command_errors, catch_command_errors_const): Use
exception_print instead of print_any_exception.
Put the inferior's terminal settings in effect while running (fg) infcalls The "call" and "print" commands presently always run synchronously, in the foreground, but GDB currently forgets to put the inferior's terminal settings into effect while running them, on async-capable targets, resulting in: (gdb) print func () hello world Program received signal SIGTTOU, Stopped (tty output). 0x000000373bceb8d0 in __libc_tcdrain (fd=1) at ../sysdeps/unix/sysv/linux/tcdrain.c:29 29 return INLINE_SYSCALL (ioctl, 3, fd, TCSBRK, 1); The program being debugged was signaled while in a function called from GDB. GDB remains in the frame where the signal was received. To change this behavior use "set unwindonsignal on". Evaluation of the expression containing the function (func) will be abandoned. When the function is done executing, GDB will silently stop. (gdb) That's because target_terminal_inferior skips actually doing anything if running in the background, and, nothing is setting sync_execution while running infcalls: void target_terminal_inferior (void) { /* A background resume (``run&'') should leave GDB in control of the terminal. Use target_can_async_p, not target_is_async_p, since at this point the target is not async yet. However, if sync_execution is not set, we know it will become async prior to resume. */ if (target_can_async_p () && !sync_execution) return; This would best be all cleaned up by making GDB not even call target_terminal_inferior and try to pass the terminal to the inferior if running in the background, but that's a more invasive fix that is better done post-7.8. This was originally caught by a patch later in this series that makes catch_command_errors use exception_print instead of print_any_exception. Note that print_flush calls serial_drain_output while print_any_exception doesnt't have that bit. And, gdb.gdb/python-selftest.exp does: gdb_test "call catch_command_errors(execute_command, \"python print 5\", 0, RETURN_MASK_ALL)" \ "Python not initialized.* = 0" which without this fix results in SIGTTOU... gdb/ 2014-07-14 Pedro Alves <palves@redhat.com> * infcall.c (run_inferior_call): Set 'sync_execution' while running the inferior call. gdb/testsuite/ 2014-07-14 Pedro Alves <palves@redhat.com> * gdb.base/execution-termios.c: New file. * gdb.base/execution-termios.exp: New file.
2014-07-14 20:55:30 +02:00
2014-07-14 Pedro Alves <palves@redhat.com>
* infcall.c (run_inferior_call): Set 'sync_execution' while
running the inferior call.
2014-07-14 Pedro Alves <palves@redhat.com>
* value.c (value_contents_equal): Delete function.
* value.h (value_contents_equal): Delete declaration.
2014-07-14 Tom Tromey <tromey@redhat.com>
PR exp/17106:
* gdbtypes.c (is_dynamic_type_internal): New function, from
is_dynamic_type.
(is_dynamic_type): Rewrite.
(resolve_dynamic_union): Use resolve_dynamic_type_internal.
(resolve_dynamic_struct): Likewise.
(resolve_dynamic_type_internal): New function, from
resolve_dynamic_type.
(resolve_dynamic_type): Rewrite.
2014-07-14 Tom Tromey <tromey@redhat.com>
* target.c (target_require_runnable): Also check record_stratum.
Update comment.
Stop prologue analysis when past the epilogue We see a fail in gdb.trace/entry-values.exp on armv4t thumb, bt^M #0 0x000086fc in foo (i=0, i@entry=<optimized out>, j=2, j@entry=<optimized out>)^M #1 0x00000002 in ?? ()^M Backtrace stopped: previous frame identical to this frame (corrupt stack?)^M (gdb) FAIL: gdb.trace/entry-values.exp: bt (1) (pattern 1) The fail is caused by incorrect prologue analysis, which can be illustrated by setting a breakpoint on function foo, (gdb) disassemble foo Dump of assembler code for function foo: 0x000086e8 <+0>: push {r7, lr} 0x000086ea <+2>: sub sp, #8 0x000086ec <+4>: add r7, sp, #0 0x000086ee <+6>: str r0, [r7, #4] 0x000086f0 <+8>: str r1, [r7, #0] 0x000086f2 <+10>: movs r3, #0 0x000086f4 <+12>: adds r0, r3, #0 0x000086f6 <+14>: mov sp, r7 0x000086f8 <+16>: add sp, #8 0x000086fa <+18>: pop {r7} 0x000086fc <+20>: pop {r1} 0x000086fe <+22>: bx r1 End of assembler dump. (gdb) b foo Breakpoint 1 at 0x86fc As we can see, GDB analyzes the prologue and skip the prologue to the last instruction but one. The breakpoint is set within the epilogue, and GDB skips too many instruction for prologue. This patch teaches GDB to stop prologue analysis when goes into the epilogue. With this patch applied, GDB is able to unwind correctly, (gdb) bt #0 0x000086f6 in foo (i=0, i@entry=2, j=2, j@entry=3) #1 0x00008718 in bar (i=<optimized out>) #2 0x00008758 in main () gdb: 2014-07-11 Yao Qi <yao@codesourcery.com> * arm-tdep.c (thumb_analyze_prologue): Break the loop if thumb_instruction_restores_sp return true.
2014-07-02 09:16:26 +02:00
2014-07-11 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (thumb_analyze_prologue): Break the loop if
thumb_instruction_restores_sp return true.
2014-07-11 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (thumb_instruction_restores_sp): New function.
(thumb_in_function_epilogue_p): Call
thumb_instruction_restores_sp.
2014-07-11 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (thumb_analyze_prologue): Don't match instruction
'add sp, #imm'.
(thumb_in_function_epilogue_p): Don't match 'sub sp, #imm'.
2014-07-11 Gary Benson <gbenson@redhat.com>
* amd64-linux-nat.c (gdbcore.h): Remove include.
(regset.h): Likewise.
(nat/linux-btrace.h): Likewise.
(btrace.h): Likewise.
(gdb_assert.h): Likewise.
(string.h): Likewise.
(sys/uio.h): Likewise.
(sys/debugreg.h): Likewise.
(sys/syscall.h): Likewise.
(sys/procfs.h): Likewise.
(sys/user.h): Likewise.
(asm/ptrace.h): Likewise.
(i386-nat.h): Likewise.
* i386-linux-nat.c (i386-nat.h): Likewise.
(regset.h): Likewise.
(target.h): Likewise.
(linux-nat.h): Likewise.
(nat/linux-btrace.h): Likewise.
(btrace.h): Likewise.
(gdb_assert.h): Likewise.
(string.h): Likewise.
(sys/uio.h): Likewise.
(sys/user.h): Likewise.
(sys/procfs.h): Likewise.
(sys/reg.h): Likewise.
(sys/debugreg.h): Likewise.
(ORIG_EAX): Remove definition.
Move duplicated code into new files This commit moves the duplicated code in {i386,amd64}-linux-nat.c into the new files x86-linux-nat.[ch]. Additionally, a new file i386-linux-nat.h was required to expose a value required by the 32-bit code in x86-linux-nat.c. gdb/ 2014-07-11 Gary Benson <gbenson@redhat.com> * i386-linux-nat.h: New file. * x86-linux-nat.h: Likewise. * x86-linux-nat.c: Likewise. * Makefile.in (HFILES_NO_SRCDIR): Add the above new headers. * config/i386/linux.mh (NATDEPFILES): Add x86-linux-nat.o. * config/i386/linux64.mh (NATDEPFILES): Likewise. * amd64-linux-nat.c (x86-linux-nat.h): New include. (PTRACE_GETREGSET): Now in x86-linux-nat.h. (PTRACE_SETREGSET): Likewise. (arch_lwp_info): Now in x86-linux-nat.c. (have_ptrace_getregset): Now in x86-linux-nat.h. (x86_linux_dr_get): Now in x86-linux-nat.c. (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_prepare_to_resume): Likewise. (x86_linux_new_thread): Likewise. (x86_linux_new_fork): Likewise. (x86_linux_get_thread_area): Likewise. (super_post_startup_inferior): Likewise. (x86_linux_child_post_startup_inferior): Likewise. (AMD64_LINUX_USER64_CS): Likewise. (AMD64_LINUX_X32_DS): Likewise. (x86_linux_read_description): Likewise. (x86_linux_enable_btrace): Likewise. (x86_linux_disable_btrace): Likewise. (x86_linux_teardown_btrace): Likewise. (x86_linux_read_btrace): Likewise. (x86_linux_create_target): Likewise. (x86_linux_add_target): Likewise. * i386-linux-nat.c (x86-linux-nat.h): New include. (PTRACE_GETREGSET): Now in x86-linux-nat.h. (PTRACE_SETREGSET): Likewise. (arch_lwp_info): Now in x86-linux-nat.c. (have_ptrace_getregset): Now in x86-linux-nat.h. (x86_linux_dr_get): Now in x86-linux-nat.c. (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_prepare_to_resume): Likewise. (x86_linux_new_thread): Likewise. (x86_linux_new_fork): Likewise. (x86_linux_get_thread_area): Likewise. (super_post_startup_inferior): Likewise. (x86_linux_child_post_startup_inferior): Likewise. (AMD64_LINUX_USER64_CS): Likewise. (AMD64_LINUX_X32_DS): Likewise. (x86_linux_read_description): Likewise. (x86_linux_enable_btrace): Likewise. (x86_linux_disable_btrace): Likewise. (x86_linux_teardown_btrace): Likewise. (x86_linux_read_btrace): Likewise. (x86_linux_create_target): Likewise. (x86_linux_add_target): Likewise.
2014-07-10 16:43:56 +02:00
2014-07-11 Gary Benson <gbenson@redhat.com>
* i386-linux-nat.h: New file.
* x86-linux-nat.h: Likewise.
* x86-linux-nat.c: Likewise.
* Makefile.in (HFILES_NO_SRCDIR): Add the above new headers.
* config/i386/linux.mh (NATDEPFILES): Add x86-linux-nat.o.
* config/i386/linux64.mh (NATDEPFILES): Likewise.
* amd64-linux-nat.c (x86-linux-nat.h): New include.
(PTRACE_GETREGSET): Now in x86-linux-nat.h.
(PTRACE_SETREGSET): Likewise.
(arch_lwp_info): Now in x86-linux-nat.c.
(have_ptrace_getregset): Now in x86-linux-nat.h.
(x86_linux_dr_get): Now in x86-linux-nat.c.
(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_prepare_to_resume): Likewise.
(x86_linux_new_thread): Likewise.
(x86_linux_new_fork): Likewise.
(x86_linux_get_thread_area): Likewise.
(super_post_startup_inferior): Likewise.
(x86_linux_child_post_startup_inferior): Likewise.
(AMD64_LINUX_USER64_CS): Likewise.
(AMD64_LINUX_X32_DS): Likewise.
(x86_linux_read_description): Likewise.
(x86_linux_enable_btrace): Likewise.
(x86_linux_disable_btrace): Likewise.
(x86_linux_teardown_btrace): Likewise.
(x86_linux_read_btrace): Likewise.
(x86_linux_create_target): Likewise.
(x86_linux_add_target): Likewise.
* i386-linux-nat.c (x86-linux-nat.h): New include.
(PTRACE_GETREGSET): Now in x86-linux-nat.h.
(PTRACE_SETREGSET): Likewise.
(arch_lwp_info): Now in x86-linux-nat.c.
(have_ptrace_getregset): Now in x86-linux-nat.h.
(x86_linux_dr_get): Now in x86-linux-nat.c.
(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_prepare_to_resume): Likewise.
(x86_linux_new_thread): Likewise.
(x86_linux_new_fork): Likewise.
(x86_linux_get_thread_area): Likewise.
(super_post_startup_inferior): Likewise.
(x86_linux_child_post_startup_inferior): Likewise.
(AMD64_LINUX_USER64_CS): Likewise.
(AMD64_LINUX_X32_DS): Likewise.
(x86_linux_read_description): Likewise.
(x86_linux_enable_btrace): Likewise.
(x86_linux_disable_btrace): Likewise.
(x86_linux_teardown_btrace): Likewise.
(x86_linux_read_btrace): Likewise.
(x86_linux_create_target): Likewise.
(x86_linux_add_target): Likewise.
2014-07-11 Gary Benson <gbenson@redhat.com>
* amd64-linux-nat.c: Comment and whitespace changes.
* i386-linux-nat.c: Comment and whitespace changes.
2014-07-11 Gary Benson <gbenson@redhat.com>
* amd64-linux-nat.c (x86_linux_create_target): New function.
(x86_linux_add_target): Likewise.
(_initialize_amd64_linux_nat): Delegate to the above new functions.
* i386-linux-nat.c (x86_linux_create_target): New function.
(x86_linux_add_target): Likewise.
(_initialize_i386_linux_nat): Delegate to the above new functions.
2014-07-11 Gary Benson <gbenson@redhat.com>
* amd64-linux-nat.c (x86_linux_get_thread_area): New function.
(ps_get_thread_area): Delegate to the above in 32-bit mode.
* i386-linux-nat.c (x86_linux_get_thread_area): New function.
(ps_get_thread_area): Delegate to the above.
2014-07-11 Gary Benson <gbenson@redhat.com>
* amd64-linux-nat.c (amd64_linux_read_description): Renamed to
x86_linux_read_description. All uses updated. amd64-specific
code conditionalized. Conditionalized i386-specific code added.
Redundant cast removed.
* i386-linux-nat.c (i386_linux_read_description): Renamed to
x86_linux_read_description. All uses updated. i386-specific
code conditionalized. Conditionalized amd64-specific code added.
One sizeof replaced with the actual type it is describing.
Rename identical functions amd64-linux-nat.c and i386-linux-nat.c contain a number of functions which are identical but for prefix on their names. This commit renames all such functions to have the prefix x86_ instead of the prefixes amd64_ or i386_ and updates all uses of those functions. The now-identical x86_ functions will be pulled out to a separate shared file in a later commit. gdb/ 2014-07-11 Gary Benson <gbenson@redhat.com> * amd64-linux-nat.c (amd64_linux_dr_get): Renamed to x86_linux_dr_get. All uses updated. (amd64_linux_dr_set): Renamed to x86_linux_dr_set. All uses updated. (amd64_linux_dr_get_addr): Renamed to x86_linux_dr_get_addr. All uses updated. (amd64_linux_dr_get_control): Renamed to x86_linux_dr_get_control. All uses updated. (amd64_linux_dr_get_status): Renamed to x86_linux_dr_get_status. All uses updated. (amd64_linux_dr_set_control): Renamed to x86_linux_dr_set_control. All uses updated. (amd64_linux_dr_set_addr): Renamed to x86_linux_dr_set_addr. All uses updated. (amd64_linux_prepare_to_resume): Renamed to x86_linux_prepare_to_resume. All uses updated. (amd64_linux_new_thread): Renamed to x86_linux_new_thread. All uses updated. (amd64_linux_new_fork): Renamed to x86_linux_new_fork. All uses updated. (amd64_linux_child_post_startup_inferior): Renamed to x86_linux_child_post_startup_inferior. All uses updated. (amd64_linux_enable_btrace): Renamed to x86_linux_enable_btrace. All uses updated. (amd64_linux_disable_btrace): Renamed to x86_linux_disable_btrace. All uses updated. (amd64_linux_teardown_btrace): Renamed to x86_linux_teardown_btrace. All uses updated. (amd64_linux_read_btrace): Renamed to x86_linux_read_btrace. All uses updated. * i386-linux-nat.c (i386_linux_dr_get): Renamed to x86_linux_dr_get. All uses updated. (i386_linux_dr_set): Renamed to x86_linux_dr_set. All uses updated. (i386_linux_dr_get_addr): Renamed to x86_linux_dr_get_addr. All uses updated. (i386_linux_dr_get_control): Renamed to x86_linux_dr_get_control. All uses updated. (i386_linux_dr_get_status): Renamed to x86_linux_dr_get_status. All uses updated. (i386_linux_dr_set_control): Renamed to x86_linux_dr_set_control. All uses updated. (i386_linux_dr_set_addr): Renamed to x86_linux_dr_set_addr. All uses updated. (i386_linux_prepare_to_resume): Renamed to x86_linux_prepare_to_resume. All uses updated. (i386_linux_new_thread): Renamed to x86_linux_new_thread. All uses updated. (i386_linux_new_fork): Renamed to x86_linux_new_fork. All uses updated. (i386_linux_child_post_startup_inferior): Renamed to x86_linux_child_post_startup_inferior. All uses updated. (i386_linux_enable_btrace): Renamed to x86_linux_enable_btrace. All uses updated. (i386_linux_disable_btrace): Renamed to x86_linux_disable_btrace. All uses updated. (i386_linux_teardown_btrace): Renamed to x86_linux_teardown_btrace. All uses updated. (i386_linux_read_btrace): Renamed to x86_linux_read_btrace. All uses updated.
2014-06-24 11:07:12 +02:00
2014-07-11 Gary Benson <gbenson@redhat.com>
* amd64-linux-nat.c (amd64_linux_dr_get): Renamed to
x86_linux_dr_get. All uses updated.
(amd64_linux_dr_set): Renamed to
x86_linux_dr_set. All uses updated.
(amd64_linux_dr_get_addr): Renamed to
x86_linux_dr_get_addr. All uses updated.
(amd64_linux_dr_get_control): Renamed to
x86_linux_dr_get_control. All uses updated.
(amd64_linux_dr_get_status): Renamed to
x86_linux_dr_get_status. All uses updated.
(amd64_linux_dr_set_control): Renamed to
x86_linux_dr_set_control. All uses updated.
(amd64_linux_dr_set_addr): Renamed to
x86_linux_dr_set_addr. All uses updated.
(amd64_linux_prepare_to_resume): Renamed to
x86_linux_prepare_to_resume. All uses updated.
(amd64_linux_new_thread): Renamed to
x86_linux_new_thread. All uses updated.
(amd64_linux_new_fork): Renamed to
x86_linux_new_fork. All uses updated.
(amd64_linux_child_post_startup_inferior): Renamed to
x86_linux_child_post_startup_inferior. All uses updated.
(amd64_linux_enable_btrace): Renamed to
x86_linux_enable_btrace. All uses updated.
(amd64_linux_disable_btrace): Renamed to
x86_linux_disable_btrace. All uses updated.
(amd64_linux_teardown_btrace): Renamed to
x86_linux_teardown_btrace. All uses updated.
(amd64_linux_read_btrace): Renamed to
x86_linux_read_btrace. All uses updated.
* i386-linux-nat.c (i386_linux_dr_get): Renamed to
x86_linux_dr_get. All uses updated.
(i386_linux_dr_set): Renamed to
x86_linux_dr_set. All uses updated.
(i386_linux_dr_get_addr): Renamed to
x86_linux_dr_get_addr. All uses updated.
(i386_linux_dr_get_control): Renamed to
x86_linux_dr_get_control. All uses updated.
(i386_linux_dr_get_status): Renamed to
x86_linux_dr_get_status. All uses updated.
(i386_linux_dr_set_control): Renamed to
x86_linux_dr_set_control. All uses updated.
(i386_linux_dr_set_addr): Renamed to
x86_linux_dr_set_addr. All uses updated.
(i386_linux_prepare_to_resume): Renamed to
x86_linux_prepare_to_resume. All uses updated.
(i386_linux_new_thread): Renamed to
x86_linux_new_thread. All uses updated.
(i386_linux_new_fork): Renamed to
x86_linux_new_fork. All uses updated.
(i386_linux_child_post_startup_inferior): Renamed to
x86_linux_child_post_startup_inferior. All uses updated.
(i386_linux_enable_btrace): Renamed to
x86_linux_enable_btrace. All uses updated.
(i386_linux_disable_btrace): Renamed to
x86_linux_disable_btrace. All uses updated.
(i386_linux_teardown_btrace): Renamed to
x86_linux_teardown_btrace. All uses updated.
(i386_linux_read_btrace): Renamed to
x86_linux_read_btrace. All uses updated.
2014-07-11 Adrian Sendroiu <adrian.sendroiu@freescale.com>
* remote.c (extended_remote_post_attach): New function.
(init_extended_remote_ops): Install it as to_post_attach method.
2014-07-09 Pedro Alves <palves@redhat.com>
* infcmd.c (attach_command_post_wait): Don't call
target_terminal_inferior here.
(attach_command): Call it here instead.
Improve MI -var-info-path-expression for nested struct/union case. https://sourceware.org/ml/gdb-patches/2014-05/msg00383.html The MI command -var-info-path-expression currently does not handle non-anonymous structs / unions nested within other structs / unions, it will skip parts of the expression. Consider this example: ## START EXAMPLE ## $ cat ex.c #include <string.h> int main () { struct s1 { int a; }; struct ss { struct s1 x; }; struct ss an_ss; memset (&an_ss, 0, sizeof (an_ss)); return 0; } $ gcc -g -o ex.x ex.c $ gdb ex.x (gdb) break 18 Breakpoint 1 at 0x80483ba: file ex.c, line 18. (gdb) run Starting program: /home/user/ex.x Breakpoint 1, main () at ex.c:18 18 return 0; (gdb) interpreter-exec mi "-var-create an_ss * an_ss" (gdb) interpreter-exec mi "-var-list-children an_ss" ^done,numchild="1",children=[child={name="an_ss.x",exp="x",numchild="1",type="struct s1",thread-id="1"}],has_more="0" (gdb) interpreter-exec mi "-var-list-children an_ss.x" ^done,numchild="1",children=[child={name="an_ss.x.a",exp="a",numchild="0",type="int",thread-id="1"}],has_more="0" (gdb) interpreter-exec mi "-var-list-children an_ss.x.a" ^done,numchild="0",has_more="0" (gdb) interpreter-exec mi "-var-info-path-expression an_ss.x.a" ^done,path_expr="(an_ss).a" (gdb) print (an_ss).a There is no member named a. ## END EXAMPLE ## Notice that the path expression returned is wrong, and as a result the print command fails. This patch adds a new method to the varobj_ops structure called is_path_expr_parent, to allow language specific control over finding the parent varobj, the current logic becomes the C/C++ version and is extended to handle the nested cases. No other language currently uses this code, so all other languages just get a default method. With this patch, the above example now finishes like this: ## START EXAMPLE ## $ gdb ex.x (gdb) break 18 Breakpoint 1 at 0x80483ba: file ex.c, line 18. (gdb) run Starting program: /home/user/ex.x Breakpoint 1, main () at ex.c:18 18 return 0; (gdb) interpreter-exec mi "-var-list-children an_ss" ^done,numchild="1",children=[child={name="an_ss.x",exp="x",numchild="1",type="struct s1",thread-id="1"}],has_more="0" (gdb) interpreter-exec mi "-var-list-children an_ss.x" ^done,numchild="1",children=[child={name="an_ss.x.a",exp="a",numchild="0",type="int",thread-id="1"}],has_more="0" (gdb) interpreter-exec mi "-var-list-children an_ss.x.a" ^done,numchild="0",has_more="0" (gdb) interpreter-exec mi "-var-info-path-expression an_ss.x.a" ^done,path_expr="((an_ss).x).a" (gdb) print ((an_ss).x).a $1 = 0 ## END EXAMPLE ## Notice that the path expression is now correct, and the print is a success. gdb/ChangeLog: * ada-varobj.c (ada_varobj_ops): Fill in is_path_expr_parent field. * c-varobj.c (c_is_path_expr_parent): New function, moved core from varobj.c, with additional checks. (c_varobj_ops): Fill in is_path_expr_parent field. (cplus_varobj_ops): Fill in is_path_expr_parent field. * jv-varobj.c (java_varobj_ops): Fill in is_path_expr_parent field. * varobj.c (is_path_expr_parent): Call is_path_expr_parent varobj ops method. (varobj_default_is_path_expr_parent): New function. * varobj.h (lang_varobj_ops): Add is_path_expr_parent field. (varobj_default_is_path_expr_parent): Declare new function. gdb/testsuite/ChangeLog: * gdb.mi/var-cmd.c (do_nested_struct_union_tests): New function setting up test structures. (main): Call new test function. * gdb.mi/mi2-var-child.exp: Create additional breakpoint in new test function, continue into test function and walk test structures.
2014-07-07 20:22:36 +02:00
2014-07-09 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-varobj.c (ada_varobj_ops): Fill in is_path_expr_parent
field.
* c-varobj.c (c_is_path_expr_parent): New function, moved core
from varobj.c, with additional checks.
(c_varobj_ops): Fill in is_path_expr_parent field.
(cplus_varobj_ops): Fill in is_path_expr_parent field.
* jv-varobj.c (java_varobj_ops): Fill in is_path_expr_parent
field.
* varobj.c (is_path_expr_parent): Call is_path_expr_parent varobj
ops method.
(varobj_default_is_path_expr_parent): New function.
* varobj.h (lang_varobj_ops): Add is_path_expr_parent field.
(varobj_default_is_path_expr_parent): Declare new function.
2014-07-08 Markus Metzger <markus.t.metzger@intel.com>
* infcmd.c (finish_backward): Turn internal error into normal error.
2014-07-07 Pedro Alves <palves@redhat.com>
2014-07-07 20:05:04 +02:00
PR gdb/17096
* remote.c (async_handle_remote_sigint)
(async_handle_remote_sigint_twice): Call
gdb_call_async_signal_handler instead of
mark_async_signal_handler.
2014-07-07 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_info_record): Remove.
* record.c (info_record_command): Unconditionally call
to_info_record.
* target.h (struct target_ops) <to_info_record>: Use
TARGET_DEFAULT_IGNORE.
(target_info_record): Remove.
2014-07-07 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_get_thread_local_address>: Use
TARGET_DEFAULT_NORETURN.
* target.c (generic_tls_error): New function.
(target_translate_tls_address): Don't search target stack.
* target-delegates.c: Rebuild.
* ppc-linux-tdep.c (ppc_linux_spe_context): Don't search target
stack.
* linux-thread-db.c (thread_db_get_thread_local_address):
Unconditionally call beneath target.
2014-07-03 Marc Khouzam <marc.khouzam@ericsson.com>
* cli/cli-logging.c (pop_output_files): Assign targerr to
gdb_stdtargerr.
2014-07-03 Andrew Burgess <andrew.burgess@embecosm.com>
* MAINTAINERS (Write After Approval): Update my email address.
2014-07-02 Gary Benson <gbenson@redhat.com>
* proc-service.c (ps_xfer_memory): Update comment.
(ps_pstop): Remove unused function.
(ps_pcontinue): Likewise.
(ps_lstop): Likewise.
(ps_lcontinue): Likewise.
(ps_lgetxregsize): Likewise.
(ps_lgetxregs): Likewise.
(ps_lsetxregs): Likewise.
(ps_plog): Likewise.
(ps_ptread): Likewise.
(ps_ptwrite): Likewise.
2014-07-01 Mark Wielaard <mjw@redhat.com>
* dwarf2read.c (add_array_cv_type): New function.
(read_tag_const_type): Call add_array_cv_type for TYPE_CODE_ARRAY.
(read_tag_volatile_type): Likewise.
2014-07-01 Tom Tromey <tromey@redhat.com>
* breakpoint.c (add_catch_command): Use cmd_sfunc_ftype.
* breakpoint.h (add_catch_command): Use cmd_sfunc_ftype.
* cli/cli-decode.c (cmd_cfunc_eq, add_cmd, add_prefix_cmd)
(add_abbrev_prefix_cmd, add_info, add_com): Use cmd_cfunc_ftype.
* command.h (cmd_cfunc_ftype): Move earlier.
(add_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, cmd_cfunc_eq)
(add_com, add_info): Use cmd_cfunc_ftype.
2014-06-30 Tom Tromey <tromey@redhat.com>
* symtab.c (operator_chars): Make parameters and return type
const.
(file_matches): Make "files" const.
(struct search_symbols_data) <files>: Now const.
(search_symbols): Make "regexp" and "files" parameters const.
Update.
(symtab_symbol_info): Remove cast.
(rbreak_command): Update.
* symtab.h (search_symbols): Update.
Associate dummy_frame with ptid This patch is to add ptid into dummy_frame and extend frame_id to dummy_frame_id (which has a ptid field). With this change, GDB uses dummy_frame_id (thread ptid and frame_id) to find the dummy frames. Currently, dummy frames are looked up by frame_id, which isn't accurate in non-stop or multi-process mode. The test case gdb.multi/dummy-frame-restore.exp shows the problem and this patch can fix it. Test dummy-frame-restore.exp makes two inferiors stop at different functions, say, inferior 1 stops at f1 while inferior 2 stops at f2. Set a breakpoint to a function, do the inferior call in two inferiors, and GDB has two dummy frames of the same frame_id. When the inferior call is finished, GDB will look up a dummy frame from its stack/list and restore the inferior's regcache. Two inferiors are finished in different orders, the inferiors' states are restored differently, which is wrong. Running dummy-frame-restore.exp under un-patched GDB, we'll get two fails: FAIL: gdb.multi/dummy-frame-restore.exp: inf 2 first: after infcall: bt in inferior 2 FAIL: gdb.multi/dummy-frame-restore.exp: inf 2 first: after infcall: bt in inferior 1 With this patch applied, GDB will choose the correct dummy_frame to restore for a given inferior, because ptid is considered when looking up dummy frames. Two fails above are fixed. Regression tested on x86_64-linux, both native and gdbserver. gdb: 2014-06-27 Yao Qi <yao@codesourcery.com> * breakpoint.c (check_longjmp_breakpoint_for_call_dummy): Change parameter type to 'struct thread_info *'. Caller updated. * breakpoint.h (check_longjmp_breakpoint_for_call_dummy): Update declaration. * dummy-frame.c (struct dummy_frame_id): New. (dummy_frame_id_eq): New function. (struct dummy_frame) <id>: Change its type to 'struct dummy_frame_id'. (dummy_frame_push): Add parameter ptid and save it in dummy_frame_id. (pop_dummy_frame_bpt): Use ptid of dummy_frame instead of inferior_ptid. (pop_dummy_frame): Assert that the ptid of dummy_frame equals to inferior_ptid. (lookup_dummy_frame): Change parameter type to 'struct dummy_frame_id *'. Callers updated. Call dummy_frame_id_eq instead of frame_id_eq. (dummy_frame_pop): Add parameter ptid. Callers updated. Update comments. Compose dummy_frame_id and pass it to lookup_dummy_frame. (dummy_frame_discard): Add parameter ptid. (dummy_frame_sniffer): Compose dummy_frame_id and call dummy_frame_id_eq instead of frame_id_eq. (fprint_dummy_frames): Print ptid. * dummy-frame.h: Remove comments. (dummy_frame_push): Add ptid in declaration. (dummy_frame_pop, dummy_frame_discard): Likewise. gdb/testsuite: 2014-06-27 Yao Qi <yao@codesourcery.com> * gdb.multi/dummy-frame-restore.exp: New. * gdb.multi/dummy-frame-restore.c: New. gdb/doc: 2014-06-27 Yao Qi <yao@codesourcery.com> * gdb.texinfo (Maintenance Commands): Update the output of 'maint print dummy-frames' command.
2014-06-25 05:52:52 +02:00
2014-06-27 Yao Qi <yao@codesourcery.com>
* breakpoint.c (check_longjmp_breakpoint_for_call_dummy):
Change parameter type to 'struct thread_info *'. Caller
updated.
* breakpoint.h (check_longjmp_breakpoint_for_call_dummy):
Update declaration.
* dummy-frame.c (struct dummy_frame_id): New.
(dummy_frame_id_eq): New function.
(struct dummy_frame) <id>: Change its type to 'struct
dummy_frame_id'.
(dummy_frame_push): Add parameter ptid and save it in
dummy_frame_id.
(pop_dummy_frame_bpt): Use ptid of dummy_frame instead of
inferior_ptid.
(pop_dummy_frame): Assert that the ptid of dummy_frame equals
to inferior_ptid.
(lookup_dummy_frame): Change parameter type to 'struct
dummy_frame_id *'. Callers updated. Call dummy_frame_id_eq
instead of frame_id_eq.
(dummy_frame_pop): Add parameter ptid. Callers updated.
Update comments. Compose dummy_frame_id and pass it to
lookup_dummy_frame.
(dummy_frame_discard): Add parameter ptid.
(dummy_frame_sniffer): Compose dummy_frame_id and call
dummy_frame_id_eq instead of frame_id_eq.
(fprint_dummy_frames): Print ptid.
* dummy-frame.h: Remove comments.
(dummy_frame_push): Add ptid in declaration.
(dummy_frame_pop, dummy_frame_discard): Likewise.
2014-06-26 Tom Tromey <tromey@redhat.com>
* cli/cli-cmds.c (error_no_arg): Make "why" const.
* command.h (error_no_arg): Update.
2014-06-26 Tom Tromey <tromey@redhat.com>
* cli/cli-setshow.c (do_set_command): Make "arg" const.
(do_show_command): Make "arg" const.
* cli/cli-setshow.h (do_set_command, do_show_command): Update.
2014-06-26 Tom Tromey <tromey@redhat.com>
* record-full.c (record_full_get_bookmark): Make "args" const.
(record_full_goto_bookmark): Make "raw_bookmark" const.
* record.c (record_goto): New function.
(cmd_record_goto): Use it. Now static.
* record.h (record_goto): Declare.
(cmd_record_goto): Remove declaration.
* target-delegates.c: Rebuild.
* target.h (struct target_ops) <to_get_bookmark,
to_goto_bookmark>: Make parameter const.
2014-06-26 Tom Tromey <tromey@redhat.com>
* defs.h (generic_load): Update.
* m32r-rom.c (m32r_load_gen): Make "filename" const.
* monitor.c (monitor_load): Make "args" const.
* remote-m32r-sdi.c (m32r_load): Make "args" const.
* remote-mips.c (mips_load_srec, pmon_load_fast): Make "args"
const.
(mips_load): Make "file" const.
* remote-sim.c (gdbsim_load): Make "args" const.
* remote.c (remote_load): Make "name" const.
* symfile.c (generic_load): Make "args" const.
* target-delegates.c: Rebuild.
* target.c (target_load): Make "arg" const.
(debug_to_load): Make "args" const.
* target.h (struct target_ops) <to_load>: Make parameter const.
(target_load): Update.
2014-06-26 Tom Tromey <tromey@redhat.com>
PR symtab/16902:
* dwarf2read.c (fixup_go_packaging, dwarf2_compute_name)
(dwarf2_physname, read_partial_die)
(guess_partial_die_structure_name, fixup_partial_die)
(guess_full_die_structure_name, anonymous_struct_prefix)
(dwarf2_name): Use per-BFD obstack.
2014-06-26 Yao Qi <yao@codesourcery.com>
* dummy-frame.c (dummy_frame_sniffer): Move local variables
dummyframe and this_id into inner block below.
2014-06-26 Yao Qi <yao@codesourcery.com>
* infrun.c (_initialize_infrun): Replace "signal_program[0]"
with "signal_pass[0]" in the initialization of signal_pass.
2014-06-25 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_generating_corefile)
(record_btrace_prepare_to_generate_core)
(record_btrace_done_generating_core): New.
(record_btrace_xfer_partial, record_btrace_fetch_registers)
(record_btrace_store_registers, record_btrace_prepare_to_store):
Forward request when generating a core file.
(record_btrace_open): Set record_btrace_generating_corefile to zero.
(init_record_btrace_ops): Set to_prepare_to_generate_core and
to_done_generating_core.
2014-06-25 Markus Metzger <markus.t.metzger@intel.com>
* target.h (target_ops) <to_prepare_to_generate_core>
<to_done_generating_core>: New.
(target_prepare_to_generate_core, target_done_generating_core): New.
* target.c (target_prepare_to_generate_core)
(target_done_generating_core): New.
* target-delegates.c: Regenerate.
* gcore.c: (write_gcore_file): Rename to ...
(write_gcore_file_1): ...this.
(write_gcore_file): Call target_prepare_to_generate_core
and target_done_generating_core.
2014-06-25 Markus Metzger <markus.t.metzger@intel.com>
* fbsd-nat.c (fbsd_make_corefile_notes): Remove make_cleanup call.
* gcore.c (write_gcore_file): Free memory returned from
make_corefile_notes.
* linux-tdep.c (linux_make_corefile_notes): Remove make_cleanup call.
* procfs.c (procfs_make_note_section): Remove make_cleanup call.
2014-06-24 Yao Qi <yao@codesourcery.com>
* arm-linux-tdep.c (arm_linux_skip_trampoline_code): New.
(arm_linux_init_abi): Set skip_trampoline_code with
gdbarch_skip_trampoline_code instead of
find_solib_trampoline_target.
2014-06-24 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_stub_unwind_sniffer): Return 1 if
arm_skip_bx_reg returns non-zero.
2014-06-24 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_skip_bx_reg): New function.
(arm_skip_stub): Call arm_skip_bx_reg.
2014-06-23 Don Breazeal <donb@codesourcery.com>
* MAINTAINERS: Add myself as write-after-approval maintainer.
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>
* 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.
2014-06-23 Siva Chandra Reddy <sivachandra@google.com>
* python/lib/gdb/command/xmethods.py
(get_method_matchers_in_loci): Lookup xmethod matchers in the
current progspace only if the string "progspace" matches LOCUS_RE.
Fix --with-system-readline with readline-6.3 patch 5 I have filed now: --with-system-readline uses bundled readline include files https://sourceware.org/bugzilla/show_bug.cgi?id=17077 To see any effect of the patch below you have to do: rm -rf readline Otherwise readline include files get used the bundled ones from GDB which are currently 6.2 while system readline may be 6.3 already. You also have to use system readline-6.3 including its upstream patch: [Bug-readline] Readline-6.3 Official Patch 5 http://lists.gnu.org/archive/html/bug-readline/2014-04/msg00018.html Message-ID: <140415125618.AA57598.SM@caleb.ins.cwru.edu> In short it happens on Fedora Rawhide since: readline-6.3-1.fc21 https://koji.fedoraproject.org/koji/buildinfo?buildID=538941 The error is: ../../gdb/tui/tui-io.c:132:1: error: 'Function' is deprecated [-Werror=deprecated-declarations] static Function *tui_old_rl_getc_function; ^ ../../gdb/tui/tui-io.c:133:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations] static VFunction *tui_old_rl_redisplay_function; ^ ../../gdb/tui/tui-io.c:134:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations] static VFunction *tui_old_rl_prep_terminal; ^ ../../gdb/tui/tui-io.c:135:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations] static VFunction *tui_old_rl_deprep_terminal; ^ It is since bash change: lib/readline/rltypedefs.h - remove old Function/VFunction/CPFunction/CPPFunction typedefs as suggested by Tom Tromey <tromey@redhat.com> The new typedefs used below are present in readline/rltypedefs.h since: git://git.savannah.gnu.org/bash.git commit 28ef6c316f1aff914bb95ac09787a3c83c1815fd Date: Fri Apr 6 19:14:31 2001 +0000 gdb/ 2014-06-20 Jan Kratochvil <jan.kratochvil@redhat.com> Fix --with-system-readline with readline-6.3 patch 5. * tui/tui-io.c (tui_old_rl_getc_function, tui_old_rl_redisplay_function) (tui_old_rl_prep_terminal, tui_old_rl_deprep_terminal): Use rl_*_t types. Message-ID: <20140620105004.GA22236@host2.jankratochvil.net>
2014-06-20 17:43:56 +02:00
2014-06-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix --with-system-readline with readline-6.3 patch 5.
* tui/tui-io.c (tui_old_rl_getc_function, tui_old_rl_redisplay_function)
(tui_old_rl_prep_terminal, tui_old_rl_deprep_terminal): Use rl_*_t
types.
2014-06-20 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (dw2_get_real_path): Use correct type in
OBSTACK_CALLOC.
* gdb_obstack.h (OBSTACK_ZALLOC, OBSTACK_CALLOC): Cast result.
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>
* 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.
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-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.
2014-06-19 Iain Buclaw <ibuclaw@gdcproject.org>
* Makefile.in (SFILES): Add d-exp.y.
(YYFILES): Add d-exp.c.
(YYOBJ): Add d-exp.o.
(local-maintainer-clean): Delete d-exp.c.
* d-exp.y: New file.
* d-lang.h (d_parse): New declaration.
(d_error): New declaration.
* d-lang.c (d_op_print_tab): Add entry for BINOP_CONCAT and BINOP_EXP.
Set BINOP_EQUAL and BINOP_NOTEQUAL to same precedence as other
PREC_ORDER operators.
(d_language_defn): Use d_parse, d_error instead of c_parse, c_error.
2014-06-19 Yao Qi <yao@codesourcery.com>
* gdbthread.h (any_running): Remove the declaration.
* thread.c (any_running): Remove.
2014-06-19 Yao Qi <yao@codesourcery.com>
* gdbthread.h (struct thread_info) <state>: Change its type to
'enum thread_state'. Update comments.
Fix next over threaded execl with "set scheduler-locking step". Running gdb.threads/thread-execl.exp with scheduler-locking set to "step" reveals a problem: (gdb) next^M [Thread 0x7ffff7fda700 (LWP 27168) exited]^M [New LWP 27168]^M [Thread 0x7ffff74ee700 (LWP 27174) exited]^M process 27168 is executing new program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.threads/thread-execl^M [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M infrun.c:5225: internal-error: switch_back_to_stepped_thread: Assertion `!schedlock_applies (1)' 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.threads/thread-execl.exp: schedlock step: get to main in new image (GDB internal error) The assertion is correct. The issue is that GDB is mistakenly trying to switch back to an exited thread, that was previously stepping when it exited. This is exactly the sort of thing the test wants to make sure doesn't happen: # Now set a breakpoint at `main', and step over the execl call. The # breakpoint at main should be reached. GDB should not try to revert # back to the old thread from the old image and resume stepping it We don't see this bug with schedlock off only because a different sequence of events makes GDB manage to delete the thread instead of marking it exited. This particular internal error can be fixed by making the loop over all threads in switch_back_to_stepped_thread skip exited threads. But, looking over other ALL_THREADS users, all either can or should be skipping exited threads too. So for simplicity, this patch replaces ALL_THREADS with a new macro that skips exited threads itself, and updates everything to use it. Tested on x86_64 Fedora 20. gdb/ 2014-06-19 Pedro Alves <palves@redhat.com> * gdbthread.h (ALL_THREADS): Delete. (ALL_NON_EXITED_THREADS): New macro. * btrace.c (btrace_free_objfile): Use ALL_NON_EXITED_THREADS instead of ALL_THREADS. * infrun.c (find_thread_needs_step_over) (switch_back_to_stepped_thread): Use ALL_NON_EXITED_THREADS instead of ALL_THREADS. * record-btrace.c (record_btrace_open) (record_btrace_stop_recording, record_btrace_close) (record_btrace_is_replaying, record_btrace_resume) (record_btrace_find_thread_to_move, record_btrace_wait): Likewise. * remote.c (append_pending_thread_resumptions): Likewise. * thread.c (thread_apply_all_command): Likewise. gdb/testsuite/ 2014-06-19 Pedro Alves <palves@redhat.com> * gdb.threads/thread-execl.exp (do_test): New procedure, factored out from ... (top level): ... here. Iterate running tests under different scheduler-locking settings.
2014-06-19 12:59:03 +02:00
2014-06-19 Pedro Alves <palves@redhat.com>
* gdbthread.h (ALL_THREADS): Delete.
(ALL_NON_EXITED_THREADS): New macro.
* btrace.c (btrace_free_objfile): Use ALL_NON_EXITED_THREADS
instead of ALL_THREADS.
* infrun.c (find_thread_needs_step_over)
(switch_back_to_stepped_thread): Use ALL_NON_EXITED_THREADS
instead of ALL_THREADS.
* record-btrace.c (record_btrace_open)
(record_btrace_stop_recording, record_btrace_close)
(record_btrace_is_replaying, record_btrace_resume)
(record_btrace_find_thread_to_move, record_btrace_wait): Likewise.
* remote.c (append_pending_thread_resumptions): Likewise.
* thread.c (thread_apply_all_command): Likewise.
2014-06-19 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_stopped_by_watchpoint):
Use i386_dr_stopped_by_watchpoint.
(i386_insert_hw_breakpoint): Use i386_dr_insert_watchpoint.
(i386_remove_hw_breakpoint): Use i386_dr_remove_watchpoint.
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>
* 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.
2014-06-19 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_insert_hw_breakpoint): Use
i386_insert_watchpoint.
(i386_remove_hw_breakpoint): Use i386_remove_watchpoint.
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-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.
2014-06-19 Gary Benson <gbenson@redhat.com>
* configure.ac [AC_CHECK_FUNCS] <sigaltstack>: New check.
* configure: Regenerate.
* config.in: Likewise.
* main.c (signal.h): New include.
(setup_alternate_signal_stack): New function.
(captured_main): Call the above.
* cp-support.c (signal.h): New include.
(catch_demangler_crashes): New flag.
(SIGJMP_BUF): New define.
(SIGSETJMP): Likewise.
(SIGLONGJMP): Likewise.
(gdb_demangle_jmp_buf): New static global.
(gdb_demangle_attempt_core_dump): Likewise.
(gdb_demangle_signal_handler): New function.
(gdb_demangle): If catch_demangler_crashes is set, install the
above signal handler before calling bfd_demangle, and restore
the original signal handler afterwards. Display the offending
symbol and call demangler_warning the first time a segmentation
fault is caught.
(_initialize_cp_support): New maint set/show command.
2014-06-19 Gary Benson <gbenson@redhat.com>
* utils.h (resource_limit_kind): New enum.
(can_dump_core): New declaration.
(warn_cant_dump_core): Likewise.
(dump_core): Likewise.
* utils.c (dump_core): Made nonstatic. Added new
parameter "limit_kind".
(can_dump_core): Made nonstatic. Moved printing code to...
(warn_cant_dump_core): New function.
(can_dump_core_warn): Likewise.
(internal_vproblem): Replace calls to can_dump_core with
calls to can_dump_core_warn. Supply new argument to each.
2014-06-19 Gary Benson <gbenson@redhat.com>
* utils.h (demangler_vwarning): New declaration.
(demangler_warning): Likewise.
* utils.c (struct internal_problem)
<user_settable_should_quit>: New field.
<user_settable_should_dump_core>: Likewise
(internal_error_problem): Add values for above new fields.
(internal_warning_problem): Likewise.
(demangler_warning_problem): New static global.
(demangler_vwarning): New function.
(demangler_warning): Likewise.
(add_internal_problem_command): Selectively add commands.
(_initialize_utils): New internal problem command.
* maint.c (maintenance_demangler_warning): New function.
(_initialize_maint_cmds): New command.
2014-06-18 Tom Tromey <tromey@redhat.com>
* f-valprint.c (info_common_command_for_block): Update.
* symtab.h (struct general_symbol_info) <common_block>: Now
const.
constify some blockvector APIs Generally, the blockvector ought to be readonly. So, this patch makes the blockvector const in the symtab, and also changes various blockvector APIs to be const. This patch has a couple of spots that cast away const. I consider these to be ok because they occur in mdebugread and are used while constructing the blockvector. I have added comments at these spots. 2014-06-18 Tom Tromey <tromey@redhat.com> * symtab.h (struct symtab) <blockvector>: Now const. * ada-lang.c (ada_add_global_exceptions): Update. * buildsym.c (augment_type_symtab): Update. * dwarf2read.c (dw2_lookup_symbol): Update. * jit.c (finalize_symtab): Update. * jv-lang.c (add_class_symtab_symbol): Update. * mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab): Update. * objfiles.c (objfile_relocate1): Update. * psymtab.c (lookup_symbol_aux_psymtabs) (maintenance_check_psymtabs): Update. * python/py-symtab.c (stpy_global_block, stpy_static_block): Update. * spu-tdep.c (spu_catch_start): Update. * symmisc.c (dump_symtab_1): Update. * symtab.c (lookup_global_symbol_from_objfile) (lookup_symbol_aux_objfile, lookup_symbol_aux_quick) (basic_lookup_transparent_type_quick) (basic_lookup_transparent_type, find_pc_sect_symtab) (find_pc_sect_line, search_symbols): Update. * block.c (find_block_in_blockvector): Make "bl" const. (blockvector_for_pc_sect, blockvector_for_pc): Make return type const. (blockvector_contains_pc): Make "bv" const. (block_for_pc_sect): Update. * block.h (blockvector_for_pc, blockvector_for_pc_sect) (blockvector_contains_pc): Update. * breakpoint.c (resolve_sal_pc): Update. * inline-frame.c (block_starting_point_at): Update.
2014-06-10 21:11:19 +02:00
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.h (struct symtab) <blockvector>: Now const.
* ada-lang.c (ada_add_global_exceptions): Update.
* buildsym.c (augment_type_symtab): Update.
* dwarf2read.c (dw2_lookup_symbol): Update.
* jit.c (finalize_symtab): Update.
* jv-lang.c (add_class_symtab_symbol): Update.
* mdebugread.c (parse_symbol, add_block, sort_blocks, new_symtab):
Update.
* objfiles.c (objfile_relocate1): Update.
* psymtab.c (lookup_symbol_aux_psymtabs)
(maintenance_check_psymtabs): Update.
* python/py-symtab.c (stpy_global_block, stpy_static_block):
Update.
* spu-tdep.c (spu_catch_start): Update.
* symmisc.c (dump_symtab_1): Update.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_aux_objfile, lookup_symbol_aux_quick)
(basic_lookup_transparent_type_quick)
(basic_lookup_transparent_type, find_pc_sect_symtab)
(find_pc_sect_line, search_symbols): Update.
* block.c (find_block_in_blockvector): Make "bl" const.
(blockvector_for_pc_sect, blockvector_for_pc): Make return type
const.
(blockvector_contains_pc): Make "bv" const.
(block_for_pc_sect): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(blockvector_contains_pc): Update.
* breakpoint.c (resolve_sal_pc): Update.
* inline-frame.c (block_starting_point_at): Update.
2014-06-18 Tom Tromey <tromey@redhat.com>
* completer.c (complete_line): Make "line_buffer" const.
* completer.h (complete_line): Update.
2014-06-18 Tom Tromey <tromey@redhat.com>
* symtab.c (add_macro_name): Remove unneeded cast.
2014-06-18 Tom Tromey <tromey@redhat.com>
* cli/cli-setshow.h (parse_cli_boolean_value): Update.
* cli/cli-setshow.c (parse_cli_boolean_value): Make "arg" const.
2014-06-18 Tom Tromey <tromey@redhat.com>
* probe.c (info_probes_for_ops): Make "arg" const.
* probe.h (info_probes_for_ops): Update.
constify struct block in some places This makes some spots in gdb, particularly general_symbol_info, use a "const struct block", then fixes the fallout. The justification is that, ordinarily, blocks ought to be readonly. Note though that we can't add "const" in the blockvector due to block relocation. This can be done once blocks are made independent of the program space. 2014-06-18 Tom Tromey <tromey@redhat.com> * varobj.c (varobj_create): Update. * valops.c (value_of_this): Update. * tracepoint.c (add_local_symbols, scope_info): Update. * symtab.h (struct general_symbol_info) <block>: Now const. * symtab.c (skip_prologue_sal) (default_make_symbol_completion_list_break_on) (skip_prologue_using_sal): Update. * stack.h (iterate_over_block_locals) (iterate_over_block_local_vars): Update. * stack.c (print_frame_args): Update. (iterate_over_block_locals, iterate_over_block_local_vars): Make parameter const. (get_selected_block): Make return type const. * python/py-frame.c (frapy_block): Update. * python/py-block.c (gdbpy_block_for_pc): Update. * p-exp.y (%union) <bval>: Now const. * mi/mi-cmd-stack.c (list_args_or_locals): Update. * mdebugread.c (mylookup_symbol, parse_procedure): Update. * m2-exp.y (%union) <bval>: Now const. * linespec.c (get_current_search_block): Make return type const. (create_sals_line_offset, find_label_symbols): Update. * inline-frame.c (inline_frame_sniffer, skip_inline_frames): Update. (block_starting_point_at): Make "block" const. * infrun.c (insert_exception_resume_breakpoint): Make "b" const. (check_exception_resume): Update. * guile/scm-frame.c (gdbscm_frame_block): Update. * guile/scm-block.c (gdbscm_lookup_block): Update. * frame.h (get_frame_block): Update. (get_selected_block): Make return type const. * frame.c (frame_id_inner): Update. * f-valprint.c (info_common_command_for_block) (info_common_command): Update. * dwarf2loc.c (dwarf2_find_location_expression) (dwarf_expr_frame_base, dwarf2_compile_expr_to_ax) (locexpr_describe_location_piece): Update. * c-exp.y (%union) <bval>: Now const. * breakpoint.c (resolve_sal_pc): Update. * blockframe.c (get_frame_block):Make return type const. (get_pc_function_start, get_frame_function, find_pc_sect_function) (block_innermost_frame): Update. * block.h (blockvector_for_pc, blockvector_for_pc_sect) (block_for_pc, block_for_pc_sect): Update. * block.c (blockvector_for_pc_sect, blockvector_for_pc): Make 'pblock' const. (block_for_pc_sect, block_for_pc): Make return type const. * ax-gdb.c (gen_expr): Update. * alpha-mdebug-tdep.c (find_proc_desc): Update. * ada-lang.c (ada_read_renaming_var_value): Make 'block' const. (ada_make_symbol_completion_list, ada_add_exceptions_from_frame) (ada_read_var_value): Update. * ada-exp.y (struct name_info) <block>: Now const. (%union): Likewise. (block_lookup): Constify.
2013-03-12 16:51:37 +01:00
2014-06-18 Tom Tromey <tromey@redhat.com>
* varobj.c (varobj_create): Update.
* valops.c (value_of_this): Update.
* tracepoint.c (add_local_symbols, scope_info): Update.
* symtab.h (struct general_symbol_info) <block>: Now const.
* symtab.c (skip_prologue_sal)
(default_make_symbol_completion_list_break_on)
(skip_prologue_using_sal): Update.
* stack.h (iterate_over_block_locals)
(iterate_over_block_local_vars): Update.
* stack.c (print_frame_args): Update.
(iterate_over_block_locals, iterate_over_block_local_vars): Make
parameter const.
(get_selected_block): Make return type const.
* python/py-frame.c (frapy_block): Update.
* python/py-block.c (gdbpy_block_for_pc): Update.
* p-exp.y (%union) <bval>: Now const.
* mi/mi-cmd-stack.c (list_args_or_locals): Update.
* mdebugread.c (mylookup_symbol, parse_procedure): Update.
* m2-exp.y (%union) <bval>: Now const.
* linespec.c (get_current_search_block): Make return type const.
(create_sals_line_offset, find_label_symbols): Update.
* inline-frame.c (inline_frame_sniffer, skip_inline_frames):
Update.
(block_starting_point_at): Make "block" const.
* infrun.c (insert_exception_resume_breakpoint): Make "b" const.
(check_exception_resume): Update.
* guile/scm-frame.c (gdbscm_frame_block): Update.
* guile/scm-block.c (gdbscm_lookup_block): Update.
* frame.h (get_frame_block): Update.
(get_selected_block): Make return type const.
* frame.c (frame_id_inner): Update.
* f-valprint.c (info_common_command_for_block)
(info_common_command): Update.
* dwarf2loc.c (dwarf2_find_location_expression)
(dwarf_expr_frame_base, dwarf2_compile_expr_to_ax)
(locexpr_describe_location_piece): Update.
* c-exp.y (%union) <bval>: Now const.
* breakpoint.c (resolve_sal_pc): Update.
* blockframe.c (get_frame_block):Make return type const.
(get_pc_function_start, get_frame_function, find_pc_sect_function)
(block_innermost_frame): Update.
* block.h (blockvector_for_pc, blockvector_for_pc_sect)
(block_for_pc, block_for_pc_sect): Update.
* block.c (blockvector_for_pc_sect, blockvector_for_pc): Make
'pblock' const.
(block_for_pc_sect, block_for_pc): Make return type const.
* ax-gdb.c (gen_expr): Update.
* alpha-mdebug-tdep.c (find_proc_desc): Update.
* ada-lang.c (ada_read_renaming_var_value): Make 'block' const.
(ada_make_symbol_completion_list, ada_add_exceptions_from_frame)
(ada_read_var_value): Update.
* ada-exp.y (struct name_info) <block>: Now const.
(%union): Likewise.
(block_lookup): Constify.
2014-06-18 Gary Benson <gbenson@redhat.com>
* nat/i386-dregs.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add the above.
* i386-nat.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-nat.c (ALL_DEBUG_REGISTERS): Likewise.
Symptom: Using the test program gdb.base/foll-fork.c, with follow-fork-mode set to "child" and detach-on-fork set to "off", stepping or running past the fork call results in the child process running to completion, when it should just finish the single step. In addition, the breakpoint is not removed from the parent process, so if it is resumed it receives a SIGTRAP. Cause: No matter what the setting for detach-on-fork, when stepping past a fork, the single-step breakpoint (step_resume_breakpoint) is not handled correctly in the parent. The SR breakpoint is cloned for the child process, but before the clone is associated with the child it is treated as a duplicate of the original, associated wth the parent. This results in the insertion state of the original SR breakpoint and the clone being "swapped" by breakpoint.c:update_global_location_list, so that the clone is marked as inserted. In the case where the parent is not detached, the two breakpoints remain in that state. The breakpoint is never inserted in the child, because although the cloned SR breakpoint is associated with the child, it is marked as inserted. When the child is resumed, it runs to completion. The breakpoint is never removed from the parent, so that if it is resumed after the child exits, it gets a SIGTRAP. Here is the sequence of events: 1) handle_inferior_event: FORK event is recognized. 2) handle_inferior_event: detach_breakpoints removes all breakpoints from the child. 3) follow_fork: the parent SR breakpoint is cloned. Part of this procedure is to call update_global_location_list, which swaps the insertion state of the original and cloned SR breakpoints as part of ensuring that duplicate breakpoints are only inserted once. At this point the original SR breakpoint is not marked as inserted, and the clone is. The breakpoint is actually inserted in the parent but not the child. 4) follow_fork: the original breakpoint is deleted by calling delete_step_resume_breakpoint. Since the original is not marked as inserted, the actual breakpoint remains in the parent process. update_global_location_list is called again as part of the deletion. The clone is still associated with the parent, but since it is marked as enabled and inserted, the breakpoint is left in the parent. 5) follow_fork: if detach-on-fork is 'on', the actual breakpoint will be removed from the parent in target_detach, based on the cloned breakpoint still associated with the parent. Then the clone is no longer marked as inserted. In follow_inferior_reset_breakpoints the clone is associated with the child, and can be inserted. If detach-on-fork is 'off', the actual breakpoint in the parent is never removed (although the breakpoint had been deleted from the list). Since the clone continues to be marked 'inserted', the SR breakpoint is never inserted in the child. Fix: Set the cloned breakpoint as disabled from the moment it is created. This is done by modifying clone_momentary_breakpoint to take an additional argument, LOC_ENABLED, which is used as the value of the bp_location->enabled member. The clone must be disabled at that point because clone_momentary_breakpoint calls update_global_location_list, which will swap treat the clone as a duplicate of the original breakpoint if it is enabled. All the calls to clone_momentary_breakpoint had to be modified to pass '1' or '0'. I looked at implementing an enum for the enabled member, but concluded that readability would suffer because there are so many places it is used as a boolean, e.g. "if (bl->enabled)". In follow_inferior_reset_breakpoints the clone is set to enabled once it has been associated with the child process. With this, the bp_location 'inserted' member is maintained correctly throughout the follow-fork procedure and the behavior is as expected. The same treatment is given to the exception_resume_breakpoint when following a fork. Testing: Ran 'make check' on Linux x64. Along with the fix above, the coverage of the follow-fork test gdb.base/foll-fork.exp was expanded to: 1) cover all the combinations of values for follow-fork-mode and detach-on-fork 2) make sure that both user breakpoints and single-step breakpoints are propagated correctly to the child 3) check that the inferior list has the expected contents after following the fork. 4) check that unfollowed, undetached inferiors can be resumed. gdb/ 2014-06-18 Don Breazeal <donb@codesourcery.com> * breakpoint.c (set_longjmp_breakpoint): Call momentary_breakpoint_from_master with additional argument. (set_longjmp_breakpoint_for_call_dummy): Call momentary_breakpoint_from_master with additional argument. (set_std_terminate_breakpoint): Call momentary_breakpoint_from_master with additional argument. (momentary_breakpoint_from_master): Add argument to function definition and use it to initialize structure member flag. (clone_momentary_breakpoint): Call momentary_breakpoint_from_master with additional argument. * infrun.c (follow_inferior_reset_breakpoints): Clear structure member flags set in momentary_breakpoint_from_master. gdb/testsuite/ 2014-06-18 Don Breazeal <donb@codesourcery.com> * gdb.base/foll-fork.exp (default_fork_parent_follow): Deleted procedure. (explicit_fork_parent_follow): Deleted procedure. (explicit_fork_child_follow): Deleted procedure. (test_follow_fork): New procedure. (do_fork_tests): Replace calls to deleted procedures with calls to test_follow_fork and reset GDB for subsequent procedure calls.
2014-06-18 11:25:47 +02:00
2014-06-18 Don Breazeal <donb@codesourcery.com>
* breakpoint.c (set_longjmp_breakpoint): Call
momentary_breakpoint_from_master with additional argument.
(set_longjmp_breakpoint_for_call_dummy): Call
momentary_breakpoint_from_master with additional argument.
(set_std_terminate_breakpoint): Call
momentary_breakpoint_from_master with additional argument.
(momentary_breakpoint_from_master): Add argument to function
definition and use it to initialize structure member flag.
(clone_momentary_breakpoint): Call
Symptom: Using the test program gdb.base/foll-fork.c, with follow-fork-mode set to "child" and detach-on-fork set to "off", stepping or running past the fork call results in the child process running to completion, when it should just finish the single step. In addition, the breakpoint is not removed from the parent process, so if it is resumed it receives a SIGTRAP. Cause: No matter what the setting for detach-on-fork, when stepping past a fork, the single-step breakpoint (step_resume_breakpoint) is not handled correctly in the parent. The SR breakpoint is cloned for the child process, but before the clone is associated with the child it is treated as a duplicate of the original, associated wth the parent. This results in the insertion state of the original SR breakpoint and the clone being "swapped" by breakpoint.c:update_global_location_list, so that the clone is marked as inserted. In the case where the parent is not detached, the two breakpoints remain in that state. The breakpoint is never inserted in the child, because although the cloned SR breakpoint is associated with the child, it is marked as inserted. When the child is resumed, it runs to completion. The breakpoint is never removed from the parent, so that if it is resumed after the child exits, it gets a SIGTRAP. Here is the sequence of events: 1) handle_inferior_event: FORK event is recognized. 2) handle_inferior_event: detach_breakpoints removes all breakpoints from the child. 3) follow_fork: the parent SR breakpoint is cloned. Part of this procedure is to call update_global_location_list, which swaps the insertion state of the original and cloned SR breakpoints as part of ensuring that duplicate breakpoints are only inserted once. At this point the original SR breakpoint is not marked as inserted, and the clone is. The breakpoint is actually inserted in the parent but not the child. 4) follow_fork: the original breakpoint is deleted by calling delete_step_resume_breakpoint. Since the original is not marked as inserted, the actual breakpoint remains in the parent process. update_global_location_list is called again as part of the deletion. The clone is still associated with the parent, but since it is marked as enabled and inserted, the breakpoint is left in the parent. 5) follow_fork: if detach-on-fork is 'on', the actual breakpoint will be removed from the parent in target_detach, based on the cloned breakpoint still associated with the parent. Then the clone is no longer marked as inserted. In follow_inferior_reset_breakpoints the clone is associated with the child, and can be inserted. If detach-on-fork is 'off', the actual breakpoint in the parent is never removed (although the breakpoint had been deleted from the list). Since the clone continues to be marked 'inserted', the SR breakpoint is never inserted in the child. Fix: Set the cloned breakpoint as disabled from the moment it is created. This is done by modifying clone_momentary_breakpoint to take an additional argument, LOC_ENABLED, which is used as the value of the bp_location->enabled member. The clone must be disabled at that point because clone_momentary_breakpoint calls update_global_location_list, which will swap treat the clone as a duplicate of the original breakpoint if it is enabled. All the calls to clone_momentary_breakpoint had to be modified to pass '1' or '0'. I looked at implementing an enum for the enabled member, but concluded that readability would suffer because there are so many places it is used as a boolean, e.g. "if (bl->enabled)". In follow_inferior_reset_breakpoints the clone is set to enabled once it has been associated with the child process. With this, the bp_location 'inserted' member is maintained correctly throughout the follow-fork procedure and the behavior is as expected. The same treatment is given to the exception_resume_breakpoint when following a fork. Testing: Ran 'make check' on Linux x64. Along with the fix above, the coverage of the follow-fork test gdb.base/foll-fork.exp was expanded to: 1) cover all the combinations of values for follow-fork-mode and detach-on-fork 2) make sure that both user breakpoints and single-step breakpoints are propagated correctly to the child 3) check that the inferior list has the expected contents after following the fork. 4) check that unfollowed, undetached inferiors can be resumed. gdb/ 2014-06-18 Don Breazeal <donb@codesourcery.com> * breakpoint.c (set_longjmp_breakpoint): Call momentary_breakpoint_from_master with additional argument. (set_longjmp_breakpoint_for_call_dummy): Call momentary_breakpoint_from_master with additional argument. (set_std_terminate_breakpoint): Call momentary_breakpoint_from_master with additional argument. (momentary_breakpoint_from_master): Add argument to function definition and use it to initialize structure member flag. (clone_momentary_breakpoint): Call momentary_breakpoint_from_master with additional argument. * infrun.c (follow_inferior_reset_breakpoints): Clear structure member flags set in momentary_breakpoint_from_master. gdb/testsuite/ 2014-06-18 Don Breazeal <donb@codesourcery.com> * gdb.base/foll-fork.exp (default_fork_parent_follow): Deleted procedure. (explicit_fork_parent_follow): Deleted procedure. (explicit_fork_child_follow): Deleted procedure. (test_follow_fork): New procedure. (do_fork_tests): Replace calls to deleted procedures with calls to test_follow_fork and reset GDB for subsequent procedure calls.
2014-06-18 11:25:47 +02:00
momentary_breakpoint_from_master with additional argument.
* infrun.c (follow_inferior_reset_breakpoints): Clear structure
member flags set in momentary_breakpoint_from_master.
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-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.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_dr_low_can_set_addr): New macro.
(i386_dr_low_can_set_control): Likewise.
(i386_dr_low_set_addr): Likewise.
(i386_dr_low_set_control): Likewise.
(i386_dr_low_get_addr): Likewise.
(i386_dr_low_get_status): Likewise.
(i386_dr_low_get_control): Likewise.
(i386_insert_aligned_watchpoint): Use new macros.
(i386_update_inferior_debug_regs): Likewise.
(i386_stopped_data_address): Likewise.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_update_inferior_debug_regs) <state>:
New parameter. All uses updated.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c (maint_show_dr): Renamed to debug_hw_points.
All uses updated.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c (debug_printf): New macro.
(i386_get_debug_register_length): Likewise.
(TARGET_HAS_DR_LEN_8): Use above macro.
(i386_show_dr): Use debug_printf instead of puts_unfiltered
and printf_unfiltered. Use phex to format values.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_handle_nonaligned_watchpoint) <size_try_array>:
Make const.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c: Comment changes.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c (I386_DR_WATCH_MASK): Remove macro.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_length_and_rw_bits): Remove prototype.
(i386_insert_aligned_watchpoint): Likewise.
(i386_remove_aligned_watchpoint): Likewise.
(i386_handle_nonaligned_watchpoint): Likewise.
2014-06-18 Gary Benson <gbenson@redhat.com>
* i386-nat.c: Whitespace changes.
2014-06-17 Samuel Bronson <naesten@gmail.com>
* MAINTAINERS: Update Roland McGrath's email address.
Thanks to Sergio Durigan Junior for pointing out that he left
Red Hat a while ago, and giving me a current address.
2014-06-17 Tom Tromey <tromey@redhat.com>
* utils.h (savestring): Remove declaration.
2014-06-17 Tom Tromey <tromey@redhat.com>
* remote.c (extended_remote_run): Use make_cleanup_freeargv.
2014-06-16 Keith Seitz <keiths@redhat.com>
PR mi/15863
* mi/mi-cmd-var.c (mi_cmd_var_update_iter): Do not attempt
to update the varobj if inferior_ptid is null_ptid.
2014-06-16 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_info_proc>: Make parameter
const.
(target_info_proc): Update.
* target.c (target_info_proc): Make "args" const.
* procfs.c (procfs_info_proc): Update.
* linux-tdep.c (linux_info_proc): Update.
(linux_core_info_proc_mappings): Make "args" const.
(linux_core_info_proc): Update.
* gdbarch.sh (info_proc, core_info_proc): Make "args" const.
* gdbarch.c: Rebuild.
* gdbarch.h: Rebuild.
* corelow.c (core_info_proc): Update.
2014-06-16 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_disconnect>: Make parameter
const.
(target_disconnect): Update.
* target.c (target_disconnect): Make "args" const.
* target-delegates.c: Rebuild.
* remote.c (remote_disconnect): Update.
* record.h (record_disconnect): Update.
* record.c (record_disconnect): Update.
* inf-child.c (inf_child_disconnect): Update.
2014-06-16 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_rcmd>: Make "command" const.
* target.c (debug_to_rcmd, default_rcmd): Update.
* target-delegates.c: Rebuild.
* remote.c (remote_rcmd): Update.
* monitor.c (monitor_rcmd): Update.
"$ gdb PROGRAM" vs "(gdb) file PROGRAM" difference; warn on failure to remove breakpoint. Turns out there's a difference between loading the program with "gdb PROGRAM", vs loading it with "(gdb) file PROGRAM". The latter results in the objfile ending up with OBJF_USERLOADED set, while not with the former. (That difference seems bogus, but still that's not the point of this patch. We can revisit that afterwards.) The new code that suppresses breakpoint removal errors for add-symbol-file objects ends up being too greedy: /* In some cases, we might not be able to remove a breakpoint in a shared library that has already been removed, but we have not yet processed the shlib unload event. Similarly for an unloaded add-symbol-file object - the user might not yet have had the chance to remove-symbol-file it. shlib_disabled will be set if the library/object has already been removed, but the breakpoint hasn't been uninserted yet, e.g., after "nosharedlibrary" or "remove-symbol-file" with breakpoints always-inserted mode. */ if (val && (bl->loc_type == bp_loc_software_breakpoint && (bl->shlib_disabled || solib_name_from_address (bl->pspace, bl->address) || userloaded_objfile_contains_address_p (bl->pspace, bl->address)))) val = 0; as it turns out that OBJF_USERLOADED can be set for objfiles loaded by some other means not add-symbol-file. In this case, symbol-file (or "file", which is really just "exec-file"+"symbol-file"). Recall that add-symbol-file is documented as: (gdb) help add-symbol-file Load symbols from FILE, assuming FILE has been dynamically loaded. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ And it's the "dynamically loaded" aspect that the breakpoint.c code cares about. So make add-symbol-file set OBJF_SHARED on its objfiles too, and tweak the breakpoint.c code to look for OBJF_SHARED instead of OBJF_USERLOADED. This restores back the missing breakpoint removal warning when we let sss-bp-on-user-bp-2.exp run on native GNU/Linux (https://sourceware.org/ml/gdb-patches/2014-06/msg00335.html): (gdb) PASS: gdb.base/sss-bp-on-user-bp-2.exp: define stepi_del_break stepi_del_break warning: Error removing breakpoint 3 (gdb) FAIL: gdb.base/sss-bp-on-user-bp-2.exp: stepi_del_break I say "restores" because this was GDB's behavior in 7.7 and earlier. And, likewise, "file" with no arguments only started turning breakpoints set in the main executable to "<pending>" with the remote-symbol-file patch (63644780). The old behavior is now restored, and we break-unload-file.exp test now exercizes both "gdb; file PROGRAM" and "gdb PROGRAM". gdb/ 2014-06-16 Pedro Alves <palves@redhat.com> * breakpoint.c (insert_bp_location, remove_breakpoint_1): Adjust. (disable_breakpoints_in_freed_objfile): Skip objfiles that don't have OBJF_SHARED set. * objfiles.c (userloaded_objfile_contains_address_p): Rename to... (shared_objfile_contains_address_p): ... this. Check OBJF_SHARED instead of OBJF_USERLOADED. * objfiles.h (OBJF_SHARED): Update comment. (userloaded_objfile_contains_address_p): Rename to ... (shared_objfile_contains_address_p): ... this, and update comments. * symfile.c (add_symbol_file_command): Also set OBJF_SHARED in the new objfile. (remove_symbol_file_command): Skip objfiles that don't have OBJF_SHARED set. gdb/testsuite/ 2014-06-16 Pedro Alves <palves@redhat.com> * gdb.base/break-main-file-remove-fail.c: New file. * gdb.base/break-main-file-remove-fail.exp: New file. * gdb.base/break-unload-file.exp: Use build_executable instead of prepare_for_testing. (test_break): New parameter "initial_load". Handle it. (top level): Add initial_load cmdline/file axis.
2014-06-16 16:38:13 +02:00
2014-06-16 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location, remove_breakpoint_1): Adjust.
(disable_breakpoints_in_freed_objfile): Skip objfiles that don't
have OBJF_SHARED set.
* objfiles.c (userloaded_objfile_contains_address_p): Rename to...
(shared_objfile_contains_address_p): ... this. Check OBJF_SHARED
instead of OBJF_USERLOADED.
* objfiles.h (OBJF_SHARED): Update comment.
(userloaded_objfile_contains_address_p): Rename to ...
(shared_objfile_contains_address_p): ... this, and update
comments.
* symfile.c (add_symbol_file_command): Also set OBJF_SHARED in the
new objfile.
(remove_symbol_file_command): Skip objfiles that don't have
OBJF_SHARED set.
2014-06-16 Tom Tromey <tromey@redhat.com>
* minsyms.h (prim_record_minimal_symbol)
(prim_record_minimal_symbol_and_info): Update comments.
2014-06-14 Eli Zaretskii <eliz@gnu.org>
* top.c (print_gdb_configuration) [HAVE_GUILE]: Print --with-guile
or --without-guile, according to how GDB was built.
make calls to help_list use enumerator Currently there are many calls to help_list that pass the constant -1 as the "class" value. However, the parameter is declared as being of type enum command_class, and uses of the constant violate this abstraction. This patch fixes the error everywhere it occurs in the gdb sources. Tested by rebuilding. 2014-06-13 Tom Tromey <tromey@redhat.com> * cp-support.c (maint_cplus_command): Pass all_commands, not -1, to help_list. * guile/guile.c (info_guile_command): Pass all_commands, not -1, to help_list. * tui/tui-win.c (tui_command): Pass all_commands, not -1, to help_list. * tui/tui-regs.c (tui_reg_command): Pass all_commands, not -1, to help_list.Pass all_commands, not -1, to help_list. * cli/cli-dump.c (dump_command, append_command) (srec_dump_command, ihex_dump_command, tekhex_dump_command) (binary_dump_command, binary_append_command): Pass all_commands, not -1, to help_list. * cli/cli-cmds.c (info_command, set_debug): Pass all_commands, not -1, to help_list. * valprint.c (set_print, set_print_raw): Pass all_commands, not -1, to help_list. * typeprint.c (set_print_type): Pass all_commands, not -1, to help_list. * top.c (set_history): Pass all_commands, not -1, to help_list. * target-descriptions.c (set_tdesc_cmd, unset_tdesc_cmd): Pass all_commands, not -1, to help_list. * symfile.c (overlay_command): Pass all_commands, not -1, to help_list. * spu-tdep.c (info_spu_command): Pass all_commands, not -1, to help_list. * serial.c (serial_set_cmd): Pass all_commands, not -1, to help_list. * ser-tcp.c (set_tcp_cmd, show_tcp_cmd): Pass all_commands, not -1, to help_list. * remote.c (remote_command, set_remote_cmd): Pass all_commands, not -1, to help_list. * ravenscar-thread.c (set_ravenscar_command): Pass all_commands, not -1, to help_list. * maint.c (maintenance_command, maintenance_info_command) (maintenance_print_command, maintenance_set_cmd): Pass all_commands, not -1, to help_list. * macrocmd.c (macro_command): Pass all_commands, not -1, to help_list. * language.c (set_check): Pass all_commands, not -1, to help_list. * infcmd.c (unset_command): Pass all_commands, not -1, to help_list. * frame.c (set_backtrace_cmd): Pass all_commands, not -1, to help_list. * dwarf2read.c (set_dwarf2_cmd): Pass all_commands, not -1, to help_list. * dcache.c (set_dcache_command): Pass all_commands, not -1, to help_list. * breakpoint.c (save_command): Pass all_commands, not -1, to help_list. * ada-lang.c (maint_set_ada_cmd, set_ada_command): Pass all_commands, not -1, to help_list.
2014-06-05 16:25:00 +02:00
2014-06-13 Tom Tromey <tromey@redhat.com>
* cp-support.c (maint_cplus_command): Pass all_commands, not -1,
to help_list.
* guile/guile.c (info_guile_command): Pass all_commands, not -1,
to help_list.
* tui/tui-win.c (tui_command): Pass all_commands, not -1, to
help_list.
* tui/tui-regs.c (tui_reg_command): Pass all_commands, not -1, to
help_list.Pass all_commands, not -1, to help_list.
* cli/cli-dump.c (dump_command, append_command)
(srec_dump_command, ihex_dump_command, tekhex_dump_command)
(binary_dump_command, binary_append_command): Pass all_commands,
not -1, to help_list.
* cli/cli-cmds.c (info_command, set_debug): Pass all_commands, not
-1, to help_list.
* valprint.c (set_print, set_print_raw): Pass all_commands, not
-1, to help_list.
* typeprint.c (set_print_type): Pass all_commands, not -1, to
help_list.
* top.c (set_history): Pass all_commands, not -1, to help_list.
* target-descriptions.c (set_tdesc_cmd, unset_tdesc_cmd): Pass
all_commands, not -1, to help_list.
* symfile.c (overlay_command): Pass all_commands, not -1, to
help_list.
* spu-tdep.c (info_spu_command): Pass all_commands, not -1, to
help_list.
* serial.c (serial_set_cmd): Pass all_commands, not -1, to
help_list.
* ser-tcp.c (set_tcp_cmd, show_tcp_cmd): Pass all_commands, not
-1, to help_list.
* remote.c (remote_command, set_remote_cmd): Pass all_commands,
not -1, to help_list.
* ravenscar-thread.c (set_ravenscar_command): Pass all_commands,
not -1, to help_list.
* maint.c (maintenance_command, maintenance_info_command)
(maintenance_print_command, maintenance_set_cmd): Pass
all_commands, not -1, to help_list.
* macrocmd.c (macro_command): Pass all_commands, not -1, to
help_list.
* language.c (set_check): Pass all_commands, not -1, to help_list.
* infcmd.c (unset_command): Pass all_commands, not -1, to
help_list.
* frame.c (set_backtrace_cmd): Pass all_commands, not -1, to
help_list.
* dwarf2read.c (set_dwarf2_cmd): Pass all_commands, not -1, to
help_list.
* dcache.c (set_dcache_command): Pass all_commands, not -1, to
help_list.
* breakpoint.c (save_command): Pass all_commands, not -1, to
help_list.
* ada-lang.c (maint_set_ada_cmd, set_ada_command): Pass
all_commands, not -1, to help_list.
Invalidate a register in cache when a remote target failed to write it. As shown by the bug report, GDB crashes when the remote target was unable to write to a register (the program counter) with the 'P' packet. This was reported for AVR but can be reproduced on any architecture with a gdbserver that fails to handle a 'P' packet. Issue ===== This GDB session was done with a custom gdbserver patched to send an error packet when trying to set the program counter with a 'P' packet: ~~~ (gdb) file Debug/ATMega2560-simple-program.elf Reading symbols from Debug/ATMega2560-simple-program.elf...done. (gdb) target remote :51000 Remote debugging using :51000 0x00000000 in __vectors () (gdb) load Loading section .text, size 0x1fc lma 0x0 Start address 0x0, load size 508 Transfer rate: 248 KB/sec, 169 bytes/write. (gdb) b main Breakpoint 1 at 0x164: file .././ATMega2560-simple-program.c, line 39. (gdb) c Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. main () at .././ATMega2560-simple-program.c:42 42 DDRD |= LED0_MASK;// | LED1_MASK; (gdb) info line 43 Line 43 of ".././ATMega2560-simple-program.c" is at address 0x178 <main+40> but contains no code. (gdb) set $pc=0x178 Could not write register "PC2"; remote failure reply 'E00' (gdb) info registers pc pc 0x178 0x178 <main+40> (gdb) s ../../unisrc-mainline/gdb/infrun.c:1978: internal-error: resume: Assertion `pc_in_thread_step_range (pc, tp)' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) ../../unisrc-mainline/gdb/infrun.c:1978: internal-error: resume: Assertion `pc_in_thread_step_range (pc, tp)' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) ~~~ We can see that even though GDB reports that writing to the register failed, the register cache was updated: ~~~ (gdb) set $pc=0x178 Could not write register "PC2"; remote failure reply 'E00' (gdb) info registers pc pc 0x178 0x178 <main+40> ~~~ The root of the problem is of course in the gdbserver but I thought GDB should keep a register cache consistent with the hardware even in case of a failure. Changes ======= This patch adds routines to add a regcache_invalidate cleanup to the current chain. We can then register one before calling target_store_registers. This way if the target throws an error, the register we wanted to write to will be invalidated in cache. If target_store_registers succeeds, we can discard the new cleanup. 2014-06-12 Pierre Langlois <pierre.langlois@embecosm.com> * regcache.c (struct register_to_invalidate): New structure. (do_register_invalidate, make_cleanup_regcache_invalidate): New functions. (regcache_raw_write): Call make_cleanup_regcache_invalidate.
2014-05-20 16:13:20 +02:00
2014-06-12 Pierre Langlois <pierre.langlois@embecosm.com>
* regcache.c (struct register_to_invalidate): New structure.
(do_register_invalidate, make_cleanup_regcache_invalidate): New
functions.
(regcache_raw_write): Call make_cleanup_regcache_invalidate.
2014-06-12 Yao Qi <yao@codesourcery.com>
* varobj.c (varobj_get_num_children): Call
varobj_is_dynamic_p.
(varobj_list_children): Likewise.
(varobj_update): Likewise. Update comments.
2014-06-12 Yao Qi <yao@codesourcery.com>
* varobj.c (varobj_pretty_printed_p): Rename to ...
(varobj_is_dynamic_p): ... this. New function.
* varobj.h (varobj_pretty_printed_p): Remove declaration.
(varobj_is_dynamic_p): Declare.
* mi/mi-cmd-var.c (print_varobj): All callers updated.
(mi_print_value_p, varobj_update_one): Likewise.
2014-06-12 Pedro Alves <pedro@codesourcery.com>
Yao Qi <yao@codesourcery.com>
* varobj.c: Remove "#if HAVE_PYTHON" and "#endif".
(varobj_get_iterator): Wrap up code for pretty-printer by
"#if HAVE_PYTHON" and "#endif".
(update_dynamic_varobj_children): Likewise.
2014-06-12 Pedro Alves <pedro@codesourcery.com>
Yao Qi <yao@codesourcery.com>
* python/py-varobj.c (py_varobj_iter_next): Return NULL if
gdb_python_initialized is false. Move some code from varobj.c.
* varobj-iter.h (struct varobj_item): Moved from varobj.c.
* varobj.c: Move "varobj-iter.h" inclusion earlier.
(struct varobj_item): Moved to varobj-iter.h".
(varobj_clear_saved_item): New function.
(update_dynamic_varobj_children): Move python-related code to
py-varobj.c.
(free_variable): Call varobj_clear_saved_item and
varobj_iter_delete.
Generalize varobj iterator This patch generalizes varobj iterator, in a python-independent way. Note varobj_item is still a typedef of PyObject, we can only focus on API changes, and leave the data type changes to the next patch. As a result, we include "varobj-iter.h" after the typedef of PyObject in varobj.c, but it is an intermediate state. Finally, varobj-iter.h is independent of PyObject. This change is helpful to move some python-related code out of varobj.c. V2: - Fix a missing cleanup. - Fix typos. - Use XNEW. - Check against NULL explicitly. - Update copyright year for new added files. V3: - Call PyGILState_Ensure before Py_XDECREF. - Use CPYCHECKER_STEALS_REFERENCE_TO_ARG. - Code indentation. V4: - use varobj_ensure_python_env instead of PyGILState_Ensure. gdb: 2014-06-12 Pedro Alves <pedro@codesourcery.com> Yao Qi <yao@codesourcery.com> * Makefile.in (SUBDIR_PYTHON_OBS): Add "py-varobj.o". (SUBDIR_PYTHON_SRCS): Add "python/py-varobj.c". (HFILES_NO_SRCDIR): Add "varobj-iter.h". (py-varobj.o): New rule. * python/py-varobj.c: New file. * python/python-internal.h (py_varobj_get_iterator): Declare. * varobj-iter.h: New file. * varobj.c: Include "varobj-iter.h" (struct varobj) <child_iter>: Change its type from "PyObject *" to "struct varobj_iter *". <saved_item>: Likewise. [HAVE_PYTHON] (varobj_ensure_python_env): Make it extern. [HAVE_PYTHON] (varobj_get_iterator): New function. (update_dynamic_varobj_children) [HAVE_PYTHON]: Move python-specific code to python/py-varobj.c. (install_visualizer): Call varobj_iter_delete instead of Py_XDECREF. * varobj.h (varobj_ensure_python_env): Declare.
2013-08-30 03:44:46 +02:00
2014-06-12 Pedro Alves <pedro@codesourcery.com>
Yao Qi <yao@codesourcery.com>
* Makefile.in (SUBDIR_PYTHON_OBS): Add "py-varobj.o".
(SUBDIR_PYTHON_SRCS): Add "python/py-varobj.c".
(HFILES_NO_SRCDIR): Add "varobj-iter.h".
(py-varobj.o): New rule.
* python/py-varobj.c: New file.
* python/python-internal.h (py_varobj_get_iterator): Declare.
* varobj-iter.h: New file.
* varobj.c: Include "varobj-iter.h"
(struct varobj) <child_iter>: Change its type from "PyObject *"
to "struct varobj_iter *".
<saved_item>: Likewise.
[HAVE_PYTHON] (varobj_ensure_python_env): Make it extern.
[HAVE_PYTHON] (varobj_get_iterator): New function.
(update_dynamic_varobj_children) [HAVE_PYTHON]: Move
python-specific code to python/py-varobj.c.
(install_visualizer): Call varobj_iter_delete instead of
Py_XDECREF.
* varobj.h (varobj_ensure_python_env): Declare.
2014-06-12 Yao Qi <yao@codesourcery.com>
* varobj.c (struct varobj_item): New structure.
(create_child_with_value): Update declaration.
(varobj_add_child): Replace arguments 'name' and 'value' with
'item'. All callers updated.
(install_dynamic_child): Likewise.
(update_dynamic_varobj_children): Likewise.
(varobj_add_child): Likewise.
(create_child_with_value): Likewise.
2014-06-11 Joel Brobecker <brobecker@adacore.com>
* NEWS: Create a new section for the next release branch.
Rename the section of the current branch, now that it has
been cut.
2014-06-11 Joel Brobecker <brobecker@adacore.com>
GDB 7.8 branch created (173373c6f6388171d1d62a217fae90a052395be2):
* version.in: Bump version to 7.8.50.DATE-cvs.
PR remote/17028: GDB+GDBserver hangs on Windows Since target-async was turned on by default, debugging on Windows using GDB+GDBserver sometimes hangs while waiting for a RSP reply. The problem is a race in the gdb_select machinery. This is what we see for a faulty next on the GDB side: (gdb) n infrun: clear_proceed_status_thread (Thread 4424) infrun: proceed (addr=0xffffffff, signal=GDB_SIGNAL_DEFAULT, step=1) (...) infrun: resume (step=1, signal=GDB_SIGNAL_0), ... Sending packet: $vCont;s:1148;c#5e... *hang* At this point, attaching a debugger to the hanging GDB confirms that it is blocked, waiting for a socket event: #6 0x757841d8 in WaitForMultipleObjects () from C:\Windows\syswow64\kernel32.dll #7 0x004708e7 in gdb_select (n=469, readfds=0x88ca50 <gdb_notifier+784>, writefds=0x88cb54 <gdb_notifier+1044>, exceptfds=0x88cc58 <gdb_notifier+1304>, timeout=0x0) at /[...]/gdb/mingw-hdep.c:172 #8 0x00527926 in gdb_wait_for_event (block=1) at /[...]/gdb/event-loop.c:831 #9 0x00526ff1 in gdb_do_one_event () at /[...]/gdb/event-loop.c:403 However, on the GDBserver side, we see that GDBserver already sent a T05 packet reply: gdbserver: kernel event EXCEPTION_DEBUG_EVENT for pid=4968 tid=1148 EXCEPTION_SINGLE_STEP Child Stopped with signal = 5 Writing resume reply for LWP 4968.4424:1 DEBUG: write_prim ($T0505:c8fe2800;04:a0fe2800;08:38164000;thread:1148;#f0) -> 55 To recap, on Windows, 'select' only works with sockets, so we have a wrapper, gdb_select, that uses the GDB serial abstraction to handle sockets, consoles, pipes, and serial ports. Each serial descriptor has a thread associated (we call those the select threads), and those threads communicate with the main thread by means of standard Windows events. It basically goes like this: gdb_select first loops through all fds of interest, calling their wait_handle hooks, which returns an event that WaitForMultipleObjects can wait on. gdb_select then blocks in WaitForMultipleObjects with all those event handles. The wait_handle hook is responsible for arranging for the returned event to become set once data is available. This is done by setting the descriptor's helper thread running, which itself knows how to wait for data from the type of handle it manages (sockets, pipes, consoles, files, etc.). Once data arrives, the select thread sets the corresponding event which unblocks WaitForMultipleObjects within gdb_select. However, the wait_handle hook can also apply an optimization: if data is already pending, then there's no need to set the thread running, and the descriptors event can be set immediately. It's around this latter aspect that lies the bug/race. Adding some ad hoc debug logs to ser-mingw.c and mingw-hdep.c, we see the following sequence of events, right after sending "$vCont;s:1148;c#5e". Thread 1 is the main thread, and thread 2 is the socket's helper/select thread. gdb_select was only passed one descriptor to wait on, the remote target's socket. net_windows_select_thread is the entry point of the select threads for sockets. #1 - thread 1: gdb_select: enter #2 - thread 2: net_windows_select_thread: WaitForMultipleObjects blocking gdb_select walked over the wait_handle hooks, and woke up the socket's helper thread. The helper thread is now blocked waiting for socket events. #3 - thread 1: gdb_select: WaitForMultipleObjects polling (timeout=0ms) #4 - thread 1: gdb_select: WaitForMultipleObjects returned 102 (WAIT_TIMEOUT) There was no pending data available yet, and gdb_select was passed timeout==0ms, and so WaitForMultipleObjects times out immediately. #5 - thread 2: net_windows_select_thread: WaitForMultipleObjects returned 1 Just afterwards, socket data arrives, and thread 2 wakes up. Thread 2 calls WSAEnumNetworkEvents, which clears state->sock_event, and marks the serial's read_event event, telling the main thread that data is available. #6 - thread 1: gdb_select: call serial_done_wait_handle on each serial gdb_select stops all the helper/select threads. #7 - thread 1: gdb_select: return 0 (WAIT_TIMEOUT) gdb_select in the main thread returns to the caller. Note that at this point, data is pending on the socket, the serial's read_event is set, but the socket's sock_event event is not set, until _further_ data arrives. Now GDB does its thing and goes back to the event loop. That calls gdb_select, but with timeout==INFINITE. Again, gdb_select calls the socket serial's wait_handle hook. It first clears its events, starting from a clean slate: ResetEvent (state->base.read_event); ResetEvent (state->base.except_event); ResetEvent (state->base.stop_select); That cleared read_event, which was previously set in #5 above. And then it checks for pending events, in the sock_event event: /* Check any pending events. This both avoids starting the thread unnecessarily, and handles stray FD_READ events (see below). */ if (WaitForSingleObject (state->sock_event, 0) == WAIT_OBJECT_0) { That also fails because state->sock_event was cleared in #5 too... So the wait_handle hook erroneously decides that it needs to start the helper thread to wait for input: #8 - thread 2: net_windows_select_thread: WaitForMultipleObjects blocking #9 - thread 1: gdb_select: WaitForMultipleObjects blocking (INFINITE) But, GDBserver already sent all it had to send, so both threads waits forever... At first I thought that net_windows_wait_handle shouldn't be resetting state->base.read_event or state->base.except_event, but looking deeper, the pipe and console wait_handle hooks reset all events too. It actually makes sense that way -- consuming an event from different threads is bad practice, and, we should always be able to query pending state without looking at the state->sock_event from within net_windows_wait_handle. The end result is much simpler, and makes net_windows_select_thread look a lot like console_select_thread, actually. gdb/ 2014-06-11 Pedro Alves <palves@redhat.com> PR remote/17028 * ser-mingw.c (net_windows_socket_check_pending): New function. (net_windows_select_thread): Ignore spurious wakeups. Use net_windows_socket_check_pending. (net_windows_wait_handle): Check for pending events with ioctlsocket, through net_windows_socket_check_pending, instead of checking the socket's event.
2014-06-11 12:04:31 +02:00
2014-06-11 Pedro Alves <palves@redhat.com>
PR remote/17028
* ser-mingw.c (net_windows_socket_check_pending): New function.
(net_windows_select_thread): Ignore spurious wakeups. Use
net_windows_socket_check_pending.
(net_windows_wait_handle): Check for pending events with
ioctlsocket, through net_windows_socket_check_pending, instead of
checking the socket's event.
2014-06-10 Siva Chandra Reddy <sivachandra@google.com>
* python/python-internal.h (gdb_PyObject_GetAttrString)
(gdb_PyObject_HasAttrString): New inline function definitions.
* py-value.c (get_field_flag): Remove the now unnecessary cast to
char * of the second argument to PyObject_GetAttrString.
2014-06-10 Joel Brobecker <brobecker@adacore.com>
* serial.c (serial_write): Fix index of character to be printed
in call to serial_logchar when serial debug traces are enabled.
2014-06-10 Joel Brobecker <brobecker@adacore.com>
* gdbtypes (resolve_dynamic_range): Add function description.
2014-06-09 Pedro Alves <palves@redhat.com>
* linux-nat.c (linux_child_follow_fork): Initialize status with
W_STOPCODE (0) instead of 0. Remove shodowing 'status' local from
inner block. Only pass the signal to PTRACE_DETACH if in pass
state.
2014-06-09 Gary Benson <gbenson@redhat.com>
* common/signals.c (gdb_signal_from_host): Reorder to separate
the always-available ANSI-standard signals from the signals that
require checking.
(do_gdb_signal_to_host): Likewise.
* proc-events.c (signal_table): Likewise.
2014-06-08 Hui Zhu <hui@codesourcery.com>
* common/linux-ptrace.c (linux_disable_event_reporting): New
function.
* common/linux-ptrace.h (linux_disable_event_reporting): New
declaration.
* linux-nat.c (linux_child_follow_fork): Do a single step before
detach.
2014-06-07 Keith Seitz <keiths@redhat.com>
Revert:
PR c++/16253
* ada-lang.c (ada_symbol_matches_domain): Moved here and renamed
from symbol_matches_domain in symtab.c. All local callers
of symbol_matches_domain updated.
(standard_lookup): If DOMAIN is VAR_DOMAIN and no symbol is found,
search STRUCT_DOMAIN.
(ada_find_any_type_symbol): Do not search STRUCT_DOMAIN
independently. standard_lookup will do that automatically.
* cp-namespace.c (cp_lookup_symbol_nonlocal): Explain when/why
VAR_DOMAIN searches may return a STRUCT_DOMAIN match.
(cp_lookup_symbol_in_namespace): Likewise.
If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN.
(cp_lookup_symbol_exports): Explain when/why VAR_DOMAIN searches
may return a STRUCT_DOMAIN match.
(lookup_symbol_file): Search for the class name in STRUCT_DOMAIN.
* cp-support.c: Include language.h.
(inspect_type): Explicitly search STRUCT_DOMAIN before searching
VAR_DOMAIN.
* psymtab.c (match_partial_symbol): Compare the requested
domain with the symbol's domain directly.
(lookup_partial_symbol): Likewise.
* symtab.c (lookup_symbol_in_language): Explain when/why
VAR_DOMAIN searches may return a STRUCT_DOMAIN match.
If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN for
appropriate languages.
(symbol_matches_domain): Renamed `ada_symbol_matches_domain'
and moved to ada-lang.c
(lookup_block_symbol): Explain that this function only returns
symbol matching the requested DOMAIN.
Compare the requested domain with the symbol's domain directly.
(iterate_over_symbols): Compare the requested domain with the
symbol's domain directly.
* symtab.h (symbol_matches_domain): Remove.
2014-06-07 01:08:54 +02:00
2014-06-06 Doug Evans <xdje42@gmail.com>
* guile/guile-internal.h (gdbscm_guile_major_version): Declare.
(gdbscm_guile_minor_version, gdbscm_guile_micro_version): Declare.
(gdbscm_guile_version_is_at_least): Declare.
(gdbscm_scm_string_to_int): Declare.
* guile/guile.c (gdbscm_guile_major_version): New global.
(gdbscm_guile_minor_version, gdbscm_guile_micro_version): New globals.
(guile_datadir): New static global.
(gdbscm_guile_data_directory): New function.
(initialize_scheme_side): Update.
(misc_guile_functions): Add guile-data-directory.
(initialize_gdb_module): Fetch guile version number.
* guile/lib/gdb.scm: Remove call to add-to-load-path.
* guile/lib/gdb/init.scm (%initialize!): Ditto.
* guile/lib/gdb/boot.scm: Use guile-data-directory.
* guile/scm-exception.c (gdbscm_print_exception_with_stack): Fix
comments.
* guile/scm-string.c (gdbscm_scm_string_to_int): New function.
* guile/scm-utils.c (gdbscm_guile_version_is_at_least): New function.
* guile/scm-value.c (gdbscm_value_to_string): Only call
scm_port_conversion_strategy if Guile version >= 2.0.6.
2014-06-06 11:51:30 +02:00
2014-06-06 Mingjie Xing <mingjie.xing@gmail.com>
* main.c (print_gdb_help): Add -q and --silent.
2014-06-06 Gary Benson <gbenson@redhat.com>
* common/signals.c: Remove preprocessor conditionals for
always-defined signals SIGINT, SIGILL, SIGABRT, SIGFPE,
SIGSEGV and SIGTERM.
* proc-events.c: Likewise.
2014-06-06 Markus Metzger <markus.t.metzger@intel.com>
* symfile.c (symfile_free_objfile): Remove restriction to
OBJF_USERLOADED.
* symfile-mem.c (symbol_file_add_from_memory): Call
add_target_sections_of_objfile.
2014-06-05 Ludovic Courtès <ludo@gnu.org>
* guile/scm-value.c (gdbscm_history_append_x): Use
'vlscm_get_value_smob_arg_unsafe' instead of
'vlscm_scm_to_value'.
PR mi/15806: Fix quoting of async events Original patch: https://sourceware.org/ml/gdb-patches/2014-04/msg00552.html New in v2: * In remote.c:escape_buffer, pass '\\' to fputstrn_unfiltered/printchar to make sure backslashes are escaped in remote debug output. * Updated function documentation for printchar. See updated ChangeLog below. -------------------- The quoting in whatever goes in the event_channel of MI is little bit broken. Link for the lazy: https://sourceware.org/bugzilla/show_bug.cgi?id=15806 Here is an example of a =library-loaded event with an ill-named directory, /tmp/how"are\you (the problem is present with every directory on Windows since it uses backslashes as a path separator). The result will be the following: =library-loaded,id="/tmp/how"are\\you/libexpat.so.1",... The " between 'how' and 'are' should be escaped. Another bad behavior is double escaping in =breakpoint-created, for example: =breakpoint-created,bkpt={...,fullname="/tmp/how\\"are\\\\you/test.c",...} The two backslashes before 'how' should be one and the four before 'you' should be two. The reason for this is that when sending something to an MI console, escaping can take place at two different moments (the actual escaping work is always done in the printchar function): 1. When generating the content, if ui_out_field_* functions are used. Here, fields are automatically quoted with " and properly escaped. At least mi_field_string does it, not sure about mi_field_fmt, I need to investigate further. 2. When gdb_flush is called, to send the data in the buffer of the console to the actual output (stdout). At this point, mi_console_raw_packet takes the whole string in the buffer, quotes it, and escapes all occurences of the quoting character and backslashes. The event_channel does not specify a quoting character, so quotes are not escaped here, only backslashes. The problem with =library-loaded is that it does use fprintf_unfiltered, which doesn't do escaping (so, no #1). When gdb_flush is called, backslashes are escaped (#2). The problem with =breakpoint-created is that it first uses ui_out_field_* functions to generate its output, so backslashes and quotes are escaped there (#1). backslashes are escaped again in #2, leading to an overdose of backslashes. In retrospect, there is no way escaping can be done reliably in mi_console_raw_packet for data that is already formatted, such as event_channel. At this point, there is no way to differentiate quotes that delimit field values from those that should be escaped. In the case of other MI consoles, it is ok since mi_console_raw_packet receives one big string that should be quoted and escaped as a whole. So, first part of the fix: for the MI channels that specify no quoting character, no escaping at all should be done in mi_console_raw_packet (that's the change in printchar, thanks to Yuanhui Zhang for this). For those channels, whoever generates the content is responsible for proper quoting and escaping. This will fix the =breakpoint-created kind of problem. Second part of the fix is to make =library-loaded generate content that is properly escaped. For this, we use ui_out_field_* functions, instead of one big fprintf_unfiltered. =library-unloaded suffered from the same problem so it is modified as well. There might be other events that need fixing too, but that's all I found with a quick scan. Those that use fprintf_unfiltered but whose sole variable data is a %d are not critical, since it won't generate a " or a \. Finally, a test has been fixed, as it was expecting an erroneous output. Otherwise, all other tests that were previously passing still pass (x86-64 linux). gdb/ChangeLog: 2014-06-02 Simon Marchi <simon.marchi@ericsson.com> PR mi/15806 * utils.c (printchar): Don't escape at all if quoter is NUL. Update function documentation to clarify effect of parameter QUOTER. * remote.c (escape_buffer): Pass '\\' as the quoter to fputstrn_unfiltered. * mi/mi-interp.c (mi_solib_loaded): Use ui_out_field_* functions to generate the output. (mi_solib_unloaded): Same. gdb/testsuite/ChangeLog: 2014-06-02 Simon Marchi <simon.marchi@ericsson.com> * gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify): Fix erroneous dprintf expected input.
2014-06-02 23:10:36 +02:00
2014-06-05 Simon Marchi <simon.marchi@ericsson.com>
PR mi/15806
* utils.c (printchar): Don't escape at all if quoter is NUL.
Update function documentation to clarify effect of parameter
QUOTER.
* remote.c (escape_buffer): Pass '\\' as the quoter to
fputstrn_unfiltered.
* mi/mi-interp.c (mi_solib_loaded): Use ui_out_field_* functions to
generate the output.
(mi_solib_unloaded): Same.
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-04 Doug Evans <xdje42@gmail.com>
* guile/scm-breakpoint.c (struct gdbscm_breakpoint_object): New members
is_scheme_bkpt, spec.
(bpscm_make_breakpoint_smob): Initialize new members.
(gdbscm_create_breakpoint_x): Split into two ...
(gdbscm_make_breakpoint, gdbscm_register_breakpoint_x): New functions.
(bpscm_breakpoint_deleted): Reset breakpoint number and stop function.
(scheme_function breakpoint_functions): Update.
* guile/lib/gdb.scm: Delete create-breakpoint!. Rename
breakpoint-delete! to delete-breakpoint!. Add make-breakpoint,
register-breakpoint!.
2014-06-04 Joel Brobecker <brobecker@adacorer.com>
PR server/17023
* mem-break.c (z_type_supported): Return zero if
THE_TARGET->SUPPORTS_Z_POINT_TYPE is NULL.
2014-06-04 Tom Tromey <tromey@redhat.com>
* ada-lang.c (ada_template_to_fixed_record_type_1): Use
value_from_contents_and_address_unresolved.
(ada_template_to_fixed_record_type_1): Likewise.
(ada_which_variant_applies): Likewise.
* value.h (value_from_contents_and_address_unresolved): Declare.
* value.c (value_from_contents_and_address_unresolved): New
function.
* gdbtypes.c (is_dynamic_type, resolve_dynamic_type)
<TYPE_CODE_STRUCT, TYPE_CODE_UNION>: New cases.
(resolve_dynamic_struct, resolve_dynamic_union): New functions.
2014-06-04 Tom Tromey <tromey@redhat.com>
* gdbtypes.c (is_dynamic_type): Remove unneeded "break"s.
2014-06-04 Tom Tromey <tromey@redhat.com>
* procfs.c (procfs_attach): Make "args" const.
* windows-nat.c (windows_attach): Make "args" const.
* nto-procfs.c (procfs_attach): Make "args" const.
* inf-ttrace.c (inf_ttrace_attach): Make "args" const.
* go32-nat.c (go32_attach): Make "args" const.
* gnu-nat.c (gnu_attach): Make "args" const.
* darwin-nat.c (darwin_attach): Make "args" const.
* inf-ptrace.c (inf_ptrace_attach): Make "args" const.
* linux-nat.c (linux_nat_attach): Make "args" const.
* remote.c (extended_remote_attach_1, extended_remote_attach):
Make "args" const.
* target.h (struct target_ops) <to_attach>: Make "args" const.
(find_default_attach): Likewise.
* utils.c (parse_pid_to_attach): Make "args" const.
* utils.h (parse_pid_to_attach): Update.
2014-06-04 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (default_thread_address_space): New function.
(target_thread_address_space): Simplify.
* target.h (struct target_ops) <to_thread_address_space>: Add
TARGET_DEFAULT_FUNC.
2014-06-04 Doug Evans <xdje42@gmail.com>
* guile/scm-type.c (type_smob): Remove duplicate typedef.
2014-06-04 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c: Include event-loop.h and inf-loop.h.
(record_btrace_resume_exec_dir)
(record_btrace_async_inferior_event_handler)
(record_btrace_handle_async_inferior_event): New.
(record_btrace_open): Create async event handler.
(record_btrace_close): Delete async event handler.
(record_btrace_resume): Set record_btrace_resume_exec_dir,
Mark async event handler.
(record_btrace_execution_direction): New.
(init_record_btrace_ops): Initialize to_execution_direction.
2014-06-03 Doug Evans <xdje42@gmail.com>
* guile/scm-param.c (pascm_make_param_smob): Add ARI comment.
(gdbscm_make_parameter): Ditto.
2014-06-03 Doug Evans <dje@google.com>
* exec.c (exec_close_1): Call clear_section_table instead of
resize_section_table.
(clear_section_table): New function.
(resize_section_table): Make static. Rename arg num_added to
adjustment.
* exec.h (clear_section_table): Declare.
(resize_section_table): Delete.
* progspace.c (release_program_space): Call clear_section_table
instead of resize_section_table.
2014-06-03 Siva Chandra Reddy <sivachandra@google.com>
* NEWS (Python Scripting): Add entry about the new xmethods
feature.
2014-06-03 Siva Chandra Reddy <sivachandra@google.com>
* python/py-xmethods.c: New file.
* python/py-objfile.c (objfile_object): New field 'xmethods'.
(objfpy_dealloc): XDECREF on the new xmethods field.
(objfpy_new, objfile_to_objfile_object): Initialize xmethods
field.
(objfpy_get_xmethods): New function.
(objfile_getset): New entry 'xmethods'.
* python/py-progspace.c (pspace_object): New field 'xmethods'.
(pspy_dealloc): XDECREF on the new xmethods field.
(pspy_new, pspace_to_pspace_object): Initialize xmethods
field.
(pspy_get_xmethods): New function.
(pspace_getset): New entry 'xmethods'.
* python/python-internal.h: Add declarations for new functions.
* python/python.c (_initialize_python): Invoke
gdbpy_initialize_xmethods.
* python/lib/gdb/__init__.py (xmethods): New
attribute.
* python/lib/gdb/xmethod.py: New file.
* python/lib/gdb/command/xmethods.py: New file.
2014-06-03 Siva Chandra Reddy <sivachandra@google.com>
* eval.c (evaluate_subexp_standard): Call the xmethod if the
best match method returned by find_overload_match is an xmethod.
* valarith.c (value_x_binop, value_x_unop): Call the xmethod if
the best matching operator returned by find_overload_match is an
xmethod.
* valops.c: #include "extension.h".
(find_method_list): Add "fn_list" and "xm_worker_vec" arguments.
Return void. The list of matching source methods is returned in
"fn_list" and a vector of matching debug method workers is
returned in "xm_worker_vec". Update all callers.
(value_find_oload_method_list): Likewise.
(find_oload_champ): Add "xm_worker_vec" parameter. If it is
non-NULL, then the index of the best matching method in this
vector is returned. Update all callers.
(find_overload_match): Include xmethods while performing overload
resolution.
2014-06-03 Siva Chandra Reddy <sivachandra@google.com>
* defs.h (enum lval_type): New enumerator "lval_xcallable".
* extension-priv.h (struct extension_language_ops): Add the
xmethod interface.
* extension.c (new_xmethod_worker, clone_xmethod_worker,
get_matching_xmethod_workers, get_xmethod_argtypes,
invoke_xmethod, free_xmethod_worker,
free_xmethod_worker_vec): New functions.
* extension.h: #include "common/vec.h".
New function declarations.
(struct xmethod_worker): New struct.
(VEC (xmethod_worker_ptr)): New vector type.
(xmethod_worker_ptr): New typedef.
(xmethod_worker_vec): Likewise.
* gdbtypes.c (gdbtypes_post_init): Initialize "xmethod" field of
builtin_type.
* gdbtypes.h (enum type_code): New enumerator TYPE_CODE_XMETHOD.
(struct builtin_type): New field "xmethod".
* valarith.c (value_ptradd): Assert that the value argument is not
lval_xcallable.
* valops.c (value_must_coerce_to_target): Return 0 for
lval_xcallable values.
* value.c (struct value): New field XM_WORKER in the field
LOCATION.
(value_address, value_raw_address): Return 0 for lval_xcallable
values.
(set_value_address): Assert that the value is not an
lval_xcallable.
(value_free): Free the associated xmethod worker when freeing
lval_xcallable values.
(set_value_component_location): Assert that the WHOLE value is not
lval_xcallable.
(value_of_xmethod, call_xmethod): New functions.
* value.h: Declare "struct xmethod_worker".
Declare new functions value_of_xmethod, call_xmethod.
User breakpoint ignored if software-single-step at same location with the following code... 12 Nested; -- break #1 13 return I; -- break #2 14 end; (line 12 is a call to function Nested) ... we have noticed the following errorneous behavior on ppc-aix, where, after having inserted a breakpoint at line 12 and line 13, and continuing from the breakpoint at line 12, the program never stops at line 13, running away until the program terminates: % gdb -q func (gdb) b func.adb:12 Breakpoint 1 at 0x10000a24: file func.adb, line 12. (gdb) b func.adb:13 Breakpoint 2 at 0x10000a28: file func.adb, line 13. (gdb) run Starting program: /[...]/func Breakpoint 1, func () at func.adb:12 12 Nested; -- break #1 (gdb) c Continuing. [Inferior 1 (process 4128872) exited with code 02] When resuming from the first breakpoint, GDB first tries to step out of that first breakpoint. We rely on software single-stepping on this platform, and it just so happens that the address of the first software single-step breakpoint is the same as the user's breakpoint #2 (0x10000a28). So, with infrun and target traces turned on (but uninteresting traces snip'ed off), the "continue" operation looks like this: (gdb) c ### First, we insert the user breakpoints (the second one is an internal ### breakpoint on __pthread_init). The first user breakpoint is not ### inserted as we need to step out of it first. target_insert_breakpoint (0x0000000010000a28, xxx) = 0 target_insert_breakpoint (0x00000000d03f3800, xxx) = 0 ### Then we proceed with the step-out-of-breakpoint... infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [process 15335610] at 0x10000a24 ### That's when we insert the SSS breakpoints... target_insert_breakpoint (0x0000000010000a28, xxx) = 0 target_insert_breakpoint (0x00000000100009ac, xxx) = 0 ### ... then let the inferior resume... target_resume (15335610, continue, 0) infrun: wait_for_inferior () target_wait (-1, status, options={}) = 15335610, status->kind = stopped, signal = GDB_SIGNAL_TRAP infrun: target_wait (-1, status) = infrun: 15335610 [process 15335610], infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x100009ac ### At this point, we stopped at the second SSS breakpoint... target_stopped_by_watchpoint () = 0 ### We remove the SSS breakpoints... target_remove_breakpoint (0x0000000010000a28, xxx) = 0 target_remove_breakpoint (0x00000000100009ac, xxx) = 0 target_stopped_by_watchpoint () = 0 ### We find that we're not done, so we resume.... infrun: no stepping, continue ### And thus insert the user breakpoints again, except we're not ### inserting the second breakpoint?!? target_insert_breakpoint (0x0000000010000a24, xxx) = 0 infrun: resume (step=0, signal=GDB_SIGNAL_0), trap_expected=0, current thread [process 15335610] at 0x100009ac target_resume (-1, continue, 0) infrun: prepare_to_wait target_wait (-1, status, options={}) = 15335610, status->kind = exited, status = 2 What happens is that the removal of the software single-step breakpoints effectively removed the breakpoint instruction from inferior memory. But because such breakpoints are inserted directly as raw breakpoints rather than through the normal chain of breakpoints, we fail to notice that one of the user breakpoints points to the same address and that this user breakpoint is therefore effectively un-inserted. When resuming after the single-step, GDB thinks that the user breakpoint is still inserted and therefore does not need to insert it again. This patch teaches the insert and remove routines of both regular and raw breakpoints to be aware of each other. Special care needs to be applied in case the target supports evaluation of breakpoint conditions or commands. gdb/ChangeLog: PR breakpoints/17000 * breakpoint.c (find_non_raw_software_breakpoint_inserted_here): New function, extracted from software_breakpoint_inserted_here_p. (software_breakpoint_inserted_here_p): Replace factored out code by call to find_non_raw_software_breakpoint_inserted_here. (bp_target_info_copy_insertion_state): New function. (bkpt_insert_location): Handle the case of a single-step breakpoint already inserted at the same address. (bkpt_remove_location): Handle the case of a single-step breakpoint still inserted at the same address. (deprecated_insert_raw_breakpoint): Handle the case of non-raw breakpoint already inserted at the same address. (deprecated_remove_raw_breakpoint): Handle the case of a non-raw breakpoint still inserted at the same address. (find_single_step_breakpoint): New function, extracted from single_step_breakpoint_inserted_here_p. (find_single_step_breakpoint): New function, factored out from single_step_breakpoint_inserted_here_p. (single_step_breakpoint_inserted_here_p): Reimplement. gdb/testsuite/ChangeLog: PR breakpoints/17000 * gdb.base/sss-bp-on-user-bp.exp: Remove kfail. * gdb.base/sss-bp-on-user-bp-2.exp: Remove kfail. Tested on ppc-aix with AdaCore's testsuite. Tested on x86_64-linux, (native and gdbserver) with the official testsuite. Also tested on x86_64-linux through Pedro's branch enabling software single-stepping on that platform (native and gdbserver).
2014-06-03 18:42:19 +02:00
2014-06-03 Joel Brobecker <brobecker@adacore.com>
Pedro Alves <palves@redhat.com>
PR breakpoints/17000
* breakpoint.c (find_non_raw_software_breakpoint_inserted_here):
New function, extracted from software_breakpoint_inserted_here_p.
(software_breakpoint_inserted_here_p): Replace factored out code
by call to find_non_raw_software_breakpoint_inserted_here.
(bp_target_info_copy_insertion_state): New function.
(bkpt_insert_location): Handle the case of a single-step
breakpoint already inserted at the same address.
(bkpt_remove_location): Handle the case of a single-step
breakpoint still inserted at the same address.
(deprecated_insert_raw_breakpoint): Handle the case of non-raw
breakpoint already inserted at the same address.
(deprecated_remove_raw_breakpoint): Handle the case of a
non-raw breakpoint still inserted at the same address.
(find_single_step_breakpoint): New function, extracted from
single_step_breakpoint_inserted_here_p.
(find_single_step_breakpoint): New function,
factored out from single_step_breakpoint_inserted_here_p.
(single_step_breakpoint_inserted_here_p): Reimplement.
gdb/source.c: Fix matching path substitute rule listing The check for the source (or "from") directory snippet in listing matching path substitution rules currently will not match anything other than a direct match of the "from" field in a substitution rule, resulting in the incorrect behavior below: ... (gdb) set substitute-path /a/path /another/path (gdb) show substitute-path List of all source path substitution rules: `/a/path' -> `/another/path'. (gdb) show substitute-path /a/path/to/a/file.ext Source path substitution rule matching `/a/path/to/a/file.ext': (gdb) show substitute-path /a/path Source path substitution rule matching `/a/path': `/a/path' -> `/another/path'. ... This change effects the following behavior by (sanely) checking with the length of the "from" portion of a rule and ensuring that the next character of the path considered for substitution is a path delimiter (or NULL). With this change, the following behavior is garnered: ... (gdb) set substitute-path /a/path /another/path (gdb) show substitute-path List of all source path substitution rules: `/a/path' -> `/another/path'. (gdb) show substitute-path /a/path/to/a/file.ext Source path substitution rule matching `/a/path/to/a/file.ext': `/a/path' -> `/another/path'. (gdb) show substitute-path /a/pathological/case/that/should/fail.err Source path substitution rule matching `/a/pathological/case/that/should/fail.err': (gdb) Also included is a couple of tests added to subst.exp to verify this behavior in the test suite. gdb/ChangeLog: * source.c (show_substitute_path_command): Fix display of matching substitution rules. gdb/testsuite/ChangeLog: * gdb.ada/subst.exp: Add tests to verify partial path matching output. This was tested on x86_64 Linux.
2014-06-02 22:55:10 +02:00
2014-06-03 Brad Mouring <bmouring@ni.com> (tiny patch)
Pushed by Joel Brobecker <brobecker@adacore.com>
* source.c (show_substitute_path_command): Fix display of matching
substitution rules.
2014-06-03 Gary Benson <gbenson@redhat.com>
* gnu-v2-abi.c (gnuv2_value_rtti_type): Use gdb_demangle.
2014-06-02 Doug Evans <xdje42@gmail.com>
Add parameter support for Guile.
* Makefile.in (SUBDIR_GUILE_OBS): Add scm-param.o.
(SUBDIR_GUILE_SRCS): Add scm-param.c.
(scm-param.o): New rule.
* guile/guile-internal.h (gdbscm_gc_dup_argv): Declare.
(gdbscm_misc_error): Declare.
(gdbscm_canonicalize_command_name): Declare.
(gdbscm_scm_to_host_string): Declare.
(gdbscm_scm_from_host_string): Declare.
(gdbscm_initialize_parameters): Declare.
* guile/guile.c (initialize_gdb_module): Call
gdbscm_initialize_parameters.
* guile/lib/gdb.scm: Export parameter symbols.
* guile/scm-cmd.c (gdbscm_canonicalize_command_name): Renamed from
cmdscm_canonicalize_name and made public. All callers updated.
* guile/scm-exception.c (gdbscm_misc_error): New function.
* guile/scm-param.c: New file.
* guile/scm-string.c (gdbscm_scm_to_string): Add comments.
(gdbscm_scm_to_host_string): New function.
(gdbscm_scm_from_host_string): New function.
* scm-utils.c (gdbscm_gc_dup_argv): New function.
2014-06-02 Doug Evans <xdje42@gmail.com>
Add command support for Guile.
* Makefile.in (SUBDIR_GUILE_OBS): Add scm-cmd.o.
(SUBDIR_GUILE_SRCS): Add scm-cmd.c.
(scm-cmd.o): New rule.
* guile/guile-internal.h (gdbscm_gc_xstrdup): Declare.
(gdbscm_user_error_p): Declare.
(gdbscm_parse_command_name): Declare.
(gdbscm_valid_command_class_p): Declare.
(gdbscm_initialize_commands): Declare.
* guile/guile.c (initialize_gdb_module): Call
gdbscm_initialize_commands.
* guile/lib/gdb.scm: Export command symbols.
* guile/lib/gdb/init.scm (%exception-keys): Add gdb:user-error.
(throw-user-error): New function.
* guile/scm-cmd.c: New file.
* guile/scm-exception.c (user_error_symbol): New static global.
(gdbscm_user_error_p): New function.
(gdbscm_initialize_exceptions): Set user_error_symbol.
* scm-utils.c (gdbscm_gc_xstrdup): New function.
2014-06-02 Phil Muldoon <pmuldoon@redhat.com>
* top.c (command_loop): Handle comments here...
(command_line_input): ... not here.
2014-06-02 Doug Evans <xdje42@gmail.com>
Add progspace support for Guile.
* Makefile.in (SUBDIR_GUILE_OBS): Add scm-progspace.o.
(SUBDIR_GUILE_SRCS): Add scm-progspace.c.
(scm-progspace.o): New rule.
* guile/guile-internal.h (pspace_smob): New typedef.
(psscm_pspace_smob_pretty_printers): Declare.
(psscm_pspace_smob_from_pspace): Declare.
(psscm_scm_from_pspace): Declare.
* guile/guile.c (initialize_gdb_module): Call
gdbscm_initialize_pspaces.
* guile/lib/gdb.scm: Export progspace symbols.
* guile/lib/gdb/printing.scm (prepend-pretty-printer!): Add progspace
support.
(append-pretty-printer!): Ditto.
* guile/scm-pretty-print.c (ppscm_find_pretty_printer_from_progspace):
Implement.
* guile/scm-progspace.c: New file.
2014-06-03 Alan Modra <amodra@gmail.com>
* ppc64-tdep.c (ppc64_standard_linkage8): New.
(ppc64_skip_trampoline_code): Recognise ELFv2 stub supporting fusion.
2014-06-02 Doug Evans <dje@google.com>
Add support for skeletonless type units.
* dwarf2read.c (struct dwarf2_per_objfile): New member
n_allocated_type_units.
(struct dwarf2_per_objfile) <tu_stats>: New member
nr_all_type_units_reallocs.
(create_signatured_type_table_from_index): Initialize
n_allocated_type_units
(create_all_type_units): Ditto.
(add_type_unit): Move up in file. New arg slot.
All callers updated. Increase space for all_type_units more
efficiently.
(fill_in_sig_entry_from_dwo_entry): Handle psymtabs.
(lookup_dwo_signatured_type): Handle skeletonless TUs.
(lookup_dwp_signatured_type): Ditto.
(init_tu_and_read_dwo_dies): New arg use_existing_cu.
All callers updated.
(build_type_psymtabs_1): Leave type_unit_groups as
NULL if no TUs present.
(print_tu_stats): New function.
(process_skeletonless_type_unit): New function.
(process_dwo_file_for_skeletonless_type_units): New
function.
(process_skeletonless_type_units): New function.
(dwarf2_build_psymtabs_hard): Handle skeletonless TUs.
Call print tu_stats if debugging enabled.
2014-06-02 Pedro Alves <palves@redhat.com>
* breakpoint.c (build_target_command_list): Don't build a command
list if we have any duplicate location that isn't a dprintf.
2014-06-02 Pedro Alves <palves@redhat.com>
* breakpoint.c (dprintf_breakpoint_hit): New function.
(initialize_breakpoint_ops): Install it as dprintf's
breakpoint_hit method.
2014-06-02 Joel Brobecker <brobecker@adacore.com>
* source.c (substitute_path_rule_matches): Simplify using
filename_ncmp instead of FILENAME_CMP.
2014-06-02 Joel Brobecker <brobecker@adacore.com>
* source.c (substitute_path_rule_matches): Remove trailing spaces.
2014-06-01 Ludovic Courtès <ludo@gnu.org>
* configure.ac: When Guile is available, check for the
availability of 'scm_new_smob'.
* configure, config.h.in: Regenerate.
* guile/guile-internal.h (scm_new_smob) [!HAVE_SCM_NEW_SMOB]: New
function.
Add a TRY_CATCH to get_prev_frame_always to better manage errors during unwind. https://sourceware.org/ml/gdb-patches/2014-05/msg00737.html Currently a MEMORY_ERROR raised during unwinding a frame will cause the unwind to stop with an error message, for example: (gdb) bt #0 breakpt () at amd64-invalid-stack-middle.c:27 #1 0x00000000004008f0 in func5 () at amd64-invalid-stack-middle.c:32 #2 0x0000000000400900 in func4 () at amd64-invalid-stack-middle.c:38 #3 0x0000000000400910 in func3 () at amd64-invalid-stack-middle.c:44 #4 0x0000000000400928 in func2 () at amd64-invalid-stack-middle.c:50 Cannot access memory at address 0x2aaaaaab0000 However, frame #4 is marked as being the end of the stack unwind, so a subsequent request for the backtrace looses the error message, such as: (gdb) bt #0 breakpt () at amd64-invalid-stack-middle.c:27 #1 0x00000000004008f0 in func5 () at amd64-invalid-stack-middle.c:32 #2 0x0000000000400900 in func4 () at amd64-invalid-stack-middle.c:38 #3 0x0000000000400910 in func3 () at amd64-invalid-stack-middle.c:44 #4 0x0000000000400928 in func2 () at amd64-invalid-stack-middle.c:50 When fetching the backtrace, or requesting the stack depth using the MI interface the situation is even worse, the first time a request is made we encounter the memory error and so the MI returns an error instead of the correct result, for example: (gdb) -stack-info-depth ^error,msg="Cannot access memory at address 0x2aaaaaab0000" Or, (gdb) -stack-list-frames ^error,msg="Cannot access memory at address 0x2aaaaaab0000" However, once one of these commands has been used gdb has, internally, walked the stack and figured that out that frame #4 is the bottom of the stack, so the second time an MI command is tried you'll get the "expected" result: (gdb) -stack-info-depth ^done,depth="5" Or, (gdb) -stack-list-frames ^done,stack=[frame={level="0", .. snip lots .. }] After this patch the MEMORY_ERROR encountered during the frame unwind is attached to frame #4 as the stop reason, and is displayed in the CLI each time the backtrace is requested. In the MI, catching the error means that the "expected" result is returned the first time the MI command is issued. So, from the CLI the results of the backtrace will be: (gdb) bt #0 breakpt () at amd64-invalid-stack-middle.c:27 #1 0x00000000004008f0 in func5 () at amd64-invalid-stack-middle.c:32 #2 0x0000000000400900 in func4 () at amd64-invalid-stack-middle.c:38 #3 0x0000000000400910 in func3 () at amd64-invalid-stack-middle.c:44 #4 0x0000000000400928 in func2 () at amd64-invalid-stack-middle.c:50 Backtrace stopped: Cannot access memory at address 0x2aaaaaab0000 Each and every time that the backtrace is requested, while the MI output will similarly be consistently: (gdb) -stack-info-depth ^done,depth="5" Or, (gdb) -stack-list-frames ^done,stack=[frame={level="0", .. snip lots .. }] gdb/ChangeLog: * frame.c (struct frame_info): Add stop_string field. (get_prev_frame_always_1): Renamed from get_prev_frame_always. (get_prev_frame_always): Old content moved into get_prev_frame_always_1. Call get_prev_frame_always_1 inside TRY_CATCH, handle MEMORY_ERROR exceptions. (frame_stop_reason_string): New function definition. * frame.h (unwind_stop_reason_to_string): Extend comment to mention frame_stop_reason_string. (frame_stop_reason_string): New function declaration. * stack.c (frame_info): Switch to frame_stop_reason_string. (backtrace_command_1): Switch to frame_stop_reason_string. * unwind_stop_reason.def: Add UNWIND_MEMORY_ERROR. (LAST_ENTRY): Changed to UNWIND_MEMORY_ERROR. * guile/lib/gdb.scm: Add FRAME_UNWIND_MEMORY_ERROR to export list. gdb/doc/ChangeLog: * guile.texi (Frames In Guile): Mention FRAME_UNWIND_MEMORY_ERROR. * python.texi (Frames In Python): Mention gdb.FRAME_UNWIND_MEMORY_ERROR. gdb/testsuite/ChangeLog: * gdb.arch/amd64-invalid-stack-middle.exp: Update expected results. * gdb.arch/amd64-invalid-stack-top.exp: Likewise.
2014-05-29 00:34:43 +02:00
2014-05-30 Andrew Burgess <aburgess@broadcom.com>
* frame.c (struct frame_info): Add stop_string field.
(get_prev_frame_always_1): Renamed from get_prev_frame_always.
(get_prev_frame_always): Old content moved into
get_prev_frame_always_1. Call get_prev_frame_always_1 inside
TRY_CATCH, handle MEMORY_ERROR exceptions.
(frame_stop_reason_string): New function definition.
* frame.h (unwind_stop_reason_to_string): Extend comment to
mention frame_stop_reason_string.
(frame_stop_reason_string): New function declaration.
* stack.c (frame_info): Switch to frame_stop_reason_string.
(backtrace_command_1): Switch to frame_stop_reason_string.
* unwind_stop_reason.def: Add UNWIND_MEMORY_ERROR.
(LAST_ENTRY): Changed to UNWIND_MEMORY_ERROR.
* guile/lib/gdb.scm: Add FRAME_UNWIND_MEMORY_ERROR to export list.
2014-05-30 Andrew Burgess <aburgess@broadcom.com>
* frame.c (frame_stop_reason_string): Rename to ...
(unwind_stop_reason_to_string): this.
* frame.h (frame_stop_reason_string): Rename to ...
(unwind_stop_reason_to_string): this.
* stack.c (frame_info): Update call to frame_stop_reason_string.
(backtrace_command_1): Likewise.
* guile/scm-frame.c (gdbscm_unwind_stop_reason_string): Likewise.
* python/py-frame.c (gdbpy_frame_stop_reason_string): Likewise.
2014-05-30 Andrew Burgess <aburgess@broadcom.com>
* frame.c (remove_prev_frame): New function.
(get_prev_frame_if_no_cycle): Create / discard cleanup using
remove_prev_frame.
2014-05-29 Pedro Alves <palves@redhat.com>
* infrun.c (resume): Rename local 'hw_step' to 'entry_step'
and make it const. When a single-step decays to a continue,
clear 'step', not 'hw_step'. Pass whether the caller wanted
to step to user_visible_resume_ptid, not what we ask the
target to do.
2014-05-29 Pedro Alves <palves@redhat.com>
* infrun.c (process_event_stop_test, handle_step_into_function)
(handle_step_into_function_backward): Adjust.
Don't set the even thread's stop_step and call stop_waiting before
calling end_stepping_range. Instead do that ...
(end_stepping_range): ... here. Take an ecs pointer parameter.
2014-05-29 Pedro Alves <palves@redhat.com>
* infrun.c (stop_stepping): Rename to ...
(stop_waiting): ... this.
(proceed): Update comment.
(process_event_stop_test, handle_inferior_event)
(handle_signal_stop, handle_step_into_function)
(handle_step_into_function_backward): Update.
unbreak infcalls I managed to miss an interaction between the recent *running patch, and target-async, which resulted in infcalls being completely broken on GNU/Linux and remote targets (that is, the async-capable targets). Temporary breakpoint 1, main () at threads.c:35 35 long i = 0; (gdb) p malloc (0) The program being debugged stopped while in a function called from GDB. Evaluation of the expression containing the function (malloc) will be abandoned. When the function is done executing, GDB will silently stop. (gdb) p malloc (0) Program received signal SIGSEGV, Segmentation fault. 0x000000000058d7e8 in get_regcache_aspace (regcache=0x0) at ../../src/gdb/regcache.c:281 281 return regcache->aspace; (top-gdb) The issue is that when running an infcall, the thread is no longer marked as running, so run_inferior_call is not calling wait_for_inferior anymore. Fix this by doing what the comment actually says we do: "Do here what `proceed' itself does in sync mode." And proceed doesn't check whether the target is running. I notice this is broken in case of the early return in proceed, but we were broken before in that case anyway, because run_inferior_call will think the call actually ran. Seems like we should make proceed have a boolean return, and go through all callers making use of it, if necessary. But for now, just fix the regression. Tested on x86_64 Fedora 20. gdb/ 2014-05-29 Pedro Alves <palves@redhat.com> * infcall.c (run_inferior_call): Don't check whether the current thread is running after the proceed call.
2014-05-29 18:17:30 +02:00
2014-05-29 Pedro Alves <palves@redhat.com>
* infcall.c (run_inferior_call): Don't check whether the current
thread is running after the proceed call.
enable target async by default; separate MI and target notions of async This finally makes background execution commands possible by default. However, in order to do that, there's one last thing we need to do -- we need to separate the MI and target notions of "async". Unlike the CLI, where the user explicitly requests foreground vs background execution in the execution command itself (c vs c&), MI chose to treat "set target-async" specially -- setting it changes the default behavior of execution commands. So, we can't simply "set target-async" default to on, as that would affect MI frontends. Instead we have to make the setting MI-specific, and teach MI about sync commands on top of an async target. Because the "target" word in "set target-async" ends up as a potential source of confusion, the patch adds a "set mi-async" option, and makes "set target-async" a deprecated alias. Rather than make the targets always async, this patch introduces a new "maint set target-async" option so that the GDB developer can control whether the target is async. This makes it simpler to debug issues arising only in the synchronous mode; important because sync mode seems unlikely to go away. Unlike in previous revisions, "set target-async" does not affect this new maint parameter. The rationale for this is that then one can easily run the test suite in the "maint set target-async off" mode and have tests that enable mi-async fail just like they fail on non-async-capable targets. This emulation is exactly the point of the maint option. I had asked Tom in a previous iteration to split the actual change of the target async default to a separate patch, but it turns out that that is quite awkward in this version of the patch, because with MI async and target async decoupled (unlike in previous versions), if we don't flip the default at the same time, then just "set target-async on" alone never actually manages to do anything. It's best to not have that transitory state in the tree. Given "set target-async on" now only has effect for MI, the patch goes through the testsuite removing it from non-MI tests. MI tests are adjusted to use the new and less confusing "mi-async" spelling. 2014-05-29 Pedro Alves <palves@redhat.com> Tom Tromey <tromey@redhat.com> * NEWS: Mention "maint set target-async", "set mi-async", and that background execution commands are now always available. * target.h (target_async_permitted): Update comment. * target.c (target_async_permitted, target_async_permitted_1): Default to 1. (set_target_async_command): Rename to ... (maint_set_target_async_command): ... this. (show_target_async_command): Rename to ... (maint_show_target_async_command): ... this. (_initialize_target): Adjust. * infcmd.c (prepare_execution_command): Make extern. * inferior.h (prepare_execution_command): Declare. * infrun.c (set_observer_mode): Leave target async alone. * mi/mi-interp.c (mi_interpreter_init): Install mi_on_sync_execution_done as sync_execution_done observer. (mi_on_sync_execution_done): New function. (mi_execute_command_input_handler): Don't print the prompt if we just started a synchronous command with an async target. (mi_on_resume): Check sync_execution before printing prompt. * mi/mi-main.h (mi_async_p): Declare. * mi/mi-main.c: Include gdbcmd.h. (mi_async_p): New function. (mi_async, mi_async_1): New globals. (set_mi_async_command, show_mi_async_command, mi_async): New functions. (exec_continue): Call prepare_execution_command. (run_one_inferior, mi_cmd_exec_run, mi_cmd_list_target_features) (mi_execute_async_cli_command): Use mi_async_p. (_initialize_mi_main): Install "set mi-async". Make "target-async" a deprecated alias. 2014-05-29 Pedro Alves <palves@redhat.com> Tom Tromey <tromey@redhat.com> * gdb.texinfo (Non-Stop Mode): Remove "set target-async 1" from example. (Asynchronous and non-stop modes): Document '-gdb-set mi-async'. Mention that target-async is now deprecated. (Maintenance Commands): Document maint set/show target-async. 2014-05-29 Pedro Alves <palves@redhat.com> Tom Tromey <tromey@redhat.com> * gdb.base/async-shell.exp: Don't enable target-async. * gdb.base/async.exp * gdb.base/corefile.exp (corefile_test_attach): Remove 'async' parameter. Adjust. (top level): Don't test with "target-async". * gdb.base/dprintf-non-stop.exp: Don't enable target-async. * gdb.base/gdb-sigterm.exp: Don't test with "target-async". * gdb.base/inferior-died.exp: Don't enable target-async. * gdb.base/interrupt-noterm.exp: Likewise. * gdb.mi/mi-async.exp: Use "mi-async" instead of "target-async". * gdb.mi/mi-nonstop-exit.exp: Likewise. * gdb.mi/mi-nonstop.exp: Likewise. * gdb.mi/mi-ns-stale-regcache.exp: Likewise. * gdb.mi/mi-nsintrall.exp: Likewise. * gdb.mi/mi-nsmoribund.exp: Likewise. * gdb.mi/mi-nsthrexec.exp: Likewise. * gdb.mi/mi-watch-nonstop.exp: Likewise. * gdb.multi/watchpoint-multi.exp: Adjust comment. * gdb.python/py-evsignal.exp: Don't enable target-async. * gdb.python/py-evthreads.exp: Likewise. * gdb.python/py-prompt.exp: Likewise. * gdb.reverse/break-precsave.exp: Don't test with "target-async". * gdb.server/solib-list.exp: Don't enable target-async. * gdb.threads/thread-specific-bp.exp: Likewise. * lib/mi-support.exp: Adjust to use mi-async.
2014-05-29 20:58:57 +02:00
2014-05-29 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
* NEWS: Mention "maint set target-async", "set mi-async", and that
background execution commands are now always available.
* target.h (target_async_permitted): Update comment.
* target.c (target_async_permitted, target_async_permitted_1):
Default to 1.
(set_target_async_command): Rename to ...
(maint_set_target_async_command): ... this.
(show_target_async_command): Rename to ...
(maint_show_target_async_command): ... this.
(_initialize_target): Adjust.
* infcmd.c (prepare_execution_command): Make extern.
* inferior.h (prepare_execution_command): Declare.
* infrun.c (set_observer_mode): Leave target async alone.
* mi/mi-interp.c (mi_interpreter_init): Install
mi_on_sync_execution_done as sync_execution_done observer.
(mi_on_sync_execution_done): New function.
(mi_execute_command_input_handler): Don't print the prompt if we
just started a synchronous command with an async target.
(mi_on_resume): Check sync_execution before printing prompt.
* mi/mi-main.h (mi_async_p): Declare.
* mi/mi-main.c: Include gdbcmd.h.
(mi_async_p): New function.
(mi_async, mi_async_1): New globals.
(set_mi_async_command, show_mi_async_command, mi_async): New
functions.
(exec_continue): Call prepare_execution_command.
(run_one_inferior, mi_cmd_exec_run, mi_cmd_list_target_features)
(mi_execute_async_cli_command): Use mi_async_p.
(_initialize_mi_main): Install "set mi-async". Make
"target-async" a deprecated alias.
Make display_gdb_prompt CLI-only. Enabling target-async by default will require implementing sync execution on top of an async target, much like foreground command are implemented on the CLI in async mode. In order to do that, we will need better control of when to print the MI prompt. Currently the interp->display_prompt_p hook is all we have, and MI just always returns false, meaning, make display_gdb_prompt a no-op. We'll need to be able to know to print the MI prompt in some of the conditions that display_gdb_prompt is called from the core, but not all. This is all a litte twisted currently. As we can see, display_gdb_prompt is really CLI specific, so make the console interpreters (console/tui) themselves call it. To be able to do that, and add a few different observers that the interpreters can use to distinguish when or why the the prompt is being printed: #1 - one called whenever a command is cancelled due to an error. #2 - another for when a foreground command just finished. In both cases, CLI wants to print the prompt, while MI doesn't. MI will want to print the prompt in the second case when in a special MI mode. The display_gdb_prompt call in interp_set made me pause. The comment there reads: /* Finally, put up the new prompt to show that we are indeed here. Also, display_gdb_prompt for the console does some readline magic which is needed for the console interpreter, at least... */ But, that looks very much like a no-op to me currently: - the MI interpreter always return false in the prompt hook, meaning actually display no prompt. - the interpreter used at that point is still quiet. And the console/tui interpreters return false in the prompt hook if they're quiet, meaning actually display no prompt. The only remaining possible use would then be the readline magic. But whatever that might have been, it's not reacheable today either, because display_gdb_prompt returns early, before touching readline if the interpreter returns false in the display_prompt_p hook. Tested on x86_64 Fedora 20, sync and async modes. gdb/ 2014-05-29 Pedro Alves <palves@redhat.com> * cli/cli-interp.c (cli_interpreter_display_prompt_p): Delete. (_initialize_cli_interp): Adjust. * event-loop.c: Include "observer.h". (start_event_loop): Notify 'command_error' observers instead of calling display_gdb_prompt. Remove FIXME comment. * event-top.c (display_gdb_prompt): Remove call into the interpreters. * inf-loop.c: Include "observer.h". (inferior_event_handler): Notify 'command_error' observers instead of calling display_gdb_prompt. * infrun.c (fetch_inferior_event): Notify 'sync_execution_done' observers instead of calling display_gdb_prompt. * interps.c (interp_set): Don't call display_gdb_prompt. (current_interp_display_prompt_p): Delete. * interps.h (interp_prompt_p): Delete declaration. (interp_prompt_p_ftype): Delete. (struct interp_procs) <prompt_proc_p>: Delete field. (current_interp_display_prompt_p): Delete declaration. * mi-interp.c (mi_interpreter_prompt_p): Delete. (_initialize_mi_interp): Adjust. * tui-interp.c (tui_init): Install 'sync_execution_done' and 'command_error' observers. (tui_on_sync_execution_done, tui_on_command_error): New functions. (tui_display_prompt_p): Delete. (_initialize_tui_interp): Adjust. gdb/doc/ 2014-05-29 Pedro Alves <palves@redhat.com> * observer.texi (sync_execution_done, command_error): New subjects.
2014-05-23 12:37:12 +02:00
2014-05-29 Pedro Alves <palves@redhat.com>
* cli/cli-interp.c (cli_interpreter_display_prompt_p): Delete.
(_initialize_cli_interp): Adjust.
* event-loop.c: Include "observer.h".
(start_event_loop): Notify 'command_error' observers instead of
calling display_gdb_prompt. Remove FIXME comment.
* event-top.c (display_gdb_prompt): Remove call into the
interpreters.
* inf-loop.c: Include "observer.h".
(inferior_event_handler): Notify 'command_error' observers instead
of calling display_gdb_prompt.
* infrun.c (fetch_inferior_event): Notify 'sync_execution_done'
observers instead of calling display_gdb_prompt.
* interps.c (interp_set): Don't call display_gdb_prompt.
(current_interp_display_prompt_p): Delete.
* interps.h (interp_prompt_p): Delete declaration.
(interp_prompt_p_ftype): Delete.
(struct interp_procs) <prompt_proc_p>: Delete field.
(current_interp_display_prompt_p): Delete declaration.
* mi-interp.c (mi_interpreter_prompt_p): Delete.
(_initialize_mi_interp): Adjust.
* tui-interp.c (tui_init): Install 'sync_execution_done' and
'command_error' observers.
(tui_on_sync_execution_done, tui_on_command_error): New
functions.
(tui_display_prompt_p): Delete.
(_initialize_tui_interp): Adjust.
PR gdb/13860 - Make MI sync vs async output (closer to) the same. Ignoring expected and desired differences like whether the prompt is output after *stoppped records, GDB MI output is still different in sync and async modes. In sync mode, when a CLI execution command is entered, the "reason" field is missing in the *stopped async record. And in async mode, for some events, like program exits, the corresponding CLI output is missing in the CLI channel. Vis, diff between sync vs async modes: run ^running *running,thread-id="1" (gdb) ... - ~"[Inferior 1 (process 15882) exited normally]\n" =thread-exited,id="1",group-id="i1" =thread-group-exited,id="i1",exit-code="0" - *stopped + *stopped,reason="exited-normally" si ... (gdb) ~"0x000000000045e033\t29\t memset (&args, 0, sizeof args);\n" - *stopped,frame=...,thread-id="1",stopped-threads="all",core="0" + *stopped,reason="end-stepping-range",frame=...,thread-id="1",stopped-threads="all",core="0" (gdb) In addition, in both cases, when a MI execution command is entered, and a breakpoint triggers, the event is sent to the console too. But some events like program exits have the CLI output missing in the CLI channel: -exec-run ^running *running,thread-id="1" (gdb) ... =thread-exited,id="1",group-id="i1" =thread-group-exited,id="i1",exit-code="0" - *stopped + *stopped,reason="exited-normally" We'll want to make background commands always possible by default. IOW, make target-async be the default. But, in order to do that, we'll need to emulate MI sync on top of an async target. That means we'll have yet another combination to care for in the testsuite. Rather than making the testsuite cope with all these differences, I thought it better to just fix GDB to always have the complete output, no matter whether it's in sync or async mode. This is all related to interpreter-exec, and the corresponding uiout switching. (Typing a CLI command directly in MI is shorthand for running it through -interpreter-exec console.) In sync mode, when a CLI command is active, normal_stop is called when the current interpreter and uiout are CLI's. So print_XXX_reason prints the stop reason to CLI uiout (only), and we don't show it in MI. In async mode the stop event is processed when we're back in the MI interpreter, so the stop reason is printed directly to the MI uiout. Fix this by making run control event printing roughly independent of whatever is the current interpreter or uiout. That is, move these prints to interpreter observers, that know whether to print or be quiet, and if printing, which uiout to print to. In the case of the console/tui interpreters, only print if the top interpreter. For MI, always print. Breakpoint hits / normal stops are already handled similarly -- MI has a normal_stop observer that prints the event to both MI and the CLI, though that could be cleaned up further in the direction of this patch. This also makes all of: (gdb) foo and (gdb) interpreter-exec MI "-exec-foo" and (gdb) -exec-foo and (gdb) -interpreter-exec console "foo" print as expected. Tested on x86_64 Fedora 20, sync and async modes. gdb/ 2014-05-29 Pedro Alves <palves@redhat.com> PR gdb/13860 * cli/cli-interp.c: Include infrun.h and observer.h. (cli_uiout, cli_interp): New globals. (cli_on_signal_received, cli_on_end_stepping_range) (cli_on_signal_exited, cli_on_exited, cli_on_no_history): New functions. (cli_interpreter_init): Install them as 'end_stepping_range', 'signal_received' 'signal_exited', 'exited' and 'no_history' observers. (_initialize_cli_interp): Remove cli_interp local. * infrun.c (handle_inferior_event): Call the several stop reason observers instead of printing the stop reason directly. (end_stepping_range): New function. (print_end_stepping_range_reason, print_signal_exited_reason) (print_exited_reason, print_signal_received_reason) (print_no_history_reason): Make static, and add an uiout parameter. Print to that instead of to CURRENT_UIOUT. * infrun.h (print_end_stepping_range_reason) (print_signal_exited_reason, print_exited_reason) (print_signal_received_reason print_no_history_reason): New declarations. * mi/mi-common.h (struct mi_interp): Rename 'uiout' field to 'mi_uiout'. <cli_uiout>: New field. * mi/mi-interp.c (mi_interpreter_init): Adjust. Create the new uiout for CLI output. Install 'signal_received', 'end_stepping_range', 'signal_exited', 'exited' and 'no_history' observers. (find_mi_interpreter, mi_interp_data, mi_on_signal_received) (mi_on_end_stepping_range, mi_on_signal_exited, mi_on_exited) (mi_on_no_history): New functions. (ui_out_free_cleanup): Delete function. (mi_on_normal_stop): Don't allocate a new uiout for CLI output, instead use the one already stored in the MI interpreter data. (mi_ui_out): Adjust. * tui/tui-interp.c: Include infrun.h and observer.h. (tui_interp): New global. (tui_on_signal_received, tui_on_end_stepping_range) (tui_on_signal_exited, tui_on_exited) (tui_on_no_history): New functions. (tui_init): Install them as 'end_stepping_range', 'signal_received' 'signal_exited', 'exited' and 'no_history' observers. (_initialize_tui_interp): Delete tui_interp local. gdb/doc/ 2014-05-29 Pedro Alves <palves@redhat.com> PR gdb/13860 * observer.texi (signal_received, end_stepping_range) (signal_exited, exited, no_history): New observer subjects. gdb/testsuite/ 2014-05-29 Pedro Alves <palves@redhat.com> PR gdb/13860 * gdb.mi/mi-cli.exp: Always expect "end-stepping-range" stop reason, even in sync mode.
2014-05-29 14:09:45 +02:00
2014-05-29 Pedro Alves <palves@redhat.com>
PR gdb/13860
* cli/cli-interp.c: Include infrun.h and observer.h.
(cli_uiout, cli_interp): New globals.
(cli_on_signal_received, cli_on_end_stepping_range)
(cli_on_signal_exited, cli_on_exited, cli_on_no_history): New
functions.
(cli_interpreter_init): Install them as 'end_stepping_range',
'signal_received' 'signal_exited', 'exited' and 'no_history'
observers.
(_initialize_cli_interp): Remove cli_interp local.
* infrun.c (handle_inferior_event): Call the several stop reason
observers instead of printing the stop reason directly.
(end_stepping_range): New function.
(print_end_stepping_range_reason, print_signal_exited_reason)
(print_exited_reason, print_signal_received_reason)
(print_no_history_reason): Make static, and add an uiout
parameter. Print to that instead of to CURRENT_UIOUT.
* infrun.h (print_end_stepping_range_reason)
(print_signal_exited_reason, print_exited_reason)
(print_signal_received_reason print_no_history_reason): New
declarations.
* mi/mi-common.h (struct mi_interp): Rename 'uiout' field to
'mi_uiout'.
<cli_uiout>: New field.
* mi/mi-interp.c (mi_interpreter_init): Adjust. Create the new
uiout for CLI output. Install 'signal_received',
'end_stepping_range', 'signal_exited', 'exited' and 'no_history'
observers.
(find_mi_interpreter, mi_interp_data, mi_on_signal_received)
(mi_on_end_stepping_range, mi_on_signal_exited, mi_on_exited)
(mi_on_no_history): New functions.
(ui_out_free_cleanup): Delete function.
(mi_on_normal_stop): Don't allocate a new uiout for CLI output,
instead use the one already stored in the MI interpreter data.
(mi_ui_out): Adjust.
* tui/tui-interp.c: Include infrun.h and observer.h.
(tui_interp): New global.
(tui_on_signal_received, tui_on_end_stepping_range)
(tui_on_signal_exited, tui_on_exited)
(tui_on_no_history): New functions.
(tui_init): Install them as 'end_stepping_range',
'signal_received' 'signal_exited', 'exited' and 'no_history'
observers.
(_initialize_tui_interp): Delete tui_interp local.
PR gdb/15713 - errors from i386_linux_resume lead to lock-up linux_nat_resume is not considering that linux_ops->to_resume may throw: /* Mark LWP as not stopped to prevent it from being continued by linux_nat_resume_callback. */ lp->stopped = 0; if (resume_many) iterate_over_lwps (ptid, linux_nat_resume_callback, NULL); If something within linux_nat_resume_callback throws, GDB leaves the lwp_info as if the inferior was resumed, while it actually wasn't. A couple examples, there are possibly others: - i386_linux_resume calls target_read which calls QUIT. - if the actual ptrace resumption fails in inf_ptrace_resume, perror_with_name is called. If the user tries to kill the inferior at this point (or quit, which offers to kill), GDB locks up trying to stop the lwp -- if it is already stopped no new waitpid event gets generated for it. Fix this by setting the stopped flag earlier, as soon as we collect a stop event with waitpid, and clearing it always only after resuming the lwp successfully. Tested on x86_64 Fedora 20. Confirmed the lock-up disappears using a local hack that forces an error in inf_ptrace_resume. Also fixes a little "set debug lin-lwp" annoyance. Currently we always see: Continuing. LLR: Preparing to resume process 6802, 0, inferior_ptid Thread 0x7ffff7fc7740 (LWP 6802) ^^^^^^^^ RC: Resuming sibling Thread 0x7ffff77c5700 (LWP 6807), 0, resume RC: Resuming sibling Thread 0x7ffff7fc6700 (LWP 6806), 0, resume RC: Not resuming sibling Thread 0x7ffff7fc7740 (LWP 6802) (not stopped) ^^^^^^^^^^^^^^^^^^^^^^^ LLR: PTRACE_CONT process 6802, 0 (resume event thread) This patch gets rid of the "Not resuming sibling" line. 2014-05-29 Pedro Alves <palves@redhat.com> PR gdb/15713 * linux-nat.c (linux_nat_resume_callback): Rename the second parameter to 'except'. Skip LP if it points to EXCEPT. (linux_nat_resume): Don't mark the event lwp as not stopped before resuming sibling lwps. Instead ask linux_nat_resume_callback to skip the event lwp. Mark it as not stopped after actually resuming it. (linux_handle_syscall_trap): Mark the lwp as not stopped after resuming it. (wait_lwp): Mark the lwp as stopped here. (stop_wait_callback): Mark the lwp as not stopped right after resuming it. Don't mark lwps as stopped here. (linux_nat_filter_event): Mark the lwp as stopped earlier. (linux_nat_wait_1): Don't mark dead lwps as stopped here.
2014-05-29 13:50:48 +02:00
2014-05-29 Pedro Alves <palves@redhat.com>
PR gdb/15713
* linux-nat.c (linux_nat_resume_callback): Rename the second
parameter to 'except'. Skip LP if it points to EXCEPT.
(linux_nat_resume): Don't mark the event lwp as not stopped
before resuming sibling lwps. Instead ask
linux_nat_resume_callback to skip the event lwp. Mark it as not
stopped after actually resuming it.
(linux_handle_syscall_trap): Mark the lwp as not stopped after
resuming it.
(wait_lwp): Mark the lwp as stopped here.
(stop_wait_callback): Mark the lwp as not stopped right after
resuming it. Don't mark lwps as stopped here.
(linux_nat_filter_event): Mark the lwp as stopped earlier.
(linux_nat_wait_1): Don't mark dead lwps as stopped here.
PR15693 - Fix spurious *running events, thread state, dprintf-style call If one sets a breakpoint with a condition that involves calling a function in the inferior, and then the condition evaluates false, GDB outputs one *running event for each time the program hits the breakpoint. E.g., $ gdb return-false -i=mi (gdb) start ... (gdb) b 14 if return_false () &"b 14 if return_false ()\n" ~"Breakpoint 2 at 0x4004eb: file return-false.c, line 14.\n" ... ^done (gdb) c &"c\n" ~"Continuing.\n" ^running *running,thread-id=(...) (gdb) *running,thread-id=(...) *running,thread-id=(...) *running,thread-id=(...) *running,thread-id=(...) *running,thread-id=(...) ... repeat forever ... An easy way a user can trip on this is with a dprintf with "set dprintf-style call". In that case, a dprintf is just a breakpoint that when hit GDB calls the printf function in the inferior, and then resumes it, just like the case above. If the breakpoint/dprintf is set in a loop, then these spurious events can potentially slow down a frontend much, if it decides to refresh its GUI whenever it sees this event (Eclipse is one such case). When we run an infcall, we pretend we don't actually run the inferior. This is already handled for the usual case of calling a function directly from the CLI: (gdb) p return_false () &"p return_false ()\n" ~"$1 = 0" ~"\n" ^done (gdb) Note no *running, nor *stopped events. That's handled by: static void mi_on_resume (ptid_t ptid) { ... /* Suppress output while calling an inferior function. */ if (tp->control.in_infcall) return; and equivalent code on normal_stop. However, in the cases of the PR, after finishing the infcall there's one more resume, and mi_on_resume doesn't know that it should suppress output then too, somehow. The "running/stopped" state is a high level user/frontend state. Internal stops are invisible to the frontend. If follows from that that we should be setting the thread to running at a higher level where we still know the set of threads the user _intends_ to resume. Currently we mark a thread as running from within target_resume, a low level target operation. As consequence, today, if we resume a multi-threaded program while stopped at a breakpoint, we see this: -exec-continue ^running *running,thread-id="1" (gdb) *running,thread-id="all" The first *running was GDB stepping over the breakpoint, and the second is GDB finally resuming everything. Between those two *running's, threads other than "1" still have their state set to stopped. That's bogus -- in async mode, this opens a tiny window between both resumes where the user might try to run another execution command to threads other than thread 1, and very much confuse GDB. That is, the "step" below should fail the "step", complaining that the thread is running: (gdb) c -a & (gdb) thread 2 (gdb) step IOW, threads that GDB happens to not resume immediately (say, because it needs to step over a breakpoint) shall still be marked as running. Then, if we move marking threads as running to a higher layer, decoupled from target_resume, plus skip marking threads as running when running an infcall, the spurious *running events disappear, because there will be no state transitions at all. I think we might end up adding a new thread state -- THREAD_INFCALL or some such, however since infcalls are always synchronous today, I didn't find a need. There's no way to execute a CLI/MI command directly from the prompt if some thread is running an infcall. Tested on x86_64 Fedora 20. gdb/ 2014-05-29 Pedro Alves <palves@redhat.com> PR PR15693 * infrun.c (resume): Determine how much to resume depending on whether the caller wanted a step, not whether we can hardware step the target. Mark all threads that we intend to run as running, unless we're calling an inferior function. (normal_stop): If the thread is running an infcall, don't finish thread state. * target.c (target_resume): Don't mark threads as running here. gdb/testsuite/ 2014-05-29 Pedro Alves <palves@redhat.com> Hui Zhu <hui@codesourcery.com> PR PR15693 * gdb.mi/mi-condbreak-call-thr-state-mt.c: New file. * gdb.mi/mi-condbreak-call-thr-state-st.c: New file. * gdb.mi/mi-condbreak-call-thr-state.c: New file. * gdb.mi/mi-condbreak-call-thr-state.exp: New file.
2014-05-29 13:27:01 +02:00
2014-05-29 Pedro Alves <palves@redhat.com>
PR PR15693
* infrun.c (resume): Determine how much to resume depending on
whether the caller wanted a step, not whether we can hardware step
the target. Mark all threads that we intend to run as running,
unless we're calling an inferior function.
(normal_stop): If the thread is running an infcall, don't finish
thread state.
* target.c (target_resume): Don't mark threads as running here.
2014-05-28 Joel Brobecker <brobecker@adacore.com>
* serial.c (_initialize_serial): Remove support for
the "set remotebaud" and "show remotebaud" commands.
* NEWS: Add entry documenting the removal of that command.
2014-05-28 Yao Qi <yao@codesourcery.com>
* charset.c: Fix typo in comments.
2014-05-27 Gary Benson <gbenson@redhat.com>
* utils.c (internal_vproblem): Prompt for a bug report.
2014-05-26 Andy Wingo <wingo@igalia.com>
* guile/scm-arch.c (arscm_mark_arch_smob):
* guile/scm-block.c (bkscm_mark_block_smob)
(bkscm_mark_block_syms_progress_smob):
* guile/scm-breakpoint.c (bpscm_mark_breakpoint_smob):
* guile/scm-exception.c (exscm_mark_exception_smob):
* guile/scm-frame.c (frscm_mark_frame_smob):
* guile/scm-iterator.c (itscm_mark_iterator_smob):
* guile/scm-lazy-string.c (lsscm_mark_lazy_string_smob):
* guile/scm-objfile.c (ofscm_mark_objfile_smob):
* guile/scm-pretty-print.c (ppscm_mark_pretty_printer_smob)
(ppscm_mark_pretty_printer_worker_smob):
* guile/scm-symbol.c (syscm_mark_symbol_smob):
* guile/scm-symtab.c (stscm_mark_symtab_smob, stscm_mark_sal_smob):
* guile/scm-type.c (tyscm_mark_type_smob, tyscm_mark_field_smob):
* guile/scm-value.c (vlscm_mark_value_smob): Remove unnecessary
mark functions.
* guile/scm-symtab.c (stscm_free_sal_smob): Remove unnecessary free
function.
2014-05-26 Andy Wingo <wingo@igalia.com>
Doug Evans <xdje42@gmail.com>
* guile/guile-internal.h (GDB_SMOB_HEAD): Replace properties with
empty_base_class. All uses updated.
(gdbscm_mark_gsmob, gdbscm_mark_chained_gsmob)
(gdbscm_mark_eqable_gsmob): Remove these now-unneeded functions.
Adapt all callers.
* guile/scm-gsmob.c (gdbscm_mark_gsmob)
(gdbscm_mark_chained_gsmob, gdbscm_mark_eqable_gsmob): Remove.
(gdbscm_gsmob_property, gdbscm_set_gsmob_property_x)
(gdbscm_gsmob_has_property_p, add_property_name)
(gdbscm_gsmob_properties): Remove, and remove them from gsmob_functions.
* guile/lib/gdb.scm (gdb-object-property, set-gdb-object-property)
(gdb-object-has-property?, gdb-object-properties): Remove.
(gdb-object-kind): Renamed from gsmob-kind.
2014-05-26 Andy Wingo <wingo@igalia.com>
* configure.ac (try_guile_versions): Allow building with guile 2.2.
* configure: Regenerate.
2014-05-23 Markus Metzger <markus.t.metzger@intel.com>
* symfile-mem.c (symbol_file_add_from_memory): Add BFD sections.
2014-05-23 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_allow_memory_access): Remove.
(replay_memory_access_read_only, replay_memory_access_read_write)
(replay_memory_access_types, replay_memory_access)
(set_record_btrace_cmdlist, show_record_btrace_cmdlist)
(cmd_set_record_btrace, cmd_show_record_btrace)
(cmd_show_replay_memory_access): New.
(record_btrace_xfer_partial, record_btrace_insert_breakpoint)
(record_btrace_remove_breakpoint): Replace
record_btrace_allow_memory_access with replay_memory_access.
(_initialize_record_btrace): Add commands.
* NEWS: Announce it.
2014-05-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* aarch64-linux-nat.c (asm/ptrace.h): Include.
2014-05-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* MAINTAINERS (Write After Approval): Move self back from
paper trail.
Add new infrun.h header. Move infrun.c declarations out of inferior.h to a new infrun.h file. Tested by building on: i686-w64-mingw32, enable-targets=all x86_64-linux, enable-targets=all i586-pc-msdosdjgpp And also grepped the whole tree for each symbol moved to find where infrun.h might be necessary. gdb/ 2014-05-22 Pedro Alves <palves@redhat.com> * inferior.h (debug_infrun, debug_displaced, stop_on_solib_events) (sync_execution, sched_multi, step_stop_if_no_debug, non_stop) (disable_randomization, enum exec_direction_kind) (execution_direction, stop_registers, start_remote) (clear_proceed_status, proceed, resume, user_visible_resume_ptid) (wait_for_inferior, normal_stop, get_last_target_status) (prepare_for_detach, fetch_inferior_event, init_wait_for_inferior) (insert_step_resume_breakpoint_at_sal) (follow_inferior_reset_breakpoints, stepping_past_instruction_at) (set_step_info, print_stop_event, signal_stop_state) (signal_print_state, signal_pass_state, signal_stop_update) (signal_print_update, signal_pass_update) (update_signals_program_target, clear_exit_convenience_vars) (displaced_step_dump_bytes, update_observer_mode) (signal_catch_update, gdb_signal_from_command): Move declarations ... * infrun.h: ... to this new file. * amd64-tdep.c: Include infrun.h. * annotate.c: Include infrun.h. * arch-utils.c: Include infrun.h. * arm-linux-tdep.c: Include infrun.h. * arm-tdep.c: Include infrun.h. * break-catch-sig.c: Include infrun.h. * breakpoint.c: Include infrun.h. * common/agent.c: Include infrun.h instead of inferior.h. * corelow.c: Include infrun.h. * event-top.c: Include infrun.h. * go32-nat.c: Include infrun.h. * i386-tdep.c: Include infrun.h. * inf-loop.c: Include infrun.h. * infcall.c: Include infrun.h. * infcmd.c: Include infrun.h. * infrun.c: Include infrun.h. * linux-fork.c: Include infrun.h. * linux-nat.c: Include infrun.h. * linux-thread-db.c: Include infrun.h. * monitor.c: Include infrun.h. * nto-tdep.c: Include infrun.h. * procfs.c: Include infrun.h. * record-btrace.c: Include infrun.h. * record-full.c: Include infrun.h. * remote-m32r-sdi.c: Include infrun.h. * remote-mips.c: Include infrun.h. * remote-notif.c: Include infrun.h. * remote-sim.c: Include infrun.h. * remote.c: Include infrun.h. * reverse.c: Include infrun.h. * rs6000-tdep.c: Include infrun.h. * s390-linux-tdep.c: Include infrun.h. * solib-irix.c: Include infrun.h. * solib-osf.c: Include infrun.h. * solib-svr4.c: Include infrun.h. * target.c: Include infrun.h. * top.c: Include infrun.h. * windows-nat.c: Include infrun.h. * mi/mi-interp.c: Include infrun.h. * mi/mi-main.c: Include infrun.h. * python/py-threadevent.c: Include infrun.h.
2014-05-22 13:29:11 +02:00
2014-05-22 Pedro Alves <palves@redhat.com>
* inferior.h (debug_infrun, debug_displaced, stop_on_solib_events)
(sync_execution, sched_multi, step_stop_if_no_debug, non_stop)
(disable_randomization, enum exec_direction_kind)
(execution_direction, stop_registers, start_remote)
(clear_proceed_status, proceed, resume, user_visible_resume_ptid)
(wait_for_inferior, normal_stop, get_last_target_status)
(prepare_for_detach, fetch_inferior_event, init_wait_for_inferior)
(insert_step_resume_breakpoint_at_sal)
(follow_inferior_reset_breakpoints, stepping_past_instruction_at)
(set_step_info, print_stop_event, signal_stop_state)
(signal_print_state, signal_pass_state, signal_stop_update)
(signal_print_update, signal_pass_update)
(update_signals_program_target, clear_exit_convenience_vars)
(displaced_step_dump_bytes, update_observer_mode)
(signal_catch_update, gdb_signal_from_command): Move
declarations ...
* infrun.h: ... to this new file.
* amd64-tdep.c: Include infrun.h.
* annotate.c: Include infrun.h.
* arch-utils.c: Include infrun.h.
* arm-linux-tdep.c: Include infrun.h.
* arm-tdep.c: Include infrun.h.
* break-catch-sig.c: Include infrun.h.
* breakpoint.c: Include infrun.h.
* common/agent.c: Include infrun.h instead of inferior.h.
* corelow.c: Include infrun.h.
* event-top.c: Include infrun.h.
* go32-nat.c: Include infrun.h.
* i386-tdep.c: Include infrun.h.
* inf-loop.c: Include infrun.h.
* infcall.c: Include infrun.h.
* infcmd.c: Include infrun.h.
* infrun.c: Include infrun.h.
* linux-fork.c: Include infrun.h.
* linux-nat.c: Include infrun.h.
* linux-thread-db.c: Include infrun.h.
* monitor.c: Include infrun.h.
* nto-tdep.c: Include infrun.h.
* procfs.c: Include infrun.h.
* record-btrace.c: Include infrun.h.
* record-full.c: Include infrun.h.
* remote-m32r-sdi.c: Include infrun.h.
* remote-mips.c: Include infrun.h.
* remote-notif.c: Include infrun.h.
* remote-sim.c: Include infrun.h.
* remote.c: Include infrun.h.
* reverse.c: Include infrun.h.
* rs6000-tdep.c: Include infrun.h.
* s390-linux-tdep.c: Include infrun.h.
* solib-irix.c: Include infrun.h.
* solib-osf.c: Include infrun.h.
* solib-svr4.c: Include infrun.h.
* target.c: Include infrun.h.
* top.c: Include infrun.h.
* windows-nat.c: Include infrun.h.
* mi/mi-interp.c: Include infrun.h.
* mi/mi-main.c: Include infrun.h.
* python/py-threadevent.c: Include infrun.h.
2014-05-22 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event): Store the exit code for
--return-child-result here, instead of ...
(print_exited_reason): ... here.
PR gdb/13860: don't lose '-interpreter-exec console EXECUTION_COMMAND''s output in async mode. The other part of PR gdb/13860 is about console execution commands in MI getting their output half lost. E.g., take the finish command, executed on a frontend's GDB console: sync: finish &"finish\n" ~"Run till exit from #0 usleep (useconds=10) at ../sysdeps/unix/sysv/linux/usleep.c:27\n" ^running *running,thread-id="1" (gdb) ~"0x00000000004004d7 in foo () at stepinf.c:6\n" ~"6\t usleep (10);\n" ~"Value returned is $1 = 0\n" *stopped,reason="function-finished",frame={addr="0x00000000004004d7",func="foo",args=[],file="stepinf.c",fullname="/home/pedro/gdb/tests/stepinf.c",line="6"},thread-id="1",stopped-threads="all",core="1" async: finish &"finish\n" ~"Run till exit from #0 usleep (useconds=10) at ../sysdeps/unix/sysv/linux/usleep.c:27\n" ^running *running,thread-id="1" (gdb) *stopped,reason="function-finished",frame={addr="0x00000000004004d7",func="foo",args=[],file="stepinf.c",fullname="/home/pedro/gdb/tests/stepinf.c",line="6"},gdb-result-var="$1",return-value="0",thread-id="1",stopped-threads="all",core="0" Note how all the "Value returned" etc. output is missing in async mode. The same happens with e.g., catchpoints: =breakpoint-modified,bkpt={number="1",type="catchpoint",disp="keep",enabled="y",what="22016",times="1"} ~"\nCatchpoint " ~"1 (forked process 22016), 0x0000003791cbd8a6 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:131\n" ~"131\t pid = ARCH_FORK ();\n" *stopped,reason="fork",disp="keep",bkptno="1",newpid="22016",frame={addr="0x0000003791cbd8a6",func="__libc_fork",args=[],file="../nptl/sysdeps/unix/sysv/linux/fork.c",fullname="/usr/src/debug/glibc-2.14-394-g8f3b1ff/nptl/sysdeps/unix/sysv/linux/fork.c",line="131"},thread-id="1",stopped-threads="all",core="0" where all those ~ lines are missing in async mode, or just the "step" current line indication: s &"s\n" ^running *running,thread-id="all" (gdb) ~"13\t foo ();\n" *stopped,frame={addr="0x00000000004004ef",func="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffdd78"}],file="stepinf.c",fullname="/home/pedro/gdb/tests/stepinf.c",line="13"},thread-id="1",stopped-threads="all",core="3" (gdb) Or in the case of the PRs example, the "Stopped due to shared library event" note: start &"start\n" ~"Temporary breakpoint 1 at 0x400608: file ../../../src/gdb/testsuite/gdb.mi/solib-main.c, line 21.\n" =breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0000000000400608",func="main",file="../../../src/gdb/testsuite/gdb.mi/solib-main.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/solib-main.c",line="21",times="0",original-location="main"} ~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n" =thread-group-started,id="i1",pid="21990" =thread-created,id="1",group-id="i1" ^running *running,thread-id="all" (gdb) =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1" ~"Stopped due to shared library event (no libraries added or removed)\n" *stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="3" (gdb) IMO, if you're typing execution commands in a frontend's console, you expect to see their output. Indeed it's what you get in sync mode. I think async mode should do the same. Deciding what to mirror to the console wrt to breakpoints and random stops gets messy real fast. E.g., say "s" trips on a breakpoint. We'd clearly want to mirror the event to the console in this case. But what about more complicated cases like "s&; thread n; s&", and one of those steps spawning a new thread, and that thread hitting a breakpoint? It's impossible in general to track whether the thread had any relation to the commands that had been executed. So I think we should just simplify and always mirror breakpoints and random events to the console. Notes: - mi->out is the same as gdb_stdout when MI is the current interpreter. I think that referring to that directly is cleaner. An earlier revision of this patch made the changes that are now done in mi_on_normal_stop directly in infrun.c:normal_stop, and so not having an obvious place to put the new uiout by then, and not wanting to abuse CLI's uiout, I made a temporary uiout when necessary. - Hopefuly the rest of the patch is more or less obvious given the comments added. Tested on x86_64 Fedora 20, no regressions. 2014-05-21 Pedro Alves <palves@redhat.com> PR gdb/13860 * gdbthread.h (struct thread_control_state): New field `command_interp'. * infrun.c (follow_fork): Copy the new thread control field to the child fork thread. (clear_proceed_status_thread): Clear the new thread control field. (proceed): Set the new thread control field. * interps.h (command_interp): Declare. * interps.c (command_interpreter): New global. (command_interp): New function. (interp_exec): Set `command_interpreter' while here. * cli-out.c (cli_uiout_dtor): New function. (cli_ui_out_impl): Install it. * mi/mi-interp.c: Include cli-out.h. (mi_cmd_interpreter_exec): Add comment. (restore_current_uiout_cleanup): New function. (ui_out_free_cleanup): New function. (mi_on_normal_stop): If finishing an execution command started by a CLI command, or any kind of breakpoint-like event triggered, print the stop event to the output (CLI) stream. * mi/mi-out.c (mi_ui_out_impl): Install NULL `dtor' handler. 2014-05-21 Pedro Alves <palves@redhat.com> PR gdb/13860 * gdb.mi/mi-cli.exp (line_callee4_next_step): New global. (top level): Test that output related to execution commands is sent to the console with CLI commands, but not with MI commands. Test that breakpoint events are always mirrored to the console. Also expect the new source line to be output after a "next" in async mode too. Make it a pass/fail test. * gdb.mi/mi-solib.exp: Test that the CLI solib event note is output. * lib/mi-support.exp (mi_gdb_expect_cli_output): New procedure.
2014-03-11 21:31:36 +01:00
2014-05-21 Pedro Alves <palves@redhat.com>
PR gdb/13860
* gdbthread.h (struct thread_control_state): New field
`command_interp'.
* infrun.c (follow_fork): Copy the new thread control field to the
child fork thread.
(clear_proceed_status_thread): Clear the new thread control field.
(proceed): Set the new thread control field.
* interps.h (command_interp): Declare.
* interps.c (command_interpreter): New global.
(command_interp): New function.
(interp_exec): Set `command_interpreter' while here.
* cli-out.c (cli_uiout_dtor): New function.
(cli_ui_out_impl): Install it.
* mi/mi-interp.c: Include cli-out.h.
(mi_cmd_interpreter_exec): Add comment.
(restore_current_uiout_cleanup): New function.
(ui_out_free_cleanup): New function.
(mi_on_normal_stop): If finishing an execution command started by
a CLI command, or any kind of breakpoint-like event triggered,
print the stop event to the output (CLI) stream.
* mi/mi-out.c (mi_ui_out_impl): Install NULL `dtor' handler.
PR gdb/13860: make -interpreter-exec console "list" behave more like "list". I noticed that "list" behaves differently in CLI vs MI. Particularly: $ ./gdb -nx -q ./testsuite/gdb.mi/mi-cli Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli...done. (gdb) start Temporary breakpoint 1 at 0x40054d: file ../../../src/gdb/testsuite/gdb.mi/basics.c, line 62. Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli Temporary breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.mi/basics.c:62 62 callee1 (2, "A string argument.", 3.5); (gdb) list 57 { 58 } 59 60 main () 61 { 62 callee1 (2, "A string argument.", 3.5); 63 callee1 (2, "A string argument.", 3.5); 64 65 do_nothing (); /* Hello, World! */ 66 (gdb) Note the list started at line 57. IOW, the program stopped at line 62, and GDB centered the list on that. compare with: $ ./gdb -nx -q ./testsuite/gdb.mi/mi-cli -i=mi =thread-group-added,id="i1" ~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli..." ~"done.\n" (gdb) start &"start\n" ... ~"\nTemporary breakpoint " ~"1, main () at ../../../src/gdb/testsuite/gdb.mi/basics.c:62\n" ~"62\t callee1 (2, \"A string argument.\", 3.5);\n" *stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x000000000040054d",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/basics.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/basics.c",line="62"},thread-id="1",stopped-threads="all",core="0" =breakpoint-deleted,id="1" (gdb) -interpreter-exec console list ~"62\t callee1 (2, \"A string argument.\", 3.5);\n" ~"63\t callee1 (2, \"A string argument.\", 3.5);\n" ~"64\t\n" ~"65\t do_nothing (); /* Hello, World! */\n" ~"66\t\n" ~"67\t callme (1);\n" ~"68\t callme (2);\n" ~"69\t\n" ~"70\t return 0;\n" ~"71\t}\n" ^done (gdb) Here the list starts at line 62, where the program was stopped. This happens because print_stack_frame, called from both normal_stop and mi_on_normal_stop, is the function responsible for setting the current sal from the selected frame, overrides the PRINT_WHAT argument, and only after that does it decide whether to center the current sal line or not, based on the overridden value, and it will always decide false. (The print_stack_frame call in mi_on_normal_stop is a little different from the call in normal_stop, in that it is an unconditional SRC_AND_LOC call. A future patch will make those uniform.) A previous version of this patch made MI uniform with CLI here, by making print_stack_frame also center when MI is active. That changed the output of a "list" command in mi-cli.exp, to expect line 57 instead of 62, as per the example above. However, looking deeper, that list in question is the first "list" after the program stops, and right after the stop, before the "list", the test did "set listsize 1". Let's try the same thing with the CLI: (gdb) start 62 callee1 (2, "A string argument.", 3.5); (gdb) set listsize 1 (gdb) list 57 { Huh, that's unexpected. Why the 57? It's because print_stack_frame, called in reaction to the breakpoint stop, expecting the next "list" to show 10 lines (the listsize at the time) around line 62, sets the lines listed range to 57-67 (62 +/- 5). If the user changes the listsize before "list", why would we still show that range? Looks bogus to me. So the fix for this whole issue should be delay trying to center the listing to until actually listing, so that the correct listsize can be taken into account. This makes MI and CLI uniform too, as it deletes the center code from print_stack_frame. A series of tests are added to list.exp to cover this. mi-cli.exp was after all correct all along, but it now gains an additional test that lists lines with listsize 10, to ensure the centering is consistent with CLI's. One related Python test changed related output -- it's a test that prints the line number after stopping for a breakpoint, similar to the new list.exp tests. Previously we'd print the stop line minus 5 (due to the premature centering), now we print the stop line. I think that's a good change. Tested on x86_64 Fedora 20. gdb/ 2014-05-21 Pedro Alves <palves@redhat.com> * cli/cli-cmds.c (list_command): Handle the first "list" after the current source line having changed. * frame.h (set_current_sal_from_frame): Remove 'center' parameter. * infrun.c (normal_stop): Adjust call to set_current_sal_from_frame. * source.c (clear_lines_listed_range): New function. (set_current_source_symtab_and_line, identify_source_line): Clear the lines listed range. (line_info): Handle the first "info line" after the current source line having changed. * stack.c (print_stack_frame): Remove center handling. (set_current_sal_from_frame): Remove 'center' parameter. Don't center sal.line. gdb/testsuite/ 2014-05-21 Pedro Alves <palves@redhat.com> * gdb.base/list.exp (build_pattern, test_list): New procedures. Use them to test variations of "list" after reaching a breakpoint. * gdb.mi/mi-cli.exp (line_main_callme_2): New global. Test "list" with listsize 10 after reaching a breakpoint. * gdb.python/python.exp (decode_line current location line number): Adjust expected line number.
2014-05-22 00:15:27 +02:00
2014-05-21 Pedro Alves <palves@redhat.com>
* cli/cli-cmds.c (list_command): Handle the first "list" after the
current source line having changed.
* frame.h (set_current_sal_from_frame): Remove 'center' parameter.
* infrun.c (normal_stop): Adjust call to
set_current_sal_from_frame.
* source.c (clear_lines_listed_range): New function.
(set_current_source_symtab_and_line, identify_source_line): Clear
the lines listed range.
(line_info): Handle the first "info line" after the current source
line having changed.
* stack.c (print_stack_frame): Remove center handling.
(set_current_sal_from_frame): Remove 'center' parameter. Don't
center sal.line.
2014-05-21 Pedro Alves <palves@redhat.com>
* inf-child.c (inf_child_mourn_inferior): New function.
* inf-child.h (inf_child_mourn_inferior): New declaration.
* darwin-nat.c (darwin_mourn_inferior): Use
inf_child_mourn_inferior.
* gnu-nat.c (gnu_mourn_inferior): Likewise.
* inf-ptrace.c (inf_ptrace_mourn_inferior): Likewise.
* inf-ttrace.c (inf_ttrace_mourn_inferior): Likewise.
* nto-procfs.c (procfs_mourn_inferior): Likewise.
* windows-nat.c (windows_mourn_inferior): Likewise.
2014-05-21 Doug Evans <xdje42@gmail.com>
2014-05-22 00:00:31 +02:00
* guile/scm-breakpoint.c (breakpoint_functions): Fix typo.
2014-05-21 Doug Evans <xdje42@gmail.com>
2014-05-26 21:32:09 +02:00
* guile/scm-exception.c (gdbscm_invalid_object_error): Make result void.
(gdbscm_out_of_range_error): Ditto.
(gdbscm_memory_error): Ditto.
2014-05-22 00:00:31 +02:00
* guile/scm-string.c (gdbscm_scm_to_target_string_unsafe): Delete.
* guile/guile-internal.h (gdbscm_invalid_object_error): Update.
(gdbscm_out_of_range_error): Update.
(gdbscm_memory_error): Update.
(gdbscm_scm_to_target_string_unsafe): Delete.
Allow making GDB not automatically connect to the native target. Sometimes it's useful to be able to disable the automatic connection to the native target. E.g., sometimes GDB disconnects from the extended-remote target I was debugging, without me noticing it, and then I do "run". That starts the program locally, and only after a little head scratch session do I figure out the program is running locally instead of remotely as intended. Same thing with "attach", "info os", etc. With the patch, we now can have this instead: (gdb) set auto-connect-native-target off (gdb) target extended-remote :9999 ... *gdb disconnects* (gdb) run Don't know how to run. Try "help target". To still be able to connect to the native target with auto-connect-native-target set to off, I've made "target native" work instead of erroring out as today. Before: (gdb) target native Use the "run" command to start a native process. After: (gdb) target native Done. Use the "run" command to start a process. (gdb) maint print target-stack The current target stack is: - native (Native process) - exec (Local exec file) - None (None) (gdb) run Starting program: ./a.out ... I've also wanted this for the testsuite, when running against the native-extended-gdbserver.exp board (runs against gdbserver in extended-remote mode). With a non-native-target board, it's always a bug to launch a program with the native target. Turns out we still have one such case this patch catches: (gdb) break main Breakpoint 1 at 0x4009e5: file ../../../src/gdb/testsuite/gdb.base/coremaker.c, line 138. (gdb) run Don't know how to run. Try "help target". (gdb) FAIL: gdb.base/corefile.exp: run: with core On the patch itself, probably the least obvious bit is the need to go through all targets, and move the unpush_target call to after the generic_mourn_inferior call instead of before. This is what inf-ptrace.c does too, ever since multi-process support was added. The reason inf-ptrace.c does things in that order is that in the current multi-process/single-target model, we shouldn't unpush the target if there are still other live inferiors being debugged. The check for that is "have_inferiors ()" (a misnomer nowadays...), which does: have_inferiors (void) { for (inf = inferior_list; inf; inf = inf->next) if (inf->pid != 0) return 1; It's generic_mourn_inferior that ends up clearing inf->pid, so we need to call it before the have_inferiors check. To make all native targets behave the same WRT to explicit "target native", I've added an inf_child_maybe_unpush_target function that targets call instead of calling unpush_target directly, and as that includes the have_inferiors check, I needed to adjust the targets. Tested on x86_64 Fedora 20, native, and also with the extended-gdbserver board. Confirmed a cross build of djgpp gdb still builds. Smoke tested a cross build of Windows gdb under Wine. Untested otherwise. gdb/ 2014-05-21 Pedro Alves <palves@redhat.com> * inf-child.c (inf_child_ops, inf_child_explicitly_opened): New globals. (inf_child_open_target): New function. (inf_child_open): Use inf_child_open_target to push the target instead of erroring out. (inf_child_disconnect, inf_child_close) (inf_child_maybe_unpush_target): New functions. (inf_child_target): Install inf_child_disconnect and inf_child_close. Store a pointer to the returned object. * inf-child.h (inf_child_open_target, inf_child_maybe_unpush): New declarations. * target.c (auto_connect_native_target): New global. (show_default_run_target): New function. (find_default_run_target): Return NULL if automatically connecting to the native target is disabled. (_initialize_target): Install set/show auto-connect-native-target. * NEWS: Mention "set auto-connect-native-target", and "target native". * linux-nat.c (super_close): New global. (linux_nat_close): Call super_close. (linux_nat_add_target): Store a pointer to the base class's to_close method. * inf-ptrace.c (inf_ptrace_mourn_inferior, inf_ptrace_detach): Use inf_child_maybe_unpush. * inf-ttrace.c (inf_ttrace_him): Don't push the target if it is already pushed. (inf_ttrace_mourn_inferior): Only unpush the target after mourning the inferior. Use inf_child_maybe_unpush_target. (inf_ttrace_attach): Don't push the target if it is already pushed. (inf_ttrace_detach): Use inf_child_maybe_unpush_target. * darwin-nat.c (darwin_mourn_inferior): Only unpush the target after mourning the inferior. Use inf_child_maybe_unpush_target. (darwin_attach_pid): Don't push the target if it is already pushed. * gnu-nat.c (gnu_mourn_inferior): Only unpush the target after mourning the inferior. Use inf_child_maybe_unpush_target. (gnu_detach): Use inf_child_maybe_unpush_target. * go32-nat.c (go32_create_inferior): Don't push the target if it is already pushed. (go32_mourn_inferior): Use inf_child_maybe_unpush_target. * nto-procfs.c (procfs_is_nto_target): Adjust comment. (procfs_open): Rename to ... (procfs_open_1): ... this. Add target_ops parameter. Adjust comments. Can target_preopen before changing node. Call inf_child_open_target to push the target explicitly. (procfs_attach): Don't push the target if it is already pushed. (procfs_detach): Use inf_child_maybe_unpush_target. (procfs_create_inferior): Don't push the target if it is already pushed. (nto_native_ops): New global. (procfs_open): Reimplement. (procfs_native_open): New function. (init_procfs_targets): Install procfs_native_open as to_open of "target native". Store a pointer to the "native" target in nto_native_ops. * procfs.c (procfs_attach): Don't push the target if it is already pushed. (procfs_detach): Use inf_child_maybe_unpush_target. (procfs_mourn_inferior): Only unpush the target after mourning the inferior. Use inf_child_maybe_unpush_target. (procfs_init_inferior): Don't push the target if it is already pushed. * windows-nat.c (do_initial_windows_stuff): Don't push the target if it is already pushed. (windows_detach): Use inf_child_maybe_unpush_target. (windows_mourn_inferior): Only unpush the target after mourning the inferior. Use inf_child_maybe_unpush_target. gdb/doc/ 2014-05-21 Pedro Alves <palves@redhat.com> * gdb.texinfo (Starting): Document "set/show auto-connect-native-target". (Target Commands): Document "target native". gdb/testsuite/ 2014-05-21 Pedro Alves <palves@redhat.com> * boards/gdbserver-base.exp (GDBFLAGS): Set to "set auto-connect-native-target off". * gdb.base/auto-connect-native-target.c: New file. * gdb.base/auto-connect-native-target.exp: New file.
2014-05-21 19:30:47 +02:00
2014-05-21 Pedro Alves <palves@redhat.com>
* inf-child.c (inf_child_ops, inf_child_explicitly_opened): New
globals.
(inf_child_open_target): New function.
(inf_child_open): Use inf_child_open_target to push the target
instead of erroring out.
(inf_child_disconnect, inf_child_close)
(inf_child_maybe_unpush_target): New functions.
(inf_child_target): Install inf_child_disconnect and
inf_child_close. Store a pointer to the returned object.
* inf-child.h (inf_child_open_target, inf_child_maybe_unpush): New
declarations.
* target.c (auto_connect_native_target): New global.
(show_default_run_target): New function.
(find_default_run_target): Return NULL if automatically connecting
to the native target is disabled.
(_initialize_target): Install set/show auto-connect-native-target.
* NEWS: Mention "set auto-connect-native-target", and "target
native".
* linux-nat.c (super_close): New global.
(linux_nat_close): Call super_close.
(linux_nat_add_target): Store a pointer to the base class's
to_close method.
* inf-ptrace.c (inf_ptrace_mourn_inferior, inf_ptrace_detach): Use
inf_child_maybe_unpush.
* inf-ttrace.c (inf_ttrace_him): Don't push the target if it is
already pushed.
(inf_ttrace_mourn_inferior): Only unpush the target after mourning
the inferior. Use inf_child_maybe_unpush_target.
(inf_ttrace_attach): Don't push the target if it is already
pushed.
(inf_ttrace_detach): Use inf_child_maybe_unpush_target.
* darwin-nat.c (darwin_mourn_inferior): Only unpush the target
after mourning the inferior. Use inf_child_maybe_unpush_target.
(darwin_attach_pid): Don't push the target if it is already
pushed.
* gnu-nat.c (gnu_mourn_inferior): Only unpush the target after
mourning the inferior. Use inf_child_maybe_unpush_target.
(gnu_detach): Use inf_child_maybe_unpush_target.
* go32-nat.c (go32_create_inferior): Don't push the target if it
is already pushed.
(go32_mourn_inferior): Use inf_child_maybe_unpush_target.
* nto-procfs.c (procfs_is_nto_target): Adjust comment.
(procfs_open): Rename to ...
(procfs_open_1): ... this. Add target_ops parameter. Adjust
comments. Can target_preopen before changing node. Call
inf_child_open_target to push the target explicitly.
(procfs_attach): Don't push the target if it is already pushed.
(procfs_detach): Use inf_child_maybe_unpush_target.
(procfs_create_inferior): Don't push the target if it is already
pushed.
(nto_native_ops): New global.
(procfs_open): Reimplement.
(procfs_native_open): New function.
(init_procfs_targets): Install procfs_native_open as to_open of
"target native". Store a pointer to the "native" target in
nto_native_ops.
* procfs.c (procfs_attach): Don't push the target if it is already
pushed.
(procfs_detach): Use inf_child_maybe_unpush_target.
(procfs_mourn_inferior): Only unpush the target after mourning the
inferior. Use inf_child_maybe_unpush_target.
(procfs_init_inferior): Don't push the target if it is already
pushed.
* windows-nat.c (do_initial_windows_stuff): Don't push the target
if it is already pushed.
2014-05-21 Pedro Alves <palves@redhat.com>
* NEWS: Mention that the "child", "GNU, "djgpp", "darwin-child"
and "procfs" targets are now called "native" instead.
2014-05-21 Pedro Alves <palves@redhat.com>
* go32-nat.c (go32_open): Delete.
(go32_target): Don't override the to_open method.
2014-05-21 Pedro Alves <palves@redhat.com>
* nto-procfs.c (procfs_can_run): New function.
(nto_procfs_ops): New global.
(init_procfs_targets): New, based on procfs_target. Install
"target native" in addition to "target procfs".
(_initialize_procfs): Call init_procfs_targets instead of adding
the target here.
2014-05-21 Pedro Alves <palves@redhat.com>
* windows-nat.c (windows_target): Don't override to_shortname,
to_longname or to_doc.
2014-05-21 Pedro Alves <palves@redhat.com>
* gnu-nat.c (gnu): Don't override to_shortname, to_longname or
to_doc.
2014-05-21 Pedro Alves <palves@redhat.com>
* darwin-nat.c (_initialize_darwin_inferior): Don't override
to_shortname, to_longname or to_doc.
2014-05-21 Pedro Alves <palves@redhat.com>
* go32-nat.c (go32_target): Don't override to_shortname,
to_longname or to_doc.
Rename "target child" to "target native". I had been pondering renaming "target child" to something else. "child" is a little lie in case of "attach", and not exactly very clear to users, IMO. By best suggestion is "target native". If I were to explain what "target child" is, I'd just start out with "it's the native target" anyway. I was worrying a little that "native" might be a lie too if some port comes up with a default target that can run but is not really native, but I think that's a very minor issue - we can consider that "native" really means the default built in target that GDB supports, instead of saying that's the target that debugs host native processes, if it turns out necessary. This change doesn't affect users much, because "target child" results in error today: (gdb) target child Use the "run" command to start a child process. Other places "child" is visible: (gdb) help target ... List of target subcommands: target child -- Child process (started by the "run" command) target core -- Use a core file as a target target exec -- Use an executable file as a target ... (gdb) info target Symbols from "/home/pedro/gdb/mygit/build/gdb/gdb". Child process: Using the running image of child Thread 0x7ffff7fc9740 (LWP 4818). While running this, GDB does not access memory from... ... These places will say "native" instead. I think that's a good thing. gdb/ 2014-05-21 Pedro Alves <palves@redhat.com> * inf-child.c (inf_child_open): Remove mention of "child". (inf_child_target): Rename target to "native" instead of "child". gdb/testsuite/ 2014-05-21 Pedro Alves <palves@redhat.com> * gdb.base/default.exp: Test "target native" instead of "target child".
2014-05-21 19:30:43 +02:00
2014-05-21 Pedro Alves <palves@redhat.com>
* inf-child.c (inf_child_open): Remove mention of "child".
(inf_child_target): Rename target to "native" instead of "child".
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* Makefile.in (SFILES): Delete "regset.c".
(COMMON_OBS): Delete "regset.o".
* regset.c: Remove.
* regset.h (regset_alloc): Delete prototype.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* sparc-linux-tdep.c (sparc32_linux_gregset)
(sparc32_linux_fpregset): New static regset structures.
(sparc32_linux_init_abi): Drop dynamic regset allocations.
* sparc-tdep.h (struct gdbarch_tdep): Constify 'gregset' and
'fpregset' fields.
* sparc64-linux-tdep.c: (sparc64_linux_gregset)
(sparc64_linux_fpregset): New static regset structures.
(sparc64_linux_init_abi): Drop dynamic regset allocations.
* sparc64fbsd-tdep.c (sparc64fbsd_gregset, sparc64fbsd_fpregset):
New static regset structures.
(sparc64fbsd_init_abi): Drop dynamic regset allocations.
* sparc64nbsd-tdep.c (sparc64nbsd_gregset, sparc64nbsd_fpregset):
New static regset structures.
(sparc64nbsd_init_abi): Drop dynamic regset allocations.
* sparc64obsd-tdep.c (sparc64obsd_gregset, sparc64obsd_fpregset):
New static regset structures.
(sparc64obsd_init_abi): Drop dynamic regset allocations.
* sparcnbsd-tdep.c (sparc32nbsd_gregset, sparc32nbsd_fpregset):
New static regset structures.
(sparc32nbsd_init_abi): Drop dynamic regset allocations.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* sparc-linux-nat.c (supply_gregset, supply_fpregset)
(fill_gregset, fill_fpregset, _initialize_sparc_linux_nat): Rename
register maps ("regmaps") from "*regset" to "*regmap". Do this
for all regmap types and variables.
* sparc-linux-tdep.c (sparc32_linux_step_trap)
(sparc32_linux_supply_core_gregset)
(sparc32_linux_collect_core_gregset)
(sparc32_linux_supply_core_fpregset)
(sparc32_linux_collect_core_fpregset): Likewise.
* sparc-nat.c (sparc_gregset, sparc_fpregset): Rename to...
(sparc_gregmap, sparc_fpregmap): ... these.
(sparc_supply_gregset, sparc_collect_gregset)
(sparc_supply_fpregset, sparc_collect_fpregset): Likewise.
(sparc_fetch_inferior_registers, sparc_store_inferior_registers)
(_initialize_sparc_nat): Rename regmaps.
* sparc-nat.h (sparc_gregset, sparc_fpregset): Rename to...
(sparc_gregmap, sparc_fpregmap): ... these.
(sparc_supply_gregset, sparc_collect_gregset)
(sparc_supply_fpregset, sparc_collect_fpregset): Likewise.
* sparc-sol2-nat.c (sparc_sol2_gregset, sparc_sol2_fpregset):
Rename macros to...
(sparc_sol2_gregmap, sparc_sol2_fpregmap): ... these.
(supply_gregset, supply_fpregset, fill_gregset, fill_fpregset):
Likewise.
* sparc-sol2-tdep.c (sparc32_sol2_gregset, sparc32_sol2_fpregset):
Rename to...
(sparc32_sol2_gregmap, sparc32_sol2_fpregmap): ... these.
* sparc-tdep.c (sparc32_supply_gregset, sparc32_collect_gregset)
(sparc32_supply_fpregset, sparc32_collect_fpregset): Rename
regmaps.
(sparc32_sunos4_gregset, sparc32_sunos4_fpregset)
(sparc32_bsd_fpregset): Rename to...
(sparc32_sunos4_gregmap, sparc32_sunos4_fpregmap)
(sparc32_bsd_fpregmap): ... these.
* sparc-tdep.h (struct sparc_gregset, struct sparc_fpregset)
(sparc32_sunos4_gregset, sparc32_sunos4_fpregset)
(sparc32_bsd_fpregset, sparc32_sol2_gregset)
(sparc32_sol2_fpregset, sparc32nbsd_gregset): Rename to...
(struct sparc_gregmap, struct sparc_fpregmap)
(sparc32_sunos4_gregmap, sparc32_sunos4_fpregmap)
(sparc32_bsd_fpregmap, sparc32_sol2_gregmap)
(sparc32_sol2_fpregmap, sparc32nbsd_gregmap): ... these.
(sparc32_supply_regset, sparc32_collect_gregset)
(sparc32_supply_fpregset, sparc32_collect_fpregset): Adjust
prototypes.
* sparc64-linux-nat.c (sparc64_linux_ptrace_gregset): Rename to...
(sparc64_linux_ptrace_gregmap): ... this.
(supply_gregset, supply_fpregset, fill_gregset, fill_fpregset)
(_initialize_sparc64_linux_nat): Rename regmaps.
* sparc64-linux-tdep.c (sparc64_linux_core_gregset): Rename to...
(sparc64_linux_core_gregmap): ... this.
(sparc64_linux_supply_core_gregset)
(sparc64_linux_collect_core_gregset)
(sparc64_linux_supply_core_fpregset)
(sparc64_linux_collect_core_fpregset): Rename regmaps.
* sparc64-sol2-tdep.c (sparc64_sol2_gregset)
(sparc64_sol2_fpregset): Rename to...
(sparc64_sol2_gregmap, sparc64_sol2_fpregmap): ... these.
* sparc64-tdep.c (sparc64_supply_gregset, sparc64_collect_gregset)
(sparc64_supply_fpregset, sparc64_collect_fpregset): Rename
regmaps.
* sparc64-tdep.h (struct sparc_gregset, sparc64_sol2_gregset)
(sparc64_sol2_fpregset, sparc64fbsd_gregset, sparc64nbsd_gregset)
(sparc64_bsd_fpregset): Rename to...
(struct sparc_gregmap, sparc64_sol2_gregmap)
(sparc64_sol2_fpregmap, sparc64fbsd_gregmap, sparc64nbsd_gregmap)
(sparc64_bsd_fpregmap): ... these.
(sparc64_supply_gregset, sparc64_collect_gregset)
(sparc64_supply_fpregset, sparc64_collect_fpregset): Adjust
prototypes.
* sparc64fbsd-nat.c (_initialize_sparc64fbsd_nat): Rename regmaps.
* sparc64fbsd-tdep.c (sparc64fbsd_gregset): Rename to...
(sparc64fbsd_gregmap): ... this.
(sparc64fbsd_supply_gregset, sparc64fbsd_collect_gregset)
(sparc64fbsd_supply_fpregset, sparc64fbsd_collect_fpregset):
Rename regmaps.
* sparc64nbsd-nat.c (sparc64nbsd_supply_gregset)
(sparc64nbsd_collect_gregset, sparc64nbsd_supply_fpregset)
(sparc64nbsd_collect_fpregset): Likewise.
* sparc64nbsd-tdep.c (sparc64nbsd_gregset): Rename to...
(sparc64nbsd_gregmap): ... this.
(sparc64nbsd_supply_gregset, sparc64nbsd_supply_fpregset): Rename
regmaps.
* sparc64obsd-nat.c (_initialize_sparc64obsd_nat): Likewise.
* sparc64obsd-tdep.c (sparc64obsd_gregset): Rename to...
(sparc64obsd_gregmap): ... this.
(sparc64obsd_supply_gregset, sparc64obsd_supply_fpregset): Rename
regmaps.
* sparcnbsd-nat.c (_initialize_sparcnbsd_nat): Likewise.
* sparcnbsd-tdep.c (sparc32nbsd_gregset): Rename to...
(sparc32nbsd_gregmap): ... this.
(sparc32nbsd_supply_gregset, sparc32nbsd_supply_fpregset): Rename
regmaps.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* score-tdep.c (score7_linux_gregset): New static regset
structure.
(score7_linux_regset_from_core_section): Remove dynamic regset
allocation.
(score_gdbarch_init): Drop allocation of tdep structure.
* score-tdep.h (struct gdbarch_tdep): Remove declaration.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* mn10300-linux-tdep.c (am33_gregset, am33_fpregset): New static
regset structures.
(am33_regset_from_core_section): Remove dynamic regset
allocations.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* mips-linux-tdep.c (mips_linux_gregset, mips64_linux_gregset)
(mips_linux_fpregset, mips64_linux_fpregset): New static regset
structures.
(mips_linux_regset_from_core_section): Remove dynamic regset
allocations.
* mips-tdep.h (struct gdbarch_tdep): Remove fields 'gregset',
'gregset64', 'fpregset', and 'fpregset64'.
* mips-tdep.c (mips_gdbarch_init): Remove initialization of
deleted tdep fields.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* amd64-tdep.c (amd64_fpregset, amd64_xstateregset): New static
regset structures.
(amd64_regset_from_core_section): Remove dynamic regset
allocations.
* amd64obsd-tdep.c (amd64obsd_combined_regset): New static regset
structure.
(amd64obsd_regset_from_core_section): Remove dynamic regset
allocation.
* i386-cygwin-tdep.c (i386_windows_regset_from_core_section):
Likewise.
* i386-nto-tdep.c (i386nto_supply_gregset): Adjust call to
x86-common regset supply function.
* i386-tdep.c (i386_collect_gregset): Make static.
(i386_gregset): New global regset structure.
(i386_fpregset, i386_xstateregset): New static regset structures.
(i386_regset_from_core_section): Remove dynamic regset
allocations.
(i386_gdbarch_init): Remove initialization of tdep fields
'gregset', 'fpregset', and 'xstateregset'.
* i386-tdep.h (struct gdbarch_tdep): Remove fields 'gregset',
'fpregset', and 'xstateregset'.
(i386_collect_gregset): Remove prototype.
(i386_gregset): New declaration.
* i386obsd-tdep.c (i386obsd_aout_gregset): New static regset
structure.
(i386obsd_aout_regset_from_core_section): Remove dynamic regset
allocation.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* arm-linux-tdep.c (arm_linux_gregset, arm_linux_fpregset)
(arm_linux_vfpregset): New static regset structures.
(arm_linux_regset_from_core_section): Remove dynamic allocation of
regset structures.
* arm-tdep.h (struct gdbarch_tdep): Remove 'gregset', 'fpregset',
and 'vfpregset' fields.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* aarch64-linux-tdep.c (aarch64_linux_gregset)
(aarch64_linux_fpregset): New static regset structures.
(aarch64_linux_regset_from_core_section): Drop dynamic allocation
of regset structures.
* aarch64-tdep.h (struct gdbarch_tdep): Remove 'gregset' and
'fpregset' fields.
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* regset.h (struct regset): Remove gdbarch field.
* regset.c (regset_alloc): Drop initialization of gdbarch field.
* nios2-linux-tdep.c (nios2_core_regset): Likewise.
* ppcfbsd-tdep.c (ppc32_fbsd_gregset, ppc64_fbsd_gregset):
Likewise.
* ppc-linux-tdep.c (ppc32_linux_gregset, ppc64_linux_gregset)
(ppc32_linux_fpregset, ppc32_linux_vrregset)
(ppc32_linux_vsxregset): Likewise.
* i386obsd-tdep.c (i386obsd_aout_supply_regset): Get the gdbarch
via the regcache instead of the regset.
* i386-tdep.c (i386_supply_gregset, i386_collect_gregset)
(i386_supply_fpregset, i386_collect_fpregset): Likewise.
* amd64obsd-tdep.c (amd64obsd_supply_regset): Likewise.
* amd64-tdep.c (amd64_supply_fpregset, amd64_collect_fpregset):
Likewise.
2014-03-03 10:31:21 +01:00
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
* alpha-linux-tdep.c (alpha_linux_gregset, alpha_linux_fpregset):
Constify structures.
* alphanbsd-tdep.c (alphanbsd_gregset, alphanbsd_fpregset)
(alphanbsd_aout_gregset): Likewise.
* armbsd-tdep.c (armbsd_gregset, armbsd_fpregset): Likewise.
* frv-linux-tdep.c (frv_linux_gregset, frv_linux_fpregset):
Likewise.
* hppa-hpux-tdep.c (hppa_hpux_regset): Likewise.
* hppa-linux-tdep.c (hppa_linux_regset, hppa_linux_fpregset):
Likewise.
* hppanbsd-tdep.c (hppanbsd_gregset): Likewise.
* hppaobsd-tdep.c (hppaobsd_gregset, hppaobsd_fpregset): Likewise.
* m32r-linux-tdep.c (m32r_linux_gregset): Likewise.
* m68kbsd-tdep.c (m68kbsd_gregset, m68kbsd_fpregset): Likewise.
* m88k-tdep.c (m88k_gregset): Likewise.
* mips64obsd-tdep.c (mips64obsd_gregset): Likewise.
* mipsnbsd-tdep.c (mipsnbsd_gregset, mipsnbsd_fpregset): Likewise.
* nios2-linux-tdep.c (nios2_core_regset): Likewise.
* ppcfbsd-tdep.c (ppc32_fbsd_fpregset): Likewise.
* ppcnbsd-tdep.c (ppcnbsd_gregset, ppcnbsd_fpregset): Likewise.
* ppcnbsd-tdep.h (ppcnbsd_gregset, ppcnbsd_fpregset): Likewise.
* ppcobsd-tdep.c (ppcobsd_gregset, ppcobsd_fpregset): Likewise.
* ppcobsd-tdep.h (ppcobsd_gregset, ppcobsd_fpregset): Likewise.
* rs6000-aix-tdep.c (rs6000_aix32_regset, rs6000_aix64_regset):
Likewise.
* sh-tdep.c (sh_corefile_gregset, sh_corefile_fpregset): Likewise.
* sh-tdep.h (sh_corefile_gregset): Likewise.
* tilegx-linux-tdep.c (tilegx_linux_regset): Likewise.
* vax-tdep.c (vax_gregset): Likewise.
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.
* 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.
2014-05-21 Pedro Alves <palves@redhat.com>
* dcache.c (dcache_read_memory_partial): If reading the cache line
fails, fallback to reading just the memory the caller wanted.
Fix gdb.multi/base.exp failures. UNRESOLVED: gdb.multi/base.exp: remove-inferiors 2-3 UNRESOLVED: gdb.multi/base.exp: check remove-inferiors gdb is crashing because it's accessing/freeing already freed memory. ==16368== Invalid read of size 4 ==16368== at 0x660A9D: find_pc_section (binutils-gdb/gdb/objfiles.c:1349) ==16368== by 0x663ECB: lookup_minimal_symbol_by_pc_section (binutils-gdb/gdb/minsyms.c:734) ==16368== by 0x5D987A: find_pc_sect_symtab (binutils-gdb/gdb/symtab.c:2153) ==16368== by 0x5D4D77: blockvector_for_pc_sect (binutils-gdb/gdb/block.c:168) ==16368== by 0x5D4F59: block_for_pc_sect (binutils-gdb/gdb/block.c:246) ==16368== by 0x5D4F9B: block_for_pc (binutils-gdb/gdb/block.c:258) ==16368== by 0x734C5D: inline_frame_sniffer (binutils-gdb/gdb/inline-frame.c:218) ==16368== by 0x732104: frame_unwind_try_unwinder (binutils-gdb/gdb/frame-unwind.c:108) ==16368== by 0x73223F: frame_unwind_find_by_frame (binutils-gdb/gdb/frame-unwind.c:159) ==16368== by 0x72D5AA: compute_frame_id (binutils-gdb/gdb/frame.c:453) ==16368== by 0x7300EC: get_prev_frame_if_no_cycle (binutils-gdb/gdb/frame.c:1758) ==16368== by 0x73079A: get_prev_frame_always (binutils-gdb/gdb/frame.c:1931) ==16368== Address 0x5b13500 is 16 bytes inside a block of size 24 free'd ==16368== at 0x403072E: free (valgrind/coregrind/m_replacemalloc/vg_replace_malloc.c:445) ==16368== by 0x762134: xfree (binutils-gdb/gdb/common/common-utils.c:108) ==16368== by 0x65DACF: objfiles_pspace_data_cleanup (binutils-gdb/gdb/objfiles.c:91) ==16368== by 0x75E546: program_spaceregistry_callback_adaptor (binutils-gdb/gdb/progspace.c:45) ==16368== by 0x7644F6: registry_clear_data (binutils-gdb/gdb/registry.c:82) ==16368== by 0x7645AB: registry_container_free_data (binutils-gdb/gdb/registry.c:95) ==16368== by 0x75E5B4: program_space_free_data (binutils-gdb/gdb/progspace.c:45) ==16368== by 0x75E9BA: release_program_space (binutils-gdb/gdb/progspace.c:167) ==16368== by 0x75EB9B: prune_program_spaces (binutils-gdb/gdb/progspace.c:269) ==16368== by 0x75303D: remove_inferior_command (binutils-gdb/gdb/inferior.c:792) ==16368== by 0x50B5FD: do_cfunc (binutils-gdb/gdb/cli/cli-decode.c:107) ==16368== by 0x50E6F2: cmd_func (binutils-gdb/gdb/cli/cli-decode.c:1886) The problem originates from the get_current_arch call in py-progspace.c:py_free_pspace. The inferior associated with the pspace is gone, and the current inferior is a different one and is running. Therefore get_current_arch tries to read the current frame which causes reads of data in the current program space which we've just deleted. * python/py-progspace.c (py_free_pspace): Call target_gdbarch instead of get_current_arch.
2014-05-20 22:06:26 +02:00
2014-05-20 Doug Evans <dje@google.com>
* python/py-progspace.c (py_free_pspace): Call target_gdbarch
instead of get_current_arch.
Make compare-sections work against all targets; add compare-sections [-r] tests. This does two things: 1. Adds a test. Recently compare-sections got a new "-r" switch, but given no test existed for compare-sections, the patch was allowed in with no testsuite addition. This now adds a test for both compare-sections and compare-sections -r. 2. Makes the compare-sections command work against all targets. Currently, compare-sections only works with remote targets, and only those that support the qCRC packet. The patch makes it so that if the target doesn't support accelerating memory verification, then GDB falls back to comparing memory itself. This is of course slower, but it's better than nothing, IMO. While testing against extended-remote GDBserver I noticed that we send the qCRC request to the target if we're connected, but not yet running a program. That can't work of course -- the patch fixes that. This all also goes in the direction of bridging the local/remote parity gap. I didn't decouple 1. from 2., because that would mean that the test would need to handle the case of the target not supporting the command. Tested on x86_64 Fedora 17, native, remote GDBserver, and extended-remote GDBserver. I also hack-disabled qCRC support to make sure the fallback paths in remote.c work. gdb/doc/ 2014-05-20 Pedro Alves <palves@redhat.com> * gdb.texinfo (Memory) <compare-sections>: Generalize comments to not be remote specific. Add cross reference to the qCRC packet. (Separate Debug Files): Update cross reference to the qCRC packet. (General Query Packets) <qCRC packet>: Add anchor. gdb/ 2014-05-20 Pedro Alves <palves@redhat.com> * NEWS: Mention that compare-sections now works with all targets. * remote.c (PACKET_qCRC): New enum value. (remote_verify_memory): Don't send qCRC if the target has no execution. Use packet_support/packet_ok. If the target doesn't support the qCRC packet, fallback to a deep memory copy. (compare_sections_command): Say "target image" instead of "remote executable". (_initialize_remote): Add PACKET_qCRC to the list of config packets that have no associated command. Extend comment. * target.c (simple_verify_memory, default_verify_memory): New function. * target.h (struct target_ops) <to_verify_memory>: Default to default_verify_memory. (simple_verify_memory): New declaration. * target-delegates.c: Regenerate. gdb/testsuite/ 2014-05-20 Pedro Alves <palves@redhat.com> * gdb.base/compare-sections.c: New file. * gdb.base/compare-sections.exp: New file.
2014-05-20 20:11:39 +02:00
2014-05-20 Pedro Alves <palves@redhat.com>
* NEWS: Mention that compare-sections now works with all targets.
* remote.c (PACKET_qCRC): New enum value.
(remote_verify_memory): Don't send qCRC if the target has no
execution. Use packet_support/packet_ok. If the target doesn't
support the qCRC packet, fallback to a deep memory copy.
(compare_sections_command): Say "target image" instead of "remote
executable".
(_initialize_remote): Add PACKET_qCRC to the list of config
packets that have no associated command. Extend comment.
* target.c (simple_verify_memory, default_verify_memory): New
function.
* target.h (struct target_ops) <to_verify_memory>: Default to
default_verify_memory.
(simple_verify_memory): New declaration.
* target-delegates.c: Regenerate.
2014-05-20 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_step_thread): Check for empty history.
Fix issue #15778: GDB Aarch64 signal frame unwinder issue The root cause of this issue is unwinder of "#3 <signal handler called>" doesn't supply right values of registers. When GDB want to get the previous frame of "#3 <signal handler called>", it will call cache init function of unwinder "aarch64_linux_sigframe_init". The address or the value of the registers is get from this function. So the bug is inside thie function. I check the asm code of "#3 <signal handler called>": (gdb) frame 3 (gdb) p $pc $1 = (void (*)()) 0x7f931fa4d0 (gdb) disassemble $pc, +10 Dump of assembler code from 0x7f931fa4d0 to 0x7f931fa4da: => 0x0000007f931fa4d0: mov x8, #0x8b // #139 0x0000007f931fa4d4: svc #0x0 0x0000007f931fa4d8: nop This is the syscall sys_rt_sigreturn, Linux kernel function "restore_sigframe" will set the frame: for (i = 0; i < 31; i++) __get_user_error(regs->regs[i], &sf->uc.uc_mcontext.regs[i], err); __get_user_error(regs->sp, &sf->uc.uc_mcontext.sp, err); __get_user_error(regs->pc, &sf->uc.uc_mcontext.pc, err); The struct of uc_mcontext is: struct sigcontext { __u64 fault_address; /* AArch64 registers */ __u64 regs[31]; __u64 sp; __u64 pc; __u64 pstate; /* 4K reserved for FP/SIMD state and future expansion */ __u8 __reserved[4096] __attribute__((__aligned__(16))); }; But in GDB function "aarch64_linux_sigframe_init", the code the get address of registers is: for (i = 0; i < 31; i++) { trad_frame_set_reg_addr (this_cache, AARCH64_X0_REGNUM + i, sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET + i * AARCH64_SIGCONTEXT_REG_SIZE); } trad_frame_set_reg_addr (this_cache, AARCH64_FP_REGNUM, fp); trad_frame_set_reg_addr (this_cache, AARCH64_LR_REGNUM, fp + 8); trad_frame_set_reg_addr (this_cache, AARCH64_PC_REGNUM, fp + 8); The code that get pc and sp is not right, so I change the code according to Linux kernel code: trad_frame_set_reg_addr (this_cache, AARCH64_SP_REGNUM, sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET + 31 * AARCH64_SIGCONTEXT_REG_SIZE); trad_frame_set_reg_addr (this_cache, AARCH64_PC_REGNUM, sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET + 32 * AARCH64_SIGCONTEXT_REG_SIZE); The issue was fixed by this change, and I did the regression test. It also fixed a lot of other XFAIL and FAIL. 2014-05-20 Hui Zhu <hui@codesourcery.com> Yao Qi <yao@codesourcery.com> PR backtrace/16558 * aarch64-linux-tdep.c (aarch64_linux_sigframe_init): Update comments and change address of sp and pc.
2014-05-20 07:19:06 +02:00
2014-05-20 Hui Zhu <hui@codesourcery.com>
Yao Qi <yao@codesourcery.com>
PR backtrace/16558
* aarch64-linux-tdep.c (aarch64_linux_sigframe_init): Update comments
and change address of sp and pc.
2014-05-19 Tom Tromey <tromey@redhat.com>
* gdbtypes.c (rank_function): Use XNEWVEC.
* mi/mi-cmds.c (build_table): Use XCNEWVEC.
2014-05-19 Doug Evans <dje@google.com>
* dwarf2read.c (build_type_psymtabs_1): Renamed from
build_type_unit_groups and moved closer to only caller. Remove
arguments. All references updated. Remove outdated .gdb_index
comment.
(struct tu_abbrev_offset, sort_tu_by_abbrev_offset): Move with
build_type_psymtabs_1.
2014-05-19 Doug Evans <dje@google.com>
* dwarf2read.c (struct dwarf2_per_objfile): Delete unused members
n_type_unit_groups, all_type_unit_groups. All uses removed.
(get_type_unit_group, build_type_unit_groups): Delete forward decls.
(dw2_get_cutu): Renamed from dw2_get_cu. All callers updated.
(dw2_get_cu): Renamed from dw2_get_primary_cu. All callers updated.
(add_type_unit_group_to_table): Delete.
2014-05-19 Doug Evans <dje@google.com>
* eval.c (evaluate_subexp_standard): Add some comments.
2014-05-17 Doug Evans <xdje42@gmail.com>
* progspace.c (remove_program_space): Delete, unused.
* progspace.h (remove_program_space): Ditto.
2014-05-17 Doug Evans <xdje42@gmail.com>
* inferior.c (prune_inferiors): Fix comment.
(remove_inferior_command): Call prune_program_spaces.
2014-05-16 Doug Evans <dje@google.com>
New command line option -D.
* NEWS: Mention it.
* main.c (set_gdb_data_directory): New function.
(captured_main): Recognize -D. Flag error for --data-directory "".
Call set_gdb_data_directory.
(print_gdb_help): Print --data-directory, -D.
* main.h (set_gdb_data_directory): Declare.
* top.c (staged_gdb_datadir): New static global.
(set_gdb_datadir): Call set_gdb_data_directory
(show_gdb_datadir): New function.
(init_main): Update init of data-directory parameter.
2014-05-16 Gregory Fong <gregory.0xf0@gmail.com>
Import the "dirfd" gnulib module.
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add dirfd.
* gnulib/aclocal.m4: Update.
* gnulib/config.in: Update.
* gnulib/configure: Update.
* gnulib/import/Makefile.am: Update.
* gnulib/import/Makefile.in: Update.
* gnulib/import/dirfd.c: New.
* gnulib/import/m4/dirfd.m4: New.
* gnulib/import/m4/gnulib-cache.m4: Update.
* gnulib/import/m4/gnulib-comp.m4: Update.
2014-05-16 Pierre Muller <muller@sourceware.org>
Yao Qi <yao@codesourcery.com>
* valprint.c (print_wchar): Move the code on checking whether
W is a printable wide char to the default branch of switch
statement below. Call wchar_printable instead of gdb_iswprint.
2014-05-16 Taimoor Mirza <tmirza@codesourcery.com>
* arm-tdep.c (thumb_analyze_prologue): Fix offset calculation for
ldr.w and ldrd instructions.
2014-05-15 Doug Evans <dje@google.com>
* dwarf2read.c (read_structure_type): Delete outdated comments.
2014-05-14 Tom Tromey <tromey@redhat.com>
* macrocmd.c (print_macro_definition): Reindent.
2014-05-13 Doug Evans <xdje42@gmail.com>
* python/py-cmd.c (cmdpy_completer): Add comment.
(completers): Make const.
2014-05-13 Simon Marchi <simon.marchi@ericsson.com>
* infrun.c (resume): Remove should_resume (unused). Move up
declaration of resume_ptid.
2014-05-13 Tom Tromey <tromey@redhat.com>
* language.h (unop_type_check): Remove.
(binop_type_check): Don't declare.
2014-05-13 Andreas Arnez <arnez@vnet.linux.ibm.com>
* s390-linux-nat.c (fill_gregset): Remove erroneous offset 4 in
call to regcache_raw_collect.
2014-05-12 Simon Marchi <simon.marchi@ericsson.com>
* mi/mi-console.c (mi_console_raw_packet): Use the value from
mi_console->quote as the quoting character.
2014-05-12 Simon Marchi <simon.marchi@ericsson.com>
* MAINTAINERS (Write After Approval): Add "Simon Marchi".
2014-04-29 Tom Tromey <tromey@redhat.com>
* varobj.c (_initialize_varobj): Rename to "set debug varobj" and
"show debug varobj".
2014-05-07 Kyle McMartin <kyle@redhat.com>
Pushed by Joel Brobecker <brobecker@adacore.com>.
* aarch64-tdep.c (aarch64_software_single_step): New function.
(aarch64_gdbarch_init): Handle single stepping of atomic sequences
with aarch64_software_single_step.
2014-05-05 Joel Brobecker <brobecker@adacore.com>
GDB 7.7.1 released.
2014-05-05 Keith Seitz <keiths@redhat.com>
* linespec.c (linespec_parse_basic): Run cleanups if a convenience
variable or history value is successfully parsed.
Partially available/unavailable data in requested range In gdb.trace/unavailable.exp, an action is defined to collect struct_b.struct_a.array[2] and struct_b.struct_a.array[100], struct StructB { int d, ef; StructA struct_a; int s:1; static StructA static_struct_a; const char *string; }; and the other files are not collected. When GDB examine traceframe collected by the action, "struct_b" is unavailable completely, which is wrong. (gdb) p struct_b $1 = <unavailable> When GDB reads 'struct_b', it will request to read memory at struct_b's address of length LEN. Since struct_b.d is not collected, no 'M' block includes the first part of the desired range, so tfile_xfer_partial returns TARGET_XFER_UNAVAILABLE and GDB thinks the whole requested range is unavailable. In order to fix this problem, in the iteration to 'M' blocks, we record the lowest address of blocks within the request range. If it has, the requested range isn't unavailable completely. This applies to ctf too. With this patch applied, the result looks good and fails in unavailable.exp is fixed. (gdb) p struct_b $1 = {d = <unavailable>, ef = <unavailable>, struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable>, <unavailable>, -1431655766, <unavailable> <repeats 97 times>, -1431655766, <unavailable> <repeats 9899 times>}, ptr = <unavailable>, bitfield = <unavailable>}, s = <unavailable>, static static_struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable> <repeats 10000 times>}, ptr = <unavailable>, bitfield = <unavailable>}, string = <unavailable>} gdb: 2014-05-05 Yao Qi <yao@codesourcery.com> Pedro Alves <palves@redhat.com> * tracefile-tfile.c (tfile_xfer_partial): Record the lowest address of blocks that intersects the requested range. Trim LEN up to LOW_ADDR_AVAILABLE if read from executable read-only sections. * ctf.c (ctf_xfer_partial): Likewise. gdb/testsuite: 2014-05-05 Yao Qi <yao@codesourcery.com> * gdb.trace/unavailable.exp (gdb_collect_args_test): Save traceframes into tfile and ctf trace files. Read data from trace file and test collected data. (gdb_collect_locals_test): Likewise. (gdb_unavailable_registers_test): Likewise. (gdb_unavailable_floats): Likewise. (gdb_collect_globals_test): Likewise. (top-level): Append "ctf" to trace_file_targets if GDB supports.
2014-04-26 04:14:52 +02:00
2014-05-05 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* tracefile-tfile.c (tfile_xfer_partial): Record the lowest
address of blocks that intersects the requested range. Trim
LEN up to LOW_ADDR_AVAILABLE if read from executable read-only
sections.
* ctf.c (ctf_xfer_partial): Likewise.
Show new created display When I run refactored unavailable.exp, I find command display behaves a little different on live inferior and on examining traceframes. In live inferior, when command "display argc" is typed, the value of "argc" is shown. (gdb) display argc 1: argc = 1 '\001' however, on tfile target, when command "display argc" is typed, the value of "argc" is not shown. (gdb) tfind Found trace frame 0, tracepoint 1 at ../../../../git/gdb/testsuite/gdb.trace/unavailable.cc:198 198 i = (int) argc + argi + argf + argd + argstruct.memberi + argarray[1]; (gdb) display argc I also notice that on "core" target, the value of "argc" isn't shown either. This difference is caused by the code below in printcmd.c:display_command, if (from_tty && target_has_execution) do_one_display (new); Looks the value of each display is shown if the target has execution. Source code archaeology doesn't tell much about this requirement. However, if we type command "display" then on "core" or "tfile" target, the value of "argc" is still displayed, for "core" target, (gdb) display argc (gdb) display 1: argc = 1 '\001' for "tfile" target, (gdb) display argc (gdb) display 1: argc = <unavailable> I feel that it is not necessary to have such "target has execution" requirement to show the value of new created display. Auto-display is a feature to show the value of expression frequently, has nothing to do with whether target has execution or not. On the other hand, GDB has the requirement for new created display, but command "display" can still show them, this is an inconsistency, which should be fixed. This patch is to remove the checking to target_has_execution from the condition. gdb: 2014-05-05 Yao Qi <yao@codesourcery.com> * printcmd.c (display_command): Remove the check to target_has_execution.
2014-04-26 02:47:33 +02:00
2014-05-05 Yao Qi <yao@codesourcery.com>
* printcmd.c (display_command): Remove the check to
target_has_execution.
2014-05-03 Mark Kettenis <kettenis@gnu.org>
* ppcobsd-nat.c: Include "obsd-nat.h".
(_initialize_ppcobsd_nat): Call obsd_add_target instead of
add_target.
* config/powerpc/obsd.mh (NATDEPFILES): Add obsd-nat.o.
2014-05-02 Sergio Durigan Junior <sergiodj@redhat.com>
* stap-probe.c (enum stap_arg_bitness): New enums to represent 8
and 16-bit signed and unsigned arguments. Update comment.
(stap_parse_probe_arguments): Extend code to handle such
arguments. Use warning instead of complaint to notify about
unrecognized bitness.
Fix PR breakpoints/16889: gdb segfaults when printing ASM SDT arguments This commit fixes PR breakpoints/16889, which is about a bug that triggers when GDB tries to parse probes whose arguments do not contain the initial (and optional) "N@" part. For reference sake, the de facto format is described here: <https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation> Anyway, this PR actually uncovered two bugs (related) that were happening while parsing the arguments. The first one was that the parser *was* catching *some* arguments that were missing the "N@" part, but it wasn't correctly setting the argument's type. This was causing a NULL pointer being dereferenced, ouch... The second bug uncovered was that the parser was not catching all of the cases for a probe which did not provide the "N@" part. The fix for that was to simplify the check that the code was making to identify non-prefixed probes. The code is simpler and easier to read now. I am also providing a testcase for this bug, only for x86_64 architectures. gdb/ 2014-05-02 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/16889 * stap-probe.c (stap_parse_probe_arguments): Simplify check for non-prefixed probes (i.e., probes whose arguments do not start with "N@"). Always set the argument type to a sane value. gdb/testsuite/ 2014-05-02 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/16889 * gdb.arch/amd64-stap-optional-prefix.S: New file. * gdb.arch/amd64-stap-optional-prefix.exp: Likewise.
2014-05-02 22:45:35 +02:00
2014-05-02 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/16889
* stap-probe.c (stap_parse_probe_arguments): Simplify
check for non-prefixed probes (i.e., probes whose
arguments do not start with "N@"). Always set the
argument type to a sane value.
2014-05-01 David Taylor <dtaylor@emc.com>
* remote.c (compare_sections_command): Add -r option to compare
all loadable read-only sections.
2014-04-30 Siva Chandra Reddy <sivachandra@google.com>
* dwarf2loc.c (dwarf2_locexpr_baton_eval,
dwarf2_evaluate_property): Remove unused CORE_ADDR argument.
Update all callers.
* dwarf2loc.h (dwarf2_evaluate_property): Update signature.
* gdbtypes.c (resolve_dynamic_range, resolve_dynamic_array):
Remove unused CORE_ADDR argument. Update all callers.
Fix remote connection to targets that don't support the QNonStop packet. ... and others. The recent patch that fixed several "set remote foo-packet on/off" commands introduced a regression, observable when connecting GDB to QEMU. For instance: (gdb) set debug remote 1 (gdb) tar rem :4444 Remote debugging using :4444 Sending packet: $qSupported:multiprocess+;qRelocInsn+#2a...Ack Packet received: PacketSize=1000;qXfer:features:read+ Packet qSupported (supported-packets) is supported Sending packet: $Hgp0.0#ad...Ack Packet received: OK Sending packet: $qXfer:features:read:target.xml:0,ffb#79...Ack Packet received: [...] Sending packet: $qXfer:features:read:arm-core.xml:0,ffb#08...Ack Packet received: [...] !!! -> Sending packet: $QNonStop:0#8c...Ack Packet received: Remote refused setting all-stop mode with: The "QNonStop" feature is associated with the PACKET_QNonStop packet, with a default of PACKET_DISABLE, so GDB should not be sending the packet at all. The patch that introduced the regression decoupled packet_config's 'detect' and 'support' fields, making the former (an auto_boolean) purely the associated "set remote foo-packet" command's variable. In the example above, the packet config's 'supported' field does end up correctly set to PACKET_DISABLE. However, nothing is presently initializing packet configs that don't actually have a command associated. Those configs's 'detect' field then ends up set to AUTO_BOOLEAN_TRUE, simply because that happens to be 0. This forces GDB to assume the packet is supported, irrespective of what the target claims it supports, just like if the user had done "set remote foo-packet on" (this being the associated command, if there was one). Ideally, all packet configs would have a command associated. While that isn't true, make sure all packet configs are initialized, even if no command is associated, and add an assertion that prevents adding more packets/features without an associated command. Tested on x86_64 Fedora 17, against pristine gdbserver, and against a gdbserver with the QNonStop packet/feature disabled with a local hack. gdb/ 2014-04-29 Pedro Alves <palves@redhat.com> * remote.c (struct packet_config) <detect>: Extend comment. (add_packet_config_cmd): Don't set the config's detect or support fields here. (init_all_packet_configs): Also initialize the config's 'detect' field. (reset_all_packet_configs_support): New function. (remote_open_1): Call reset_all_packet_configs_support instead of init_all_packet_configs. (_initialize_remote): Initialize all packet configs. Assert that all packets have an associated command, except a few known outliers.
2014-04-29 15:01:27 +02:00
2014-04-29 Pedro Alves <palves@redhat.com>
* remote.c (struct packet_config) <detect>: Extend comment.
(add_packet_config_cmd): Don't set the config's detect or support
fields here.
(init_all_packet_configs): Also initialize the config's 'detect'
field.
(reset_all_packet_configs_support): New function.
(remote_open_1): Call reset_all_packet_configs_support instead of
init_all_packet_configs.
(_initialize_remote): Initialize all packet configs. Assert that
all packets have an associated command, except a few known
outliers.
2014-04-28 Joel Brobecker <brobecker@adacore.com>
* dwarf2read.c (read_subrange_type): Handle dynamic
DW_AT_lower_bound attributes.
2014-04-28 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_discrete_type_high_bound): Resolve the type's
dynamic bounds before computing its upper bound.
(ada_discrete_type_low_bound): Same as above with the lower bound.
2014-04-28 Joel Brobecker <brobecker@adacore.com>
* dwarf2read.c (is_dynamic_type): Return true for dynamic
range types. Adjust the array handling implementation to
take advantage of this change.
(resolve_dynamic_range): New function, mostly extracted from
resolve_dynamic_bounds.
(resolve_dynamic_array): New function, mostly extracted from
resolve_dynamic_bounds.
(resolve_dynamic_bounds): Delete.
(resolve_dynamic_type): Reimplement. Add handling of
TYPE_CODE_RANGE types.
2014-04-28 Joel Brobecker <brobecker@adacore.com>
* ada-varobj.c (ada_varobj_describe_simple_array_child): Remove
handling of parallel ___XA types.
2014-04-28 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Remove
unnecessary second call to static_unwrap_type.
2014-04-27 Hui Zhu <hui@codesourcery.com>
* stack.c (print_frame_info): Call do_gdb_disassembly with
DUMMY_FRAME, SIGTRAMP_FRAME and ARCH_FRAME.
2014-04-26 Doug Evans <xdje42@gmail.com>
* guile/scm-safe-call.c (scscm_eval_scheme_string): Fix comment.
PR server/16255: gdbserver cannot attach to a second inferior that is multi-threaded. On Linux, we need to explicitly ptrace attach to all lwps of a process. Because GDB might not be connected yet when an attach is requested, and thus it may not be possible to activate thread_db, as that requires access to symbols (IOW, gdbserver --attach), a while ago we make linux_attach loop over the lwps as listed by /proc/PID/task to find the lwps to attach to. linux_attach_lwp_1 has: ... if (initial) /* If lwp is the tgid, we handle adding existing threads later. Otherwise we just add lwp without bothering about any other threads. */ ptid = ptid_build (lwpid, lwpid, 0); else { /* Note that extracting the pid from the current inferior is safe, since we're always called in the context of the same process as this new thread. */ int pid = pid_of (current_inferior); ptid = ptid_build (pid, lwpid, 0); } That "safe" comment referred to linux_attach_lwp being called by thread-db.c. But this was clearly missed when a new call to linux_attach_lwp_1 was added to linux_attach. As a result, current_inferior will be set to some random process, and non-initial lwps of the second inferior get assigned the pid of the wrong inferior. E.g., in the case of attaching to two inferiors, for the second inferior (and so on), non-initial lwps of the second inferior get assigned the pid of the first inferior. This doesn't trigger on the first inferior, when current_inferior is NULL, add_thread switches the current inferior to the newly added thread. Rather than making linux_attach switch current_inferior temporarily (thus avoiding further reliance on global state), or making linux_attach_lwp_1 get the tgid from /proc, which add extra syscalls, and will be wrong in case of the user having originally attached directly to a non-tgid lwp, and then that lwp spawning new clones (the ptid.pid field of further new clones should be the same as the original lwp's pid, which is not the tgid), we note that callers of linux_attach_lwp/linux_attach_lwp_1 always have the right pid handy already, so they can pass it down along with the lwpid. The only other reason for the "initial" parameter is to error out instead of warn in case of attach failure, when we're first attaching to a process. There are only three callers of linux_attach_lwp/linux_attach_lwp_1, and each wants to print a different warn/error string, so we can just move the error/warn out of linux_attach_lwp_1 to the callers, thus getting rid of the "initial" parameter. There really nothing gdbserver-specific about attaching to two threaded processes, so this adds a new test under gdb.multi/. The test passes cleanly against the native GNU/Linux target, but fails/triggers the bug against GDBserver (before the patch), with the native-extended-remote board (as plain remote doesn't support multi-process). Tested on x86_64 Fedora 17, with the native-extended-gdbserver board. gdb/gdbserver/ 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. gdb/ 2014-04-25 Pedro Alves <palves@redhat.com> PR server/16255 * common/linux-ptrace.c (linux_ptrace_attach_warnings): Rename to ... (linux_ptrace_attach_fail_reason): ... this. Remove "warning: " and newline from built string. * common/linux-ptrace.h (linux_ptrace_attach_warnings): Rename to ... (linux_ptrace_attach_fail_reason): ... this. * linux-nat.c (linux_nat_attach): Adjust to use linux_ptrace_attach_fail_reason. gdb/testsuite/ 2014-04-25 Simon Marchi <simon.marchi@ericsson.com> Pedro Alves <palves@redhat.com> PR server/16255 * gdb.multi/multi-attach.c: New file. * gdb.multi/multi-attach.exp: New file.
2014-04-25 20:07:33 +02:00
2014-04-25 Pedro Alves <palves@redhat.com>
PR server/16255
* common/linux-ptrace.c (linux_ptrace_attach_warnings): Rename to ...
(linux_ptrace_attach_fail_reason): ... this. Remove "warning: "
and newline from built string.
* common/linux-ptrace.h (linux_ptrace_attach_warnings): Rename to ...
(linux_ptrace_attach_fail_reason): ... this.
* linux-nat.c (linux_nat_attach): Adjust to use
linux_ptrace_attach_fail_reason.
Fix several "set remote foo-packet on/off" commands. For several RSP packets, there's a corresponding "set remote foo-packet on/off/auto" command that one can use do bypass auto-detection of support for the packet or feature. However, I noticed that setting several of these commands to 'on' or 'off' doesn't actually have any effect. These are, at least: set remote breakpoint-commands-packet set remote conditional-breakpoints-packet set remote fast-tracepoints-packet set remote static-tracepoints-packet set remote install-in-trace-packet These are commands that control a remote protocol feature that doesn't have a corresponding regular packet, and because of that we cache the knowledge of the remote side support as returned by the qSupported packet in the remote_state object. E.g., in the case of the 'set remote breakpoint-commands-packet' command, whether the feature is supported is recorded in the 'breakpoint_commands' field of the remote_state object. Whether to bypass packet support auto-detection or not is controlled by the 'detect' field of the corresponding packet's packet_config structure. That field is the variable associated directly with the "set remote foo-packet" command. Actual remote stub support for the packet (or feature) is recorded in the 'support' field of the same structure. However, when the user toggles the command, the 'support' field is also correspondingly updated to PACKET_ENABLE/DISABLE/SUPPORT_UNKNOWN, discarding the knowledge of whether the target actually supports the feature. If one toggles back to 'auto', it's no big issue for real packets, as they'll just end up re-probed the next time they might be necessary. But features whose support is only reported through qSupported don't get their corresponding (manually added/maintained) fields in remote_state objected updated. As we lost the actual status of the target support for the feature, GDB would need to probe the qSupported features again, which GDB doesn't do. But we can avoid that extra traffic, and clean things up, IMO. Instead of going in that direction, this patch completely decouples struct packet_config's 'detect' and 'support' fields. E.g., when the user does "set remote foo-packet off", instead of setting the packet config's 'support' field to PACKET_DISABLE, the 'support' field is not touched at all anymore. That is, we end up respecting this simple table: | packet_config->detect | packet_config->support | should use packet/feature? | |-----------------------+------------------------+----------------------------| | auto | PACKET_ENABLE | PACKET_ENABLE | | auto | PACKET_DISABLE | PACKET_DISABLE | | auto | PACKET_UNKNOWN | PACKET_UNKNOWN | | yes | don't care | PACKET_ENABLE | | no | don't care | PACKET_DISABLE | This is implemented by the new packet_support function. With that, we need to update this pattern throughout: if (remote_protocol_packets[PACKET_foo].support == PACKET_DISABLE) to do this instead: if (packet_support (PACKET_qAttached) == PACKET_DISABLE) where as mentioned, the packet_support function takes struct packet_config's 'detect' field into account, like in the table above. As when the packet is force-disabled or force-enabled, the 'support' field is just ignored, if the command is set back to auto, we'll resume respecting whatever the target said it supports. IOW, the end result is that the 'support' field always represents whether the target actually supports the packet or not. After all that, the manually maintained breakpoint_commands and equivalent fields of struct remote_state can then be eliminated, with references replaced by checking the result of calling the packet_support function on the corresponding packet or feature. This required adding new PACKET_foo enum values for several features that didn't have it yet. (The patch does not add corresponding "set remote foo-packet" style commands though, focusing only on bug fixing and laying the groundwork). Tested on x86_64 Fedora 17, native GDBserver. The new tests all fail without this patch. gdb/ 2014-04-25 Pedro Alves <palves@redhat.com> * remote.c (struct remote_state): Remove multi_process_aware, non_stop_aware, cond_tracepoints, cond_breakpoints, breakpoint_commands, fast_tracepoints, static_tracepoints, install_in_trace, disconnected_tracing, enable_disable_tracepoints, string_tracing, and augmented_libraries_svr4_read fields. (remote_multi_process_p): Move further below in the file. (struct packet_config): Add comments. (update_packet_config): Delete function. (show_packet_config_cmd): Use packet_config_support. (add_packet_config_cmd): Use NULL as set callback. (packet_ok): "set remote foo-packet"-style commands no longer change config->supported -- adjust. (PACKET_ConditionalTracepoints, PACKET_ConditionalBreakpoints) (PACKET_BreakpointCommands, PACKET_FastTracepoints) (PACKET_StaticTracepoints, PACKET_InstallInTrace): Add comments. (PACKET_QNonStop, PACKET_multiprocess_feature) (PACKET_EnableDisableTracepoints_feature, PACKET_tracenz_feature) (PACKET_DisconnectedTracing_feature) (PACKET_augmented_libraries_svr4_read_feature): New enum values. (set_remote_protocol_packet_cmd): Delete function. (packet_config_support, packet_support): New functions. (set_remote_protocol_Z_packet_cmd): Don't call update_packet_config. (remote_query_attached, remote_pass_signals) (remote_program_signals, remote_threads_info) (remote_threads_extra_info, remote_start_remote): Use packet_support. (remote_start_remote): Use packet_config_support and packet_support. (init_all_packet_configs): Set all packets to unknown support, instead of calling update_packet_config. (remote_check_symbols): Use packet_support. (remote_supported_packet): Unconditionally set the packet config's support status. (remote_multi_process_feature, remote_non_stop_feature) (remote_cond_tracepoint_feature, remote_cond_breakpoint_feature) (remote_breakpoint_commands_feature) (remote_fast_tracepoint_feature, remote_static_tracepoint_feature) (remote_install_in_trace_feature) (remote_disconnected_tracing_feature) (remote_enable_disable_tracepoint_feature) (remote_string_tracing_feature) (remote_augmented_libraries_svr4_read_feature): Delete functions. (remote_protocol_features): Adjust to use remote_supported_packet for "augmented-libraries-svr4-read", "multiprocess", "QNonStop", "ConditionalTracepoints", "ConditionalBreakpoints", "BreakpointCommands", "FastTracepoints", "StaticTracepoints", "InstallInTrace", "DisconnectedTracing", "DisconnectedTracing", "EnableDisableTracepoints", and "tracenz". (remote_query_supported): Use packet_support. (remote_open_1): Adjust. (extended_remote_attach_1): Use packet_support. Switch on the result of packet_ok instead of checking whether the packet ended up disabled. (remote_vcont_resume): Use packet_support. (remote_resume, remote_stop_ns, fetch_register_using_p) (remote_prepare_to_store, store_register_using_P) (check_binary_download, remote_write_bytes): Use packet_support. (remote_vkill): Use packet_support. Switch on the result of packet_ok instead of checking whether the packet ended up disabled. (extended_remote_supports_disable_randomization): Use packet_support. (extended_remote_run): Switch on the result of packet_ok instead of checking whether the packet ended up disabled. (remote_insert_breakpoint, remote_remove_breakpoint) (remote_insert_watchpoint, remote_remove_watchpoint) (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Use packet_support. (remote_search_memory): Use packet_config_support. (remote_get_thread_local_address, remote_get_tib_address) (remote_hostio_send_command, remote_can_execute_reverse): Use packet_support. (remote_supports_cond_tracepoints) (remote_supports_cond_breakpoints) (remote_supports_fast_tracepoints) (remote_supports_static_tracepoints) (remote_supports_install_in_trace) (remote_supports_enable_disable_tracepoint) (remote_supports_string_tracing) (remote_can_run_breakpoint_commands): Rewrite, checking whether the packet config says the feature is enabled or disabled. (remote_download_tracepoint, remote_trace_set_readonly_regions) (remote_get_trace_status): Use packet_support. (remote_set_disconnected_tracing): Adjust to check whether the feature is enabled with packet_support. (remote_set_trace_buffer_size, remote_use_agent) (remote_can_use_agent, remote_supports_btrace): Use packet_support. (remote_enable_btrace, remote_disable_btrace, remote_read_btrace): Use packet_config_support. (remote_augmented_libraries_svr4_read): Rewrite, checking whether the packet config says the feature is enabled or disabled. (set_range_stepping): Use packet_support. gdb/testsuite/ 2014-04-25 Pedro Alves <palves@redhat.com> * gdb.base/cond-eval-mode.exp (warning): Move trailing \r\n to user. (top level): Test that "set remote conditional-breakpoints-packet off" works as intended. * gdb.base/dprintf.exp: Test that "set remote breakpoint-commands-packet off" works as intended. * gdb.trace/change-loc.exp (tracepoint_install_in_trace_disabled): New function. (top level): Call it. * gdb.trace/ftrace.exp (test_fast_tracepoints): Test that "set remote fast-tracepoints-packet off" works as intended. * gdb.trace/qtro.exp (gdb_is_target_remote): Moved ... * lib/gdb.exp (gdb_is_target_remote): ... here.
2014-04-25 19:07:02 +02:00
2014-04-25 Pedro Alves <palves@redhat.com>
* remote.c (struct remote_state): Remove multi_process_aware,
non_stop_aware, cond_tracepoints, cond_breakpoints,
breakpoint_commands, fast_tracepoints, static_tracepoints,
install_in_trace, disconnected_tracing,
enable_disable_tracepoints, string_tracing, and
augmented_libraries_svr4_read fields.
(remote_multi_process_p): Move further below in the file.
(struct packet_config): Add comments.
(update_packet_config): Delete function.
(show_packet_config_cmd): Use packet_config_support.
(add_packet_config_cmd): Use NULL as set callback.
(packet_ok): "set remote foo-packet"-style commands no longer
change config->supported -- adjust.
(PACKET_ConditionalTracepoints, PACKET_ConditionalBreakpoints)
(PACKET_BreakpointCommands, PACKET_FastTracepoints)
(PACKET_StaticTracepoints, PACKET_InstallInTrace): Add comments.
(PACKET_QNonStop, PACKET_multiprocess_feature)
(PACKET_EnableDisableTracepoints_feature, PACKET_tracenz_feature)
(PACKET_DisconnectedTracing_feature)
(PACKET_augmented_libraries_svr4_read_feature): New enum values.
(set_remote_protocol_packet_cmd): Delete function.
(packet_config_support, packet_support): New functions.
(set_remote_protocol_Z_packet_cmd): Don't call
update_packet_config.
(remote_query_attached, remote_pass_signals)
(remote_program_signals, remote_threads_info)
(remote_threads_extra_info, remote_start_remote): Use
packet_support.
(remote_start_remote): Use packet_config_support and
packet_support.
(init_all_packet_configs): Set all packets to unknown support,
instead of calling update_packet_config.
(remote_check_symbols): Use packet_support.
(remote_supported_packet): Unconditionally set the packet config's
support status.
(remote_multi_process_feature, remote_non_stop_feature)
(remote_cond_tracepoint_feature, remote_cond_breakpoint_feature)
(remote_breakpoint_commands_feature)
(remote_fast_tracepoint_feature, remote_static_tracepoint_feature)
(remote_install_in_trace_feature)
(remote_disconnected_tracing_feature)
(remote_enable_disable_tracepoint_feature)
(remote_string_tracing_feature)
(remote_augmented_libraries_svr4_read_feature): Delete functions.
(remote_protocol_features): Adjust to use remote_supported_packet
for "augmented-libraries-svr4-read", "multiprocess", "QNonStop",
"ConditionalTracepoints", "ConditionalBreakpoints",
"BreakpointCommands", "FastTracepoints", "StaticTracepoints",
"InstallInTrace", "DisconnectedTracing", "DisconnectedTracing",
"EnableDisableTracepoints", and "tracenz".
(remote_query_supported): Use packet_support.
(remote_open_1): Adjust.
(extended_remote_attach_1): Use packet_support. Switch on the
result of packet_ok instead of checking whether the packet ended
up disabled.
(remote_vcont_resume): Use packet_support.
(remote_resume, remote_stop_ns, fetch_register_using_p)
(remote_prepare_to_store, store_register_using_P)
(check_binary_download, remote_write_bytes): Use packet_support.
(remote_vkill): Use packet_support. Switch on the result of
packet_ok instead of checking whether the packet ended up
disabled.
(extended_remote_supports_disable_randomization): Use
packet_support.
(extended_remote_run): Switch on the result of packet_ok instead
of checking whether the packet ended up disabled.
(remote_insert_breakpoint, remote_remove_breakpoint)
(remote_insert_watchpoint, remote_remove_watchpoint)
(remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Use
packet_support.
(remote_search_memory): Use packet_config_support.
(remote_get_thread_local_address, remote_get_tib_address)
(remote_hostio_send_command, remote_can_execute_reverse): Use
packet_support.
(remote_supports_cond_tracepoints)
(remote_supports_cond_breakpoints)
(remote_supports_fast_tracepoints)
(remote_supports_static_tracepoints)
(remote_supports_install_in_trace)
(remote_supports_enable_disable_tracepoint)
(remote_supports_string_tracing)
(remote_can_run_breakpoint_commands): Rewrite, checking whether
the packet config says the feature is enabled or disabled.
(remote_download_tracepoint, remote_trace_set_readonly_regions)
(remote_get_trace_status): Use packet_support.
(remote_set_disconnected_tracing): Adjust to check whether the
feature is enabled with packet_support.
(remote_set_trace_buffer_size, remote_use_agent)
(remote_can_use_agent, remote_supports_btrace): Use
packet_support.
(remote_enable_btrace, remote_disable_btrace, remote_read_btrace):
Use packet_config_support.
(remote_augmented_libraries_svr4_read): Rewrite, checking whether
the packet config says the feature is enabled or disabled.
(set_range_stepping): Use packet_support.
2014-04-25 Tom Tromey <tromey@redhat.com>
* cli/cli-cmds.c (_initialize_cli_cmds): Document "quit" command's
argument.
2014-04-24 Sanimir Agovic <sanimir.agovic@intel.com>
* NEWS: Mention support for C99 variable length arrays.
2014-04-24 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (standard_exc): Expand introductory comment.
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>
* 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.
Stale breakpoint instructions, spurious SIGTRAPS. Without the code portion of the patch, we get these failures: FAIL: gdb.base/break-unload-file.exp: always-inserted on: break: continue FAIL: gdb.base/break-unload-file.exp: always-inserted on: hbreak: continue FAIL: gdb.base/sym-file.exp: stale bkpts: continue to breakpoint: end here They all looks like random SIGTRAPs: continue Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. 0x0000000000400541 in foo () at ../../../src/gdb/testsuite/gdb.base/break-unload-file.c:21 21 } (gdb) FAIL: gdb.base/break-unload-file.exp: always-inserted on: break: continue (This is a regression caused by the remove-symbol-file command series.) break-unload-file.exp is about having breakpoints inserted, and then doing "file". I caught this while writing a test that does "file PROGRAM", while PROGRAM was already loaded, which internally does "file" first, because I wanted to force a breakpoint_re_set, but the test is more explicit in case GDB ever optimizes out that re-set. The problem is that unloading the file with "file" ends up in disable_breakpoints_in_freed_objfile, which marks all breakpoint locations of the objfile as both shlib_disabled, _and_ clears the inserted flag, without actually removing the breakpoints from the inferior. Now, usually, in all-stop, breakpoints will already be removed from the inferior before the user can issue the "file" command, but, with non-stop, or breakpoints always-inserted on mode, breakpoints stay inserted even while the user has the prompt. In the latter case, then, if we let the program continue, and it executes the address where we had previously set the breakpoint, it'll actually execute the breakpoint instruction that we left behind... Now, one issue is that the intent of disable_breakpoints_in_freed_objfile is really to handle the unloading of OBJF_USERLOADED objfiles. These are objfiles that were added with add-symbol-file and that are removed with remove-symbol-file. "add-symbol-file"'s docs in the manual clearly say these commands are used to let GDB know about dynamically loaded code: You would use this command when @var{filename} has been dynamically loaded (by some other means) into the program that is running. Similarly, the online help says: (gdb) help add-symbol-file Load symbols from FILE, assuming FILE has been dynamically loaded. So it makes sense to, like when shared libraries are unloaded through the generic solib machinery, mark the breakpoint locations as shlib_disabled. But, the "file" command is not about dynamically loaded code, it's about the main program. So the patch makes disable_breakpoints_in_freed_objfile skip all objfiles but OBJF_USERLOADED ones, thus skipping the main objfile. Then, the reason that disable_breakpoints_in_freed_objfile was clearing the inserted flag isn't clear, but likely to avoid breakpoint removal errors, assuming remove-symbol-file was called after the dynamic object was already unmapped from the inferior. In that case, it'd okay to simply clear the inserted flag, but not so if the user for example does remove-symbol-file to remove the library because he made a mistake in the library's address, and wants to re-do add-symbol-file with the correct address. To address all that, I propose an alternative implementation, that handles both cases. The patch includes changes to sym-file.exp to cover them. This implementation leaves the inserted flag alone, and handles breakpoint insertion/removal failure gracefully when the locations are in OBJF_USERLOADED objfiles, just like we handle insertion/removal failure gracefully for locations in shared libraries. To try to make sure we aren't patching back stale shadow memory contents into the inferior, in case the program mapped a different library at the same address where we had the breakpoint, without the user having had a chance of remove-symbol-file'ing before, this adds a new memory_validate_breakpoint function that checks if the breakpoint instruction is still in memory. ppc_linux_memory_remove_breakpoint does this unconditionally for all memory breakpoints, and questions whether memory_remove_breakpoint should be changed to do this for all breakpoints. Possibly yes, though I'm not certain, hence this baby-steps patch. Tested on x86_64 Fedora 17, native and gdbserver. gdb/ 2014-04-23 Pedro Alves <palves@redhat.com> * breakpoint.c (insert_bp_location): Tolerate errors if the breakpoint is set in a user-loaded objfile. (remove_breakpoint_1): Likewise. Also tolerate errors if the location is marked shlib_disabled. If the breakpoint is set in a user-loaded objfile is a GDB-side memory breakpoint, validate it before uninsertion. (disable_breakpoints_in_freed_objfile): Skip non-OBJF_USERLOADED objfiles. Don't clear the location's inserted flag. * mem-break.c (memory_validate_breakpoint): New function. * objfiles.c (userloaded_objfile_contains_address_p): New function. * objfiles.h (userloaded_objfile_contains_address_p): Declare. * target.h (memory_validate_breakpoint): New declaration. gdb/testsuite/ 2014-04-23 Pedro Alves <palves@redhat.com> * gdb.base/break-unload-file.c: New file. * gdb.base/break-unload-file.exp: New file. * gdb.base/sym-file-lib.c (baz): New function. * gdb.base/sym-file-loader.c (struct segment) <mapped_size>: New field. (load): Store the segment's mapped size. (unload): New function. (unload_shlib): New function. * gdb.base/sym-file-loader.h (unload_shlib): New declaration. * gdb.base/sym-file-main.c (main): Unload, and reload the library, set a breakpoint at baz, and call it. * gdb.base/sym-file.exp: New tests for stale breakpoint instructions.
2014-04-23 00:19:19 +02:00
2014-04-23 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location): Tolerate errors if the
breakpoint is set in a user-loaded objfile.
(remove_breakpoint_1): Likewise. Also tolerate errors if the
location is marked shlib_disabled. If the breakpoint is set in a
user-loaded objfile is a GDB-side memory breakpoint, validate it
before uninsertion. (disable_breakpoints_in_freed_objfile): Skip
non-OBJF_USERLOADED objfiles. Don't clear the location's inserted
flag.
* mem-break.c (memory_validate_breakpoint): New function.
* objfiles.c (userloaded_objfile_contains_address_p): New
function.
* objfiles.h (userloaded_objfile_contains_address_p): Declare.
* target.h (memory_validate_breakpoint): New declaration.
Don't suppress errors inserting/removing hardware breakpoints in shared libraries. As explained in https://sourceware.org/ml/gdb-patches/2008-08/msg00361.html, after a shared library was unloaded, we can no longer insert or remove breakpoints into/from its (no longer present) code segment. That'll fail with memory errors. However, that concern does not apply to hardware breakpoints. By definition, hardware breakpoints are implemented using a mechanism that is not dependent on being able to modify the target's memory. Usually, by setting up CPU debug registers. IOW, we should be able to set hw breakpoints in an unmapped address. We don't seem to have a test that exercises that, so this patch adds one. I noticed the error supression because of a related issue -- the target_insert_hw_breakpoint/target_remove_hw_breakpoint interfaces don't really distinguish "not supported" from "error" return, and so remote.c returns -1 in both cases. This results in hardware breakpoints set in shared libraries silently ending up pending forever even though the target doesn't actually support hw breakpoints. (gdb) set breakpoint always-inserted on (gdb) set remote Z-packet off (gdb) info breakpoints No breakpoints or watchpoints. (gdb) hbreak shrfunc Hardware assisted breakpoint 3 at 0x7ffff7dfb657: file ../../../src/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported-shr.c, line 21. (gdb) info break Num Type Disp Enb Address What 3 hw breakpoint keep y <PENDING> shrfunc After the patch we get the expected: (gdb) hbreak shrfunc Hardware assisted breakpoint 3 at 0x7ffff7dfb657: file ../../../src/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported-shr.c, line 21. Warning: Cannot insert hardware breakpoint 3. Could not insert hardware breakpoints: You may have requested too many hardware breakpoints/watchpoints. (gdb) info break Num Type Disp Enb Address What 3 hw breakpoint keep y 0x00007ffff7dfb657 in shrfunc at ../../../src/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported-shr.c:21 (HW breakpoints set in the main executable, when the target doesn't support HW breakpoints always resulted in the latter output.) We probably should improve the insert/remove interface to return a different error code for unsupported. But I chose to fix the error supression first, as it's a deeper and wider issue. Tested on x86_64 Fedora 17, native and gdbserver. gdb/ 2014-04-23 Pedro Alves <palves@redhat.com> * breakpoint.c (insert_bp_location, remove_breakpoint_1): If the breakpoint is set in a shared library, only suppress errors for software breakpoints, not hardware breakpoints. gdb/testsuite/ 2014-04-23 Pedro Alves <palves@redhat.com> * gdb.base/hbreak-in-shr-unsupported-shr.c: New file. * gdb.base/hbreak-in-shr-unsupported.c: New file. * gdb.base/hbreak-in-shr-unsupported.exp: New file. * gdb.base/hbreak-unmapped.c: New file. * gdb.base/hbreak-unmapped.exp: New file. * gdb.trace/qtro.exp (gdb_is_target_remote): Move ... * lib/gdb.exp (gdb_is_target_remote): ... here.
2014-04-23 16:06:47 +02:00
2014-04-23 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location, remove_breakpoint_1): If
the breakpoint is set in a shared library, only suppress
errors for software breakpoints, not hardware breakpoints.
Consecutive step-overs trigger internal error. If a thread trips on a breakpoint that needs stepping over just after finishing a step over, GDB currently fails an assertion. This is a regression caused by the "Handle multiple step-overs." patch (99619beac6252113fed212fdb9e1ab97bface423) at https://sourceware.org/ml/gdb-patches/2014-02/msg00765.html. (gdb) x /4i $pc => 0x400540 <main+4>: movl $0x0,0x2003da(%rip) # 0x600924 <i> 0x40054a <main+14>: movl $0x1,0x2003d0(%rip) # 0x600924 <i> 0x400554 <main+24>: movl $0x2,0x2003c6(%rip) # 0x600924 <i> 0x40055e <main+34>: movl $0x3,0x2003bc(%rip) # 0x600924 <i> (gdb) PASS: gdb.base/consecutive-step-over.exp: get breakpoint addresses break *0x40054a Breakpoint 2 at 0x40054a: file ../../../src/gdb/testsuite/gdb.base/consecutive-step-over.c, line 23. (gdb) PASS: gdb.base/consecutive-step-over.exp: insn 1: set breakpoint condition $bpnum condition (gdb) PASS: gdb.base/consecutive-step-over.exp: insn 1: set condition break *0x400554 Breakpoint 3 at 0x400554: file ../../../src/gdb/testsuite/gdb.base/consecutive-step-over.c, line 24. (gdb) PASS: gdb.base/consecutive-step-over.exp: insn 2: set breakpoint condition $bpnum condition (gdb) PASS: gdb.base/consecutive-step-over.exp: insn 2: set condition break *0x40055e Breakpoint 4 at 0x40055e: file ../../../src/gdb/testsuite/gdb.base/consecutive-step-over.c, line 25. (gdb) PASS: gdb.base/consecutive-step-over.exp: insn 3: set breakpoint condition $bpnum condition (gdb) PASS: gdb.base/consecutive-step-over.exp: insn 3: set condition break 27 Breakpoint 5 at 0x400568: file ../../../src/gdb/testsuite/gdb.base/consecutive-step-over.c, line 27. (gdb) continue Continuing. ../../src/gdb/infrun.c:5200: internal-error: switch_back_to_stepped_thread: Assertion `!tp->control.trap_expected' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. FAIL: gdb.base/consecutive-step-over.exp: continue to breakpoint: break here (GDB internal error) The assertion fails, because the code is not expecting that the event thread itself might need another step over. IOW, not expecting that TP in: tp = find_thread_needs_step_over (stepping_thread != NULL, stepping_thread); could be the event thread. A small fix for this would be to clear the event thread's trap_expected earlier, before asserting. But looking deeper, although currently_stepping_or_nexting_callback's intention is finding the thread that is doing a step/next, it also returns the thread that is doing a step-over dance, with trap_expected set. If there ever was a reason for that (it was I who added currently_stepping_or_nexting_callback , but I can't recall why I put trap_expected there in the first place), the only remaining reason nowadays is to aid in implementing switch_back_to_stepped_thread's assertion that is now triggering, by piggybacking on the walk over all threads, thus avoiding a separate walk. This is quite obscure, and I think we can do even better, by merging the walks that look for the stepping thread, and the walk that looks for some thread that might need a step over. Tested on x86_64 Fedora 17, native and gdbserver, and also native on top of my "software single-step on x86_64" series. gdb/ 2014-04-22 Pedro Alves <palves@redhat.com> * infrun.c (schedlock_applies): New function, factored out from find_thread_needs_step_over. (find_thread_needs_step_over): Use it. (switch_back_to_stepped_thread): Always clear trap_expected if the step over is finished. Return early if scheduler locking applies. Look for the stepping thread and a potential step-over thread with a single loop. (currently_stepping_or_nexting_callback): Delete. 2014-04-22 Pedro Alves <palves@redhat.com> * gdb.base/consecutive-step-over.c: New file. * gdb.base/consecutive-step-over.exp: New file.
2014-04-22 16:00:56 +02:00
2014-04-22 Pedro Alves <palves@redhat.com>
* infrun.c (schedlock_applies): New function, factored out from
find_thread_needs_step_over.
(find_thread_needs_step_over): Use it.
(switch_back_to_stepped_thread): Always clear trap_expected if the
step over is finished. Return early if scheduler locking applies.
Look for the stepping thread and a potential step-over thread with
a single loop.
(currently_stepping_or_nexting_callback): Delete.
2014-04-22 Nick Clifton <nickc@redhat.com>
* NEWS: Mention that ARM sim now supports tracing.
2014-04-22 Yao Qi <yao@codesourcery.com>
* tracefile-tfile.c (tfile_fetch_registers): Move the bottom
to ...
* tracefile.c (tracefile_fetch_registers): ... it. New
function.
* tracefile.h (tracefile_fetch_registers): Declare.
* ctf.c (ctf_fetch_registers): Remove the bottom. Call
tracefile_fetch_registers.
2014-04-19 Eli Zaretskii <eliz@gnu.org>
PR gdb/14018
* windows-nat.c (thread_rec): Don't display a warning when
SuspendThread fails with ERROR_ACCESS_DENIED. If SuspendThread
fails for any reason, set th->suspended to -1, so that we don't
try to resume such a thread. Also, don't return NULL in these
cases, to avoid completely ruin the session due to "PC register is
not available" error.
(do_windows_fetch_inferior_registers): Check errors in
GetThreadContext call.
(windows_continue): Accept an additional argument KILLED; if not
zero, ignore errors in the SetThreadContext call, since the
inferior was killed and is shutting down.
(windows_resume, get_windows_debug_event)
(windows_create_inferior, windows_mourn_inferior)
(windows_kill_inferior): All callers of windows_continue changed
to adjust to its new calling sequence.
2014-04-19 Yao Qi <yao@codesourcery.com>
* ctf.c (ctf_open): Call post_create_inferior.
2014-04-19 Yao Qi <yao@codesourcery.com>
* ctf.c (handle_id): New static variable.
(ctf_open_dir): Get handle_id from bt_context_add_trace return
value. Get the declaration of event "register" and get length
of field "contents".
2014-04-19 Yao Qi <yao@codesourcery.com>
* ctf.c (ctf_xfer_partial): Check 'name' is NULL before strcmp.
2014-04-18 Siva Chandra Reddy <sivachandra@google.com>
* valops.c (oload_method_static): Remove unnecessary argument
METHOD. Update all callers.
Fix PR backtrace/15558 This PR is about an assertion failure in GDB that can be triggered by setting "backtrace limit" to a value that causes GDB to stop unwinding after an inline frame. In this case, an assertion in inline_frame_this_id will trigger: /* We need a valid frame ID, so we need to be based on a valid frame. (...). */ gdb_assert (frame_id_p (*this_id)); Looking at the function: static void inline_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id) { struct symbol *func; /* In order to have a stable frame ID for a given inline function, we must get the stack / special addresses from the underlying real frame's this_id method. So we must call get_prev_frame. Because we are inlined into some function, there must be previous frames, so this is safe - as long as we're careful not to create any cycles. */ *this_id = get_frame_id (get_prev_frame (this_frame)); we see we're computing the frame id for the inline frame. If this is an inline frame, which is a virtual frame constructed based on debug info, on top of a real stack frame, we should _always_ be able to find where the frame was inlined into, as that ultimately just means peeling off the virtual frames on top of the real stack frame. If there ultimately was no prev (real) stack frame, then we wouldn't have been able to construct the inline frame either, by design. That's what the assertion catches. So we have an inline frame, we should _always_ be able to compute its ID, even if that means bypassing the user backtrace limits to get at the real stack frame's info. The problem is that inline_frame_id calls get_prev_frame, and that takes user backtrace limits into account. Code that wants to bypass the limits calls get_prev_frame_1 instead. Note how get_prev_frame_1 already skips all checks for inline frames: /* If we are unwinding from an inline frame, all of the below tests were already performed when we unwound from the next non-inline frame. We must skip them, since we can not get THIS_FRAME's ID until we have unwound all the way down to the previous non-inline frame. */ if (get_frame_type (this_frame) == INLINE_FRAME) return get_prev_frame_if_no_cycle (this_frame); And note how the related frame_unwind_caller_id function also uses get_prev_frame_1: struct frame_id frame_unwind_caller_id (struct frame_info *next_frame) { struct frame_info *this_frame; /* Use get_prev_frame_1, and not get_prev_frame. The latter will truncate the frame chain, leading to this function unintentionally returning a null_frame_id (e.g., when a caller requests the frame ID of "main()"s caller. */ next_frame = skip_artificial_frames (next_frame); this_frame = get_prev_frame_1 (next_frame); if (this_frame) return get_frame_id (skip_artificial_frames (this_frame)); else return null_frame_id; } get_prev_frame_1 is currently static in frame.c. As a _1 suffix is not a good name for an extern function, I've renamed it. Tested on x86-64 Fedora 17. gdb/ 2014-04-18 Pedro alves <palves@redhat.com> Tom Tromey <tromey@redhat.com> PR backtrace/15558 * frame.c (get_prev_frame_1): Rename to ... (get_prev_frame_always): ... this, and make extern. Adjust. (skip_artificial_frames): Use get_prev_frame_always. (frame_unwind_caller_id, frame_pop, get_prev_frame) (get_frame_unwind_stop_reason): Adjust to rename. * frame.h (get_prev_frame_always): Declare. * inline-frame.c: Include frame.h. (inline_frame_this_id): Use get_prev_frame_always. gdb/testsuite/ 2014-04-18 Tom Tromey <palves@redhat.com> Pedro alves <tromey@redhat.com> PR backtrace/15558 * gdb.opt/inline-bt.exp: Test backtracing from an inline function with a backtrace limit. * gdb.python/py-frame-inline.exp: Test running to an inline function with a backtrace limit, and printing the newest frame. * gdb.python/py-frame-inline.c (main): Call f.
2014-04-18 11:15:21 +02:00
2014-04-18 Pedro alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
PR backtrace/15558
* frame.c (get_prev_frame_1): Rename to ...
(get_prev_frame_always): ... this, and make extern. Adjust.
(skip_artificial_frames): Use get_prev_frame_always.
(frame_unwind_caller_id, frame_pop, get_prev_frame)
(get_frame_unwind_stop_reason): Adjust to rename.
* frame.h (get_prev_frame_always): Declare.
* inline-frame.c: Include frame.h.
(inline_frame_this_id): Use get_prev_frame_always.
2014-04-18 Tristan Gingold <gingold@adacore.com>
* solib-darwin.c (darwin_solib_create_inferior_hook): Simplify
code by using bfd_mach_o_get_base_address.
2014-04-17 Ulrich Weigand  <uweigand@de.ibm.com>
* spu-tdep.c: Include "dwarf2-frame.h" and "ax.h".
(spu_ax_pseudo_register_collect): New function.
(spu_ax_pseudo_register_push_stack): Likewise.
(spu_dwarf_reg_to_regnum): Likewise.
(spu_gdbarch_init): Install them. Append DWARF unwinders.
Use address_from_register in dwarf2-frame.c:read_addr_from_reg This patch fixes a problem that prevented use of the Dwarf unwinders on SPU, because dwarf2-frame.c common code did not support the situation where the stack and/or frame pointer is maintained in a *vector* register. This is because read_addr_from_reg is hard-coded to assume that such pointers can be read from registers via a simple get_frame_register / unpack_pointer operation. Now, there *is* a routine address_from_register that calls into the appropriate tdep routines to handle pointer values in "weird" registers like on SPU, but it turns out I cannot simply change dwarf2-frame.c to use address_from_register. This is because address_from_register uses value_from_register to create a (temporary) value, and that routine at some point calls get_frame_id in order to set up that value's VALUE_FRAME_ID entry. However, the dwarf2-frame.c read_addr_from_reg routine will be called during early unwinding (to unwind the frame's CFA), at which point the frame's ID is not actually known yet! This would cause an assert. On the other hand, we may notice that VALUE_FRAME_ID is only needed in the value returned by value_from_register if that value is later used as an lvalue. But this is obviously never done to the temporary value used in address_from_register. So, if we could change address_from_register to not call value_from_register but instead accept constructing a value that doesn't have VALUE_FRAME_ID set, things should be fine. To do that, we can change the value_from_register callback to accept a FRAME_ID instead of a FRAME; the only existing uses of the FRAME argument were either to extract its frame ID, or its gdbarch. (To keep a way of getting at the latter, we also change the callback's type from "f" to "m".) Together with the required follow-on changes in the existing value_from_register implementations (including the default one), this seems to fix the problem. As another minor interface cleanup, I've removed the explicit TYPE argument from address_from_register. This routine really always uses a default pointer type, and in the new implementation it -to some extent- relies on that fact, in that it will now no longer handle types that require gdbarch_convert_register_p handling. gdb: 2014-04-17 Ulrich Weigand  <uweigand@de.ibm.com> * gdbarch.sh (value_from_register): Make class "m" instead of "f". Replace FRAME argument with FRAME_ID. * gdbarch.c, gdbarch.h: Regenerate. * findvar.c (default_value_from_register): Add GDBARCH argument; replace FRAME by FRAME_ID. No longer call get_frame_id. (value_from_register): Update call to gdbarch_value_from_register. * value.h (default_value_from_register): Update prototype. * s390-linux-tdep.c (s390_value_from_register): Update interface and call to default_value_from_register. * spu-tdep.c (spu_value_from_register): Likewise. * findvar.c (address_from_register): Remove TYPE argument. Do not call value_from_register; use gdbarch_value_from_register with null_frame_id instead. * value.h (address_from_register): Update prototype. * dwarf2-frame.c (read_addr_from_reg): Use address_from_register. * dwarf2loc.c (dwarf_expr_read_addr_from_reg): Update for address_from_register interface change.
2014-04-17 14:01:39 +02:00
2014-04-17 Ulrich Weigand  <uweigand@de.ibm.com>
* gdbarch.sh (value_from_register): Make class "m" instead of "f".
Replace FRAME argument with FRAME_ID.
* gdbarch.c, gdbarch.h: Regenerate.
* findvar.c (default_value_from_register): Add GDBARCH argument;
replace FRAME by FRAME_ID. No longer call get_frame_id.
(value_from_register): Update call to gdbarch_value_from_register.
* value.h (default_value_from_register): Update prototype.
* s390-linux-tdep.c (s390_value_from_register): Update interface
and call to default_value_from_register.
* spu-tdep.c (spu_value_from_register): Likewise.
* findvar.c (address_from_register): Remove TYPE argument.
Do not call value_from_register; use gdbarch_value_from_register
with null_frame_id instead.
* value.h (address_from_register): Update prototype.
* dwarf2-frame.c (read_addr_from_reg): Use address_from_register.
* dwarf2loc.c (dwarf_expr_read_addr_from_reg): Update for
address_from_register interface change.
2014-04-17 Yao Qi <yao@codesourcery.com>
* gdbtypes.h: Update comments to link to types and macros'
definitions.
2014-04-16 Siva Chandra Reddy <sivachandra@google.com>
* gdbtypes.h: Remove definition of the macro TYPE_FN_FIELDS.
2014-04-16 Keith Seitz <keiths@redhat.com>
PR gdb/15827
* dwarf2read.c (skip_one_die): Check that all relative-offset
sibling DIEs fall within range of the current reader's buffer.
(read_partial_die): Likewise.
2014-04-16 Keith Seitz <keiths@redhat.com>
PR c++/16597
* cp-namespace.c (lookup_symbol_file): If the type name of
`this' is NULL, return immediately.
Remove symbol_matches_domain. This fixes PR c++/16253. symbol_matches_domain was permitting searches for a VAR_DOMAIN symbol to also match STRUCT_DOMAIN symbols for languages like C++ where STRUCT_DOMAIN symbols also define a typedef of the same name, e.g., "struct foo {}" introduces a typedef of the name "foo". Problems occur if there exists both a VAR_DOMAIN and STRUCT_DOMAIN symbol of the same name. Then it is essentially a race between which symbol is found first. The other symbol is obscurred. [This is a relatively common idiom: enum e { ... } e;] This patchset moves this "language defines a typedef" logic to lookup_symbol[_in_language], looking first for a symbol in the given domain and falling back to searching STRUCT_DOMAIN when/if appropriate. 2014-04-14 Keith Seitz <keiths@redhat.com> PR c++/16253 * ada-lang.c (ada_symbol_matches_domain): Moved here and renamed from symbol_matches_domain in symtab.c. All local callers of symbol_matches_domain updated. (standard_lookup): If DOMAIN is VAR_DOMAIN and no symbol is found, search STRUCT_DOMAIN. (ada_find_any_type_symbol): Do not search STRUCT_DOMAIN independently. standard_lookup will do that automatically. * cp-namespace.c (cp_lookup_symbol_nonlocal): Explain when/why VAR_DOMAIN searches may return a STRUCT_DOMAIN match. (cp_lookup_symbol_in_namespace): Likewise. If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN. (cp_lookup_symbol_exports): Explain when/why VAR_DOMAIN searches may return a STRUCT_DOMAIN match. (lookup_symbol_file): Search for the class name in STRUCT_DOMAIN. * cp-support.c: Include language.h. (inspect_type): Explicitly search STRUCT_DOMAIN before searching VAR_DOMAIN. * psymtab.c (match_partial_symbol): Compare the requested domain with the symbol's domain directly. (lookup_partial_symbol): Likewise. * symtab.c (lookup_symbol_in_language): Explain when/why VAR_DOMAIN searches may return a STRUCT_DOMAIN match. If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN for appropriate languages. (symbol_matches_domain): Renamed `ada_symbol_matches_domain' and moved to ada-lang.c (lookup_block_symbol): Explain that this function only returns symbol matching the requested DOMAIN. Compare the requested domain with the symbol's domain directly. (iterate_over_symbols): Compare the requested domain with the symbol's domain directly. * symtab.h (symbol_matches_domain): Remove. 2014-04-14 Keith Seitz <keiths@redhat.com> PR c++/16253 * gdb.cp/var-tag.cc: New file. * gdb.cp/var-tag.exp: New file. * gdb.dwarf2/dw2-ada-ffffffff.exp: Set the language to C++. * gdb.dwarf2/dw2-anon-mptr.exp: Likewise. * gdb.dwarf2/dw2-double-set-die-type.exp: Likewise. * gdb.dwarf2/dw2-inheritance.exp: Likewise.
2014-04-15 00:47:15 +02:00
2014-04-14 Keith Seitz <keiths@redhat.com>
PR c++/16253
* ada-lang.c (ada_symbol_matches_domain): Moved here and renamed
from symbol_matches_domain in symtab.c. All local callers
of symbol_matches_domain updated.
(standard_lookup): If DOMAIN is VAR_DOMAIN and no symbol is found,
search STRUCT_DOMAIN.
(ada_find_any_type_symbol): Do not search STRUCT_DOMAIN
independently. standard_lookup will do that automatically.
* cp-namespace.c (cp_lookup_symbol_nonlocal): Explain when/why
VAR_DOMAIN searches may return a STRUCT_DOMAIN match.
(cp_lookup_symbol_in_namespace): Likewise.
If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN.
(cp_lookup_symbol_exports): Explain when/why VAR_DOMAIN searches
may return a STRUCT_DOMAIN match.
(lookup_symbol_file): Search for the class name in STRUCT_DOMAIN.
* cp-support.c: Include language.h.
(inspect_type): Explicitly search STRUCT_DOMAIN before searching
VAR_DOMAIN.
* psymtab.c (match_partial_symbol): Compare the requested
domain with the symbol's domain directly.
(lookup_partial_symbol): Likewise.
* symtab.c (lookup_symbol_in_language): Explain when/why
VAR_DOMAIN searches may return a STRUCT_DOMAIN match.
If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN for
appropriate languages.
(symbol_matches_domain): Renamed `ada_symbol_matches_domain'
and moved to ada-lang.c
(lookup_block_symbol): Explain that this function only returns
symbol matching the requested DOMAIN.
Compare the requested domain with the symbol's domain directly.
(iterate_over_symbols): Compare the requested domain with the
symbol's domain directly.
* symtab.h (symbol_matches_domain): Remove.
2014-04-14 Tom Tromey <tromey@redhat.com>
PR c++/15246:
* c-exp.y (type_aggregate_p): New function.
(qualified_name, classify_inner_name): Use it.
* c-typeprint.c (c_type_print_base): Handle TYPE_DECLARED_CLASS
and TYPE_TARGET_TYPE of an enum type.
* dwarf2read.c (read_enumeration_type): Set TYPE_DECLARED_CLASS on
an enum type.
(determine_prefix) <case DW_TAG_enumeration_type>: New case;
handle TYPE_DECLARED_CLASS.
* gdbtypes.c (rank_one_type): Handle TYPE_DECLARED_CLASS on enum
types.
* gdbtypes.h (TYPE_DECLARED_CLASS): Update comment.
* valops.c (enum_constant_from_type): New function.
(value_aggregate_elt): Use it.
* cp-namespace.c (cp_lookup_nested_symbol): Handle
TYPE_CODE_ENUM.
2014-04-14 Tom Tromey <tromey@redhat.com>
* valops.c (value_aggregate_elt, value_struct_elt_for_reference)
(value_namespace_elt, value_maybe_namespace_elt): Make "name"
const.
* value.h (value_aggregate_elt): Update.
2014-04-14 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (read_enumeration_type): Handle DW_AT_type.
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
* eval.c (evaluate_subexp_for_sizeof): Add enum noside argument.
(evaluate_subexp_standard): Pass noside argument.
(evaluate_subexp_for_sizeof) <BINOP_SUBSCRIPT>: Handle subscript case
if noside equals EVAL_NORMAL. If the subscript yields a vla type
re-evaluate subscript operation with EVAL_NORMAL to enable sideffects.
* gdbtypes.c (resolve_dynamic_bounds): Mark bound as evaluated.
* gdbtypes.h (enum range_flags): Add RANGE_EVALUATED case.
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
* findvar.c (default_read_var_value): Resolve dynamic bounds if location
points to a constant blob.
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
* dwarf2read.c (read_subrange_type): Convert DW_AT_count to a dynamic
property and store it as the high bound and flag the range accordingly.
* gdbtypes.c (resolve_dynamic_bounds): If range is flagged as
RANGE_UPPER_BOUND_IS_COUNT assign low + high - 1 as the new high bound.
* gdbtypes.h (enum range_flags): New enum.
(struct range_bounds): Add flags member.
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
* c-typeprint.c (c_type_print_varspec_suffix): Added
check for not yet resolved high bound. If unresolved, print
"variable length" string to the console instead of random
length.
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
* ada-lang.c (ada_value_primitive_packed_val): Re-fetch type from
value.
(ada_template_to_fixed_record_type_1): Likewise.
(ada_to_fixed_type_1): Likewise.
* cp-valprint.c (cp_print_value_fields_rtti): Likewise.
(cp_print_value): Likewise.
* d-valprint.c (dynamic_array_type): Likewise.
* findvar.c (address_of_variable): Likewise.
* jv-valprint.c (java_value_print): Likewise.
* valops.c (value_ind): Likewise.
* value.c (coerce_ref): Likewise.
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
* eval.c (evaluate_subexp_for_sizeof) <UNOP_IND>: Create an indirect
value and retrieve the dynamic type size.
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
* eval.c (evaluate_subexp_for_sizeof) <OP_VAR_VALUE>: If the type
passed to sizeof is dynamic evaluate the argument to compute the length.
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
Joel Brobecker <brobecker@adacore.com>
* dwarf2loc.c (dwarf2_locexpr_baton_eval): New function.
(dwarf2_evaluate_property): New function.
* dwarf2loc.h (dwarf2_evaluate_property): New function prototype.
* dwarf2read.c (attr_to_dynamic_prop): New function.
(read_subrange_type): Use attr_to_dynamic_prop to read high bound
attribute.
* gdbtypes.c: Include dwarf2loc.h.
(is_dynamic_type): New function.
(resolve_dynamic_type): New function.
(resolve_dynamic_bounds): New function.
(get_type_length): New function.
(check_typedef): Use get_type_length to compute type length.
* gdbtypes.h (TYPE_HIGH_BOUND_KIND): New macro.
(TYPE_LOW_BOUND_KIND): New macro.
(is_dynamic_type): New function prototype.
* value.c (value_from_contents_and_address): Call resolve_dynamic_type
to resolve dynamic properties of the type. Update comment.
* valops.c (get_value_at, value_at, value_at_lazy): Update comment.
2014-04-14 Richard Henderson <rth@redhat.com>
* alpha-linux-nat.c (_initialize_alpha_linux_nat): Fix prototype.
2014-04-12 Siva Chandra Reddy <sivachandra@google.com>
Doug Evans <xdje42@gmail.com>
* guile/scm-value.c (gdbscm_value_dynamic_type): Use coerce_ref to
dereference TYPE_CODE_REF values.
Revert the entire VLA series. This reverts the following patch series, as they cause some regresssions. commit 37c1ab67a35025d37d42c449deab5f254f9f59da type: add c99 variable length array support gdb/ * dwarf2loc.c (dwarf2_locexpr_baton_eval): New function. (dwarf2_evaluate_property): New function. * dwarf2loc.h (dwarf2_evaluate_property): New function prototype. * dwarf2read.c (attr_to_dynamic_prop): New function. (read_subrange_type): Use attr_to_dynamic_prop to read high bound attribute. * gdbtypes.c: Include dwarf2loc.h. (is_dynamic_type): New function. (resolve_dynamic_type): New function. (resolve_dynamic_bounds): New function. (get_type_length): New function. (check_typedef): Use get_type_length to compute type length. * gdbtypes.h (TYPE_HIGH_BOUND_KIND): New macro. (TYPE_LOW_BOUND_KIND): New macro. (is_dynamic_type): New function prototype. * value.c (value_from_contents_and_address): Call resolve_dynamic_type to resolve dynamic properties of the type. Update comment. * valops.c (get_value_at, value_at, value_at_lazy): Update comment. commit 26cb189f8b46dbe7b2d485525329a8919005ca8a vla: enable sizeof operator to work with variable length arrays gdb/ * eval.c (evaluate_subexp_for_sizeof) <OP_VAR_VALUE>: If the type passed to sizeof is dynamic evaluate the argument to compute the length. commit 04b19544ef6a97b62b2cc4a3170b900e046ab185 vla: enable sizeof operator for indirection gdb/ * eval.c (evaluate_subexp_for_sizeof) <UNOP_IND>: Create an indirect value and retrieve the dynamic type size. commit bcd629a44fff61527430f353cf77e20fe3afc395 vla: update type from newly created value gdb/ * ada-lang.c (ada_value_primitive_packed_val): Re-fetch type from value. (ada_template_to_fixed_record_type_1): Likewise. (ada_to_fixed_type_1): Likewise. * cp-valprint.c (cp_print_value_fields_rtti): Likewise. (cp_print_value): Likewise. * d-valprint.c (dynamic_array_type): Likewise. * eval.c (evaluate_subexp_with_coercion): Likewise. * findvar.c (address_of_variable): Likewise. * jv-valprint.c (java_value_print): Likewise. * valops.c (value_ind): Likewise. * value.c (coerce_ref): Likewise. commit b86138fb0484f42db6cb83abed1e3d0ad2ec4eac vla: print "variable length" for unresolved dynamic bounds gdb/ * c-typeprint.c (c_type_print_varspec_suffix): Added check for not yet resolved high bound. If unresolved, print "variable length" string to the console instead of random length. commit e1969afbd454c09c3aad1990305715f70bc47c3c vla: support for DW_AT_count gdb/ * dwarf2read.c (read_subrange_type): Convert DW_AT_count to a dynamic property and store it as the high bound and flag the range accordingly. * gdbtypes.c (resolve_dynamic_bounds): If range is flagged as RANGE_UPPER_BOUND_IS_COUNT assign low + high - 1 as the new high bound. * gdbtypes.h (enum range_flags): New enum. (struct range_bounds): Add flags member. commit 92b09522dc5a93ba4bda3c1c0b3c58264e357c8a vla: resolve dynamic bounds if value contents is a constant byte-sequence gdb/ * findvar.c (default_read_var_value): Resolve dynamic bounds if location points to a constant blob. commit 3bce82377f683870cc89925ff43aefb7dcce4a77 vla: evaluate operand of sizeof if its type is a vla gdb/ * eval.c (evaluate_subexp_for_sizeof): Add enum noside argument. (evaluate_subexp_standard): Pass noside argument. (evaluate_subexp_for_sizeof) <BINOP_SUBSCRIPT>: Handle subscript case if noside equals EVAL_NORMAL. If the subscript yields a vla type re-evaluate subscript operation with EVAL_NORMAL to enable sideffects. * gdbtypes.c (resolve_dynamic_bounds): Mark bound as evaluated. * gdbtypes.h (enum range_flags): Add RANGE_EVALUATED case. gdb/testsuite * gdb.base/vla-sideeffect.c: New file. * gdb.base/vla-sideeffect.exp: New file. commit 504f34326e5ae7c78ebfcdd6ed03c7403b42048b test: cover subranges with present DW_AT_count attribute gdb/testsuite/ * gdb.dwarf2/count.exp: New file. commit 1a237e0ee53bbdee97d72d794b5b42e774cc81c0 test: multi-dimensional c99 vla. gdb/testsuite/ * gdb.base/vla-multi.c: New file. * gdb.base/vla-multi.exp: New file. commit 024e13b46f9c33d151ae82fd9d64c53092fd9313 test: evaluate pointers to C99 vla correctly. gdb/testsuite/ * gdb.base/vla-ptr.c: New file. * gdb.base/vla-ptr.exp: New file. commit c8655f75e2f0fada311be193e3090087a77ec802 test: basic c99 vla tests for C primitives gdb/testsuite/ * gdb.base/vla-datatypes.c: New file. * gdb.base/vla-datatypes.exp: New file. commit 58a84dcf29b735ee776536b4c51ba90b51612b71 test: add mi vla test gdb/testsuite/ * gdb.mi/mi-vla-c99.exp: New file. * gdb.mi/vla.c: New file.
2014-04-11 23:47:15 +02:00
2014-04-11 Joel Brobecker <brobecker@adacore.com>
Revert the following changes due to regressions:
* dwarf2loc.c (dwarf2_locexpr_baton_eval): New function.
(dwarf2_evaluate_property): New function.
* dwarf2loc.h (dwarf2_evaluate_property): New function prototype.
* dwarf2read.c (attr_to_dynamic_prop): New function.
(read_subrange_type): Use attr_to_dynamic_prop to read high bound
attribute.
* gdbtypes.c: Include dwarf2loc.h.
(is_dynamic_type): New function.
(resolve_dynamic_type): New function.
(resolve_dynamic_bounds): New function.
(get_type_length): New function.
(check_typedef): Use get_type_length to compute type length.
* gdbtypes.h (TYPE_HIGH_BOUND_KIND): New macro.
(TYPE_LOW_BOUND_KIND): New macro.
(is_dynamic_type): New function prototype.
* value.c (value_from_contents_and_address): Call resolve_dynamic_type
to resolve dynamic properties of the type. Update comment.
* valops.c (get_value_at, value_at, value_at_lazy): Update comment.
* eval.c (evaluate_subexp_for_sizeof) <OP_VAR_VALUE>: If the type
passed to sizeof is dynamic evaluate the argument to compute the length.
* eval.c (evaluate_subexp_for_sizeof) <UNOP_IND>: Create an indirect
value and retrieve the dynamic type size.
* ada-lang.c (ada_value_primitive_packed_val): Re-fetch type from value.
(ada_template_to_fixed_record_type_1): Likewise.
(ada_to_fixed_type_1): Likewise.
* cp-valprint.c (cp_print_value_fields_rtti): Likewise.
(cp_print_value): Likewise.
* d-valprint.c (dynamic_array_type): Likewise.
* eval.c (evaluate_subexp_with_coercion): Likewise.
* findvar.c (address_of_variable): Likewise.
* jv-valprint.c (java_value_print): Likewise.
* valops.c (value_ind): Likewise.
* value.c (coerce_ref): Likewise.
* c-typeprint.c (c_type_print_varspec_suffix): Added
check for not yet resolved high bound. If unresolved, print
"variable length" string to the console instead of random
length.
* dwarf2read.c (read_subrange_type): Convert DW_AT_count to a dynamic
property and store it as the high bound and flag the range accordingly.
* gdbtypes.c (resolve_dynamic_bounds): If range is flagged as
RANGE_UPPER_BOUND_IS_COUNT assign low + high - 1 as the new high bound.
* gdbtypes.h (enum range_flags): New enum.
(struct range_bounds): Add flags member.
* findvar.c (default_read_var_value): Resolve dynamic bounds if location
points to a constant blob.
* eval.c (evaluate_subexp_for_sizeof): Add enum noside argument.
(evaluate_subexp_standard): Pass noside argument.
(evaluate_subexp_for_sizeof) <BINOP_SUBSCRIPT>: Handle subscript case
if noside equals EVAL_NORMAL. If the subscript yields a vla type
re-evaluate subscript operation with EVAL_NORMAL to enable sideffects.
* gdbtypes.c (resolve_dynamic_bounds): Mark bound as evaluated.
* gdbtypes.h (enum range_flags): Add RANGE_EVALUATED case.
2014-04-11 Keith Seitz <keiths@redhat.com>
PR c++/16675
* c-exp.y (exp : SIZEOF '(' type ')'): Handle reference types.
* eval.c (evaluate_subexp_for_sizeof): Refactor and handle
reference types.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* eval.c (evaluate_subexp_for_sizeof): Add enum noside argument.
(evaluate_subexp_standard): Pass noside argument.
(evaluate_subexp_for_sizeof) <BINOP_SUBSCRIPT>: Handle subscript case
if noside equals EVAL_NORMAL. If the subscript yields a vla type
re-evaluate subscript operation with EVAL_NORMAL to enable sideffects.
* gdbtypes.c (resolve_dynamic_bounds): Mark bound as evaluated.
* gdbtypes.h (enum range_flags): Add RANGE_EVALUATED case.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* findvar.c (default_read_var_value): Resolve dynamic bounds if location
points to a constant blob.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* dwarf2read.c (read_subrange_type): Convert DW_AT_count to a dynamic
property and store it as the high bound and flag the range accordingly.
* gdbtypes.c (resolve_dynamic_bounds): If range is flagged as
RANGE_UPPER_BOUND_IS_COUNT assign low + high - 1 as the new high bound.
* gdbtypes.h (enum range_flags): New enum.
(struct range_bounds): Add flags member.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* c-typeprint.c (c_type_print_varspec_suffix): Added
check for not yet resolved high bound. If unresolved, print
"variable length" string to the console instead of random
length.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* ada-lang.c (ada_value_primitive_packed_val): Re-fetch type from value.
(ada_template_to_fixed_record_type_1): Likewise.
(ada_to_fixed_type_1): Likewise.
* cp-valprint.c (cp_print_value_fields_rtti): Likewise.
(cp_print_value): Likewise.
* d-valprint.c (dynamic_array_type): Likewise.
* eval.c (evaluate_subexp_with_coercion): Likewise.
* findvar.c (address_of_variable): Likewise.
* jv-valprint.c (java_value_print): Likewise.
* valops.c (value_ind): Likewise.
* value.c (coerce_ref): Likewise.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* eval.c (evaluate_subexp_for_sizeof) <UNOP_IND>: Create an indirect
value and retrieve the dynamic type size.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* eval.c (evaluate_subexp_for_sizeof) <OP_VAR_VALUE>: If the type
passed to sizeof is dynamic evaluate the argument to compute the length.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* dwarf2loc.c (dwarf2_locexpr_baton_eval): New function.
(dwarf2_evaluate_property): New function.
* dwarf2loc.h (dwarf2_evaluate_property): New function prototype.
* dwarf2read.c (attr_to_dynamic_prop): New function.
(read_subrange_type): Use attr_to_dynamic_prop to read high bound
attribute.
* gdbtypes.c: Include dwarf2loc.h.
(is_dynamic_type): New function.
(resolve_dynamic_type): New function.
(resolve_dynamic_bounds): New function.
(get_type_length): New function.
(check_typedef): Use get_type_length to compute type length.
* gdbtypes.h (TYPE_HIGH_BOUND_KIND): New macro.
(TYPE_LOW_BOUND_KIND): New macro.
(is_dynamic_type): New function prototype.
* value.c (value_from_contents_and_address): Call resolve_dynamic_type
to resolve dynamic properties of the type. Update comment.
* valops.c (get_value_at, value_at, value_at_lazy): Update comment.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* dwarf2read.c (read_subrange_type): Use struct bound_prop for
declaring high/low bounds and change uses accordingly. Call
create_range_type instead of create_static_range_type.
* gdbtypes.c (create_range_type): New function.
(create_range_type): Convert bounds into struct bound_prop and pass
them to create_range_type.
* gdbtypes.h (struct bound_prop): New struct.
(create_range_type): New function prototype.
(struct range_bounds): Use struct bound_prop instead of LONGEST for
high/low bounds. Remove low_undefined/high_undefined and adapt all uses.
(TYPE_LOW_BOUND,TYPE_HIGH_BOUND): Adapt macros to refer to the static
part of the bound.
* parse.c (follow_types): Set high bound kind to BOUND_UNDEFINED.
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
* gdbtypes.c (create_static_range_type): Renamed from create_range_type.
* gdbtypes.h (create_static_range_type): Renamed from create_range_type.
* ada-lang.c: All uses of create_range_type updated.
* coffread.c: All uses of create_range_type updated.
* dwarf2read.c: All uses of create_range_type updated.
* f-exp.y: All uses of create_range_type updated.
* m2-valprint.c: All uses of create_range_type updated.
* mdebugread.c: All uses of create_range_type updated.
* stabsread.c: All uses of create_range_type updated.
* valops.c: All uses of create_range_type updated.
* valprint.c: All uses of create_range_type updated.
breakpoint shadowing, take single-step breakpoints into account. Breakpoints are supposed to be transparent to memory accesses. For all kinds of breakpoints breakpoint_xfer_memory hides the breakpoint instructions. However, sss breakpoints aren't tracked like all other breakpoints, and nothing is taking care of hiding them from memory reads. Say, as is, a background step + disassemble will see breakpoints instructions on software step targets. E.g., stepping over this line: while (1); with s& and then "disassemble" would show sss breakpoints. Actually, that's still not be possible to see today, because: - in native Linux, you can't read memory while the program is running. - with Linux gdbserver, you can, but in the all-stop RSP you can't talk to the server while the program is running... - and with non-stop, on software step targets, we presently force the use of displaced-stepping for all single-steps, so no single-step breakpoints are used... I've been working towards making non-stop not force displaced stepping on sss targets, and I noticed the issue then. With that, I indeed see this: (gdb) set remote Z-packet off (gdb) s& (gdb) disassemble main Dump of assembler code for function main: 0x000000000040049c <+0>: push %rbp 0x000000000040049d <+1>: mov %rsp,%rbp 0x00000000004004a0 <+4>: int3 0x00000000004004a1 <+5>: (bad) End of assembler dump. Instead of the correct: (gdb) disassemble main Dump of assembler code for function main: 0x000000000040049c <+0>: push %rbp 0x000000000040049d <+1>: mov %rsp,%rbp 0x00000000004004a0 <+4>: jmp 0x4004a0 <main+4> This is actually one thing that my v1 of the recent "fix a bunch of run control bugs" series was fixing, because it made sss breakpoints be regular breakpoints in the breakpoint chain. But dropped it in the version that landed in the tree, due to some problems. So instead of making sss breakpoints regular breakpoints, go with a simpler fix (at least for now) -- make breakpoint_xfer_memory take software single-step breakpoints into account. After the patch, I get the correct disassemble output. Tested on x86_64 Fedora 17, and also on top of my "use software single-step on x86" series. Also fixes the issue pointed out by Yao at https://sourceware.org/ml/gdb-patches/2014-04/msg00045.html, where the prologue analysis/frame sniffing manages to see software step breakpoint instructions. gdb/ 2014-04-10 Pedro Alves <palves@redhat.com> * breakpoint.c (single_step_breakpoints) (single_step_gdbarch): Move up in the file. (one_breakpoint_xfer_memory): New function, factored out from ... (breakpoint_xfer_memory): ... here. Also process single-step breakpoints.
2014-04-10 15:19:52 +02:00
2014-04-10 Pedro Alves <palves@redhat.com>
* breakpoint.c (single_step_breakpoints)
(single_step_gdbarch): Move up in the file.
(one_breakpoint_xfer_memory): New function, factored out from ...
(breakpoint_xfer_memory): ... here. Also process single-step
breakpoints.
2014-04-09 Tristan Gingold <gingold@adacore.com>
* darwin-nat.c (darwin_check_new_threads): Fix port leak, add
comments.
(darwin_decode_exception_message): Free port only after use.
2014-04-08 Pierre Langlois <pierre.langlois@embecosm.com>
* avr-tdep.c (struct gdbarch_tdep): Mention avrxmega in the comment.
(avr_gdbarch_init): Add xmega architectures given by bfd_architecture
when setting the size of call_length.
2014-04-07 Siva Chandra Reddy <sivachandra@google.com>
* python/py-value.c (valpy_get_dynamic_type): Use coerce_ref to
dereference TYPE_CODE_REF values.
2014-04-07 Joel Brobecker <brobecker@adacore.com>
* darwin-nat.c (darwin_decode_message): Remove trailing '\n' at
end of warning message.
2014-04-03 Doug Evans <dje@google.com>
* dwarf2read.c (read_cutu_die_from_dwo): Fix assertion, at most one
of stub_comp_unit_die, stub_comp_dir is non-NULL.
2014-04-02 Alan Modra <amodra@gmail.com>
* symfile-mem.c (symbol_file_add_from_memory): Add size parameter.
Pass to bfd_elf_bfd_from_remote_memory. Adjust all callers.
(struct symbol_file_add_from_memory_args): Add size field.
(find_vdso_size): New function.
(add_vsyscall_page): Attempt to find vdso size.
2014-04-01 Doug Evans <dje@google.com>
* dwarf2read.c (read_cutu_die_from_dwo): Improve comment.
2014-04-01 Tristan Gingold <gingold@adacore.com>
* darwin-nat.c (darwin_encode_reply): Add prototype.
(darwin_decode_exception_message): Reply to unknown inferiors.
(darwin_decode_message): Handle message by id. Ignore message
to unknown inferior.
(darwin_wait): Discard unknown messages, add debug trace.
2014-03-31 Doug Evans <dje@google.com>
* dwarf2read.c (read_cutu_die_from_dwo): Delete unused local
comp_dir_string.
2014-03-31 Doug Evans <dje@google.com>
New option "set print symbol-loading".
* NEWS: Mention it.
* solib.c (solib_read_symbols): Only print symbol loading messages
if requested.
(solib_add): If symbol loading is in "brief" mode, notify user
symbols are being loaded.
(reload_shared_libraries_1): Ditto.
* symfile.c (print_symbol_loading_off): New static global.
(print_symbol_loading_brief): New static global.
(print_symbol_loading_full): New static global.
(print_symbol_loading_enums): New static global.
(print_symbol_loading): New static global.
(print_symbol_loading_p): New function.
(symbol_file_add_with_addrs): Only print symbol loading messages
if requested.
(_initialize_symfile): Register "print symbol-loading" set/show
command.
* symfile.h (print_symbol_loading_p): Declare.
2014-03-30 Doug Evans <xdje42@gmail.com>
* infrun.c (set_last_target_status): New function.
(handle_inferior_event): Call it.
2014-03-30 Doug Evans <xdje42@gmail.com>
* inferior.h (enum stop_kind): Improve comment.
[varobj] false type-changed status for reference to Ada array Given the following variable... BT : Bounded := New_Bounded (Low => 1, High => 3); ... where type Bounded is defined as a simple unconstrained array: type Bounded is array (Integer range <>) of Integer; Creating a varobj for that variable, and immediately asking for varobj updates, GDB says that our varobj changed types! (gdb) -var-create bt * bt ^done,name="bt",numchild="3",value="[3]",type="<ref> array (1 .. 3) of integer",has_more="0" (gdb) -var-update 1 * ^done,changelist=[{name="bt",value="[3]",in_scope="true",type_changed="true",new_type="<ref> array (1 .. 3) of integer",new_num_children="3",has_more="0"}] The expected output for the -var-update command is, in this case: (gdb) -var-update 1 * ^done,changelist=[] The problem occurs because the ada-varobj module does not handle references, and while the references gets stripped when the varobj gets created, it doesn't when computing varobj updates. More specifically, when creating the varobj, varobj_create creates a new value which is a reference to a TYPE_CODE_ARRAY. It then calls install_new_value which calls coerce_ref with the following comment: /* We are not interested in the address of references, and given that in C++ a reference is not rebindable, it cannot meaningfully change. So, get hold of the real value. */ if (value) value = coerce_ref (value); This leaves the varobj's type component still a ref, while the varobj's value is now our array, without the ref. This explains why the "value" field in the varobj indicates an array with 3 elements "[3]" while the "type" field shows a ref to an array. Generally speaking, most users have said that showing the ref was a useful piece of information, so this patch is not touching this part. Next, when the user issues the -var-update request, varobj_update calls value_of_root to compute the varobj's new value as well as determine whether the value's type has changed or not. What happens in a nutshell is that it calls value_of_root_1 (which re-evaluates the expression and returns the corresponding new value), finds that the new value is not NULL, and thus asks whether it has mutated: else if (varobj_value_has_mutated (var, value, value_type (value))) This then indirectly delegates the determination to the language-specific callback, which fails, because it does not handle references. This patch fixes the issue by adjusting varobj_value_has_mutated to expect references, and strip them when seen. This allows the various language-specific implementations to remain unaware of references. gdb/ChangeLog: * varobj.c (varobj_value_has_mutated): If NEW_VALUE is a reference, strip the reference layer before calling the lang_ops value_has_mutated callback. gdb/testsuite/ChangeLog: * gdb.ada/mi_dyn_arr: New testcase.
2014-03-20 15:43:08 +01:00
2014-03-28 Joel Brobecker <brobecker@adacore.com>
* varobj.c (varobj_value_has_mutated): If NEW_VALUE is
a reference, strip the reference layer before calling
the lang_ops value_has_mutated callback.
Remove `expout*' globals from parser-defs.h This commit removes the "expout*" globals from our parser code, turning them into a structure that is passed when an expression needs to be evaluated. This is the initial step to make our parser less "globalized". This is mostly a mechanical patch, which creates a structure containing the "expout*" globals and then modify all the functions that handle them in order to take the structure as argument. It is big, and has been reviewed at least 4 times, so I think everything is covered. Below you can see the message links from the discussions: - First attempt: <https://sourceware.org/ml/gdb-patches/2012-01/msg00522.html> Message-ID: <m3k44s7qej.fsf@gmail.com> - Second attempt: <https://sourceware.org/ml/gdb-patches/2012-06/msg00054.html> Message-Id: <1338665528-5932-1-git-send-email-sergiodj@redhat.com> - Third attempt: <https://sourceware.org/ml/gdb-patches/2014-01/msg00949.html> Message-Id: <1390629467-27139-1-git-send-email-sergiodj@redhat.com> - Fourth (last) attempt: <https://sourceware.org/ml/gdb-patches/2014-03/msg00546.html> Message-Id: <1395463432-29750-1-git-send-email-sergiodj@redhat.com> gdb/ 2014-03-27 Sergio Durigan Junior <sergiodj@redhat.com> Remove some globals from our parser. * language.c (unk_lang_parser): Add "struct parser_state" argument. * language.h (struct language_defn) <la_parser>: Likewise. * parse.c (expout, expout_size, expout_ptr): Remove variables. (initialize_expout): Add "struct parser_state" argument. Rewrite function to use the parser state. (reallocate_expout, write_exp_elt, write_exp_elt_opcode, write_exp_elt_sym, write_exp_elt_block, write_exp_elt_objfile, write_exp_elt_longcst, write_exp_elt_dblcst, write_exp_elt_decfloatcst, write_exp_elt_type, write_exp_elt_intern, write_exp_string, write_exp_string_vector, write_exp_bitstring, write_exp_msymbol, mark_struct_expression, write_dollar_variable): Likewise. (parse_exp_in_context_1): Use parser state. (insert_type_address_space): Add "struct parser_state" argument. Use parser state. (increase_expout_size): New function. * parser-defs.h: Forward declare "struct language_defn" and "struct parser_state". (expout, expout_size, expout_ptr): Remove extern declarations. (parse_gdbarch, parse_language): Rewrite macro declarations to accept the parser state. (struct parser_state): New struct. (initialize_expout, reallocate_expout, write_exp_elt_opcode, write_exp_elt_sym, write_exp_elt_longcst, write_exp_elt_dblcst, write_exp_elt_decfloatcst, write_exp_elt_type, write_exp_elt_intern, write_exp_string, write_exp_string_vector, write_exp_bitstring, write_exp_elt_block, write_exp_elt_objfile, write_exp_msymbol, write_dollar_variable, mark_struct_expression, insert_type_address_space): Add "struct parser_state" argument. (increase_expout_size): New function. * utils.c (do_clear_parser_state): New function. (make_cleanup_clear_parser_state): Likewise. * utils.h (make_cleanup_clear_parser_state): New function prototype. * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Update calls to write_exp* in order to pass the parser state. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * i386-tdep.c (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. (stap_parse_single_operand): Likewise. (stap_parse_argument_1): Likewise. (stap_parse_argument): Use parser state. * stap-probe.h: Include "parser-defs.h". (struct stap_parse_info) <pstate>: New field. * c-exp.y (parse_type): Rewrite to use parser state. (yyparse): Redefine to c_parse_internal. (pstate): New global variable. (parse_number): Add "struct parser_state" argument. (write_destructor_name): Likewise. (type_exp): Update calls to write_exp* and similars in order to use parser state. (exp1, exp, variable, qualified_name, space_identifier, typename, typebase): Likewise. (write_destructor_name, parse_number, lex_one_token, classify_name, classify_inner_name, c_parse): Add "struct parser_state" argument. Update function to use parser state. * c-lang.h: Forward declare "struct parser_state". (c_parse): Add "struct parser_state" argument. * ada-exp.y (parse_type): Rewrite macro to use parser state. (yyparse): Redefine macro to ada_parse_internal. (pstate): New variable. (write_int, write_object_renaming, write_var_or_type, write_name_assoc, write_exp_op_with_string, write_ambiguous_var, type_int, type_long, type_long_long, type_float, type_double, type_long_double, type_char, type_boolean, type_system_address): Add "struct parser_state" argument. (exp1, primary, simple_exp, relation, and_exp, and_then_exp, or_exp, or_else_exp, xor_exp, type_prefix, opt_type_prefix, var_or_type, aggregate, aggregate_component_list, positional_list, others, component_group, component_associations): Update calls to write_exp* and similar functions in order to use parser state. (ada_parse, write_var_from_sym, write_int, write_exp_op_with_string, write_object_renaming, find_primitive_type, write_selectors, write_ambiguous_var, write_var_or_type, write_name_assoc, type_int, type_long, type_long_long, type_float, type_double, type_long_double, type_char, type_boolean, type_system_address): Add "struct parser_state" argument. Adjust function to use parser state. * ada-lang.c (parse): Likewise. * ada-lang.h: Forward declare "struct parser_state". (ada_parse): Add "struct parser_state" argument. * ada-lex.l (processInt, processReal): Likewise. Adjust all calls to both functions. * f-exp.y (parse_type, parse_f_type): Rewrite macros to use parser state. (yyparse): Redefine macro to f_parse_internal. (pstate): New variable. (parse_number): Add "struct parser_state" argument. (type_exp, exp, subrange, typebase): Update calls to write_exp* and similars in order to use parser state. (parse_number): Adjust code to use parser state. (yylex): Likewise. (f_parse): New function. * f-lang.h: Forward declare "struct parser_state". (f_parse): Add "struct parser_state" argument. * jv-exp.y (parse_type, parse_java_type): Rewrite macros to use parser state. (yyparse): Redefine macro for java_parse_internal. (pstate): New variable. (push_expression_name, push_expression_name, insert_exp): Add "struct parser_state" argument. (type_exp, StringLiteral, Literal, PrimitiveType, IntegralType, FloatingPointType, exp1, PrimaryNoNewArray, FieldAccess, FuncStart, MethodInvocation, ArrayAccess, PostfixExpression, PostIncrementExpression, PostDecrementExpression, UnaryExpression, PreIncrementExpression, PreDecrementExpression, UnaryExpressionNotPlusMinus, CastExpression, MultiplicativeExpression, AdditiveExpression, ShiftExpression, RelationalExpression, EqualityExpression, AndExpression, ExclusiveOrExpression, InclusiveOrExpression, ConditionalAndExpression, ConditionalOrExpression, ConditionalExpression, Assignment, LeftHandSide): Update calls to write_exp* and similars in order to use parser state. (parse_number): Ajust code to use parser state. (yylex): Likewise. (java_parse): New function. (push_variable): Add "struct parser_state" argument. Adjust code to user parser state. (push_fieldnames, push_qualified_expression_name, push_expression_name, insert_exp): Likewise. * jv-lang.h: Forward declare "struct parser_state". (java_parse): Add "struct parser_state" argument. * m2-exp.y (parse_type, parse_m2_type): Rewrite macros to use parser state. (yyparse): Redefine macro to m2_parse_internal. (pstate): New variable. (type_exp, exp, fblock, variable, type): Update calls to write_exp* and similars to use parser state. (yylex): Likewise. (m2_parse): New function. * m2-lang.h: Forward declare "struct parser_state". (m2_parse): Add "struct parser_state" argument. * objc-lang.c (end_msglist): Add "struct parser_state" argument. * objc-lang.h: Forward declare "struct parser_state". (end_msglist): Add "struct parser_state" argument. * p-exp.y (parse_type): Rewrite macro to use parser state. (yyparse): Redefine macro to pascal_parse_internal. (pstate): New variable. (parse_number): Add "struct parser_state" argument. (type_exp, exp1, exp, qualified_name, variable): Update calls to write_exp* and similars in order to use parser state. (parse_number, yylex): Adjust code to use parser state. (pascal_parse): New function. * p-lang.h: Forward declare "struct parser_state". (pascal_parse): Add "struct parser_state" argument. * go-exp.y (parse_type): Rewrite macro to use parser state. (yyparse): Redefine macro to go_parse_internal. (pstate): New variable. (parse_number): Add "struct parser_state" argument. (type_exp, exp1, exp, variable, type): Update calls to write_exp* and similars in order to use parser state. (parse_number, lex_one_token, classify_name, yylex): Adjust code to use parser state. (go_parse): Likewise. * go-lang.h: Forward declare "struct parser_state". (go_parse): Add "struct parser_state" argument.
2014-03-27 23:10:40 +01:00
2014-03-27 Sergio Durigan Junior <sergiodj@redhat.com>
Remove some globals from our parser.
* language.c (unk_lang_parser): Add "struct parser_state"
argument.
* language.h (struct language_defn) <la_parser>: Likewise.
* parse.c (expout, expout_size, expout_ptr): Remove variables.
(initialize_expout): Add "struct parser_state" argument.
Rewrite function to use the parser state.
(reallocate_expout, write_exp_elt, write_exp_elt_opcode,
write_exp_elt_sym, write_exp_elt_block, write_exp_elt_objfile,
write_exp_elt_longcst, write_exp_elt_dblcst,
write_exp_elt_decfloatcst, write_exp_elt_type,
write_exp_elt_intern, write_exp_string, write_exp_string_vector,
write_exp_bitstring, write_exp_msymbol, mark_struct_expression,
write_dollar_variable): Likewise.
(parse_exp_in_context_1): Use parser state.
(insert_type_address_space): Add "struct parser_state" argument.
Use parser state.
(increase_expout_size): New function.
* parser-defs.h: Forward declare "struct language_defn" and
"struct parser_state".
(expout, expout_size, expout_ptr): Remove extern declarations.
(parse_gdbarch, parse_language): Rewrite macro declarations to
accept the parser state.
(struct parser_state): New struct.
(initialize_expout, reallocate_expout, write_exp_elt_opcode,
write_exp_elt_sym, write_exp_elt_longcst, write_exp_elt_dblcst,
write_exp_elt_decfloatcst, write_exp_elt_type,
write_exp_elt_intern, write_exp_string, write_exp_string_vector,
write_exp_bitstring, write_exp_elt_block, write_exp_elt_objfile,
write_exp_msymbol, write_dollar_variable,
mark_struct_expression, insert_type_address_space): Add "struct
parser_state" argument.
(increase_expout_size): New function.
* utils.c (do_clear_parser_state): New function.
(make_cleanup_clear_parser_state): Likewise.
* utils.h (make_cleanup_clear_parser_state): New function
prototype.
* aarch64-linux-tdep.c (aarch64_stap_parse_special_token):
Update calls to write_exp* in order to pass the parser state.
* arm-linux-tdep.c (arm_stap_parse_special_token): Likewise.
* i386-tdep.c (i386_stap_parse_special_token_triplet): Likewise.
(i386_stap_parse_special_token_three_arg_disp): Likewise.
* ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise.
* stap-probe.c (stap_parse_register_operand): Likewise.
(stap_parse_single_operand): Likewise.
(stap_parse_argument_1): Likewise.
(stap_parse_argument): Use parser state.
* stap-probe.h: Include "parser-defs.h".
(struct stap_parse_info) <pstate>: New field.
* c-exp.y (parse_type): Rewrite to use parser state.
(yyparse): Redefine to c_parse_internal.
(pstate): New global variable.
(parse_number): Add "struct parser_state" argument.
(write_destructor_name): Likewise.
(type_exp): Update calls to write_exp* and similars in order to
use parser state.
(exp1, exp, variable, qualified_name, space_identifier,
typename, typebase): Likewise.
(write_destructor_name, parse_number, lex_one_token,
classify_name, classify_inner_name, c_parse): Add "struct
parser_state" argument. Update function to use parser state.
* c-lang.h: Forward declare "struct parser_state".
(c_parse): Add "struct parser_state" argument.
* ada-exp.y (parse_type): Rewrite macro to use parser state.
(yyparse): Redefine macro to ada_parse_internal.
(pstate): New variable.
(write_int, write_object_renaming, write_var_or_type,
write_name_assoc, write_exp_op_with_string, write_ambiguous_var,
type_int, type_long, type_long_long, type_float, type_double,
type_long_double, type_char, type_boolean, type_system_address):
Add "struct parser_state" argument.
(exp1, primary, simple_exp, relation, and_exp, and_then_exp,
or_exp, or_else_exp, xor_exp, type_prefix, opt_type_prefix,
var_or_type, aggregate, aggregate_component_list,
positional_list, others, component_group,
component_associations): Update calls to write_exp* and similar
functions in order to use parser state.
(ada_parse, write_var_from_sym, write_int,
write_exp_op_with_string, write_object_renaming,
find_primitive_type, write_selectors, write_ambiguous_var,
write_var_or_type, write_name_assoc, type_int, type_long,
type_long_long, type_float, type_double, type_long_double,
type_char, type_boolean, type_system_address): Add "struct
parser_state" argument. Adjust function to use parser state.
* ada-lang.c (parse): Likewise.
* ada-lang.h: Forward declare "struct parser_state".
(ada_parse): Add "struct parser_state" argument.
* ada-lex.l (processInt, processReal): Likewise. Adjust all
calls to both functions.
* f-exp.y (parse_type, parse_f_type): Rewrite macros to use
parser state.
(yyparse): Redefine macro to f_parse_internal.
(pstate): New variable.
(parse_number): Add "struct parser_state" argument.
(type_exp, exp, subrange, typebase): Update calls to write_exp*
and similars in order to use parser state.
(parse_number): Adjust code to use parser state.
(yylex): Likewise.
(f_parse): New function.
* f-lang.h: Forward declare "struct parser_state".
(f_parse): Add "struct parser_state" argument.
* jv-exp.y (parse_type, parse_java_type): Rewrite macros to use
parser state.
(yyparse): Redefine macro for java_parse_internal.
(pstate): New variable.
(push_expression_name, push_expression_name, insert_exp): Add
"struct parser_state" argument.
(type_exp, StringLiteral, Literal, PrimitiveType, IntegralType,
FloatingPointType, exp1, PrimaryNoNewArray, FieldAccess,
FuncStart, MethodInvocation, ArrayAccess, PostfixExpression,
PostIncrementExpression, PostDecrementExpression,
UnaryExpression, PreIncrementExpression, PreDecrementExpression,
UnaryExpressionNotPlusMinus, CastExpression,
MultiplicativeExpression, AdditiveExpression, ShiftExpression,
RelationalExpression, EqualityExpression, AndExpression,
ExclusiveOrExpression, InclusiveOrExpression,
ConditionalAndExpression, ConditionalOrExpression,
ConditionalExpression, Assignment, LeftHandSide): Update
calls to write_exp* and similars in order to use parser state.
(parse_number): Ajust code to use parser state.
(yylex): Likewise.
(java_parse): New function.
(push_variable): Add "struct parser_state" argument. Adjust
code to user parser state.
(push_fieldnames, push_qualified_expression_name,
push_expression_name, insert_exp): Likewise.
* jv-lang.h: Forward declare "struct parser_state".
(java_parse): Add "struct parser_state" argument.
* m2-exp.y (parse_type, parse_m2_type): Rewrite macros to use
parser state.
(yyparse): Redefine macro to m2_parse_internal.
(pstate): New variable.
(type_exp, exp, fblock, variable, type): Update calls to
write_exp* and similars to use parser state.
(yylex): Likewise.
(m2_parse): New function.
* m2-lang.h: Forward declare "struct parser_state".
(m2_parse): Add "struct parser_state" argument.
* objc-lang.c (end_msglist): Add "struct parser_state" argument.
* objc-lang.h: Forward declare "struct parser_state".
(end_msglist): Add "struct parser_state" argument.
* p-exp.y (parse_type): Rewrite macro to use parser state.
(yyparse): Redefine macro to pascal_parse_internal.
(pstate): New variable.
(parse_number): Add "struct parser_state" argument.
(type_exp, exp1, exp, qualified_name, variable): Update calls to
write_exp* and similars in order to use parser state.
(parse_number, yylex): Adjust code to use parser state.
(pascal_parse): New function.
* p-lang.h: Forward declare "struct parser_state".
(pascal_parse): Add "struct parser_state" argument.
* go-exp.y (parse_type): Rewrite macro to use parser state.
(yyparse): Redefine macro to go_parse_internal.
(pstate): New variable.
(parse_number): Add "struct parser_state" argument.
(type_exp, exp1, exp, variable, type): Update calls to
write_exp* and similars in order to use parser state.
(parse_number, lex_one_token, classify_name, yylex): Adjust code
to use parser state.
(go_parse): Likewise.
* go-lang.h: Forward declare "struct parser_state".
(go_parse): Add "struct parser_state" argument.
2014-03-27 Doug Evans <dje@google.com>
* dwarf2read.c (read_str_index): Delete arg cu. All callers updated.
2014-03-27 Doug Evans <dje@google.com>
* dwarf2read.c (init_cutu_and_read_dies_no_follow): Fix comments.
Remove argument abbrev_section. All callers updated.
2014-03-27 Doug Evans <dje@google.com>
* dwarf2read.c (struct dwarf2_cu): Improve comments for members
addr_base, ranges_base.
2014-03-26 Keith Seitz <keiths@redhat.com>
* ada-tasks.c (get_tcb_types_info): Search STRUCT_DOMAIN for
types, not VAR_DOMAIN.
2014-03-25 Sandra Loosemore <sandra@codesourcery.com>
* features/nios2-cpu.xml: Correct types of "gp", "fp", "ea", and
"ra" registers.
* features/nios2-linux.c: Regenerated.
* features/nios2.c: Regenerated.
2014-03-25 Pedro Alves <palves@redhat.com>
* cli/cli-script.c (script_from_file): Force the interpreter to
sync mode.
2014-03-24 Pierre Langlois <pierre.langlois@embecosm.com>
* avr-tdep.c (avr_scan_prologue): Accept push r1 instruction for
small stack allocation.
2014-03-24 Tristan Gingold <gingold@adacore.com>
* darwin-nat.c (exc_server): Remove unused prototype.
(darwin_dump_message): Correctly display data on x86_64.
(darwin_encode_reply): Fix style.
Add comments and fix indentation.
2014-03-24 10:10:07 +01:00
2014-03-24 Pierre Langlois <pierre.langlois@embecosm.com>
* MAINTAINERS (Write After Approval): Add "Pierre Langlois".
2014-03-22 Doug Evans <xdje42@gmail.com>
* infcmd.c: Whitespace fixes.
(interrupt_command): Merge two function comments into one.
2014-03-22 Doug Evans <xdje42@gmail.com>
* infcmd.c (interrupt_command): Renamed from interrupt_target_command.
All uses updated.
2014-03-22 Yao Qi <yao@codesourcery.com>
* remote.c (target_read_live_memory): Remove.
(memory_xfer_live_readonly_partial): Rename it to
remote_xfer_live_readonly_partial. Remove argument 'object'.
All callers updated. Call remote_read_bytes_1
instead of target_read_live_memory.
* tracepoint.c (set_traceframe_number): Remove.
(make_cleanup_restore_traceframe_number): Likewise .
* tracepoint.h (set_traceframe_number): Remove declaration.
(make_cleanup_restore_traceframe_number): Likewise.
2014-03-22 Yao Qi <yao@codesourcery.com>
* remote.c (remote_read_bytes): Move code on reading from the
remote stub to ...
(remote_read_bytes_1): ... here. New function.
Move the traceframe_available_memory code from memory_xfer_partial_1 down to the targets As a follow-up to [PATCH 7/8] Adjust read_value_memory to use to_xfer_partial https://sourceware.org/ml/gdb-patches/2014-02/msg00384.html this patch moves traceframe_available_memory down to the target side. After this patch, the gdb core code is cleaner, and code on handling unavailable memory is moved to remote/tfile/ctf targets. In details, this patch moves traceframe_available_memory code from memory_xfer_partial_1 to remote target only, so remote target still uses traceframe_info mechanism to check unavailable memory, and use remote_ops to read them from read-only sections. We don't use traceframe_info mechanism for tfile and ctf target, because it is fast to iterate all traceframes from trace file, so the summary information got from traceframe_info is not necessary. This patch also moves two functions to remote.c from target.c, because they are only used in remote.c. I'll clean them up in another patch. gdb: 2014-03-22 Yao Qi <yao@codesourcery.com> * ctf.c (ctf_xfer_partial): Check the return value of exec_read_partial_read_only, if it is not TARGET_XFER_OK, return TARGET_XFER_UNAVAILABLE. * tracefile-tfile.c (tfile_xfer_partial): Likewise. * target.c (target_read_live_memory): Move it to remote.c. (memory_xfer_live_readonly_partial): Likewise. (memory_xfer_partial_1): Move some code to remote_read_bytes. * remote.c (target_read_live_memory): Moved from target.c. (memory_xfer_live_readonly_partial): Likewise. (remote_read_bytes): New, factored out from memory_xfer_partial_1.
2014-03-11 03:47:48 +01:00
2014-03-22 Yao Qi <yao@codesourcery.com>
* ctf.c (ctf_xfer_partial): Check the return value of
exec_read_partial_read_only, if it is not TARGET_XFER_OK,
return TARGET_XFER_UNAVAILABLE.
* tracefile-tfile.c (tfile_xfer_partial): Likewise.
* target.c (target_read_live_memory): Move it to remote.c.
(memory_xfer_live_readonly_partial): Likewise.
(memory_xfer_partial_1): Move some code to remote_read_bytes.
* remote.c (target_read_live_memory): Moved from target.c.
(memory_xfer_live_readonly_partial): Likewise.
(remote_read_bytes): Factored out from
memory_xfer_partial_1.
2014-03-21 Daniel Gutson <daniel.gutson@tallertechnologies.com>
* extension.c (eval_ext_lang_from_control_command): Avoid dereferencing
NULL pointer.
2014-03-21 Pedro Alves <palves@redhat.com>
* infrun.c (normal_stop): Extend comment.
Fix internal warning when "gdb -p xxx" ps -e | grep a.out 28886 pts/12 00:00:00 a.out gdb -p 28886 Loaded symbols for /lib64/ld-linux-x86-64.so.2 0x0000003b0ccbc970 in __nanosleep_nocancel () from /lib64/libc.so.6 ../../binutils-gdb/gdb/cleanups.c:265: internal-warning: restore_my_cleanups has found a stale cleanup A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) The backtrace of this issue: (gdb) bt file=0x8b0c10 "s' failed.", line=265, fmt=0x8b0c38 "nutils-gdb/gdb/cleanups.c", ap=0x7fff803e3ed8) at ../../binutils-gdb/gdb/utils.c:748 fmt=0x8b0c38 "nutils-gdb/gdb/cleanups.c", ap=0x7fff803e3ed8) at ../../binutils-gdb/gdb/utils.c:799 string=0x8b0c38 "nutils-gdb/gdb/cleanups.c") at ../../binutils-gdb/gdb/utils.c:809 at ../../binutils-gdb/gdb/cleanups.c:265 at ../../binutils-gdb/gdb/cleanups.c:276 at ../../binutils-gdb/gdb/exceptions.c:142 at ../../binutils-gdb/gdb/exceptions.c:203 command=0x5d5fb8 <attach_command_continuation_free_args+18>, arg=0x7fff803e525b "2914", from_tty=1, mask=RETURN_MASK_ALL) at ../../binutils-gdb/gdb/exceptions.c:549 ---Type <return> to continue, or q <return> to quit--- func_args=0x7fff803e4280, errstring=0x8cf2e4 "/local/bin", mask=RETURN_MASK_ALL) at ../../binutils-gdb/gdb/exceptions.c:522 This is a new issue. It is introduced by commit https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=8bc2fe488957946d2cdccda3ce8d4f39e4003ea0 It removed the discard_cleanups (back_to) inside attach_command. Then restore_my_cleanups will throw a internal_warning. https://sourceware.org/ml/gdb-patches/2014-03/msg00374.html 2014-03-21 Hui Zhu <hui@codesourcery.com> Pedro Alves <palves@redhat.com> * darwin-nat.c (darwin_pid_to_exec_file): Change xmalloc to static buffer. * fbsd-nat.c (fbsd_pid_to_exec_file): Ditto. * linux-nat.c (linux_child_pid_to_exec_file): Ditto. * nbsd-nat.c (nbsd_pid_to_exec_file): Ditto.
2014-03-21 03:25:41 +01:00
2014-03-21 Hui Zhu <hui@codesourcery.com>
Pedro Alves <palves@redhat.com>
* darwin-nat.c (darwin_pid_to_exec_file): Change xmalloc to
static buffer.
* fbsd-nat.c (fbsd_pid_to_exec_file): Ditto.
* linux-nat.c (linux_child_pid_to_exec_file): Ditto.
* nbsd-nat.c (nbsd_pid_to_exec_file): Ditto.
2014-03-20 Maciej W. Rozycki <macro@codesourcery.com>
* mi/mi-interp.c (mi_memory_changed): Avoid using the ISO C99
`z' formatted output modifier.
2014-03-20 Tom Tromey <tromey@redhat.com>
Sergio Durigan Junior <sergiodj@redhat.com>
* probe.c (parse_probes): Turn assert into an ordinary error.
* break-catch-throw.c (re_set_exception_catchpoint): Ignore
exceptions when parsing probes. Rearrange the code for clarity.
Fix py-finish-breakpoint.exp with target async. With target async enabled, py-finish-breakpoint.exp triggers an assertion failure. The failure occurs because execute_command re-enters the event loop in some circumstances, and in this case resets the sync_execution flag. Then later GDB reaches this assertion in normal_stop: gdb_assert (sync_execution || !target_can_async_p ()); In detail: #1 - A synchronous execution command is run. sync_execution is set. #2 - A python breakpoint is hit (TARGET_WAITKIND_STOPPED), and the corresponding Python breakpoint's stop method is executed. When and while python commands are executed, interpreter_async is forced to 0. #3 - The Python stop method happens to execute a not-execution-related gdb command. In this case, "where 1". #4 - Seeing that sync_execution is set, execute_command nests a new event loop (although that wasn't necessary; this is the problem). #5 - The linux-nat target's pipe in the event loop happens to be marked. That's normal, due to this in linux_nat_wait: /* If we requested any event, and something came out, assume there may be more. If we requested a specific lwp or process, also assume there may be more. */ The nested event loop thus immediately wakes up and calls target_wait. No thread is actually executing in the inferior, so the target returns TARGET_WAITKIND_NO_RESUMED. #6 - normal_stop is reached. GDB prints "No unwaited-for children left.", and resets the sync_execution flag (IOW, there are no resumed threads left, so the synchronous command is considered completed.) This is already bogus. We were handling a breakpoint! #7 - the nested event loop unwinds/ends. GDB is now back to handling the python stop method (TARGET_WAITKIND_STOPPED), which decides the breakpoint should stop. normal_stop is called for this event. However, normal_stop actually works with the _last_ reported target status: void normal_stop (void) { struct target_waitstatus last; ptid_t last_ptid; struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); ... get_last_target_status (&last_ptid, &last); ... if (last.kind == TARGET_WAITKIND_NO_RESUMED) { gdb_assert (sync_execution || !target_can_async_p ()); target_terminal_ours_for_output (); printf_filtered (_("No unwaited-for children left.\n")); } And due to the nesting in execute command, the last event is now TARGET_WAITKIND_NO_RESUMED, not the actual breakpoint event being handled. This could be seen to be broken in itself, but we can leave fixing that for another pass. The assertion is reached, and fails. execute_command has a comment explaining when it should synchronously wait for events: /* If the interpreter is in sync mode (we're running a user command's list, running command hooks or similars), and we just ran a synchronous command that started the target, wait for that command to end. */ However, the code did not follow this comment -- it didn't check to see if the command actually started the target, just whether the target was executing a sync command at this point. This patch fixes the problem by noting whether the target was executing in sync_execution mode before running the command, and then augmenting the condition to test this as well. 2014-03-20 Tom Tromey <tromey@redhat.com> PR gdb/14135 * top.c (execute_command): Only dispatch events if the command started the target.
2014-03-04 19:32:52 +01:00
2014-03-20 Tom Tromey <tromey@redhat.com>
PR gdb/14135
* top.c (execute_command): Only dispatch events if the command
started the target.
make dprintf.exp pass in target async mode When target-async is enabled, dprintf.exp fails: Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ... FAIL: gdb.base/dprintf.exp: 1st dprintf, call FAIL: gdb.base/dprintf.exp: 2nd dprintf, call FAIL: gdb.base/dprintf.exp: Set dprintf function FAIL: gdb.base/dprintf.exp: 1st dprintf, fprintf FAIL: gdb.base/dprintf.exp: 2nd dprintf, fprintf Breakpoint 2, main (argc=1, argv=0x7fffffffd3f8) at ../../../src/gdb/testsuite/gdb.base/dprintf.c:33 33 int loc = 1234; (gdb) continue Continuing. kickoff 1234 also to stderr 1234 At foo entry (gdb) FAIL: gdb.base/dprintf.exp: 1st dprintf, call The problem is that GDB gave the prompt back to the user too early. This happens when calling functions while handling an event that doesn't cause a user visible stop. dprintf with "set dprintf-style gdb" is one such case. This patch adds a test case that has a breakpoint with a condition that calls a function that returns false, so that regression testing isn't dependent on the implementation of dprintf. The problem happens because run_inferior_call causes GDB to forget that it is running in sync_execution mode, so any event that runs an inferior call causes fetch_inferior_event to display the prompt, even if the event should not result in a user visible stop (that is, gdb resumes the inferior and waits for the next event). This patch fixes the issue by noticing when GDB was in sync_execution mode in run_inferior_call, and taking care to restore this state afterward. gdb/ 2014-03-20 Tom Tromey <tromey@redhat.com> PR cli/15718 * infcall.c: Include event-top.h. (run_inferior_call): Call async_disable_stdin if needed. gdb/testsuite/ 2014-03-20 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> PR cli/15718 * gdb.base/condbreak-call-false.c: New file. * gdb.base/condbreak-call-false.exp: New file.
2014-03-20 18:03:43 +01:00
2014-03-20 Tom Tromey <tromey@redhat.com>
PR cli/15718
* infcall.c: Include event-top.h.
(run_inferior_call): Call async_disable_stdin if needed.
Handle multiple step-overs. This test fails with current mainline. If the program stopped for a breakpoint in thread 1, and then the user switches to thread 2, and resumes the program, GDB first switches back to thread 1 to step it over the breakpoint, in order to make progress. However, that logic only considers the last reported event, assuming only one thread needs that stepping over dance. That's actually not true when we play with scheduler-locking. The patch adds an example to the testsuite of multiple threads needing a step-over before the stepping thread can be resumed. With current mainline, the program re-traps the same breakpoint it had already trapped before. E.g.: Breakpoint 2, main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99 99 wait_threads (); /* set wait-threads breakpoint here */ (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint info threads Id Target Id Frame 3 Thread 0x7ffff77c9700 (LWP 4310) "multiple-step-o" 0x00000000004007ca in child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:43 2 Thread 0x7ffff7fca700 (LWP 4309) "multiple-step-o" 0x0000000000400827 in child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:60 * 1 Thread 0x7ffff7fcb740 (LWP 4305) "multiple-step-o" main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99 (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: info threads shows all threads set scheduler-locking on (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: set scheduler-locking on break 44 Breakpoint 3 at 0x4007d3: file ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c, line 44. (gdb) break 61 Breakpoint 4 at 0x40082d: file ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c, line 61. (gdb) thread 3 [Switching to thread 3 (Thread 0x7ffff77c9700 (LWP 4310))] #0 0x00000000004007ca in child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:43 43 (*myp) ++; (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 3 continue Continuing. Breakpoint 3, child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:44 44 callme (); /* set breakpoint thread 3 here */ (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint in thread 3 p *myp = 0 $1 = 0 (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: unbreak loop in thread 3 thread 2 [Switching to thread 2 (Thread 0x7ffff7fca700 (LWP 4309))] #0 0x0000000000400827 in child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:60 60 (*myp) ++; (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 2 continue Continuing. Breakpoint 4, child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:61 61 callme (); /* set breakpoint thread 2 here */ (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint in thread 2 p *myp = 0 $2 = 0 (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: unbreak loop in thread 2 thread 1 [Switching to thread 1 (Thread 0x7ffff7fcb740 (LWP 4305))] #0 main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99 99 wait_threads (); /* set wait-threads breakpoint here */ (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 1 set scheduler-locking off (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: set scheduler-locking off At this point all thread are stopped for a breakpoint that needs stepping over. (gdb) step Breakpoint 2, main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99 99 wait_threads (); /* set wait-threads breakpoint here */ (gdb) FAIL: gdb.threads/multiple-step-overs.exp: step But that "step" retriggers the same breakpoint instead of making progress. The patch teaches GDB to step over all breakpoints of all threads before resuming the stepping thread. Tested on x86_64 Fedora 17, against pristine mainline, and also my branch that implements software single-stepping on x86. gdb/ 2014-03-20 Pedro Alves <palves@redhat.com> * infrun.c (prepare_to_proceed): Delete. (thread_still_needs_step_over): New function. (find_thread_needs_step_over): New function. (proceed): If the current thread needs a step-over, set its steping_over_breakpoint flag. Adjust to use find_thread_needs_step_over instead of prepare_to_proceed. (process_event_stop_test): For BPSTAT_WHAT_STOP_NOISY and BPSTAT_WHAT_STOP_SILENT, assume the thread stopped for a breakpoint. (switch_back_to_stepped_thread): Step over breakpoints of all threads not the stepping thread, before switching back to the stepping thread. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> * gdb.threads/multiple-step-overs.c: New file. * gdb.threads/multiple-step-overs.exp: New file. * gdb.threads/signal-while-stepping-over-bp-other-thread.exp: Adjust expected infrun debug output.
2014-03-20 14:26:32 +01:00
2014-03-20 Pedro Alves <palves@redhat.com>
* infrun.c (prepare_to_proceed): Delete.
(thread_still_needs_step_over): New function.
(find_thread_needs_step_over): New function.
(proceed): If the current thread needs a step-over, set its
steping_over_breakpoint flag. Adjust to use
find_thread_needs_step_over instead of prepare_to_proceed.
(process_event_stop_test): For BPSTAT_WHAT_STOP_NOISY and
BPSTAT_WHAT_STOP_SILENT, assume the thread stopped for a
breakpoint.
(switch_back_to_stepped_thread): Step over breakpoints of all
threads not the stepping thread, before switching back to the
stepping thread.
Fix for even more missed events; eliminate thread-hop code. Even with deferred_step_ptid out of the way, GDB can still lose watchpoints. If a watchpoint triggers and the PC points to an address where a thread-specific breakpoint for another thread is set, the thread-hop code triggers, and we lose the watchpoint: if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP) { int thread_hop_needed = 0; struct address_space *aspace = get_regcache_aspace (get_thread_regcache (ecs->ptid)); /* Check if a regular breakpoint has been hit before checking for a potential single step breakpoint. Otherwise, GDB will not see this breakpoint hit when stepping onto breakpoints. */ if (regular_breakpoint_inserted_here_p (aspace, stop_pc)) { if (!breakpoint_thread_match (aspace, stop_pc, ecs->ptid)) thread_hop_needed = 1; ^^^^^^^^^^^^^^^^^^^^^ } And on software single-step targets, even without a thread-specific breakpoint in the way, here in the thread-hop code: else if (singlestep_breakpoints_inserted_p) { ... if (!ptid_equal (singlestep_ptid, ecs->ptid) && in_thread_list (singlestep_ptid)) { /* If the PC of the thread we were trying to single-step has changed, discard this event (which we were going to ignore anyway), and pretend we saw that thread trap. This prevents us continuously moving the single-step breakpoint forward, one instruction at a time. If the PC has changed, then the thread we were trying to single-step has trapped or been signalled, but the event has not been reported to GDB yet. There might be some cases where this loses signal information, if a signal has arrived at exactly the same time that the PC changed, but this is the best we can do with the information available. Perhaps we should arrange to report all events for all threads when they stop, or to re-poll the remote looking for this particular thread (i.e. temporarily enable schedlock). */ CORE_ADDR new_singlestep_pc = regcache_read_pc (get_thread_regcache (singlestep_ptid)); if (new_singlestep_pc != singlestep_pc) { enum gdb_signal stop_signal; if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: unexpected thread," " but expected thread advanced also\n"); /* The current context still belongs to singlestep_ptid. Don't swap here, since that's the context we want to use. Just fudge our state and continue. */ stop_signal = ecs->event_thread->suspend.stop_signal; ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0; ecs->ptid = singlestep_ptid; ecs->event_thread = find_thread_ptid (ecs->ptid); ecs->event_thread->suspend.stop_signal = stop_signal; stop_pc = new_singlestep_pc; } else { if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: unexpected thread\n"); thread_hop_needed = 1; stepping_past_singlestep_breakpoint = 1; saved_singlestep_ptid = singlestep_ptid; } } } we either end up with thread_hop_needed, ignoring the watchpoint SIGTRAP, or switch to the stepping thread, again ignoring that the SIGTRAP could be for some other event. The new test added by this patch exercises both paths. So the fix is similar to the deferred_step_ptid fix -- defer the thread hop to _after_ the SIGTRAP had a change of passing through the regular bpstat handling. If the wrong thread hits a breakpoint, we'll just end up with BPSTAT_WHAT_SINGLE, and if nothing causes a stop, keep_going starts a step-over. Most of the stepping_past_singlestep_breakpoint mechanism is really not necessary -- setting the thread to step over a breakpoint with thread->trap_expected is sufficient to keep all other threads locked. It's best to still keep the flag in some form though, because when we get to keep_going, the software single-step breakpoint we need to step over is already gone -- an optimization done by a follow up patch will check whether a step-over is still be necessary by looking to see whether the breakpoint is still there, and would find the thread no longer needs a step-over, while we still want it. Special care is still needed to handle the case of PC of the thread we were trying to single-step having changed, like in the old code. We can't just keep_going and re-step it, as in that case we can over-step the thread (if it was already done with the step, but hasn't reported it yet, we'd ask it to step even further). That's now handled in switch_back_to_stepped_thread. As bonus, we're now using a technique that doesn't lose signals, unlike the old code -- we now insert a breakpoint at PC, and resume, which either reports the breakpoint immediately, or any pending signal. Tested on x86_64 Fedora 17, against pristine mainline, and against a branch that implements software single-step on x86. gdb/ 2014-03-20 Pedro Alves <palves@redhat.com> * breakpoint.c (single_step_breakpoint_inserted_here_p): Make extern. * breakpoint.h (single_step_breakpoint_inserted_here_p): Declare. * infrun.c (saved_singlestep_ptid) (stepping_past_singlestep_breakpoint): Delete. (resume): Remove stepping_past_singlestep_breakpoint handling. (proceed): Store the prev_pc of the stepping thread too. (init_wait_for_inferior): Adjust. Clear singlestep_ptid and singlestep_pc. (enum infwait_states): Delete infwait_thread_hop_state. (struct execution_control_state) <hit_singlestep_breakpoint>: New field. (handle_inferior_event): Adjust. (handle_signal_stop): Delete stepping_past_singlestep_breakpoint handling and the thread-hop code. Before removing single-step breakpoints, check whether the thread hit a single-step breakpoint of another thread. If it did, the trap is not a random signal. (switch_back_to_stepped_thread): If the event thread hit a single-step breakpoint, unblock it before switching to the stepping thread. Handle the case of the stepped thread having advanced already. (keep_going): Handle the case of the current thread moving past a single-step breakpoint. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> * gdb.threads/step-over-trips-on-watchpoint.c: New file. * gdb.threads/step-over-trips-on-watchpoint.exp: New file.
2014-03-20 14:26:32 +01:00
2014-03-20 Pedro Alves <palves@redhat.com>
* breakpoint.c (single_step_breakpoint_inserted_here_p): Make
extern.
* breakpoint.h (single_step_breakpoint_inserted_here_p): Declare.
* infrun.c (saved_singlestep_ptid)
(stepping_past_singlestep_breakpoint): Delete.
(resume): Remove stepping_past_singlestep_breakpoint handling.
(proceed): Store the prev_pc of the stepping thread too.
(init_wait_for_inferior): Adjust. Clear singlestep_ptid and
singlestep_pc.
(enum infwait_states): Delete infwait_thread_hop_state.
(struct execution_control_state) <hit_singlestep_breakpoint>: New
field.
(handle_inferior_event): Adjust.
(handle_signal_stop): Delete stepping_past_singlestep_breakpoint
handling and the thread-hop code. Before removing single-step
breakpoints, check whether the thread hit a single-step breakpoint
of another thread. If it did, the trap is not a random signal.
(switch_back_to_stepped_thread): If the event thread hit a
single-step breakpoint, unblock it before switching to the
stepping thread. Handle the case of the stepped thread having
advanced already.
(keep_going): Handle the case of the current thread moving past a
single-step breakpoint.
PR breakpoints/7143 - Watchpoint does not trigger when first set Say the program is stopped at a breakpoint, and the user sets a watchpoint. When the program is next resumed, GDB will first step over the breakpoint, as explained in the manual: @value {GDBN} normally ignores breakpoints when it resumes execution, until at least one instruction has been executed. If it it did not do this, you would be unable to proceed past a breakpoint without first disabling the breakpoint. This rule applies whether or not the breakpoint already existed when your program stopped. However, GDB currently also removes watchpoints, catchpoints, etc., and that means that the first instruction off the breakpoint does not trigger the watchpoint, catchpoint, etc. testsuite/gdb.base/watchpoint.exp has a kfail for this. The PR proposes installing watchpoints only when stepping over a breakpoint, but that misses catchpoints, etc. A better fix would instead work from the opposite direction -- remove only real breakpoints, leaving all other kinds of breakpoints inserted. But, going further, it's really a waste to constantly remove/insert all breakpoints when stepping over a single breakpoint (generating a pair of RSP z/Z packets for each breakpoint), so the fix goes a step further and makes GDB remove _only_ the breakpoint being stepped over, leaving all others installed. This then has the added benefit of reducing breakpoint-related RSP traffic substancialy when there are many breakpoints set. gdb/ 2014-03-20 Pedro Alves <palves@redhat.com> PR breakpoints/7143 * breakpoint.c (should_be_inserted): Don't insert breakpoints that are being stepped over. (breakpoint_address_match): Make extern. * breakpoint.h (breakpoint_address_match): New declaration. * inferior.h (stepping_past_instruction_at): New declaration. * infrun.c (struct step_over_info): New type. (step_over_info): New global. (set_step_over_info, clear_step_over_info) (stepping_past_instruction_at): New functions. (handle_inferior_event): Clear the step-over info when trap_expected is cleared. (resume): Remove now stale comment. (clear_proceed_status): Clear step-over info. (proceed): Adjust step-over handling to set or clear the step-over info instead of removing all breakpoints. (handle_signal_stop): When setting up a thread-hop, don't remove breakpoints here. (stop_stepping): Clear step-over info. (keep_going): Adjust step-over handling to set or clear step-over info and then always inserting breakpoints, instead of removing all breakpoints when stepping over one. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> PR breakpoints/7143 * gdb.base/watchpoint.exp: Mention bugzilla bug number instead of old gnats gdb/38. Remove kfail. Adjust to use gdb_test instead of gdb_test_multiple. * gdb.cp/annota2.exp: Remove kfail for gdb/38. * gdb.cp/annota3.exp: Remove kfail for gdb/38.
2014-03-20 14:26:32 +01:00
2014-03-20 Pedro Alves <palves@redhat.com>
PR breakpoints/7143
* breakpoint.c (should_be_inserted): Don't insert breakpoints that
are being stepped over.
(breakpoint_address_match): Make extern.
* breakpoint.h (breakpoint_address_match): New declaration.
* inferior.h (stepping_past_instruction_at): New declaration.
* infrun.c (struct step_over_info): New type.
(step_over_info): New global.
(set_step_over_info, clear_step_over_info)
(stepping_past_instruction_at): New functions.
(handle_inferior_event): Clear the step-over info when
trap_expected is cleared.
(resume): Remove now stale comment.
(clear_proceed_status): Clear step-over info.
(proceed): Adjust step-over handling to set or clear the step-over
info instead of removing all breakpoints.
(handle_signal_stop): When setting up a thread-hop, don't remove
breakpoints here.
(stop_stepping): Clear step-over info.
(keep_going): Adjust step-over handling to set or clear step-over
info and then always inserting breakpoints, instead of removing
all breakpoints when stepping over one.
Fix missing breakpoint/watchpoint hits, eliminate deferred_step_ptid. Consider the case of the user doing "step" in thread 2, while thread 1 had previously stopped for a breakpoint. In order to make progress, GDB makes thread 1 step over its breakpoint first (with all other threads stopped), and once that is over, thread 2 then starts stepping (with thread 1 and all others running free, by default). If GDB didn't do that, thread 1 would just trip on the same breakpoint immediately again. This is what the prepare_to_proceed / deferred_step_ptid code is all about. However, deferred_step_ptid code resumes the target with: resume (1, GDB_SIGNAL_0); prepare_to_wait (ecs); return; Recall we were just stepping over a breakpoint when we get here. That means that _nothing_ had installed breakpoints yet! If there's another breakpoint just after the breakpoint that was just stepped, we'll miss it. The fix for that would be to use keep_going instead. However, there are more problems. What if the instruction that was just single-stepped triggers a watchpoint? Currently, GDB just happily resumes the thread, losing that too... Missed watchpoints will need yet further fixes, but we should keep those in mind. So the fix must be to let the trap fall through the regular bpstat handling, and only if no breakpoint, watchpoint, etc. claims the trap, shall we switch back to the stepped thread. Now, nowadays, we have code at the tail end of trap handling that does exactly that -- switch back to the stepped thread (switch_back_to_the_stepped_thread). So the deferred_step_ptid code is just standing in the way, and can simply be eliminated, fixing bugs in the process. Sweet. The comment about spurious "Switching to ..." made me pause, but is actually stale nowadays. That isn't needed anymore. previous_inferior_ptid used to be re-set at each (internal) event, but now it's only touched in proceed and normal stop. The two tests added by this patch fail without the fix. Tested on x86_64 Fedora 17 (also against my software single-stepping on x86 branch). gdb/ 2014-03-20 Pedro Alves <palves@redhat.com> * infrun.c (previous_inferior_ptid): Adjust comment. (deferred_step_ptid): Delete. (infrun_thread_ptid_changed, prepare_to_proceed) (init_wait_for_inferior): Adjust. (handle_signal_stop): Delete deferred_step_ptid handling. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> * gdb.threads/step-over-lands-on-breakpoint.c: New file. * gdb.threads/step-over-lands-on-breakpoint.exp: New file.
2014-03-20 14:26:31 +01:00
2014-03-20 Pedro Alves <palves@redhat.com>
* infrun.c (previous_inferior_ptid): Adjust comment.
(deferred_step_ptid): Delete.
(infrun_thread_ptid_changed, prepare_to_proceed)
(init_wait_for_inferior): Adjust.
(handle_signal_stop): Delete deferred_step_ptid handling.
2014-03-18 Jan Kratochvil <jan.kratochvil@redhat.com>
PR gdb/15358
* defs.h (sync_quit_force_run): New declaration.
(QUIT): Check also SYNC_QUIT_FORCE_RUN.
* event-top.c (async_sigterm_handler): New declaration.
(async_sigterm_token): New variable.
(async_init_signals): Create also async_sigterm_token.
(async_sigterm_handler): New function.
(sync_quit_force_run): New variable.
(handle_sigterm): Replace quit_force call by other calls.
* utils.c (quit): Call quit_force if SYNC_QUIT_FORCE_RUN.
2014-03-18 Maciej W. Rozycki <macro@codesourcery.com>
* rs6000-tdep.c (rs6000_frame_cache): Correct little-endian GPR
offset into SPE pseudo registers.
PR gdb/13860: make "-exec-foo"'s MI output equal to "foo"'s MI output. Part of PR gdb/13860 is about the mi-solib.exp test's output being different in sync vs async modes. sync: >./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async off" -i=mi =thread-group-added,id="i1" ~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..." ~"done.\n" (gdb) &"start\n" ~"Temporary breakpoint 1 at 0x400608: file ../../../src/gdb/testsuite/gdb.mi/solib-main.c, line 21.\n" =breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0000000000400608",func="main",file="../../../src/gdb/testsuite/gdb.mi/solib-main.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/solib-main.c",line="21",times="0",original-location="main"} ~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n" =thread-group-started,id="i1",pid="17724" =thread-created,id="1",group-id="i1" ^running *running,thread-id="all" (gdb) =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1" ~"Stopped due to shared library event (no libraries added or removed)\n" *stopped,reason="solib-event",frame={addr="0x000000379180f990",func="_dl_debug_state",args=[],from="/lib64/ld-linux-x86-64.so.2"},thread-id="1",stopped-threads="all",core="3" (gdb) async: >./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async on" -i=mi =thread-group-added,id="i1" ~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..." ~"done.\n" (gdb) start &"start\n" ~"Temporary breakpoint 1 at 0x400608: file ../../../src/gdb/testsuite/gdb.mi/solib-main.c, line 21.\n" =breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0000000000400608",func="main",file="../../../src/gdb/testsuite/gdb.mi/solib-main.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/solib-main.c",line="21",times="0",original-location="main"} ~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n" =thread-group-started,id="i1",pid="17729" =thread-created,id="1",group-id="i1" ^running *running,thread-id="all" =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1" (gdb) *stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1" For now, let's focus only on the *stopped event. We see that the async output is missing frame info. And this causes a test failure in async mode, as "mi_expect_stop solib-event" wants to see the frame info. However, if we compare the event output when a real MI execution command is used, compared to a CLI command (e.g., run vs -exec-run, next vs -exec-next, etc.), we see: >./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async off" -i=mi =thread-group-added,id="i1" ~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..." ~"done.\n" (gdb) r &"r\n" ~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n" =thread-group-started,id="i1",pid="17751" =thread-created,id="1",group-id="i1" ^running *running,thread-id="all" (gdb) =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1" ~"Stopped due to shared library event (no libraries added or removed)\n" *stopped,reason="solib-event",frame={addr="0x000000379180f990",func="_dl_debug_state",args=[],from="/lib64/ld-linux-x86-64.so.2"},thread-id="1",stopped-threads="all",core="3" (gdb) -exec-run =thread-exited,id="1",group-id="i1" =thread-group-exited,id="i1" =library-unloaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",thread-group="i1" =thread-group-started,id="i1",pid="17754" =thread-created,id="1",group-id="i1" ^running *running,thread-id="all" (gdb) =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1" *stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1" =thread-selected,id="1" (gdb) As seen above, with MI commands, the *stopped event _doesn't_ have frame info. This is because normal_stop, as commanded by the result of bpstat_print, skips printing frame info in this case (it's an "event", not a "breakpoint"), and when the interpreter is MI, mi_on_normal_stop skips calling print_stack_frame, as the normal_stop call was already done with the MI uiout. This explains why the async output is different even with a CLI command. Its because in async mode, the mi_on_normal_stop path is always taken; it is always reached with the MI uiout, because the stop is handled from the event loop, instead of from within `proceed -> wait_for_inferior -> normal_stop' with the interpreter overridden, as in sync mode. This patch fixes the issue by making all cases output the same *stopped event, by factoring out the print code from normal_stop, and using it from mi_on_normal_stop as well. I chose the *stopped output without a frame, mainly because that is what you already get if you use MI execution commands, the commands frontends are supposed to use (except when implementing a console). This patch makes it simpler to tweak the MI output differently if desired, as we only have to change the centralized print_stop_event (taking into account whether the uiout is MI-like), and all different modes will change accordingly. Tested on x86_64 Fedora 17, no regressions. The mi-solib.exp test no longer fails in async mode with this patch, so the patch removes the kfail. 2014-03-18 Pedro Alves <palves@redhat.com> PR gdb/13860 * inferior.h (print_stop_event): Declare. * infrun.c (print_stop_event): New, factored out from ... (normal_stop): ... this. * mi/mi-interp.c (mi_on_normal_stop): Use print_stop_event instead of bpstat_print/print_stack_frame. 2014-03-18 Pedro Alves <palves@redhat.com> PR gdb/13860 * gdb.mi/mi-solib.exp: Remove gdb/13860 kfail. * lib/mi-support.exp (mi_expect_stop): Add special handling for solib-event.
2014-03-18 18:50:28 +01:00
2014-03-18 Pedro Alves <palves@redhat.com>
PR gdb/13860
* inferior.h (print_stop_event): Declare.
* infrun.c (print_stop_event): New, factored out from ...
(normal_stop): ... this.
* mi/mi-interp.c (mi_on_normal_stop): Use print_stop_event instead
of bpstat_print/print_stack_frame.
2014-03-17 Tom Tromey <tromey@redhat.com>
* ui-out.c (clear_table, ui_out_new): Clear uiout->table.id.
[Ada] Crash with references to GNAT packed arrays handling Consider the following declarations: type Packed_Array is array (Natural range <>) of Boolean; pragma Pack (Packed_Array); function Make (H, L : Natural) return Packed_Array is begin return (H .. L => False); end Make; A1 : Packed_Array := Make (1, 2); A2 : Packed_Array renames A1; One possible DWARF translation for A2 is: <3><1e4>: Abbrev Number: 21 (DW_TAG_variable) <1e5> DW_AT_name : a2 <1ea> DW_AT_type : <0x1d9> <3><1d9>: Abbrev Number: 22 (DW_TAG_const_type) <1da> DW_AT_type : <0x1de> <3><1de>: Abbrev Number: 23 (DW_TAG_reference_type) <1e0> DW_AT_type : <0x1a3> <3><1a3>: Abbrev Number: 17 (DW_TAG_array_type) <1a4> DW_AT_name : foo__Ta1S___XP1 <1a8> DW_AT_GNAT_descriptive_type: <0x16b> <3><16b>: Abbrev Number: 6 (DW_TAG_typedef) <16c> DW_AT_name : foo__Ta1S <172> DW_AT_type : <0x176> <3><176>: Abbrev Number: 17 (DW_TAG_array_type) <177> DW_AT_name : foo__Ta1S <17b> DW_AT_GNAT_descriptive_type: <0x223> Here, foo__Ta1S___XP1 is the type used for the code generation while foo__Ta1S is the source-level type. Both form a valid GNAT encoding for a packed array type. Trying to print A2 (1) can make GDB crash. This is because A2 is defined as a reference to a GNAT encoding for a packed array. When decoding constrained packed arrays, the ada_coerce_ref subprogram follows references and returns a fixed type from the target type, peeling the GNAT encoding for packed arrays. The remaining code assumes that the resulting type is still such an encoding while we only have a standard GDB array type, hence the crash: arr = ada_coerce_ref (arr); [...] type = decode_constrained_packed_array_type (value_type (arr)); decode_constrained_packed_array_type assumes that its argument is such an encoding. From its front comment: /* The array type encoded by TYPE, where ada_is_constrained_packed_array_type (TYPE). */ This patch simply replaces the call to ada_coerce_ref with a call to coerce_ref in order to avoid prematurely transforming the packed array type as a side-effect. This way, the remaining code will always work with a GNAT encoding. gdb/ChangeLog: * ada-lang.c (decode_constrained_packed_array): Perform a minimal coercion for reference with coerce_ref instead of ada_coerce_ref.
2014-03-14 14:55:42 +01:00
2014-03-17 Pierre-Marie de Rodat <derodat@adacore.com>
* ada-lang.c (decode_constrained_packed_array): Perform a
minimal coercion for reference with coerce_ref instead of
ada_coerce_ref.
2014-03-17 Tristan Gingold <gingold@adacore.com>
* solib-darwin.c (DYLD_VERSION_MAX): Increase value.
(darwin_solib_create_inferior_hook): Emit a warning if version
is unhandled.
2014-03-16 Ulrich Weigand  <uweigand@de.ibm.com>
* python/py-value.c (get_field_flag): Cast flag_name argument to
PyObject_GetAttrString to support Python 2.4.
2014-03-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* MAINTAINERS (The Official FSF-appointed GDB Maintainers)
(Global Maintainers): Remove Jan Kratochvil.
Rename native-only terminal related functions. Looking at target_terminal_inferior etc. in async mode, I realized that the naming of the terminal_inferior, terminal_ours, etc. functions doesn't really give a clue that they're meant for the native target only. This patch renames them. There's already child_terminal_info using the child_ prefix, and, they're most prominently installed by inf-child.c, so I went with the child_ prefix. I dropped "inferior" from a couple to make the name match the corresponding target method. Tested on x86_64 Fedora 17, and cross built for mingw. I didn't test gnu-nat.c, but I think the change is as obvious as it gets. I grepped the tree looking for other potential spots that would need adjustment but this is all I found. If something breaks, it should be trivial to fix. gdb/ 2014-03-14 Pedro Alves <palves@redhat.com> * inferior.h (terminal_ours_for_output): Rename to ... (child_terminal_ours_for_output): ... this. (terminal_save_ours): Rename to ... (child_terminal_save_ours): ... this. (terminal_ours): Rename to ... (child_terminal_ours): ... this. (terminal_inferior): Rename to ... (child_terminal_inferior): ... this. (terminal_init_inferior): Rename to ... (child_terminal_init_inferior): ... this. (terminal_init_inferior_with_pgrp): Rename to ... (child_terminal_init_inferior_with_pgrp): ... this. * inflow.c (terminal_init_inferior_with_pgrp): Rename to ... (child_terminal_init_with_pgrp): ... this. (terminal_save_ours): Rename to ... (child_terminal_save_ours): ... this. (terminal_init_inferior): Rename to ... (child_terminal_init): ... this. Adjust. (terminal_inferior): Rename to ... (child_terminal_inferior): ... this. (terminal_ours_for_output): Rename to ... (child_terminal_ours_for_output): ... this. Adjust. (terminal_ours): Rename to ... (child_terminal_ours): ... this. (terminal_ours_1): Rename to ... (child_terminal_ours_1): ... this. Adjust. * linux-nat.c (linux_nat_terminal_inferior): Adjust. * windows-nat.c (do_initial_windows_stuff): Adjust. * gnu-nat.c (gnu_terminal_init_inferior): Rename to ... (gnu_terminal_init): ... this. Adjust. (gnu_target): Adjust. * inf-child.c (inf_child_target): Adjust.
2014-03-14 01:06:45 +01:00
2014-03-14 Pedro Alves <palves@redhat.com>
* inferior.h (terminal_ours_for_output): Rename to ...
(child_terminal_ours_for_output): ... this.
(terminal_save_ours): Rename to ...
(child_terminal_save_ours): ... this.
(terminal_ours): Rename to ...
(child_terminal_ours): ... this.
(terminal_inferior): Rename to ...
(child_terminal_inferior): ... this.
(terminal_init_inferior): Rename to ...
(child_terminal_init_inferior): ... this.
(terminal_init_inferior_with_pgrp): Rename to ...
(child_terminal_init_inferior_with_pgrp): ... this.
* inflow.c (terminal_init_inferior_with_pgrp): Rename to ...
(child_terminal_init_with_pgrp): ... this.
(terminal_save_ours): Rename to ...
(child_terminal_save_ours): ... this.
(terminal_init_inferior): Rename to ...
(child_terminal_init): ... this. Adjust.
(terminal_inferior): Rename to ...
(child_terminal_inferior): ... this.
(terminal_ours_for_output): Rename to ...
(child_terminal_ours_for_output): ... this. Adjust.
(terminal_ours): Rename to ...
(child_terminal_ours): ... this.
(terminal_ours_1): Rename to ...
(child_terminal_ours_1): ... this. Adjust.
* linux-nat.c (linux_nat_terminal_inferior): Adjust.
* windows-nat.c (do_initial_windows_stuff): Adjust.
* gnu-nat.c (gnu_terminal_init_inferior): Rename to ...
(gnu_terminal_init): ... this. Adjust.
(gnu_target): Adjust.
* inf-child.c (inf_child_target): Adjust.
2014-03-13 Doug Evans <xdje42@gmail.com>
PR guile/16612
* guile/scm-type.c (tyscm_copy_type_recursive): Move type to its
new eq?-hashtab.
2014-03-13 Doug Evans <xdje42@gmail.com>
* value.c (record_latest_value): Call release_value_or_incref
instead of release_value.
2014-03-13 Pedro Alves <palves@redhat.com>
* procfs.c (procfs_target): Don't override to_shortname,
to_longname or to_doc.
Don't mention "Unix" in native target name. I find the mention of "Unix" unnecessary (and really slightly a lie) on GNU/Linux in a couple of places: (gdb) maint print target-stack The current target stack is: - multi-thread (multi-threaded child process.) - child (Unix child process) - exec (Local exec file) - None (None) (gdb) help target child Unix child process (started by the "run" command). (gdb) target child Use the "run" command to start a Unix child process. It's also odd that e.g., the Windows port says "Unix" in reaction to "target child" (it was already that way before Windows used inf-child.c): (gdb) target child Use the "run" command to start a Unix child process. (gdb) So drop "Unix", going in the direction of saying mostly the same on all native targets: (gdb) maint print target-stack The current target stack is: - multi-thread (multi-threaded child process.) - - child (Unix child process) + - child (Child process) - exec (Local exec file) - None (None) (gdb) help target child - Unix child process (started by the "run" command). + Child process (started by the "run" command). (gdb) target child -Use the "run" command to start a Unix child process. +Use the "run" command to start a child process. gdb/ 2014-03-13 Pedro Alves <palves@redhat.com> * inf-child.c (inf_child_open, inf_child_target): Don't mention Unix in user visible strings. gdb/testsuite/ 2014-03-13 Pedro Alves <palves@redhat.com> * gdb.base/default.exp: Update "target child" and "target procfs" tests to not expect "Unix".
2014-03-13 13:02:24 +01:00
2014-03-13 Pedro Alves <palves@redhat.com>
* inf-child.c (inf_child_open, inf_child_target): Don't mention
Unix in user visible strings.
2014-03-13 03:36:45 +01:00
2014-03-12 Stan Shebs <stan@codesourcery.com>
* gdbtypes.h: Annotate comments for Doxygen, add a page
block comment with some general info.
2014-03-12 Pedro Alves <palves@redhat.com>
* infcmd.c (prepare_execution_command): New function, factored out
from several execution commands.
(run_command_1, continue_command, step_1, jump_command)
(signal_command, until_command, advance_command, finish_command)
(attach_command): Use prepare_execution_command.
2014-03-12 Omair Javaid <omair.javaid@linaro.org>
* arm-linux-nat.c (arm_linux_get_hwbp_cap): Updated.
(MAX_BPTS): Define.
(MAX_WPTS): Define.
(struct arm_linux_thread_points): Removed.
(struct arm_linux_process_info): New.
(DEF_VEC_P (arm_linux_thread_points_p)): Removed.
(VEC(arm_linux_thread_points_p) *arm_threads): Removed.
(arm_linux_find_breakpoints_by_tid): Removed.
(struct arch_lwp_info): New.
(arm_linux_find_process_pid): New functions.
(arm_linux_add_process): New functions.
(arm_linux_process_info_get): New functions.
(arm_linux_forget_process): New function.
(arm_linux_get_debug_reg_state): New function.
(struct update_registers_data): New.
(update_registers_callback): New function.
(arm_linux_insert_hw_breakpoint1): Updated.
(arm_linux_remove_hw_breakpoint1): Updated.
(arm_linux_insert_hw_breakpoint): Updated.
(arm_linux_remove_hw_breakpoint): Updated.
(arm_linux_insert_watchpoint): Updated.
(arm_linux_remove_watchpoint): Updated.
(arm_linux_new_thread): Updated.
(arm_linux_prepare_to_resume): New function.
(arm_linux_new_fork): New function.
(_initialize_arm_linux_nat): Updated.
2014-03-12 Pedro Alves <palves@redhat.com>
* Makefile.in (TARGET_FLAGS_TO_PASS): Add TESTS.
fix regressions with target-async A patch in the target cleanup series caused a regression when using record with target-async. Version 4 of the patch is here: https://sourceware.org/ml/gdb-patches/2014-03/msg00159.html The immediate problem is that record supplies to_can_async_p and to_is_async_p methods, but does not supply a to_async method. So, when target-async is set, record claims to support async -- but if the underlying target does not support async, then the to_async method call will end up in that method's default implementation, namely tcomplain. This worked previously because the record target used to provide a to_async method; one that (erroneously, only at push time) checked the other members of the target stack, and then simply dropped to_async calls in the "does not implement async" case. My first thought was to simply drop tcomplain as the default for to_async. This works, but Pedro pointed out that the only reason record has to supply to_can_async_p and to_is_async_p is that these default to using the find_default_run_target machinery -- and these defaults are only needed by "run" and "attach". So, a nicer solution presents itself: change run and attach to explicitly call into the default run target when needed; and change to_is_async_p and to_can_async_p to default to "return 0". This makes the target stack simpler to use and lets us remove the method implementations from record. This is also in harmony with other plans for the target stack; namely trying to reduce the impact of find_default_run_target. This approach makes it clear that find_default_is_async_p is not needed -- it is asking whether a target that may not even be pushed is actually async, which seems like a nonsensical question. While an improvement, this approach proved to introduce the same bug when using the core target. Looking a bit deeper, the issue is that code in "attach" and "run" may need to use either the current target stack or the default run target -- but different calls into the target API in those functions could wind up querying different targets. This new patch makes the target to use more explicit in "run" and "attach". Then these commands explicitly make the needed calls against that target. This ensures that a single target is used for all relevant operations. This lets us remove a couple find_default_* functions from various targets, including the dummy target. I think this is a decent understandability improvement. One issue I see with this patch is that the new calls in "run" and "attach" are not very much like the rest of the target API. I think fundamentally this is due to bad factoring in the target API, which may need to be fixed for multi-target. Tackling that seemed ambitious for a regression fix. While working on this I noticed that there don't seem to be any test cases that involve both target-async and record, so this patch changes break-precsave.exp to add some. It also changes corefile.exp to add some target-async tests; these pass with current trunk and with this patch applied, but fail with the v1 patch. This patch differs from v4 in that it moves initialization of to_can_async_p and to_supports_non_stop into inf-child, adds some assertions to complete_target_initialization, and adds some comments to target.h. Built and regtested on x86-64 Fedora 20. 2014-03-12 Tom Tromey <tromey@redhat.com> * inf-child.c (return_zero): New function. (inf_child_target): Set to_can_async_p, to_supports_non_stop. * aix-thread.c (aix_thread_inferior_created): New function. (aix_thread_attach): Remove. (init_aix_thread_ops): Don't set to_attach. (_initialize_aix_thread): Register inferior_created observer. * corelow.c (init_core_ops): Don't set to_attach or to_create_inferior. * exec.c (init_exec_ops): Don't set to_attach or to_create_inferior. * infcmd.c (run_command_1): Use find_run_target. Make direct target calls. (attach_command): Use find_attach_target. Make direct target calls. * record-btrace.c (init_record_btrace_ops): Don't set to_create_inferior. * record-full.c (record_full_can_async_p, record_full_is_async_p): Remove. (init_record_full_ops, init_record_full_core_ops): Update. Don't set to_create_inferior. * target.c (complete_target_initialization): Add assertion. (target_create_inferior): Remove. (find_default_attach, find_default_create_inferior): Remove. (find_attach_target, find_run_target): New functions. (find_default_is_async_p, find_default_can_async_p) (target_supports_non_stop, target_attach): Remove. (init_dummy_target): Don't set to_create_inferior or to_supports_non_stop. * target.h (struct target_ops) <to_attach>: Add comment. Remove TARGET_DEFAULT_FUNC. <to_create_inferior>: Add comment. <to_can_async_p, to_is_async_p, to_supports_non_stop>: Use TARGET_DEFAULT_RETURN. <to_can_async_p, to_supports_non_stop, to_can_run>: Add comments. (find_attach_target, find_run_target): Declare. (target_create_inferior): Remove. (target_has_execution_1): Update comment. (target_supports_non_stop): Remove. * target-delegates.c: Rebuild. 2014-03-12 Tom Tromey <tromey@redhat.com> * gdb.base/corefile.exp (corefile_test_run, corefile_test_attach): New procs. Add target-async tests. * gdb.reverse/break-precsave.exp (precsave_tests): New proc. Add target-async tests.
2014-02-28 17:47:34 +01:00
2014-03-12 Tom Tromey <tromey@redhat.com>
* inf-child.c (return_zero): New function.
(inf_child_target): Set to_can_async_p, to_supports_non_stop.
* aix-thread.c (aix_thread_inferior_created): New function.
(aix_thread_attach): Remove.
(init_aix_thread_ops): Don't set to_attach.
(_initialize_aix_thread): Register inferior_created observer.
* corelow.c (init_core_ops): Don't set to_attach or
to_create_inferior.
* exec.c (init_exec_ops): Don't set to_attach or
to_create_inferior.
* infcmd.c (run_command_1): Use find_run_target. Make direct
target calls.
(attach_command): Use find_attach_target. Make direct target
calls.
* record-btrace.c (init_record_btrace_ops): Don't set
to_create_inferior.
* record-full.c (record_full_can_async_p, record_full_is_async_p):
Remove.
(init_record_full_ops, init_record_full_core_ops): Update. Don't
set to_create_inferior.
* target.c (complete_target_initialization): Add assertion.
(target_create_inferior): Remove.
(find_default_attach, find_default_create_inferior): Remove.
(find_attach_target, find_run_target): New functions.
(find_default_is_async_p, find_default_can_async_p)
(target_supports_non_stop, target_attach): Remove.
(init_dummy_target): Don't set to_create_inferior or
to_supports_non_stop.
* target.h (struct target_ops) <to_attach>: Add comment. Remove
TARGET_DEFAULT_FUNC.
<to_create_inferior>: Add comment.
<to_can_async_p, to_is_async_p, to_supports_non_stop>: Use
TARGET_DEFAULT_RETURN.
<to_can_async_p, to_supports_non_stop, to_can_run>: Add comments.
(find_attach_target, find_run_target): Declare.
(target_create_inferior): Remove.
(target_has_execution_1): Update comment.
(target_supports_non_stop): Remove.
* target-delegates.c: Rebuild.
2014-03-12 Pedro Alves <palves@redhat.com>
* inf-child.h: Update comment to not mention Unix.
2014-03-12 Pedro Alves <palves@redhat.com>
* inf-child.c: Update top comment to not mention Unix. Add
generic comment describing how this target is meant to be used.
(inf_child_post_attach, inf_child_post_startup_inferior)
(inf_child_follow_fork, inf_child_pid_to_exec_file): Don't mention
Unix in comment.
2014-03-12 Pedro Alves <palves@redhat.com>
* nto-procfs.c: Include inf-child.h.
(procfs_ops): Delete global.
(procfs_can_run): Delete method.
(procfs_detach, procfs_mourn_inferior): Unpush the passed in
target pointer instead of referencing procfs_ops.
(procfs_prepare_to_store): Delete.
(init_procfs_ops): Delete function.
(procfs_target): New function, based on init_procfs_ops, but
inherit inf_child_target.
(_initialize_procfs): Use procfs_target.
2014-03-12 Pedro Alves <palves@redhat.com>
* windows-nat.c: Include inf-child.h.
(windows_ops): Delete global.
(windows_open, windows_prepare_to_store, windows_can_run): Delete
methods.
(init_windows_ops): Delete function.
(windows_target): New function, based on init_windows_ops, but
inherit inf_child_target.
(_initialize_windows_nat): Use windows_target. Install x86
specific target methods here.
2014-03-10 Doug Evans <xdje42@gmail.com>
* guile/guile.c (call_initialize_gdb_module): New function.
(initialize_guile): Replace call to scm_init_guile with call to
scm_with_guile.
2014-03-10 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_evaluate_subexp): Add missing space before '('
in call to TYPE_CODE macro.
2014-03-10 Jerome Guitton <guitton@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <UNOP_IND, STRUCTOP_STRUCT>:
Resolve tagged types to full view.
2014-03-10 Hui Zhu <hui@codesourcery.com>
* target.h (target_insert_breakpoint): Remove "hardware" from its
comments.
2014-03-07 Doug Evans <dje@google.com>
* dwarf2read.c (read_str_index): Rename local dwo_name to objf_name.
2014-03-07 Doug Evans <dje@google.com>
* dwarf2read.c (read_cutu_die_from_dwo): Fix function comment.
Remove unused local comp_dir_attr. Assert exactly one of
stub_comp_unit_die, stub_comp_dir is non-NULL.
2014-03-07 Joel Brobecker <brobecker@adacore.com>
* target.h (complete_target_initialization, add_target):
Add comment.
2014-03-07 Pedro Alves <palves@redhat.com>
* go32-nat.c: Include inf-child.h.
(go32_ops): Delete global.
(go32_close, go32_detach, go32_prepare_to_store, go32_can_run):
Delete methods.
(go32_create_inferior): Push the passed in target pointer instead
of referencing go32_ops.
(init_go32_ops): Delete function. Moved parts to _initialize_go32_nat.
(go32_target): New function, based on init_go32_ops, but inherit
inf_child_target.
(_initialize_go32_nat): Use go32_target. Move parts of
init_go32_ops here.
2014-03-06 Joel Brobecker <brobecker@adacore.com>
* sol-thread.c: #include "symtab.h", "minsym.h" and "objfiles.h".
(ps_pglobal_lookup): Use BMSYMBOL_VALUE_ADDRESS instead of
SYMBOL_VALUE_ADDRESS.
(info_cb): MSYMBOL_PRINT_NAME instead of SYMBOL_PRINT_NAME.
2014-03-06 Yao Qi <yao@codesourcery.com>
* breakpoint.c (get_tracepoint_by_number): Remove argument
optional_p. All callers updated. Adjust comments. Update
output message.
* breakpoint.h (get_tracepoint_by_number): Update declaration.
2014-03-06 Yao Qi <yao@codesourcery.com>
* reverse.c (goto_bookmark_command): Add local 'p'. Emit error
early if get_number returns zero. Use 'p' instead of 'args'.
2014-03-06 Yao Qi <yao@codesourcery.com>
* cli/cli-utils.c (get_number_trailer): Add '\n' at the end of
message.
2014-03-06 Yao Qi <yao@codesourcery.com>
PR breakpoints/16508
* tracepoint.c (check_trace_running): New function.
(trace_find_command): Move code to check_trace_running and
call check_trace_running.
(trace_find_pc_command): Likewise.
(trace_find_tracepoint_command): Likewise.
(trace_find_line_command): Likewise.
(trace_find_range_command): Likewise.
* tracepoint.h (check_trace_running): Likewise.
* mi/mi-main.c (mi_cmd_trace_find): Call check_trace_running.
2014-03-06 Yao Qi <yao@codesourcery.com>
* target.h (struct target_ops) <to_traceframe_info>: Use
TARGET_DEFAULT_NORETURN (tcomplain ()).
* target-delegates.c: Regenerated.
PR gdb/16575: stale breakpoint instructions in the code cache In non-stop mode, or rather, breakpoints always-inserted mode, the code cache can easily end up with stale breakpoint instructions: All it takes is filling a cache line when breakpoints already exist in that memory region, and then delete the breakpoint. Vis. (from the new test): (gdb) set breakpoint always-inserted on (gdb) b 23 Breakpoint 2 at 0x400540: file ../../../src/gdb/testsuite/gdb.base/breakpoint-shadow.c, line 23. (gdb) b 24 Breakpoint 3 at 0x400547: file ../../../src/gdb/testsuite/gdb.base/breakpoint-shadow.c, line 24. disass main Dump of assembler code for function main: 0x000000000040053c <+0>: push %rbp 0x000000000040053d <+1>: mov %rsp,%rbp => 0x0000000000400540 <+4>: movl $0x1,-0x4(%rbp) 0x0000000000400547 <+11>: movl $0x2,-0x4(%rbp) 0x000000000040054e <+18>: mov $0x0,%eax 0x0000000000400553 <+23>: pop %rbp 0x0000000000400554 <+24>: retq End of assembler dump. So far so good. Now flush the code cache: (gdb) set code-cache off (gdb) set code-cache on Requesting a disassembly works as expected, breakpoint shadowing is applied: (gdb) disass main Dump of assembler code for function main: 0x000000000040053c <+0>: push %rbp 0x000000000040053d <+1>: mov %rsp,%rbp => 0x0000000000400540 <+4>: movl $0x1,-0x4(%rbp) 0x0000000000400547 <+11>: movl $0x2,-0x4(%rbp) 0x000000000040054e <+18>: mov $0x0,%eax 0x0000000000400553 <+23>: pop %rbp 0x0000000000400554 <+24>: retq End of assembler dump. However, now delete the breakpoints: (gdb) delete Delete all breakpoints? (y or n) y And disassembly shows the old breakpoint instructions: (gdb) disass main Dump of assembler code for function main: 0x000000000040053c <+0>: push %rbp 0x000000000040053d <+1>: mov %rsp,%rbp => 0x0000000000400540 <+4>: int3 0x0000000000400541 <+5>: rex.RB cld 0x0000000000400543 <+7>: add %eax,(%rax) 0x0000000000400545 <+9>: add %al,(%rax) 0x0000000000400547 <+11>: int3 0x0000000000400548 <+12>: rex.RB cld 0x000000000040054a <+14>: add (%rax),%al 0x000000000040054c <+16>: add %al,(%rax) 0x000000000040054e <+18>: mov $0x0,%eax 0x0000000000400553 <+23>: pop %rbp 0x0000000000400554 <+24>: retq End of assembler dump. Those breakpoint instructions are no longer installed in target memory they're stale in the code cache. Easily confirmed by just disabling the code cache: (gdb) set code-cache off (gdb) disass main Dump of assembler code for function main: 0x000000000040053c <+0>: push %rbp 0x000000000040053d <+1>: mov %rsp,%rbp => 0x0000000000400540 <+4>: movl $0x1,-0x4(%rbp) 0x0000000000400547 <+11>: movl $0x2,-0x4(%rbp) 0x000000000040054e <+18>: mov $0x0,%eax 0x0000000000400553 <+23>: pop %rbp 0x0000000000400554 <+24>: retq End of assembler dump. I stumbled upon this when writing a patch to infrun.c, that made handle_inferior_event & co fill in the cache before breakpoints were removed from the target. Recall that wait_for_inferior flushes the dcache for every event. So in that case, always-inserted mode was not necessary to trigger this. It's just a convenient way to expose the issue. The dcache works at the raw memory level. We need to update it whenever memory is written, no matter what kind of target memory object was originally passed down by the caller. The issue is that the dcache update code isn't reached when a caller explicitly writes raw memory. Breakpoint insertion/removal is one such case -- mem-break.c uses target_write_read_memory/target_write_raw_memory. The fix is to move the dcache update code from memory_xfer_partial_1 to raw_memory_xfer_partial so that it's always reachable. When we do that, we can actually simplify a series of things. memory_xfer_partial_1 no longer needs to handle writes for any kind of memory object, and therefore dcache_xfer_memory no longer needs to handle writes either. So the latter (dcache_xfer_memory) and its callees can be simplified to only care about reads. While we're touching dcache_xfer_memory's prototype, might as well rename it to reflect that fact that it only handles reads, and make it follow the new target_xfer_status/xfered_len style. This made me notice that dcache_xfer_memory loses the real error status if a memory read fails: we could have failed to read due to TARGET_XFER_E_UNAVAILABLE, for instance, but we always return TARGET_XFER_E_IO, hence the FIXME note. I felt that fixing that fell out of the scope of this patch. Currently dcache_xfer_memory handles the case of a write failing. The whole cache line is invalidated when that happens. However, dcache_update, the sole mechanism for handling writes that will remain after the patch, does not presently handle that scenario. That's a bug. The patch makes it handle that, by passing down the target_xfer_status status from the caller, so that it can better decide what to do itself. While I was changing the function's prototype, I constified the myaddr parameter, getting rid of the need for the cast as seen in its existing caller. Tested on x86_64 Fedora 17, native and gdbserver. gdb/ 2014-03-05 Pedro Alves <palves@redhat.com> PR gdb/16575 * dcache.c (dcache_poke_byte): Constify ptr parameter. Return void. Update comment. (dcache_xfer_memory): Delete. (dcache_read_memory_partial): New, based on the read bits of dcache_xfer_memory. (dcache_update): Add status parameter. Use ULONGEST for len, and adjust. Discard cache lines if the reason for the update was error. * dcache.h (dcache_xfer_memory): Delete declaration. (dcache_read_memory_partial): New declaration. (dcache_update): Update prototype. * target.c (raw_memory_xfer_partial): Update the dcache here. (memory_xfer_partial_1): Don't handle dcache writes here. gdb/testsuite/ 2014-03-05 Pedro Alves <palves@redhat.com> PR gdb/16575 * gdb.base/breakpoint-shadow.exp (compare_disassembly): New procedure. (top level): Adjust to use it. Add tests that exercise breakpoint interaction with the code-cache.
2014-03-05 15:18:28 +01:00
2014-03-05 Pedro Alves <palves@redhat.com>
PR gdb/16575
* dcache.c (dcache_poke_byte): Constify ptr parameter. Return
void. Update comment.
(dcache_xfer_memory): Delete.
(dcache_read_memory_partial): New, based on the read bits of
dcache_xfer_memory.
(dcache_update): Add status parameter. Use ULONGEST for len, and
adjust. Discard cache lines if the reason for the update was
error.
* dcache.h (dcache_xfer_memory): Delete declaration.
(dcache_read_memory_partial): New declaration.
(dcache_update): Update prototype.
* target.c (raw_memory_xfer_partial): Update the dcache here.
(memory_xfer_partial_1): Don't handle dcache writes here.
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* remote-sim.c (gdbsim_load): Add const to prog.
2014-03-03 Tom Tromey <tromey@redhat.com>
* elfread.c (probe_key): Change to bfd_data.
(elf_get_probes, probe_key_free, _initialize_elfread): Probes are
now per-BFD, not per-objfile.
* stap-probe.c (stap_probe_destroy): Update comment.
(handle_stap_probe): Allocate on the per-BFD obstack.
change probes to be program-space-independent This changes the probes to be independent of the program space. After this, when a probe's address is needed, it is determined by applying offsets at the point of use. This introduces a bound_probe object, similar to bound minimal symbols. Objects of this type are used when it's necessary to pass a probe and its corresponding objfile. This removes the backlink from probe to objfile, which was primarily used to fetch the architecture to use. This adds a get_probe_address function which calls a probe method to compute the probe's relocated address. Similarly, it adds an objfile parameter to the semaphore methods so they can do the relocation properly as well. 2014-03-03 Tom Tromey <tromey@redhat.com> * break-catch-throw.c (fetch_probe_arguments): Use bound probes. * breakpoint.c (create_longjmp_master_breakpoint): Use get_probe_address. (add_location_to_breakpoint, bkpt_probe_insert_location) (bkpt_probe_remove_location): Update. * breakpoint.h (struct bp_location) <probe>: Now a bound_probe. * elfread.c (elf_symfile_relocate_probe): Remove. (elf_probe_fns): Update. (insert_exception_resume_breakpoint): Change type of "probe" parameter to bound_probe. (check_exception_resume): Update. * objfiles.c (objfile_relocate1): Don't relocate probes. * probe.c (bound_probe_s): New typedef. (parse_probes): Use get_probe_address. Set sal's objfile. (find_probe_by_pc): Return a bound_probe. (collect_probes): Return a VEC(bound_probe_s). (compare_probes): Update. (gen_ui_out_table_header_info): Change type of "probes" parameter. Update. (info_probes_for_ops): Update. (get_probe_address): New function. (probe_safe_evaluate_at_pc): Update. * probe.h (struct probe_ops) <get_probe_address>: New field. <set_semaphore, clear_semaphore>: Add objfile parameter. (struct probe) <objfile>: Remove field. <arch>: New field. <address>: Update comment. (struct bound_probe): New. (find_probe_by_pc): Return a bound_probe. (get_probe_address): Declare. * solib-svr4.c (struct probe_and_action) <address>: New field. (hash_probe_and_action, equal_probe_and_action): Update. (register_solib_event_probe): Add address parameter. (solib_event_probe_at): Update. (svr4_create_probe_breakpoints): Add objfile parameter. Use get_probe_address. * stap-probe.c (struct stap_probe) <sem_addr>: Update comment. (stap_get_probe_address): New function. (stap_can_evaluate_probe_arguments, compute_probe_arg) (compile_probe_arg): Update. (stap_set_semaphore, stap_clear_semaphore): Compute semaphore's address. (handle_stap_probe): Don't relocate the probe. (stap_relocate): Remove. (stap_gen_info_probes_table_values): Update. (stap_probe_ops): Remove stap_relocate. * symfile-debug.c (debug_sym_relocate_probe): Remove. (debug_sym_probe_fns): Update. * symfile.h (struct sym_probe_fns) <sym_relocate_probe>: Remove. * symtab.c (init_sal): Use memset. * symtab.h (struct symtab_and_line) <objfile>: New field. * tracepoint.c (start_tracing, stop_tracing): Update.
2013-12-02 21:58:59 +01:00
2014-03-03 Tom Tromey <tromey@redhat.com>
* break-catch-throw.c (fetch_probe_arguments): Use bound probes.
* breakpoint.c (create_longjmp_master_breakpoint): Use
get_probe_address.
(add_location_to_breakpoint, bkpt_probe_insert_location)
(bkpt_probe_remove_location): Update.
* breakpoint.h (struct bp_location) <probe>: Now a bound_probe.
* elfread.c (elf_symfile_relocate_probe): Remove.
(elf_probe_fns): Update.
(insert_exception_resume_breakpoint): Change type of "probe"
parameter to bound_probe.
(check_exception_resume): Update.
* objfiles.c (objfile_relocate1): Don't relocate probes.
* probe.c (bound_probe_s): New typedef.
(parse_probes): Use get_probe_address. Set sal's objfile.
(find_probe_by_pc): Return a bound_probe.
(collect_probes): Return a VEC(bound_probe_s).
(compare_probes): Update.
(gen_ui_out_table_header_info): Change type of "probes"
parameter. Update.
(info_probes_for_ops): Update.
(get_probe_address): New function.
(probe_safe_evaluate_at_pc): Update.
* probe.h (struct probe_ops) <get_probe_address>: New field.
<set_semaphore, clear_semaphore>: Add objfile parameter.
(struct probe) <objfile>: Remove field.
<arch>: New field.
<address>: Update comment.
(struct bound_probe): New.
(find_probe_by_pc): Return a bound_probe.
(get_probe_address): Declare.
* solib-svr4.c (struct probe_and_action) <address>: New field.
(hash_probe_and_action, equal_probe_and_action): Update.
(register_solib_event_probe): Add address parameter.
(solib_event_probe_at): Update.
(svr4_create_probe_breakpoints): Add objfile parameter. Use
get_probe_address.
* stap-probe.c (struct stap_probe) <sem_addr>: Update comment.
(stap_get_probe_address): New function.
(stap_can_evaluate_probe_arguments, compute_probe_arg)
(compile_probe_arg): Update.
(stap_set_semaphore, stap_clear_semaphore): Compute semaphore's
address.
(handle_stap_probe): Don't relocate the probe.
(stap_relocate): Remove.
(stap_gen_info_probes_table_values): Update.
(stap_probe_ops): Remove stap_relocate.
* symfile-debug.c (debug_sym_relocate_probe): Remove.
(debug_sym_probe_fns): Update.
* symfile.h (struct sym_probe_fns) <sym_relocate_probe>: Remove.
* symtab.c (init_sal): Use memset.
* symtab.h (struct symtab_and_line) <objfile>: New field.
* tracepoint.c (start_tracing, stop_tracing): Update.
2014-03-03 Tom Tromey <tromey@redhat.com>
* probe.h (parse_probes, find_probe_by_pc)
(find_probes_in_objfile): Fix comments.
2014-03-02 Doug Evans <xdje42@gmail.com>
* infrun.c (handle_signal_stop): Replace test for
TARGET_WAITKIND_STOPPED with an assert.
2014-03-02 Doug Evans <xdje42@gmail.com>
* guile/scm-objfile.c (ofscm_mark_objfile_smob): Fix typo in comment.
2014-03-02 Doug Evans <xdje42@gmail.com>
* guile/lib/gdb/printing.scm (append-pretty-printer!): Fix thinko.
2014-03-01 Mark Kettenis <kettenis@gnu.org>
* obsd-nat.c: Include "gdb_wait.h" instead of <sys/wait.h>.
2014-03-01 Mark Kettenis <kettenis@gnu.org>
* i386obsd-nat.c: Include "obsd-nat.h".
(_initialize_i386obsd_nat): Call obsd_add_target instead of
add_target.
* config/i386/obsd.mh (NATDEPFILES): Add obsd-nat.o.
2014-03-01 Mark Kettenis <kettenis@gnu.org>
* i386obsd-nat.c (i386obsd_supply_pcb): Cast 'sf' to 'gdb_byte *'.
2014-03-01 Mark Kettenis <kettenis@gnu.org>
* mips64obsd-nat.c: Include "obsd-nath".
(_initialize_mips64obsd_nat): Call obsd_add_target instead of
add_target
* config/mips/obsd64.mh (NATDEPFILES): Add obsd-nat.o.
2014-03-01 Mark Kettenis <kettenis@gnu.org>
2014-03-01 12:03:30 +01:00
* amd64obsd-nat.c: Include "obsd-nat,h.
(_initialize_amd64obsd_nat): Call obsd_add_target instead of
add_target.
* config/i386/obsd64.mh (NATDEPFILES): Add obsd-nat.o.
2014-02-28 Siva Chandra Reddy <sivachandra@google.com>
* valops.c (find_oload_champ): Remove unneccesary argument METHOD.
(find_overload_match): Update call to find_oload_champ.
(find_oload_champ_namespace_loop): Likewise
2014-02-28 Mark Kettenis <kettenis@gnu.org>
* Makefile.in (ALLDEPFILES): Add sparc64obsd-nat.c.
* configure.host (sparc64-*-openbsd*): Set gdb_host to obsd64.
* config/sparc/obsd64.mh: New file.
* sparc64obsd-nat.c: New file.
* obsd-nat.h: New file.
* obsd-nat.c: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add obsd-nat.h.
(ALLDEPFILES): Add obsd-nat.c.
2014-02-28 Tom Tromey <tromey@redhat.com>
* cli-out.c (cli_ui_out_impl): Now const. Remove comment.
* cli-out.h (cli_ui_out_impl): Now const.
* mi/mi-out.c (mi_ui_out_impl): Now const. Remove comment.
* ui-out.c (struct ui_out) <impl>: Now const.
(default_ui_out_impl): Now const.
(ui_out_new): Make 'impl' parameter const.
* ui-out.h (ui_out_new): Update.
2014-02-27 Mark Kettenis <kettenis@gnu.org>
* solib-svr4.c (svr4_read_so_list): Initialize first_l_name to 0.
2014-02-27 Mark Kettenis <kettenis@gnu.org>
* sparc-nat.c (sparc_xfer_wcookie): Always use process ID.
Additional PR 8882 fix. runtest gdb.base/corefile.exp ==23174== ERROR: AddressSanitizer: heap-use-after-free on address 0x604400008c88 at pc 0x68f0be bp 0x7fffae9d7490 sp 0x7fffae9d7480 READ of size 8 at 0x604400008c88 thread T0 #0 0x68f0bd in svr4_read_so_list (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x68f0bd) #1 0x68f64e in svr4_current_sos_direct (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x68f64e) #2 0x68f757 in svr4_current_sos (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x68f757) #3 0xcebbff in update_solib_list (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0xcebbff) 0x604400008c88 is located 8 bytes inside of 1104-byte region [0x604400008c80,0x6044000090d0) freed by thread T0 here: #0 0x7f52677500f9 (/lib64/libasan.so.0+0x160f9) #1 0xd2c68a in xfree (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0xd2c68a) #2 0xceb364 in free_so (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0xceb364) #3 0xca59f8 in do_free_so (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0xca59f8) #4 0x93432a in do_my_cleanups (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x93432a) #5 0x934406 in do_cleanups (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x934406) #6 0x68efa9 in svr4_read_so_list (/home/jkratoch/redhat/gdb-clean/gdb/gdb+0x68efa9) I did not notice it during my review in: Re: [PATCH v2] Skip vDSO when reading SO list (PR 8882) https://sourceware.org/ml/gdb-patches/2013-09/msg00888.html gdb/ 2014-02-27 Jan Kratochvil <jan.kratochvil@redhat.com> Additional PR 8882 fix. * solib-svr4.c (svr4_read_so_list): Change first to first_l_name. Message-ID: <20140226220918.GA10431@host2.jankratochvil.net>
2014-02-27 21:16:04 +01:00
2014-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
Additional PR 8882 fix.
* solib-svr4.c (svr4_read_so_list): Change first to first_l_name.
2014-02-27 Pedro Alves <palves@redhat.com>
* nat/linux-waitpid.c (my_waitpid): Only block signals if WNOHANG
isn't set.
2014-02-27 Pedro Alves <palves@redhat.com>
PR 12702
* linux-nat.c (status_to_str): Moved to nat/linux-waitpid.c.
* nat/linux-waitpid.c: Include string.h.
(status_to_str): Moved here and made extern.
* nat/linux-waitpid.h (status_to_str): New declaration.
2014-02-27 Hui Zhu <hui@codesourcery.com>
PR 12702
* infrun.c (ptid_match): Move ...
* common/ptid.c (ptid_match): ... here.
* inferior.h (ptid_match): Move ...
* common/ptid.h (ptid_match): ... here.
2014-02-27 Mark Kettenis <kettenis@gnu.org>
* mips64obsd-tdep.c (mips64obsd_init_abi): Call obsd_init_abi.
* configure.tgt (mips64*-*-openbsd*): Add obsd-tdep.c to
gdb_target_obs.
2014-02-27 Mark Kettenis <kettenis@gnu.org>
* obsd-tdep.c (obsd_auxv_parse): New function.
(obsd_init_abi): Set auxv_parse.
* gdbarch.sh (auxv_parse): New.
* gdbarch.h: Regenerated.
* gdbarch.c: Regenerated.
* auxv.c (target_auxv_parse): Call gdbarch_parse_auxv if provided.
2014-02-26 Ludovic Courtès <ludo@gnu.org>
* guile/scm-value.c (gdbscm_history_append_x): New function.
(value_functions): Add it.
DWARF: Read constant-class addresses correctly Starting with DWARF version 4, the description of the DW_AT_high_pc attribute was amended to say: if it is of class constant, the value is an unsigned integer offset which when added to the low PC gives the address of the first location past the last instruction associated with the entity. A change was made in Apr 27th, 2012 to reflect that change: | commit 91da14142c0171e58a91ad58a32fd010b700e761 | Author: Mark Wielaard <mjw@redhat.com> | Date: Fri Apr 27 18:55:19 2012 +0000 | | * dwarf2read.c (dwarf2_get_pc_bounds): Check DW_AT_high_pc form to | see whether it is an address or a constant offset from DW_AT_low_pc. | (dwarf2_record_block_ranges): Likewise. | (read_partial_die): Likewise. Unfortunately, this new interpretation is now used regardless of the CU's DWARF version. It turns out that one of WindRiver's compilers (FTR: Diabdata 4.4) is generating DWARF version 2 info with DW_AT_high_pc attributes improperly using the data4 form. Because of that, we miscompute all high PCs incorrectly. This leads to a lot of symtabs having overlapping ranges, which in turn causes havoc in pc-to-symtab-and-line translations. One visible effect is when inserting a breakpoint on a given function: (gdb) b world Breakpoint 1 at 0x4005c4 The source location of the breakpoint is missing. The output should be: (gdb) b world Breakpoint 1 at 0x4005c8: file dw2-rel-hi-pc-world.c, line 24. What happens in this case is that the pc-to-SAL translation first starts be trying to find the symtab associated to our PC using each symtab's ranges. Because of the high_pc miscomputation, many symtabs end up matching, and the heuristic trying to select the most probable one unfortunately returns one that is unrelated (it really had no change in this case to do any better). Once we have the wrong symtab, the start searching the associated linetable, where the addresses are correct, thus finding no match, and therefore no SAL. This patch is an attempt at handling the situation as gracefully as we can, without guarantees. It introduces a new function "attr_value_as_address" which uses the correct accessor for getting the value of a given attribute. It then adjust the code throughout this unit to use this function instead of assuming that addresses always have the DW_FORM_addr format. It also fixes the original issue of miscomputing the high_pc by limiting the new interpretation of constant form DW_AT_high_pc attributes to units using DWARF version 4 or later. gdb/ChangeLog: * dwarf2read.c (attr_value_as_address): New function. (dwarf2_find_base_address, read_call_site_scope): Use attr_value_as_address in place of DW_ADDR. (dwarf2_get_pc_bounds): Use attr_value_as_address to get the low and high addresses. Slight rework of the handling of the high pc being a constant form, and limit it to DWARF verson 4 or higher. (dwarf2_record_block_ranges): Likewise. (read_partial_die): Likewise. (new_symbol_full): Use attr_value_as_address in place of DW_ADDR. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S: New file. * gdb.dwarf2/dw2-abs-hi-pc-hello.c: New file. * gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S: New file. * gdb.dwarf2/dw2-abs-hi-pc-world.c: New file. * gdb.dwarf2/dw2-abs-hi-pc.c: New file. * gdb.dwarf2/dw2-abs-hi-pc.exp: New file. Tested on x86_64-linux.
2014-02-15 16:09:58 +01:00
2014-02-27 Joel Brobecker <brobecker@adacore.com>
* dwarf2read.c (attr_value_as_address): New function.
(dwarf2_find_base_address, read_call_site_scope): Use
attr_value_as_address in place of DW_ADDR.
(dwarf2_get_pc_bounds): Use attr_value_as_address to get
the low and high addresses. Slight rework of the handling
of the high pc being a constant form, and limit it to
DWARF verson 4 or higher.
(dwarf2_record_block_ranges): Likewise.
(read_partial_die): Likewise.
(new_symbol_full): Use attr_value_as_address in place of DW_ADDR.
2014-02-26 Tom Tromey <tromey@redhat.com>
* exec.c (exec_file_attach): Hold a reference to exec_bfd.
2014-02-26 Tom Tromey <tromey@redhat.com>
* elfread.c (elf_read_minimal_symbols): Return early if
minimal symbols have already been read. Add "ei" parameter.
(elf_symfile_read): Call elf_read_minimal_symbols earlier.
* minsyms.c (prim_record_minimal_symbol_full): Update.
* objfiles.h (struct objstats) <n_minsyms>: Move...
(struct objfile_per_bfd_storage) <n_minsyms>: ... here.
* symmisc.c (print_objfile_statistics): Update.
2014-02-26 Tom Tromey <tromey@redhat.com>
* elfread.c (elf_read_minimal_symbols): New function, from
elf_symfile_read.
(elf_symfile_read): Call it.
move minimal symbols to per-bfd Now that minimal symbols are independent of the program space, we can move them to the per-BFD object. This lets us save memory in the multi-inferior case; and, once the symbol readers are updated, time. The other prerequisite for this move is that all the objects referred to by the minimal symbols have a lifetime at least as long as the per-BFD object. I think this is satisfied partially by this patch (moving the copied names there) and partially by earlier patches moving the demangled name hash. This patch contains a bit of logic to avoid creating new minimal symbols if they have already been read for a given BFD. This allows us to avoid trying to update all the symbol readers for this condition. At first glance this may seem like a hack, but some symbol readers mix psym and minsym reading, and would require logic just like this regardless -- and it is simpler and less error-prone to just do the work in a central spot. 2014-02-26 Tom Tromey <tromey@redhat.com> * minsyms.c (lookup_minimal_symbol, iterate_over_minimal_symbols) (lookup_minimal_symbol_text, lookup_minimal_symbol_by_pc_name) (lookup_minimal_symbol_solib_trampoline) (lookup_minimal_symbol_by_pc_section_1) (lookup_minimal_symbol_and_objfile): Update. (prim_record_minimal_symbol_full): Use the per-BFD obstack. Don't allocate a minimal symbol if minsyms have already been read. (build_minimal_symbol_hash_tables): Update. (install_minimal_symbols): Do nothing if minsyms already read. Use the per-BFD obstack. (terminate_minimal_symbol_table): Use the per-BFD obstack. * objfiles.c (allocate_objfile): Call terminate_minimal_symbol_table later. (have_minimal_symbols): Update. * objfiles.h (struct objfile_per_bfd_storage) <msymbols, minimal_symbol_count, msymbol_hash, msymbol_demangled_hash>: Move from struct objfile. <minsyms_read>: New field. (struct objfile) <msymbols, minimal_symbol_count, msymbol_hash, msymbol_demangled_hash>: Move. (ALL_OBJFILE_MSYMBOLS): Update. * symfile.c (read_symbols): Set minsyms_read. (reread_symbols): Update. * symmisc.c (dump_objfile, dump_msymbols): Update.
2013-10-15 19:37:19 +02:00
2014-02-26 Tom Tromey <tromey@redhat.com>
* minsyms.c (lookup_minimal_symbol, iterate_over_minimal_symbols)
(lookup_minimal_symbol_text, lookup_minimal_symbol_by_pc_name)
(lookup_minimal_symbol_solib_trampoline)
(lookup_minimal_symbol_by_pc_section_1)
(lookup_minimal_symbol_and_objfile): Update.
(prim_record_minimal_symbol_full): Use the per-BFD obstack.
Don't allocate a minimal symbol if minsyms have already been read.
(build_minimal_symbol_hash_tables): Update.
(install_minimal_symbols): Do nothing if minsyms already read.
Use the per-BFD obstack.
(terminate_minimal_symbol_table): Use the per-BFD obstack.
* objfiles.c (allocate_objfile): Call
terminate_minimal_symbol_table later.
(have_minimal_symbols): Update.
* objfiles.h (struct objfile_per_bfd_storage) <msymbols,
minimal_symbol_count, msymbol_hash, msymbol_demangled_hash>:
Move from struct objfile.
<minsyms_read>: New field.
(struct objfile) <msymbols, minimal_symbol_count,
msymbol_hash, msymbol_demangled_hash>: Move.
(ALL_OBJFILE_MSYMBOLS): Update.
* symfile.c (read_symbols): Set minsyms_read.
(reread_symbols): Update.
* symmisc.c (dump_objfile, dump_msymbols): Update.
change minsyms not to be relocated at read-time This removes the runtime offsets from minsyms. Instead, these offsets will now be applied whenever the minsym's address is computed. This patch redefines MSYMBOL_VALUE_ADDRESS to actually use the offsets from the given objfile. Then, it updates all the symbol readers, changing them so that they do not add in the section offset when creating the symbol. This change also lets us remove relocation of minsyms from objfile_relocate1 and also msymbols_sort. 2014-02-26 Tom Tromey <tromey@redhat.com> * minsyms.c (msymbols_sort): Remove. * minsyms.h (msymbols_sort): Remove. * objfiles.c (objfile_relocate1): Don't relocate minsyms. * symtab.h (MSYMBOL_VALUE_ADDRESS): Use objfile offsets. * elfread.c (elf_symtab_read): Don't add section offsets. * xcoffread.c (record_minimal_symbol): Don't add section offset to minimal symbol address. * somread.c (text_offset, data_offset): Remove. (som_symtab_read): Don't add section offsets to minimal symbol addresses. * coff-pe-read.c (add_pe_forwarded_sym, read_pe_exported_syms): Don't add section offsets to minimal symbols. * coffread.c (coff_symtab_read): Don't add section offsets to minimal symbol addresses. * machoread.c (macho_symtab_add_minsym): Don't add section offset to minimal symbol addresses. * mipsread.c (read_alphacoff_dynamic_symtab): Don't add section offset to minimal symbol addresses. * mdebugread.c (parse_partial_symbols): Don't add section offset to minimal symbol addresses. * dbxread.c (read_dbx_dynamic_symtab): Don't add section offset to minimal symbol addresses.
2013-10-15 21:28:57 +02:00
2014-02-26 Tom Tromey <tromey@redhat.com>
* minsyms.c (msymbols_sort): Remove.
* minsyms.h (msymbols_sort): Remove.
* objfiles.c (objfile_relocate1): Don't relocate minsyms.
* symtab.h (MSYMBOL_VALUE_ADDRESS): Use objfile offsets.
* elfread.c (elf_symtab_read): Don't add section offsets.
* xcoffread.c (record_minimal_symbol): Don't add section offset
to minimal symbol address.
* somread.c (text_offset, data_offset): Remove.
(som_symtab_read): Don't add section offsets to minimal symbol
addresses.
* coff-pe-read.c (add_pe_forwarded_sym, read_pe_exported_syms):
Don't add section offsets to minimal symbols.
* coffread.c (coff_symtab_read): Don't add section offsets
to minimal symbol addresses.
* machoread.c (macho_symtab_add_minsym): Don't add section offset
to minimal symbol addresses.
* mipsread.c (read_alphacoff_dynamic_symtab): Don't add
section offset to minimal symbol addresses.
* mdebugread.c (parse_partial_symbols): Don't add section
offset to minimal symbol addresses.
* dbxread.c (read_dbx_dynamic_symtab): Don't add section
offset to minimal symbol addresses.
start change to progspace independence This patch starts changing minimal symbols to be independent of the program space. Specifically, it adds a new objfile parameter to MSYMBOL_VALUE_ADDRESS and changes all the code to use it. This is needed so we can change gdb to apply the section offset when a minsym's address is computed, as opposed to baking the offsets into the symbol itself. A few spots still need the unrelocated address. For these, we introduce MSYMBOL_VALUE_RAW_ADDRESS. As a convenience, we also add the new macro BMSYMBOL_VALUE_ADDRESS, which computes the address of a bound minimal symbol. This just does the obvious thing with the fields. Note that this change does not actually enable program space independence. That requires more changes to gdb. However, to ensure that these changes compile properly, this patch does add the needed section lookup code to MSYMBOL_VALUE_ADDRESS -- it just ensures it has no effect at runtime by multiplying the offset by 0. 2014-02-26 Tom Tromey <tromey@redhat.com> * ada-lang.c (ada_main_name): Update. (ada_add_standard_exceptions): Update. * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * arm-tdep.c (skip_prologue_function, arm_skip_stub): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * blockframe.c (get_pc_function_start) (find_pc_partial_function_gnu_ifunc): Update. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * c-valprint.c (c_val_print): Update. * coff-pe-read.c (add_pe_forwarded_sym): Update. * common/agent.c (agent_look_up_symbols): Update. * dbxread.c (find_stab_function_addr, end_psymtab): Update. * dwarf2loc.c (call_site_to_target_addr): Update. * dwarf2read.c (dw2_find_pc_sect_symtab): Update. * elfread.c (elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Update. * findvar.c (default_read_var_value): Update. * frame.c (inside_main_func): Update. * frv-tdep.c (frv_frame_this_id): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline): Update. * hppa-hpux-tdep.c (hppa64_hpux_search_dummy_call_sequence) (hppa_hpux_find_dummy_bpaddr): Update. * hppa-tdep.c (hppa_symbol_address): Update. * infcmd.c (until_next_command): Update. * jit.c (jit_read_descriptor, jit_breakpoint_re_set_internal): Update. * linespec.c (minsym_found, add_minsym): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update. * m32c-tdep.c (m32c_return_value) (m32c_m16c_address_to_pointer): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * maint.c (maintenance_translate_address): Update. * minsyms.c (lookup_minimal_symbol_by_pc_name): Update. (frob_address): New function. (lookup_minimal_symbol_by_pc_section_1): Use raw addresses, frob_address. Rename parameter to "pc_in". (compare_minimal_symbols, compact_minimal_symbols): Use raw addresses. (find_solib_trampoline_target, minimal_symbol_upper_bound): Update. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * mips-tdep.c (mips_skip_pic_trampoline_code): Update. * objc-lang.c (find_objc_msgsend): Update. * objfiles.c (objfile_relocate1): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-valprint.c (pascal_val_print): Update. * parse.c (write_exp_msymbol): Update. * ppc-linux-tdep.c (ppc_linux_spe_context_lookup) (ppc_elfv2_skip_entrypoint): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * printcmd.c (build_address_symbolic, msym_info) (address_info): Update. * proc-service.c (ps_pglobal_lookup): Update. * psymtab.c (find_pc_sect_psymtab_closer) (find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Change msymbol parameter to bound_minimal_symbol. * ravenscar-thread.c (get_running_thread_id): Update. * remote.c (remote_check_symbols): Update. * sh64-tdep.c (sh64_elf_make_msymbol_special): Use raw address. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base, main_got): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook) (link_map_start): Update. * solib-spu.c (spu_enable_break, ocl_enable_break): Update. * solib-svr4.c (elf_locate_base, enable_break): Update. * spu-tdep.c (spu_get_overlay_table, spu_catch_start) (flush_ea_cache): Update. * stabsread.c (define_symbol, scan_file_globals): Update. * stack.c (find_frame_funname): Update. * symfile-debug.c (debug_qf_expand_symtabs_matching) (debug_qf_find_pc_sect_symtab): Update. * symfile.c (simple_read_overlay_table) (simple_overlay_update): Update. * symfile.h (struct quick_symbol_functions) <find_pc_sect_symtab>: Change type of msymbol to bound_minimal_symbol. * symmisc.c (dump_msymbols): Update. * symtab.c (find_pc_sect_symtab_via_partial) (find_pc_sect_psymtab, find_pc_sect_line, skip_prologue_sal) (search_symbols, print_msymbol_info): Update. * symtab.h (MSYMBOL_VALUE_RAW_ADDRESS): New macro. (MSYMBOL_VALUE_ADDRESS): Redefine. (BMSYMBOL_VALUE_ADDRESS): New macro. * tracepoint.c (scope_info): Update. * tui/tui-disasm.c (tui_find_disassembly_address) (tui_get_begin_asm_address): Update. * valops.c (find_function_in_inferior): Update. * value.c (value_static_field, value_fn_field): Update.
2013-08-15 16:46:35 +02:00
2014-02-26 Tom Tromey <tromey@redhat.com>
* ada-lang.c (ada_main_name): Update.
(ada_add_standard_exceptions): Update.
* ada-tasks.c (ada_tasks_inferior_data_sniffer): Update.
* aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
* arm-tdep.c (skip_prologue_function, arm_skip_stub): Update.
* auxv.c (ld_so_xfer_auxv): Update.
* avr-tdep.c (avr_scan_prologue): Update.
* ax-gdb.c (gen_var_ref): Update.
* blockframe.c (get_pc_function_start)
(find_pc_partial_function_gnu_ifunc): Update.
* breakpoint.c (create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint): Update.
* bsd-uthread.c (bsd_uthread_lookup_address): Update.
* c-valprint.c (c_val_print): Update.
* coff-pe-read.c (add_pe_forwarded_sym): Update.
* common/agent.c (agent_look_up_symbols): Update.
* dbxread.c (find_stab_function_addr, end_psymtab): Update.
* dwarf2loc.c (call_site_to_target_addr): Update.
* dwarf2read.c (dw2_find_pc_sect_symtab): Update.
* elfread.c (elf_gnu_ifunc_record_cache)
(elf_gnu_ifunc_resolve_by_got): Update.
* findvar.c (default_read_var_value): Update.
* frame.c (inside_main_func): Update.
* frv-tdep.c (frv_frame_this_id): Update.
* glibc-tdep.c (glibc_skip_solib_resolver): Update.
* gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline):
Update.
* hppa-hpux-tdep.c (hppa64_hpux_search_dummy_call_sequence)
(hppa_hpux_find_dummy_bpaddr): Update.
* hppa-tdep.c (hppa_symbol_address): Update.
* infcmd.c (until_next_command): Update.
* jit.c (jit_read_descriptor, jit_breakpoint_re_set_internal):
Update.
* linespec.c (minsym_found, add_minsym): Update.
* linux-nat.c (get_signo): Update.
* linux-thread-db.c (inferior_has_bug): Update.
* m32c-tdep.c (m32c_return_value)
(m32c_m16c_address_to_pointer): Update.
* m32r-tdep.c (m32r_frame_this_id): Update.
* m68hc11-tdep.c (m68hc11_get_register_info): Update.
* machoread.c (macho_resolve_oso_sym_with_minsym): Update.
* maint.c (maintenance_translate_address): Update.
* minsyms.c (lookup_minimal_symbol_by_pc_name): Update.
(frob_address): New function.
(lookup_minimal_symbol_by_pc_section_1): Use raw addresses,
frob_address. Rename parameter to "pc_in".
(compare_minimal_symbols, compact_minimal_symbols): Use raw
addresses.
(find_solib_trampoline_target, minimal_symbol_upper_bound):
Update.
* mips-linux-tdep.c (mips_linux_skip_resolver): Update.
* mips-tdep.c (mips_skip_pic_trampoline_code): Update.
* objc-lang.c (find_objc_msgsend): Update.
* objfiles.c (objfile_relocate1): Update.
* obsd-tdep.c (obsd_skip_solib_resolver): Update.
* p-valprint.c (pascal_val_print): Update.
* parse.c (write_exp_msymbol): Update.
* ppc-linux-tdep.c (ppc_linux_spe_context_lookup)
(ppc_elfv2_skip_entrypoint): Update.
* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
* printcmd.c (build_address_symbolic, msym_info)
(address_info): Update.
* proc-service.c (ps_pglobal_lookup): Update.
* psymtab.c (find_pc_sect_psymtab_closer)
(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial):
Change msymbol parameter to bound_minimal_symbol.
* ravenscar-thread.c (get_running_thread_id): Update.
* remote.c (remote_check_symbols): Update.
* sh64-tdep.c (sh64_elf_make_msymbol_special): Use raw
address.
* sol2-tdep.c (sol2_skip_solib_resolver): Update.
* solib-dsbt.c (lm_base): Update.
* solib-frv.c (lm_base, main_got): Update.
* solib-irix.c (locate_base): Update.
* solib-som.c (som_solib_create_inferior_hook)
(link_map_start): Update.
* solib-spu.c (spu_enable_break, ocl_enable_break): Update.
* solib-svr4.c (elf_locate_base, enable_break): Update.
* spu-tdep.c (spu_get_overlay_table, spu_catch_start)
(flush_ea_cache): Update.
* stabsread.c (define_symbol, scan_file_globals): Update.
* stack.c (find_frame_funname): Update.
* symfile-debug.c (debug_qf_expand_symtabs_matching)
(debug_qf_find_pc_sect_symtab): Update.
* symfile.c (simple_read_overlay_table)
(simple_overlay_update): Update.
* symfile.h (struct quick_symbol_functions)
<find_pc_sect_symtab>: Change type of msymbol to
bound_minimal_symbol.
* symmisc.c (dump_msymbols): Update.
* symtab.c (find_pc_sect_symtab_via_partial)
(find_pc_sect_psymtab, find_pc_sect_line, skip_prologue_sal)
(search_symbols, print_msymbol_info): Update.
* symtab.h (MSYMBOL_VALUE_RAW_ADDRESS): New macro.
(MSYMBOL_VALUE_ADDRESS): Redefine.
(BMSYMBOL_VALUE_ADDRESS): New macro.
* tracepoint.c (scope_info): Update.
* tui/tui-disasm.c (tui_find_disassembly_address)
(tui_get_begin_asm_address): Update.
* valops.c (find_function_in_inferior): Update.
* value.c (value_static_field, value_fn_field): Update.
use bound_minsym as result for lookup_minimal_symbol et al This patch changes a few minimal symbol lookup functions to return a bound_minimal_symbol rather than a pointer to the minsym. This change helps prepare gdb for computing a minimal symbol's address at the point of use. Note that this changes even those functions that ostensibly search a single objfile. That was necessary because, in fact, those functions can search an objfile and its separate debug objfiles; and it is important for the caller to know in which objfile the minimal symbol was actually found. The bulk of this patch is mechanical. 2014-02-26 Tom Tromey <tromey@redhat.com> * ada-lang.c (ada_update_initial_language): Update. (ada_main_name, ada_has_this_exception_support): Update. * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * arm-tdep.c (arm_skip_stub): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * breakpoint.c (struct breakpoint_objfile_data) <overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change type to bound_minimal_symbol. (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * c-exp.y (classify_name): Update. * coffread.c (coff_symfile_read): Update. * common/agent.c (agent_look_up_symbols): Update. * d-lang.c (d_main_name): Update. * dbxread.c (find_stab_function_addr, end_psymtab): Update. * dec-thread.c (enable_dec_thread): Update. * dwarf2loc.c (call_site_to_target_addr): Update. * elfread.c (elf_gnu_ifunc_resolve_by_got): Update. * eval.c (evaluate_subexp_standard): Update. * findvar.c (struct minsym_lookup_data) <result>: Change type to bound_minimal_symbol. <objfile>: Remove. (minsym_lookup_iterator_cb, default_read_var_value): Update. * frame.c (inside_main_func): Update. * frv-tdep.c (frv_frame_this_id): Update. * gcore.c (call_target_sbrk): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline): Update. * go-lang.c (go_main_name): Update. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code) (hppa_hpux_find_import_stub_for_addr): Update. * hppa-tdep.c (hppa_extract_17, hppa_lookup_stub_minimal_symbol): Update. Change return type. * hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return type. * jit.c (jit_breakpoint_re_set_internal): Update. * linux-fork.c (inferior_call_waitpid, checkpoint_command): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update * m32c-tdep.c (m32c_return_value) (m32c_m16c_address_to_pointer): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * minsyms.c (lookup_minimal_symbol_internal): Rename to lookup_minimal_symbol. Change return type. (lookup_minimal_symbol): Remove. (lookup_bound_minimal_symbol): Update. (lookup_minimal_symbol_text): Change return type. (lookup_minimal_symbol_solib_trampoline): Change return type. * minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text) (lookup_minimal_symbol_solib_trampoline): Change return type. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (value_nsstring, find_imps): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-lang.c (pascal_main_name): Update. * ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * proc-service.c (ps_pglobal_lookup): Update. * ravenscar-thread.c (get_running_thread_msymbol): Change return type. (has_ravenscar_runtime, get_running_thread_id): Update. * remote.c (remote_check_symbols): Update. * sol-thread.c (ps_pglobal_lookup): Update. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base, frv_relocate_section_addresses): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook) (som_solib_desire_dynamic_linker_symbols, link_map_start): Update. * solib-spu.c (spu_enable_break): Update. * solib-svr4.c (elf_locate_base, enable_break): Update. * spu-tdep.c (spu_get_overlay_table, spu_catch_start) (flush_ea_cache): Update. * stabsread.c (define_symbol): Update. * symfile.c (simple_read_overlay_table): Update. * symtab.c (find_pc_sect_line): Update. * tracepoint.c (scope_info): Update. * tui-disasm.c (tui_get_begin_asm_address): Update. * value.c (value_static_field): Update.
2013-10-15 03:53:29 +02:00
2014-02-26 Tom Tromey <tromey@redhat.com>
* ada-lang.c (ada_update_initial_language): Update.
(ada_main_name, ada_has_this_exception_support): Update.
* ada-tasks.c (ada_tasks_inferior_data_sniffer): Update.
* aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
* arm-tdep.c (arm_skip_stub): Update.
* auxv.c (ld_so_xfer_auxv): Update.
* avr-tdep.c (avr_scan_prologue): Update.
* ax-gdb.c (gen_var_ref): Update.
* breakpoint.c (struct breakpoint_objfile_data)
<overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change
type to bound_minimal_symbol.
(create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint): Update.
* bsd-uthread.c (bsd_uthread_lookup_address): Update.
* c-exp.y (classify_name): Update.
* coffread.c (coff_symfile_read): Update.
* common/agent.c (agent_look_up_symbols): Update.
* d-lang.c (d_main_name): Update.
* dbxread.c (find_stab_function_addr, end_psymtab): Update.
* dec-thread.c (enable_dec_thread): Update.
* dwarf2loc.c (call_site_to_target_addr): Update.
* elfread.c (elf_gnu_ifunc_resolve_by_got): Update.
* eval.c (evaluate_subexp_standard): Update.
* findvar.c (struct minsym_lookup_data) <result>: Change type
to bound_minimal_symbol.
<objfile>: Remove.
(minsym_lookup_iterator_cb, default_read_var_value): Update.
* frame.c (inside_main_func): Update.
* frv-tdep.c (frv_frame_this_id): Update.
* gcore.c (call_target_sbrk): Update.
* glibc-tdep.c (glibc_skip_solib_resolver): Update.
* gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline):
Update.
* go-lang.c (go_main_name): Update.
* hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code)
(hppa_hpux_find_import_stub_for_addr): Update.
* hppa-tdep.c (hppa_extract_17, hppa_lookup_stub_minimal_symbol):
Update. Change return type.
* hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return
type.
* jit.c (jit_breakpoint_re_set_internal): Update.
* linux-fork.c (inferior_call_waitpid, checkpoint_command):
Update.
* linux-nat.c (get_signo): Update.
* linux-thread-db.c (inferior_has_bug): Update
* m32c-tdep.c (m32c_return_value)
(m32c_m16c_address_to_pointer): Update.
* m32r-tdep.c (m32r_frame_this_id): Update.
* m68hc11-tdep.c (m68hc11_get_register_info): Update.
* machoread.c (macho_resolve_oso_sym_with_minsym): Update.
* minsyms.c (lookup_minimal_symbol_internal): Rename to
lookup_minimal_symbol. Change return type.
(lookup_minimal_symbol): Remove.
(lookup_bound_minimal_symbol): Update.
(lookup_minimal_symbol_text): Change return type.
(lookup_minimal_symbol_solib_trampoline): Change return type.
* minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text)
(lookup_minimal_symbol_solib_trampoline): Change return type.
* mips-linux-tdep.c (mips_linux_skip_resolver): Update.
* objc-lang.c (lookup_objc_class, lookup_child_selector)
(value_nsstring, find_imps): Update.
* obsd-tdep.c (obsd_skip_solib_resolver): Update.
* p-lang.c (pascal_main_name): Update.
* ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update.
* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
* proc-service.c (ps_pglobal_lookup): Update.
* ravenscar-thread.c (get_running_thread_msymbol): Change
return type.
(has_ravenscar_runtime, get_running_thread_id): Update.
* remote.c (remote_check_symbols): Update.
* sol-thread.c (ps_pglobal_lookup): Update.
* sol2-tdep.c (sol2_skip_solib_resolver): Update.
* solib-dsbt.c (lm_base): Update.
* solib-frv.c (lm_base, frv_relocate_section_addresses):
Update.
* solib-irix.c (locate_base): Update.
* solib-som.c (som_solib_create_inferior_hook)
(som_solib_desire_dynamic_linker_symbols, link_map_start):
Update.
* solib-spu.c (spu_enable_break): Update.
* solib-svr4.c (elf_locate_base, enable_break): Update.
* spu-tdep.c (spu_get_overlay_table, spu_catch_start)
(flush_ea_cache): Update.
* stabsread.c (define_symbol): Update.
* symfile.c (simple_read_overlay_table): Update.
* symtab.c (find_pc_sect_line): Update.
* tracepoint.c (scope_info): Update.
* tui-disasm.c (tui_get_begin_asm_address): Update.
* value.c (value_static_field): Update.
2014-02-26 Tom Tromey <tromey@redhat.com>
* minsyms.c (prim_record_minimal_symbol_full): Use
SET_MSYMBOL_VALUE_ADDRESS.
* objfiles.c (objfile_relocate1): Use SET_MSYMBOL_VALUE_ADDRESS.
* sh64-tdep.c (sh64_elf_make_msymbol_special): Use
SET_MSYMBOL_VALUE_ADDRESS.
* symtab.h (MSYMBOL_VALUE_ADDRESS): Expand to an rvalue.
(SET_MSYMBOL_VALUE_ADDRESS): New macro.
change minsym representation In a later patch we're going to change the minimal symbol address calculation to apply section offsets at the point of use. To make it simpler to catch potential problem spots, this patch changes the representation of minimal symbols and introduces new minimal-symbol-specific variants of the various accessors. This is necessary because it would be excessively ambitious to try to convert all the symbol types at once. The core of this change is just renaming a field in minimal_symbol; the rest is just a fairly mechanical rewording. 2014-02-26 Tom Tromey <tromey@redhat.com> * symtab.h (struct minimal_symbol) <mginfo>: Rename from ginfo. (MSYMBOL_VALUE, MSYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_BYTES) (MSYMBOL_BLOCK_VALUE, MSYMBOL_VALUE_CHAIN, MSYMBOL_LANGUAGE) (MSYMBOL_SECTION, MSYMBOL_OBJ_SECTION, MSYMBOL_NATURAL_NAME) (MSYMBOL_LINKAGE_NAME, MSYMBOL_PRINT_NAME, MSYMBOL_DEMANGLED_NAME) (MSYMBOL_SET_LANGUAGE, MSYMBOL_SEARCH_NAME) (MSYMBOL_MATCHES_SEARCH_NAME, MSYMBOL_SET_NAMES): New macros. * ada-lang.c (ada_main_name): Update. (ada_lookup_simple_minsym): Update. (ada_make_symbol_completion_list): Update. (ada_add_standard_exceptions): Update. * ada-tasks.c (read_atcb, ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * amd64-windows-tdep.c (amd64_skip_main_prologue): Update. * arm-tdep.c (skip_prologue_function): Update. (arm_skip_stack_protector, arm_skip_stub): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. (arm_wince_skip_main_prologue): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * block.c (call_site_for_pc): Update. * blockframe.c (get_pc_function_start): Update. (find_pc_partial_function_gnu_ifunc): Update. * breakpoint.c (create_overlay_event_breakpoint): Update. (create_longjmp_master_breakpoint): Update. (create_std_terminate_master_breakpoint): Update. (create_exception_master_breakpoint): Update. (resolve_sal_pc): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * btrace.c (ftrace_print_function_name, ftrace_function_switched): Update. * c-valprint.c (c_val_print): Update. * coff-pe-read.c (add_pe_forwarded_sym): Update. * coffread.c (coff_symfile_read): Update. * common/agent.c (agent_look_up_symbols): Update. * dbxread.c (find_stab_function_addr): Update. (end_psymtab): Update. * dwarf2loc.c (call_site_to_target_addr): Update. (func_verify_no_selftailcall): Update. (tailcall_dump): Update. (call_site_find_chain_1): Update. (dwarf_expr_reg_to_entry_parameter): Update. * elfread.c (elf_gnu_ifunc_record_cache): Update. (elf_gnu_ifunc_resolve_by_got): Update. * f-valprint.c (info_common_command): Update. * findvar.c (read_var_value): Update. * frame.c (get_prev_frame_1): Update. (inside_main_func): Update. * frv-tdep.c (frv_skip_main_prologue): Update. (frv_frame_this_id): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v2-abi.c (gnuv2_value_rtti_type): Update. * gnu-v3-abi.c (gnuv3_rtti_type): Update. (gnuv3_skip_trampoline): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline): Update. (hppa64_hpux_in_solib_call_trampoline): Update. (hppa_hpux_skip_trampoline_code): Update. (hppa64_hpux_search_dummy_call_sequence): Update. (hppa_hpux_find_import_stub_for_addr): Update. (hppa_hpux_find_dummy_bpaddr): Update. * hppa-tdep.c (hppa_symbol_address) (hppa_lookup_stub_minimal_symbol): Update. * i386-tdep.c (i386_skip_main_prologue): Update. (i386_pe_skip_trampoline_code): Update. * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Update. * infcall.c (get_function_name): Update. * infcmd.c (until_next_command): Update. * jit.c (jit_breakpoint_re_set_internal): Update. (jit_inferior_init): Update. * linespec.c (minsym_found): Update. (add_minsym): Update. * linux-fork.c (info_checkpoints_command): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update. * m32c-tdep.c (m32c_return_value): Update. (m32c_m16c_address_to_pointer): Update. (m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * maint.c (maintenance_translate_address): Update. * minsyms.c (add_minsym_to_hash_table): Update. (add_minsym_to_demangled_hash_table): Update. (msymbol_objfile): Update. (lookup_minimal_symbol): Update. (iterate_over_minimal_symbols): Update. (lookup_minimal_symbol_text): Update. (lookup_minimal_symbol_by_pc_name): Update. (lookup_minimal_symbol_solib_trampoline): Update. (lookup_minimal_symbol_by_pc_section_1): Update. (lookup_minimal_symbol_and_objfile): Update. (prim_record_minimal_symbol_full): Update. (compare_minimal_symbols): Update. (compact_minimal_symbols): Update. (build_minimal_symbol_hash_tables): Update. (install_minimal_symbols): Update. (terminate_minimal_symbol_table): Update. (find_solib_trampoline_target): Update. (minimal_symbol_upper_bound): Update. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * mips-tdep.c (mips_stub_frame_sniffer): Update. (mips_skip_pic_trampoline_code): Update. * msp430-tdep.c (msp430_skip_trampoline_code): Update. * objc-lang.c (selectors_info): Update. (classes_info): Update. (find_methods): Update. (find_imps): Update. (find_objc_msgsend): Update. * objfiles.c (objfile_relocate1): Update. * objfiles.h (ALL_OBJFILE_MSYMBOLS): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-valprint.c (pascal_val_print): Update. * parse.c (write_exp_msymbol): Update. * ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code) (ppc_linux_spe_context_lookup, ppc_elfv2_skip_entrypoint): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * printcmd.c (build_address_symbolic): Update. (sym_info): Update. (address_info): Update. * proc-service.c (ps_pglobal_lookup): Update. * psymtab.c (find_pc_sect_psymtab_closer): Update. (find_pc_sect_psymtab): Update. * python/py-framefilter.c (py_print_frame): Update. * ravenscar-thread.c (get_running_thread_id): Update. * record-btrace.c (btrace_call_history, btrace_get_bfun_name): Update. * remote.c (remote_check_symbols): Update. * rs6000-tdep.c (rs6000_skip_main_prologue): Update. (rs6000_skip_trampoline_code): Update. * sh64-tdep.c (sh64_elf_make_msymbol_special): Update. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base): Update. (main_got): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook): Update. (som_solib_desire_dynamic_linker_symbols): Update. (link_map_start): Update. * solib-spu.c (spu_enable_break): Update. (ocl_enable_break): Update. * solib-svr4.c (elf_locate_base): Update. (enable_break): Update. * spu-tdep.c (spu_get_overlay_table): Update. (spu_catch_start): Update. (flush_ea_cache): Update. * stabsread.c (define_symbol): Update. (scan_file_globals): Update. * stack.c (find_frame_funname): Update. (frame_info): Update. * symfile.c (simple_read_overlay_table): Update. (simple_overlay_update): Update. * symmisc.c (dump_msymbols): Update. * symtab.c (fixup_section): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (search_symbols): Update. (print_msymbol_info): Update. (rbreak_command): Update. (MCOMPLETION_LIST_ADD_SYMBOL): New macro. (completion_list_objc_symbol): Update. (default_make_symbol_completion_list_break_on): Update. * tracepoint.c (scope_info): Update. * tui/tui-disasm.c (tui_find_disassembly_address): Update. (tui_get_begin_asm_address): Update. * valops.c (find_function_in_inferior): Update. * value.c (value_static_field): Update. (value_fn_field): Update.
2013-08-15 16:43:43 +02:00
2014-02-26 Tom Tromey <tromey@redhat.com>
* symtab.h (struct minimal_symbol) <mginfo>: Rename from ginfo.
(MSYMBOL_VALUE, MSYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_BYTES)
(MSYMBOL_BLOCK_VALUE, MSYMBOL_VALUE_CHAIN, MSYMBOL_LANGUAGE)
(MSYMBOL_SECTION, MSYMBOL_OBJ_SECTION, MSYMBOL_NATURAL_NAME)
(MSYMBOL_LINKAGE_NAME, MSYMBOL_PRINT_NAME, MSYMBOL_DEMANGLED_NAME)
(MSYMBOL_SET_LANGUAGE, MSYMBOL_SEARCH_NAME)
(MSYMBOL_MATCHES_SEARCH_NAME, MSYMBOL_SET_NAMES): New macros.
* ada-lang.c (ada_main_name): Update.
(ada_lookup_simple_minsym): Update.
(ada_make_symbol_completion_list): Update.
(ada_add_standard_exceptions): Update.
* ada-tasks.c (read_atcb, ada_tasks_inferior_data_sniffer): Update.
* aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
* amd64-windows-tdep.c (amd64_skip_main_prologue): Update.
* arm-tdep.c (skip_prologue_function): Update.
(arm_skip_stack_protector, arm_skip_stub): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
(arm_wince_skip_main_prologue): Update.
* auxv.c (ld_so_xfer_auxv): Update.
* avr-tdep.c (avr_scan_prologue): Update.
* ax-gdb.c (gen_var_ref): Update.
* block.c (call_site_for_pc): Update.
* blockframe.c (get_pc_function_start): Update.
(find_pc_partial_function_gnu_ifunc): Update.
* breakpoint.c (create_overlay_event_breakpoint): Update.
(create_longjmp_master_breakpoint): Update.
(create_std_terminate_master_breakpoint): Update.
(create_exception_master_breakpoint): Update.
(resolve_sal_pc): Update.
* bsd-uthread.c (bsd_uthread_lookup_address): Update.
* btrace.c (ftrace_print_function_name, ftrace_function_switched):
Update.
* c-valprint.c (c_val_print): Update.
* coff-pe-read.c (add_pe_forwarded_sym): Update.
* coffread.c (coff_symfile_read): Update.
* common/agent.c (agent_look_up_symbols): Update.
* dbxread.c (find_stab_function_addr): Update.
(end_psymtab): Update.
* dwarf2loc.c (call_site_to_target_addr): Update.
(func_verify_no_selftailcall): Update.
(tailcall_dump): Update.
(call_site_find_chain_1): Update.
(dwarf_expr_reg_to_entry_parameter): Update.
* elfread.c (elf_gnu_ifunc_record_cache): Update.
(elf_gnu_ifunc_resolve_by_got): Update.
* f-valprint.c (info_common_command): Update.
* findvar.c (read_var_value): Update.
* frame.c (get_prev_frame_1): Update.
(inside_main_func): Update.
* frv-tdep.c (frv_skip_main_prologue): Update.
(frv_frame_this_id): Update.
* glibc-tdep.c (glibc_skip_solib_resolver): Update.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Update.
* gnu-v3-abi.c (gnuv3_rtti_type): Update.
(gnuv3_skip_trampoline): Update.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline): Update.
(hppa64_hpux_in_solib_call_trampoline): Update.
(hppa_hpux_skip_trampoline_code): Update.
(hppa64_hpux_search_dummy_call_sequence): Update.
(hppa_hpux_find_import_stub_for_addr): Update.
(hppa_hpux_find_dummy_bpaddr): Update.
* hppa-tdep.c (hppa_symbol_address)
(hppa_lookup_stub_minimal_symbol): Update.
* i386-tdep.c (i386_skip_main_prologue): Update.
(i386_pe_skip_trampoline_code): Update.
* ia64-tdep.c (ia64_convert_from_func_ptr_addr): Update.
* infcall.c (get_function_name): Update.
* infcmd.c (until_next_command): Update.
* jit.c (jit_breakpoint_re_set_internal): Update.
(jit_inferior_init): Update.
* linespec.c (minsym_found): Update.
(add_minsym): Update.
* linux-fork.c (info_checkpoints_command): Update.
* linux-nat.c (get_signo): Update.
* linux-thread-db.c (inferior_has_bug): Update.
* m32c-tdep.c (m32c_return_value): Update.
(m32c_m16c_address_to_pointer): Update.
(m32c_m16c_pointer_to_address): Update.
* m32r-tdep.c (m32r_frame_this_id): Update.
* m68hc11-tdep.c (m68hc11_get_register_info): Update.
* machoread.c (macho_resolve_oso_sym_with_minsym): Update.
* maint.c (maintenance_translate_address): Update.
* minsyms.c (add_minsym_to_hash_table): Update.
(add_minsym_to_demangled_hash_table): Update.
(msymbol_objfile): Update.
(lookup_minimal_symbol): Update.
(iterate_over_minimal_symbols): Update.
(lookup_minimal_symbol_text): Update.
(lookup_minimal_symbol_by_pc_name): Update.
(lookup_minimal_symbol_solib_trampoline): Update.
(lookup_minimal_symbol_by_pc_section_1): Update.
(lookup_minimal_symbol_and_objfile): Update.
(prim_record_minimal_symbol_full): Update.
(compare_minimal_symbols): Update.
(compact_minimal_symbols): Update.
(build_minimal_symbol_hash_tables): Update.
(install_minimal_symbols): Update.
(terminate_minimal_symbol_table): Update.
(find_solib_trampoline_target): Update.
(minimal_symbol_upper_bound): Update.
* mips-linux-tdep.c (mips_linux_skip_resolver): Update.
* mips-tdep.c (mips_stub_frame_sniffer): Update.
(mips_skip_pic_trampoline_code): Update.
* msp430-tdep.c (msp430_skip_trampoline_code): Update.
* objc-lang.c (selectors_info): Update.
(classes_info): Update.
(find_methods): Update.
(find_imps): Update.
(find_objc_msgsend): Update.
* objfiles.c (objfile_relocate1): Update.
* objfiles.h (ALL_OBJFILE_MSYMBOLS): Update.
* obsd-tdep.c (obsd_skip_solib_resolver): Update.
* p-valprint.c (pascal_val_print): Update.
* parse.c (write_exp_msymbol): Update.
* ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code)
(ppc_linux_spe_context_lookup, ppc_elfv2_skip_entrypoint): Update.
* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
* printcmd.c (build_address_symbolic): Update.
(sym_info): Update.
(address_info): Update.
* proc-service.c (ps_pglobal_lookup): Update.
* psymtab.c (find_pc_sect_psymtab_closer): Update.
(find_pc_sect_psymtab): Update.
* python/py-framefilter.c (py_print_frame): Update.
* ravenscar-thread.c (get_running_thread_id): Update.
* record-btrace.c (btrace_call_history, btrace_get_bfun_name):
Update.
* remote.c (remote_check_symbols): Update.
* rs6000-tdep.c (rs6000_skip_main_prologue): Update.
(rs6000_skip_trampoline_code): Update.
* sh64-tdep.c (sh64_elf_make_msymbol_special): Update.
* sol2-tdep.c (sol2_skip_solib_resolver): Update.
* solib-dsbt.c (lm_base): Update.
* solib-frv.c (lm_base): Update.
(main_got): Update.
* solib-irix.c (locate_base): Update.
* solib-som.c (som_solib_create_inferior_hook): Update.
(som_solib_desire_dynamic_linker_symbols): Update.
(link_map_start): Update.
* solib-spu.c (spu_enable_break): Update.
(ocl_enable_break): Update.
* solib-svr4.c (elf_locate_base): Update.
(enable_break): Update.
* spu-tdep.c (spu_get_overlay_table): Update.
(spu_catch_start): Update.
(flush_ea_cache): Update.
* stabsread.c (define_symbol): Update.
(scan_file_globals): Update.
* stack.c (find_frame_funname): Update.
(frame_info): Update.
* symfile.c (simple_read_overlay_table): Update.
(simple_overlay_update): Update.
* symmisc.c (dump_msymbols): Update.
* symtab.c (fixup_section): Update.
(find_pc_sect_line): Update.
(skip_prologue_sal): Update.
(search_symbols): Update.
(print_msymbol_info): Update.
(rbreak_command): Update.
(MCOMPLETION_LIST_ADD_SYMBOL): New macro.
(completion_list_objc_symbol): Update.
(default_make_symbol_completion_list_break_on): Update.
* tracepoint.c (scope_info): Update.
* tui/tui-disasm.c (tui_find_disassembly_address): Update.
(tui_get_begin_asm_address): Update.
* valops.c (find_function_in_inferior): Update.
* value.c (value_static_field): Update.
(value_fn_field): Update.
2014-02-26 Tom Tromey <tromey@redhat.com>
* blockframe.c (find_pc_partial_function_gnu_ifunc): Use
bound minimal symbols. Move code that knows about minsym
table layout...
* minsyms.c (minimal_symbol_upper_bound): ... here. New
function.
* minsyms.h (minimal_symbol_upper_bound): Declare.
* objc-lang.c (find_objc_msgsend): Use bound minimal symbols,
minimal_symbol_upper_bound.
2014-02-27 Joel Brobecker <brobecker@adacore.com>
* python/lib/gdb/printing.py (RegexpCollectionPrettyPrinter):
Use the type's name if its basic type does not have a tag.
2014-02-27 Joel Brobecker <brobecker@adacore.com>
* dwarf2read.c (read_subrange_type): Add comment.
DWARF: Set enum type "flag_enum" and "unsigned" flags at type creation. Consider the following Ada code: -- An array whose index is an enumeration type with 128 enumerators. type Enum_T is (Enum_000, Enum_001, [...], Enum_128); type Table is array (Enum_T) of Boolean; When the compiler is configured to generate pure DWARF debugging info, trying to print type Table's description yields: ptype pck.table type = array (enum_000 .. -128) of boolean The expected output was: ptype pck.table type = array (enum_000 .. enum_128) of boolean The DWARF debugging info for our array looks like this: <1><44>: Abbrev Number: 5 (DW_TAG_array_type) <45> DW_AT_name : pck__table <50> DW_AT_type : <0x28> <2><54>: Abbrev Number: 6 (DW_TAG_subrange_type) <55> DW_AT_type : <0x5c> <59> DW_AT_lower_bound : 0 <5a> DW_AT_upper_bound : 128 The array index type is, by construction with the DWARF standard, a subrange of our enumeration type, defined as follow: <2><5b>: Abbrev Number: 0 <1><5c>: Abbrev Number: 7 (DW_TAG_enumeration_type) <5d> DW_AT_name : pck__enum_t <69> DW_AT_byte_size : 1 <2><6b>: Abbrev Number: 8 (DW_TAG_enumerator) <6c> DW_AT_name : pck__enum_000 <7a> DW_AT_const_value : 0 [etc] Therefore, while processing these DIEs, the array index type ends up being a TYPE_CODE_RANGE whose target type is our enumeration type. But the problem is that we read the upper bound as a negative value (-128), which is then used as is by the type printer to print the array upper bound. This negative value explains the "-128" in the output. To understand why the range type's upper bound is read as a negative value, one needs to look at how it is determined, in read_subrange_type: orig_base_type = die_type (die, cu); base_type = check_typedef (orig_base_type); [... high is first correctly read as 128, but then ...] if (!TYPE_UNSIGNED (base_type) && (high & negative_mask)) high |= negative_mask; The negative_mask is applied, here, because BASE_TYPE->FLAG_UNSIGNED is not set. And the reason for that is because the base_type was only partially constructed during the call to die_type. While the enum is constructed on the fly by read_enumeration_type, its flag_unsigned flag is only set later on, while creating the symbols corresponding to the enum type's enumerators (see process_enumeration_scope), after we've already finished creating our range type - and therefore too late. My first naive attempt at fixing this problem consisted in extracting the part in process_enumeration_scope which processes all enumerators, to generate the associated symbols, but more importantly set the type's various flags when necessary. However, this does not always work well, because we're still in the subrange_type's scope, and it might be different from the scope where the enumeration type is defined. So, instead, what this patch does to fix the issue is to extract from process_enumeration_scope the part that determines whether the enumeration type should have the flag_unsigned and/or the flag_flag_enum flags set. It turns out that, aside from the code implementing the loop, this part is fairly independent of the symbol creation. With that part extracted, we can then use it at the end of our enumeration type creation, to produce a type which should now no longer need any adjustment. Once the enumeration type produced is correctly marked as unsigned, the subrange type's upper bound is then correctly read as an unsigned value, therefore giving us an upper bound of 128 instead of -128. gdb/ChangeLog: * dwarf2read.c (update_enumeration_type_from_children): New function, mostly extracted from process_structure_scope. (read_enumeration_type): Call update_enumeration_type_from_children. (process_enumeration_scope): Do not set THIS_TYPE's flag_unsigned and flag_flag_enum fields. gdb/testsuite/ChangeLog: * gdb.dwarf2/arr-subrange.c, gdb.dwarf2/arr-subrange.exp: New files.
2014-01-22 15:40:20 +01:00
2014-02-27 Joel Brobecker <brobecker@adacore.com>
* dwarf2read.c (update_enumeration_type_from_children): New
function, mostly extracted from process_structure_scope.
(read_enumeration_type): Call update_enumeration_type_from_children.
(process_enumeration_scope): Do not set THIS_TYPE's flag_unsigned
and flag_flag_enum fields.
2014-02-26 Pedro Alves <palves@redhat.com>
* bsd-uthread.c (bsd_uthread_xfer_partial): Delete function.
(bsd_uthread_target): Don't install bsd_uthread_xfer_partial as
to_xfer_partial method.
2014-02-26 Pedro Alves <palves@redhat.com>
* target.c (complete_target_initialization): Don't install
default_xfer_partial as to_xfer_partial hook.
(nomemory): Delete.
(update_current_target): Don't INHERIT nor de_fault
deprecated_xfer_memory. Delete de_fault macro.
(default_xfer_partial, deprecated_debug_xfer_memory): Delete.
(setup_target_debug): Don't install a deprecated_xfer_memory hook.
* target.h (struct target_ops) <deprecated_xfer_memory>: Delete
field.
2014-02-26 Pedro Alves <palves@redhat.com>
* go32-nat.c (my_write_child): New function.
(go32_xfer_memory): Rewrite as to_xfer_partial helper.
(go32_xfer_partial): New function.
(init_go32_ops): Don't install a deprecated_xfer_memory hook.
Instead install a to_xfer_partial hook.
2014-02-26 Pedro Alves <palves@redhat.com>
* nto-procfs.c (procfs_xfer_memory): Adjust interface as a
to_xfer_partial helper. Rewrite.
(procfs_xfer_partial): New function.
(init_procfs_ops): Don't install a deprecated_xfer_memory hook.
Install a to_xfer_partial hook.
2014-02-26 Pedro Alves <palves@redhat.com>
* remote-m32r-sdi.c (send_data): Constify 'buf' parameter.
(m32r_xfer_memory): Adjust as a to_xfer_partial helper.
(m32r_xfer_partial): New function.
(init_m32r_ops): Don't install a deprecated_xfer_memory hook.
Install a to_xfer_partial hook.
2014-02-26 Pedro Alves <palves@redhat.com>
* remote-mips.c (mips_xfer_memory): Adjust as to_xfer_partial
helper.
(mips_xfer_partial): New function.
(_initialize_remote_mips): Don't install a deprecated_xfer_memory
hook. Install a to_xfer_partial hook.
DWARF: Add array DW_AT_bit_stride and DW_AT_byte_stride support Consider the following declarations in Ada... type Item is range -32 .. 31; for Item'Size use 6; type Table is array (Natural range 0 .. 4) of Item; pragma Pack (Table); ... which declare a packed array whose elements are 6 bits long. The debugger currently does not notice that the array is packed, and thus prints values of this type incorrectly. This can be seen in the "ptype" output: (gdb) ptype table type = array (0 .. 4) of foo.item Normally, the debugger should print: (gdb) ptype table type = array (0 .. 4) of foo.item <packed: 6-bit elements> The debugging information for this array looks like this: .uleb128 0xf # (DIE (0x15c) DW_TAG_array_type) .long .LASF9 # DW_AT_name: "pck__table" .byte 0x6 # DW_AT_bit_stride .long 0x1a9 # DW_AT_type .uleb128 0x10 # (DIE (0x16a) DW_TAG_subrange_type) .long 0x3b # DW_AT_type .byte 0 # DW_AT_lower_bound .byte 0x4 # DW_AT_upper_bound .byte 0 # end of children of DIE 0x15c The interesting part is the DW_AT_bit_stride attribute, which tells the size of the array elements is 6 bits, rather than the normal element type's size. This patch adds support for this attribute by first creating gdbtypes.c::create_array_type_with_stride, which is an enhanced version of create_array_type taking an extra parameter as the stride. The old create_array_type can then be re-implemented very simply by calling the new create_array_type_with_stride. We can then use this new function from dwarf2read, to create arrays with or without stride. gdb/ChangeLog: * gdbtypes.h (create_array_type_with_stride): Add declaration. * gdbtypes.c (create_array_type_with_stride): New function, renaming create_array_type, but with an added parameter called "bit_stride". (create_array_type): Re-implement using create_array_type_with_stride. * dwarf2read.c (read_array_type): Add support for DW_AT_byte_stride and DW_AT_bit_stride attributes. gdb/testsuite/ChangeLog: * gdb.dwarf2/arr-stride.c: New file. * gdb.dwarf2/arr-stride.exp: New file. The test, relying purely on generating an assembly file, only verifies the type description of our array. But I was also able to verify manually that the debugger print values of these types correctly as well (which was not the case prior to this patch).
2014-01-29 14:39:56 +01:00
2014-02-26 Joel Brobecker <brobecker@adacore.com>
* gdbtypes.h (create_array_type_with_stride): Add declaration.
* gdbtypes.c (create_array_type_with_stride): New function,
renaming create_array_type, but with an added parameter
called "bit_stride".
(create_array_type): Re-implement using
create_array_type_with_stride.
* dwarf2read.c (read_array_type): Add support for DW_AT_byte_stride
and DW_AT_bit_stride attributes.
Multiple Ada task-specific breakpoints at the same address. With the test changed as in the patch, against current mainline, we get: (gdb) PASS: gdb.ada/tasks.exp: info tasks before inserting breakpoint break break_me task 1 Breakpoint 2 at 0x4030b0: file /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb, line 27. (gdb) PASS: gdb.ada/tasks.exp: break break_me task 1 break break_me task 3 Note: breakpoint 2 also set at pc 0x4030b0. Breakpoint 3 at 0x4030b0: file /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb, line 27. (gdb) PASS: gdb.ada/tasks.exp: break break_me task 3 continue Continuing. [Switching to Thread 0x7ffff7dc7700 (LWP 27133)] Breakpoint 2, foo.break_me () at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb:27 27 null; (gdb) FAIL: gdb.ada/tasks.exp: continue to breakpoint info tasks ID TID P-ID Pri State Name 1 63b010 48 Waiting on RV with 3 main_task 2 63bd80 1 48 Accept or Select Term task_list(1) * 3 63f510 1 48 Accepting RV with 1 task_list(2) 4 642ca0 1 48 Accept or Select Term task_list(3) (gdb) PASS: gdb.ada/tasks.exp: info tasks after hitting breakpoint The breakpoint that caused a stop is breakpoint 3, but GDB end up reporting (and running breakpoint commands of) "Breakpoint 2" instead. The issue is that the bpstat_check_breakpoint_conditions logic of "wrong thread" is missing the "wrong task" check. This is usually harmless, because the thread hop code in infrun.c code that handles wrong-task-hitting-breakpoint does check for task-specific breakpoints (within breakpoint_thread_match): /* Check if a regular breakpoint has been hit before checking for a potential single step breakpoint. Otherwise, GDB will not see this breakpoint hit when stepping onto breakpoints. */ if (regular_breakpoint_inserted_here_p (aspace, stop_pc)) { if (!breakpoint_thread_match (aspace, stop_pc, ecs->ptid)) thread_hop_needed = 1; } IOW, usually, when one only has a task specific breakpoint at a given address, things work correctly. Put another task-specific or non-task-specific breakpoint there, and things break. A patch that eliminates the special thread hop code in infrun.c is what exposed this, as after that GDB solely relies on bpstat_check_breakpoint_conditions to know whether the right or wrong task hit a breakpoint. IOW, given the latent bug, Ada task-specific breakpoints become non-task-specific, and that is caught by the testsuite, as: break break_me task 3 Breakpoint 2 at 0x4030b0: file /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb, line 27. (gdb) PASS: gdb.ada/tasks.exp: break break_me task 3 continue Continuing. [Switching to Thread 0x7ffff7fcb700 (LWP 17122)] Breakpoint 2, foo.break_me () at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb:27 27 null; (gdb) PASS: gdb.ada/tasks.exp: continue to breakpoint info tasks ID TID P-ID Pri State Name 1 63b010 48 Waiting on RV with 2 main_task * 2 63bd80 1 48 Accepting RV with 1 task_list(1) 3 63f510 1 48 Accept or Select Term task_list(2) 4 642ca0 1 48 Accept or Select Term task_list(3) (gdb) FAIL: gdb.ada/tasks.exp: info tasks after hitting breakpoint It was after seeing this that I thought of how to expose the bug with current mainline. Tested on x86_64 Fedora 17. gdb/ 2014-02-26 Pedro Alves <palves@redhat.com> * breakpoint.c (bpstat_check_breakpoint_conditions): Handle task-specific breakpoints. gdb/testsuite/ 2014-02-26 Pedro Alves <palves@redhat.com> * gdb.ada/tasks.exp: Set a task-specific breakpoint at break_me that won't ever trigger. Make sure that GDB reports the correct breakpoint that caused the stop.
2014-02-26 15:22:33 +01:00
2014-02-26 Pedro Alves <palves@redhat.com>
* breakpoint.c (bpstat_check_breakpoint_conditions): Handle
task-specific breakpoints.
2014-02-25 Pedro Alves <palves@redhat.com>
* ia64-linux-nat.c (ia64_linux_xfer_partial): Reimplement
handling of object == TARGET_OBJECT_UNWIND_TABLE.
2014-02-26 00:47:58 +01:00
2014-02-25 Stan Shebs <stan@codesourcery.com>
* defs.h: Annotate comments for Doxygen.
2014-02-25 Tom Tromey <tromey@redhat.com>
* target.h (target_ignore): Don't declare.
* target.c (target_ignore): Remove.
PR gdb/16626 Fix auto-load 7.7 regression, the regression affects any loading from /usr/share/gdb/auto-load . 5b2bf9471f1499bee578fcd60c05afe85794e280 is the first bad commit commit 5b2bf9471f1499bee578fcd60c05afe85794e280 Author: Doug Evans <xdje42@gmail.com> Date: Fri Nov 29 21:29:26 2013 -0800 Move .debug_gdb_script processing to auto-load.c. Simplify handling of auto-loaded objfile scripts. Fedora 20 x86_64 $ gdb -q /usr/lib64/libgobject-2.0.so Reading symbols from /usr/lib64/libglib-2.0.so.0.3800.2...Reading symbols from /usr/lib/debug/usr/lib64/libglib-2.0.so.0.3800.2.debug...done. done. (gdb) _ Fedora Rawhide x86_64 $ gdb -q /usr/lib64/libgobject-2.0.so Reading symbols from /usr/lib64/libglib-2.0.so...Reading symbols from /usr/lib/debug/usr/lib64/libglib-2.0.so.0.3990.0.debug...done. done. warning: File "/usr/lib64/libglib-2.0.so.0.3990.0-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py". To enable execution of this file add add-auto-load-safe-path /usr/lib64/libglib-2.0.so.0.3990.0-gdb.py line to your configuration file "/home/jkratoch/.gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/home/jkratoch/.gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" (gdb) _ That is it tries to load "forbidden" /usr/lib64/libglib-2.0.so.0.3990.0-gdb.py but it should load instead /usr/share/gdb/auto-load/usr/lib64/libglib-2.0.so.0.3990.0-gdb.py* Although that is also not exactly this way, there does not exist any /usr/lib64/libglib-2.0.so.0.3990.0-gdb.py despite regressed GDB says so. gdb/ 2014-02-24 Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/16626 * auto-load.c (auto_load_objfile_script_1): Change filename to debugfile. gdb/testsuite/ 2014-02-24 Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/16626 * gdb.base/auto-load-script: New file. * gdb.base/auto-load.c: New file. * gdb.base/auto-load.exp: New file. Message-ID: <20140223212400.GA8831@host2.jankratochvil.net>
2014-02-25 18:32:32 +01:00
2014-02-25 Jan Kratochvil <jan.kratochvil@redhat.com>
PR gdb/16626
* auto-load.c (auto_load_objfile_script_1): Change filename to
debugfile.
2014-02-25 Joel Brobecker <brobecker@adacore.com>
* ia64-linux-nat.c (ia64_linux_xfer_partial): Add function
documentation. Adjust prototype to match the target_ops
to_xfer_partial method. Adjust implementation accordingly.
2014-02-25 Hui Zhu <hui@codesourcery.com>
* target.h (target_ops): Fix TARGET_DEFAULT_RETURN of
to_traceframe_info.
Use 16-bit integer type for rl78 register pairs. This patch changes rl78-tdep.c so that a 16-bit type is used for register pairs instead of a pointer type as was previously the case. This will cause these register pairs to be displayed as integers instead of as a data address with a 0xf0000 ORed in. E.g. registers ax, bc, de, and hl might now be displayed like this: (gdb) info registers ax bc de hl ax 0x6 6 bc 0x0 0 de 0x10c3 4291 hl 0x108d 423 Whereas, before, they were displayed as follows: (gdb) info registers ax bc de hl ax 0xf0006 0xf0006 bc 0xf0000 0xf0000 de 0xf10c3 0xf10c3 hl 0xf108d 0xf108d These pairs are 16 bit quantities and should be displayed as such. This change also affects the way that the banked register pairs are displayed. Within GDB, the banked register pairs are named bank0_rp0, bank0_rp1, .., bank3_rp2, bank3_rp3. However, these register pairs need to be used as addresses in DWARF expressions. I have added 16 pseudo registers corresponding to banked register pairs. These new pseudo registers are all hidden from the user and have a pointer type. Values from these registers are intended to be used in DWARF expressions. Therefore, rl78_dwarf_reg_to_regnum() has been adjusted to return these new pseudo register numbers. I had a much simpler patch which only changed the types, but it showed a number of regressions due to integer values from the banked register pairs being used as part of an address expression. This current patch shows no regressions and now displays values of register pairs correctly. * rl78-tdep.c ( RL78_BANK0_RP0_PTR_REGNUM, RL78_BANK0_RP1_PTR_REGNUM) (RL78_BANK0_RP2_PTR_REGNUM, RL78_BANK0_RP3_PTR_REGNUM) (RL78_BANK1_RP0_PTR_REGNUM, RL78_BANK1_RP1_PTR_REGNUM) (RL78_BANK1_RP2_PTR_REGNUM, RL78_BANK1_RP3_PTR_REGNUM) (RL78_BANK2_RP0_PTR_REGNUM, RL78_BANK2_RP1_PTR_REGNUM) (RL78_BANK2_RP2_PTR_REGNUM, RL78_BANK2_RP3_PTR_REGNUM) (RL78_BANK3_RP0_PTR_REGNUM, RL78_BANK3_RP1_PTR_REGNUM) (RL78_BANK3_RP2_PTR_REGNUM, RL78_BANK3_RP3_PTR_REGNUM): New constants. (rl78_register_type): Use a data pointer type for SP and new pseudo registers mentioned above. Use a 16 bit integer type for all other register pairs. (rl78_register_name, rl78_g10_register_name): Update for new pseudo registers. (rl78_pseudo_register_read): Likewise. (rl78_pseudo_register_write): Likewise. (rl78_dwarf_reg_to_regnum): Return register numbers representing to the newly added pseudo registers.
2014-02-25 08:32:45 +01:00
2014-02-25 Kevin Buettner <kevinb@redhat.com>
2014-02-25 16:59:47 +01:00
* rl78-tdep.c (RL78_BANK0_RP0_PTR_REGNUM, RL78_BANK0_RP1_PTR_REGNUM)
Use 16-bit integer type for rl78 register pairs. This patch changes rl78-tdep.c so that a 16-bit type is used for register pairs instead of a pointer type as was previously the case. This will cause these register pairs to be displayed as integers instead of as a data address with a 0xf0000 ORed in. E.g. registers ax, bc, de, and hl might now be displayed like this: (gdb) info registers ax bc de hl ax 0x6 6 bc 0x0 0 de 0x10c3 4291 hl 0x108d 423 Whereas, before, they were displayed as follows: (gdb) info registers ax bc de hl ax 0xf0006 0xf0006 bc 0xf0000 0xf0000 de 0xf10c3 0xf10c3 hl 0xf108d 0xf108d These pairs are 16 bit quantities and should be displayed as such. This change also affects the way that the banked register pairs are displayed. Within GDB, the banked register pairs are named bank0_rp0, bank0_rp1, .., bank3_rp2, bank3_rp3. However, these register pairs need to be used as addresses in DWARF expressions. I have added 16 pseudo registers corresponding to banked register pairs. These new pseudo registers are all hidden from the user and have a pointer type. Values from these registers are intended to be used in DWARF expressions. Therefore, rl78_dwarf_reg_to_regnum() has been adjusted to return these new pseudo register numbers. I had a much simpler patch which only changed the types, but it showed a number of regressions due to integer values from the banked register pairs being used as part of an address expression. This current patch shows no regressions and now displays values of register pairs correctly. * rl78-tdep.c ( RL78_BANK0_RP0_PTR_REGNUM, RL78_BANK0_RP1_PTR_REGNUM) (RL78_BANK0_RP2_PTR_REGNUM, RL78_BANK0_RP3_PTR_REGNUM) (RL78_BANK1_RP0_PTR_REGNUM, RL78_BANK1_RP1_PTR_REGNUM) (RL78_BANK1_RP2_PTR_REGNUM, RL78_BANK1_RP3_PTR_REGNUM) (RL78_BANK2_RP0_PTR_REGNUM, RL78_BANK2_RP1_PTR_REGNUM) (RL78_BANK2_RP2_PTR_REGNUM, RL78_BANK2_RP3_PTR_REGNUM) (RL78_BANK3_RP0_PTR_REGNUM, RL78_BANK3_RP1_PTR_REGNUM) (RL78_BANK3_RP2_PTR_REGNUM, RL78_BANK3_RP3_PTR_REGNUM): New constants. (rl78_register_type): Use a data pointer type for SP and new pseudo registers mentioned above. Use a 16 bit integer type for all other register pairs. (rl78_register_name, rl78_g10_register_name): Update for new pseudo registers. (rl78_pseudo_register_read): Likewise. (rl78_pseudo_register_write): Likewise. (rl78_dwarf_reg_to_regnum): Return register numbers representing to the newly added pseudo registers.
2014-02-25 08:32:45 +01:00
(RL78_BANK0_RP2_PTR_REGNUM, RL78_BANK0_RP3_PTR_REGNUM)
(RL78_BANK1_RP0_PTR_REGNUM, RL78_BANK1_RP1_PTR_REGNUM)
(RL78_BANK1_RP2_PTR_REGNUM, RL78_BANK1_RP3_PTR_REGNUM)
(RL78_BANK2_RP0_PTR_REGNUM, RL78_BANK2_RP1_PTR_REGNUM)
(RL78_BANK2_RP2_PTR_REGNUM, RL78_BANK2_RP3_PTR_REGNUM)
(RL78_BANK3_RP0_PTR_REGNUM, RL78_BANK3_RP1_PTR_REGNUM)
(RL78_BANK3_RP2_PTR_REGNUM, RL78_BANK3_RP3_PTR_REGNUM):
New constants.
(rl78_register_type): Use a data pointer type for SP and
new pseudo registers mentioned above. Use a 16 bit integer
type for all other register pairs.
(rl78_register_name, rl78_g10_register_name): Update for
new pseudo registers.
(rl78_pseudo_register_read): Likewise.
(rl78_pseudo_register_write): Likewise.
(rl78_dwarf_reg_to_regnum): Return register numbers representing
to the newly added pseudo registers.
2014-02-24 Doug Evans <dje@google.com>
* value.c (record_latest_value): Fix comment.
* printcmd.c (print_command_1): Remove code to handle -1 return from
record_latest_value.
2014-02-24 Pedro Alves <palves@redhat.com>
* procfs.c (procfs_target): Don't install procfs_xfer_memory as
deprecated_xfer_memory hook.
(procfs_xfer_partial): Call procfs_xfer_memory instead
of the deprecated_xfer_memory target hook.
(procfs_xfer_memory): Adjust interface as a to_xfer_partial
helper.
2014-02-24 Yuanhui Zhang <asmwarrior@gmail.com>
* windows-nat.c (windows_xfer_shared_libraries): Return
TARGET_XFER_EOF if LEN is zero to fix an assert failure when
requested object is TARGET_OBJECT_LIBRARIES.
2014-02-24 Yao Qi <yao@codesourcery.com>
* target.h (enum target_xfer_status)
<TARGET_XFER_E_UNAVAILABLE>: Rename it to ...
<TARGET_XFER_UNAVAILABLE>: ... it with setting value 2
explicitly. New.
* corefile.c (memory_error_message): User updated.
* exec.c (section_table_read_available_memory): Likewise.
* record-btrace.c (record_btrace_xfer_partial): Likewise.
* target.c (target_xfer_status_to_string): Likewise.
(raw_memory_xfer_partial): Likewise.
(memory_xfer_partial_1, target_xfer_partial): Likewise.
* valops.c (read_value_memory): Likewise.
* exec.h: Update comments.
2014-02-24 Yao Qi <yao@codesourcery.com>
* target.c (target_xfer_status_to_string): Rename argument err
to status.
* target.h (target_xfer_status_to_string): Update declaration.
Replace target_xfer_error_to_string with
target_xfer_status_to_string in comment.
2014-02-24 Yao Qi <yao@codesourcery.com>
* mips-linux-nat.c (super_close): Update its type.
(mips_linux_close): Pass 'self' to super_close.
2014-02-24 Yao Qi <yao@codesourcery.com>
* target.h (TARGET_XFER_STATUS_ERROR_P): Remove.
* corefile.c (read_memory): Adjusted.
* target.c (target_write_with_progress): Adjusted.
2014-02-23 Yao Qi <yao@codesourcery.com>
Revert two patches:
2013-10-25 Yao Qi <yao@codesourcery.com>
* remote.c (remote_traceframe_info): Return early if
traceframe is not selected.
2013-07-19 Yao Qi <yao@codesourcery.com>
* target.c (update_current_target): Change the default action
of 'to_traceframe_info' from tcomplain to return_zero.
* target.h (struct target_ops) <to_traceframe_info>: Add more
comments.
2014-02-23 Yao Qi <yao@codesourcery.com>
* valops.c (read_value_memory): Rewrite it. Call
target_xfer_partial in a loop.
* exec.h (section_table_available_memory): Remove declaration.
Move comments to ...
* exec.c (section_table_available_memory): ... here. Make it
static.
2014-02-23 Yao Qi <yao@codesourcery.com>
* exec.c (section_table_read_available_memory): New function.
* exec.h (section_table_read_available_memory): Declare.
* ctf.c (ctf_xfer_partial): Call
section_table_read_available_memory.
* tracefile-tfile.c (tfile_xfer_partial): Likewise.
2014-02-23 Yao Qi <yao@codesourcery.com>
* ctf.c (ctf_xfer_partial): Move code to ...
* exec.c (exec_read_partial_read_only): ... it. New function.
* tracefile-tfile.c (tfile_xfer_partial): Likewise.
* tracefile.c: Include "exec.h".
* exec.h (exec_read_partial_read_only): Declare.
2014-02-23 Yao Qi <yao@codesourcery.com>
* tracefile-tfile.c (tfile_has_all_memory): Remove.
(tfile_has_memory): Remove.
(init_tfile_ops): Don't set fields to_has_all_memory and
to_has_memory of tfile_ops.
* tracefile.c (tracefile_has_all_memory): New function.
(tracefile_has_memory): New function.
(init_tracefile_ops): Initialize fields to_has_all_memory and
to_has_memory of 'ops'.
2014-02-23 Yao Qi <yao@codesourcery.com>
* ctf.c (ctf_has_stack, ctf_has_registers): Remove.
(ctf_thread_alive, ctf_get_trace_status): Remove.
(init_ctf_ops): Don't set some fields of ctf_ops. Call
init_tracefile_ops.
* tracefile-tfile.c (tfile_get_trace_status): Remove.
(tfile_has_stack, tfile_has_registers): Remove.
(tfile_thread_alive): Remove.
(init_tfile_ops): Don't set some fields of tfile_ops. Call
init_tracefile_ops.
* tracefile.c (tracefile_has_stack): New function.
(tracefile_has_registers): New function.
(tracefile_thread_alive): New function.
(tracefile_get_trace_status): New function.
(init_tracefile_ops): New function.
* tracefile.h (init_tracefile_ops): Declare.
2014-02-23 Yao Qi <yao@codesourcery.com>
* tracepoint.c (TFILE_PID): Move it to tracefile-tfile.c.
(O_LARGEFILE): Likewise.
(tfile_ops): Likewise.
(TRACE_HEADER_SIZE): Likewise.
(trace_fd, trace_frames_offset, cur_offset): Likewise.
(cur_data_size): Likewise.
(tfile_read, tfile_open, tfile_interp_line): Likewise.
(tfile_close, tfile_files_info): Likewise.
(tfile_get_trace_status): Likewise.
(tfile_get_tracepoint_status): Likewise.
(tfile_get_traceframe_address): Likewise.
(tfile_trace_find, match_blocktype): Likewise.
(traceframe_walk_blocks, traceframe_find_block_type): Likewise.
(tfile_fetch_registers, tfile_xfer_partial): Likewise.
(tfile_get_trace_state_variable_value): Likewise.
(tfile_has_all_memory, tfile_has_memory): Likewise.
(tfile_has_stack, tfile_has_registers): Likewise.
(tfile_thread_alive, build_traceframe_info): Likewise.
(tfile_traceframe_info, init_tfile_ops): Likewise.
(_initialize_tracepoint): Don't call init_tfile_ops
and add_target_with_completer.
* tracefile-tfile.c: Include regcache.h, inferior.h, gdbthread.h,
exec.h, completer.h and filenames.h.
(_initialize_tracefile_tfile): New function.
Move trace file writer out of tracepoint.c This patch is a refactor which moves trace file writer related code out of tracepoint.c, which has 6k LOC. It moves general trace file writer to a new file tracefile.c and moves tfile specific writer to tracefile-tfile.c. gdb: 2014-02-23 Yao Qi <yao@codesourcery.com> * Makefile.in (REMOTE_OBS): Append tracefile.o and tracefile-tfile.o. (HFILES_NO_SRCDIR): Add tracefile.h. * ctf.c: Include "tracefile.h". * tracefile.h: New file. * tracefile.c: New file * tracefile-tfile.c: New file. * tracepoint.c: Include "tracefile.h". (free_uploaded_tps, free_uploaded_tsvs): Remove declarations. (stop_reason_names): Add const. (trace_file_writer_xfree): Move it to tracefile.c. (trace_save, trace_save_command, trace_save_tfile): Likewise. (trace_save_ctf): Likewise. (struct tfile_trace_file_writer): Move it to tracefile-tfile.c. (tfile_target_save, tfile_dtor, tfile_start): Likewise. (tfile_write_header, tfile_write_regblock_type): Likewise. (tfile_write_status, tfile_write_uploaded_tsv): Likewise. (tfile_write_uploaded_tp, tfile_write_definition_end): Likewise. (tfile_write_raw_data, tfile_end): Likewise. (tfile_trace_file_writer_new): Likewise. (free_uploaded_tp): Make it extern. (free_uploaded_tsv): Make it extern. (_initialize_tracepoint): Move code to register command 'tsave' to tracefile.c. * tracepoint.h (stop_reason_names): Declare. (struct trace_frame_write_ops): Move it to tracefile.h. (struct trace_file_write_ops): Likewise. (struct trace_file_writer): Likewise. (free_uploaded_tsvs, free_uploaded_tps): Declare.
2014-02-10 06:31:12 +01:00
2014-02-23 Yao Qi <yao@codesourcery.com>
* Makefile.in (REMOTE_OBS): Append tracefile.o and
tracefile-tfile.o.
(HFILES_NO_SRCDIR): Add tracefile.h.
* ctf.c: Include "tracefile.h".
* tracefile.h: New file.
* tracefile.c: New file
* tracefile-tfile.c: New file.
* tracepoint.c: Include "tracefile.h".
(free_uploaded_tps, free_uploaded_tsvs): Remove declarations.
(stop_reason_names): Add const.
(trace_file_writer_xfree): Move it to tracefile.c.
(trace_save, trace_save_command, trace_save_tfile): Likewise.
(trace_save_ctf): Likewise.
(struct tfile_trace_file_writer): Move it to tracefile-tfile.c.
(tfile_target_save, tfile_dtor, tfile_start): Likewise.
(tfile_write_header, tfile_write_regblock_type): Likewise.
(tfile_write_status, tfile_write_uploaded_tsv): Likewise.
(tfile_write_uploaded_tp, tfile_write_definition_end): Likewise.
(tfile_write_raw_data, tfile_end): Likewise.
(tfile_trace_file_writer_new): Likewise.
(free_uploaded_tp): Make it extern.
(free_uploaded_tsv): Make it extern.
(_initialize_tracepoint): Move code to register command 'tsave'
to tracefile.c.
* tracepoint.h (stop_reason_names): Declare.
(struct trace_frame_write_ops): Move it to tracefile.h.
(struct trace_file_write_ops): Likewise.
(struct trace_file_writer): Likewise.
(free_uploaded_tsvs, free_uploaded_tps): Declare.
Fix crash on process name "(sd-pam)" (PR 16594). info os processes -fsanitize=address error https://sourceware.org/bugzilla/show_bug.cgi?id=16594 info os processes ================================================================= ==5795== ERROR: AddressSanitizer: heap-use-after-free on address 0x600600214974 at pc 0x757a92 bp 0x7fff95dd9f00 sp 0x7fff95dd9ef0 READ of size 4 at 0x600600214974 thread T0 #0 0x757a91 in get_cores_used_by_process (.../gdb/gdb+0x757a91) At least Fedora 20 has process(es): 6678 ? Ss 0:00 /usr/lib/systemd/systemd --user 6680 ? S 0:00 \_ (sd-pam) and GDB "info os processes" crashes on it as /proc/6680/stat contains: 6680 ((sd-pam)) S 6678 6678 6678 0 -1 1077961024 33 0 0 0 0 0 0 0 20 0 1 0 18568 73768960 120 18446744073709551615 1 1 0 0 0 0 0 4096 0 18446744073709551615 0 0 17 6 0 0 0 0 0 0 0 0 0 0 0 0 0 and GDB fails to find the proper end of the process name "((sd-pam))". Therefore it reads core number off-by-one (it reads 17 instead of 6) and overruns the array. (1) Make the process name parsing more foolproof. (2) Do not trust the parsed number from /proc/PID/stat and verify it against the array size. I noticed that 'ps' gets this right, so I've peeked at its sources, and it just looks for the first ')' starting at the end. https://gitorious.org/procps/procps/source/dc072aced7250fed9b01fb05f0d672678752a63e:proc/readproc.c Look for stat2proc. Given ps does that, I believe the kernel won't ever be changed in a way that would break it. So it sounds like could do strrchr from the end of stat just as well without worry, which is simpler. gdb/ 2014-02-21 Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/16594 * common/linux-osdata.c (linux_common_core_of_thread): Find the end of process name. (get_cores_used_by_process): New parameter num_cores, use it. (linux_xfer_osdata_processes): Pass num_cores to it. * linux-tdep.c (linux_info_proc, linux_fill_prpsinfo): Find the end of process name. Message-ID: <20140217212826.GA15080@host2.jankratochvil.net>
2014-02-21 18:39:40 +01:00
2014-02-21 Jan Kratochvil <jan.kratochvil@redhat.com>
PR gdb/16594
* common/linux-osdata.c (linux_common_core_of_thread): Find the end of
process name.
(get_cores_used_by_process): New parameter num_cores, use it.
(linux_xfer_osdata_processes): Pass num_cores to it.
* linux-tdep.c (linux_info_proc, linux_fill_prpsinfo): Find the end of
process name.
2014-02-21 Andreas Arnez <arnez@vnet.linux.ibm.com>
* target.c (memory_xfer_partial): Fix length arg in call to
breakpoint_xfer_memory.
Fix for PR tdep/16397: SystemTap SDT probe support for x86 doesn't work with "triplet operands" This is the continuation of what Joel proposed on: <https://sourceware.org/ml/gdb-patches/2013-12/msg00977.html> Now that I have already submitted and pushed the patch to split i386_stap_parse_special_token into two smaller functions, it is indeed simpler to understand this patch. It occurs because, on x86, triplet displacement operands are allowed (like "-4+8-20(%rbp)"), and the current parser for this expression is buggy. It does not correctly extract the register name from the expression, which leads to incorrect evaluation. The parser was also being very "generous" with the expression, so I included a few more checks to ensure that we're indeed dealing with a triplet displacement operand. This patch also includes testcases for the two different kind of expressions that can be encountered on x86: the triplet displacement (explained above) and the three-argument displacement (as in "(%rbx,%ebx,-8)"). The tests are obviously arch-dependent and are placed under gdb.arch/. Message-ID: <m3mwj1j12v.fsf@redhat.com> URL: <https://sourceware.org/ml/gdb-patches/2014-01/msg00310.html> gdb/ 2014-02-20 Sergio Durigan Junior <sergiodj@redhat.com> PR tdep/16397 * i386-tdep.c (i386_stap_parse_special_token_triplet): Check if a number comes after the + or - signs. Adjust length of register name to be extracted. gdb/testsuite/ 2014-02-20 Sergio Durigan Junior <sergiodj@redhat.com> PR tdep/16397 * gdb.arch/amd64-stap-special-operands.exp: New file. * gdb.arch/amd64-stap-three-arg-disp.S: Likewise. * gdb.arch/amd64-stap-three-arg-disp.c: Likewise. * gdb.arch/amd64-stap-triplet.S: Likewise. * gdb.arch/amd64-stap-triplet.c: Likewise.
2014-02-20 22:49:09 +01:00
2014-02-20 Sergio Durigan Junior <sergiodj@redhat.com>
PR tdep/16397
* i386-tdep.c (i386_stap_parse_special_token_triplet): Check if a
number comes after the + or - signs. Adjust length of register
name to be extracted.
2014-02-20 Tom Tromey <tromey@redhat.com>
* varobj.h (c_varobj_ops, cplus_varobj_ops, java_varobj_ops)
(ada_varobj_ops): Mark "extern".
2014-02-20 Tom Tromey <tromey@redhat.com>
* dbxread.c (read_dbx_symtab): Remove last_o_file_start.
2014-02-20 Doug Evans <xdje42@gmail.com>
* guile/scm-gsmob.c (gdbscm_init_eqable_gsmob): New arg containing_scm.
All callers updated.
(gdbscm_fill_eqable_gsmob_ptr_slot): Delete arg containing_scm.
All callers updated.
* guile/guile-internal.h (gdbscm_init_eqable_gsmob): Update.
(gdbscm_fill_eqable_gsmob_ptr_slot): Update.
2014-02-20 lin zuojian <manjian2006@gmail.com>
Joel Brobecker <brobecker@adacore.com>
Doug Evans <xdje42@gmail.com>
PR symtab/16581
* dwarf2read.c (struct die_info): New member in_process.
(reset_die_in_process): New function.
(process_die): Set it at the start, reset when returning.
(inherit_abstract_dies): Only call process_die if origin_child_die
not already being processed.
2014-02-20 Joel Brobecker <brobecker@adacore.com>
* windows-nat.c (handle_unload_dll): Add function documentation.
(do_initial_windows_stuff): Add comment explaining why we wait
until after inferior initialization has finished before
processing all DLLs.
2014-02-20 Joel Brobecker <brobecker@adacore.com>
* windows-nat.c (get_module_name): Delete.
(windows_get_exec_module_filename): New function, mostly
inspired from get_module_name.
(windows_pid_to_exec_file): Replace call to get_module_name
by call to windows_get_exec_module_filename.
2014-02-20 Joel Brobecker <brobecker@adacore.com>
* windows-nat.c (handle_load_dll): Rewrite this function's
introductory comment. Remove code using get_module_name
to get the DLL's name.
2014-02-20 Joel Brobecker <brobecker@adacore.com>
* windows-nat.c (get_windows_debug_event): Ignore
LOAD_DLL_DEBUG_EVENT and UNLOAD_DLL_DEBUG_EVENT
if windows_initialization_done == 0.
(windows_add_all_dlls): Renames windows_ensure_ntdll_loaded.
Adjust implementation to always load all DLLs.
(do_initial_windows_stuff): Replace call to
windows_ensure_ntdll_loaded by call to windows_add_all_dlls.
Deprecate windows-specific dll-symbols command and aliases The "dll-symbols" command, specific to native Windows platforms, gives the impression that the symbols were not loaded, first because it completes silently, and second because the "info shared" output does not get updated after the command completes: (gdb) dll-symbols C:\WINDOWS\syswow64\rpcrt4.dll (gdb) info shared From To Syms Read Shared Object Library [...] 0x77e51000 0x77ee2554 No C:\WINDOWS\system32\rpcrt4.dll (we exected the "Syms Read" column to read "Yes"). As far as I can tell, the symbols actually do get loaded, but completely independently from the solib framework, which explains the silent loading and the fact that the "Syms Read" column does not get updated. See windows-nat.c::safe_symbol_file_add_stub, which calls symbol_file_add instead of calling solib_add. But, aside from the fact that the "Syms Read" status does not get updated, I also noticed that it does not take into account the DLL's actual load address when loading its symbols. As a result, I believe that we get it wrong if the DLL does not get loaded at the prefered address. Rather than trying to fix this command, there does not seem to be a reason other than historical for having Windows-specific commands which essentially re-implements the "sharedlibrary" command. The command interface is slightly different (the latter takes a regexp rather than a plain filename), but it should be just as easy to use the "sharedlibrary" command, or its "share" alias, as usisng the "dll-symbols" command. For instance: (gdb) share rpcrt4.dll Reading symbols from C:\WINDOWS\system32\rpcrt4.dll...(no debugging symbols found)...done. Loaded symbols for C:\WINDOWS\system32\rpcrt4.dll (gdb) info shared From To Syms Read Shared Object Library [...] 0x77e51000 0x77ee2554 Yes (*) C:\WINDOWS\system32\rpcrt4.dll This patch therefore deprecates the "dll-symbols" command, as well as its two aliases "add-shared-symbol-files" and "assf", with a view of deleting them as soon as the 7.8 branch gets cut. gdb/ChangeLog: * windows-nat.c (_initialize_windows_nat): Deprecate the "dll-symbols" command. Turn the "add-shared-symbol-files" and "assf" aliases into commands, and deprecate them as well. * NEWS: Add entry explaining that "dll-symbols" and its two aliases are now deprecated. gdb/doc/ChangeLog: * gdb.texinfo (Files): Document "add-shared-symbol-files" and "assf" as being deprecated. (Cygwin Native): Likewise for "dll-symbols". (Non-debug DLL Symbols): Remove reference to "dll-symbols" as a way to force the loading of symbols from a DLL.
2014-01-31 10:22:53 +01:00
2014-02-20 Joel Brobecker <brobecker@adacore.com>
* windows-nat.c (_initialize_windows_nat): Deprecate the
"dll-symbols" command. Turn the "add-shared-symbol-files"
and "assf" aliases into commands, and deprecate them as well.
* NEWS: Add entry explaining that "dll-symbols" and its two
aliases are now deprecated.
2014-02-20 Joel Brobecker <brobecker@adacore.com>
* dec-thread.c (dec_thread_get_ada_task_ptid): Avoid unescaped
new-line in debug string. Remove trailing spaces.
2014-02-19 Stan Shebs <stan@codesourcery.com>
* darwin-nat.c (darwin_xfer_partial): Fix return type.
2014-02-19 Siva Chandra Reddy <sivachandra@google.com>
* NEWS: Add entry for the new feature
* python/py-value.c (valpy_binop): Call value_x_binop for struct
and class values.
2014-02-19 22:38:12 +01:00
2014-02-19 Stan Shebs <stan@codesourcery.com>
* MAINTAINERS: List Yao Qi as nios2 maintainer.
2014-02-19 Pedro Alves <palves@redhat.com>
* common/ptid.h (struct ptid): Mention that process_stratum
targets should prefer ptid.lwp.
2014-02-19 Pedro Alves <palves@redhat.com>
* remote.c (remote_thread_alive, write_ptid, read_ptid)
(read_ptid, remote_newthread_step, remote_threads_extra_info)
(remote_get_ada_task_ptid, append_resumption, remote_stop_ns)
(threadalive_test, remote_pid_to_str): Use the ptid.lwp field to
store remote thread ids rather than ptid.tid.
(_initialize_remote): Adjust.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.c (target_get_unwinder): Rewrite.
(target_get_tailcall_unwinder): Rewrite.
* record-btrace.c (record_btrace_to_get_unwinder): New function.
(record_btrace_to_get_tailcall_unwinder): New function.
(init_record_btrace_ops): Update.
* target.h (struct target_ops) <to_get_unwinder,
to_get_tailcall_unwinder>: Now function pointers. Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* nto-procfs.c (procfs_remove_hw_breakpoint): Add 'self'
argument.
(init_procfs_ops): Correctly set to_remove_hw_breakpoint.
2014-02-19 Tom Tromey <tromey@redhat.com>
* record-btrace.c (record_btrace_decr_pc_after_break): Delegate
directly.
* target-delegates.c: Rebuild.
* target.h (struct target_ops) <to_decr_pc_after_break>: Use
TARGET_DEFAULT_FUNC.
* target.c (default_target_decr_pc_after_break): Rename from
forward_target_decr_pc_after_break. Simplify.
(target_decr_pc_after_break): Rely on delegation.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.c (update_current_target): Do not INHERIT to_doc or
to_magic. Do not de_fault to_open or to_close.
2014-02-19 Tom Tromey <tromey@redhat.com>
* gcore.h (objfile_find_memory_regions): Declare.
* gcore.c (objfile_find_memory_regions): No longer static. Add
"self" argument.
(_initialize_gcore): Don't call exec_set_find_memory_regions.
* exec.c: Include gcore.h.
(exec_set_find_memory_regions): Remove.
(exec_find_memory_regions): Remove.
(exec_do_find_memory_regions): Remove.
(init_exec_ops): Update.
* defs.h (exec_set_find_memory_regions): Remove.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.h (struct target_ops) <to_extra_thread_info,
to_thread_name, to_pid_to_exec_file, to_get_section_table,
to_memory_map, to_read_description, to_traceframe_info>: Use NULL,
not 0, in TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.c (complete_target_initialization): Remove casts. Use
return_zero_has_execution.
(return_zero): Add "ignore" argument.
(return_zero_has_execution): New function.
(init_dummy_target): Remove casts. Use
return_zero_has_execution.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.c (update_current_target): Update comments. Do not
INHERIT to_stratum.
2014-02-19 Tom Tromey <tromey@redhat.com>
* arm-linux-nat.c (arm_linux_read_description): Delegate when
needed.
* corelow.c (core_read_description): Delegate when needed.
* remote.c (remote_read_description): Delegate when needed.
* target-delegates.c: Rebuild.
* target.c (target_read_description): Rewrite.
* target.h (struct target_ops) <to_read_description>: Update
comment. Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_can_run.
(find_default_run_target): Check against delegate_can_run.
* target.h (struct target_ops) <to_can_run>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_disconnect): Unconditionally delegate.
* target.h (struct target_ops) <to_disconnect>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* record.c (record_stop): Unconditionally delegate.
* target-delegates.c: Rebuild.
* target.c (target_stop_recording): Unconditionally delegate.
* target.h (struct target_ops) <to_stop_recording>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_enable_btrace): Unconditionally delegate.
* target.h (struct target_ops) <to_enable_btrace>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_read_btrace): Unconditionally delegate.
* target.h (struct target_ops) <to_read_btrace>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_teardown_btrace): Unconditionally delegate.
* target.h (struct target_ops) <to_teardown_btrace>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_disable_btrace): Unconditionally delegate.
* target.h (struct target_ops) <to_disable_btrace>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (default_search_memory): New function.
(simple_search_memory): Update comment.
(target_search_memory): Unconditionally delegate.
* target.h (struct target_ops) <to_search_memory>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* auxv.c (default_auxv_parse): No longer static.
(target_auxv_parse): Unconditionally delegate.
* auxv.h (default_auxv_parse): Declare.
* target-delegates.c: Rebuild.
* target.c: Include auxv.h.
* target.h (struct target_ops) <to_auxv_parse>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_memory_map): Unconditionally delegate.
* target.h (struct target_ops) <to_memory_map>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_thread_alive): Unconditionally delegate.
* target.h (struct target_ops) <to_thread_alive>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_save_record): Unconditionally delegate.
* target.h (struct target_ops) <to_save_record>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_delete_record): Unconditionally delegate.
* target.h (struct target_ops) <to_delete_record>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_record_is_replaying): Unconditionally
delegate.
* target.h (struct target_ops) <to_record_is_replaying>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_goto_record_begin): Unconditionally delegate.
* target.h (struct target_ops) <to_goto_record_begin>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_goto_record_end): Unconditionally delegate.
* target.h (struct target_ops) <to_goto_record_end>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_goto_record): Unconditionally delegate.
* target.h (struct target_ops) <to_goto_record>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_insn_history): Unconditionally delegate.
* target.h (struct target_ops) <to_insn_history>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_insn_history_from): Unconditionally delegate.
* target.h (struct target_ops) <to_insn_history_from>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_insn_history_range): Unconditionally delegate.
* target.h (struct target_ops) <to_insn_history_range>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_call_history): Unconditionally delegate.
* target.h (struct target_ops) <to_call_history>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_call_history_from): Unconditionally delegate.
* target.h (struct target_ops) <to_call_history_from>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_call_history_range): Unconditionally delegate.
* target.h (struct target_ops) <to_call_history_range>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_verify_memory): Unconditionally delegate.
* target.h (struct target_ops) <to_verify_memory>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_core_of_thread): Unconditionally delegate.
* target.h (struct target_ops) <to_core_of_thread>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_flash_done): Unconditionally delegate.
* target.h (struct target_ops) <to_flash_done>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_flash_erase): Unconditionally delegate.
* target.h (struct target_ops) <to_flash_erase>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_get_section_table): Unconditionally delegate.
* target.h (struct target_ops) <to_get_section_table>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_pid_to_str): Unconditionally delegate.
(init_dummy_target): Don't initialize to_pid_to_str.
(default_pid_to_str): Rename from dummy_pid_to_str.
* target.h (struct target_ops) <to_pid_to_str>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_find_new_threads): Unconditionally delegate.
* target.h (struct target_ops) <to_find_new_threads>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_program_signals): Unconditionally delegate.
* target.h (struct target_ops) <to_program_signals>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_pass_signals): Unconditionally delegate.
* target.h (struct target_ops) <to_pass_signals>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (default_mourn_inferior): New function.
(target_mourn_inferior): Unconditionally delegate.
* target.h (struct target_ops) <to_mourn_inferior>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (default_follow_fork): New function.
(target_follow_fork): Unconditionally delegate.
* target.h (struct target_ops) <to_follow_fork>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_kill): Unconditionally delegate.
* target.h (struct target_ops) <to_kill>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_masked_watch_num_registers): Unconditionally
delegate.
* target.h (struct target_ops) <to_masked_watch_num_registers>:
Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_remove_mask_watchpoint): Unconditionally
delegate.
* target.h (struct target_ops) <to_remove_mask_watchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_insert_mask_watchpoint): Unconditionally
delegate.
* target.h (struct target_ops) <to_insert_mask_watchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_ranged_break_num_registers): Unconditionally
delegate.
* target.h (struct target_ops) <to_ranged_break_num_registers>:
Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_fetch_registers): Unconditionally delegate.
* target.h (struct target_ops) <to_fetch_registers>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_stop.
* target.h (struct target_ops) <to_stop>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_can_run_breakpoint_commands.
* target.h (struct target_ops) <to_can_run_breakpoint_commands>:
Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_supports_evaluation_of_breakpoint_conditions.
* target.h (struct target_ops)
<to_supports_evaluation_of_breakpoint_conditions>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_augmented_libraries_svr4_read.
* target.h (struct target_ops) <to_augmented_libraries_svr4_read>:
Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_can_use_agent.
* target.h (struct target_ops) <to_can_use_agent>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_use_agent.
* target.h (struct target_ops) <to_use_agent>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_traceframe_info.
(return_null): Remove.
* target.h (struct target_ops) <to_traceframe_info>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_static_tracepoint_markers_by_strid.
* target.h (struct target_ops)
<to_static_tracepoint_markers_by_strid>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_static_tracepoint_marker_at.
* target.h (struct target_ops) <to_static_tracepoint_marker_at>:
Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_permissions.
* target.h (struct target_ops) <to_set_permissions>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_tib_address.
* target.h (struct target_ops) <to_get_tib_address>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_trace_notes.
* target.h (struct target_ops) <to_set_trace_notes>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't initialize
to_set_trace_buffer_size.
* target.h (struct target_ops) <to_set_trace_buffer_size>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_circular_trace_buffer.
* target.h (struct target_ops) <to_set_circular_trace_buffer>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_disconnected_tracing.
* target.h (struct target_ops) <to_set_disconnected_tracing>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_min_fast_tracepoint_insn_len.
(return_minus_one): Remove.
* target.h (struct target_ops)
<to_get_min_fast_tracepoint_insn_len>: Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_raw_trace_data.
* target.h (struct target_ops) <to_get_raw_trace_data>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_upload_trace_state_variables.
* target.h (struct target_ops) <to_upload_trace_state_variables>:
Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_upload_tracepoints.
* target.h (struct target_ops) <to_upload_tracepoints>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_save_trace_data.
* target.h (struct target_ops) <to_save_trace_data>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_trace_state_variable_value.
* target.h (struct target_ops)
<to_get_trace_state_variable_value>: Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_find.
* target.h (struct target_ops): Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_stop.
* target.h (struct target_ops) <to_trace_stop>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_tracepoint_status.
* target.h (struct target_ops) <to_get_tracepoint_status>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_trace_status.
* target.h (struct target_ops) <to_get_trace_status>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_start.
* target.h (struct target_ops) <to_trace_start>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_set_readonly_regions.
* target.h (struct target_ops) <to_trace_set_readonly_regions>:
Use TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_disable_tracepoint.
* target.h (struct target_ops) <to_disable_tracepoint>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_enable_tracepoint.
* target.h (struct target_ops) <to_enable_tracepoint>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_download_trace_state_variable.
* target.h (struct target_ops) <to_download_trace_state_variable>:
Use TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_can_download_tracepoint.
* target.h (struct target_ops) <to_can_download_tracepoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_download_tracepoint.
* target.h (struct target_ops) <to_download_tracepoint>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_trace_init.
* target.h (struct target_ops) <to_trace_init>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_supports_string_tracing.
* target.h (struct target_ops) <to_supports_string_tracing>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_supports_enable_disable_tracepoint.
* target.h (struct target_ops)
<to_supports_enable_disable_tracepoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_supports_multi_process.
* target.h (struct target_ops) <to_supports_multi_process>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_ada_task_ptid.
* target.h (struct target_ops) <to_get_ada_task_ptid>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_thread_architecture.
* target.h (struct target_ops) <to_thread_architecture>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_execution_direction.
* target.h (struct target_ops) <to_execution_direction>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_can_execute_reverse.
* target.h (struct target_ops) <to_can_execute_reverse>: Use
TARGET_DEFAULT_RETURN.
(target_can_execute_reverse): Unconditionally delegate.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_goto_bookmark.
(dummy_goto_bookmark): Remove.
(init_dummy_target): Don't inherit or default to_goto_bookmark.
* target.h (struct target_ops) <to_goto_bookmark>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_bookmark.
(dummy_get_bookmark): Remove.
(init_dummy_target): Don't inherit or default to_get_bookmark.
* target.h (struct target_ops) <to_get_bookmark>: Use
TARGET_DEFAULT_NORETURN
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_make_corefile_notes.
(init_dummy_target): Don't initialize to_make_corefile_notes.
* target.h (struct target_ops) <to_make_corefile_notes>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_find_memory_regions.
(init_dummy_target): Don't initialize to_find_memory_regions.
* target.h (struct target_ops) <to_find_memory_regions>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_log_command.
* target.h (struct target_ops) <to_log_command>: Use
TARGET_DEFAULT_IGNORE.
(target_log_command): Unconditionally delegate.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_pid_to_exec_file.
* target.h (struct target_ops) <to_pid_to_exec_file>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_thread_name.
(target_thread_name): Unconditionally delegate.
* target.h (struct target_ops) <to_thread_name>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_extra_thread_info.
* target.h (struct target_ops) <to_extra_thread_info>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_has_exited.
* target.h (struct target_ops) <to_has_exited>: Use
TARGET_DEFAULT_RETURN..
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_set_syscall_catchpoint.
(return_one): Remove.
* target.h (struct target_ops) <to_set_syscall_catchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_insert_exec_catchpoint.
* target.h (struct target_ops) <to_insert_exec_catchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-01-08 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_insert_exec_catchpoint.
* target.h (struct target_ops) <to_insert_exec_catchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_remove_vfork_catchpoint.
* target.h (struct target_ops) <to_remove_vfork_catchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_insert_vfork_catchpoint.
* target.h (struct target_ops) <to_insert_vfork_catchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_remove_fork_catchpoint.
* target.h (struct target_ops) <to_remove_fork_catchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_insert_fork_catchpoint.
* target.h (struct target_ops) <to_insert_fork_catchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_post_startup_inferior.
* target.h (struct target_ops) <to_post_startup_inferior>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_load.
* target.h (struct target_ops) <to_load>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_terminal_info.
* target.h (struct target_ops) <to_terminal_info>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_terminal_save_ours.
* target.h (struct target_ops) <to_terminal_save_ours>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_terminal_ours.
* target.h (struct target_ops) <to_terminal_ours>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_terminal_ours_for_output.
* target.h (struct target_ops) <to_terminal_ours_for_output>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_terminal_inferior.
* target.h (struct target_ops) <to_terminal_inferior>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_terminal_init.
* target.h (struct target_ops) <to_terminal_init>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_can_accel_watchpoint_condition.
* target.h (struct target_ops)
<to_can_accel_watchpoint_condition>: Use TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_region_ok_for_hw_watchpoint.
* target.h (struct target_ops) <to_region_ok_for_hw_watchpoint>:
Use TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_watchpoint_addr_within_range.
* target.h (struct target_ops) <to_watchpoint_addr_within_range>:
Use TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_remove_watchpoint.
* target.h (struct target_ops) <to_remove_watchpoint>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_insert_watchpoint.
* target.h (struct target_ops) <to_insert_watchpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_remove_hw_breakpoint.
* target.h (struct target_ops) <to_remove_hw_breakpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_insert_hw_breakpoint.
* target.h (struct target_ops) <to_insert_hw_breakpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_can_use_hw_breakpoint.
* target.h (struct target_ops) <to_can_use_hw_breakpoint>: Use
TARGET_DEFAULT_RETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_files_info.
* target.h (struct target_ops) <to_files_info>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_store.
* target.h (struct target_ops) <to_store>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_post_attach.
* target.h (struct target_ops) <to_post_attach>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_rcmd.
(default_rcmd): New function.
(do_monitor_command): Unconditionally delegate.
* target.h (struct target_ops) <to_rmcd>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (init_dummy_target): Don't initialize to_attach.
(target_attach): Unconditionally delegate.
* target.h (struct target_ops) <to_attach>: Use
TARGET_DEFAULT_FUNC.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_detach): Unconditionally delegate.
(init_dummy_target): Don't initialize to_detach.
* target.h (struct target_ops) <to_detach>: Use
TARGET_DEFAULT_IGNORE.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_augmented_libraries_svr4_read>:
Add argument.
(target_augmented_libraries_svr4_read): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_augmented_libraries_svr4_read): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_call_history_range>: Add
argument.
* target.c (target_call_history_range): Add argument.
* record-btrace.c (record_btrace_call_history_range): Add 'self'
argument.
(record_btrace_call_history_from): Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_call_history_from>: Add
argument.
* target.c (target_call_history_from): Add argument.
* record-btrace.c (record_btrace_call_history_from): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_call_history>: Add argument.
* target.c (target_call_history): Add argument.
* record-btrace.c (record_btrace_call_history): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_insn_history_range>: Add
argument.
* target.c (target_insn_history_range): Add argument.
* record-btrace.c (record_btrace_insn_history_range): Add 'self'
argument.
(record_btrace_insn_history_from): Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_insn_history_from>: Add
argument.
* target.c (target_insn_history_from): Add argument.
* record-btrace.c (record_btrace_insn_history_from): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_insn_history>: Add argument.
* target.c (target_insn_history): Add argument.
* record-btrace.c (record_btrace_insn_history): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_goto_record>: Add argument.
* target.c (target_goto_record): Add argument.
* record-full.c (record_full_goto): Add 'self' argument.
* record-btrace.c (record_btrace_goto): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_goto_record_end>: Add argument.
* target.c (target_goto_record_end): Add argument.
* record-full.c (record_full_goto_end): Add 'self' argument.
* record-btrace.c (record_btrace_goto_end): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_goto_record_begin>: Add
argument.
* target.c (target_goto_record_begin): Add argument.
* record-full.c (record_full_goto_begin): Add 'self' argument.
* record-btrace.c (record_btrace_goto_begin): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_record_is_replaying>: Add
argument.
* target.c (target_record_is_replaying): Add argument.
* record-full.c (record_full_is_replaying): Add 'self' argument.
* record-btrace.c (record_btrace_is_replaying): Add 'self'
argument.
(record_btrace_xfer_partial, record_btrace_store_registers)
(record_btrace_prepare_to_store, record_btrace_resume)
(record_btrace_wait, record_btrace_decr_pc_after_break)
(record_btrace_find_new_threads, record_btrace_thread_alive):
Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_delete_record>: Add argument.
* target.c (target_delete_record): Add argument.
* record-full.c (record_full_delete): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_save_record>: Add argument.
* target.c (target_save_record): Add argument.
* record-full.c (record_full_save): Add 'self' argument.
(record_full_save): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_info_record>: Add argument.
* target.c (target_info_record): Add argument.
* record.c (info_record_command): Add argument.
* record-full.c (record_full_info): Add 'self' argument.
* record-btrace.c (record_btrace_info): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_stop_recording>: Add argument.
* target.c (target_stop_recording): Add argument.
* record.c (record_stop): Add argument.
* record-btrace.c (record_btrace_stop_recording): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_read_btrace>: Add argument.
* target.c (struct target_ops) <to_read_btrace>: Add argument.
* remote.c (struct target_ops) <to_read_btrace>: Add 'self'
argument.
* amd64-linux-nat.c (amd64_linux_read_btrace): New function.
(_initialize_amd64_linux_nat): Use it.
* i386-linux-nat.c (i386_linux_read_btrace): New function.
(_initialize_i386_linux_nat): Use it.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_teardown_btrace>: Add argument.
* target.c (target_teardown_btrace): Add argument.
* remote.c (remote_teardown_btrace): Add 'self' argument.
* i386-linux-nat.c (i386_linux_teardown_btrace): Add 'self'
argument.
* amd64-linux-nat.c (amd64_linux_teardown_btrace): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_disable_btrace>: Add argument.
* target.c (target_disable_btrace): Add argument.
* remote.c (remote_disable_btrace): Add 'self' argument.
* i386-linux-nat.c (i386_linux_disable_btrace): Add 'self'
argument.
* amd64-linux-nat.c (amd64_linux_disable_btrace): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_enable_btrace>: Add argument.
* target.c (target_enable_btrace): Add argument.
* remote.c (remote_enable_btrace): Add 'self' argument.
* i386-linux-nat.c (i386_linux_enable_btrace): Add 'self'
argument.
* amd64-linux-nat.c (amd64_linux_enable_btrace): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_can_use_agent>: Add argument.
(target_can_use_agent): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_can_use_agent): Add 'self' argument.
* inf-child.c (inf_child_can_use_agent): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_use_agent>: Add argument.
(target_use_agent): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_use_agent): Add 'self' argument.
* inf-child.c (inf_child_use_agent): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* tracepoint.c (tfile_traceframe_info): Add 'self' argument.
* target.h (struct target_ops) <to_traceframe_info>: Add argument.
(target_traceframe_info): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_traceframe_info): Add 'self' argument.
* ctf.c (ctf_traceframe_info): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (target_static_tracepoint_markers_by_strid): Add
argument.
(struct target_ops) <to_static_tracepoint_markers_by_strid>: Add
'self' argument.
* target.c (update_current_target): Update.
* remote.c (struct target_ops)
<to_static_tracepoint_markers_by_strid>: Add 'self' argument.
* linux-nat.c (struct target_ops)
<to_static_tracepoint_markers_by_strid>: Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_static_tracepoint_marker_at>:
Add argument.
(target_static_tracepoint_marker_at): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_static_tracepoint_marker_at): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_set_permissions>: Add argument.
(target_set_permissions): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_set_permissions): Add 'self' argument.
(remote_start_remote): Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_get_tib_address): Add 'self' argument.
* target.h (struct target_ops) <to_get_tib_address>: Add argument.
(target_get_tib_address): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_get_tib_address): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_set_trace_notes>: Add argument.
(target_set_trace_notes): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_set_trace_notes): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_set_trace_buffer_size>: Add
argument.
(target_set_trace_buffer_size): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_set_trace_buffer_size): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_set_circular_trace_buffer>: Add
argument.
(target_set_circular_trace_buffer): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_set_circular_trace_buffer): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_set_disconnected_tracing>: Add
argument.
(target_set_disconnected_tracing): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_set_disconnected_tracing): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops)
<to_get_min_fast_tracepoint_insn_len>: Add argument.
(target_get_min_fast_tracepoint_insn_len): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_get_min_fast_tracepoint_insn_len): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_get_raw_trace_data>: Add
argument.
(target_get_raw_trace_data): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_get_raw_trace_data): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_upload_trace_state_variables>:
Add argument.
(target_upload_trace_state_variables): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_upload_trace_state_variables): Add 'self'
argument.
(remote_start_remote): Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_upload_tracepoints>: Add
argument.
(target_upload_tracepoints): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_upload_tracepoints): Add 'self' argument.
(remote_start_remote): Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_save_trace_data>: Add argument.
(target_save_trace_data): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_save_trace_data): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* tracepoint.c (tfile_get_trace_state_variable_value): Add 'self'
argument.
* target.h (struct target_ops)
<to_get_trace_state_variable_value>: Add argument.
(target_get_trace_state_variable_value): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_get_trace_state_variable_value): Add 'self'
argument.
* ctf.c (ctf_get_trace_state_variable_value): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* tracepoint.c (tfile_trace_find): Add 'self' argument.
* target.h (struct target_ops) <to_trace_find>: Add argument.
(target_trace_find): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_trace_find): Add 'self' argument.
* ctf.c (ctf_trace_find): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_trace_stop>: Add argument.
(target_trace_stop): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_trace_stop): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* tracepoint.c (tfile_get_tracepoint_status): Add 'self' argument.
* target.h (struct target_ops) <to_get_tracepoint_status>: Add
argument.
(target_get_tracepoint_status): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_get_tracepoint_status): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* tracepoint.c (tfile_get_trace_status): Add 'self' argument.
* target.h (struct target_ops) <to_get_trace_status>: Add
argument.
(target_get_trace_status): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_get_trace_status): Add 'self' argument.
(remote_start_remote, remote_can_download_tracepoint): Update.
* ctf.c (ctf_get_trace_status): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_trace_start>: Add argument.
(target_trace_start): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_trace_start): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_trace_set_readonly_regions>:
Add argument.
(target_trace_set_readonly_regions): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_trace_set_readonly_regions): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_disable_tracepoint>: Add
argument.
(target_disable_tracepoint): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_disable_tracepoint): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_enable_tracepoint>: Add
argument.
(target_enable_tracepoint): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_enable_tracepoint): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_download_trace_state_variable>:
Add argument.
(target_download_trace_state_variable): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_download_trace_state_variable): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_can_download_tracepoint>: Add
argument.
(target_can_download_tracepoint): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_can_download_tracepoint): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_download_tracepoint>: Add
argument.
(target_download_tracepoint): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_download_tracepoint): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_trace_init>: Add argument.
(target_trace_init): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_trace_init): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_readlink>: Add argument.
* target.c (target_fileio_readlink): Add argument.
* remote.c (remote_hostio_readlink): Add 'self' argument.
* inf-child.c (inf_child_fileio_readlink): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_unlink>: Add argument.
* target.c (target_fileio_unlink): Add argument.
* remote.c (remote_hostio_unlink): Add 'self' argument.
(remote_file_delete): Update.
* inf-child.c (inf_child_fileio_unlink): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_close>: Add argument.
* target.c (target_fileio_close): Add argument.
* remote.c (remote_hostio_close): Add 'self' argument.
(remote_hostio_close_cleanup): Update.
(remote_bfd_iovec_close, remote_file_put, remote_file_get):
Update.
* inf-child.c (inf_child_fileio_close): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_pread>: Add argument.
* target.c (target_fileio_pread): Add argument.
* remote.c (remote_hostio_pread): Add 'self' argument.
(remote_bfd_iovec_pread, remote_file_get): Update.
* inf-child.c (inf_child_fileio_pread): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_pwrite>: Add argument.
* target.c (target_fileio_pwrite): Add argument.
* remote.c (remote_hostio_pwrite): Add 'self' argument.
(remote_file_put): Update.
* inf-child.c (inf_child_fileio_pwrite): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_open>: Add argument.
* target.c (target_fileio_open): Add argument.
* remote.c (remote_hostio_open): Add 'self' argument.
(remote_bfd_iovec_open): Add 'self' argument.
(remote_file_put): Add 'self' argument.
(remote_file_get): Add 'self' argument.
* inf-child.c (inf_child_fileio_open): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_can_run_breakpoint_commands>:
Add argument.
(target_can_run_breakpoint_commands): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_can_run_breakpoint_commands): Add 'self'
argument.
(remote_insert_breakpoint): Add 'self' argument.
(remote_insert_hw_breakpoint): Add 'self' argument.
(remote_can_run_breakpoint_commands): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops)
<to_supports_evaluation_of_breakpoint_conditions>: Add argument.
(target_supports_evaluation_of_breakpoint_conditions): Add
argument.
* target.c (update_current_target): Update.
* remote.c (remote_supports_cond_breakpoints): Add 'self'
argument.
(remote_insert_breakpoint): Add 'self' argument.
(remote_insert_hw_breakpoint): Add 'self' argument.
(remote_supports_cond_breakpoints): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_supports_string_tracing>: Add
argument.
(target_supports_string_tracing): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_supports_string_tracing): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops)
<to_supports_disable_randomization>: Add argument.
* target.c (find_default_supports_disable_randomization): Add
argument.
(target_supports_disable_randomization): Add argument.
(find_default_supports_disable_randomization): Add 'self'
argument.
* remote.c (extended_remote_supports_disable_randomization): Add
'self' argument.
(remote_supports_disable_randomization): Add 'self' argument.
(extended_remote_create_inferior): Update.
* linux-nat.c (linux_nat_supports_disable_randomization): Add
'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops)
<to_supports_enable_disable_tracepoint>: Add argument.
(target_supports_enable_disable_tracepoint): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_supports_enable_disable_tracepoint): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_supports_multi_process>: Add
argument.
(target_supports_multi_process): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_supports_multi_process): Add 'self' argument.
* linux-nat.c (linux_nat_supports_multi_process): Add 'self'
argument.
* darwin-nat.c (darwin_supports_multi_process): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_execution_direction>: Add
argument.
(target_execution_direction): Add argument.
* target.c (default_execution_direction): Add 'self' argument.
* record-full.c (record_full_execution_direction): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_can_execute_reverse>: Add
argument.
(target_can_execute_reverse): Add argument.
* remote.c (remote_can_execute_reverse): Add 'self' argument.
* record-full.c (record_full_can_execute_reverse): Add 'self'
argument.
* record-btrace.c (record_btrace_can_execute_reverse): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_get_ada_task_ptid): Add 'self' argument.
* target.h (struct target_ops) <to_get_ada_task_ptid>: Add
argument.
(target_get_ada_task_ptid): Add argument.
* target.c (update_current_target): Update.
(default_get_ada_task_ptid): Add 'self' argument.
* sol-thread.c (sol_get_ada_task_ptid): Add 'self' argument.
* remote.c (remote_get_ada_task_ptid): Add 'self' argument.
* ravenscar-thread.c (ravenscar_get_ada_task_ptid): Add 'self'
argument.
* linux-thread-db.c (thread_db_get_ada_task_ptid): Add 'self'
argument.
* inf-ttrace.c (inf_ttrace_get_ada_task_ptid): Add 'self'
argument.
* dec-thread.c (dec_thread_get_ada_task_ptid): Add 'self'
argument.
* darwin-nat.c (darwin_get_ada_task_ptid): Add 'self' argument.
* aix-thread.c (aix_thread_get_ada_task_ptid): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_goto_bookmark>: Add argument.
(target_goto_bookmark): Add argument.
* target.c (dummy_goto_bookmark): Add 'self' argument.
* record-full.c (record_full_goto_bookmark): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_get_bookmark>: Add argument.
(target_get_bookmark): Add argument.
* target.c (dummy_get_bookmark): Add 'self' argument.
* record-full.c (record_full_get_bookmark): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_make_corefile_notes>: Add
argument.
(target_make_corefile_notes): Add argument.
* target.c (dummy_make_corefile_notes): Add 'self' argument.
* procfs.c (procfs_make_note_section): Add 'self' argument.
(procfs_make_note_section): Add 'self' argument.
(procfs_make_note_section): Add 'self' argument.
* linux-nat.c (linux_nat_make_corefile_notes): Add 'self'
argument.
* fbsd-nat.h (fbsd_make_corefile_notes): Add 'self' argument.
* fbsd-nat.c (fbsd_make_corefile_notes): Add 'self' argument.
* exec.c (exec_make_note_section): Add 'self' argument.
(exec_make_note_section): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_find_memory_regions>: Add
argument.
(target_find_memory_regions): Add argument.
* target.c (dummy_find_memory_regions): Add 'self' argument.
* procfs.c (proc_find_memory_regions): Add 'self' argument.
* gnu-nat.c (gnu_find_memory_regions): Add 'self' argument.
* fbsd-nat.h (fbsd_find_memory_regions): Add 'self' argument.
* fbsd-nat.c (fbsd_find_memory_regions): Add 'self' argument.
* exec. (exec_do_find_memory_regions): New global.
(exec_set_find_memory_regions): Rewrite.
(exec_find_memory_regions): New function.
(init_exec_ops): Use exec_find_memory_regions.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_supports_non_stop>: Add
argument.
* target.c (find_default_supports_non_stop): Add argument.
(target_supports_non_stop): Add argument.
(find_default_supports_non_stop): Add 'self' argument.
* remote.c (remote_supports_non_stop): Add 'self' argument.
* linux-nat.c (linux_nat_supports_non_stop): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_log_command>: Add argument.
(target_log_command): Add argument.
* serial.h (serial_log_command): Add 'self' argument.
* serial.c (serial_log_command): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_pid_to_exec_file): Add 'self' argument.
* target.h (struct target_ops) <to_pid_to_exec_file>: Add
argument.
(target_pid_to_exec_file): Add argument.
* target.c (debug_to_pid_to_exec_file): Add argument.
(update_current_target): Update.
* nbsd-nat.h (nbsd_pid_to_exec_file): Add 'self' argument.
* nbsd-nat.c (nbsd_pid_to_exec_file): Add 'self' argument.
* linux-nat.c (linux_child_pid_to_exec_file): Add 'self' argument.
(linux_handle_extended_wait): Update.
* inf-child.c (inf_child_pid_to_exec_file): Add 'self' argument.
* fbsd-nat.h (fbsd_pid_to_exec_file): Add 'self' argument.
* fbsd-nat.c (fbsd_pid_to_exec_file): Add 'self' argument.
* darwin-nat.c (darwin_pid_to_exec_file): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_rcmd>: Add argument.
(target_rcmd): Add argument.
* target.c (debug_to_rcmd): Add argument.
(update_current_target, do_monitor_command): Update.
* remote.c (remote_rcmd): Add 'self' argument.
* monitor.c (monitor_rcmd): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_stop): Add 'self' argument.
* target.h (struct target_ops) <to_stop>: Add argument.
* target.c (target_stop): Add argument.
(debug_to_stop): Add argument.
(update_current_target): Update.
* remote.c (remote_stop): Add 'self' argument.
* remote-sim.c (gdbsim_stop): Add 'self' argument.
(gdbsim_cntrl_c): Update.
* remote-m32r-sdi.c (m32r_stop): Add 'self' argument.
* procfs.c (procfs_stop): Add 'self' argument.
* nto-procfs.c (procfs_stop): Add 'self' argument.
* monitor.c (monitor_stop): Add 'self' argument.
(monitor_open): Update.
* linux-nat.c (linux_nat_stop): Add argument.
* inf-ptrace.c (inf_ptrace_stop): Add 'self' argument.
* gnu-nat.c (gnu_stop): Add 'self' argument.
* darwin-nat.c (darwin_stop): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_thread_name>: Add argument.
* target.c (target_thread_name): Add argument.
(update_current_target): Update.
* linux-nat.c (linux_nat_thread_name): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_extra_thread_info>: Add
argument.
(target_extra_thread_info): Add argument.
* target.c (update_current_target): Update.
* remote.c (remote_threads_extra_info): Add 'self' argument.
* ravenscar-thread.c (ravenscar_extra_thread_info): Add 'self'
argument.
* nto-tdep.h (nto_extra_thread_info): Add 'self' argument.
* nto-tdep.c (nto_extra_thread_info): Add 'self' argument.
* linux-thread-db.c (thread_db_extra_thread_info): Add 'self'
argument.
* inf-ttrace.c (inf_ttrace_extra_thread_info): Add 'self'
argument.
* bsd-uthread.c (bsd_uthread_extra_thread_info): Add 'self'
argument.
* aix-thread.c (aix_thread_extra_thread_info): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_program_signals>: Add argument.
* target.c (target_program_signals): Add argument.
* remote.c (remote_program_signals): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_pass_signals>: Add argument.
* target.c (target_pass_signals): Add argument.
* remote.c (remote_pass_signals): Add 'self' argument.
(remote_start_remote): Update.
* procfs.c (procfs_pass_signals): Add 'self' argument.
* nto-procfs.c (procfs_pass_signals): Add 'self' argument.
* linux-nat.c (linux_nat_pass_signals): Add 'self' argument.
(linux_nat_create_inferior, linux_nat_attach): Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_can_run): Add 'self' argument.
* target.h (struct target_ops) <to_can_run>: Add argument.
(target_can_run): Add argument.
* target.c (debug_to_can_run): Add argument.
(update_current_target): Update.
* nto-procfs.c (procfs_can_run): Add 'self' argument.
* inf-child.c (inf_child_can_run): Add 'self' argument.
* go32-nat.c (go32_can_run): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_has_exited>: Add argument.
(target_has_exited): Add argument.
* target.c (debug_to_has_exited): Add argument.
(update_current_target): Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_set_syscall_catchpoint>: Add
argument.
(target_set_syscall_catchpoint): Add argument.
* linux-nat.c (linux_child_set_syscall_catchpoint): Add 'self'
argument.
* target.c (update_current_target): Update.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_remove_exec_catchpoint>: Add
argument.
(target_remove_exec_catchpoint): Add argument.
* target.c (debug_to_remove_exec_catchpoint): Add argument.
(update_current_target): Update.
* linux-nat.c (linux_child_remove_exec_catchpoint): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_insert_exec_catchpoint>: Add
argument.
(target_insert_exec_catchpoint): Add argument.
* target.c (debug_to_insert_exec_catchpoint): Add argument.
(update_current_target): Update.
* linux-nat.c (linux_child_insert_exec_catchpoint): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_remove_vfork_catchpoint>: Add
argument.
(target_remove_vfork_catchpoint): Add argument.
* target.c (debug_to_remove_vfork_catchpoint): Add argument.
(update_current_target): Update.
* linux-nat.c (linux_child_remove_vfork_catchpoint): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_insert_vfork_catchpoint>: Add
argument.
(target_insert_vfork_catchpoint): Add argument.
* target.c (debug_to_insert_vfork_catchpoint): Add argument.
(update_current_target): Update.
* linux-nat.c (linux_child_insert_vfork_catchpoint): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_remove_fork_catchpoint>: Add
argument.
(target_remove_fork_catchpoint): Add argument.
* target.c (debug_to_remove_fork_catchpoint): Add argument.
(update_current_target): Update.
* linux-nat.c (linux_child_remove_fork_catchpoint): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_insert_fork_catchpoint>: Add
argument.
(target_insert_fork_catchpoint): Add argument.
* target.c (debug_to_insert_fork_catchpoint): Add argument.
(update_current_target): Update.
* linux-nat.c (linux_child_insert_fork_catchpoint): Add 'self'
argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_post_startup_inferior>: Add
argument.
(target_post_startup_inferior): Add argument.
* target.c (debug_to_post_startup_inferior): Add argument.
(update_current_target): Update.
* spu-linux-nat.c (spu_child_post_startup_inferior): Add 'self'
argument.
* linux-nat.c (linux_child_post_startup_inferior): Add 'self'
argument.
* inf-ptrace.c (inf_ptrace_post_startup_inferior): Add 'self'
argument.
* inf-child.c (inf_child_post_startup_inferior): Add 'self'
argument.
* i386-linux-nat.c (i386_linux_child_post_startup_inferior): Add
'self' argument.
(super_post_startup_inferior): Likewise.
* amd64-linux-nat.c (amd64_linux_child_post_startup_inferior): Add
'self' argument.
(super_post_startup_inferior): Likewise.
* aarch64-linux-nat.c (aarch64_linux_child_post_startup_inferior):
Add 'self' argument.
(super_post_startup_inferior): Likewise.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_load>: Add argument.
* target.c (target_load): Add argument.
(debug_to_load): Add argument.
(update_current_target): Update.
* remote.c (remote_load): Add 'self' argument.
* remote-sim.c (gdbsim_load): Add 'self' argument.
* remote-mips.c (mips_load): Add 'self' argument.
* remote-m32r-sdi.c (m32r_load): Add 'self' argument.
* monitor.c (monitor_load): Add 'self' argument.
* m32r-rom.c (m32r_load_gen): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_terminal_info>: Add argument.
(target_terminal_info): Add argument.
* target.c (debug_to_terminal_info): Add argument.
(default_terminal_info): Likewise.
* inflow.c (child_terminal_info): Add 'self' argument.
* inferior.h (child_terminal_info): Add 'self' argument.
* go32-nat.c (go32_terminal_info): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_terminal_save_ours>: Add
argument.
(target_terminal_save_ours): Add argument.
* target.c (debug_to_terminal_save_ours): Add argument.
(update_current_target): Update.
* inflow.c (terminal_save_ours): Add 'self' argument.
* inferior.h (terminal_save_ours): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_terminal_ours>: Add argument.
(target_terminal_ours): Add argument.
* target.c (debug_to_terminal_ours): Add argument.
(update_current_target): Update.
* remote.c (remote_terminal_ours): Add 'self' argument.
(remote_close): Update.
* linux-nat.c (linux_nat_terminal_ours): Add 'self' argument.
* inflow.c (terminal_ours): Add 'self' argument.
* inferior.h (terminal_ours): Add 'self' argument.
* go32-nat.c (go32_terminal_ours): Add 'self' argument.
2014-02-19 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_terminal_ours_for_output>: Add
argument.
(target_terminal_ours_for_output): Add argument.
* target.c (debug_to_terminal_ours_for_output): Add argument.
(update_current_target): Update.
* inflow.c (terminal_ours_for_output): Add 'self' argument.
* inferior.h (terminal_ours_for_output): Add 'self' argument.
* go32-nat.c (go32_terminal_ours): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_terminal_inferior>: Add
argument.
* target.c (target_terminal_inferior): Add argument.
(update_current_target): Update.
* remote.c (remote_terminal_inferior): Add 'self' argument.
* linux-nat.c (linux_nat_terminal_inferior): Add 'self' argument.
* inflow.c (terminal_inferior): Add 'self' argument.
* inferior.h (terminal_inferior): Add 'self' argument.
* go32-nat.c (go32_terminal_inferior): Add 'self' argument.
(go32_terminal_inferior): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_terminal_init>: Add argument.
(target_terminal_init): Add argument.
* target.c (debug_to_terminal_init): Add argument.
(update_current_target): Update.
* inflow.c (terminal_init_inferior): Add 'self' argument.
* inferior.h (terminal_init_inferior): Add 'self' argument.
* go32-nat.c (go32_terminal_init): Add 'self' argument.
* gnu-nat.c (gnu_terminal_init_inferior): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops)
<to_can_accel_watchpoint_condition>: Add argument.
(target_can_accel_watchpoint_condition): Add argument.
* target.c (debug_to_can_accel_watchpoint_condition): Add
argument.
(update_current_target): Update.
* ppc-linux-nat.c (ppc_linux_can_accel_watchpoint_condition): Add
'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_region_ok_for_hw_watchpoint>:
Add argument.
(target_region_ok_for_hw_watchpoint): Add argument.
* target.c (debug_to_region_ok_for_hw_watchpoint): Add argument.
(default_region_ok_for_hw_watchpoint): Add argument.
* spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Add argument.
* s390-linux-nat.c (s390_region_ok_for_hw_watchpoint): Add 'self'
argument.
* remote.c (remote_region_ok_for_hw_watchpoint): Add 'self'
argument.
* procfs.c (procfs_region_ok_for_hw_watchpoint): Add 'self'
argument.
* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): Add
'self' argument.
* mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint): Add
'self' argument.
* inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): Add
'self' argument.
* i386-nat.c (i386_region_ok_for_watchpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_region_ok_for_hw_watchpoint): Add
'self' argument.
* aarch64-linux-nat.c (aarch64_linux_region_ok_for_hw_watchpoint):
Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_insert_watchpoint>: Add
argument.
(target_insert_watchpoint): Add argument.
* target.c (debug_to_insert_watchpoint): Add argument.
(update_current_target): Update.
* s390-linux-nat.c (s390_insert_watchpoint): Add 'self' argument.
* remote.c (remote_insert_watchpoint): Add 'self' argument.
* remote-mips.c (mips_insert_watchpoint): Add 'self' argument.
* remote-m32r-sdi.c (m32r_insert_watchpoint): Add 'self' argument.
* procfs.c (procfs_insert_watchpoint): Add 'self' argument.
* ppc-linux-nat.c (ppc_linux_insert_watchpoint): Add 'self'
argument.
* nto-procfs.c (procfs_insert_hw_watchpoint): Add 'self' argument.
(procfs_insert_hw_watchpoint): Add 'self' argument.
* mips-linux-nat.c (mips_linux_insert_watchpoint): Add 'self'
argument.
* inf-ttrace.c (inf_ttrace_insert_watchpoint): Add 'self'
argument.
* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Add 'self'
argument.
* i386-nat.c (i386_insert_watchpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_insert_watchpoint): Add 'self'
argument.
* aarch64-linux-nat.c (aarch64_linux_insert_watchpoint): Add
'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_remove_watchpoint>: Add
argument.
(target_remove_watchpoint): Add argument.
* target.c (debug_to_remove_watchpoint): Add argument.
(update_current_target): Update.
* s390-linux-nat.c (s390_remove_watchpoint): Add 'self' argument.
* remote.c (remote_remove_watchpoint): Add 'self' argument.
* remote-mips.c (mips_remove_watchpoint): Add 'self' argument.
* remote-m32r-sdi.c (m32r_remove_watchpoint): Add 'self' argument.
* procfs.c (procfs_remove_watchpoint): Add 'self' argument.
* ppc-linux-nat.c (ppc_linux_remove_watchpoint): Add 'self'
argument.
* nto-procfs.c (procfs_remove_hw_watchpoint): Add 'self' argument.
* mips-linux-nat.c (mips_linux_remove_watchpoint): Add 'self'
argument.
* inf-ttrace.c (inf_ttrace_remove_watchpoint): Add 'self'
argument.
* ia64-linux-nat.c (ia64_linux_remove_watchpoint): Add 'self'
argument.
* i386-nat.c (i386_remove_watchpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_remove_watchpoint): Add 'self'
argument.
* aarch64-linux-nat.c (aarch64_linux_remove_watchpoint): Add
'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_remove_hw_breakpoint>: Add
argument.
(target_remove_hw_breakpoint): Add argument.
* target.c (debug_to_remove_hw_breakpoint): Add argument.
(update_current_target): Update.
* remote.c (remote_remove_hw_breakpoint): Add 'self' argument.
* ppc-linux-nat.c (ppc_linux_remove_hw_breakpoint): Add 'self'
argument.
* i386-nat.c (i386_remove_hw_breakpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_remove_hw_breakpoint): Add 'self'
argument.
* aarch64-linux-nat.c (aarch64_linux_remove_hw_breakpoint): Add
'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_insert_hw_breakpoint>: Add
argument.
(target_insert_hw_breakpoint): Add argument.
* target.c (debug_to_insert_hw_breakpoint): Add argument.
(update_current_target): Update.
* remote.c (remote_insert_hw_breakpoint): Add 'self' argument.
* ppc-linux-nat.c (ppc_linux_insert_hw_breakpoint): Add 'self'
argument.
* nto-procfs.c (procfs_insert_hw_breakpoint): Add 'self' argument.
* i386-nat.c (i386_insert_hw_breakpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_insert_hw_breakpoint): Add 'self'
argument.
* aarch64-linux-nat.c (aarch64_linux_insert_hw_breakpoint): Add
'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_can_use_hw_breakpoint>: Add
argument.
(target_can_use_hardware_watchpoint): Add argument.
* target.c (debug_to_can_use_hw_breakpoint): Add argument.
(update_current_target): Update.
* spu-linux-nat.c (spu_can_use_hw_breakpoint): Add 'self'
argument.
* s390-linux-nat.c (s390_can_use_hw_breakpoint): Add 'self'
argument.
* remote.c (remote_check_watch_resources): Add 'self' argument.
* remote-mips.c (mips_can_use_watchpoint): Add 'self' argument.
* remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Add 'self'
argument.
* procfs.c (procfs_can_use_hw_breakpoint): Add 'self' argument.
* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Add 'self'
argument.
* nto-procfs.c (procfs_can_use_hw_breakpoint): Add 'self'
argument.
* mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Add 'self'
argument.
* inf-ttrace.c (inf_ttrace_can_use_hw_breakpoint): Add 'self'
argument.
* ia64-linux-nat.c (ia64_linux_can_use_hw_breakpoint): Add 'self'
argument.
* ia64-hpux-nat.c (ia64_hpux_can_use_hw_breakpoint): Add 'self'
argument.
* i386-nat.c (i386_can_use_hw_breakpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Add 'self'
argument.
* aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Add
'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_post_attach>: Add argument.
(target_post_attach): Add argument.
* target.c (debug_to_post_attach): Add argument.
(update_current_target): Update.
* spu-linux-nat.c (spu_child_post_attach): Add 'self' argument.
* nto-procfs.c (procfs_post_attach): Add 'self' argument.
* linux-nat.c (linux_child_post_attach): Add 'self' argument.
* inf-ptrace.c (inf_ptrace_post_attach): Add 'self' argument.
* inf-child.c (inf_child_post_attach): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_close): Add 'self' argument.
* tracepoint.c (tfile_close): Add 'self' argument.
* target.h (struct target_ops) <to_close>: Add argument.
* target.c (target_close): Add argument.
(update_current_target): Update.
* remote.c (remote_close): Add 'self' argument.
* remote-sim.c (gdbsim_close): Add 'self' argument.
* remote-mips.c (mips_close): Add 'self' argument.
* remote-m32r-sdi.c (m32r_close): Add 'self' argument.
* record-full.c (record_full_close): Add 'self' argument.
* record-btrace.c (record_btrace_close): Add 'self' argument.
* monitor.h (monitor_close): Add 'self' argument.
* monitor.c (monitor_close): Add 'self' argument.
* mips-linux-nat.c (mips_linux_close): Add 'self' argument.
* linux-nat.c (linux_nat_close): Add argument.
* go32-nat.c (go32_close): Add 'self' argument.
* exec.c (exec_close_1): Add 'self' argument.
* ctf.c (ctf_close): Add 'self' argument.
* corelow.c (core_close): Add 'self' argument.
(core_close_cleanup): Update.
* bsd-uthread.c (bsd_uthread_close): Add 'self' argument.
* bsd-kvm.c (bsd_kvm_close): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* remote.c (remote_load): New function.
(init_remote_ops): Use it.
2014-02-19 Tom Tromey <tromey@redhat.com>
* common/linux-btrace.c (linux_supports_btrace): Add "ops"
argument.
* common/linux-btrace.h (linux_supports_btrace): Update.
* remote.c (remote_supports_btrace): Add "self" argument.
* target-delegates.c: Rebuild.
* target.c (target_supports_btrace): Remove.
* target.h (struct target_ops) <to_supports_btrace>: Add
target_ops argument.
(target_supports_btrace): New define.
add target method delegation This patch replaces some code in the record targets with target method delegation. record-full.c stores pointers to many target methods when the record target is pushed. Then it later delegates some calls via these. This is wrong because it violates the target stack contract. In particular it is ok to unpush a target at any stratum, but record-full does not keep track of this, so it could potentially call into an unpushed target. This patch fixes the problem by using the newly-introduced generic approach to target delegation for the methods in question. 2014-02-19 Tom Tromey <tromey@redhat.com> * record-full.c (record_full_beneath_to_resume_ops) (record_full_beneath_to_resume, record_full_beneath_to_wait_ops) (record_full_beneath_to_wait) (record_full_beneath_to_store_registers_ops) (record_full_beneath_to_store_registers) (record_full_beneath_to_xfer_partial_ops) (record_full_beneath_to_xfer_partial) (record_full_beneath_to_insert_breakpoint_ops) (record_full_beneath_to_insert_breakpoint) (record_full_beneath_to_remove_breakpoint_ops) (record_full_beneath_to_remove_breakpoint) (record_full_beneath_to_stopped_by_watchpoint) (record_full_beneath_to_stopped_data_address) (record_full_beneath_to_async, tmp_to_resume_ops, tmp_to_resume) (tmp_to_wait_ops, tmp_to_wait, tmp_to_store_registers_ops) (tmp_to_store_registers, tmp_to_xfer_partial_ops) (tmp_to_xfer_partial, tmp_to_instmp_to_insert_breakpoint_ops) (tmp_to_insert_breakpoint, tmp_to_remove_breakpoint_ops) (tmp_to_remove_breakpoint, tmp_to_stopped_by_watchpoint) (tmp_to_stopped_data_address, tmp_to_async): Remove. (record_full_open_1, record_full_open): Update. Use RECORD_IS_USED. (record_full_resume, record_full_wait_1) (record_full_stopped_by_watchpoint, record_full_stopped_data_address) (record_full_store_registers, record_full_xfer_partial) (record_full_insert_breakpoint, record_full_remove_breakpoint) (record_full_async, record_full_core_xfer_partial): Use target delegation. * target-delegates.c: Rebuild. * target.c (current_xfer_partial): Remove. (update_current_target): Do not INHERIT or de_fault to_insert_breakpoint, to_remove_breakpoint, to_stopped_data_address, to_stopped_by_watchpoint, to_can_async_p, to_is_async_p, to_async. Do not set to_xfer_partial field. (default_xfer_partial): Simplify. (current_xfer_partial): Remove. (target_wait, target_resume): Simplify. (find_default_can_async_p, find_default_is_async_p): Update. (init_dummy_target): Don't set to_can_async_p, to_is_async_p, to_xfer_partial, to_stopped_by_watchpoint, to_stopped_data_address. (target_store_registers): Simplify. (forward_target_remove_breakpoint) (forward_target_insert_breakpoint): Remove. (target_remove_breakpoint, target_insert_breakpoint) (debug_to_insert_breakpoint, debug_to_remove_breakpoint): Update. * target.h (struct target_ops) <to_resume, to_wait, to_store_registers, to_insert_breakpoint, to_remove_breakpoint, to_stopped_by_watchpoint, to_stopped_data_address, to_can_async_p, to_is_async_p, to_async, to_xfer_partial>: Add TARGET_DEFAULT markup. (forward_target_remove_breakpoint) (forward_target_insert_breakpoint): Remove. * record-btrace.c (record_btrace_remove_breakpoint): Delegate directly. (record_btrace_insert_breakpoint): Delegate directly.
2013-07-12 21:00:34 +02:00
2014-02-19 Tom Tromey <tromey@redhat.com>
* record-full.c (record_full_beneath_to_resume_ops)
(record_full_beneath_to_resume, record_full_beneath_to_wait_ops)
(record_full_beneath_to_wait)
(record_full_beneath_to_store_registers_ops)
(record_full_beneath_to_store_registers)
(record_full_beneath_to_xfer_partial_ops)
(record_full_beneath_to_xfer_partial)
(record_full_beneath_to_insert_breakpoint_ops)
(record_full_beneath_to_insert_breakpoint)
(record_full_beneath_to_remove_breakpoint_ops)
(record_full_beneath_to_remove_breakpoint)
(record_full_beneath_to_stopped_by_watchpoint)
(record_full_beneath_to_stopped_data_address)
(record_full_beneath_to_async, tmp_to_resume_ops, tmp_to_resume)
(tmp_to_wait_ops, tmp_to_wait, tmp_to_store_registers_ops)
(tmp_to_store_registers, tmp_to_xfer_partial_ops)
(tmp_to_xfer_partial, tmp_to_instmp_to_insert_breakpoint_ops)
(tmp_to_insert_breakpoint, tmp_to_remove_breakpoint_ops)
(tmp_to_remove_breakpoint, tmp_to_stopped_by_watchpoint)
(tmp_to_stopped_data_address, tmp_to_async): Remove.
(record_full_open_1, record_full_open): Update. Use RECORD_IS_USED.
(record_full_resume, record_full_wait_1)
(record_full_stopped_by_watchpoint, record_full_stopped_data_address)
(record_full_store_registers, record_full_xfer_partial)
(record_full_insert_breakpoint, record_full_remove_breakpoint)
(record_full_async, record_full_core_xfer_partial): Use target
delegation.
* target-delegates.c: Rebuild.
* target.c (current_xfer_partial): Remove.
(update_current_target): Do not INHERIT or de_fault
to_insert_breakpoint, to_remove_breakpoint,
to_stopped_data_address, to_stopped_by_watchpoint, to_can_async_p,
to_is_async_p, to_async. Do not set to_xfer_partial field.
(default_xfer_partial): Simplify.
(current_xfer_partial): Remove.
(target_wait, target_resume): Simplify.
(find_default_can_async_p, find_default_is_async_p): Update.
(init_dummy_target): Don't set to_can_async_p, to_is_async_p,
to_xfer_partial, to_stopped_by_watchpoint,
to_stopped_data_address.
(target_store_registers): Simplify.
(forward_target_remove_breakpoint)
(forward_target_insert_breakpoint): Remove.
(target_remove_breakpoint, target_insert_breakpoint)
(debug_to_insert_breakpoint, debug_to_remove_breakpoint): Update.
* target.h (struct target_ops) <to_resume, to_wait,
to_store_registers, to_insert_breakpoint, to_remove_breakpoint,
to_stopped_by_watchpoint, to_stopped_data_address, to_can_async_p,
to_is_async_p, to_async, to_xfer_partial>: Add TARGET_DEFAULT
markup.
(forward_target_remove_breakpoint)
(forward_target_insert_breakpoint): Remove.
* record-btrace.c (record_btrace_remove_breakpoint): Delegate
directly.
(record_btrace_insert_breakpoint): Delegate directly.
2014-02-19 Tom Tromey <tromey@redhat.com>
PR build/7701:
* target-delegates.c: New file.
* target.c: Include target-delegates.c.
(init_dummy_target): Call install_dummy_methods.
(complete_target_initialization): Call install_delegators.
* target.h (TARGET_DEFAULT_IGNORE, TARGET_DEFAULT_NORETURN)
(TARGET_DEFAULT_RETURN, TARGET_DEFAULT_FUNC): New defines.
* make-target-delegates: New file.
2014-02-19 Tom Tromey <tromey@redhat.com>
* record.c (find_record_target): Use find_target_at.
* target.c (find_target_at): New function.
* target.h (find_target_at): Declare.
add "this" pointers to more target APIs A subsequent pass introduces delegation helper functions to the target API. This delegation is much cleaner if the target_ops pointer is directly available at delegation time. This patch adds the "this" pointer to various to_* methods for this purpose. This updates a number of ports which I am unable to test. Please give them a look-over. Any possible problem here is trivial, though, as all that is required is adding an argument to a function. 2014-02-19 Tom Tromey <tromey@redhat.com> * aarch64-linux-nat.c (aarch64_linux_stopped_by_watchpoint): Add 'ops' argument. * arm-linux-nat.c (arm_linux_stopped_by_watchpoint): Add 'ops' argument. * i386-nat.c (i386_stopped_by_watchpoint): Add 'ops' argument. * ia64-linux-nat.c (ia64_linux_stopped_by_watchpoint): Add 'ops' argument. * inf-ttrace.c (inf_ttrace_stopped_by_watchpoint): Add 'ops' argument. * linux-nat.c (save_sigtrap): Update. (linux_nat_stopped_by_watchpoint, linux_nat_is_async_p) (linux_nat_can_async_p, linux_nat_async): Add 'ops' argument. (linux_nat_close): Update. * mips-linux-nat.c (mips_linux_stopped_by_watchpoint): Add 'ops' argument. * ppc-linux-nat.c (ppc_linux_stopped_by_watchpoint): Add 'ops' argument. * procfs.c (procfs_stopped_by_watchpoint): Add 'ops' argument. * record-full.c (record_full_beneath_to_stopped_by_watchpoint) (record_full_beneath_to_async, tmp_to_stopped_by_watchpoint) (tmp_to_async): Add 'ops' argument. (record_full_stopped_by_watchpoint, record_full_async) (record_full_can_async_p, record_full_is_async_p): Add 'ops' argument. * remote-m32r-sdi.c (m32r_insert_breakpoint, m32r_remove_breakpoint) (m32r_stopped_by_watchpoint): Add 'ops' argument. * remote-mips.c (mips_stopped_by_watchpoint): Add 'ops' argument. * remote.c (remote_stopped_by_watchpoint_p, remote_can_async_p) (remote_is_async_p, remote_async): Add 'ops' argument. (remote_stopped_data_address): Update. * s390-nat.c (s390_stopped_by_watchpoint): Add 'ops' argument. * target.c (update_current_target) (find_default_can_async_p, find_default_is_async_p): Update. (init_dummy_target): Update. (debug_to_stopped_by_watchpoint): Add 'ops' argument. * target.h (struct target_ops) <to_stopped_by_watchpoint, to_can_async_p, to_is_async_p, to_async>: Add 'ops' argument. (target_can_async_p, target_is_async_p, target_async) (target_stopped_by_watchpoint): Update.
2013-07-30 18:36:07 +02:00
2014-02-19 Tom Tromey <tromey@redhat.com>
* aarch64-linux-nat.c (aarch64_linux_stopped_by_watchpoint):
Add 'ops' argument.
* arm-linux-nat.c (arm_linux_stopped_by_watchpoint): Add
'ops' argument.
* i386-nat.c (i386_stopped_by_watchpoint): Add 'ops' argument.
* ia64-linux-nat.c (ia64_linux_stopped_by_watchpoint): Add
'ops' argument.
* inf-ttrace.c (inf_ttrace_stopped_by_watchpoint): Add 'ops'
argument.
* linux-nat.c (save_sigtrap): Update.
(linux_nat_stopped_by_watchpoint, linux_nat_is_async_p)
(linux_nat_can_async_p, linux_nat_async): Add 'ops' argument.
(linux_nat_close): Update.
* mips-linux-nat.c (mips_linux_stopped_by_watchpoint): Add 'ops'
argument.
* ppc-linux-nat.c (ppc_linux_stopped_by_watchpoint): Add 'ops'
argument.
* procfs.c (procfs_stopped_by_watchpoint): Add 'ops' argument.
* record-full.c (record_full_beneath_to_stopped_by_watchpoint)
(record_full_beneath_to_async, tmp_to_stopped_by_watchpoint)
(tmp_to_async): Add 'ops' argument.
(record_full_stopped_by_watchpoint, record_full_async)
(record_full_can_async_p, record_full_is_async_p): Add 'ops'
argument.
* remote-m32r-sdi.c (m32r_insert_breakpoint, m32r_remove_breakpoint)
(m32r_stopped_by_watchpoint): Add 'ops' argument.
* remote-mips.c (mips_stopped_by_watchpoint): Add 'ops' argument.
* remote.c (remote_stopped_by_watchpoint_p, remote_can_async_p)
(remote_is_async_p, remote_async): Add 'ops' argument.
(remote_stopped_data_address): Update.
* s390-nat.c (s390_stopped_by_watchpoint): Add 'ops' argument.
* target.c (update_current_target)
(find_default_can_async_p, find_default_is_async_p): Update.
(init_dummy_target): Update.
(debug_to_stopped_by_watchpoint): Add 'ops' argument.
* target.h (struct target_ops) <to_stopped_by_watchpoint,
to_can_async_p, to_is_async_p, to_async>: Add 'ops' argument.
(target_can_async_p, target_is_async_p, target_async)
(target_stopped_by_watchpoint): Update.
2014-02-19 Yao Qi <yao@codesourcery.com>
PR gdb/16220
* gdbarch.sh: Remove startup_gdbarch.
* gdbarch.c: Regenerated.
* gdbarch.h: Likewise.
2014-02-17 Kevin Buettner <kevinb@redhat.com>
* rl78-tdep.c (rl78_g10_register_name): New function.
(rl78_return_value): Add g10 support.
(rl78_gdbarch_init): Register rl78_g10_register_name for the
g10.
2014-02-17 05:57:43 +01:00
2014-02-17 Doug Evans <xdje42@gmail.com>
* Makefile.in (SUBDIR_GUILE_OBS): Resort alphabetically.
(SUBDIR_GUILE_SRCS): Ditto.
(scm-gsmob.o): Ditto.
2014-02-17 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (ILL_RPC): Declare defined function.
2014-02-17 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (gnu_read_inferior): Change 'copy_count' type to
mach_msg_type_number_t.
(gnu_write_inferior): Likewise.
2014-02-17 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (proc_get_exception_port): Use 'lu' insetad of 'd'
in format string.
(proc_steal_exc_port, make_proc, inf_set_pid): Likewise.
(inf_validate_procs, inf_signal): Likewise.
(S_exception_raise_request): Likewise.
(do_mach_notify_dead_name): Likewise.
(steal_exc_port): Likewise.
(gnu_read_inferior): Change 'copy_count''s type to
mach_msg_type_number_t.
(gnu_write_inferior): Likewise. Use 'lx' instead of 'x' in
format string.
2014-02-16 Thomas Schwinge <thomas@codesourcery.com>
* gnu-nat.c (struct inf): Change pending_execs member to a 1-bit
flag. Adjust all users; in particular...
(gnu_wait): ..., don't decrement its value in here...
(gnu_create_inferior): ..., and instead set the flag in here,
around the startup_inferior call, and call that one with
START_INFERIOR_TRAPS_EXPECTED.
* gnu-nat.c (ill_rpc): Remove function; replaced with this...
(ILL_RPC): ... new macro.
(do_mach_notify_no_senders, do_mach_notify_port_deleted)
(do_mach_notify_msg_accepted, do_mach_notify_port_destroyed)
(do_mach_notify_send_once, S_proc_setmsgport_reply)
(S_proc_getmsgport_reply, S_msg_sig_post_reply): Generate stub
functions with ILL_RPC macro.
(S_proc_pid2task_reply, S_proc_task2pid_reply)
(S_proc_task2proc_reply, S_proc_proc2task_reply)
(S_proc_pid2proc_reply, S_proc_getprocinfo_reply)
(S_proc_getprocargs_reply, S_proc_getprocenv_reply)
(S_proc_getloginid_reply, S_proc_getloginpids_reply)
(S_proc_getlogin_reply, S_proc_getsid_reply)
(S_proc_getsessionpgids_reply, S_proc_getsessionpids_reply)
(S_proc_getsidport_reply, S_proc_getpgrp_reply)
(S_proc_getpgrppids_reply, S_proc_get_tty_reply)
(S_proc_getnports_reply, S_proc_is_important_reply)
(S_proc_get_code_reply): New stub functions, generated with
ILL_RPC macro.
* reply_mig_hack.awk: In phase 5, keep going if we have not yet
collected the type check structures.
* reply_mig_hack.awk: Don't expect to see the auto keyword.
2014-02-14 Doug Evans <dje@google.com>
* target.c (target_write_partial): Fix result type.
2014-02-14 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Register
the proper offsets to access fpregset_t.
2014-02-13 Sanimir Agovic <sanimir.agovic@intel.com>
* cris-tdep.c (cris_supply_gregset): Remove zerobuf.
(_initialize_cris_tdep): Remove cris_set_cmdlist, cris_show_cmdlist.
* h8300-tdep.c (setmachinelist): Remove global.
* hppa-tdep.c (hppa_sigtramp): Remove global.
* mipsnbsd-tdep.c (sigtramp_retcode_mipsel, sigtramp_retcode_mipseb
RETCODE_NWORDS, RETCODE_SIZE): Wrap code with #if 0.
* ravenscar-thread.c (update_target_observer): Remove global.
* rs6000-tdep.c (rs6000_gdbarch_init): Remove segment_regs.
2014-02-12 Tom Tromey <tromey@redhat.com>
* common/rsp-low.c: Update comments.
* common/rsp-low.h: Update comments.
2014-02-12 Tom Tromey <tromey@redhat.com>
* common/rsp-low.c (convert_ascii_to_int): Remove.
* common/rsp-low.h (convert_ascii_to_int): Don't declare.
2014-02-12 Tom Tromey <tromey@redhat.com>
* common/rsp-low.h (unhexify): Don't declare.
* common/rsp-low.c (unhexify): Remove.
2014-02-12 Tom Tromey <tromey@redhat.com>
* common/rsp-low.h (convert_int_to_ascii): Don't declare.
* common/rsp-low.c (convert_int_to_ascii): Remove.
2014-02-12 Tom Tromey <tromey@redhat.com>
* common/rsp-low.h (hexify): Don't declare.
* common/rsp-low.c (hexify): Remove.
2014-02-12 Tom Tromey <tromey@redhat.com>
* common/rsp-low.c (hexify): Never take strlen of argument.
2014-02-12 Tom Tromey <tromey@redhat.com>
* common/rsp-low.c (bin2hex): Never take strlen of argument.
* remote.c (extended_remote_run, remote_rcmd)
(remote_download_trace_state_variable, remote_save_trace_data)
(remote_set_trace_notes): Update.
* tracepoint.c (encode_source_string, tfile_write_status)
(tfile_write_uploaded_tsv): Update.
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.
* 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>
* utils.h: Include print-utils.h.
(host_address_to_string, plongest, pulongest, phex, phex_nz)
(int_string, core_addr_to_string, core_addr_to_string_nz)
(hex_string, hex_string_custom): Don't declare.
* utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
(plongest, thirty_two, phex, phex_nz, octal2str, hex_string)
(hex_string_custom, int_string, core_addr_to_string)
(core_addr_to_string_nz, host_address_to_string): Move to
common/print-utils.c.
* common/print-utils.h: New file.
* common/print-utils.c: New file
* Makefile.in (SFILES): Add common/print-utils.c.
(HFILES_NO_SRCDIR): Add common/print-utils.h.
(COMMON_OBS): Add print-utils.o.
(print-utils.o): New target.
2014-02-12 Tom Tromey <tromey@redhat.com>
* nios2-tdep.c (nios2_stub_frame_base_address): Remove.
2014-02-12 Mark Kettenis <kettenis@gnu.org>
* sparc64obsd-tdep.c (sparc64obsd_init_abi): Call obsd_init_abi.
2014-02-12 Mark Kettenis <kettenis@gnu.org>
* inf-ptrace.c (inf_ptrace_xfer_partial): Return TARGET_XFER_EOF
if a PT_IO ptrace request returns sucessfully but indicates that 0
bytes were transferred.
Explicitly mark vtables as code space Ports for Hardvard architectures will typically have in their pointer_to_address hook a check for TYPE_CODE_SPACE in their "pointer_to_address" gdbarch method. E.g., rl78's: /* Is it a code address? */ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type)) || TYPE_LENGTH (type) == 4) return rl78_make_instruction_address (addr); else return rl78_make_data_address (addr); The avr port is similar. The vtable type is a struct type gdb itself bakes. Being neither a function, nor a method, and absent explicit flagging as residing in code space, ends up being considered data. This patch marks the type as code when it is created, on the theory that this is needed for all Hardvard architectures. I believe this should make no difference on archs with flat address space. Testing on x86-64 GNU/Linux shows no changes. gdb/ 2014-02-12 Pedro Alves <palves@redhat.com> Kevin Buettner <kevinb@redhat.com> * gnu-v3-abi.c (build_gdb_vtable_type): Return a type marked with TYPE_INSTANCE_FLAG_CODE_SPACE. Kevin Buettner, at <https://sourceware.org/ml/gdb-patches/2014-02/msg00338.html>, writes, re. rl78: This patch, for rl78 using the default multilib, fixes 5 failures in gdb.cp/casts.exp, 2 failures in gdb.cp/class2.exp, 115 failures in gdb.mi/mi-var-rtti.exp, and 2 failures in gdb.python/py-value.exp. It introduces 9 failures (regressions) in gdb.mi/mi-var-rtti.exp. One of the regressions is: FAIL: gdb.mi/mi-var-rtti.exp: list children of s.public in type_update_when_use_rtti The relevant lines from the log file from a pre-patch test run are as follows: -var-list-children S.public ^done,numchild="1",children=[child={name="S.public.ptr",exp="ptr",numchild="1",type="Base *",thread-id="1"}],has_more="0" (gdb) PASS: gdb.mi/mi-var-rtti.exp: list children of s.public in type_update_when_use_rtti Expecting: \^done,numchild=".*",children=\[child={name="S.public.ptr.public",exp="public",numchild="1"(,thread-id="[0-9]+")?}.*\],has_more="0" Expecting: ^(-var-list-children S\.public\.ptr [ ]+)?(\^done,numchild=".*",children=\[child={name="S.public.ptr.public",exp="public",numchild="1"(,thread-id="[0-9]+")?}.*\],has_more="0"[ ]+[(]gdb[)] [ ]*) The same set of lines for the failing (post-patch) run are instead: -var-list-children S.public &"warning: can't find linker symbol for virtual table for `Base' value\n" &"warning: found `typeinfo for __cxxabiv1::__vmi_class_type_info' instead\n" &"warning: can't find linker symbol for virtual table for `Base' value\n" &"warning: found `typeinfo for __cxxabiv1::__vmi_class_type_info' instead\n" &"warning: can't find linker symbol for virtual table for `Base' value\n" &"warning: found `typeinfo for __cxxabiv1::__vmi_class_type_info' instead\n" ^done,numchild="1",children=[child={name="S.public.ptr",exp="ptr",numchild="1",type="Base *",thread-id="1"}],has_more="0" (gdb) FAIL: gdb.mi/mi-var-rtti.exp: list children of s.public in type_update_when_use_rtti Expecting: \^done,numchild=".*",children=\[child={name="S.public.ptr.public",exp="public",numchild="1"(,thread-id="[0-9]+")?}.*\],has_more="0" Expecting: ^(-var-list-children S\.public\.ptr [ ]+)?(\^done,numchild=".*",children=\[child={name="S.public.ptr.public",exp="public",numchild="1"(,thread-id="[0-9]+")?}.*\],has_more="0"[ ]+[(]gdb[)] [ ]*) Note that the difference between these are the warnings regarding linker symbols. Aside from the warnings, the result is the same. I.e. gdb produces the correct answer despite the warnings. The reason for the other 8 failures is the same: the test harness is not expecting these warnings. I spent some time (a while ago) looking at the reason for these warnings. As I recall, we are now getting further along in the type resolution process than we were without my patch. I.e. for the example above, the code in question never got to the point where it was looking for the specified linker symbol. So it seems to me that, at worst, my patch exposes some other problem, but is not directly the cause of the problem.
2014-02-12 14:30:21 +01:00
2014-02-12 Pedro Alves <palves@redhat.com>
Kevin Buettner <kevinb@redhat.com>
* gnu-v3-abi.c (build_gdb_vtable_type): Return a type marked with
TYPE_INSTANCE_FLAG_CODE_SPACE.
H8/300: Fix pseudo registers reads/writes. 'info registers ccr' corrupts memory. Debugging gdb under Valgrind, we see: (gdb) info registers ccr ==23225== Invalid write of size 1 ==23225== at 0x4A0A308: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:881) ==23225== by 0x52D334: regcache_raw_read (regcache.c:625) ==23225== by 0x45E4D8: h8300_pseudo_register_read (h8300-tdep.c:1171) ==23225== by 0x5B694B: gdbarch_pseudo_register_read (gdbarch.c:1926) ==23225== by 0x52DADB: regcache_cooked_read (regcache.c:740) ==23225== by 0x52DC10: regcache_cooked_read_value (regcache.c:765) ==23225== by 0x68CA41: sentinel_frame_prev_register (sentinel-frame.c:52) ==23225== by 0x6B80CB: frame_unwind_register_value (frame.c:1105) ==23225== by 0x6B7C97: frame_register_unwind (frame.c:1010) ==23225== by 0x6B7F73: frame_unwind_register (frame.c:1064) ==23225== by 0x6B8359: frame_unwind_register_signed (frame.c:1162) ==23225== by 0x6B8396: get_frame_register_signed (frame.c:1169) ==23225== Address 0x4f7b031 is 0 bytes after a block of size 1 alloc'd ==23225== at 0x4A06B0F: calloc (vg_replace_malloc.c:593) ==23225== by 0x6EB754: xcalloc (common-utils.c:91) ==23225== by 0x6EB793: xzalloc (common-utils.c:101) ==23225== by 0x53A782: allocate_value_contents (value.c:854) ==23225== by 0x53A7B4: allocate_value (value.c:864) ==23225== by 0x52DBC8: regcache_cooked_read_value (regcache.c:757) ==23225== by 0x68CA41: sentinel_frame_prev_register (sentinel-frame.c:52) ==23225== by 0x6B80CB: frame_unwind_register_value (frame.c:1105) ==23225== by 0x6B7C97: frame_register_unwind (frame.c:1010) ==23225== by 0x6B7F73: frame_unwind_register (frame.c:1064) ==23225== by 0x6B8359: frame_unwind_register_signed (frame.c:1162) ==23225== by 0x6B8396: get_frame_register_signed (frame.c:1169) ==23225== ccr 0x00 0 I-0 UI-0 H-0 U-0 N-0 Z-0 V-0 C-0 u> u>= != >= > (gdb) This bit: ==23225== Invalid write of size 1 ==23225== at 0x4A0A308: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:881) ==23225== by 0x52D334: regcache_raw_read (regcache.c:625) ==23225== by 0x45E4D8: h8300_pseudo_register_read (h8300-tdep.c:1171) shows the problem. The CCR pseudo register has type length of 1, while the corresponding CCR raw register has a length of 2 or 4 (depending on mode). In sim/h8300/compile.c:sim_{fetch|store}_register we see that the sim also treats those raw registers (CCR/EXR) as 2 or 4 bytes length. gdb/ 2014-02-12 Pedro Alves <palves@redhat.com> * h8300-tdep.c (pseudo_from_raw_register) (raw_from_pseudo_register): New functions. (h8300_pseudo_register_read, h8300_pseudo_register_write): Use them.
2014-02-12 13:27:50 +01:00
2014-02-12 Pedro Alves <palves@redhat.com>
* h8300-tdep.c (pseudo_from_raw_register)
(raw_from_pseudo_register): New functions.
(h8300_pseudo_register_read, h8300_pseudo_register_write): Use
them.
H8/300: Fix gdb<->sim register mapping. Currently, printing the H8/300 ccr register when debugging with the sim is broken: (gdb) target sim ... (gdb) load ... (gdb) start ... Breakpoint 1, foo (i=0x0 <foo>) at main.c:4 4 { (gdb) info registers ccr Register 13 is not available '13' is the ccr pseudo-register. This pseudo-register provides an 8-bit view into the raw ccr register (regno=8). The problem is that the H8/300 port does not define a register_sim_regno gdbarch hook, and thus when fetching the raw register off of the sim, we end up in legacy_register_sim_regno trying to figure out the sim register number for the raw CCR register: int legacy_register_sim_regno (struct gdbarch *gdbarch, int regnum) { /* Only makes sense to supply raw registers. */ gdb_assert (regnum >= 0 && regnum < gdbarch_num_regs (gdbarch)); /* NOTE: cagney/2002-05-13: The old code did it this way and it is suspected that some GDB/SIM combinations may rely on this behavour. The default should be one2one_register_sim_regno (below). */ if (gdbarch_register_name (gdbarch, regnum) != NULL && gdbarch_register_name (gdbarch, regnum)[0] != '\0') return regnum; else return LEGACY_SIM_REGNO_IGNORE; } Because the raw ccr register does not have a name (so that it is hidden from the user), that returns LEGACY_SIM_REGNO_IGNORE. That means that we never actually read the value of the raw ccr register. Before the <unavailable> support, this must have meant that ccr was _always_ read as 0... At least, I'm not seeing how this ever worked. The fix for that is adding a gdbarch_register_sim_regno hook that maps all raw registers. Looking at sim/h8300/sim-main.h, I believe the sim's register numbers are compatible with gdb's, so no actual convertion is necessary. gdb/ 2014-02-12 Pedro Alves <palves@redhat.com> * h8300-tdep.c (h8300_register_sim_regno): New function. (h8300_gdbarch_init): Install h8300_register_sim_regno as gdbarch_register_sim_regno hook.
2014-02-12 13:27:49 +01:00
2014-02-12 Pedro Alves <palves@redhat.com>
* h8300-tdep.c (h8300_register_sim_regno): New function.
(h8300_gdbarch_init): Install h8300_register_sim_regno as
gdbarch_register_sim_regno hook.
2014-02-12 Sanimir Agovic <sanimir.agovic@intel.com>
* nios2-tdep.c (nios2_stub_frame_base): Remove global.
2014-02-12 Sanimir Agovic <sanimir.agovic@intel.com>
* tic6x-tdep.c (tic6x_gdbarch_init): Call frame_base_set_default.
2014-02-12 Mark Kettenis <kettenis@gnu.org>
* obsd-tdep.h (obsd_init_abi): New prototype.
* obsd-tdep.c: Define enum with OpenBSD signal numbers.
(obsd_gdb_signal_from_target, obsd_gdb_signal_to_target)
(obsd_init_abi): New functions.
* i386obsd-tdep.c: Include "obsd-tdep.h".
(i386obsd_init_abi): Call obsd_init_abi.
* amd64obsd-tdep.c: Include "obsd-tdep.h".
(amd64obsd_init_abi): Call obsd_init_abi.
* configure.tgt (i[34567]86-*-openbsd*, x86_64-*-openbsd*): Add
obsd-tdep.c to gdb_target_obs.
2014-02-11 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc64-tdep.c (sparc64_store_arguments): Do not align complex
double float arguments to 16-byte in the argument slots.
2014-02-11 Doug Evans <xdje42@gmail.com>
* configure.ac: Don't crash if pkg-config is not found and guile
wasn't explicitly requested. Use AC_MSG_ERROR instead of AC_ERROR
in guile checks.
* configure: Regenerate.
2014-02-11 Yao Qi <yao@codesourcery.com>
* aix-thread.c (aix_thread_xfer_partial): Update comments.
* auxv.c (procfs_xfer_auxv, memory_xfer_auxv): Likewise.
* bsd-uthread.c (bsd_uthread_xfer_partial): Likewise.
* gnu-nat.c (gnu_xfer_memory): Likewise.
* inf-ptrace.c (inf_ptrace_xfer_partial): Likewise.
* rs6000-nat.c (rs6000_xfer_partial): Likewise.
* sparc-nat.c (sparc_xfer_wcookie): Likewise.
* spu-linux-nat.c (spu_proc_xfer_spu): Likewise.
Return target_xfer_status in to_xfer_partial This patch does the conversion of to_xfer_partial from LONGEST (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len); to enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len); It changes to_xfer_partial return the transfer status and the transfered length by *XFERED_LEN. Generally, the return status has three stats, - TARGET_XFER_OK, - TARGET_XFER_EOF, - TARGET_XFER_E_XXXX, See the comments to them in 'enum target_xfer_status'. Note that Pedro suggested not name TARGET_XFER_DONE, as it is confusing, compared with "TARGET_XFER_OK". We finally name it TARGET_XFER_EOF. With this change, GDB core can handle unavailable data in a convenient way. The rationale behind this change was mentioned here https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html Consider an object/value like this: 0 100 150 200 512 DDDDDDDDDDDxxxxxxxxxDDDDDD...DDIIIIIIIIIIII..III where D is valid data, and xxx is unavailable data, and I is beyond the end of the object (Invalid). Currently, if we start the xfer at 0, requesting, say 512 bytes, we'll first get back 100 bytes. The xfer machinery then retries fetching [100,512), and gets back TARGET_XFER_E_UNAVAILABLE. That's sufficient when you're either interested in either having the whole of the 512 bytes available, or erroring out. But, in this scenario, we're interested in the data at [150,512). The problem is that the last TARGET_XFER_E_UNAVAILABLE gives us no indication where to start the read next. We'd need something like: get me [0,512) >>> <<< here's [0,100), *xfered_len is 100, returns TARGET_XFER_OK get me [100,512) >>> (**1) <<< [100,150) is unavailable, *xfered_len is 50, return TARGET_XFER_E_UNAVAILABLE. get me [150,512) >>> <<< here's [150,200), *xfered_len is 50, return TARGET_XFER_OK. get me [200,512) >>> <<< no more data, return TARGET_XFER_EOF. This naturally implies pushing down the decision of whether to return TARGET_XFER_E_UNAVAILABLE or something else down to the target. (Which kinds of leads back to tfile itself reading from RO memory from file (though we could export a function in exec.c for that that tfile delegates to, instead of re-adding the old code). Beside this change, we also add a macro TARGET_XFER_STATUS_ERROR_P to check whether a status is an error or not, to stop using "status < 0". This patch also eliminates the comparison between status and 0. No target implementations to to_xfer_partial adapts this new interface. The interface still behaves as before. gdb: 2014-02-11 Yao Qi <yao@codesourcery.com> * target.h (enum target_xfer_error): Rename to ... (enum target_xfer_status): ... it. New. All users updated. (enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>: New. (TARGET_XFER_STATUS_ERROR_P): New macro. (target_xfer_error_to_string): Remove declaration. (target_xfer_status_to_string): Declare. (target_xfer_partial_ftype): Adjust it. (struct target_ops) <to_xfer_partial>: Return target_xfer_status. Add argument xfered_len. Update comments. * target.c (target_xfer_error_to_string): Rename to ... (target_xfer_status_to_string): ... it. New. All callers updated. (target_read_live_memory): Likewise. Call target_xfer_partial instead of target_read. (memory_xfer_live_readonly_partial): Return target_xfer_status. Add argument xfered_len. (raw_memory_xfer_partial): Likewise. (memory_xfer_partial_1): Likewise. (memory_xfer_partial): Likewise. (target_xfer_partial): Likewise. Check *XFERED_LEN is set properly. Update debug message. (default_xfer_partial, current_xfer_partial): Likewise. (target_write_partial): Likewise. (target_read_partial): Likewise. All callers updated. (read_whatever_is_readable): Likewise. (target_write_with_progress): Likewise. (target_read_alloc_1): Likewise. * aix-thread.c (aix_thread_xfer_partial): Likewise. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv, memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partia): Likewise. * corefile.c (read_memory): Adjust. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. All callers updated. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. All callers updated. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not negative. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise. (ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise. (ia64_hpux_xfer_solib_got): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change type of 'partial_len' to ULONGEST. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo ): Likewise. (linux_nat_xfer_partial): Likewise. (linux_proc_xfer_partial, linux_xfer_partial): Likewise. (linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-btrace.c (record_btrace_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_bytes_aux): Likewise. All callers updated. (remote_write_bytes, remote_read_bytes): Likewise. All callers updated. (remote_flash_erase): Likewise. All callers updated. (remote_write_qxfer): Likewise. All callers updated. (remote_read_qxfer): Likewise. All callers updated. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers updated. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise. * valprint.c: Replace 'target_xfer_error' with 'target_xfer_status' in comments.
2014-01-27 13:35:33 +01:00
2014-02-11 Yao Qi <yao@codesourcery.com>
* target.h (enum target_xfer_error): Rename to ...
(enum target_xfer_status): ... it. New. All users updated.
(enum target_xfer_status) <TARGET_XFER_OK>, <TARGET_XFER_EOF>:
New.
(TARGET_XFER_STATUS_ERROR_P): New macro.
(target_xfer_error_to_string): Remove declaration.
(target_xfer_status_to_string): Declare.
(target_xfer_partial_ftype): Adjust it.
(struct target_ops) <to_xfer_partial>: Return
target_xfer_status. Add argument xfered_len. Update
comments.
* target.c (target_xfer_error_to_string): Rename to ...
(target_xfer_status_to_string): ... it. New. All callers
updated.
(target_read_live_memory): Likewise. Call target_xfer_partial
instead of target_read.
(memory_xfer_live_readonly_partial): Return
target_xfer_status. Add argument xfered_len.
(raw_memory_xfer_partial): Likewise.
(memory_xfer_partial_1): Likewise.
(memory_xfer_partial): Likewise.
(target_xfer_partial): Likewise. Check *XFERED_LEN is set
properly. Update debug message.
(default_xfer_partial, current_xfer_partial): Likewise.
(target_write_partial): Likewise.
(target_read_partial): Likewise. All callers updated.
(read_whatever_is_readable): Likewise.
(target_write_with_progress): Likewise.
(target_read_alloc_1): Likewise.
* aix-thread.c (aix_thread_xfer_partial): Likewise.
* auxv.c (procfs_xfer_auxv): Likewise.
(ld_so_xfer_auxv, memory_xfer_auxv): Likewise.
* bfd-target.c (target_bfd_xfer_partial): Likewise.
* bsd-kvm.c (bsd_kvm_xfer_partial): Likewise.
* bsd-uthread.c (bsd_uthread_xfer_partia): Likewise.
* corefile.c (read_memory): Adjust.
* corelow.c (core_xfer_partial): Likewise.
* ctf.c (ctf_xfer_partial): Likewise.
* darwin-nat.c (darwin_read_dyld_info): Likewise. All callers
updated.
(darwin_xfer_partial): Likewise.
* exec.c (section_table_xfer_memory_partial): Likewise. All
callers updated.
(exec_xfer_partial): Likewise.
* exec.h (section_table_xfer_memory_partial): Update
declaration.
* gnu-nat.c (gnu_xfer_memory): Likewise. Assert 'res' is not
negative.
(gnu_xfer_partial): Likewise.
* ia64-hpux-nat.c (ia64_hpux_xfer_memory_no_bs): Likewise.
(ia64_hpux_xfer_memory, ia64_hpux_xfer_uregs): Likewise.
(ia64_hpux_xfer_solib_got): Likewise.
* inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. Change
type of 'partial_len' to ULONGEST.
* inf-ttrace.c (inf_ttrace_xfer_partial): Likewise.
* linux-nat.c (linux_xfer_siginfo ): Likewise.
(linux_nat_xfer_partial): Likewise.
(linux_proc_xfer_partial, linux_xfer_partial): Likewise.
(linux_proc_xfer_spu, linux_nat_xfer_osdata): Likewise.
* monitor.c (monitor_xfer_memory): Likewise.
(monitor_xfer_partial): Likewise.
* procfs.c (procfs_xfer_partial): Likewise.
* record-btrace.c (record_btrace_xfer_partial): Likewise.
* record-full.c (record_full_xfer_partial): Likewise.
(record_full_core_xfer_partial): Likewise.
* remote-sim.c (gdbsim_xfer_memory): Likewise.
(gdbsim_xfer_partial): Likewise.
* remote.c (remote_write_bytes_aux): Likewise. All callers
updated.
(remote_write_bytes, remote_read_bytes): Likewise. All
callers updated.
(remote_flash_erase): Likewise. All callers updated.
(remote_write_qxfer): Likewise. All callers updated.
(remote_read_qxfer): Likewise. All callers updated.
(remote_xfer_partial): Likewise.
* rs6000-nat.c (rs6000_xfer_partial): Likewise.
(rs6000_xfer_shared_libraries): Likewise.
* sol-thread.c (sol_thread_xfer_partial): Likewise.
(sol_thread_xfer_partial): Likewise.
* sparc-nat.c (sparc_xfer_wcookie): Likewise.
(sparc_xfer_partial): Likewise.
* spu-linux-nat.c (spu_proc_xfer_spu): Likewise. All callers
updated.
(spu_xfer_partial): Likewise.
* spu-multiarch.c (spu_xfer_partial): Likewise.
* tracepoint.c (tfile_xfer_partial): Likewise.
* windows-nat.c (windows_xfer_memory): Likewise.
(windows_xfer_shared_libraries): Likewise.
(windows_xfer_partial): Likewise.
* valprint.c: Replace 'target_xfer_error' with
'target_xfer_status' in comments.
2014-02-11 Simon Marchi <simon.marchi@ericsson.com> (tiny patch)
Checked in by Joel Brobecker <brobecker@adacore.com>.
* mi/mi-main.c (mi_cmd_data_write_memory_bytes): Fix comment.
2014-02-11 Joel Brobecker <brobecker@adacore.com>
* symfile-debug.c (debug_qf_expand_symtabs_matching): Reformat
function parameters.
2014-02-10 Will Newton <will.newton@linaro.org>
* elfread.c (elf_rel_plt_read): Look for a .got section if
looking up .got.plt fails.
(elf_gnu_ifunc_resolve_by_got): Call gdbarch_addr_bits_remove
on address passed to elf_gnu_ifunc_record_cache.
(elf_gnu_ifunc_resolve_addr): Likewise.
(elf_gnu_ifunc_resolver_return_stop): Likewise.
2014-02-10 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc-tdep.c (sparc_in_function_epilogue_p): New function.
(X_RETTURN): New macro.
* sparc-tdep.h: sparc_in_function_epilogue_p prototype.
* sparc64-tdep.c (sparc64_init_abi): Hook
sparc_in_function_epilogue_p.
2014-02-10 Gary Benson <gbenson@redhat.com>
* symfile-debug.c (debug_qf_expand_symtabs_matching):
Rename name_matcher to symbol_matcher.
2014-02-10 Gary Benson <gbenson@redhat.com>
* symfile-debug.c (debug_qf_expand_symtabs_matching):
Use expand_symtabs_file_matcher_ftype and
expand_symtabs_symbol_matcher_ftype.
2014-02-10 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (struct cache_entry, HASH_SIZE): Move definition up.
(struct ada_symbol_cache): New.
(ada_free_symbol_cache): Forward declare.
(struct ada_pspace_data): New.
(ada_pspace_data_handle): New static global.
(get_ada_pspace_data, ada_pspace_data_cleanup)
(ada_init_symbol_cache, ada_free_symbol_cache): New functions.
(cache_space, cache): Delete, now folded inside struct
ada_pspace_data.
(ada_get_symbol_cache): New function.
(ada_clear_symbol_cache, find_entry, cache_symbol): Adjust
implementation.
(_initialize_ada_language): Remove initialization of cache_space.
Move call to observer_attach_inferior_exit up, grouping it
with the other observer registrations inside this function.
Rename command to be more general. Add call to
register_program_space_data_with_cleanup.
2014-02-10 Joel Brobecker <brobecker@adacore.com>
* ada-tasks.c (ada_tasks_new_objfile_observer): Renames
ada_new_objfile_observer.
(ada_tasks_normal_stop_observer): Renames ada_normal_stop_observer.
(_initialize_tasks): Update uses of ada_new_objfile_observer
and ada_tasks_normal_stop_observer.
2014-02-10 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_evaluate_subexp): Set the type of the value
returned by the 'Length attribute to integer.
2014-02-10 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (_initialize_ada_language): Initialize
cache_space obstack.
2014-02-10 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (HASH_SIZE): New macro.
(struct cache_entry): New type.
(cache_space, cache): New static globals.
(ada_clear_symbol_cache, find_entry): New functions.
(lookup_cached_symbol, cache_symbol): Implement.
(ada_new_objfile_observer, ada_free_objfile_observer): New.
(_initialize_ada_language): Attach ada_new_objfile_observer
and ada_free_objfile_observer.
2014-02-10 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_add_block_symbols, add_defn_to_vec)
(lookup_cached_symbol, ada_add_local_symbols): Add "const" to
struct block * parameter.
(ada_lookup_symbol_list_worker): Constify local variable "block".
Remove cast which is no longer necessary.
Add Guile as an extension language. * NEWS: Mention Guile scripting. * Makefile.in (SUBDIR_GUILE_OBS): New variable. (SUBDIR_GUILE_SRCS, SUBDIR_GUILE_DEPS): New variables (SUBDIR_GUILE_LDFLAGS, SUBDIR_GUILE_CFLAGS): New variables. (INTERNAL_CPPFLAGS): Add GUILE_CPPFLAGS. (CLIBS): Add GUILE_LIBS. (install-guile): New rule. (guile.o): New rule. (scm-arch.o, scm-auto-load.o, scm-block.o): New rules. (scm-breakpoint.o, scm-disasm.o, scm-exception.o): New rules. (scm-frame.o, scm-iterator.o, scm-lazy-string.o): New rules. (scm-math.o, scm-objfile.o, scm-ports.o): New rules. (scm-pretty-print.o, scm-safe-call.o, scm-gsmob.o): New rules. (scm-string.o, scm-symbol.o, scm-symtab.o): New rules. (scm-type.o, scm-utils.o, scm-value.o): New rules. * configure.ac: New option --with-guile. * configure: Regenerate. * config.in: Regenerate. * auto-load.c: Remove #include "python/python.h". Add #include "gdb/section-scripts.h". (source_section_scripts): Handle Guile scripts. (_initialize_auto_load): Add name of Guile objfile script to scripts-directory help text. * breakpoint.c (condition_command): Tweak comment to include Scheme. * breakpoint.h (gdbscm_breakpoint_object): Add forward decl. (struct breakpoint): New member scm_bp_object. * defs.h (enum command_control_type): New value guile_control. * cli/cli-cmds.c: Remove #include "python/python.h". Add #include "extension.h". (show_user): Update comment. (_initialize_cli_cmds): Update help text for "show user". Update help text for max-user-call-depth. * cli/cli-script.c: Remove #include "python/python.h". Add #include "extension.h". (multi_line_command_p): Add guile_control. (print_command_lines): Handle guile_control. (execute_control_command, recurse_read_control_structure): Ditto. (process_next_line): Recognize "guile" commands. * disasm.c (gdb_disassemble_info): Make non-static. * disasm.h: #include "dis-asm.h". (struct gdbarch): Add forward decl. (gdb_disassemble_info): Declare. * extension.c: #include "guile/guile.h". (extension_languages): Add guile. (get_ext_lang_defn): Handle EXT_LANG_GDB. * extension.h (enum extension_language): New value EXT_LANG_GUILE. * gdbtypes.c (get_unsigned_type_max): New function. (get_signed_type_minmax): New function. * gdbtypes.h (get_unsigned_type_max): Declare. (get_signed_type_minmax): Declare. * guile/README: New file. * guile/guile-internal.h: New file. * guile/guile.c: New file. * guile/guile.h: New file. * guile/scm-arch.c: New file. * guile/scm-auto-load.c: New file. * guile/scm-block.c: New file. * guile/scm-breakpoint.c: New file. * guile/scm-disasm.c: New file. * guile/scm-exception.c: New file. * guile/scm-frame.c: New file. * guile/scm-gsmob.c: New file. * guile/scm-iterator.c: New file. * guile/scm-lazy-string.c: New file. * guile/scm-math.c: New file. * guile/scm-objfile.c: New file. * guile/scm-ports.c: New file. * guile/scm-pretty-print.c: New file. * guile/scm-safe-call.c: New file. * guile/scm-string.c: New file. * guile/scm-symbol.c: New file. * guile/scm-symtab.c: New file. * guile/scm-type.c: New file. * guile/scm-utils.c: New file. * guile/scm-value.c: New file. * guile/lib/gdb.scm: New file. * guile/lib/gdb/boot.scm: New file. * guile/lib/gdb/experimental.scm: New file. * guile/lib/gdb/init.scm: New file. * guile/lib/gdb/iterator.scm: New file. * guile/lib/gdb/printing.scm: New file. * guile/lib/gdb/types.scm: New file. * data-directory/Makefile.in (GUILE_SRCDIR): New variable. (VPATH): Add $(GUILE_SRCDIR). (GUILE_DIR): New variable. (GUILE_INSTALL_DIR, GUILE_FILES): New variables. (all): Add stamp-guile dependency. (stamp-guile): New rule. (clean-guile, install-guile, uninstall-guile): New rules. (install-only): Add install-guile dependency. (uninstall): Add uninstall-guile dependency. (clean): Add clean-guile dependency. doc/ * Makefile.in (GDB_DOC_FILES): Add guile.texi. * gdb.texinfo (Auto-loading): Add set/show auto-load guile-scripts. (Extending GDB): New menu entries Guile, Multiple Extension Languages. (Guile docs): Include guile.texi. (objfile-gdbdotext file): Add objfile-gdb.scm. (dotdebug_gdb_scripts section): Mention Guile scripts. (Multiple Extension Languages): New node. * guile.texi: New file. testsuite/ * configure.ac (AC_OUTPUT): Add gdb.guile. * configure: Regenerate. * lib/gdb-guile.exp: New file. * lib/gdb.exp (get_target_charset): New function. * gdb.base/help.exp: Update expected output from "apropos apropos". * gdb.guile/Makefile.in: New file. * gdb.guile/guile.exp: New file. * gdb.guile/scm-arch.c: New file. * gdb.guile/scm-arch.exp: New file. * gdb.guile/scm-block.c: New file. * gdb.guile/scm-block.exp: New file. * gdb.guile/scm-breakpoint.c: New file. * gdb.guile/scm-breakpoint.exp: New file. * gdb.guile/scm-disasm.c: New file. * gdb.guile/scm-disasm.exp: New file. * gdb.guile/scm-equal.c: New file. * gdb.guile/scm-equal.exp: New file. * gdb.guile/scm-error.exp: New file. * gdb.guile/scm-error.scm: New file. * gdb.guile/scm-frame-args.c: New file. * gdb.guile/scm-frame-args.exp: New file. * gdb.guile/scm-frame-args.scm: New file. * gdb.guile/scm-frame-inline.c: New file. * gdb.guile/scm-frame-inline.exp: New file. * gdb.guile/scm-frame.c: New file. * gdb.guile/scm-frame.exp: New file. * gdb.guile/scm-generics.exp: New file. * gdb.guile/scm-gsmob.exp: New file. * gdb.guile/scm-iterator.c: New file. * gdb.guile/scm-iterator.exp: New file. * gdb.guile/scm-math.c: New file. * gdb.guile/scm-math.exp: New file. * gdb.guile/scm-objfile-script-gdb.in: New file. * gdb.guile/scm-objfile-script.c: New file. * gdb.guile/scm-objfile-script.exp: New file. * gdb.guile/scm-objfile.c: New file. * gdb.guile/scm-objfile.exp: New file. * gdb.guile/scm-ports.exp: New file. * gdb.guile/scm-pretty-print.c: New file. * gdb.guile/scm-pretty-print.exp: New file. * gdb.guile/scm-pretty-print.scm: New file. * gdb.guile/scm-section-script.c: New file. * gdb.guile/scm-section-script.exp: New file. * gdb.guile/scm-section-script.scm: New file. * gdb.guile/scm-symbol.c: New file. * gdb.guile/scm-symbol.exp: New file. * gdb.guile/scm-symtab-2.c: New file. * gdb.guile/scm-symtab.c: New file. * gdb.guile/scm-symtab.exp: New file. * gdb.guile/scm-type.c: New file. * gdb.guile/scm-type.exp: New file. * gdb.guile/scm-value-cc.cc: New file. * gdb.guile/scm-value-cc.exp: New file. * gdb.guile/scm-value.c: New file. * gdb.guile/scm-value.exp: New file. * gdb.guile/source2.scm: New file. * gdb.guile/types-module.cc: New file. * gdb.guile/types-module.exp: New file.
2014-02-10 04:40:01 +01:00
2014-02-10 Doug Evans <xdje42@gmail.com>
Add Guile as an extension language.
* NEWS: Mention Guile scripting.
* Makefile.in (SUBDIR_GUILE_OBS): New variable.
(SUBDIR_GUILE_SRCS, SUBDIR_GUILE_DEPS): New variables
(SUBDIR_GUILE_LDFLAGS, SUBDIR_GUILE_CFLAGS): New variables.
(INTERNAL_CPPFLAGS): Add GUILE_CPPFLAGS.
(CLIBS): Add GUILE_LIBS.
(install-guile): New rule.
(guile.o): New rule.
(scm-arch.o, scm-auto-load.o, scm-block.o): New rules.
(scm-breakpoint.o, scm-disasm.o, scm-exception.o): New rules.
(scm-frame.o, scm-iterator.o, scm-lazy-string.o): New rules.
(scm-math.o, scm-objfile.o, scm-ports.o): New rules.
(scm-pretty-print.o, scm-safe-call.o, scm-gsmob.o): New rules.
(scm-string.o, scm-symbol.o, scm-symtab.o): New rules.
(scm-type.o, scm-utils.o, scm-value.o): New rules.
* configure.ac: New option --with-guile.
* configure: Regenerate.
* config.in: Regenerate.
* auto-load.c: Remove #include "python/python.h". Add #include
"gdb/section-scripts.h".
(source_section_scripts): Handle Guile scripts.
(_initialize_auto_load): Add name of Guile objfile script to
scripts-directory help text.
* breakpoint.c (condition_command): Tweak comment to include Scheme.
* breakpoint.h (gdbscm_breakpoint_object): Add forward decl.
(struct breakpoint): New member scm_bp_object.
* defs.h (enum command_control_type): New value guile_control.
* cli/cli-cmds.c: Remove #include "python/python.h". Add #include
"extension.h".
(show_user): Update comment.
(_initialize_cli_cmds): Update help text for "show user". Update help
text for max-user-call-depth.
* cli/cli-script.c: Remove #include "python/python.h". Add #include
"extension.h".
(multi_line_command_p): Add guile_control.
(print_command_lines): Handle guile_control.
(execute_control_command, recurse_read_control_structure): Ditto.
(process_next_line): Recognize "guile" commands.
* disasm.c (gdb_disassemble_info): Make non-static.
* disasm.h: #include "dis-asm.h".
(struct gdbarch): Add forward decl.
(gdb_disassemble_info): Declare.
* extension.c: #include "guile/guile.h".
(extension_languages): Add guile.
(get_ext_lang_defn): Handle EXT_LANG_GDB.
* extension.h (enum extension_language): New value EXT_LANG_GUILE.
* gdbtypes.c (get_unsigned_type_max): New function.
(get_signed_type_minmax): New function.
* gdbtypes.h (get_unsigned_type_max): Declare.
(get_signed_type_minmax): Declare.
* guile/README: New file.
* guile/guile-internal.h: New file.
* guile/guile.c: New file.
* guile/guile.h: New file.
* guile/scm-arch.c: New file.
* guile/scm-auto-load.c: New file.
* guile/scm-block.c: New file.
* guile/scm-breakpoint.c: New file.
* guile/scm-disasm.c: New file.
* guile/scm-exception.c: New file.
* guile/scm-frame.c: New file.
* guile/scm-gsmob.c: New file.
* guile/scm-iterator.c: New file.
* guile/scm-lazy-string.c: New file.
* guile/scm-math.c: New file.
* guile/scm-objfile.c: New file.
* guile/scm-ports.c: New file.
* guile/scm-pretty-print.c: New file.
* guile/scm-safe-call.c: New file.
* guile/scm-string.c: New file.
* guile/scm-symbol.c: New file.
* guile/scm-symtab.c: New file.
* guile/scm-type.c: New file.
* guile/scm-utils.c: New file.
* guile/scm-value.c: New file.
* guile/lib/gdb.scm: New file.
* guile/lib/gdb/boot.scm: New file.
* guile/lib/gdb/experimental.scm: New file.
* guile/lib/gdb/init.scm: New file.
* guile/lib/gdb/iterator.scm: New file.
* guile/lib/gdb/printing.scm: New file.
* guile/lib/gdb/types.scm: New file.
* data-directory/Makefile.in (GUILE_SRCDIR): New variable.
(VPATH): Add $(GUILE_SRCDIR).
(GUILE_DIR): New variable.
(GUILE_INSTALL_DIR, GUILE_FILES): New variables.
(all): Add stamp-guile dependency.
(stamp-guile): New rule.
(clean-guile, install-guile, uninstall-guile): New rules.
(install-only): Add install-guile dependency.
(uninstall): Add uninstall-guile dependency.
(clean): Add clean-guile dependency.
2014-02-09 Doug Evans <xdje42@gmail.com>
Revert this patch (which I approved, mea culpa).
2014-02-08 Mark Kettenis <kettenis@gnu.org>
* Makefile.in (all-lib): Remove.
($(LIBGNU) $(GNULIB_H)): Replace with gits of remove all-lib target.
2014-02-09 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix Python stack corruption.
* python/py-linetable.c (ltpy_get_pcs_for_line, ltpy_has_line): Use
gdb_py_longest.
2014-02-08 Mark Kettenis <kettenis@gnu.org>
* Makefile.in (all-lib): Remove.
($(LIBGNU) $(GNULIB_H)): Replace with gits of remove all-lib target.
2014-02-07 Doug Evans <dje@google.com>
* extension-priv.h (extension_language_script_ops): Add comment.
(extension_language_ops): Add comment.
(active_ext_lang_state): Fix typo in comment.
Make sure we don't resume the stepped thread by accident. Say: <stopped at a breakpoint in thread 2> (gdb) thread 3 (gdb) step The above triggers the prepare_to_proceed/deferred_step_ptid process, which switches back to thread 2, to step over its breakpoint before getting back to thread 3 and "step" it. If while stepping over the breakpoint in thread 2, a signal arrives, and it is set to pass/nostop, we'll set a step-resume breakpoint at the supposed signal-handler resume address, and call keep_going. The problem is that we were supposedly stepping thread 3, and that keep_going delivers a signal to thread 2, and due to scheduler-locking off, resumes everything else, _including_ thread 3, the thread we want stepping. This means that we lose control of thread 3 until the next event, when we stop everything. The end result for the user, is that GDB lost control of the "step". Here's the current infrun debug output of the above, with the testcase in the patch below: infrun: clear_proceed_status_thread (Thread 0x2aaaab8f5700 (LWP 11663)) infrun: clear_proceed_status_thread (Thread 0x2aaaab6f4700 (LWP 11662)) infrun: clear_proceed_status_thread (Thread 0x2aaaab4f2b20 (LWP 11659)) infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1) infrun: prepare_to_proceed (step=1), switched to [Thread 0x2aaaab6f4700 (LWP 11662)] infrun: resume (step=1, signal=0), trap_expected=1, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f infrun: wait_for_inferior () infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)], infrun: status->kind = stopped, signal = SIGUSR1 infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40098f infrun: random signal 30 Program received signal SIGUSR1, User defined signal 1. infrun: signal arrived while stepping over breakpoint infrun: inserting step-resume breakpoint at 0x40098f infrun: resume (step=0, signal=30), trap_expected=0, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f ^^^ this is a wildcard resume. infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40098f infrun: BPSTAT_WHAT_STEP_RESUME infrun: resume (step=1, signal=0), trap_expected=1, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f ^^^ step-resume hit, meaning the handler returned, so we go back to stepping thread 3. infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40088b infrun: switching back to stepped thread infrun: Switching context from Thread 0x2aaaab6f4700 (LWP 11662) to Thread 0x2aaaab8f5700 (LWP 11663) infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x2aaaab8f5700 (LWP 11663)] at 0x400938 infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab8f5700 (LWP 11663)], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40093a infrun: keep going infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x2aaaab8f5700 (LWP 11663)] at 0x40093a infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab8f5700 (LWP 11663)], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40091e infrun: stepped to a different line infrun: stop_stepping [Switching to Thread 0x2aaaab8f5700 (LWP 11663)] 69 (*myp) ++; /* set breakpoint child_two here */ ^^^ we stopped at the wrong line. We still stepped a bit because the test is running in a loop, and when we got back to stepping thread 3, it happened to be in the stepping range. (The loop increments a counter, and the test makes sure it increments exactly once. Without the fix, the counter increments a bunch, since the user-stepped thread runs free without GDB noticing.) The fix is to switch to the stepping thread before continuing for the step-resume breakpoint. gdb/ 2014-02-07 Pedro Alves <palves@redhat.com> * infrun.c (handle_signal_stop) <signal arrives while stepping over a breakpoint>: Switch back to the stepping thread. gdb/testsuite/ 2014-02-07 Pedro Alves <pedro@codesourcery.com> Pedro Alves <palves@redhat.com> * gdb.threads/step-after-sr-lock.c: New file. * gdb.threads/step-after-sr-lock.exp: New file.
2014-02-07 20:11:25 +01:00
2014-02-07 Pedro Alves <palves@redhat.com>
PR breakpoints/16292
Make sure we don't resume the stepped thread by accident. Say: <stopped at a breakpoint in thread 2> (gdb) thread 3 (gdb) step The above triggers the prepare_to_proceed/deferred_step_ptid process, which switches back to thread 2, to step over its breakpoint before getting back to thread 3 and "step" it. If while stepping over the breakpoint in thread 2, a signal arrives, and it is set to pass/nostop, we'll set a step-resume breakpoint at the supposed signal-handler resume address, and call keep_going. The problem is that we were supposedly stepping thread 3, and that keep_going delivers a signal to thread 2, and due to scheduler-locking off, resumes everything else, _including_ thread 3, the thread we want stepping. This means that we lose control of thread 3 until the next event, when we stop everything. The end result for the user, is that GDB lost control of the "step". Here's the current infrun debug output of the above, with the testcase in the patch below: infrun: clear_proceed_status_thread (Thread 0x2aaaab8f5700 (LWP 11663)) infrun: clear_proceed_status_thread (Thread 0x2aaaab6f4700 (LWP 11662)) infrun: clear_proceed_status_thread (Thread 0x2aaaab4f2b20 (LWP 11659)) infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1) infrun: prepare_to_proceed (step=1), switched to [Thread 0x2aaaab6f4700 (LWP 11662)] infrun: resume (step=1, signal=0), trap_expected=1, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f infrun: wait_for_inferior () infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)], infrun: status->kind = stopped, signal = SIGUSR1 infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40098f infrun: random signal 30 Program received signal SIGUSR1, User defined signal 1. infrun: signal arrived while stepping over breakpoint infrun: inserting step-resume breakpoint at 0x40098f infrun: resume (step=0, signal=30), trap_expected=0, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f ^^^ this is a wildcard resume. infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40098f infrun: BPSTAT_WHAT_STEP_RESUME infrun: resume (step=1, signal=0), trap_expected=1, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f ^^^ step-resume hit, meaning the handler returned, so we go back to stepping thread 3. infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40088b infrun: switching back to stepped thread infrun: Switching context from Thread 0x2aaaab6f4700 (LWP 11662) to Thread 0x2aaaab8f5700 (LWP 11663) infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x2aaaab8f5700 (LWP 11663)] at 0x400938 infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab8f5700 (LWP 11663)], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40093a infrun: keep going infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x2aaaab8f5700 (LWP 11663)] at 0x40093a infrun: prepare_to_wait infrun: target_wait (-1, status) = infrun: 11659 [Thread 0x2aaaab8f5700 (LWP 11663)], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x40091e infrun: stepped to a different line infrun: stop_stepping [Switching to Thread 0x2aaaab8f5700 (LWP 11663)] 69 (*myp) ++; /* set breakpoint child_two here */ ^^^ we stopped at the wrong line. We still stepped a bit because the test is running in a loop, and when we got back to stepping thread 3, it happened to be in the stepping range. (The loop increments a counter, and the test makes sure it increments exactly once. Without the fix, the counter increments a bunch, since the user-stepped thread runs free without GDB noticing.) The fix is to switch to the stepping thread before continuing for the step-resume breakpoint. gdb/ 2014-02-07 Pedro Alves <palves@redhat.com> * infrun.c (handle_signal_stop) <signal arrives while stepping over a breakpoint>: Switch back to the stepping thread. gdb/testsuite/ 2014-02-07 Pedro Alves <pedro@codesourcery.com> Pedro Alves <palves@redhat.com> * gdb.threads/step-after-sr-lock.c: New file. * gdb.threads/step-after-sr-lock.exp: New file.
2014-02-07 20:11:25 +01:00
* infrun.c (handle_signal_stop) <signal arrives while stepping
over a breakpoint>: Switch back to the stepping thread.
2014-02-07 Yao Qi <yao@codesourcery.com>
* target.c (target_xfer_partial): Return zero if LEN is zero.
Replace -1 with TARGET_XFER_E_IO Hi, This patch replaces -1 with TARGET_XFER_E_IO in the implementations of to_xfer_partial and their callees. This change is quite mechanical, and makes the next patch shorter. gdb: 2014-02-07 Yao Qi <yao@codesourcery.com> * auxv.c (procfs_xfer_auxv): Replace -1 with TARGET_XFER_E_IO. (ld_so_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_dyld_info): Likewise. (darwin_xfer_partial): Likewise. * exec.c (exec_xfer_partial): Likewise. * gnu-nat.c (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_uregs): Likewise. * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise. * inf-ttrace.c (inf_ttrace_xfer_partial): Likewise. * linux-nat.c (linux_xfer_siginfo): Likewise. (linux_proc_xfer_spu): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_partial): Likewise. * remote.c (remote_write_qxfer): Likewise. (remote_write_qxfer, remote_read_qxfer): Likewise. (remote_xfer_partial): Likewise. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. (spu_xfer_partial): Likewise. * target.c (memory_xfer_partial_1): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_shared_libraries): Likewise. (windows_xfer_partial): Likewise.
2014-01-27 10:32:33 +01:00
2014-02-07 Yao Qi <yao@codesourcery.com>
* auxv.c (procfs_xfer_auxv): Replace -1 with TARGET_XFER_E_IO.
(ld_so_xfer_auxv): Likewise.
* bfd-target.c (target_bfd_xfer_partial): Likewise.
* bsd-kvm.c (bsd_kvm_xfer_partial): Likewise.
* corelow.c (core_xfer_partial): Likewise.
* ctf.c (ctf_xfer_partial): Likewise.
* darwin-nat.c (darwin_read_dyld_info): Likewise.
(darwin_xfer_partial): Likewise.
* exec.c (exec_xfer_partial): Likewise.
* gnu-nat.c (gnu_xfer_partial): Likewise.
* ia64-hpux-nat.c (ia64_hpux_xfer_uregs): Likewise.
* inf-ptrace.c (inf_ptrace_xfer_partial): Likewise.
* inf-ttrace.c (inf_ttrace_xfer_partial): Likewise.
* linux-nat.c (linux_xfer_siginfo): Likewise.
(linux_proc_xfer_spu): Likewise.
* procfs.c (procfs_xfer_partial): Likewise.
* record-full.c (record_full_xfer_partial): Likewise.
(record_full_core_xfer_partial): Likewise.
* remote-sim.c (gdbsim_xfer_partial): Likewise.
* remote.c (remote_write_qxfer): Likewise.
(remote_write_qxfer, remote_read_qxfer): Likewise.
(remote_xfer_partial): Likewise.
* rs6000-nat.c (rs6000_xfer_partial): Likewise.
(rs6000_xfer_shared_libraries): Likewise.
* sparc-nat.c (sparc_xfer_wcookie): Likewise.
* spu-linux-nat.c (spu_proc_xfer_spu): Likewise.
(spu_xfer_partial): Likewise.
* target.c (memory_xfer_partial_1): Likewise.
* tracepoint.c (tfile_xfer_partial): Likewise.
* windows-nat.c (windows_xfer_shared_libraries): Likewise.
(windows_xfer_partial): Likewise.
2014-02-07 Yao Qi <yao@codesourcery.com>
* gdbarch.sh (core_xfer_shared_libraries): Returns ULONGEST. Add
comments.
(core_xfer_shared_libraries_aix): Likewise.
* gdbarch.c, gdbarch.h: Regenerated.
* i386-cygwin-tdep.c (windows_core_xfer_shared_libraries): Return
ULONGEST. Change 'len_avail' type to ULONGEST.
* rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise.
* rs6000-aix-tdep.h (rs6000_aix_ld_info_to_xml): Update
declaration.
(rs6000_aix_core_xfer_shared_libraries_aix): Return ULONGEST.
2014-02-07 Yao Qi <yao@codesourcery.com>
* corefile.c (memory_error): Get 'exception' from ERR and pass
'exception' to throw_error.
Extension Language API * configure.ac (libpython checking): Remove all but python.o from CONFIG_OBS. Remove all but python.c from CONFIG_SRCS. * configure: Regenerate. * Makefile.in (SFILES): Add extension.c. (HFILES_NO_SRCDIR): Add extension.h, extension-priv.h (COMMON_OBS): Add extension.o. * extension.h: New file. * extension-priv.h: New file. * extension.c: New file. * python/python-internal.h: #include "extension.h". (gdbpy_auto_load_enabled): Declare. (gdbpy_apply_val_pretty_printer): Declare. (gdbpy_apply_frame_filter): Declare. (gdbpy_preserve_values): Declare. (gdbpy_breakpoint_cond_says_stop): Declare. (gdbpy_breakpoint_has_cond): Declare. (void source_python_script_for_objfile): Delete. * python/python.c: #include "extension-priv.h". Delete inclusion of "observer.h". (extension_language_python): Moved here and renamed from script_language_python in py-auto-load.c. Redefined to be of type extension_language_defn. (python_extension_script_ops): New global. (python_extension_ops): New global. (struct python_env): New member previous_active. (restore_python_env): Call restore_active_ext_lang. (ensure_python_env): Call set_active_ext_lang. (gdbpy_clear_quit_flag): Renamed from clear_quit_flag, made static. New arg extlang. (gdbpy_set_quit_flag): Renamed from set_quit_flag, made static. New arg extlang. (gdbpy_check_quit_flag): Renamed from check_quit_flag, made static. New arg extlang. (gdbpy_eval_from_control_command): Renamed from eval_python_from_control_command, made static. New arg extlang. (gdbpy_source_script) Renamed from source_python_script, made static. New arg extlang. (gdbpy_before_prompt_hook): Renamed from before_prompt_hook. Change result to int. New arg extlang. (gdbpy_source_objfile_script): Renamed from source_python_script_for_objfile, made static. New arg extlang. (gdbpy_start_type_printers): Renamed from start_type_printers, made static. New args extlang, extlang_printers. Change result type to "void". (gdbpy_apply_type_printers): Renamed from apply_type_printers, made static. New arg extlang. Rename arg printers to extlang_printers and change type to ext_lang_type_printers *. (gdbpy_free_type_printers): Renamed from free_type_printers, made static. Replace argument arg with extlang, extlang_printers. (!HAVE_PYTHON, eval_python_from_control_command): Delete. (!HAVE_PYTHON, source_python_script): Delete. (!HAVE_PYTHON, gdbpy_should_stop): Delete. (!HAVE_PYTHON, gdbpy_breakpoint_has_py_cond): Delete. (!HAVE_PYTHON, start_type_printers): Delete. (!HAVE_PYTHON, apply_type_printers): Delete. (!HAVE_PYTHON, free_type_printers): Delete. (_initialize_python): Delete call to observer_attach_before_prompt. (finalize_python): Set/restore active extension language. (gdbpy_finish_initialization) Renamed from finish_python_initialization, made static. New arg extlang. (gdbpy_initialized): New function. * python/python.h: #include "extension.h". Delete #include "value.h", "mi/mi-cmds.h". (extension_language_python): Declare. (GDBPY_AUTO_FILE_NAME): Delete. (enum py_bt_status): Moved to extension.h and renamed to ext_lang_bt_status. (enum frame_filter_flags): Moved to extension.h. (enum py_frame_args): Moved to extension.h and renamed to ext_lang_frame_args. (finish_python_initialization): Delete. (eval_python_from_control_command): Delete. (source_python_script): Delete. (apply_val_pretty_printer): Delete. (apply_frame_filter): Delete. (preserve_python_values): Delete. (gdbpy_script_language_defn): Delete. (gdbpy_should_stop, gdbpy_breakpoint_has_py_cond): Delete. (start_type_printers, apply_type_printers, free_type_printers): Delete. * auto-load.c: #include "extension.h". (GDB_AUTO_FILE_NAME): Delete. (auto_load_gdb_scripts_enabled): Make public. New arg extlang. (script_language_gdb): Delete, moved to extension.c and renamed to extension_language_gdb. (source_gdb_script_for_objfile): Delete. (auto_load_pspace_info): New member unsupported_script_warning_printed. (loaded_script): Change type of language member to struct extension_language_defn *. (init_loaded_scripts_info): Initialize unsupported_script_warning_printed. (maybe_add_script): Make static. Change type of language arg to struct extension_language_defn *. (clear_section_scripts): Reset unsupported_script_warning_printed. (auto_load_objfile_script_1): Rewrite to use extension language API. (auto_load_objfile_script): Make public. Remove support-compiled-in and auto-load-enabled checks, moved to auto_load_scripts_for_objfile. (source_section_scripts): Rewrite to use extension language API. (load_auto_scripts_for_objfile): Rewrite to use auto_load_scripts_for_objfile. (collect_matching_scripts_data): Change type of language member to struct extension_language_defn *. (auto_load_info_scripts): Change type of language arg to struct extension_language_defn *. (unsupported_script_warning_print): New function. (script_not_found_warning_print): Make static. (_initialize_auto_load): Rewrite construction of scripts-directory help. * auto-load.h (struct objfile): Add forward decl. (struct script_language): Delete. (struct auto_load_pspace_info): Add forward decl. (struct extension_language_defn): Add forward decl. (maybe_add_script): Delete. (auto_load_objfile_script): Declare. (script_not_found_warning_print): Delete. (auto_load_info_scripts): Update prototype. (auto_load_gdb_scripts_enabled): Declare. * python/py-auto-load.c (gdbpy_auto_load_enabled): Renamed from auto_load_python_scripts_enabled and made public. (script_language_python): Delete, moved to python.c. (gdbpy_script_language_defn): Delete. (info_auto_load_python_scripts): Update to use extension_language_python. * breakpoint.c (condition_command): Replace call to gdbpy_breakpoint_has_py_cond with call to get_breakpoint_cond_ext_lang. (bpstat_check_breakpoint_conditions): Replace call to gdbpy_should_stop with call to breakpoint_ext_lang_cond_says_stop. * python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Renamed from gdbpy_should_stop. Change result type to enum scr_bp_stop. New arg slang. Return SCR_BP_STOP_UNSET if py_bp_object is NULL. (gdbpy_breakpoint_has_cond): Renamed from gdbpy_breakpoint_has_py_cond. New arg slang. (local_setattro): Print name of extension language with existing stop condition. * valprint.c (val_print, value_print): Update to call apply_ext_lang_val_pretty_printer. * cp-valprint.c (cp_print_value): Update call to apply_ext_lang_val_pretty_printer. * python/py-prettyprint.c: Remove #ifdef HAVE_PYTHON. (gdbpy_apply_val_pretty_printer): Renamed from apply_val_pretty_printer. New arg extlang. (!HAVE_PYTHON, apply_val_pretty_printer): Delete. * cli/cli-cmds.c (source_script_from_stream): Rewrite to use extension language API. * cli/cli-script.c (execute_control_command): Update to call eval_ext_lang_from_control_command. * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Update to use enum ext_lang_bt_status values. Update call to apply_ext_lang_frame_filter. (mi_cmd_stack_list_locals): Ditto. (mi_cmd_stack_list_args): Ditto. (mi_cmd_stack_list_variables): Ditto. * mi/mi-main.c: Delete #include "python/python-internal.h". Add #include "extension.h". (mi_cmd_list_features): Replace reference to python internal variable gdb_python_initialized with call to ext_lang_initialized_p. * stack.c (backtrace_command_1): Update to use enum ext_lang_bt_status. Update to use enum ext_lang_frame_args. Update to call apply_ext_lang_frame_filter. * python/py-framefilter.c (extract_sym): Update to use enum ext_lang_bt_status. (extract_value, py_print_type, py_print_value): Ditto. (py_print_single_arg, enumerate_args, enumerate_locals): Ditto. (py_mi_print_variables, py_print_locals, py_print_args): Ditto. (py_print_frame): Ditto. (gdbpy_apply_frame_filter): Renamed from apply_frame_filter. New arg extlang. Update to use enum ext_lang_bt_status. * top.c (gdb_init): Delete #ifdef HAVE_PYTHON call to finish_python_initialization. Replace with call to finish_ext_lang_initialization. * typeprint.c (do_free_global_table): Update to call free_ext_lang_type_printers. (create_global_typedef_table): Update to call start_ext_lang_type_printers. (find_global_typedef): Update to call apply_ext_lang_type_printers. * typeprint.h (struct ext_lang_type_printers): Add forward decl. (type_print_options): Change type of global_printers from "void *" to "struct ext_lang_type_printers *". * value.c (preserve_values): Update to call preserve_ext_lang_values. * python/py-value.c: Remove #ifdef HAVE_PYTHON. (gdbpy_preserve_values): Renamed from preserve_python_values. New arg extlang. (!HAVE_PYTHON, preserve_python_values): Delete. * utils.c (quit_flag): Delete, moved to extension.c. (clear_quit_flag, set_quit_flag, check_quit_flag): Delete, moved to extension.c. * eval.c: Delete #include "python/python.h". * main.c: Delete #include "python/python.h". * defs.h: Update comment. testsuite/ * gdb.python/py-breakpoint.exp (test_bkpt_eval_funcs): Update expected output. * gdb.gdb/python-interrupts.exp: New file.
2014-02-06 04:27:58 +01:00
2014-02-06 Doug Evans <xdje42@gmail.com>
* configure.ac (libpython checking): Remove all but python.o from
CONFIG_OBS. Remove all but python.c from CONFIG_SRCS.
* configure: Regenerate.
* Makefile.in (SFILES): Add extension.c.
(HFILES_NO_SRCDIR): Add extension.h, extension-priv.h
(COMMON_OBS): Add extension.o.
* extension.h: New file.
* extension-priv.h: New file.
* extension.c: New file.
* python/python-internal.h: #include "extension.h".
(gdbpy_auto_load_enabled): Declare.
(gdbpy_apply_val_pretty_printer): Declare.
(gdbpy_apply_frame_filter): Declare.
(gdbpy_preserve_values): Declare.
(gdbpy_breakpoint_cond_says_stop): Declare.
(gdbpy_breakpoint_has_cond): Declare.
(void source_python_script_for_objfile): Delete.
* python/python.c: #include "extension-priv.h".
Delete inclusion of "observer.h".
(extension_language_python): Moved here and renamed from
script_language_python in py-auto-load.c.
Redefined to be of type extension_language_defn.
(python_extension_script_ops): New global.
(python_extension_ops): New global.
(struct python_env): New member previous_active.
(restore_python_env): Call restore_active_ext_lang.
(ensure_python_env): Call set_active_ext_lang.
(gdbpy_clear_quit_flag): Renamed from clear_quit_flag, made static.
New arg extlang.
(gdbpy_set_quit_flag): Renamed from set_quit_flag, made static.
New arg extlang.
(gdbpy_check_quit_flag): Renamed from check_quit_flag, made static.
New arg extlang.
(gdbpy_eval_from_control_command): Renamed from
eval_python_from_control_command, made static. New arg extlang.
(gdbpy_source_script) Renamed from source_python_script, made static.
New arg extlang.
(gdbpy_before_prompt_hook): Renamed from before_prompt_hook. Change
result to int. New arg extlang.
(gdbpy_source_objfile_script): Renamed from
source_python_script_for_objfile, made static. New arg extlang.
(gdbpy_start_type_printers): Renamed from start_type_printers, made
static. New args extlang, extlang_printers. Change result type to
"void".
(gdbpy_apply_type_printers): Renamed from apply_type_printers, made
static. New arg extlang. Rename arg printers to extlang_printers
and change type to ext_lang_type_printers *.
(gdbpy_free_type_printers): Renamed from free_type_printers, made
static. Replace argument arg with extlang, extlang_printers.
(!HAVE_PYTHON, eval_python_from_control_command): Delete.
(!HAVE_PYTHON, source_python_script): Delete.
(!HAVE_PYTHON, gdbpy_should_stop): Delete.
(!HAVE_PYTHON, gdbpy_breakpoint_has_py_cond): Delete.
(!HAVE_PYTHON, start_type_printers): Delete.
(!HAVE_PYTHON, apply_type_printers): Delete.
(!HAVE_PYTHON, free_type_printers): Delete.
(_initialize_python): Delete call to observer_attach_before_prompt.
(finalize_python): Set/restore active extension language.
(gdbpy_finish_initialization) Renamed from
finish_python_initialization, made static. New arg extlang.
(gdbpy_initialized): New function.
* python/python.h: #include "extension.h". Delete #include
"value.h", "mi/mi-cmds.h".
(extension_language_python): Declare.
(GDBPY_AUTO_FILE_NAME): Delete.
(enum py_bt_status): Moved to extension.h and renamed to
ext_lang_bt_status.
(enum frame_filter_flags): Moved to extension.h.
(enum py_frame_args): Moved to extension.h and renamed to
ext_lang_frame_args.
(finish_python_initialization): Delete.
(eval_python_from_control_command): Delete.
(source_python_script): Delete.
(apply_val_pretty_printer): Delete.
(apply_frame_filter): Delete.
(preserve_python_values): Delete.
(gdbpy_script_language_defn): Delete.
(gdbpy_should_stop, gdbpy_breakpoint_has_py_cond): Delete.
(start_type_printers, apply_type_printers, free_type_printers): Delete.
* auto-load.c: #include "extension.h".
(GDB_AUTO_FILE_NAME): Delete.
(auto_load_gdb_scripts_enabled): Make public. New arg extlang.
(script_language_gdb): Delete, moved to extension.c and renamed to
extension_language_gdb.
(source_gdb_script_for_objfile): Delete.
(auto_load_pspace_info): New member unsupported_script_warning_printed.
(loaded_script): Change type of language member to
struct extension_language_defn *.
(init_loaded_scripts_info): Initialize
unsupported_script_warning_printed.
(maybe_add_script): Make static. Change type of language arg to
struct extension_language_defn *.
(clear_section_scripts): Reset unsupported_script_warning_printed.
(auto_load_objfile_script_1): Rewrite to use extension language API.
(auto_load_objfile_script): Make public. Remove support-compiled-in
and auto-load-enabled checks, moved to auto_load_scripts_for_objfile.
(source_section_scripts): Rewrite to use extension language API.
(load_auto_scripts_for_objfile): Rewrite to use
auto_load_scripts_for_objfile.
(collect_matching_scripts_data): Change type of language member to
struct extension_language_defn *.
(auto_load_info_scripts): Change type of language arg to
struct extension_language_defn *.
(unsupported_script_warning_print): New function.
(script_not_found_warning_print): Make static.
(_initialize_auto_load): Rewrite construction of scripts-directory
help.
* auto-load.h (struct objfile): Add forward decl.
(struct script_language): Delete.
(struct auto_load_pspace_info): Add forward decl.
(struct extension_language_defn): Add forward decl.
(maybe_add_script): Delete.
(auto_load_objfile_script): Declare.
(script_not_found_warning_print): Delete.
(auto_load_info_scripts): Update prototype.
(auto_load_gdb_scripts_enabled): Declare.
* python/py-auto-load.c (gdbpy_auto_load_enabled): Renamed from
auto_load_python_scripts_enabled and made public.
(script_language_python): Delete, moved to python.c.
(gdbpy_script_language_defn): Delete.
(info_auto_load_python_scripts): Update to use
extension_language_python.
* breakpoint.c (condition_command): Replace call to
gdbpy_breakpoint_has_py_cond with call to get_breakpoint_cond_ext_lang.
(bpstat_check_breakpoint_conditions): Replace call to gdbpy_should_stop
with call to breakpoint_ext_lang_cond_says_stop.
* python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Renamed
from gdbpy_should_stop. Change result type to enum scr_bp_stop.
New arg slang. Return SCR_BP_STOP_UNSET if py_bp_object is NULL.
(gdbpy_breakpoint_has_cond): Renamed from gdbpy_breakpoint_has_py_cond.
New arg slang.
(local_setattro): Print name of extension language with existing
stop condition.
* valprint.c (val_print, value_print): Update to call
apply_ext_lang_val_pretty_printer.
* cp-valprint.c (cp_print_value): Update call to
apply_ext_lang_val_pretty_printer.
* python/py-prettyprint.c: Remove #ifdef HAVE_PYTHON.
(gdbpy_apply_val_pretty_printer): Renamed from
apply_val_pretty_printer. New arg extlang.
(!HAVE_PYTHON, apply_val_pretty_printer): Delete.
* cli/cli-cmds.c (source_script_from_stream): Rewrite to use
extension language API.
* cli/cli-script.c (execute_control_command): Update to call
eval_ext_lang_from_control_command.
* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Update to use
enum ext_lang_bt_status values. Update call to
apply_ext_lang_frame_filter.
(mi_cmd_stack_list_locals): Ditto.
(mi_cmd_stack_list_args): Ditto.
(mi_cmd_stack_list_variables): Ditto.
* mi/mi-main.c: Delete #include "python/python-internal.h".
Add #include "extension.h".
(mi_cmd_list_features): Replace reference to python internal variable
gdb_python_initialized with call to ext_lang_initialized_p.
* stack.c (backtrace_command_1): Update to use enum ext_lang_bt_status.
Update to use enum ext_lang_frame_args. Update to call
apply_ext_lang_frame_filter.
* python/py-framefilter.c (extract_sym): Update to use enum
ext_lang_bt_status.
(extract_value, py_print_type, py_print_value): Ditto.
(py_print_single_arg, enumerate_args, enumerate_locals): Ditto.
(py_mi_print_variables, py_print_locals, py_print_args): Ditto.
(py_print_frame): Ditto.
(gdbpy_apply_frame_filter): Renamed from apply_frame_filter.
New arg extlang. Update to use enum ext_lang_bt_status.
* top.c (gdb_init): Delete #ifdef HAVE_PYTHON call to
finish_python_initialization. Replace with call to
finish_ext_lang_initialization.
* typeprint.c (do_free_global_table): Update to call
free_ext_lang_type_printers.
(create_global_typedef_table): Update to call
start_ext_lang_type_printers.
(find_global_typedef): Update to call apply_ext_lang_type_printers.
* typeprint.h (struct ext_lang_type_printers): Add forward decl.
(type_print_options): Change type of global_printers from "void *"
to "struct ext_lang_type_printers *".
* value.c (preserve_values): Update to call preserve_ext_lang_values.
* python/py-value.c: Remove #ifdef HAVE_PYTHON.
(gdbpy_preserve_values): Renamed from preserve_python_values.
New arg extlang.
(!HAVE_PYTHON, preserve_python_values): Delete.
* utils.c (quit_flag): Delete, moved to extension.c.
(clear_quit_flag, set_quit_flag, check_quit_flag): Delete, moved to
extension.c.
* eval.c: Delete #include "python/python.h".
* main.c: Delete #include "python/python.h".
* defs.h: Update comment.
2014-02-06 Joel Brobecker <brobecker@adacore.com>
GDB 7.7 released.
2014-02-05 Mark Kettenis <kettenis@gnu.org>
* c-exp.y (YYPRINT, c_print_token): Only define if YYBISON is
defined.
2014-02-05 Yao Qi <yao@codesourcery.com>
* remote.c (remote_pass_signals): Remove local 'buf' and use
rs->buf.
(remote_program_signals): Likewise.
2014-02-05 Yao Qi <yao@codesourcery.com>
* ctf.c: Include "inferior.h" and "gdbthread.h".
(CTF_PID): A new macro.
(ctf_open): Call inferior_appeared and add_thread_silent.
(ctf_close): Call exit_inferior_silent and set inferior_ptid.
(ctf_thread_alive): New function.
(init_ctf_ops): Install ctf_thread_alive to to_thread_alive.
2014-02-05 Yao Qi <yao@codesourcery.com>
Revert this patch:
2013-05-24 Yao Qi <yao@codesourcery.com>
* tracepoint.c (TFILE_PID): Remove.
(tfile_open): Don't add thread and inferior.
(tfile_close): Don't set 'inferior_ptid'. Don't call
exit_inferior_silent.
(tfile_thread_alive): Remove.
(init_tfile_ops): Don't set field 'to_thread_alive' of
tfile_ops.
2014-02-04 Christian Eggers <ceggers@gmx.de> (tiny change)
* remote.c (remote_start_remote): Call remote_check_symbols even
if only symbol-file (not file) has been given.
PowerPC64 ELFv2 ABI: skip global entry point code This patch handles another aspect of the ELFv2 ABI, which unfortunately requires common code changes. In ELFv2, functions may provide both a global and a local entry point. The global entry point (where the function symbol points to) is intended to be used for function-pointer or cross-module (PLT) calls, and requires r12 to be set up to the entry point address itself. The local entry point (which is found at a fixed offset after the global entry point, as defined by bits in the symbol table entries' st_other field), instead expects r2 to be set up to the current TOC. Now, when setting a breakpoint on a function by name, you really want that breakpoint to trigger either way, no matter whether the function is called via its local or global entry point. Since the global entry point will always fall through into the local entry point, the way to achieve that is to simply set the breakpoint at the local entry point. One way to do that would be to have prologue parsing skip the code sequence that makes up the global entry point. Unfortunately, this does not work reliably, since -for optimized code- GDB these days will not actuall invoke the prologue parsing code but instead just set the breakpoint at the symbol address and rely on DWARF being correct at any point throughout the function ... Unfortunately, I don't really see any way to express the notion of local entry points with the current set of gdbarch callbacks. Thus this patch adds a new callback, skip_entrypoint, that is somewhat analogous to skip_prologue, but is called every time GDB needs to determine a function start address, even in those cases where GDB decides to not call skip_prologue. As a side effect, the skip_entrypoint implementation on ppc64 does not need to perform any instruction parsing; it can simply rely on the local entry point flags in the symbol table entry. With this implemented, two test cases would still fail to set the breakpoint correctly, but that's because they use the construct: gdb_test "break *hello" Now, using "*hello" explicitly instructs GDB to set the breakpoint at the numerical value of "hello" treated as function pointer, so it will by definition only hit the global entry point. I think this behaviour is unavoidable, but acceptable -- most people do not use this construct, and if they do, they get what they asked for ... In one of those two test cases, use of this construct is really not appropriate. I think this was added way back when as a means to work around prologue skipping problems on some platforms. These days that shouldn't really be necessary any more ... For the other (step-bt), we really want to make sure backtracing works on the very first instruction of the routine. To enable that test also on powerpc64le-linux, we can modify the code to call the test function via function pointer (which makes it use the global entry point in the ELFv2 ABI). gdb/ChangeLog: * gdbarch.sh (skip_entrypoint): New callback. * gdbarch.c, gdbarch.h: Regenerate. * symtab.c (skip_prologue_sal): Call gdbarch_skip_entrypoint. * infrun.c (fill_in_stop_func): Likewise. * ppc-linux-tdep.c: Include "elf/ppc64.h". (ppc_elfv2_elf_make_msymbol_special): New function. (ppc_elfv2_skip_entrypoint): Likewise. (ppc_linux_init_abi): Install them for ELFv2. gdb/testsuite/ChangeLog: * gdb.base/sigbpt.exp: Do not use "*" when setting breakpoint on a function. * gdb.base/step-bt.c: Call hello via function pointer to make sure its first instruction is executed on powerpc64le-linux.
2014-02-04 18:44:14 +01:00
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* gdbarch.sh (skip_entrypoint): New callback.
* gdbarch.c, gdbarch.h: Regenerate.
* symtab.c (skip_prologue_sal): Call gdbarch_skip_entrypoint.
* infrun.c (fill_in_stop_func): Likewise.
* ppc-linux-tdep.c: Include "elf/ppc64.h".
(ppc_elfv2_elf_make_msymbol_special): New function.
(ppc_elfv2_skip_entrypoint): Likewise.
(ppc_linux_init_abi): Install them for ELFv2.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc-sysv-tdep.c (ppc64_aggregate_candidate): New routine.
(ppc64_elfv2_abi_homogeneous_aggregate): Likewise.
(ppc64_sysv_abi_push_param): Handle ELFv2 homogeneous structs.
(ppc64_sysv_abi_return_value): Likewise. Also, handle small
structures returned in GPRs.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Use correct
offset to the stack parameter list for the ELFv2 ABI.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc-linux-tdep.c (ppc_linux_init_abi): Only call
set_gdbarch_convert_from_func_ptr_addr and
set_gdbarch_elf_make_msymbol_special for ELFv1.
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_param): Only handle
function descriptors on ELFv1.
(ppc64_sysv_abi_push_dummy_call): Likewise. On ELFv2,
set up r12 at function entry.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc-tdep.h (enum powerpc_elf_abi): New data type.
(struct gdbarch_tdep): New member elf_abi.
* rs6000-tdep.c: Include "elf/ppc64.h".
(rs6000_gdbarch_init): Detect ELF ABI version.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct order
within a register pair holding a DFP 128-bit value on little-endian.
(ppc64_sysv_abi_return_value_base): Likewise.
* rs6000-tdep.c (dfp_pseudo_register_read): Likewise.
(dfp_pseudo_register_write): Likewise.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct
offset on little-endian when passing _Decimal32.
(ppc64_sysv_abi_return_value_base): Likewise for return values.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* rs6000-tdep.c (efpr_pseudo_register_read): Use correct offset
of the overlapped FP register within the VSX register on little-
endian platforms.
(efpr_pseudo_register_write): Likewise.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_val): Use correct
offset on little-endian when passing small structures.
Refactor ppc64 function call and return value handling This patch refactors the ppc64 function call and return value handling code in ppc-sysv-tdep.c. The main problem to be addressed by this refactoring is the code duplication caused by certain aggregate types: According to the ABI, some types are to be decomposed into component types for parameter and return value handling. For example, complex types are to be passed as if the real and imaginary component were separate arguments. Similarly, certain OpenCL vector types are passed as if they were multiple separate arguments of the vector element type. With the new ELFv2 ABI, there is another case: "homogeneous aggregates" (e.g. a struct containing 4 floats) are passed in multiple floating point registers as well. Unfortunately, the current code is not structured to easily model these ABI properties. For example, code to pass complex values re-implements code to pass the underlying (floating-point) type. This has already led to some unfortunate code duplication, and with the addition of ELFv2 ABI support, I would have had to add yet more such duplication. To avoid that, I've decided to refactor the code in order to re-use subroutines that handle the "base" types when handling those aggregate types. This was not intended to cause any difference on current (ELFv1) ABI code, but in fact it fixes a bug: FAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3, fc4) This was caused by the old code in ppc64_sysv_abi_push_float incorrectly handling floating-point arguments to vararg routines, which just happens to work out correctly automatically in the refactored code ... gdb/ChangeLog: * ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment. (struct ppc64_sysv_argpos): New data structure. (ppc64_sysv_abi_push_float): Remove. (ppc64_sysv_abi_push_val): New function. (ppc64_sysv_abi_push_integer): Likewise. (ppc64_sysv_abi_push_freg): Likewise. (ppc64_sysv_abi_push_vreg): Likewise. (ppc64_sysv_abi_push_param): Likewise. (ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines. (ppc64_sysv_abi_return_value_base): New function. (ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 18:24:42 +01:00
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment.
(struct ppc64_sysv_argpos): New data structure.
(ppc64_sysv_abi_push_float): Remove.
(ppc64_sysv_abi_push_val): New function.
(ppc64_sysv_abi_push_integer): Likewise.
(ppc64_sysv_abi_push_freg): Likewise.
(ppc64_sysv_abi_push_vreg): Likewise.
(ppc64_sysv_abi_push_param): Likewise.
(ppc64_sysv_abi_push_dummy_call): Refactor to use those new routines.
(ppc64_sysv_abi_return_value_base): New function.
(ppc64_sysv_abi_return_value): Refactor to use it.
2014-02-04 Ulrich Weigand  <uweigand@de.ibm.com>
* NEWS: Document new target powerpc64le-*-linux*.
2014-02-04 Mark Kettenis <kettenis@gnu.org>
* sparc64obsd-tdep.c (sparc64obsd_gregset): New variable.
(sparc64obsd_supply_gregset): Handle registers sets used in ELF
core dumps.
(sparc64obsd_init_abi): Adjust minimum size of the general purpose
register set used in ELF core dumps. Add floating-point register set.
2014-02-03 Kevin Buettner <kevinb@redhat.com>
* mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Rewrite
dwarf2_to_gdb[] table using symbolic constants. Adjust
penultimate entry from number representing the PC register
to symbolic constant representing the MDR register. Add
constant for the PC register to the end of the table.
2014-02-03 Mark Kettenis <kettenis@gnu.org>
* bsd-kvm.c: Include <sys/param.h>
2014-02-03 Mark Kettenis <kettenis@gnu.org>
* sparc64nbsd-nat.c (sparc64nbsd_supply_fpregset): Fix prototype.
2014-01-31 Joel Brobecker <brobecker@adacore.com>
* ada-lang.h (clear_ada_sym_cache): Delete.
2014-01-30 Ulrich Weigand  <uweigand@de.ibm.com>
* auxv.c (fprint_target_auxv): Handle AT_HWCAP2.
2014-01-29 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc64-linux-tdep.c (sparc64_linux_step_trap): Get PC from
the sigreturn register save area only if the syscall is
sigreturn.
2014-01-29 Joel Brobecker <brobecker@adacore.com>
* valops.c (value_slice): Minor reformatting.
2014-01-28 Ulrich Weigand  <uweigand@de.ibm.com>
* ppc64-tdep.c (ppc64_standard_linkage7): Fix typo.
New Ada maintenance command to ignore descriptive types (DWARF). Currently, Ada debugging requires the use of certain GNAT-specific encodings, which are generated by the compiler. These encodings were created a long time ago to work around the fairly limited capabilities of the stabs debugging format. With DWARF, the vast majority of the encodings could be abandoned in favor of a pure DWARF approach. In order to make it easier to evaluate the quality of the DWARF debugging information generated by the compiler, and how the debugger handles it, we are introducing a small Ada-specific maintenance setting which changes the debugger's behavior to ignore descriptive types. Descriptive types are artificial types generated by the compiler purely to give the debugger hints as to how to properly decode certain properties of a type. For instance, for array types, it generates a parallel type whose name is the name of the array suffixed with ___XA, whose contents tells us what the array's index type is, and possibly its bounds. See GCC's gcc/ada/exp_dbug.ads for the full description of all encodings. This is only a first step, as this setting does not deactivate all encodings; More settings dedicated to each type of encoding will likely be implemented in the future, as we make progress. gdb/ChangeLog: * ada-lang.c (maint_set_ada_cmdlist, maint_show_ada_cmdlist): New static globals. (maint_set_ada_cmd, maint_show_ada_cmd): New functions. (ada_ignore_descriptive_types_p): New static global. (find_parallel_type_by_descriptive_type): Return immediately if ada_ignore_descriptive_types_p is set. (_initialize_ada_language): Register new commands "maintenance set ada", "maintenance show ada", "maintenance set ada ignore-descriptive-types" and "maintenance show ada ignore-descriptive-types". * NEWS: Add entry for new "maint ada set/show ignore-descriptive-types" commands. gdb/doc/ChangeLog: * gdb.texinfo (Ada Glitches): Document the new "maint ada set/show ignore-descriptive-types". commands.
2014-01-16 12:08:16 +01:00
2014-01-28 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (maint_set_ada_cmdlist, maint_show_ada_cmdlist):
New static globals.
(maint_set_ada_cmd, maint_show_ada_cmd): New functions.
(ada_ignore_descriptive_types_p): New static global.
(find_parallel_type_by_descriptive_type): Return immediately
if ada_ignore_descriptive_types_p is set.
(_initialize_ada_language): Register new commands "maintenance
set ada", "maintenance show ada", "maintenance set ada
ignore-descriptive-types" and "maintenance show ada
ignore-descriptive-types".
* NEWS: Add entry for new "maint ada set/show
ignore-descriptive-types" commands.
2014-01-27 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_close): Call btrace_teardown
for all threads.
2014-01-27 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c: Remove "#ifdef UI_OUT" condition for including
"ui-out.h".
2014-01-27 Joel Brobecker <brobecker@adacore.com>
* ada-typeprint (type_is_full_subrange_of_target_type):
New function.
(print_range): Add parameter bounds_prefered_p. If not set,
try printing range types using the name of their base type.
(print_range_type): Add parameter bounds_prefered_p.
Use it in call to print_range.
(print_array_type, ada_print_type): Update calls to print_range
and print_range_type.
2014-01-27 Joel Brobecker <brobecker@adacore.com>
* ada-typeprint.c (print_array_type, print_choices, print_range)
(print_range_bound, print_dynamic_range_bound, print_range_type):
Remove declaration.
2014-01-27 Joel Brobecker <brobecker@adacore.com>
* ada-typeprint.c (print_range): Add missing empty line
after local declaration.
2014-01-27 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (print_optional_low_bound): Get index_type's
target type for as long as it is a TYPE_CODE_RANGE.
Remove assert in procfs.c::procfs_make_note_section (x86-solaris) On x86-solaris, the gcore command sometimes triggers the following internal error: (gdb) gcore /[...]/procfs.c:5523: internal-error: procfs_make_note_section: Assertion `thread_args.note_data != note_data' failed. The problem is extremely elusive, for reasons that will become clearer as I explain what is going on. The program used to produce this issue was really simple: | void break_me (void) { } | | int | main (void) | { | break_me (); | return 0; | } The procfs_make_note_section builds a buffer incrementally with the contents of the core's notes section. The interesting bits are: char *note_data = NULL; [...] note_data = (char *) elfcore_write_prpsinfo (obfd, note_data, note_size, fname, psargs); This is the first call to bfd's elfcore which initializes note_data. After that, we have a few more calls, which keep updating notes_data and note_size, but our interest lies in the following part of the function: thread_args.note_data = note_data; [...] proc_iterate_over_threads (pi, procfs_corefile_thread_callback, &thread_args); /* There should be always at least one thread. */ gdb_assert (thread_args.note_data != note_data); The comment implies that the assert is to verify that our loop iterated over at least one thread. The check is relying on the fact that the notes_data returned by the elfcore module changes at each iteration, via (in procfs_corefile_thread_callback): args->note_data = procfs_do_thread_registers (args->obfd, ptid, args->note_data, args->note_size, args->stop_signal); (which calls elfcore_write_lwpstatus). But, while it happens most of the time, thanks to a call to realloc in elfcore_write_note (the function that actually appends the data at the end of the notes buffer),... buf = (char *) realloc (buf, *bufsiz + newspace); ... this is by no means guarantied. In fact, under the right circumstances, the buffer was grown twice without changing addresses. Unfortunately, the circumstances are very sensitive, thus making this bug very elusive. This patch fixes the problem by simply removing the assert. This means we're losing the assertion that there is at least one thread, but I think that's OK. If we still want to keep the assertion, we have the option of either checking the buffer size, or else adding a boolean flag in the context structure that we'd set to true as soon as we have a thread. gdb/ChangeLog: * procfs.c (procfs_make_note_section): Remove assertion and associated comment.
2014-01-20 16:18:58 +01:00
2014-01-27 Joel Brobecker <brobecker@adacore.com>
* procfs.c (procfs_make_note_section): Remove assertion and
associated comment.
2014-01-24 Yao Qi <yao@codesourcery.com>
* remote.c (remote_read_bytes): Change type of len to ULONGEST.
* corelow.c (get_core_siginfo): Likewise.
2014-01-24 Yao Qi <yao@codesourcery.com>
* remote.c (remote_write_bytes_aux): Change type of 'len' to
ULONGEST. Don't check 'len' is negative.
(remote_write_bytes): Change type of 'len' to ULONGEST.
2014-01-23 Tom Tromey <tromey@redhat.com>
PR python/16485:
* python/lib/gdb/FrameDecorator.py: (FrameVars.fetch_frame_args):
Handle exception from frame.block.
(FrameVars.fetch_frame_locals): Likewise.
2014-01-23 Tom Tromey <tromey@redhat.com>
PR python/16487:
* python/py-framefilter.c (py_print_frame): Don't call Py_DECREF
on a NULL pointer. Move "goto error" to correct place.
2014-01-23 Tom Tromey <tromey@redhat.com>
PR python/16491:
* python/py-framefilter.c (apply_frame_filter): Call
ensure_python_env after computing gdbarch.
2014-01-23 Yao Qi <yao@codesourcery.com>
* target.c (raw_memory_xfer_partial): Change argument type
from void * to gdb_byte *.
(memory_xfer_partial_1, memory_xfer_partial): Likewise.
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>
New gdbserver option --debug-format=timestamp.
* NEWS: Mention it.
2014-01-22 Andreas Arnez <arnez@vnet.linux.ibm.com>
* syscalls/s390x-linux.xml: New file.
* syscalls/s390-linux.xml: New file.
* s390-linux-tdep.c (XML_SYSCALL_FILENAME_S390): New macro.
(XML_SYSCALL_FILENAME_S390X): Likewise.
(op_svc): New enum value for SVC opcode.
(s390_sigtramp_frame_sniffer): Replace literal by 'op_svc'.
(s390_linux_get_syscall_number): New function.
(s390_gdbarch_init): Register '*get_syscall_number' and the
syscall xml file name.
* data-directory/Makefile.in (SYSCALLS_FILES): Add
"s390-linux.xml" and "s390x-linux.xml".
* NEWS: Announce new feature.
2014-01-22 Baruch Siach <baruch@tkos.co.il>
* xtensa-tdep.h (xtensa_elf_greg_t): Change type to uint32_t.
2014-01-22 Pedro Alves <palves@redhat.com>
* xtensa-config.c: Include defs.h.
2014-01-22 Joel Brobecker <brobecker@adacore.com>
* common/common-utils.h: Add "ARI:" comment beside __func__
reference.
2014-01-22 Joel Brobecker <brobecker@adacore.com>
* common/common-utils.h (FUNCTION_NAME): Expand the macro's
documentation a bit.
2014-01-21 Roland McGrath <mcgrathr@google.com>
* configure.ac: Call AM_PROG_INSTALL_STRIP.
* configure: Regenerate.
* aclocal.m4: Regenerate.
* Makefile.in (install_sh, INSTALL_STRIP_PROGRAM, STRIP):
New substituted variables.
(install-strip): New target.
(INSTALL_SCRIPT): New substituted variable.
(FLAGS_TO_PASS): Add it.
(install-only): Use $(INSTALL_SCRIPT) rather than
$(INSTALL_PROGRAM) for gcore.
2014-01-20 Tom Tromey <tromey@redhat.com>
* cli/cli-decode.h (struct cmd_list_element): Move all bitfields
together.
2014-01-20 Tom Tromey <tromey@redhat.com>
* cli/cli-decode.c (add_cmd, deprecate_cmd, add_alias_cmd)
(add_setshow_cmd_full, delete_cmd, lookup_cmd_1)
(deprecated_cmd_warning, complete_on_cmdlist): Update.
* cli/cli-decode.h (CMD_DEPRECATED, DEPRECATED_WARN_USER)
(MALLOCED_REPLACEMENT, DOC_ALLOCATED): Remove.
(struct cmd_list_element) <flags>: Remove.
<cmd_deprecated, deprecated_warn_user, malloced_replacement,
doc_allocated>: New fields.
<hook_in, allow_unknown, abbrev_flag, type, var_type>: Now
bitfields.
* maint.c (maintenance_do_deprecate): Update.
* top.c (execute_command): Update.
2014-01-20 Baruch Siach <baruch@tkos.co.il>
* xtensa-linux-nat.c: Include asm/ptrace.h.
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
* Makefile.in (SFILES): Add d-support.c.
(COMMON_OBS): Add d-support.o.
* d-lang.h (d_parse_symbol): Add comment, now defined in
d-support.c.
* d-lang.c (parse_call_convention)
(parse_attributes, parse_function_types)
(parse_function_args, parse_type, parse_identifier)
(call_convention_p, d_parse_symbol): Move functions to ...
* d-support.c: ... New file.
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
* d-lang.h (d_parse_symbol): Add declaration.
* d-lang.c (extract_identifiers)
(extract_type_info): Remove functions.
(parse_call_convention, parse_attributes)
(parse_function_types, parse_function_args)
(parse_type, parse_identifier, call_convention_p)
(d_parse_symbol): New functions.
(d_demangle): Use d_parse_symbol to demangle D symbols.
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
* d-lang.h (struct builtin_d_type): New data type.
(builtin_d_type): Add declaration.
* d-lang.c (d_language_arch_info, build_d_types)
(builtin_d_type): New functions.
(enum d_primitive_types): New data type.
(d_language_defn): Change c_language_arch_info to
d_language_arch_info.
(d_type_data): New static variable.
(_initialize_d_language): Initialize d_type_data.
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
* d-lang.h (d_main_name): Add declaration.
* d-lang.c (d_main_name): New function.
* symtab.c (find_main_name): Add call to d_main_name.
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
* d-lang.c (d_language_defn): Change macro_expansion_c to
macro_expansion_no.
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
* MAINTAINERS: Add myself as a write-after-approval maintainer.
2014-01-17 Sergio Durigan Junior <sergiodj@redhat.com>
* breakpoint.c (insert_bp_location): Add "volatile" keyword to "struct
gdb_exception" declaration.
* remote.c (getpkt_or_notif_sane): Likewise.
2014-01-17 Doug Evans <dje@google.com>
* common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): New
function, contents of dirnames_to_char_ptr_vec_append moved here.
(delim_string_to_char_ptr_vec): New function.
(dirnames_to_char_ptr_vec_append): Rewrite.
* common/gdb_vecs.h (delim_string_to_char_ptr_vec): Declare.
2014-01-17 Doug Evans <dje@google.com>
* common/common-utils.h (FUNCTION_NAME): Renamed from ASSERT_FUNCTION,
and moved here ...
* common/gdb_assert.h (ASSERT_FUNCTION): ... from here.
#include "common-utils.h".
(gdb_assert, gdb_assert_fail, gdb_assert_not_reached): Update.
* common/vec.h (VEC_ASSERT_PASS): Update.
* darwin-nat.h: Replace #include of gdb_assert.h with common-utils.h.
(MACH_CHECK_ERROR): Update.
2014-01-17 Simon Marchi <simon.marchi@ericsson.com>
* gdbarch.sh (gdbarch_address_class_name_to_type_flags): Add
comments.
* gdbarch.h: Regenerate.
2014-01-16 Tom Tromey <tromey@redhat.com>
* value.c (struct value) <regnum>: Move earlier.
2014-01-16 Tom Tromey <tromey@redhat.com>
* remote.c (extended_remote_create_inferior): Rename from
extended_remote_create_inferior_1. Add "ops" argument. Remove
old implementation.
Fix gdb.trace/mi-traceframe-changed.exp on s390. The test fails on s390 with: -trace-find frame-number 0^M &"PC not available\n"^M ^done,found="1",tracepoint="1",traceframe="0",frame={level="-1",addr="<unavailable>",func="??",args=[]}^M (gdb) ^M FAIL: gdb.trace/mi-traceframe-changed.exp: tfile: -trace-find frame-number 0 tfile knows to infer the PC from the tracepoint's address if the PC wasn't collected (tfile_fetch_registers) but, that only works on targets whose PC register is a raw register, and on s390, the PC register is a pseudo register. But even if GDB doesn't know how to infer the value of PC, saying the current frame is level -1 is a bug: ^done,found="1",tracepoint="1",traceframe="0",frame={level="-1",addr="<unavailable>",func="??",args=[]}^M ^^^^^^^^^ '-1' is the level of the sentinel frame, which should never be visible. This is caused by the s390's heuristic unwinder accepting the frame (the fallback heuristic unwinders _always_ accept the frame), but then the unwind->this_id method throws that "PC not available\n" error. IOW, the s390's heuristic unwinder was never adjusted to handle unavailable register values gracefully, which can happen with e.g., a trimmed core file too. This is just the minimal necessary for <unavailable> frames, which at least gets us: (gdb) tfind Found trace frame 0, tracepoint 1 #0 <unavailable> in ?? () That is, frame #0 instead of -1. We could get better info out of "info frame" (this patch makes us show "outermost"), but this change would still be necessary. gdb/ 2014-01-16 Pedro Alves <palves@redhat.com> * s390-linux-tdep.c (s390_frame_unwind_cache): Swallow NOT_AVAILABLE_ERROR errors while parsing the prologue or reading the backchain.
2014-01-16 18:43:26 +01:00
2014-01-16 Pedro Alves <palves@redhat.com>
* s390-linux-tdep.c (s390_frame_unwind_cache): Swallow
NOT_AVAILABLE_ERROR errors while parsing the prologue or reading
the backchain.
2014-01-16 Doug Evans <dje@google.com>
* dwarf2read.c (open_and_init_dwp_file): Fix typo in comment.
record-btrace: add (reverse-)stepping support Provide to_resume and to_wait target methods for the btrace record target to allow reverse stepping and replay support. Replay is limited in the sense that only stepping and source correlation are supported. We do not record data and thus can not show variables. Non-stop mode is not working. Do not allow record-btrace in non-stop mode. 2014-01-16 Markus Metzger <markus.t.metzger@intel.com> * btrace.h (btrace_thread_flag): New. (struct btrace_thread_info) <flags>: New. * record-btrace.c (record_btrace_resume_thread) (record_btrace_find_thread_to_move, btrace_step_no_history) (btrace_step_stopped, record_btrace_start_replaying) (record_btrace_step_thread, record_btrace_decr_pc_after_break) (record_btrace_find_resume_thread): New. (record_btrace_resume, record_btrace_wait): Extend. (record_btrace_can_execute_reverse): New. (record_btrace_open): Fail in non-stop mode. (record_btrace_set_replay): Split into this, ... (record_btrace_stop_replaying): ... this, ... (record_btrace_clear_histories): ... and this. (init_record_btrace_ops): Init to_can_execute_reverse. * NEWS: Announce it. testsuite/ * gdb.btrace/delta.exp: Check reverse stepi. * gdb.btrace/tailcall.exp: Update. Add stepping tests. * gdb.btrace/finish.exp: New. * gdb.btrace/next.exp: New. * gdb.btrace/nexti.exp: New. * gdb.btrace/record_goto.c: Add comments. * gdb.btrace/step.exp: New. * gdb.btrace/stepi.exp: New. * gdb.btrace/multi-thread-step.c: New. * gdb.btrace/multi-thread-step.exp: New. * gdb.btrace/rn-dl-bind.c: New. * gdb.btrace/rn-dl-bind.exp: New. * gdb.btrace/data.c: New. * gdb.btrace/data.exp: New. * gdb.btrace/Makefile.in (EXECUTABLES): Add new. doc/ * gdb.texinfo: Document limited reverse/replay support for target record-btrace.
2013-05-06 16:04:46 +02:00
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* btrace.h (btrace_thread_flag): New.
(struct btrace_thread_info) <flags>: New.
* record-btrace.c (record_btrace_resume_thread)
(record_btrace_find_thread_to_move, btrace_step_no_history)
(btrace_step_stopped, record_btrace_start_replaying)
(record_btrace_step_thread, record_btrace_decr_pc_after_break)
(record_btrace_find_resume_thread): New.
(record_btrace_resume, record_btrace_wait): Extend.
(record_btrace_can_execute_reverse): New.
(record_btrace_open): Fail in non-stop mode.
(record_btrace_set_replay): Split into this, ...
(record_btrace_stop_replaying): ... this, ...
(record_btrace_clear_histories): ... and this.
(init_record_btrace_ops): Init to_can_execute_reverse.
* NEWS: Announce it.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* target.h (struct target_ops) <to_decr_pc_after_break>: New.
(forward_target_decr_pc_after_break)
(target_decr_pc_after_break): New.
* target.c (forward_target_decr_pc_after_break)
(target_decr_pc_after_break): New.
* aix-thread.c (aix_thread_wait): Call target_decr_pc_after_break
instead of gdbarch_decr_pc_after_break.
* darwin-nat.c (cancel_breakpoint): Call target_decr_pc_after_break
instead of gdbarch_decr_pc_after_break.
* infrun.c (adjust_pc_after_break): Call target_decr_pc_after_break
instead of gdbarch_decr_pc_after_break.
* linux-nat.c (cancel_breakpoint): Call target_decr_pc_after_break
instead of gdbarch_decr_pc_after_break.
* linux-thread-db.c (check_event): Call target_decr_pc_after_break
instead of gdbarch_decr_pc_after_break.
* record-full.c (record_full_wait_1): Call target_decr_pc_after_break
instead of gdbarch_decr_pc_after_break.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* btrace.c: Include regcache.h.
(btrace_add_pc): New.
(btrace_enable): Call btrace_add_pc.
(btrace_is_empty): New.
* btrace.h (btrace_is_empty): New.
* record-btrace.c (require_btrace, record_btrace_info): Call
btrace_is_empty.
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>
* 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.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record.h (record_btrace_frame_unwind)
(record_btrace_tailcall_frame_unwind): New declarations.
* dwarf2-frame: Include record.h
(dwarf2_frame_cfa): Throw an error for btrace frames.
* record-btrace.c: Include hashtab.h.
(btrace_get_bfun_name): New.
(btrace_call_history): Call btrace_get_bfun_name.
(struct btrace_frame_cache): New.
(bfcache): New.
(bfcache_hash, bfcache_eq, bfcache_new): New.
(btrace_get_frame_function): New.
(record_btrace_frame_unwind_stop_reason): Allow unwinding.
(record_btrace_frame_this_id): Compute own id.
(record_btrace_frame_prev_register): Provide PC, throw_error
for all other registers.
(record_btrace_frame_sniffer): Detect btrace frames.
(record_btrace_tailcall_frame_sniffer): New.
(record_btrace_frame_dealloc_cache): New.
(record_btrace_frame_unwind): Add new functions.
(record_btrace_tailcall_frame_unwind): New.
(_initialize_record_btrace): Allocate cache.
* btrace.c (btrace_clear): Call reinit_frame_cache.
* NEWS: Announce it.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_set_replay)
(record_btrace_goto_begin, record_btrace_goto_end)
(record_btrace_goto): New.
(init_record_btrace_ops): Initialize them.
* NEWS: Announce it.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_find_new_threads)
(record_btrace_thread_alive): New.
(init_record_btrace_ops): Initialize to_find_new_threads and
to_thread_alive.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_resume): New.
(record_btrace_wait): New.
(init_record_btrace_ops): Initialize to_wait and to_resume.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_xfer_partial)
(record_btrace_insert_breakpoint, record_btrace_remove_breakpoint)
(record_btrace_allow_memory_access): New.
(init_record_btrace_ops): Initialize new methods.
* target.c (raw_memory_xfer_partial): Bail out if target reports
that this memory is not available.
target, breakpoint: allow insert/remove breakpoint to be forwarded 2014-01-16 Markus Metzger <markus.t.metzger@intel.com> * target.h (target_ops) <to_insert_breakpoint> <to_remove_breakpoint>: Add target_ops parameter. (forward_target_insert_breakpoint): New. (forward_target_remove_breakpoint): New. (memory_remove_breakpoint, memory_insert_breakpoint): Add target_ops parameter. * target.c (target_insert_breakpoint): Split into this and ... (forward_target_insert_breakpoint): ... this. (target_remove_breakpoint): Split into this and ... (forward_target_remove_breakpoint): ... this. (debug_to_insert_breakpoint): Add target_ops parameter. Call forward_target_insert_breakpoint. (debug_to_remove_breakpoint): Add target_ops parameter. Call forward_target_remove_breakpoint. (update_current_target): Do not inherit or default to_insert_breakpoint and to_remove_breakpoint. * corelow.c (ignore): Add target_ops parameter. * exec.c (ignore): Add target_ops parameter. * mem-break.c (memory_insert_breakpoint, memory_remove_breakpoint): Add target_ops parameter. * monitor.c (monitor_insert_breakpoint, monitor_remove_breakpoint): Add target_ops parameter. * nto-procfs.c (procfs_insert_breakpoint, procfs_remove_breakpoint): Add target_ops parameter. * record-full.c (record_full_beneath_to_insert_breakpoint) (record_full_beneath_to_remove_breakpoint, tmp_to_insert_breakpoint) (tmp_to_remove_breakpoint, record_full_insert_breakpoint) (record_full_remove_breakpoint, record_full_core_insert_breakpoint) (record_full_core_remove_breakpoint): Add target_ops parameter. Update users. (record_full_beneath_to_insert_breakpoint_ops) (record_full_beneath_to_remove_breakpoint_ops) (tmp_to_insert_breakpoint_ops, tmp_to_remove_breakpoint_ops): New. (record_full_open): Initialize tmp_to_insert_breakpoint_ops, tmp_to_remove_breakpoint_ops, record_full_beneath_to_insert_breakpoint_ops, and record_full_beneath_to_remove_breakpoint_ops. * remote-m32r-sdi.c (m32r_insert_breakpoint) (m32r_remove_breakpoint): Add target_ops parameter. * remote-mips.c (mips_insert_breakpoint, mips_remove_breakpoint): Add target_ops parameter. * remote.c (remote_insert_breakpoint, remote_remove_breakpoint): Add target_ops parameter.
2013-12-17 10:49:03 +01:00
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* target.h (target_ops) <to_insert_breakpoint>
<to_remove_breakpoint>: Add target_ops parameter.
(forward_target_insert_breakpoint): New.
(forward_target_remove_breakpoint): New.
(memory_remove_breakpoint, memory_insert_breakpoint):
Add target_ops parameter.
* target.c (target_insert_breakpoint): Split into this and ...
(forward_target_insert_breakpoint): ... this.
(target_remove_breakpoint): Split into this and ...
(forward_target_remove_breakpoint): ... this.
(debug_to_insert_breakpoint): Add target_ops parameter.
Call forward_target_insert_breakpoint.
(debug_to_remove_breakpoint): Add target_ops parameter.
Call forward_target_remove_breakpoint.
(update_current_target): Do not inherit or default to_insert_breakpoint
and to_remove_breakpoint.
* corelow.c (ignore): Add target_ops parameter.
* exec.c (ignore): Add target_ops parameter.
* mem-break.c (memory_insert_breakpoint, memory_remove_breakpoint):
Add target_ops parameter.
* monitor.c (monitor_insert_breakpoint, monitor_remove_breakpoint):
Add target_ops parameter.
* nto-procfs.c (procfs_insert_breakpoint, procfs_remove_breakpoint):
Add target_ops parameter.
* record-full.c (record_full_beneath_to_insert_breakpoint)
(record_full_beneath_to_remove_breakpoint, tmp_to_insert_breakpoint)
(tmp_to_remove_breakpoint, record_full_insert_breakpoint)
(record_full_remove_breakpoint, record_full_core_insert_breakpoint)
(record_full_core_remove_breakpoint): Add target_ops parameter.
Update users.
(record_full_beneath_to_insert_breakpoint_ops)
(record_full_beneath_to_remove_breakpoint_ops)
(tmp_to_insert_breakpoint_ops, tmp_to_remove_breakpoint_ops): New.
(record_full_open): Initialize tmp_to_insert_breakpoint_ops,
tmp_to_remove_breakpoint_ops,
record_full_beneath_to_insert_breakpoint_ops, and
record_full_beneath_to_remove_breakpoint_ops.
* remote-m32r-sdi.c (m32r_insert_breakpoint)
(m32r_remove_breakpoint): Add target_ops parameter.
* remote-mips.c (mips_insert_breakpoint, mips_remove_breakpoint):
Add target_ops parameter.
* remote.c (remote_insert_breakpoint, remote_remove_breakpoint):
Add target_ops parameter.
2014-01-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c: Include frame-unwind.h.
(record_btrace_frame_unwind_stop_reason)
(record_btrace_frame_this_id, record_btrace_frame_prev_register)
(record_btrace_frame_sniffer, record_btrace_frame_unwind):
New.
(init_record_btrace_ops): Install it.
2014-01-16 Jan Kratochvil <jan.kratochvil@redhat.com>
* frame.c (get_frame_unwind_stop_reason): Unconditionally call
get_prev_frame_1.
2014-01-16 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2-frame.c (dwarf2_frame_cfa): Move UNWIND_UNAVAILABLE check
earlier.
2014-01-16 Jan Kratochvil <jan.kratochvil@redhat.com>
* frame-unwind.c: Include target.h.
(frame_unwind_try_unwinder): New function with code from ...
(frame_unwind_find_by_frame): ... here. New variable
unwinder_from_target, call also target_get_unwinder)
(target_get_tailcall_unwinder, and frame_unwind_try_unwinder for it.
* target.c (target_get_unwinder, target_get_tailcall_unwinder): New.
* target.h (struct target_ops): New fields to_get_unwinder and
to_get_tailcall_unwinder.
(target_get_unwinder, target_get_tailcall_unwinder): New declarations.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_fetch_registers)
(record_btrace_store_registers)
(record_btrace_to_prepare_to_store): New.
(init_record_btrace_ops): Add the above.
2014-01-16 Tom Tromey <tromey@redhat.com>
* windows-nat.c (windows_prepare_to_store): Add 'self' argument.
* target.h (struct target_ops) <to_prepare_to_store>: Add
argument.
(target_prepare_to_store): Add argument.
* target.c (debug_to_prepare_to_store): Add argument.
(update_current_target): Update.
* remote.c (remote_prepare_to_store): Add 'self' argument.
* remote-sim.c (gdbsim_prepare_to_store): Add 'self' argument.
* remote-mips.c (mips_prepare_to_store): Add 'self' argument.
* remote-m32r-sdi.c (m32r_prepare_to_store): Add 'self' argument.
* record-full.c (record_full_core_prepare_to_store): Add 'self'
argument.
* ravenscar-thread.c (ravenscar_prepare_to_store): Add argument.
* nto-procfs.c (procfs_prepare_to_store): Add 'self' argument.
* monitor.c (monitor_prepare_to_store): Add 'self' argument.
* inf-child.c (inf_child_prepare_to_store): Add 'self' argument.
* go32-nat.c (go32_prepare_to_store): Add 'self' argument.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* btrace.h (replay) <replay>: New.
(btrace_is_replaying): New.
* btrace.c (btrace_clear): Free replay iterator.
(btrace_is_replaying): New.
* record-btrace.c (record_btrace_is_replaying): New.
(record_btrace_info): Print insn number if replaying.
(record_btrace_insn_history): Start at replay position.
(record_btrace_call_history): Start at replay position.
(init_record_btrace_ops): Init to_record_is_replaying.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_insn_history_range): Include
end.
(record_btrace_insn_history_from): Adjust range.
(record_btrace_call_history_range): Include
end.
(record_btrace_call_history_from): Adjust range.
* NEWS: Announce changes.
record-btrace: optionally indent function call history Add a new modifier /c to the "record function-call-history" command to indent the function name based on its depth in the call stack. Also reorder the optional fields to have the indentation at the very beginning. Prefix the insn range (/i modifier) with "inst ". Prefix the source line (/l modifier) with "at ". Change the range syntax from "begin-end" to "begin,end" to allow copy&paste to the "record instruction-history" and "list" commands. Adjust the respective tests and add new tests for the /c modifier. 2014-01-16 Markus Metzger <markus.t.metzger@intel.com> * record.h (enum record_print_flag) <record_print_indent_calls>: New. * record.c (get_call_history_modifiers): Recognize /c modifier. (_initialize_record): Document /c modifier. * record-btrace.c (btrace_call_history): Add btinfo parameter. Reorder fields. Optionally indent the function name. Update all users. * NEWS: Announce changes. testsuite/ * gdb.btrace/function_call_history.exp: Fix expected field order for "record function-call-history". Add new tests for "record function-call-history /c". * gdb.btrace/exception.cc: New. * gdb.btrace/exception.exp: New. * gdb.btrace/tailcall.exp: New. * gdb.btrace/x86-tailcall.S: New. * gdb.btrace/x86-tailcall.c: New. * gdb.btrace/unknown_functions.c: New. * gdb.btrace/unknown_functions.exp: New. * gdb.btrace/Makefile.in (EXECUTABLES): Add new. doc/ * gdb.texinfo (Process Record and Replay): Document new /c modifier accepted by "record function-call-history". Add /i modifier to "record function-call-history" example.
2013-04-18 10:58:05 +02:00
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record.h (enum record_print_flag)
<record_print_indent_calls>: New.
* record.c (get_call_history_modifiers): Recognize /c modifier.
(_initialize_record): Document /c modifier.
* record-btrace.c (btrace_call_history): Add btinfo parameter.
Reorder fields. Optionally indent the function name. Update
all users.
* NEWS: Announce changes.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* common/linux-btrace.c (linux_enable_btrace): Enlarge buffer.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* btrace.c (ftrace_new_function): Start counting at one.
* record-btrace.c (record_btrace_info): Adjust number of calls
and insns.
* NEWS: Announce it.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (btrace_call_history_insn_range): Print
insn range as [begin, end].
btrace: change branch trace data structure The branch trace is represented as 3 vectors: - a block vector - a instruction vector - a function vector Each vector (except for the first) is computed from the one above. Change this into a graph where a node represents a sequence of instructions belonging to the same function and where we have three types of edges to connect the function segments: - control flow - same function (instance) - call stack This allows us to navigate in the branch trace. We will need this for "record goto" and reverse execution. This patch introduces the data structure and computes the control flow edges. It also introduces iterator structs to simplify iterating over the branch trace in control-flow order. It also fixes PR gdb/15240 since now recursive calls are handled correctly. Fix the test that got the number of expected fib instances and also the function numbers wrong. The current instruction had been part of the branch trace. This will look odd once we start support for reverse execution. Remove it. We still keep it in the trace itself to allow extending the branch trace more easily in the future. 2014-01-16 Markus Metzger <markus.t.metzger@intel.com> * btrace.h (struct btrace_func_link): New. (enum btrace_function_flag): New. (struct btrace_inst): Rename to ... (struct btrace_insn): ...this. Update all users. (struct btrace_func) <ibegin, iend>: Remove. (struct btrace_func_link): New. (struct btrace_func): Rename to ... (struct btrace_function): ...this. Update all users. (struct btrace_function) <segment, flow, up, insn, insn_offset) (number, level, flags>: New. (struct btrace_insn_iterator): Rename to ... (struct btrace_insn_history): ...this. Update all users. (struct btrace_insn_iterator, btrace_call_iterator): New. (struct btrace_target_info) <btrace, itrace, ftrace>: Remove. (struct btrace_target_info) <begin, end, level> <insn_history, call_history>: New. (btrace_insn_get, btrace_insn_number, btrace_insn_begin) (btrace_insn_end, btrace_insn_prev, btrace_insn_next) (btrace_insn_cmp, btrace_find_insn_by_number, btrace_call_get) (btrace_call_number, btrace_call_begin, btrace_call_end) (btrace_call_prev, btrace_call_next, btrace_call_cmp) (btrace_find_function_by_number, btrace_set_insn_history) (btrace_set_call_history): New. * btrace.c (btrace_init_insn_iterator) (btrace_init_func_iterator, compute_itrace): Remove. (ftrace_print_function_name, ftrace_print_filename) (ftrace_skip_file): Change parameter to const. (ftrace_init_func): Remove. (ftrace_debug): Use new btrace_function fields. (ftrace_function_switched): Also consider gaining and losing symbol information). (ftrace_print_insn_addr, ftrace_new_call, ftrace_new_return) (ftrace_new_switch, ftrace_find_caller, ftrace_new_function) (ftrace_update_caller, ftrace_fixup_caller, ftrace_new_tailcall): New. (ftrace_new_function): Move. Remove debug print. (ftrace_update_lines, ftrace_update_insns): New. (ftrace_update_function): Check for call, ret, and jump. (compute_ftrace): Renamed to ... (btrace_compute_ftrace): ...this. Rewritten to compute call stack. (btrace_fetch, btrace_clear): Updated. (btrace_insn_get, btrace_insn_number, btrace_insn_begin) (btrace_insn_end, btrace_insn_prev, btrace_insn_next) (btrace_insn_cmp, btrace_find_insn_by_number, btrace_call_get) (btrace_call_number, btrace_call_begin, btrace_call_end) (btrace_call_prev, btrace_call_next, btrace_call_cmp) (btrace_find_function_by_number, btrace_set_insn_history) (btrace_set_call_history): New. * record-btrace.c (require_btrace): Use new btrace thread info fields. (record_btrace_info, btrace_insn_history) (record_btrace_insn_history, record_btrace_insn_history_range): Use new btrace thread info fields and new iterator. (btrace_func_history_src_line): Rename to ... (btrace_call_history_src_line): ...this. Use new btrace thread info fields. (btrace_func_history): Rename to ... (btrace_call_history): ...this. Use new btrace thread info fields and new iterator. (record_btrace_call_history, record_btrace_call_history_range): Use new btrace thread info fields and new iterator. testsuite/ * gdb.btrace/function_call_history.exp: Fix expected function trace. * gdb.btrace/instruction_history.exp: Initialize traced. Remove traced_functions.
2013-03-22 14:32:47 +01:00
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* btrace.h (struct btrace_func_link): New.
(enum btrace_function_flag): New.
(struct btrace_inst): Rename to ...
(struct btrace_insn): ...this. Update all users.
(struct btrace_func) <ibegin, iend>: Remove.
(struct btrace_func_link): New.
(struct btrace_func): Rename to ...
(struct btrace_function): ...this. Update all users.
(struct btrace_function) <segment, flow, up, insn, insn_offset)
(number, level, flags>: New.
(struct btrace_insn_iterator): Rename to ...
(struct btrace_insn_history): ...this.
Update all users.
(struct btrace_insn_iterator, btrace_call_iterator): New.
(struct btrace_target_info) <btrace, itrace, ftrace>: Remove.
(struct btrace_target_info) <begin, end, level>
<insn_history, call_history>: New.
(btrace_insn_get, btrace_insn_number, btrace_insn_begin)
(btrace_insn_end, btrace_insn_prev, btrace_insn_next)
(btrace_insn_cmp, btrace_find_insn_by_number, btrace_call_get)
(btrace_call_number, btrace_call_begin, btrace_call_end)
(btrace_call_prev, btrace_call_next, btrace_call_cmp)
(btrace_find_function_by_number, btrace_set_insn_history)
(btrace_set_call_history): New.
* btrace.c (btrace_init_insn_iterator)
(btrace_init_func_iterator, compute_itrace): Remove.
(ftrace_print_function_name, ftrace_print_filename)
(ftrace_skip_file): Change
parameter to const.
(ftrace_init_func): Remove.
(ftrace_debug): Use new btrace_function fields.
(ftrace_function_switched): Also consider gaining and
losing symbol information).
(ftrace_print_insn_addr, ftrace_new_call, ftrace_new_return)
(ftrace_new_switch, ftrace_find_caller, ftrace_new_function)
(ftrace_update_caller, ftrace_fixup_caller, ftrace_new_tailcall):
New.
(ftrace_new_function): Move. Remove debug print.
(ftrace_update_lines, ftrace_update_insns): New.
(ftrace_update_function): Check for call, ret, and jump.
(compute_ftrace): Renamed to ...
(btrace_compute_ftrace): ...this. Rewritten to compute call
stack.
(btrace_fetch, btrace_clear): Updated.
(btrace_insn_get, btrace_insn_number, btrace_insn_begin)
(btrace_insn_end, btrace_insn_prev, btrace_insn_next)
(btrace_insn_cmp, btrace_find_insn_by_number, btrace_call_get)
(btrace_call_number, btrace_call_begin, btrace_call_end)
(btrace_call_prev, btrace_call_next, btrace_call_cmp)
(btrace_find_function_by_number, btrace_set_insn_history)
(btrace_set_call_history): New.
* record-btrace.c (require_btrace): Use new btrace thread
info fields.
(record_btrace_info, btrace_insn_history)
(record_btrace_insn_history, record_btrace_insn_history_range):
Use new btrace thread info fields and new iterator.
(btrace_func_history_src_line): Rename to ...
(btrace_call_history_src_line): ...this. Use new btrace
thread info fields.
(btrace_func_history): Rename to ...
(btrace_call_history): ...this. Use new btrace thread info
fields and new iterator.
(record_btrace_call_history, record_btrace_call_history_range):
Use new btrace thread info fields and new iterator.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* frame.h (frame_id_build_unavailable_stack_special): New.
* frame.c (frame_id_build_unavailable_stack_special): New.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* amd64-tdep.c (amd64_classify_insn_at, amd64_insn_is_call)
(amd64_insn_is_ret, amd64_insn_is_jump, amd64_jmp_p): New.
(amd64_init_abi): Add insn_is_call, insn_is_ret, and insn_is_jump
to gdbarch.
* i386-tdep.c (i386_insn_is_call, i386_insn_is_ret)
(i386_insn_is_jump, i386_jmp_p): New.
(i386_gdbarch_init): Add insn_is_call, insn_is_ret, and
insn_is_jump to gdbarch.
* gdbarch.sh (insn_is_call, insn_is_ret, insn_is_jump): New.
* gdbarch.h: Regenerated.
* gdbarch.c: Regenerated.
* arch-utils.h (default_insn_is_call, default_insn_is_ret)
(default_insn_is_jump): New.
* arch-utils.c (default_insn_is_call, default_insn_is_ret)
(default_insn_is_jump): New.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* common/btrace-common.h (btrace_read_type) <btrace_read_all>:
Change to ...
(btrace_read_type) <BTRACE_READ_ALL>: ... this. Update users.
(btrace_read_type) <btrace_read_new>: Change to ...
(btrace_read_type) <BTRACE_READ_NEW>: ... this. Update users.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* common/linux-btrace.c (linux_read_btrace): Free trace from
previous iteration.
2014-01-15 Doug Evans <dje@google.com>
* dwarf2read.c (open_and_init_dwp_file): Use pulongest to print
uint32_t.
2014-01-15 Tom Tromey <tromey@redhat.com>
* dbxread.c (process_one_symbol): Use set_objfile_main_name.
* dwarf2read.c (read_partial_die): Use set_objfile_main_name.
* objfiles.c (get_objfile_bfd_data): Initialize language_of_main.
(set_objfile_main_name): New function.
* objfiles.h (struct objfile_per_bfd_storage) <name_of_main,
language_of_main>: New fields.
(set_objfile_main_name): Declare.
* symtab.c (find_main_name): Loop over objfiles to find the main
name and language.
(set_main_name): Now static.
(get_main_info): Add comment.
* symtab.h (set_main_name): Don't declare.
2014-01-15 Tom Tromey <tromey@redhat.com>
* symtab.c (main_progspace_key): New global.
(struct main_info): New.
(name_of_main, language_of_main): Remove.
(get_main_info, main_info_cleanup): New function.
(set_main_name, main_name, main_language): Use get_main_info.
(_initialize_symtab): Initialize main_progspace_key.
2014-01-15 Tom Tromey <tromey@redhat.com>
* dbxread.c (process_one_symbol): Update.
* dwarf2read.c (read_partial_die): Update.
* symfile.c (set_initial_language): Call main_language.
* symtab.c (language_of_main): Now static.
(set_main_name): Add 'lang' parameter.
(find_main_name): Update.
(main_language): New function.
(symtab_observer_executable_changed): Update.
* symtab.h (set_main_name): Update.
(language_of_main): Remove.
(main_language): Declare.
2014-01-15 Tom Tromey <tromey@redhat.com>
* symfile.c (init_entry_point_info): Use new "initialized" field.
Update.
* objfiles.h (struct entry_point) <initialized>: New field.
(struct objfile_per_bfd_storage) <ei>: New field, moved from...
(struct objfile) <ei>: ...here. Remove.
* objfiles.c (entry_point_address_query): Update.
2014-01-15 Tom Tromey <tromey@redhat.com>
* objfiles.c (entry_point_address_query): Relocate entry point
address.
(objfile_relocate1): Do not relocate entry point address.
* objfiles.h (struct entry_info) <entry_point>: Update comment.
<the_bfd_section_index>: New field.
* symfile.c (init_entry_point_info): Find the entry point's
section.
2014-01-15 Tom Tromey <tromey@redhat.com>
* solib-frv.c (enable_break): Use entry_point_address_query.
2014-01-15 Omair Javaid <omair.javaid@linaro.org>
* NEWS: Add note on improved process record-replay on
arm*-linux* targets.
2014-01-15 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (enum arm_record_result): New enum.
(arm_record_unsupported_insn): New function.
(arm_record_coproc_data_proc): Removed.
(thumb2_record_ld_st_multiple): New function.
(thumb2_record_ld_st_dual_ex_tbb): New function.
(thumb2_record_data_proc_sreg_mimm): New function.
(thumb2_record_ps_dest_generic): New function.
(thumb2_record_branch_misc_cntrl): New function.
(thumb2_record_str_single_data): New function.
(thumb2_record_ld_mem_hints): New function.
(thumb2_record_ld_word): New function.
(thumb2_record_lmul_lmla_div): New function.
(thumb2_record_decode_insn_handler): New function.
(decode_insn): Add thumb32 instruction handlers.
2014-01-15 Omair Javaid <omair.javaid@linaro.org>
* arm-linux-tdep.c: Include "record-full.h" and "linux-record.h".
(struct arm_linux_record_tdep): Declare.
(arm_canonicalize_syscall): New function.
(arm_all_but_pc_registers_record): New function.
(arm_linux_syscall_record): New function.
(arm_linux_init_abi): Add syscall recording constructs.
* arm-tdep.c (thumb_record_ldm_stm_swi): Update thumb syscall
decoding. (arm_record_coproc_data_proc): Update arm syscall
decoding.
* arm-tdep.h (struct gdbarch_tdep) <arm_swi_record>: Remove.
<arm_syscall_record>: New field.
* configure.tgt (arm*-*-linux*): Add linux-record.o to
gdb_target_obs.
2014-01-15 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (thumb_record_misc): Update to use sp as base
register for push instruction recording.
2014-01-15 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (thumb_record_misc): Update to correct logical
error while recording ldm, ldmia and pop instructions.
2014-01-15 Omair Javaid <omair.javaid@linaro.org>
* arm-tdep.c (struct arm_mem_r) <addr>: Change type to uint32_t.
2014-01-15 Pedro Alves <palves@redhat.com>
* go32-nat.c (go32_open, go32_close, go32_attach, go32_detach)
(go32_resume, go32_fetch_registers, store_register)
(go32_store_registers, go32_prepare_to_store)
(go32_xfer_memory, go32_files_info, go32_kill_inferior)
(go32_create_inferior, go32_can_run, go32_terminal_init)
(go32_terminal_inferior, go32_terminal_ours): Delete forward
declarations.
2014-01-15 Tom Tromey <tromey@redhat.com>
* target.h (async_callback_ftype): New typedef.
(struct target_ops) <to_async>: Use it.
2014-01-15 Joel Brobecker <brobecker@adacore.com>
* python/py-value.c (get_field_type): Remove unnecessary curly
braces for single-statement if block.
2014-01-15 Joel Brobecker <brobecker@adacore.com>
* python/py-type.c (convert_field): Add missing empty line
after declarations.
psymtab cleanup patch 3/3 This last patch removes "partial" from the names of expand_partial_symbol_names and map_partial_symbol_filenames. It also renames expand_partial_symbol_names to match the struct quick_symbol_functions "method" that it wraps: expand_symtabs_matching. This patch also adds two parameters to expand_symtabs_matching so that it can fully wrap the underlying quick_symbol_functions method. This makes it usable in more places. I thought of having a cover function that still had the same signature as the old expand_partial_symbol_names function, but I couldn't think of a good name, and it wasn't clear it was worth it anyway. * symfile.h (expand_symtabs_matching): Renamed from expand_partial_symbol_names. Update prototype. (map_symbol_filenames): Renamed from map_partial_symbol_filenames. * symfile.c (expand_symtabs_matching): Renamed from expand_partial_symbol_names. New args file_matcher, kind. Rename arg fun to symbol_matcher. (map_symbol_filenames): Renamed from map_partial_symbol_filenames. * ada-lang.c (ada_complete_symbol_matcher): Renamed from ada_expand_partial_symbol_name. (ada_make_symbol_completion_list): Update to call expand_symtabs_matching. (ada_add_global_exceptions): Call expand_symtabs_matching. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update to call map_symbol_filenames. * symtab.c (sources_info): Update to call map_symbol_filenames. (search_symbols): Call expand_symtabs_matching. (symbol_completion_matcher): Renamed from expand_partial_symbol_name. (default_make_symbol_completion_list_break_on): Update to call expand_symtabs_matching. (make_source_files_completion_list): Update to call map_symbol_filenames.
2014-01-15 03:36:33 +01:00
2014-01-14 Doug Evans <dje@google.com>
* symfile.h (expand_symtabs_matching): Renamed from
expand_partial_symbol_names. Update prototype.
(map_symbol_filenames): Renamed from map_partial_symbol_filenames.
* symfile.c (expand_symtabs_matching): Renamed from
expand_partial_symbol_names. New args file_matcher, kind.
Rename arg fun to symbol_matcher.
(map_symbol_filenames): Renamed from map_partial_symbol_filenames.
* ada-lang.c (ada_complete_symbol_matcher): Renamed from
ada_expand_partial_symbol_name.
(ada_make_symbol_completion_list): Update to call
expand_symtabs_matching.
(ada_add_global_exceptions): Call expand_symtabs_matching.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update to
call map_symbol_filenames.
* symtab.c (sources_info): Update to call map_symbol_filenames.
(search_symbols): Call expand_symtabs_matching.
(symbol_completion_matcher): Renamed from expand_partial_symbol_name.
(default_make_symbol_completion_list_break_on): Update to call
expand_symtabs_matching.
(make_source_files_completion_list): Update to call
map_symbol_filenames.
2014-01-14 Doug Evans <dje@google.com>
* symfile.h (expand_symtabs_file_matcher_ftype): New typedef.
(expand_symtabs_symbol_matcher_ftype): New typedef.
(quick_symbol_functions.expand_symtabs_matching): Update to use.
expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype.
* symfile.c (expand_partial_symbol_names): Update to use
expand_symtabs_symbol_matcher_ftype.
* dwarf2read.c (dw2_expand_symtabs_matching): Update to use
expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype.
Arg name_matcher renamed to symbol_matcher.
* psymtab.c (recursively_search_psymtabs): Update to use
expand_symtabs_symbol_matcher_ftype. Arg name_matcher renamed to
sym_matcher.
(expand_symtabs_matching_via_partial): Update to use
expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype.
Arg name_matcher renamed to symbol_matcher.
2014-01-14 Doug Evans <dje@google.com>
* psymtab.c (expand_partial_symbol_names): Delete, moved to symfile.c.
(map_partial_symbol_filenames): Ditto.
* psymtab.h (expand_partial_symbol_names): Delete, moved to symfile.h.
(map_partial_symbol_filenames): Ditto.
* symfile.c (expand_partial_symbol_names): Moved here from psymtab.c.
(map_partial_symbol_filenames): Ditto.
* symfile.h (expand_partial_symbol_names): Moved here from psymtab.h.
(map_partial_symbol_filenames): Ditto.
* symtab.c: Delete #include "psymtab.h".
Fix "is a record target open" checks. RECORD_IS_USED and record_full_open look at current_target.to_stratum to determine whether a record target is in use. This is wrong because arch_stratum is greater than record_stratum, so if an arch_stratum target is pushed, RECORD_IS_USED and record_full_open will miss it. To fix this, we can use the existing find_record_target instead, which looks up for a record stratum target across the target stack. Since that means exporting find_record_target in record.h, RECORD_IS_USED ends up redundant, so the patch eliminates it. That exercise then reveals other issues: - adjust_pc_after_break is gating record_full_... calls based on RECORD_IS_USED. But, record_full_ calls shouldn't be made when recording with the record-btrace target. So this adds a new record_full_is_used predicate to be used in that spot. - record_full_open says "Process record target already running", even if the recording target is record-btrace ("process record" is the original complete name of the record-full target). record_btrace_open only says "The process is already being recorded." and does not suggest "record stop", like record-full does. The patch factors out and merges that error to a new record_preopen function that all record targets call in their open routine. Tested on x86_64 Fedora 17. gdb/ 2014-01-14 Pedro Alves <palves@redhat.com> Tom Tromey <tromey@redhat.com> * infrun.c (use_displaced_stepping): Use find_record_target instead of RECORD_IS_USED. (adjust_pc_after_break): Use record_full_is_used instead of RECORD_IS_USED. * record-btrace.c (record_btrace_open): Call record_preopen instead of checking RECORD_IS_USED. * record-full.c (record_full_shortname) (record_full_core_shortname): New globals. (record_full_is_used): New function. (find_full_open): Call record_preopen instead of checking RECORD_IS_USED. (init_record_full_ops): Set the target's shortname to record_full_shortname. (init_record_full_core_ops): Set the target's shortname to record_full_core_shortname. * record-full.h (record_full_is_used): Declare. * record.c (find_record_target): Make extern. (record_preopen): New function. * record.h (RECORD_IS_USED): Delete macro. (find_record_target, record_preopen): Declare functions.
2014-01-14 17:12:19 +01:00
2014-01-14 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
* infrun.c (use_displaced_stepping): Use find_record_target
instead of RECORD_IS_USED.
(adjust_pc_after_break): Use record_full_is_used instead of
RECORD_IS_USED.
* record-btrace.c (record_btrace_open): Call record_preopen
instead of checking RECORD_IS_USED.
* record-full.c (record_full_shortname)
(record_full_core_shortname): New globals.
(record_full_is_used): New function.
(find_full_open): Call record_preopen instead of checking
RECORD_IS_USED.
(init_record_full_ops): Set the target's shortname to
record_full_shortname.
(init_record_full_core_ops): Set the target's shortname to
record_full_core_shortname.
* record-full.h (record_full_is_used): Declare.
* record.c (find_record_target): Make extern.
(record_preopen): New function.
* record.h (RECORD_IS_USED): Delete macro.
(find_record_target, record_preopen): Declare functions.
2014-01-14 Yao Qi <yao@codesourcery.com>
* gdbarch.sh (core_xfer_shared_libraries): Change its argument
'len''s type to ULONGEST.
(core_xfer_shared_libraries_aix): Likewise.
* gdbarch.c, gdbarch.h: Regenerated.
* i386-cygwin-tdep.c (windows_core_xfer_shared_libraries):
Change type of 'len' to ULONGEST.
* rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise.
(rs6000_aix_core_xfer_shared_libraries_aix): Likewise.
2014-01-14 Yao Qi <yao@codesourcery.com>
* common/linux-osdata.c (linux_xfer_osdata_processes): Change
type of 'len' to ULONGEST.
(linux_xfer_osdata_processgroups): Likewise.
(linux_xfer_osdata_threads): Likewise.
(linux_xfer_osdata_fds): Likewise.
(linux_xfer_osdata_isockets): Likewise.
(linux_xfer_osdata_shm): Likewise.
(linux_xfer_osdata_sem): Likewise.
(linux_xfer_osdata_msg): Likewise.
(linux_common_xfer_osdata): Likewise.
(struct osdata_type) <getter>: Likewise.
* common/linux-osdata.h (linux_common_xfer_osdata): Update
the declaration.
Change to_xfer_partial 'len' type to ULONGEST. This patch changes to_xfer_partial's len's type to ULONGEST, and adjust its implementations. gdb: 2014-01-14 Yao Qi <yao@codesourcery.com> * target.h (target_xfer_partial_ftype): Update. (struct target_ops) <to_xfer_partial>: Change 'len' type to ULONGEST. * aix-thread.c (aix_thread_xfer_partial): Change type of argument 'len' to ULONGEST. * auxv.c (procfs_xfer_auxv): Likewise. (ld_so_xfer_auxv): Likewise. (memory_xfer_auxv): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. * bsd-kvm.c (bsd_kvm_xfer_partial): Likewise. * bsd-uthread.c (bsd_uthread_xfer_partial): Likewise. * corelow.c (core_xfer_partial): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * darwin-nat.c (darwin_read_write_inferior): Likewise. Use '%u'. (darwin_read_dyld_info): Likewise. (darwin_xfer_partial): Likewise. * exec.c (section_table_xfer_memory_partial): Likewise. (exec_xfer_partial): Likewise. * exec.h (section_table_xfer_memory_partial): Update declaration. * gnu-nat.c (gnu_xfer_memory): Likewise. Call pulongest instead of plongest. (gnu_xfer_partial): Likewise. * ia64-hpux-nat.c (ia64_hpux_xfer_memory): Likewise. (ia64_hpux_xfer_solib_got): Likewise. (ia64_hpux_xfer_partial): Likewise. * ia64-linux-nat.c (ia64_linux_xfer_partial): * inf-ptrace.c (inf_ptrace_xfer_partial): * inf-ttrace.c (inf_ttrace_xfer_partial): * linux-nat.c (linux_xfer_siginfo): Likewise. (linux_nat_xfer_partial): Likewise. (spu_enumerate_spu_ids, linux_proc_xfer_spu): Likewise. (linux_nat_xfer_osdata, linux_xfer_partial): Likewise. * monitor.c (monitor_xfer_memory): Likewise. (monitor_xfer_partial): Likewise. * procfs.c (procfs_xfer_partial): Likewise. * record-full.c (record_full_xfer_partial): Likewise. (record_full_core_xfer_partial): Likewise. * remote-sim.c (gdbsim_xfer_memory): Likewise. Call pulongest instead of plongest. (gdbsim_xfer_partial): Likewise. * remote.c (remote_xfer_partial): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. * rs6000-aix-tdep.h (rs6000_aix_ld_info_to_xml): Update declaration. * rs6000-nat.c (rs6000_xfer_partial): Likewise. (rs6000_xfer_shared_libraries): Likewise. * sol-thread.c (sol_thread_xfer_partial): Likewise. * sparc-nat.c (sparc_xfer_wcookie): Likewise. (sparc_xfer_partial): Likewise. * spu-linux-nat.c (spu_proc_xfer_spu): Likewise. (spu_xfer_partial): Likewise. * spu-multiarch.c (spu_xfer_partial): Likewise. * target.c (target_read_live_memory): Likewise. (memory_xfer_live_readonly_partial): Likewise. (memory_xfer_partial, memory_xfer_partial_1): Likewise. (target_xfer_partial, default_xfer_partial): Likewise. (current_xfer_partial): Likewise. * tracepoint.c (tfile_xfer_partial): Likewise. * windows-nat.c (windows_xfer_memory): Likewise. Call pulongest instead of plongest. (windows_xfer_partial): Likewise. (windows_xfer_shared_libraries): Likewise.
2014-01-03 14:11:46 +01:00
2014-01-14 Yao Qi <yao@codesourcery.com>
* target.h (target_xfer_partial_ftype): Update.
(struct target_ops) <to_xfer_partial>: Change 'len' type to
ULONGEST.
* aix-thread.c (aix_thread_xfer_partial): Change type of
argument 'len' to ULONGEST.
* auxv.c (procfs_xfer_auxv): Likewise.
(ld_so_xfer_auxv): Likewise.
(memory_xfer_auxv): Likewise.
* bfd-target.c (target_bfd_xfer_partial): Likewise.
* bsd-kvm.c (bsd_kvm_xfer_partial): Likewise.
* bsd-uthread.c (bsd_uthread_xfer_partial): Likewise.
* corelow.c (core_xfer_partial): Likewise.
* ctf.c (ctf_xfer_partial): Likewise.
* darwin-nat.c (darwin_read_write_inferior): Likewise. Use
'%u'.
(darwin_read_dyld_info): Likewise.
(darwin_xfer_partial): Likewise.
* exec.c (section_table_xfer_memory_partial): Likewise.
(exec_xfer_partial): Likewise.
* exec.h (section_table_xfer_memory_partial): Update
declaration.
* gnu-nat.c (gnu_xfer_memory): Likewise. Call pulongest
instead of plongest.
(gnu_xfer_partial): Likewise.
* ia64-hpux-nat.c (ia64_hpux_xfer_memory): Likewise.
(ia64_hpux_xfer_solib_got): Likewise.
(ia64_hpux_xfer_partial): Likewise.
* ia64-linux-nat.c (ia64_linux_xfer_partial):
* inf-ptrace.c (inf_ptrace_xfer_partial):
* inf-ttrace.c (inf_ttrace_xfer_partial):
* linux-nat.c (linux_xfer_siginfo): Likewise.
(linux_nat_xfer_partial): Likewise.
(spu_enumerate_spu_ids, linux_proc_xfer_spu): Likewise.
(linux_nat_xfer_osdata, linux_xfer_partial): Likewise.
* monitor.c (monitor_xfer_memory): Likewise.
(monitor_xfer_partial): Likewise.
* procfs.c (procfs_xfer_partial): Likewise.
* record-full.c (record_full_xfer_partial): Likewise.
(record_full_core_xfer_partial): Likewise.
* remote-sim.c (gdbsim_xfer_memory): Likewise. Call pulongest
instead of plongest.
(gdbsim_xfer_partial): Likewise.
* remote.c (remote_xfer_partial): Likewise.
* rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise.
* rs6000-aix-tdep.h (rs6000_aix_ld_info_to_xml): Update
declaration.
* rs6000-nat.c (rs6000_xfer_partial): Likewise.
(rs6000_xfer_shared_libraries): Likewise.
* sol-thread.c (sol_thread_xfer_partial): Likewise.
* sparc-nat.c (sparc_xfer_wcookie): Likewise.
(sparc_xfer_partial): Likewise.
* spu-linux-nat.c (spu_proc_xfer_spu): Likewise.
(spu_xfer_partial): Likewise.
* spu-multiarch.c (spu_xfer_partial): Likewise.
* target.c (target_read_live_memory): Likewise.
(memory_xfer_live_readonly_partial): Likewise.
(memory_xfer_partial, memory_xfer_partial_1): Likewise.
(target_xfer_partial, default_xfer_partial): Likewise.
(current_xfer_partial): Likewise.
* tracepoint.c (tfile_xfer_partial): Likewise.
* windows-nat.c (windows_xfer_memory): Likewise. Call
pulongest instead of plongest.
(windows_xfer_partial): Likewise.
(windows_xfer_shared_libraries): Likewise.
2014-01-14 Yao Qi <yao@codesourcery.com>
* rs6000-nat.c (rs6000_xfer_shared_libraries): Use
target_xfer_partial_ftype.
2014-01-13 Siva Chandra Reddy <sivachandra@google.com>
PR python/15464
PR python/16113
* valops.c (value_struct_elt_bitpos): New function
* py-type.c (convert_field): Set 'name' attribute of a gdb.Field
object to 'None' if the field name is an empty string ("").
* python/py-value.c (valpy_getitem): Use 'bitpos' and 'type'
attribute to look for a field when 'name' is 'None'.
(get_field_type): New function
2014-01-13 Doug Evans <dje@google.com>
PR symtab/16426
* dwarf2read.c (dwarf2_get_dwz_file): Call gdb_bfd_record_inclusion.
(try_open_dwop_file): Ditto.
* gdb_bfd.c: #include "vec.h".
(bfdp): New typedef.
(struct gdb_bfd_data): New member included_bfds.
(gdb_bfd_unref): Unref all included bfds.
(gdb_bfd_record_inclusion): New function.
* gdb_bfd.h (gdb_bfd_record_inclusion): Declare.
2014-01-13 Tom Tromey <tromey@redhat.com>
* gdbcore.h (deprecated_core_resize_section_table): Remove.
2014-01-13 Tom Tromey <tromey@redhat.com>
* defs.h (use_windows): Remove.
* gdb.c (main): Update.
* main.c (captured_main, gdb_main): Update.
* main.h (struct captured_main_args) <use_windows>: Remove.
* top.c (use_windows): Remove.
2014-01-13 Tom Tromey <tromey@redhat.com>
* defs.h (deprecated_flush_hook): Remove.
2014-01-13 Jan Kratochvil <jan.kratochvil@redhat.com>
PR threads/16216
* linux-thread-db.c (try_thread_db_load): Add parameter
check_auto_load_safe. Move here the file_is_auto_load_safe call.
(try_thread_db_load_from_pdir_1): Move it there from here.
(try_thread_db_load_from_sdir): Update caller.
(try_thread_db_load_from_dir): Move it there from here.
2014-01-13 Patrick Palka <patrick@parcs.ath.cx>
* regformats/regdat.sh: Always rewrite the register file.
2014-01-13 Pedro Alves <palves@redhat.com>
* Makefile.in (CHECK_HEADERS): New variable.
(check-headers:): New rule.
2014-01-13 Tom Tromey <tromey@redhat.com>
* cli/cli-setshow.c (do_set_command): Update.
* defs.h (deprecated_set_hook): Remove.
* top.c (deprecated_set_hook): Remove.
2014-01-13 Pedro Alves <palves@redhat.com>
* tracepoint.c (tfile_fetch_registers): Don't infer the PC from
the tracepoint if the PC is a pseudo-register.
2014-01-13 Tom Tromey <tromey@redhat.com>
* defs.h (XCALLOC): Remove.
* bcache.c (bcache_xmalloc): Use XCNEW, not XCALLOC.
(print_bcache_statistics): Use XCNEWVEC, not XCALLOC.
* dwarf2loc.c (allocate_piece_closure): Likewise.
* elfread.c (elf_symfile_segments): Likewise.
(elf_symfile_segments): Likewise.
* gdbtypes.c (copy_type_recursive): Likewise.
* i386-tdep.c (i386_gdbarch_init): Use XCNEW, not XCALLOC.
* jit.c (jit_frame_sniffer): Use XCNEWVEC, not XCALLOC.
* minsyms.c (prim_record_minimal_symbol_full): Use XCNEW, not
XCALLOC.
* mt-tdep.c (mt_gdbarch_init): Likewise.
* opencl-lang.c (allocate_lval_closure): Use XCNEWVEC, not
XCALLOC.
* psymtab.c (psymbol_compare): Use XCNEW, not XCALLOC.
* regcache.c (regcache_xmalloc_1): Use XCNEWVEC, not XCALLOC.
* registry.c (registry_alloc_data): Likewise.
* rs6000-tdep.c (rs6000_gdbarch_init): Use XCNEW, not XCALLOC.
* s390-linux-tdep.c (s390_gdbarch_init): Likewise.
* serial.c (serial_fdopen_ops): Likewise.
* solib-aix.c (solib_aix_get_section_offsets): Use XCNEWVEC, not
XCALLOC.
* spu-tdep.c (spu_gdbarch_init): Use XCNEW, not XCALLOC.
* symfile.c (default_symfile_segments): Use XCNEW and XCNEWVEC,
not XCALLOC.
replace XMALLOC with XNEW This replaces XMALLOC with XNEW, and removes XMALLOC. The only non-mechanical bit here was remembering to edit gdbarch.sh. 2014-01-13 Tom Tromey <tromey@redhat.com> * defs.h (XMALLOC): Remove. * avr-tdep.c (avr_gdbarch_init): Use XNEW, not XMALLOC. * bfin-tdep.c (bfin_gdbarch_init): Likewise. * cli-out.c (struct ui_out *): Likewise. * cli/cli-dump.c (add_dump_command): Likewise. (add_dump_command): Likewise. * complaints.c (get_complaints): Likewise. (find_complaint): Likewise. * dwarf2-frame.c (execute_cfa_program): Likewise. * dwarf2read.c (abbrev_table_read_table): Likewise. * gdbarch.sh: Likewise. * gdbarch.c: Rebuild. * inf-ttrace.c (inf_ttrace_add_page): Likewise. * interps.c (interp_new): Likewise. * lm32-tdep.c (lm32_gdbarch_init): Likewise. * m32r-tdep.c (m32r_gdbarch_init): Likewise. * mi/mi-console.c (mi_console_file_new): Likewise. * mi/mi-interp.c (mi_interpreter_init): Likewise. * mi/mi-out.c (mi_out_new): Likewise. * mi/mi-parse.c (mi_parse): Likewise. * microblaze-tdep.c (microblaze_gdbarch_init): Likewise. * moxie-tdep.c (moxie_gdbarch_init): Likewise. * observer.c (xalloc_observer_list_node): Likewise. * regcache.c (regcache_xmalloc_1): Likewise. * reggroups.c (reggroup_new): Likewise. (_initialize_reggroup): Likewise. * registry.c (register_data_with_cleanup): Likewise. * remote.c (remote_notif_stop_alloc_reply): Likewise. * ser-base.c (serial_ttystate): Likewise. * ser-mingw.c (make_pipe_state): Likewise. * ser-pipe.c (pipe_open): Likewise. * serial.c (serial_open): Likewise. * sh64-tdep.c (sh64_gdbarch_init): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_add_content_elements): Likewise. * tui/tui-file.c (tui_file_new): Likewise. * tui/tui-out.c (tui_out_new): Likewise. * ui-file.c (mem_file_new): Likewise. * ui-out.c (push_level): Likewise. (make_cleanup_ui_out_end): Likewise. (append_header_to_list): Likewise. (ui_out_new): Likewise. * user-regs.c (user_reg_add_builtin): Likewise.
2013-12-28 23:31:23 +01:00
2014-01-13 Tom Tromey <tromey@redhat.com>
* defs.h (XMALLOC): Remove.
* avr-tdep.c (avr_gdbarch_init): Use XNEW, not XMALLOC.
* bfin-tdep.c (bfin_gdbarch_init): Likewise.
* cli-out.c (struct ui_out *): Likewise.
* cli/cli-dump.c (add_dump_command): Likewise.
(add_dump_command): Likewise.
* complaints.c (get_complaints): Likewise.
(find_complaint): Likewise.
* dwarf2-frame.c (execute_cfa_program): Likewise.
* dwarf2read.c (abbrev_table_read_table): Likewise.
* gdbarch.sh: Likewise.
* gdbarch.c: Rebuild.
* inf-ttrace.c (inf_ttrace_add_page): Likewise.
* interps.c (interp_new): Likewise.
* lm32-tdep.c (lm32_gdbarch_init): Likewise.
* m32r-tdep.c (m32r_gdbarch_init): Likewise.
* mi/mi-console.c (mi_console_file_new): Likewise.
* mi/mi-interp.c (mi_interpreter_init): Likewise.
* mi/mi-out.c (mi_out_new): Likewise.
* mi/mi-parse.c (mi_parse): Likewise.
* microblaze-tdep.c (microblaze_gdbarch_init): Likewise.
* moxie-tdep.c (moxie_gdbarch_init): Likewise.
* observer.c (xalloc_observer_list_node): Likewise.
* regcache.c (regcache_xmalloc_1): Likewise.
* reggroups.c (reggroup_new): Likewise.
(_initialize_reggroup): Likewise.
* registry.c (register_data_with_cleanup): Likewise.
* remote.c (remote_notif_stop_alloc_reply): Likewise.
* ser-base.c (serial_ttystate): Likewise.
* ser-mingw.c (make_pipe_state): Likewise.
* ser-pipe.c (pipe_open): Likewise.
* serial.c (serial_open): Likewise.
* sh64-tdep.c (sh64_gdbarch_init): Likewise.
* tui/tui-data.c (tui_alloc_generic_win_info): Likewise.
(tui_alloc_win_info): Likewise.
(tui_add_content_elements): Likewise.
* tui/tui-file.c (tui_file_new): Likewise.
* tui/tui-out.c (tui_out_new): Likewise.
* ui-file.c (mem_file_new): Likewise.
* ui-out.c (push_level): Likewise.
(make_cleanup_ui_out_end): Likewise.
(append_header_to_list): Likewise.
(ui_out_new): Likewise.
* user-regs.c (user_reg_add_builtin): Likewise.
replace XZALLOC with XCNEW This replaces XZALLOC with XCNEW and removes XZALLOC. This change is purely mechanical. 2014-01-13 Tom Tromey <tromey@redhat.com> * defs.h (XZALLOC): Remove. * ada-lang.c (get_ada_inferior_data): Use XCNEW, not XZALLOC. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * auto-load.c (get_auto_load_pspace_data): Likewise. * auxv.c (get_auxv_inferior_data): Likewise. * bfd-target.c (target_bfd_reopen): Likewise. * breakpoint.c (get_catch_syscall_inferior_data): Likewise. (deprecated_insert_raw_breakpoint): Likewise. * bsd-uthread.c (bsd_uthread_pid_to_str): Likewise. * corelow.c (core_open): Likewise. * darwin-nat.c (darwin_check_new_threads): Likewise. (darwin_attach_pid): Likewise. * dummy-frame.c (dummy_frame_push): Likewise. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * dwarf2loc.c (allocate_piece_closure): Likewise. * elfread.c (elf_symfile_segments): Likewise. * eval.c (ptrmath_type_p): Likewise. * exceptions.c (EXCEPTIONS_SIGJMP_BUF): Likewise. * gdbtypes.c (alloc_type_arch): Likewise. (alloc_type_instance): Likewise. * hppa-tdep.c (hppa_gdbarch_init): Likewise. * inf-child.c (inf_child_can_use_agent): Likewise. * inflow.c (get_inflow_inferior_data): Likewise. * infrun.c (save_infcall_suspend_state): Likewise. * jit.c (jit_reader_load): Likewise. (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_open_impl): Likewise. (jit_symtab_open_impl): Likewise. (jit_block_open_impl): Likewise. (jit_frame_sniffer): Likewise. * linux-fork.c (add_fork): Likewise. * maint.c (make_command_stats_cleanup): Likewise. * objfiles.c (get_objfile_pspace_data): Likewise. * opencl-lang.c (struct lval_closure): Likewise. * osdata.c (osdata_start_osdata): Likewise. * progspace.c (new_address_space): Likewise. (add_program_space): Likewise. * remote-sim.c (get_sim_inferior_data): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. * skip.c (Ignore): Likewise. (skip_delete_command): Likewise. * solib-aix.c (get_solib_aix_inferior_data): Likewise. (library_list_start_library): Likewise. (solib_aix_current_sos): Likewise. * solib-darwin.c (get_darwin_info): Likewise. (darwin_current_sos): Likewise. * solib-dsbt.c (get_dsbt_info): Likewise. * solib-ia64-hpux.c (new_so_list): Likewise. (ia64_hpux_get_solib_linkage_addr): Likewise. * solib-spu.c (append_ocl_sos): Likewise. (spu_current_sos): Likewise. * solib-svr4.c (get_svr4_info): Likewise. (svr4_keep_data_in_core): Likewise. (library_list_start_library): Likewise. (svr4_default_sos): Likewise. (svr4_read_so_list): Likewise. * solib-target.c (library_list_start_library): Likewise. (solib_target_current_sos): Likewise. * sparc-tdep.c (sparc32_gdbarch_init): Likewise. * symfile-debug.c (install_symfile_debug_logging): Likewise. * symfile.c (default_symfile_segments): Likewise. * target-descriptions.c (tdesc_data_init): Likewise. (tdesc_create_reg): Likewise. (struct tdesc_type *): Likewise. (tdesc_create_vector): Likewise. (tdesc_set_struct_size): Likewise. (struct tdesc_type *): Likewise. (tdesc_free_feature): Likewise. (tdesc_create_feature): Likewise. * windows-nat.c (windows_add_thread): Likewise. (windows_make_so): Likewise. * xml-support.c (gdb_xml_body_text): Likewise. (gdb_xml_create_parser_and_cleanup): Likewise. (xml_process_xincludes): Likewise. * xml-syscall.c (allocate_syscalls_info): Likewise. (syscall_create_syscall_desc): Likewise.
2013-12-28 23:31:01 +01:00
2014-01-13 Tom Tromey <tromey@redhat.com>
* defs.h (XZALLOC): Remove.
* ada-lang.c (get_ada_inferior_data): Use XCNEW, not XZALLOC.
* ada-tasks.c (get_ada_tasks_pspace_data): Likewise.
(get_ada_tasks_inferior_data): Likewise.
* auto-load.c (get_auto_load_pspace_data): Likewise.
* auxv.c (get_auxv_inferior_data): Likewise.
* bfd-target.c (target_bfd_reopen): Likewise.
* breakpoint.c (get_catch_syscall_inferior_data): Likewise.
(deprecated_insert_raw_breakpoint): Likewise.
* bsd-uthread.c (bsd_uthread_pid_to_str): Likewise.
* corelow.c (core_open): Likewise.
* darwin-nat.c (darwin_check_new_threads): Likewise.
(darwin_attach_pid): Likewise.
* dummy-frame.c (dummy_frame_push): Likewise.
* dwarf2-frame.c (dwarf2_frame_cache): Likewise.
* dwarf2loc.c (allocate_piece_closure): Likewise.
* elfread.c (elf_symfile_segments): Likewise.
* eval.c (ptrmath_type_p): Likewise.
* exceptions.c (EXCEPTIONS_SIGJMP_BUF): Likewise.
* gdbtypes.c (alloc_type_arch): Likewise.
(alloc_type_instance): Likewise.
* hppa-tdep.c (hppa_gdbarch_init): Likewise.
* inf-child.c (inf_child_can_use_agent): Likewise.
* inflow.c (get_inflow_inferior_data): Likewise.
* infrun.c (save_infcall_suspend_state): Likewise.
* jit.c (jit_reader_load): Likewise.
(get_jit_objfile_data): Likewise.
(get_jit_program_space_data): Likewise.
(jit_object_open_impl): Likewise.
(jit_symtab_open_impl): Likewise.
(jit_block_open_impl): Likewise.
(jit_frame_sniffer): Likewise.
* linux-fork.c (add_fork): Likewise.
* maint.c (make_command_stats_cleanup): Likewise.
* objfiles.c (get_objfile_pspace_data): Likewise.
* opencl-lang.c (struct lval_closure): Likewise.
* osdata.c (osdata_start_osdata): Likewise.
* progspace.c (new_address_space): Likewise.
(add_program_space): Likewise.
* remote-sim.c (get_sim_inferior_data): Likewise.
* sh-tdep.c (sh_gdbarch_init): Likewise.
* skip.c (Ignore): Likewise.
(skip_delete_command): Likewise.
* solib-aix.c (get_solib_aix_inferior_data): Likewise.
(library_list_start_library): Likewise.
(solib_aix_current_sos): Likewise.
* solib-darwin.c (get_darwin_info): Likewise.
(darwin_current_sos): Likewise.
* solib-dsbt.c (get_dsbt_info): Likewise.
* solib-ia64-hpux.c (new_so_list): Likewise.
(ia64_hpux_get_solib_linkage_addr): Likewise.
* solib-spu.c (append_ocl_sos): Likewise.
(spu_current_sos): Likewise.
* solib-svr4.c (get_svr4_info): Likewise.
(svr4_keep_data_in_core): Likewise.
(library_list_start_library): Likewise.
(svr4_default_sos): Likewise.
(svr4_read_so_list): Likewise.
* solib-target.c (library_list_start_library): Likewise.
(solib_target_current_sos): Likewise.
* sparc-tdep.c (sparc32_gdbarch_init): Likewise.
* symfile-debug.c (install_symfile_debug_logging): Likewise.
* symfile.c (default_symfile_segments): Likewise.
* target-descriptions.c (tdesc_data_init): Likewise.
(tdesc_create_reg): Likewise.
(struct tdesc_type *): Likewise.
(tdesc_create_vector): Likewise.
(tdesc_set_struct_size): Likewise.
(struct tdesc_type *): Likewise.
(tdesc_free_feature): Likewise.
(tdesc_create_feature): Likewise.
* windows-nat.c (windows_add_thread): Likewise.
(windows_make_so): Likewise.
* xml-support.c (gdb_xml_body_text): Likewise.
(gdb_xml_create_parser_and_cleanup): Likewise.
(xml_process_xincludes): Likewise.
* xml-syscall.c (allocate_syscalls_info): Likewise.
(syscall_create_syscall_desc): Likewise.
2014-01-12 Sergio Durigan Junior <sergiodj@redhat.com>
* i386-tdep.c (i386_stap_parse_special_token_triplet): New
function, with code from i386_stap_parse_special_token.
(i386_stap_parse_special_token_three_arg_disp): Likewise.
(i386_stap_parse_special_token): Move code to the two functions
above; simplify it.
Handle the case of a remote target supporting target side commands, but not on software breakpoints. Although we can tell upfront whether a remote target supports target side commands, we can only tell whether the target supports that in combination with a given breakpoint kind (software, hardware, watchpoints, etc.) when we go and try to insert such a breakpoint kind the first time. It's not desirable to make remote_insert_breakpoint simply return -1 in this case, because if the breakpoint was set in a shared library, insert_bp_location will assume that the breakpoint insertion failed because the library wasn't mapped in. insert_bp_location already handles errors/exceptions thrown from the target_insert_xxx methods, exactly so the backend can tell the user the detailed reason the insertion of hw breakpoints failed. But, in the case of software breakpoints, it discards the detailed error message. So the patch makes insert_bp_location use the error's message for SW breakpoints too, and, introduces a NOT_SUPPORTED_ERROR error code so that insert_bp_location doesn't confuse the error for failure due to a shared library disappearing. The result is: (gdb) c Warning: Cannot insert breakpoint 2: Target doesn't support breakpoints that have target side commands. 2014-01-09 Pedro Alves <palves@redhat.com> Hui Zhu <hui@codesourcery.com> PR gdb/16101 * breakpoint.c (insert_bp_location): Rename hw_bp_err_string to bp_err_string. Don't mark the location shlib_disabled if the error thrown wasn't a generic or memory error. Catch errors thrown while inserting breakpoints in overlayed code. Output error message of software breakpoints. * remote.c (remote_insert_breakpoint): If this breakpoint has target-side commands but this stub doesn't support Z0 packets, throw NOT_SUPPORTED_ERROR error. * exceptions.h (enum errors) <NOT_SUPPORTED_ERROR>: New error. * target.h (target_insert_breakpoint): Extend comment. (target_insert_hw_breakpoint): Add comment.
2014-01-09 19:33:45 +01:00
2014-01-09 Pedro Alves <palves@redhat.com>
Hui Zhu <hui@codesourcery.com>
PR gdb/16101
* breakpoint.c (insert_bp_location): Rename hw_bp_err_string to
bp_err_string. Don't mark the location shlib_disabled if the
error thrown wasn't a generic or memory error. Catch errors
thrown while inserting breakpoints in overlayed code. Output
error message of software breakpoints.
* remote.c (remote_insert_breakpoint): If this breakpoint has
target-side commands but this stub doesn't support Z0 packets,
throw NOT_SUPPORTED_ERROR error.
* exceptions.h (enum errors) <NOT_SUPPORTED_ERROR>: New error.
* target.h (target_insert_breakpoint): Extend comment.
(target_insert_hw_breakpoint): Add comment.
[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>
* 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.
2014-01-08 Joel Brobecker <brobecker@adacore.com>
* NEWS: Create a new section for the next release branch.
Rename the section of the current branch, now that it has
been cut.
2014-01-08 Joel Brobecker <brobecker@adacore.com>
GDB 7.7 branch created (79301218fa0f074c5656db0ec8972a5ddcf91fb5):
* version.in: Bump version to 7.7.50.DATE-cvs.
2014-01-08 Yao Qi <yao@codesourcery.com>
* spu-linux-nat.c (spu_symbol_file_add_from_memory): Change
type of 'id' to gdb_byte. Cast 'id' to 'const char *'.
(spu_xfer_partial): Cast 'buf' to 'const char *'.
Pass name to symbol_file_add_from_bfd This patch fixes the following build error: ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 2 of ‘symbol_file_add_from_bfd’ makes pointer from integer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘const char *’ but argument is of type ‘int’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 3 of ‘symbol_file_add_from_bfd’ makes integer from pointer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘int’ but argument is of type ‘void *’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 5 of ‘symbol_file_add_from_bfd’ makes integer from pointer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘int’ but argument is of type ‘void *’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: too few arguments to function ‘symbol_file_add_from_bfd’ Argument 'name' was added to function symbol_file_add_from_bfd by this patch [patchv4 4/5] Keep objfile original filename https://sourceware.org/ml/gdb-patches/2013-09/msg00683.html but caller of symbol_file_add_from_bfd in spu-linux-nat.c wasn't updated. This patch fixes the build error. gdb: 2014-01-08 Yao Qi <yao@codesourcery.com> * spu-linux-nat.c (spu_symbol_file_add_from_memory): Pass return value of bfd_get_filename to symbol_file_add_from_bfd.
2014-01-07 10:48:07 +01:00
2014-01-08 Yao Qi <yao@codesourcery.com>
* spu-linux-nat.c (spu_symbol_file_add_from_memory): Pass
return value of bfd_get_filename to symbol_file_add_from_bfd.
2014-01-08 Pierre Muller <muller@sourceware.org>
Fix PR16201.
* coff-pe-read.c (struct read_pe_section_data): Add index field.
(add_pe_exported_sym): Use SECTION_DATA->INDEX for call
to prim_record_mininal_symbol_and_info.
(add_pe_forwarded_sym): Use known section number of forwarded symbol
in call to prim_record_minimal_symbol_and_info.
(read_pe_exported_syms): Set index field of section_data.
2014-01-07 Andrew Pinski <apinski@cavium.com>
* features/aarch64-core.xml (cpsr): Change to be 64bit.
* features/aarch64.c: Regenerate.
2014-01-07 Andreas Schwab <schwab@linux-m68k.org>
* target.c (return_null): Define.
(update_current_target): Use it instead of return_zero for
functions that return a pointer.
2014-01-07 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
* source.c (add_path): Fix check for duplicated paths in the previously
included paths.
2014-01-07 Honggyu Kim <hong.gyu.kim@lge.com>
* ada-lang.c: Remove duplicated include statements.
* alphabsd-nat.c: Ditto.
* amd64-darwin-tdep.c: Ditto.
* amd64fbsd-nat.c: Ditto.
* auto-load.c: Ditto.
* ax-gdb.c: Ditto.
* breakpoint.c: Ditto.
* dbxread.c: Ditto.
* fork-child.c: Ditto.
* gdb_usleep.c: Ditto.
* i386-darwin-tdep.c: Ditto.
* i386fbsd-nat.c: Ditto.
* infcmd.c: Ditto.
* inferior.c: Ditto.
* jv-lang.c: Ditto.
* linux-nat.c: Ditto.
* linux-tdep.c: Ditto.
* m68kbsd-nat.c: Ditto.
* m68klinux-nat.c: Ditto.
* microblaze-tdep.c: Ditto.
* mips-linux-tdep.c: Ditto.
* mn10300-tdep.c: Ditto.
* nto-tdep.c: Ditto.
* opencl-lang.c: Ditto.
* osdata.c: Ditto.
* printcmd.c: Ditto.
* regcache.c: Ditto.
* remote-m32r-sdi.c: Ditto.
* remote.c: Ditto.
* symfile.c: Ditto.
* symtab.c: Ditto.
* tilegx-linux-nat.c: Ditto.
* tilegx-tdep.c: Ditto.
* tracepoint.c: Ditto.
* valops.c: Ditto.
* vaxbsd-nat.c: Ditto.
* windows-nat.c: Ditto.
* xtensa-tdep.c: Ditto.
2014-01-07 Yao Qi <yao@codesourcery.com>
* spu-linux-nat.c (_initialize_spu_nat): Declare.
2014-01-08 10:16:32 +01:00
2014-01-07 Yao Qi <yao@codesourcery.com>
Joel Brobecker <brobecker@adacore.com>
* aix-thread.c (pdc_read_regs): Cast parameter to uintptr_t.
(pdc_write_regs): Likewise.
(fetch_regs_kernel_thread): Likewise.
(store_regs_kernel_thread): Likewise.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-varobj.c (ada_varobj_adjust_for_child_access): Convert
tagged type objects to their actual type.
Ada: Fix missing call to pretty-printer for fields of records. Consider the following types: type Time_T is record Secs : Integer; end record; Before : Time_T := (Secs => 1384395743); In this example, we assume that type Time_T is the number of seconds since Epoch, and so added a Python pretty-printer, to print this type in a more human-friendly way. For instance: (gdb) print before $1 = Thu Nov 14 02:22:23 2013 (1384395743) However, we've noticed that things stop working when this type is embedded inside another record, and we try to print that record. For instance, with the following declarations: type Composite is record Id : Integer; T : Time_T; end record; Afternoon : Composite := (Id => 1, T => (Secs => 1384395865)); (gdb) print afternoon $2 = (id => 1, t => (secs => 1384395865)) We expected instead: (gdb) print afternoon $2 = (id => 1, t => Thu Nov 14 02:24:25 2013 (1384395865)) This patch fixes the problem by making sure that we try to print each field via a call to val_print, rather than calling ada_val_print directly. We need to go through val_print, as the val_print handles all language-independent features such as calling the pretty-printer, knowing that ada_val_print will get called eventually if actual Ada-specific printing is required (which should be the most common scenario). And because val_print takes the language as parameter, we enhanced the print_field_values and print_variant_part to also take a language. As a bonus, this allows us to remove a couple of references to current_language. gdb/ChangeLog: * ada-valprint.c (print_field_values): Add "language" parameter. Update calls to print_field_values and print_variant_part. Pass new parameter "language" in call to val_print instead of "current_language". Replace call to ada_val_print by call to val_print. (print_variant_part): Add "language" parameter. (ada_val_print_struct_union): Update call to print_field_values. gdb/testsuite/ChangeLog: * gdb.ada/pp-rec-component.exp, gdb.ada/pp-rec-component.py, gdb.ada/pp-rec-component/foo.adb, gdb.ada/pp-rec-component/pck.adb, gdb.ada/pp-rec-component/pck.ads: New files.
2013-12-19 18:26:55 +01:00
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (print_field_values): Add "language" parameter.
Update calls to print_field_values and print_variant_part.
Pass new parameter "language" in call to val_print instead
of "current_language". Replace call to ada_val_print by call
to val_print.
(print_variant_part): Add "language" parameter.
(ada_val_print_struct_union): Update call to print_field_values.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ui_memcpy): Delete.
(ada_print_floating): Update documentation. Add empty line
between between function documentation and implementation.
Delete variable "buffer". Use ui_file_xstrdup in place of
ui_file_put. Minor adjustments following this change.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_val_print_string): New function,
extracted from ada_val_print_array.
(ada_val_print_array): Replace extracted code by call
to ada_val_print_string followed by a return. Move
"else" branch to the function's top block.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_val_print_array): Move implementation
down. Rename parameter "offset" and "val" into "offset_aligned"
and "original_value" respectively. Add parameter "offset".
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_val_print_ref): Rewrite by mostly
re-organizing the code. Change the "???" message printed
when target type is a TYPE_CODE_UNDEF into
"<ref to undefined type>".
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (print_record): Delete, implementation inlined...
(ada_val_print_struct_union): ... here. Remove call to
ada_check_typedef in inlined implementation.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_val_print_gnat_array): New function,
extracted from ada_val_print_1;
(ada_val_print_ptr, ada_val_print_num, ada_val_print_enum)
(ada_val_print_flt, ada_val_print_struct_union)
(ada_val_print_ref): Likewise.
(ada_val_print_1): Delete variables i and elttype.
Replace extracted-out code by call to corresponding
new functions.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_val_print_1): Remove call to gdb_flush.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_val_print_1): Replace calls to
ada_val_print_1 by calls to val_print.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_val_print_1): Add parameter "language".
Update calls to self accordingly. Replace calls to c_val_print
by calls to val_print.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (print_record): Delete declaration.
(adjust_type_signedness, ada_val_print_1): Likewise.
(ada_val_print): Move function implementation down.
(print_variant_part, print_field_values, print_record):
Move function implementation up.
2014-01-07 Joel Brobecker <brobecker@adacore.com>
* python/py-type.c (typy_get_name): New function.
(type_object_getset): Add entry for attribute "name".
* NEWS: Add entry mentioning this new attribute.
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (set_exceptions_cmd): Remove an empty body 'if'
statement.
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (info_port_rights): Add qualifier const to
argument args.
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (trace_me): Use 'void' for empty argument list.
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (make_inf) Update declaration.
(make_inf): Make it static.
(inf_set_traced): Likewise.
(inf_port_to_thread, inf_task_died_status): Likewise.
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (inf_tid_to_proc): Remove declaration.
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (_initialize_gnu_nat): Declare.
2014-01-07 Yao Qi <yao@codesourcery.com>
* gdbarch.sh (byte_order, byte_order_for_code): Change type to
'enum bfd_endian'.
(struct gdbarch_info) <byte_order>: Change type to
'enum bfd_endian'.
<byte_order_for_code>: Likewise.
* gdbarch.c, gdbarch.h: Regenerated.
2014-01-06 Sasha Smundak <asmundak@google.com>
* jit.c: (jit_reader_load_command): Fix JIT reader path creation.
2014-01-06 Tom Tromey <tromey@redhat.com>
* doublest.c (convert_doublest_to_floatformat): Use const, not
CONST.
* somread.c (som_symtab_read): Likewise.
2014-01-07 Hui Zhu <hui@codesourcery.com>
* gdb_bfd.c (gdb_bfd_stash_filename): Removed.
(gdb_bfd_open): Removed gdb_bfd_stash_filename.
(gdb_bfd_fopen): Ditto.
(gdb_bfd_openr): Ditto.
(gdb_bfd_openw): Ditto.
(gdb_bfd_openr_iovec): Ditto.
(gdb_bfd_fdopenr): Ditto.
* gdb_bfd.h (gdb_bfd_stash_filename): Removed.
* solib-aix.c (solib_aix_bfd_open): Alloc object_bfd->filename
with xstrdup.
* solib-darwin.c (darwin_bfd_open): Alloc res->filename
with xstrdup.
* symfile-mem.c (symbol_file_add_from_memory): Removed
gdb_bfd_stash_filename.
2014-01-03 Doug Evans <dje@google.com>
* nat/linux-waitpid.c (linux_debug): Remove extraneous \n from
output.
2014-01-01 Joel Brobecker <brobecker@adacore.com>
Update year range in copyright notice of all files.
2014-01-01 Joel Brobecker <brobecker@adacore.com>
* top.c (print_gdb_version): Set copyright year to 2014.
2014-01-01 Joel Brobecker <brobecker@adacore.com>
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2013.
2014-01-01 04:31:51 +01:00
For older changes see ChangeLog-2013.
Local Variables:
mode: change-log
left-margin: 8
fill-column: 74
version-control: never
2007-08-10 00:44:38 +02:00
coding: utf-8
End: