binutils-gdb/gdb/ChangeLog

17397 lines
628 KiB
Plaintext
Raw Normal View History

2019-12-30 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_border_mode_translate)
(tui_border_kind_translate_vline, tui_border_kind_translate_hline)
(tui_border_kind_translate_ulcorner)
(tui_border_kind_translate_urcorner)
(tui_border_kind_translate_llcorner)
(tui_border_kind_translate_lrcorner, tui_active_border_mode)
(tui_border_mode, tui_border_kind): Now static.
2019-12-30 Tom Tromey <tom@tromey.com>
* tui/tui-interp.c (tui_start_enabled): Now bool.
(_initialize_tui_interp): Update.
* tui/tui-hooks.c (tui_refreshing_registers): Now bool.
(tui_register_changed)
(tui_refresh_frame_and_register_information): Update.
* tui/tui-win.c (tui_update_variables): Return bool.
* tui/tui-win.h (tui_update_variables): Return bool.
* tui/tui.c (tui_get_command_dimension): Return bool.
* tui/tui.h (tui_get_command_dimension): Return bool.
2019-12-29 Bernd Edlinger <bernd.edlinger@hotmail.de>
* buildsym.c (buildsym_compunit::record_line): Do no longer ignore
line 65535.
2019-12-27 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_source_window::do_scroll_vertical): Remove
commented-out code.
* tui/tui.c: Remove #if 0 code.
2019-12-27 Tom Tromey <tom@tromey.com>
* cli/cli-cmds.c (print_disassembly): Reorder "if".
2019-12-27 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_active): Now bool.
(tui_finish_init): Likewise.
(tui_enable): Update.
(tui_disable): Update.
(tui_is_window_visible): Update.
* tui/tui.h (tui_active): Now bool.
2019-12-27 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_source_window::maybe_update): Update.
* tui/tui-regs.c (tui_data_window::display_registers_from):
Update.
* tui/tui-layout.c (tui_gen_win_info::resize): Update.
* tui/tui-data.h (struct tui_gen_win_info) <viewport_height>:
Remove.
* tui/tui-command.c (tui_cmd_window::resize): Update.
Make symbol_set_names a member function This also renames it to make it clearer that this is not a cheap function (to compute_and_set_names). Also renames name to m_name to make the implementation of the renamed function more readable. Most of the places that access sym->m_name directly were also changed to call linkage_name () instead, to make it clearer which name they are accessing. gdb/ChangeLog: 2019-12-26 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_decode_symbol): Update. * buildsym.c (add_symbol_to_list): Update. * coffread.c (process_coff_symbol): Update. * ctfread.c (ctf_add_enum_member_cb): Update. (new_symbol): Update. (ctf_add_var_cb): Update. * dwarf2read.c (fixup_go_packaging): Update. (dwarf2_compute_name): Update. (new_symbol): Update. * jit.c (finalize_symtab): Update. * language.c (language_alloc_type_symbol): Update. * mdebugread.c (new_symbol): Update. * minsyms.c (minimal_symbol_reader::record_full): Update. (minimal_symbol_reader::install): Update. * psymtab.c (print_partial_symbols): Update. (psymbol_hash): Update. (psymbol_compare): Update. (add_psymbol_to_bcache): Update. (maintenance_check_psymtabs): Update. * stabsread.c (define_symbol): Update. * symtab.c (symbol_set_names): Rename to... (general_symbol_info::compute_and_set_names): ...this. (general_symbol_info::natural_name): Update. (general_symbol_info::search_name): Update. (fixup_section): Update. * symtab.h (struct general_symbol_info) <name>: Rename to... <m_name>: ...this. <compute_and_set_names>: Rename from... (symbol_set_names): ...this. (SYMBOL_SET_NAMES): Remove. (struct symbol) <ctor>: Update. Change-Id: I8da1f10cab4e0b89f19d5750fa4e6e2ac8d2b24f
2019-11-28 03:52:35 +01:00
2019-12-26 Christian Biesinger <cbiesinger@google.com>
* ada-lang.c (ada_decode_symbol): Update.
* buildsym.c (add_symbol_to_list): Update.
* coffread.c (process_coff_symbol): Update.
* ctfread.c (ctf_add_enum_member_cb): Update.
(new_symbol): Update.
(ctf_add_var_cb): Update.
* dwarf2read.c (fixup_go_packaging): Update.
(dwarf2_compute_name): Update.
(new_symbol): Update.
* jit.c (finalize_symtab): Update.
* language.c (language_alloc_type_symbol): Update.
* mdebugread.c (new_symbol): Update.
* minsyms.c (minimal_symbol_reader::record_full): Update.
(minimal_symbol_reader::install): Update.
* psymtab.c (print_partial_symbols): Update.
(psymbol_hash): Update.
(psymbol_compare): Update.
(add_psymbol_to_bcache): Update.
(maintenance_check_psymtabs): Update.
* stabsread.c (define_symbol): Update.
* symtab.c (symbol_set_names): Rename to...
(general_symbol_info::compute_and_set_names): ...this.
(general_symbol_info::natural_name): Update.
(general_symbol_info::search_name): Update.
(fixup_section): Update.
* symtab.h (struct general_symbol_info) <name>: Rename to...
<m_name>: ...this.
<compute_and_set_names>: Rename from...
(symbol_set_names): ...this.
(SYMBOL_SET_NAMES): Remove.
(struct symbol) <ctor>: Update.
2019-12-26 Christian Biesinger <cbiesinger@google.com>
* NEWS: Mention that multithreaded symbol loading is now on by
default.
2019-12-26 Ruslan Kabatsayev <b7.10110111@gmail.com>
* dwarf2read.c (is_valid_DW_AT_defaulted)
(is_valid_DW_AT_calling_convention_for_type)
(is_valid_DW_AT_calling_convention_for_subroutine): Fix printing
ULONGEST variables on x86-32.
2019-12-21 George Barrett <bob@bob131.so>
* solib-svr4.c (svr4_handle_solib_event): Add fallback link
namespace test for when the debug struct isn't available.
2019-12-21 Eli Zaretskii <eliz@gnu.org>
* top.c (print_gdb_configuration): Print "--with-xxhash" or
"--without-xxhash" according to HAVE_LIBXXHASH.
2019-12-20 Weimin Pan <weimin.pan@oracle.com>
* ctfread.c (ctf_file_key): Change type to objfile_key.
(struct ctf_context): Remove typedef.
(get_objfile_text_range): Use ANOFFSET to get text base.
2019-12-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* dwarf2read.c (is_valid_DW_AT_calling_convention_for_subroutine):
New function.
(read_subroutine_type): Validate the parsed
DW_AT_calling_convention value before assigning it to a
subroutine's calling_convention attribute.
* gdbtypes.h (struct func_type) <calling_convention>: Use
an enum bitfield as its type, instead of plain unsigned.
2019-12-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
PR gdb/25054
* infcall.c (call_function_by_hand_dummy): Update the argument-
passing section for call-by-value parameters.
(struct destructor_info): New struct.
(call_destructors): New auxiliary function.
2019-12-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* gnu-v3-abi.c (enum definition_style): New enum type.
(get_def_style): New function.
(is_user_provided_def): New function.
(is_implicit_def): New function.
(is_copy_or_move_constructor_type): New function.
(is_copy_constructor_type): New function.
(is_move_constructor_type): New function.
(gnuv3_pass_by_reference): Collect language_pass_by_ref_info
for a given type.
infcall, c++: allow more info to be computed for pass-by-reference values In C++, call-by-value arguments that cannot be trivially copied are implicitly passed by reference. When making an infcall, GDB needs to find out if an argument is pass-by-reference or not, so that the correct semantics can be followed. This patch enriches the information computed by the language ops for pass-by-reference arguments. Instead of a plain binary result, the computed information now includes whether the argument is - copy constructible - destructible - trivially copyable - trivially copy constructible - trivially destructible This information is stored in a struct named 'language_pass_by_ref_info'. This patch paves the way for GDB's infcall mechanism to call the copy ctor and the destructor of a pass-by-ref argument appropriately. gdb/ChangeLog: 2019-12-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * language.h (struct language_pass_by_ref_info): New struct. (struct language_defn)<la_pass_by_reference>: Change the signature to return a language_pass_by_ref_info instead of an int. (language_pass_by_reference): Ditto. (default_pass_by_reference): Ditto. Adjust the users listed below. * arch-utils.c (default_return_in_first_hidden_param_p): Update. * cp-abi.c (cp_pass_by_reference): Update. * cp-abi.h (cp_pass_by_reference): Update declaration. (struct cp_abi_ops)<pass_by_reference>: Update. * gnu-v3-abi.c (gnuv3_pass_by_reference): Update. * infcall.c (call_function_by_hand_dummy): Update. * language.c (language_pass_by_reference): Update. (default_pass_by_reference): Update. * tic6x-tdep.c (tic6x_return_value): Update. Change-Id: Ib1c1f87f2490a5737c469f7b7185ddc7f6a164cb
2019-12-20 17:43:06 +01:00
2019-12-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* language.h (struct language_pass_by_ref_info): New struct.
(struct language_defn)<la_pass_by_reference>: Change the signature
to return a language_pass_by_ref_info instead of an int.
(language_pass_by_reference): Ditto.
(default_pass_by_reference): Ditto.
Adjust the users listed below.
* arch-utils.c (default_return_in_first_hidden_param_p):
Update.
* cp-abi.c (cp_pass_by_reference): Update.
* cp-abi.h (cp_pass_by_reference): Update declaration.
(struct cp_abi_ops)<pass_by_reference>: Update.
* gnu-v3-abi.c (gnuv3_pass_by_reference): Update.
* infcall.c (call_function_by_hand_dummy): Update.
* language.c (language_pass_by_reference): Update.
(default_pass_by_reference): Update.
* tic6x-tdep.c (tic6x_return_value): Update.
2019-12-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* dwarf2read.c (dwarf2_add_member_fn): Read the DW_AT_defaulted
and DW_AT_deleted attributes of a function.
(read_structure_type): Read the DW_AT_calling_convention attribute
of a type.
(is_valid_DW_AT_defaulted): New function.
(is_valid_DW_AT_calling_convention_for_type): New function.
* gdbtypes.h: Include dwarf2.h.
(struct fn_field)<defaulted>: New field to store the
DW_AT_defaulted attribute.
(struct fn_field)<is_deleted>: New field to store the
DW_AT_deleted attribute.
(struct cplus_struct_type)<calling_convention>: New field to store
the DW_AT_calling_convention attribute.
(TYPE_FN_FIELD_DEFAULTED): New macro.
(TYPE_FN_FIELD_DELETED): New macro.
(TYPE_CPLUS_CALLING_CONVENTION): New macro.
* gdbtypes.c (dump_fn_fieldlists): Update for the changes made
to the .h file.
(print_cplus_stuff): Likewise.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_show_source): Remove.
* tui/tui.h (tui_show_source): Don't declare.
* tui/tui-out.c (tui_ui_out::do_field_string): Don't call
tui_show_source.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-stack.h (tui_show_frame_info): Return bool.
* tui/tui-stack.c (tui_show_frame_info): Return bool.
* tui/tui-hooks.c (tui_refresh_frame_and_register_information):
Update.
2019-12-20 Tom Tromey <tom@tromey.com>
PR tui/18932:
* tui/tui-hooks.c (tui_refresh_frame_and_register_information):
Rename parameters. Handle the not-from-stack-frame case.
(from_stack, from_source_symtab): New globals.
(tui_before_prompt, tui_normal_stop): Update.
(tui_context_changed, tui_symtab_changed): New functions.
(tui_attach_detach_observers): Attach new observers.
2019-12-20 Tom Tromey <tom@tromey.com>
* source.c (struct current_source_location) <set, symtab, line>:
New methods.
<m_symtab, m_line>: Rename. Now private.
(get_current_source_symtab_and_line)
(set_default_source_symtab_and_line)
(set_current_source_symtab_and_line)
(clear_current_source_symtab_and_line, select_source_symtab)
(info_source_command, print_source_lines_base)
(info_line_command, search_command_helper): Update.
* observable.h (current_source_symtab_and_line_changed): Declare
observable.
* observable.c (current_source_symtab_and_line_changed): Define
observable.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-hooks.c (tui_before_prompt): Change parameter to bool.
(tui_before_prompt, tui_normal_stop): Update.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c
(tui_source_window_base::update_source_window_as_is): Don't call
set_current_source_symtab_and_line.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-stack.h (struct tui_locator_window) <set_locator_info>:
Take a symtab_and_line.
* tui/tui-stack.c (tui_locator_window::set_locator_info): Take a
symtab_and_line.
(tui_show_frame_info): Update.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_show_frame_info): Don't call
update_exec_info.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_enable): Call tui_display_main.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.c (tui_get_begin_asm_address): Use
get_current_source_symtab_and_line, and main_name.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_show_source): Update.
* tui/tui-winsource.h (tui_update_source_windows_with_line): Update.
* tui/tui-winsource.c (tui_update_source_windows_with_line): Take
a symtab_symbol_info, not a separate symtab and line. Simplify.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_windows_with_addr):
Simplify.
Use symtab_and_line when updating TUI windows This changes a few TUI source window methods to take a symtab_and_line rather than separate symtab and tui_line_or_address parameters. A symtab_and_line already incorporates the same information, so this seemed simpler. Also, it helps avoid the problem that the source and disassembly windows need different information -- both forms are present in the SAL. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <set_contents, update_source_window_as_is, update_source_window>: Take a sal, not a separate symtab and tui_line_or_address. * tui/tui-winsource.c (tui_source_window_base::update_source_window) (tui_source_window_base::update_source_window_as_is): Take a sal, not a separate symtab and tui_line_or_address. (tui_update_source_windows_with_addr) (tui_update_source_windows_with_line) (tui_source_window_base::rerender) (tui_source_window_base::refill): Update. * tui/tui-source.h (struct tui_source_window) <set_contents>: Take a sal, not a separate symtab and tui_line_or_address. * tui/tui-source.c (tui_source_window::set_contents): Take a sal, not a separate symtab and tui_line_or_address. (tui_source_window::maybe_update): Update. * tui/tui-disasm.h (struct tui_disasm_window) <set_contents>: Take a sal, not a separate symtab and tui_line_or_address. * tui/tui-disasm.c (tui_disasm_window::set_contents): Take a sal, not a separate symtab and tui_line_or_address. (tui_disasm_window::do_scroll_vertical) (tui_disasm_window::maybe_update): Update. Change-Id: I6974a03589930a0f910c657ef50b7f6f7397c87d
2019-11-13 01:56:42 +01:00
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<set_contents, update_source_window_as_is, update_source_window>:
Take a sal, not a separate symtab and tui_line_or_address.
* tui/tui-winsource.c (tui_source_window_base::update_source_window)
(tui_source_window_base::update_source_window_as_is): Take a sal,
not a separate symtab and tui_line_or_address.
(tui_update_source_windows_with_addr)
(tui_update_source_windows_with_line)
(tui_source_window_base::rerender)
(tui_source_window_base::refill): Update.
* tui/tui-source.h (struct tui_source_window) <set_contents>: Take
a sal, not a separate symtab and tui_line_or_address.
* tui/tui-source.c (tui_source_window::set_contents): Take a sal,
not a separate symtab and tui_line_or_address.
(tui_source_window::maybe_update): Update.
* tui/tui-disasm.h (struct tui_disasm_window) <set_contents>: Take
a sal, not a separate symtab and tui_line_or_address.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Take a sal,
not a separate symtab and tui_line_or_address.
(tui_disasm_window::do_scroll_vertical)
(tui_disasm_window::maybe_update): Update.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_source_window_base::refill): Use
start_line_or_addr.
* tui/tui-source.c (tui_source_window::do_scroll_vertical): Use
start_line_or_addr.
* tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Use
start_line_or_addr.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<set_contents>: Return bool.
* tui/tui-winsource.c
(tui_source_window_base::update_source_window_as_is): Update.
* tui/tui-source.h (struct tui_source_window) <set_contents>:
Return bool.
* tui/tui-source.c (tui_source_window::set_contents): Return
bool. Simplify.
* tui/tui-disasm.h (struct tui_disasm_window) <set_contents>:
Return bool.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Return
bool.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_windows_with_addr)
(tui_update_source_windows_with_line): Call update_source_window.
* tui/tui-source.h (struct tui_source_window)
<show_symtab_source>: Don't declare.
* tui/tui-source.c (tui_source_window::show_symtab_source):
Remove.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_windows_with_addr): Call
update_source_window directly.
* tui/tui-disasm.h (tui_show_disassem): Don't declare.
* tui/tui-disasm.c (tui_show_disassem): Remove.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c
(tui_source_window_base::update_source_window_as_is): Don't switch focus.
* tui/tui-disasm.c (tui_show_disassem): Don't switch focus.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<maybe_update>: Remove line_no and addr parameters.
* tui/tui-stack.c (tui_show_frame_info): Set PC on sal. Update.
* tui/tui-source.h (struct tui_source_window) <maybe_update>:
Update.
* tui/tui-source.c (tui_source_window::maybe_update): Remove
line_no and addr parameters.
* tui/tui-disasm.h (struct tui_disasm_window) <maybe_update>:
Update.
* tui/tui-disasm.c (tui_disasm_window::maybe_update): Remove
line_no and addr parameters.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_source_window_base::set_is_exec_point_at)
(tui_source_window_base::update_breakpoint_info): Remove asserts.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_windows_with_addr): Call
tui_show_disassem.
* tui/tui-disasm.h (tui_show_disassem_and_update_source): Don't
declare.
* tui/tui-disasm.c (tui_show_disassem_and_update_source): Remove.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui.h (tui_show_source): Remove parameters.
* tui/tui.c (tui_show_source): Remove parameters.
* tui/tui-out.c (tui_ui_out::do_field_string): Update.
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_show_source): Update.
* tui/tui-winsource.c (tui_display_main): Update.
* tui/tui-stack.h (tui_update_locator_fullname): Change parameter
to symtab.
* tui/tui-stack.c (tui_update_locator_fullname): Change parameter
to symtab.
* tui/tui-disasm.c (tui_show_disassem_and_update_source): Update.
2019-12-20 Tom Tromey <tom@tromey.com>
PR tui/23619:
* tui/tui-io.c (tui_rl_saved_prompt): Remove.
(tui_redisplay_readline): Use rl_display_prompt.
(tui_prep_terminal): Update.
2019-12-19 Christian Biesinger <cbiesinger@google.com>
* configure: Regenerate.
* configure.ac: Quote variable arguments of test.
* gdbsupport/common.m4: Likewise.
2019-12-19 Christian Biesinger <cbiesinger@google.com>
* score-tdep.c (score7_analyze_prologue): Pass 2.0 instead of
2 to pow ().
2019-12-19 Christian Biesinger <cbiesinger@google.com>
* tui/tui-source.c (tui_source_window::set_contents): Cast argument of
log10 to double to fix Solaris 11 with gcc 5.5.
2019-12-19 Christian Biesinger <cbiesinger@google.com>
* fbsd-tdep.c (fbsd_info_proc_files_entry): Rename local var
"sun" to "saddr_un".
2019-12-19 Tom Tromey <tromey@adacore.com>
* ui-out.h (enum class field_kind): Fix comment.
2019-12-11 Tom Tromey <tromey@adacore.com>
* xml-support.c (xml_fetch_content_from_file): Use FOPEN_RB.
2019-12-18 Tom Tromey <tromey@adacore.com>
PR build/25268:
* gdbsupport/thread-pool.c (set_thread_name): Expect "int" return
type on macOS. Add comment.
2019-12-18 Simon Marchi <simon.marchi@efficios.com>
* c-lang.c (c_get_string, asm_language_defn): Remove space
before tab.
2019-12-18 Tom Tromey <tromey@adacore.com>
PR build/25250:
* ui-out.c (ui_out::vmessage): Update.
* ui-out.h (enum class field_kind) <FIELD_STRING, FIELD_SIGNED>:
Rename.
(string_field): Update.
(signed_field): Update.
2019-12-18 Simon Marchi <simon.marchi@efficios.com>
* top.c (print_gdb_configuration): Adjust indentation.
2019-12-17 Christian Biesinger <cbiesinger@google.com>
* bsd-kvm.c: Include gdbsupport/pathstuff.h.
Add virtual destructor to tui_layout_base I stumbled on some ASan failures when using the TUI, when tearing down a TUI layout. The simplest way to trigger it is to run: $ ./gdb --data-directory=data-directory -batch -ex "layout next" The ASan report is: ================================================================= ==2829136==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x608000009a20 in thread T0: object passed to delete has wrong type: size of the allocated type: 88 bytes; size of the deallocated type: 24 bytes. #0 0x7f470fe2507e in operator delete(void*, unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:177 #1 0x55f88c75700d in std::default_delete<tui_layout_base>::operator()(tui_layout_base*) const /usr/include/c++/9.2.0/bits/unique_ptr.h:81 #2 0x55f88c756328 in std::unique_ptr<tui_layout_base, std::default_delete<tui_layout_base> >::~unique_ptr() /usr/include/c++/9.2.0/bits/unique_ptr.h:284 #3 0x7f470ee536a6 in __run_exit_handlers (/usr/lib/libc.so.6+0x3e6a6) #4 0x7f470ee5385d in __GI_exit (/usr/lib/libc.so.6+0x3e85d) #5 0x55f88c69f2ac in quit_force(int*, int) /home/simark/src/binutils-gdb/gdb/top.c:1766 #6 0x55f88becc29a in captured_main_1 /home/simark/src/binutils-gdb/gdb/main.c:1183 #7 0x55f88becc814 in captured_main /home/simark/src/binutils-gdb/gdb/main.c:1192 #8 0x55f88becc8a9 in gdb_main(captured_main_args*) /home/simark/src/binutils-gdb/gdb/main.c:1217 #9 0x55f88b3159cd in main /home/simark/src/binutils-gdb/gdb/gdb.c:32 #10 0x7f470ee3c152 in __libc_start_main (/usr/lib/libc.so.6+0x27152) #11 0x55f88b31579d in _start (/home/simark/build/binutils-gdb/gdb/gdb+0x11fb79d) 0x608000009a20 is located 0 bytes inside of 88-byte region [0x608000009a20,0x608000009a78) allocated by thread T0 here: #0 0x7f470fe238f8 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:104 #1 0x55f88c750906 in tui_layout_split::clone() const /home/simark/src/binutils-gdb/gdb/tui/tui-layout.c:515 #2 0x55f88c74e60e in show_layout /home/simark/src/binutils-gdb/gdb/tui/tui-layout.c:90 #3 0x55f88c74e7db in tui_set_layout(tui_layout_type) /home/simark/src/binutils-gdb/gdb/tui/tui-layout.c:116 #4 0x55f88c782f4f in tui_enable() /home/simark/src/binutils-gdb/gdb/tui/tui.c:481 #5 0x55f88c74eeb2 in tui_layout_command /home/simark/src/binutils-gdb/gdb/tui/tui-layout.c:286 #6 0x55f88b6f969b in do_const_cfunc /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:107 #7 0x55f88b701859 in cmd_func(cmd_list_element*, char const*, int) /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:1952 #8 0x55f88c69b455 in execute_command(char const*, int) /home/simark/src/binutils-gdb/gdb/top.c:652 #9 0x55f88bec9026 in catch_command_errors /home/simark/src/binutils-gdb/gdb/main.c:400 #10 0x55f88becc1f2 in captured_main_1 /home/simark/src/binutils-gdb/gdb/main.c:1167 #11 0x55f88becc814 in captured_main /home/simark/src/binutils-gdb/gdb/main.c:1192 #12 0x55f88becc8a9 in gdb_main(captured_main_args*) /home/simark/src/binutils-gdb/gdb/main.c:1217 #13 0x55f88b3159cd in main /home/simark/src/binutils-gdb/gdb/gdb.c:32 #14 0x7f470ee3c152 in __libc_start_main (/usr/lib/libc.so.6+0x27152) The problem is that the tui_layout_base is missing a virtual destructor. We allocate a derived object (tui_layout_split), but delete it through a tui_layout_base pointer. Since the tui_layout_base destructor is not virtual, the derived (tui_layout_split) destructor is not called, only the base destructor. That code is not in gdb-9-branch, so I don't think this patch is relevant for the stable branch. Note that this is caught as a diagnostic with clang: In file included from /home/simark/src/binutils-gdb/gdb/tui/tui-layout.c:22: In file included from /home/simark/src/binutils-gdb/gdb/defs.h:28: In file included from /home/simark/src/binutils-gdb/gdb/gdbsupport/common-defs.h:133: In file included from /home/simark/src/binutils-gdb/gdb/gdbsupport/common-exceptions.h:25: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/memory:80: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/bits/unique_ptr.h:81:2: error: delete called on 'tui_layout_base' that is abstract but has non-virtual destructor [-Werror,-Wdelete-abstract-non-virtual-dtor] delete __ptr; ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/bits/unique_ptr.h:284:4: note: in instantiation of member function 'std::default_delete<tui_layout_base>::operator()' requested here get_deleter()(std::move(__ptr)); ^ /home/simark/src/binutils-gdb/gdb/tui/tui-layout.c:54:41: note: in instantiation of member function 'std::unique_ptr<tui_layout_base, std::default_delete<tui_layout_base> >::~unique_ptr' requested here static std::unique_ptr<tui_layout_base> applied_layout; ^ 1 error generated. GCC has the similar -Wdelete-non-virtual-dtor, enabled by -Wall, but it doesn't show up because warnings are inhibited for system headers, where std::unique_ptr is defined. There is a bug about it here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58876 gdb/ChangeLog: * tui/tui-layout.h (class tui_layout_base): Add virtual destructor.
2019-12-17 21:01:15 +01:00
2019-12-17 Simon Marchi <simon.marchi@polymtl.ca>
* tui/tui-layout.h (class tui_layout_base): Add virtual
destructor.
2019-12-16 Bernd Edlinger <bernd.edlinger@hotmail.de>
* infcmd.c (prepare_one_step): Step over skipped inline functions.
* infrun.c (inline_frame_is_marked_for_skip): New helper function.
(process_event_stop_test): Keep stepping over skipped inline functions.
2019-12-16 Simon Marchi <simon.marchi@polymtl.ca>
* jit.c (struct gdb_block) <next>: Remove field.
(struct gdb_symtab) <~gdb_symtab>: Remove.
<blocks>: Change type to std::forward_list<gdb_block>.
(compare_block): Remove.
(jit_block_open_impl): Adjust to std::forward_list. Place the new
block at the beginning, don't mind about sorting.
(finalize_symtab): Adjust to std::forward_list, sort the blocks list
before using it.
2019-12-16 Simon Marchi <simon.marchi@polymtl.ca>
* jit.c (struct gdb_block): Add constructor, initialize
real_block and next fields.
<name>: Change type to gdb::unique_xmalloc_ptr.
(struct gdb_symtab) <~gdb_symtab>: Free blocks with delete.
(jit_block_open_impl): Allocate gdb_block with new.
(finalize_symtab): Adjust to gdb::unique_xmalloc_ptr.
2019-12-16 Simon Marchi <simon.marchi@polymtl.ca>
* jit.c: Include forward_list.
(struct gdb_symtab) <next>: Remove field.
(struct gdb_object) <symtabs>: Change type to
std::forward_list<gdb_symtab>.
(jit_object_open_impl): Allocate gdb_object with new.
(jit_symtab_open_impl): Adjust to std::forward_list.
(finalize_symtab): Don't delete symtab.
(jit_object_close_impl): Adjust to std::forward_list. Free
gdb_object with delete.
2019-12-16 Simon Marchi <simon.marchi@polymtl.ca>
* jit.c (struct gdb_symtab): Add constructor, destructor,
initialize fields.
<linetable>: Change type to unique_xmalloc_ptr.
<file_name>: Change type to std::string.
(jit_symtab_open_impl): Allocate gdb_symtab with new.
(jit_symtab_line_mapping_add_impl): Adjust.
(finalize_symtab): Adjust, call delete on stab.
Fix double-free when creating more than one block in JIT debug info reader A double-free happens when using a JIT debug info reader that creates more than one block. In the loop that frees blocks in finalize_symtab, at the very end, the gdb_block_iter_tmp variable is set initially, but not changed as the loop advances. If we have two blocks, the first iteration frees the first block, the second iteration frees the second block, but the third iteration tries to free the second block again, as gdb_block_iter_tmp keeps pointing on the second block. Fix it by assigning the gdb_block_iter_tmp variable in the loop. I have improved the jit-reader.exp test to cover this case, by adding a second "JIT-ed" function and creating a block for it. I have renamed the existing function to something I find a bit more descriptive. There are no significant changes to jit-reader.exp itself, only updates following the renaming. The important changes are in jithost.c (generate a new function) and in jitreader.c (create a gdb_block for that function). This was found because of an ASan report: $ ./gdb testsuite/outputs/gdb.base/jit-reader/jit-reader -ex "jit-reader-load /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/jit-reader/jitreader.so" -ex r Reading symbols from testsuite/outputs/gdb.base/jit-reader/jit-reader... Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/jit-reader/jit-reader ================================================================= ==1751048==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000042eb8 at pc 0x5650ef8eec88 bp 0x7ffe52767290 sp 0x7ffe52767280 READ of size 8 at 0x604000042eb8 thread T0 #0 0x5650ef8eec87 in finalize_symtab /home/simark/src/binutils-gdb/gdb/jit.c:768 #1 0x5650ef8eef88 in jit_object_close_impl /home/simark/src/binutils-gdb/gdb/jit.c:797 #2 0x7fbbda986278 in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:71 #3 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850 #4 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948 #5 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396 #6 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470 [snip] 0x604000042eb8 is located 40 bytes inside of 48-byte region [0x604000042e90,0x604000042ec0) freed by thread T0 here: #0 0x7fbbe57376b0 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:122 #1 0x5650ef8f350b in xfree<gdb_block> /home/simark/src/binutils-gdb/gdb/gdbsupport/common-utils.h:62 #2 0x5650ef8eeca9 in finalize_symtab /home/simark/src/binutils-gdb/gdb/jit.c:769 #3 0x5650ef8eef88 in jit_object_close_impl /home/simark/src/binutils-gdb/gdb/jit.c:797 #4 0x7fbbda986278 in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:71 #5 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850 #6 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948 #7 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396 #8 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470 [snip] previously allocated by thread T0 here: #0 0x7fbbe5737cd8 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:153 #1 0x5650eef662f3 in xcalloc /home/simark/src/binutils-gdb/gdb/alloc.c:100 #2 0x5650ef8f34ea in xcnew<gdb_block> /home/simark/src/binutils-gdb/gdb/gdbsupport/poison.h:122 #3 0x5650ef8ed467 in jit_block_open_impl /home/simark/src/binutils-gdb/gdb/jit.c:557 #4 0x7fbbda98620a in read_debug_info /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jitreader.c:60 #5 0x5650ef8ef56b in jit_reader_try_read_symtab /home/simark/src/binutils-gdb/gdb/jit.c:850 #6 0x5650ef8effe3 in jit_register_code /home/simark/src/binutils-gdb/gdb/jit.c:948 #7 0x5650ef8f2c92 in jit_event_handler(gdbarch*) /home/simark/src/binutils-gdb/gdb/jit.c:1396 #8 0x5650ef0d137e in handle_jit_event /home/simark/src/binutils-gdb/gdb/breakpoint.c:5470 [snip] gdb/ChangeLog: * jit.c (finalize_symtab): Set gdb_block_iter_tmp in loop. gdb/testsuite/ChangeLog: * gdb.base/jit-reader.exp (jit_reader_test): Rename jit_function_00 to jit_function_stack_mangle. * gdb.base/jithost.c (jit_function_t): Rename to... (jit_function_stack_mangle_t): ... this. (jit_function_add_t): New typedef. (jit_function_00_code): Rename to... (jit_function_stack_mangle_code): ... this, make static. (jit_function_add_code): New. (main): Generate "add" function and call it. Adjust to changes in jithost_abi. * gdb.base/jithost.h (struct jithost_abi_bounds): New. (struct jithost_abi) <begin, end>: Remove fields. <object, function_stack_mangle, function_add>: New fields. * gdb.base/jitreader.c (struct reader_state) <code_begin, code_end>: Remove fields. <func_stack_mangle>: New field. (read_debug_info): Adjust to renaming, create block for "add" function. (read_sp, unwind_frame, get_frame_id): Adjust to other changes.
2019-12-16 22:30:49 +01:00
2019-12-16 Simon Marchi <simon.marchi@polymtl.ca>
* jit.c (finalize_symtab): Set gdb_block_iter_tmp in loop.
2019-12-16 Tom Tromey <tromey@adacore.com>
* windows-nat.c (windows_nat_target::attach): Update.
* remote.c (extended_remote_target::attach): Update.
* procfs.c (procfs_target::attach): Update.
* nto-procfs.c (nto_procfs_target::attach): Update.
(nto_procfs_target::create_inferior): Update.
* inf-ptrace.c (inf_ptrace_target::attach): Update.
* gnu-nat.c (gnu_nat_target::attach): Update.
(gnu_nat_target::detach): Update.
* darwin-nat.c (darwin_nat_target::attach): Update.
* corefile.c (get_exec_file): Constify result. Remove extraneous
return.
* bsd-kvm.c (bsd_kvm_target_open): Update.
* gdbsupport/common-inferior.h (get_exec_file): Constify result.
Update Gnulib to the latest git version This patch allows us to remove a workaround in common-defs.h due to the gnulib fix in: https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00024.html All of GDB's local Gnulib patches were already fixed upstream per their descriptions, so this patch removes them all. The problem listed here: https://sourceware.org/ml/gdb-patches/2019-08/msg00553.html was probably partially fixed by moving gnulib to the toplevel; for the remainder, I am setting MAKEOVERRIDES to empty in gnulib/Makefile.am. See also the comment there (it fixes an issue with compilers that don't use C99/C11 by default such as GCC 4.8.5, the default on Centos 7). gdb/ChangeLog: 2019-12-16 Christian Biesinger <cbiesinger@google.com> * gdbsupport/common-defs.h: Remove workaround for a gnulib bug (we no longer need to include time.h before pathmax.h) gnulib/ChangeLog: 2019-12-16 Christian Biesinger <cbiesinger@google.com> * Makefile.am: Set MAKEOVERRIDES. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * import/Makefile.am: Update. * import/Makefile.in: Regenerate. * import/_Noreturn.h: New file. * import/alloca.c (i00afunc): Update. * import/alloca.in.h (if): Update. * import/arg-nonnull.h: Rename from import/extra/snippet/arg-nonnull.h. * import/arpa_inet.in.h (if): Update. * import/assure.h: Update. * import/at-func.c: Update. * import/basename-lgpl.c: Update. * import/canonicalize-lgpl.c (if): Update. * import/c++defs.h: Rename from import/extra/snippet/c++defs.h. * import/cdefs.h: New file. * import/chdir-long.c: Update. * import/chdir-long.h: Update. * import/cloexec.c: Update. * import/cloexec.h: Update. * import/close.c: Update. * import/closedir.c: Update. * import/config.charset: Remove. * import/dirent-private.h: Update. * import/dirent.in.h: Update. * import/dirfd.c: Update. * import/dirname-lgpl.c: Update. * import/dirname.h (base_name): Update. * import/dosname.h (if): Update. * import/dup-safer-flag.c: New file. * import/dup-safer.c: Update. * import/dup.c: Update. * import/dup2.c (if): Update. (dup2_nothrow): Update. (ms_windows_dup2): Update. * import/errno.in.h (if): Update. (elif): Update. * import/error.c (if): Update. (strerror_r): Update. (program_name): Update. (error): Update. (error_at_line): Update. * import/error.h: Update. * import/exitfail.c: Update. * import/exitfail.h: Update. * import/extra/config.rpath: Update. * import/extra/snippet/_Noreturn.h: Remove. * import/extra/update-copyright: Update. * import/fchdir.c: Update. * import/fcntl.c (rpl_fcntl): Update. (INCL_DOS): Update. (if): Update. (rpl_fcntl_DUPFD): Update. (rpl_fcntl_DUPFD_CLOEXEC): Update. (klibc_fcntl): Update. (fcntl): Update. (have_dupfd_cloexec): Update. * import/fcntl.in.h (if): Update. (creat): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. (O_CLOEXEC): Update. (GNULIB_defined_O_CLOEXEC): Update. * import/fd-hook.c: Update. * import/fd-hook.h: Update. * import/fd-safer-flag.c: New file. * import/fd-safer.c: Update. * import/fdopendir.c: Update. * import/filename.h: Update. * import/filenamecat-lgpl.c (longest_relative_suffix): Update. (mfile_name_concat): Update. * import/filenamecat.h: Update. * import/flexmember.h: Update. * import/float+.h: Update. * import/float.c: Update. * import/float.in.h (LDBL_MIN): Update. * import/fnmatch.c (__builtin_expect): Update. (FALLTHROUGH): Update. * import/fnmatch.in.h (_FNMATCH_H): Update. (_): Update. (fnmatch): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. * import/fnmatch_loop.c (FCT): Update. (EXT): Update. * import/fpucw.h (GET_FPUCW): Update. (SET_FPUCW): Update. * import/frexp.c: Update. * import/frexpl.c: Update. * import/fstat.c (stat): Update. (fstat): Update. (WINDOWS_NATIVE): Update. (fstat_nothrow): Update. (WIN32_LEAN_AND_MEAN): Update. * import/fstatat.c (normal_fstatat): Update. (rpl_fstatat): Update. * import/getcwd-lgpl.c (rpl_getcwd): Update. * import/getcwd.c (getcwd_nothrow): Update. (getcwd_system): Update. (__getcwd): Update. * import/getdtablesize.c (if): Update. (_setmaxstdio): Update. (_setmaxstdio_nothrow): Update. (getdtablesize): Update. * import/getlogin_r.c (if): Update. (getlogin_r): Update. * import/getprogname.c (getprogname): Update. * import/getprogname.h: Update. * import/gettext.h (if): Update. * import/gettimeofday.c (WINDOWS_NATIVE): Update. (localtime): Update. (GetProcAddress): Update. (gmtime): Update. (void): Update. (struct tm): Update. (rpl_localtime): Update. (initialize): Update. (rpl_gmtime): Update. (tzset): Update. (rpl_tzset): Update. * import/glob-libc.h (_Restrict_): Update. (__size_t): Update. (__need_size_t): Update. (glob): Update. (globfree): Update. (__REDIRECT_NTH): Update. (glob64): Update. (globfree64): Update. (glob_pattern_p): Update. * import/glob.c (POSIX): Update. (if): Update. (__set_errno): Update. (getpwnam_r): Update. (__lstat64): Update. (FLEXIBLE_ARRAY_MEMBER): Update. (__glob_pattern_p): Update. (GETPW_R_SIZE_MAX): Update. (GET_LOGIN_NAME_MAX): Update. (DT_UNKNOWN): Update. (DT_DIR): Update. (DT_LNK): Update. (D_TYPE_TO_RESULT): Update. (readdir_result_might_be_symlink): Update. (readdir_result_might_be_dir): Update. (readdir_result_type): Update. (D_INO_TO_RESULT): Update. (READDIR_RESULT_INITIALIZER): Update. (attribute_hidden): Update. (__attribute_noinline__): Update. (__builtin_expect): Update. (__glibc_unlikely): Update. (__has_builtin): Update. (__glob_pattern_type): Update. (is_dir): Update. (glob): Update. (globfree): Update. (libc_hidden_def): Update. (DIRSEP_CHAR): Update. (prefix_array): Update. (weak_alias): Update. (link_exists2_p): Update. (link_exists_p): Update. (glob_in_dir): Update. (GLOBNAMES_MEMBERS): Update. * import/glob.in.h (_GL_GLOB_H): Update. (_): Update. (__BEGIN_DECLS): Update. (__END_DECLS): Update. (_Restrict_): Update. (__THROW): Update. (__THROWNL): Update. (__size_t): Update. (__USE_GNU): Update. (glob): Update. (globfree): Update. (glob_pattern_p): Update. (__glob_pattern_p): Update. (__GLOB_GNULIB): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_WARN_ON_USE): Update. * import/glob_internal.h: New file. * import/glob_pattern_p.c: New file. * import/globfree.c: New file. * import/glthread/lock.c (glthread_rwlock_init_for_glibc): Update. (glthread_rwlock_rdlock_multithreaded): Update. (glthread_once_call): Update. (glthread_once_multithreaded): Update. (glthread_once_singlethreaded): Update. (glthread_recursive_lock_init_multithreaded): Update. (glthread_recursive_lock_lock_multithreaded): Update. (glthread_recursive_lock_unlock_multithreaded): Update. (glthread_recursive_lock_destroy_multithreaded): Update. (glthread_lock_init_func): Update. (glthread_lock_lock_func): Update. (glthread_lock_unlock_func): Update. (glthread_lock_destroy_func): Update. (gl_waitqueue_t): Update. (gl_waitqueue_init): Update. (gl_waitqueue_add): Update. (gl_waitqueue_notify_first): Update. (gl_waitqueue_notify_all): Update. (glthread_rwlock_init_func): Update. (glthread_rwlock_rdlock_func): Update. (glthread_rwlock_wrlock_func): Update. (glthread_rwlock_unlock_func): Update. (glthread_rwlock_destroy_func): Update. (glthread_recursive_lock_init_func): Update. (glthread_recursive_lock_lock_func): Update. (glthread_recursive_lock_unlock_func): Update. (glthread_recursive_lock_destroy_func): Update. (glthread_once_func): Update. * import/glthread/lock.h (c11_threads_in_use): Update. (pthread_in_use): Update. (gl_rwlock_initializer): Update. (glthread_rwlock_init): Update. (glthread_rwlock_init_for_glibc): Update. (pth_in_use): Update. (gl_lock_define): Update. (gl_lock_define_initialized): Update. (gl_lock_initializer): Update. (glthread_lock_init): Update. (glthread_lock_lock): Update. (glthread_lock_unlock): Update. (glthread_lock_destroy): Update. (gl_rwlock_define): Update. (gl_rwlock_define_initialized): Update. (glthread_rwlock_rdlock): Update. (glthread_rwlock_wrlock): Update. (glthread_rwlock_unlock): Update. (glthread_rwlock_destroy): Update. (gl_recursive_lock_define): Update. (gl_recursive_lock_define_initialized): Update. (gl_recursive_lock_initializer): Update. (glthread_recursive_lock_init): Update. (glthread_recursive_lock_lock): Update. (glthread_recursive_lock_unlock): Update. (glthread_recursive_lock_destroy): Update. (gl_once_define): Update. (glthread_once): Update. (glthread_once_multithreaded): Update. (glthread_once_singlethreaded): Update. (thread_in_use): Update. (glthread_recursive_lock_init_multithreaded): Update. (glthread_recursive_lock_lock_multithreaded): Update. (glthread_recursive_lock_unlock_multithreaded): Update. (glthread_recursive_lock_destroy_multithreaded): Update. (glthread_lock_init_func): Update. (glthread_lock_lock_func): Update. (glthread_lock_unlock_func): Update. (glthread_lock_destroy_func): Update. (glthread_rwlock_init_func): Update. (glthread_rwlock_rdlock_func): Update. (glthread_rwlock_wrlock_func): Update. (glthread_rwlock_unlock_func): Update. (glthread_rwlock_destroy_func): Update. (glthread_recursive_lock_init_func): Update. (glthread_recursive_lock_lock_func): Update. (glthread_recursive_lock_unlock_func): Update. (glthread_recursive_lock_destroy_func): Update. (glthread_once_func): Update. * import/glthread/threadlib.c: Update. * import/hard-locale.c: Update. * import/hard-locale.h: Update. * import/inet_ntop.c: Update. * import/intprops.h (__has_builtin): Update. (_GL_INT_CONVERT): Update. (_GL_INT_NEGATE_CONVERT): Update. (verify): Update. (_GL_HAS_BUILTIN_OVERFLOW): Update. (_GL_HAS_BUILTIN_ADD_OVERFLOW): Update. (_GL_HAS_BUILTIN_OVERFLOW_P): Update. (_GL_HAS_BUILTIN_MUL_OVERFLOW): Update. (_GL_BINARY_OP_OVERFLOW): Update. (INT_ADD_WRAPV): Update. (INT_SUBTRACT_WRAPV): Update. (INT_MULTIPLY_WRAPV): Update. (_GL_INT_OP_WRAPV): Update. (_GL_INT_OP_WRAPV_SMALLISH): Update. (_GL_INT_OP_WRAPV_LONGISH): Update. (_GL_INT_OP_CALC): Update. (_GL_INT_OP_CALC1): Update. (_GL_INT_OP_WRAPV_VIA_UNSIGNED): Update. (_GL_INT_ADD_RANGE_OVERFLOW): Update. (_GL_INT_SUBTRACT_RANGE_OVERFLOW): Update. (_GL_INT_MULTIPLY_RANGE_OVERFLOW): Update. * import/inttypes.in.h (if): Update. * import/isnan.c: Update. * import/isnand-nolibm.h: Update. * import/isnand.c: Update. * import/isnanl-nolibm.h: Update. * import/isnanl.c: Update. * import/itold.c: Update. * import/libc-config.h: New file. * import/limits.in.h (LLONG_MIN): Update. (LLONG_MAX): Update. (ULLONG_MAX): Update. (WORD_BIT): Update. (LONG_BIT): Update. * import/localcharset.c (setlocale): Update. (relocate): Update. (O_NOFOLLOW): Update. (ISSLASH): Update. (DIRECTORY_SEPARATOR): Update. (getc): Update. (volatile): Update. (get_charset_aliases): Update. (struct table_entry): Update. (alias_table_defined): Update. (locale_table_defined): Update. (locale_charset): Update. (if): Update. * import/localcharset.h: Update. * import/localtime-buffer.c: New file. * import/localtime-buffer.h: New file. * import/lstat.c (rpl_lstat): Update. * import/m4/00gnulib.m4: Update. * import/m4/__inline.m4: New file. * import/m4/absolute-header.m4: Update. * import/m4/alloca.m4: Update. * import/m4/arpa_inet_h.m4: Update. * import/m4/builtin-expect.m4: New file. * import/m4/canonicalize.m4: Update. * import/m4/chdir-long.m4: Update. * import/m4/close.m4: Update. * import/m4/closedir.m4: Update. * import/m4/codeset.m4: Update. * import/m4/configmake.m4: Remove. * import/m4/d-ino.m4: Update. * import/m4/d-type.m4: Update. * import/m4/dirent_h.m4: Update. * import/m4/dirfd.m4: Update. * import/m4/dirname.m4: Update. * import/m4/double-slash-root.m4: Update. * import/m4/dup.m4: Update. * import/m4/dup2.m4: Update. * import/m4/eealloc.m4: Update. * import/m4/environ.m4: Update. * import/m4/errno_h.m4: Update. * import/m4/error.m4: Update. * import/m4/exponentd.m4: Update. * import/m4/exponentl.m4: Update. * import/m4/extensions.m4: Update. * import/m4/extern-inline.m4: Update. * import/m4/fchdir.m4: Update. * import/m4/fcntl-o.m4: Update. * import/m4/fcntl.m4: Update. * import/m4/fcntl_h.m4: Update. * import/m4/fdopendir.m4: Update. * import/m4/filenamecat.m4: Update. * import/m4/flexmember.m4: Update. * import/m4/float_h.m4: Update. * import/m4/fnmatch.m4: Update. * import/m4/fnmatch_h.m4: New file. * import/m4/fpieee.m4: Update. * import/m4/frexp.m4: Update. * import/m4/frexpl.m4: Update. * import/m4/fstat.m4: Update. * import/m4/fstatat.m4: Update. * import/m4/getcwd-abort-bug.m4: Update. * import/m4/getcwd-path-max.m4: Update. * import/m4/getcwd.m4: Update. * import/m4/getdtablesize.m4: Update. * import/m4/getlogin.m4: New file. * import/m4/getlogin_r.m4: Update. * import/m4/getpagesize.m4: New file. * import/m4/getprogname.m4: Update. * import/m4/gettimeofday.m4: Update. * import/m4/glibc21.m4: Remove. * import/m4/glob.m4: Update. * import/m4/glob_h.m4: New file. * import/m4/gnulib-cache.m4: Update. * import/m4/gnulib-common.m4: Update. * import/m4/gnulib-comp.m4: Update. * import/m4/gnulib-tool.m4: Update. * import/m4/hard-locale.m4: Remove. * import/m4/host-cpu-c-abi.m4: New file. * import/m4/include_next.m4: Update. * import/m4/inet_ntop.m4: Update. * import/m4/inttypes-pri.m4: Update. * import/m4/inttypes.m4: Update. * import/m4/isnand.m4: Update. * import/m4/isnanl.m4: Update. * import/m4/largefile.m4: Update. * import/m4/lib-ld.m4: Update. * import/m4/lib-link.m4: Update. * import/m4/lib-prefix.m4: Update. * import/m4/limits-h.m4: Update. * import/m4/localcharset.m4: Update. * import/m4/locale-fr.m4: Update. * import/m4/locale-ja.m4: Update. * import/m4/locale-zh.m4: Update. * import/m4/localtime-buffer.m4: New file. * import/m4/lock.m4: Update. * import/m4/longlong.m4: Update. * import/m4/lstat.m4: Update. * import/m4/malloc.m4: Update. * import/m4/malloca.m4: Update. * import/m4/math_h.m4: Update. * import/m4/mbrtowc.m4: Update. * import/m4/mbsinit.m4: Update. * import/m4/mbsrtowcs.m4: Update. * import/m4/mbstate_t.m4: Update. * import/m4/memchr.m4: Update. * import/m4/memmem.m4: Update. * import/m4/mempcpy.m4: Update. * import/m4/memrchr.m4: Update. * import/m4/mkdir.m4: Update. * import/m4/mkdtemp.m4: Update. * import/m4/mkostemp.m4: Update. * import/m4/mmap-anon.m4: Update. * import/m4/mode_t.m4: Update. * import/m4/msvc-inval.m4: Update. * import/m4/msvc-nothrow.m4: Update. * import/m4/multiarch.m4: Update. * import/m4/netinet_in_h.m4: Update. * import/m4/nocrash.m4: Update. * import/m4/off_t.m4: Update. * import/m4/onceonly.m4: Remove. * import/m4/open-cloexec.m4: New file. * import/m4/open-slash.m4: New file. * import/m4/open.m4: Update. * import/m4/openat.m4: Update. * import/m4/opendir.m4: Update. * import/m4/pathmax.m4: Update. * import/m4/pthread_rwlock_rdlock.m4: New file. * import/m4/rawmemchr.m4: Update. * import/m4/readdir.m4: Update. * import/m4/readlink.m4: Update. * import/m4/realloc.m4: Update. * import/m4/rename.m4: Update. * import/m4/rewinddir.m4: Update. * import/m4/rmdir.m4: Update. * import/m4/save-cwd.m4: Update. * import/m4/secure_getenv.m4: Remove. * import/m4/setenv.m4: Update. * import/m4/signal_h.m4: Update. * import/m4/socklen.m4: Update. * import/m4/sockpfaf.m4: Update. * import/m4/ssize_t.m4: Update. * import/m4/stat-time.m4: New file. * import/m4/stat.m4: Update. * import/m4/std-gnu11.m4: New file. * import/m4/stdalign.m4: Update. * import/m4/stdbool.m4: Update. * import/m4/stddef_h.m4: Update. * import/m4/stdint.m4: Update. * import/m4/stdio_h.m4: Update. * import/m4/stdlib_h.m4: Update. * import/m4/strchrnul.m4: Update. * import/m4/strdup.m4: Update. * import/m4/strerror.m4: Update. * import/m4/strerror_r.m4: Update. * import/m4/string_h.m4: Update. * import/m4/strstr.m4: Update. * import/m4/strtok_r.m4: Update. * import/m4/sys_socket_h.m4: Update. * import/m4/sys_stat_h.m4: Update. * import/m4/sys_time_h.m4: Update. * import/m4/sys_types_h.m4: Update. * import/m4/sys_uio_h.m4: Update. * import/m4/tempname.m4: Update. * import/m4/threadlib.m4: Update. * import/m4/time_h.m4: Update. * import/m4/time_r.m4: Update. * import/m4/unistd-safer.m4: Update. * import/m4/unistd_h.m4: Update. * import/m4/warn-on-use.m4: Update. * import/m4/wchar_h.m4: Update. * import/m4/wchar_t.m4: Update. * import/m4/wctype_h.m4: Update. * import/m4/wint_t.m4: Update. * import/malloc.c: Update. * import/malloc/scratch_buffer.h: New file. * import/malloc/scratch_buffer_grow.c: New file. * import/malloc/scratch_buffer_grow_preserve.c: New file. * import/malloc/scratch_buffer_set_array_size.c: New file. * import/malloca.c (MAGIC_NUMBER): Update. (MAGIC_SIZE): Update. (struct preliminary_header): Update. (HEADER_SIZE): Update. (union header): Update. (verify): Update. (HASH_TABLE_SIZE): Update. (freea): Update. * import/malloca.h (malloca): Update. (nmalloca): Update. * import/malloca.valgrind: Remove. * import/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Update. (func): Update. (rpl_func): Update. (f): Update. (d): Update. (l): Update. (_GL_WARN_ON_USE): Update. (_GL_WARN_ON_USE_ATTRIBUTE): Update. (FP_ILOGB0): Update. (FP_ILOGBNAN): Update. (acosf): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (asinf): Update. (atanf): Update. (atan2f): Update. (cosf): Update. (coshf): Update. (expf): Update. (expl): Update. (expm1l): Update. (ilogbl): Update. (rintl): Update. (sinf): Update. (sinhf): Update. (sqrtf): Update. (tanf): Update. (tanhf): Update. (isfinite): Update. (isinf): Update. (isnan): Update. (GNULIB_defined_signbit): Update. (signbit): Update. * import/mbrtowc.c (FALLTHROUGH): Update. (locale_enc): Update. (locale_enc_cached): Update. (gl_lock_define_initialized): Update. (mbrtowc): Update. * import/mbsinit.c (if): Update. (mbsinit): Update. * import/mbsrtowcs-impl.h: Update. * import/mbsrtowcs-state.c: Update. * import/mbsrtowcs.c: Update. * import/memchr.c: Update. * import/memchr.valgrind: Update. * import/memmem.c (__builtin_expect): Update. * import/mempcpy.c: Update. * import/memrchr.c (__memrchr): Update. * import/mkdir.c (if): Update. * import/mkdtemp.c: Update. * import/mkostemp.c: Update. * import/msvc-inval.c: Update. * import/msvc-inval.h: Update. * import/msvc-nothrow.c: Update. * import/msvc-nothrow.h (if): Update. * import/netinet_in.in.h: Update. * import/open.c (open): Update. (if): Update. * import/openat-die.c: Update. * import/openat-priv.h: Update. * import/openat-proc.c: Update. * import/openat.c (rpl_openat): Update. * import/openat.h: Update. * import/opendir.c: Update. * import/pathmax.h (if): Update. * import/pipe-safer.c: Update. * import/rawmemchr.c: Update. * import/rawmemchr.valgrind: Update. * import/readdir.c (readdir): Update. * import/readlink.c: Update. * import/realloc.c: Update. * import/ref-add.sin: Remove. * import/ref-del.sin: Remove. * import/rename.c (if): Update. * import/rewinddir.c: Update. * import/rmdir.c: Update. * import/same-inode.h (SAME_INODE): Update. * import/save-cwd.c (save_cwd): Update. * import/save-cwd.h: Update. * import/scratch_buffer.h: New file. * import/secure_getenv.c: Remove. * import/setenv.c: Update. * import/signal.in.h: Update. * import/stat-time.c: New file. * import/stat-time.h: New file. * import/stat-w32.c: New file. * import/stat-w32.h: New file. * import/stat.c (if): Update. (stat): Update. (REPLACE_FUNC_STAT_DIR): Update. (WINDOWS_NATIVE): Update. (WIN32_LEAN_AND_MEAN): Update. (is_unc_root): Update. (rpl_stat): Update. * import/stdalign.in.h (elif): Update. * import/stdbool.in.h: Update. * import/stddef.in.h (_GL_STDDEF_ALIGNAS): Update. (max_align_t): Update. (GNULIB_defined_max_align_t): Update. * import/stdint.in.h (WINT_MIN): Update. (WINT_MAX): Update. (_STDINT_MIN): Update. (_STDINT_UNSIGNED_MIN): Update. (_STDINT_SIGNED_MIN): Update. (PTRDIFF_MIN): Update. (SIG_ATOMIC_MIN): Update. (WCHAR_MIN): Update. * import/stdio.in.h (if): Update. * import/stdlib.in.h (if): Update. (_GL_WARN_ON_USE): Update. (_GL_FUNCDECL_SYS): Update. (random): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (srandom): Update. (initstate): Update. (setstate): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (GNULIB_defined_strtod_function): Update. (strtold): Update. (GNULIB_defined_strtold_function): Update. * import/str-two-way.h: Update. * import/strchrnul.c: Update. * import/strchrnul.valgrind: Update. * import/strdup.c: Update. * import/streq.h: Update. * import/strerror-override.c: Update. * import/strerror-override.h: Update. * import/strerror.c (strerror): Update. * import/strerror_r.c (safe_copy): Update. * import/string.in.h (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. * import/stripslash.c: Update. * import/strnlen1.c: Update. * import/strnlen1.h: Update. * import/strstr.c (__builtin_expect): Update. * import/strtok_r.c: Update. * import/sys_socket.in.h (CMSG_SPACE): Update. (CMSG_LEN): Update. (struct sockaddr_storage): Update. (SO_REUSEPORT): Update. (_GL_WARN_ON_USE): Update. * import/sys_stat.in.h (if): Update. (stat): Update. (struct stat): Update. (st_atime): Update. (st_mtime): Update. (st_ctime): Update. (_GL_WINDOWS_STAT_TIMESPEC): Update. (GNULIB_defined_struct_stat): Update. (_S_IFBLK): Update. (_S_IFLNK): Update. (_S_IFSOCK): Update. (fstat): Update. (fstatat): Update. (lstat): Update. (stat64): Update. (_stat64): Update. (_stat32i64): Update. (_stati64): Update. (_stat32): Update. (_stat64i32): Update. * import/sys_time.in.h: Update. * import/sys_types.in.h (dev_t): Update. (GNULIB_defined_dev_t): Update. (ino_t): Update. (GNULIB_defined_ino_t): Update. (_GL_WINDOWS_STAT_INODES): Update. (if): Update. * import/sys_uio.in.h: Update. * import/tempname.c (__secure_getenv): Update. (try_nocreate): Update. * import/tempname.h: Update. * import/time.in.h (tzset): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (ctime): Update. (strftime): Update. * import/time_r.c: Update. * import/unistd--.h: Update. * import/unistd-safer.h: Update. * import/unistd.in.h (if): Update. (elif): Update. (__need_getopt): Update. (access): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. (_GL_FUNCDECL_SYS): Update. (__declspec): Update. (_GL_WARN_ON_USE_ATTRIBUTE): Update. (faccessat): Update. (getpass): Update. (truncate): Update. * import/unsetenv.c: Update. * import/verify.h (if): Update. (_GL_HAVE__STATIC_ASSERT): Update. (_GL_HAVE_STATIC_ASSERT): Update. (_GL_HAVE__STATIC_ASSERT1): Update. (_GL_HAVE_STATIC_ASSERT1): Update. (_GL_VERIFY): Update. (_Static_assert): Update. (_GL_HAS_BUILTIN_TRAP): Update. (_GL_HAS_BUILTIN_UNREACHABLE): Update. (verify_true): Update. (verify): Update. (__has_builtin): Update. (elif): Update. (assume): Update. * import/warn-on-use.h: Rename from import/extra/snippet/warn-on-use.h. * import/wchar.in.h (if): Update. (wcsftime): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. * import/wctype.in.h (rpl_iswalnum): Update. (rpl_iswalpha): Update. (rpl_iswblank): Update. (rpl_iswcntrl): Update. (rpl_iswdigit): Update. (rpl_iswgraph): Update. (rpl_iswlower): Update. (rpl_iswprint): Update. (rpl_iswpunct): Update. (rpl_iswspace): Update. (rpl_iswupper): Update. (rpl_iswxdigit): Update. (rpl_towlower): Update. (rpl_towupper): Update. (iswalnum): Update. (iswalpha): Update. (iswblank): Update. (iswcntrl): Update. (iswdigit): Update. (iswgraph): Update. (iswlower): Update. (iswprint): Update. (iswpunct): Update. (iswspace): Update. (iswupper): Update. (iswxdigit): Update. (towlower): Update. (towupper): Update. * import/windows-initguard.h: New file. * import/windows-mutex.c: New file. * import/windows-mutex.h: New file. * import/windows-once.c: New file. * import/windows-once.h: New file. * import/windows-recmutex.c: New file. * import/windows-recmutex.h: New file. * import/windows-rwlock.c: New file. * import/windows-rwlock.h: New file. * import/xalloc-oversized.h: New file. * patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch: Remove. * patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch: Remove. * patches/0003-Fix-glob-c-Coverity-issues.patch: Remove. * update-gnulib.sh: Update to latest gnulib and don't apply patches anymore. Also updates the patch -p flag to the current directory structure in case patches are needed again in the future. Change-Id: I9c2b07a3046baecfb664e21b2644353ea888dbfa
2019-11-17 06:37:06 +01:00
2019-12-16 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/common-defs.h: Remove workaround for a gnulib bug
(we no longer need to include time.h before pathmax.h)
2019-12-15 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y (write_ambiguous_var): Update.
* coffread.c (process_coff_symbol): Update.
* ctfread.c (ctf_add_enum_member_cb): Update.
(new_symbol): Update.
* dwarf2read.c (fixup_go_packaging): Update.
(new_symbol): Update.
* language.c (language_alloc_type_symbol): Update.
* mdebugread.c (new_symbol): Update.
* minsyms.c (minimal_symbol_reader::record_full): Update.
* psymtab.c (add_psymbol_to_bcache): Update.
* stabsread.c (define_symbol): Update.
(read_enum_type): Update.
* symtab.c (symbol_set_language): Make this a member function...
(general_symbol_info::set_language): ... here.
* symtab.h (struct general_symbol_info) <set_language>: New function.
(SYMBOL_SET_LANGUAGE): Remove.
(symbol_set_language): Remove.
Use an accessor function for general_symbol_info::language Also renames the member variable to m_language to make code easier to read when more functions become member functions. I was originally hoping to eventually make m_language private (after a few more patches), but unfortunately then it no longer counts as a POD type, which means gdbsupport/poison.h won't let us use memset to initialize this type, which psymtabs rely on to clear padding bytes so that bcache can work properly. gdb/ChangeLog: 2019-12-15 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. * ax-gdb.c (gen_expr): Update. * block.c (block_lookup_symbol): Update. (block_lookup_symbol_primary): Update. (block_find_symbol): Update. * cp-namespace.c (cp_lookup_symbol_imports_or_template): Update. * dbxread.c (process_one_symbol): Update. * dictionary.c (insert_symbol_hashed): Update. (collate_pending_symbols_by_language): Update. (mdict_add_symbol): Update. * dwarf-index-write.c (write_psymbols): Update. * dwarf2read.c (fixup_go_packaging): Update. * findvar.c (read_var_value): Update. * ft32-tdep.c (ft32_skip_prologue): Update. * go-lang.c (go_symbol_package_name): Update. * language.h (scoped_switch_to_sym_language_if_auto:: scoped_switch_to_sym_language_if_auto): Update. * linespec.c (find_method): Update. (find_label_symbols_in_block): Update. * mdebugread.c (parse_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. * minsyms.c (add_minsym_to_demangled_hash_table): Update. (minimal_symbol_reader::install): Update. * moxie-tdep.c (moxie_skip_prologue): Update. * parse.c (parse_exp_in_context): Update. * psymtab.c (psymbol_name_matches): Update. (match_partial_symbol): Update. (lookup_partial_symbol): Update. (psymbol_hash): Update. (psymbol_compare): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * stabsread.c (define_symbol): Update. * stack.c (print_frame_arg): Update. (find_frame_funname): Update. (info_frame_command_core): Update. * symfile.c (set_initial_language): Update. * symtab.c (symbol_set_demangled_name): Update. (symbol_get_demangled_name): Update. (symbol_set_language): Update. (symbol_find_demangled_name): Update. (symbol_set_names): Update. (general_symbol_info::natural_name): Update. (general_symbol_info::demangled_name): Update. (general_symbol_info::search_name): Update. (symbol_matches_search_name): Update. (eq_symbol_entry): Update. (iterate_over_symbols): Update. (completion_list_add_symbol): Update. (completion_list_add_msymbol): Update. (completion_list_add_fields): Update. * symtab.h (struct general_symbol_info) <language>: New function. <language>: Rename to... <m_language>: ...this. (SYMBOL_LANGUAGE): Remove. (MSYMBOL_LANGUAGE): Remove. (struct symbol) <ctor>: Update. * xstormy16-tdep.c (xstormy16_skip_prologue): Update. Change-Id: I6464d477457e61639c63ddf8b145e407a35c235a
2019-12-04 00:10:32 +01:00
2019-12-15 Christian Biesinger <cbiesinger@google.com>
* ada-lang.c (ada_add_block_symbols): Update.
(ada_collect_symbol_completion_matches): Update.
* ax-gdb.c (gen_expr): Update.
* block.c (block_lookup_symbol): Update.
(block_lookup_symbol_primary): Update.
(block_find_symbol): Update.
* cp-namespace.c (cp_lookup_symbol_imports_or_template): Update.
* dbxread.c (process_one_symbol): Update.
* dictionary.c (insert_symbol_hashed): Update.
(collate_pending_symbols_by_language): Update.
(mdict_add_symbol): Update.
* dwarf-index-write.c (write_psymbols): Update.
* dwarf2read.c (fixup_go_packaging): Update.
* findvar.c (read_var_value): Update.
* ft32-tdep.c (ft32_skip_prologue): Update.
* go-lang.c (go_symbol_package_name): Update.
* language.h (scoped_switch_to_sym_language_if_auto::
scoped_switch_to_sym_language_if_auto): Update.
* linespec.c (find_method): Update.
(find_label_symbols_in_block): Update.
* mdebugread.c (parse_symbol): Update.
* mi/mi-cmd-stack.c (list_arg_or_local): Update.
* minsyms.c (add_minsym_to_demangled_hash_table): Update.
(minimal_symbol_reader::install): Update.
* moxie-tdep.c (moxie_skip_prologue): Update.
* parse.c (parse_exp_in_context): Update.
* psymtab.c (psymbol_name_matches): Update.
(match_partial_symbol): Update.
(lookup_partial_symbol): Update.
(psymbol_hash): Update.
(psymbol_compare): Update.
* python/py-framefilter.c (extract_sym): Update.
(py_print_single_arg): Update.
* stabsread.c (define_symbol): Update.
* stack.c (print_frame_arg): Update.
(find_frame_funname): Update.
(info_frame_command_core): Update.
* symfile.c (set_initial_language): Update.
* symtab.c (symbol_set_demangled_name): Update.
(symbol_get_demangled_name): Update.
(symbol_set_language): Update.
(symbol_find_demangled_name): Update.
(symbol_set_names): Update.
(general_symbol_info::natural_name): Update.
(general_symbol_info::demangled_name): Update.
(general_symbol_info::search_name): Update.
(symbol_matches_search_name): Update.
(eq_symbol_entry): Update.
(iterate_over_symbols): Update.
(completion_list_add_symbol): Update.
(completion_list_add_msymbol): Update.
(completion_list_add_fields): Update.
* symtab.h (struct general_symbol_info) <language>: New function.
<language>: Rename to...
<m_language>: ...this.
(SYMBOL_LANGUAGE): Remove.
(MSYMBOL_LANGUAGE): Remove.
(struct symbol) <ctor>: Update.
* xstormy16-tdep.c (xstormy16_skip_prologue): Update.
2019-12-15 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y (write_ambiguous_var): Call symbol_set_language to
set the language of sym.
* language.c (language_alloc_type_symbol): Likewise.
Guard against 'current_directory == NULL' on gdb_abspath (PR gdb/23613) Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1728147 Ref.: https://sourceware.org/bugzilla/show_bug.cgi?id=23613 Hi, This bug has been reported against Fedora GDB, but there's also an upstream bug. The problem reported is that GDB segfaults when the working directory is deleted. It's pretty use to reproduce it: mkdir bla cd bla rmdir ../bla gdb echo Debugging the problem is a bit tricky, because, since the current directory doesn't exist anymore, a corefile cannot be saved there. After a few attempts, I came up with the following: gdb -ex 'shell mkdir bla' -ex 'cd bla' -ex 'shell rmdir ../bla' -ex 'r echo' ./gdb/gdb This assumes that you're inside a build directory which contains ./gdb/gdb, of course. After investigating it, I found that the problem happens at gdb_abspath, where we're dereferencing 'current_directory' without checking if it's NULL: ... (concat (current_directory, IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) ? "" : SLASH_STRING, ... So I fixed the problem with the patch below. The idea is that, if 'current_directory' is NULL, then the final string returned should be just the "path". After fixing the bug, I found a similar one reported against our bugzilla: PR gdb/23613. The problem is the same, but the reproducer is a bit different. I really tried writing a testcase for this, but unfortunately it's apparently not possible to start GDB inside a non-existent directory with DejaGNU. I regression tested this patch on the BuildBot, and no regressions were found. gdb/ChangeLog: 2019-12-14 Sergio Durigan Junior <sergiodj@redhat.com> https://bugzilla.redhat.com/show_bug.cgi?id=1728147 PR gdb/23613 * bsd-kvm.c (bsd_kvm_target_open): Use 'gdb_abspath'. * corelow.c: Include 'gdbsupport/pathstuff.h'. (core_target_open): Use 'gdb_abspath'. * gdbsupport/pathstuff.c (gdb_abspath): Guard against 'current_directory == NULL' case. * gdbsupport/pathstuff.h (gdb_abspath): Expand comment and explain what happens when 'current_directory' is NULL. * go32-nat.c (go32_nat_target::wait): Check if 'current_directory' is NULL before call to 'chdir'. * source.c (add_path): Use 'gdb_abspath'. * top.c: Include 'gdbsupport/pathstuff.h'. (init_history): Use 'gdb_abspath'. (set_history_filename): Likewise. * tracefile-tfile.c: Include 'gdbsupport/pathstuff.h'. (tfile_target_open): Use 'gdb_abspath'. Change-Id: Ibb0932fa25bc5c2d3ae4a7f64bd7f32885ca403b
2019-07-10 22:18:27 +02:00
2019-12-14 Sergio Durigan Junior <sergiodj@redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1728147
PR gdb/23613
* bsd-kvm.c (bsd_kvm_target_open): Use 'gdb_abspath'.
* corelow.c: Include 'gdbsupport/pathstuff.h'.
(core_target_open): Use 'gdb_abspath'.
* gdbsupport/pathstuff.c (gdb_abspath): Guard against
'current_directory == NULL' case.
* gdbsupport/pathstuff.h (gdb_abspath): Expand comment and
explain what happens when 'current_directory' is NULL.
* go32-nat.c (go32_nat_target::wait): Check if
'current_directory' is NULL before call to 'chdir'.
* source.c (add_path): Use 'gdb_abspath'.
* top.c: Include 'gdbsupport/pathstuff.h'.
(init_history): Use 'gdb_abspath'.
(set_history_filename): Likewise.
* tracefile-tfile.c: Include 'gdbsupport/pathstuff.h'.
(tfile_target_open): Use 'gdb_abspath'.
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Remove check for multiple calls to
warning or error.
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Remove call to "fix" for "long long".
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Handle -Wno- prefix.
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh (usage): Use GNU style.
2019-12-13 Tom Tromey <tromey@adacore.com>
* gdbsupport/common-utils.c (string_printf, string_vprintf)
(string_vappendf): Add ARI comment.
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Remove "fix" call for
floatformat_to_double.
* target-float.c (host_float_ops<T>::from_target): Add ARI
comment.
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Remove "fix" call for abort.
* utils.c (abort_with_message, dump_core, internal_vproblem): Add
ARI marker to abort.
* event-top.c (handle_sigsegv): Add ARI marker to abort.
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Fix floatformat_from_double text.
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Remove ATTRIBUTE_UNUSED check.
2019-12-13 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Remove "boolean" and "var_boolean"
checks.
2019-12-13 Tom Tromey <tromey@adacore.com>
* gdbsupport/safe-iterator.h (class basic_safe_range) <begin,
end>: No longer "const".
2019-12-13 Simon Marchi <simon.marchi@polymtl.ca>
* jit.c: Fix indentation, replace spaces with tabs where
applicable.
2019-12-13 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* configure.tgt: Match msp430-*-elf* targets when configuring GDB.
2019-12-12 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile) <partial_symtabs>: Now a
unique_ptr.
2019-12-12 Tom Tromey <tom@tromey.com>
* progspace.h (objfile_list): New typedef.
(class unwrapping_objfile_iterator)
(struct unwrapping_objfile_range): Newl
(struct program_space) <objfiles_range>: Change type.
<objfiles>: Change return type.
<add_objfile>: Change type of "objfile" parameter.
<objfiles_list>: Now a list of shared_ptr.
* progspace.c (program_space::add_objfile): Change type of
"objfile". Update.
(program_space::remove_objfile): Update.
* objfiles.h (struct objfile) <~objfile>: Make public.
* objfiles.c (objfile::make): Update.
(objfile::unlink): Don't call delete.
2019-12-12 Tom Tromey <tom@tromey.com>
* symfile.c (symbol_file_clear): Update.
* progspace.h (struct program_space) <free_all_objfiles>: Declare
method.
* progspace.c (program_space::free_all_objfiles): New method.
* objfiles.h (free_all_objfiles): Don't declare.
* objfiles.c (free_all_objfiles): Move to program_space.
2019-12-12 Tom Tromey <tom@tromey.com>
* progspace.c (program_space::add_objfile)
(program_space::remove_objfile): Update.
(program_space::multi_objfile_p): Remove.
* objfiles.h (struct objfile) <next>: Remove.
* objfiles.c (objfile::objfile): Update.
(put_objfile_before): Update.
(unlink_objfile): Update.
* progspace.h (object_files): Remove.
(struct program_space) <objfiles_head>: Remove.
<objfiles_list>: New member.
<objfiles_range, objfiles_safe_range>: Change type.
(objfiles): Change return type.
(objfiles_safe): Update.
(multi_objfile_p): Rewrite and inline.
(object_files): Remove macro.
2019-12-12 Tom Tromey <tom@tromey.com>
* gdbsupport/safe-iterator.h (basic_safe_iterator): Simplify. Add
second constructor.
(basic_safe_range): New class.
2019-12-12 Tom Tromey <tom@tromey.com>
* progspace.c (program_space::multi_objfile_p): New method.
* printcmd.c (info_symbol_command): Update.
* maint.c (maintenance_translate_address): Update.
* objfiles.h (MULTI_OBJFILE_P): Remove.
* progspace.h (struct program_space) <multi_objfile_p>: New
method.
2019-12-12 Tom Tromey <tom@tromey.com>
* progspace.h (struct program_space) <remove_objfile>: Declare.
* progspace.c (program_space::remove_objfile): New method.
* objfiles.c (unlink_objfile): Remove.
(objfile::unlink): Call remove_objfile.
(objfile): Don't call unlink_objfile.
2019-12-12 Tom Tromey <tom@tromey.com>
* progspace.h (struct program_space) <add_objfile>: Declare
method.
* progspace.c (program_space::add_objfile): New method.
* objfiles.c (~objfile): Don't unlink objfile.
(put_objfile_before): Remove.
(add_separate_debug_objfile): Don't call put_objfile_before.
(objfile::make): Call add_objfile. Set new_objfiles_available on
the per-program-space data.
2019-12-12 Tom Tromey <tom@tromey.com>
* symfile.c (syms_from_objfile_1): Use objfile_up.
(syms_from_objfile_1, remove_symbol_file_command): Call unlink
method.
(reread_symbols): Use objfile_up.
* solib.c (update_solib_list, reload_shared_libraries_1): Call
unlink method.
* objfiles.h (struct objfile) <~objfile>: Now private.
<unlink>: New method.
(struct objfile_deleter): New.
(objfile_up): New typedef.
* objfiles.c (objfile::unlink): New method.
(free_objfile_separate_debug, free_all_objfiles)
(objfile_purge_solibs): Use it.
* jit.c (jit_unregister_code): Remove.
(jit_inferior_exit_hook, jit_event_handler): Call unlink on
objfile.
* compile/compile-object-run.c (do_module_cleanup): Call unlink on
objfile.
* compile/compile-object-load.c (compile_object_load): Use
objfile_up.
2019-12-12 Tom Tromey <tom@tromey.com>
* symfile.c (symbol_file_add_with_addrs): Pass "parent" to
objfile::make.
* objfiles.h (struct objjfile) <make>: No longer inline.
(add_separate_debug_objfile): Don't declare.
* objfiles.c (add_separate_debug_objfile): Now static.
(objfile::make): Move from objfiles.h. Call
add_separate_debug_objfile. Add "parent" parameter.
2019-12-12 Tom Tromey <tom@tromey.com>
* symfile.c (symbol_file_add_with_addrs): Use objfile::make.
* objfiles.h (struct objfile): Make constructor private.
<make>: New static method.
* jit.c (jit_object_close_impl): Update.
2019-12-12 Simon Marchi <simon.marchi@polymtl.ca>
* jit.c (jit_reader_try_read_symtab): Replace xmalloc/xfree with
gdb::byte_vector.
2019-12-12 Tom Tromey <tromey@adacore.com>
* xml-support.c (xml_fetch_content_from_file): Don't call
malloc_failure.
* utils.h (class gdb_argv): Remove malloc_failure comment.
* utils.c (gdb_argv::reset): Don't call malloc_failure.
2019-12-12 Tom Tromey <tromey@adacore.com>
* Makefile.in (ALL_TARGET_OBS): Add riscv-ravenscar-thread.o.
(HFILES_NO_SRCDIR): Add riscv-ravenscar-thread.h.
(ALLDEPFILES): Add riscv-ravenscar-thread.c.
* configure.tgt (riscv-*-*): Add riscv-ravenscar-thread.o.
* riscv-ravenscar-thread.c: New file.
* riscv-ravenscar-thread.h: New file.
* riscv-tdep.c (riscv_gdbarch_init): Call
register_riscv_ravenscar_ops.
2019-12-12 Tom Tromey <tromey@adacore.com>
* gdbsupport/thread-pool.c (set_thread_name): Use
ATTRIBUTE_UNUSED.
2019-12-12 Luis Machado <luis.machado@linaro.org>
* gdbsupport/safe-strerror.c: Don't include diagnostics.h.
(select_strerror_r): Use ATTRIBUTE_UNUSED instead of the diagnostics
macros.
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_set_win_height_command): Call
tui_adjust_window_height.
(tui_adjust_win_heights, new_height_ok): Remove.
* tui/tui-layout.h (tui_adjust_window_height): Declare.
* tui/tui-layout.c (tui_adjust_window_height): New function.
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_resize_all): Remove code, call
tui_apply_current_layout.
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-layout.h (tui_apply_current_layout): Declare.
* tui/tui-layout.c (standard_layouts, applied_layout): New
globals.
(tui_apply_current_layout): New function.
(show_layout): Set applied_layout. Call
tui_apply_current_layout.
(show_source_command, show_disasm_command)
(show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Remove.
(initialize_layouts): New function.
(_initialize_tui_layout): Call initialize_layouts.
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-layout.h (class tui_layout_base)
(class tui_layout_window, class tui_layout_split): New.
* tui/tui-layout.c (tui_get_window_by_name)
(tui_layout_window::clone, tui_layout_window::apply)
(tui_layout_window::get_sizes, tui_layout_window::add_split)
(tui_layout_split::add_window, tui_layout_split::clone)
(tui_layout_split::get_sizes)
(tui_layout_split::set_weights_from_heights)
(tui_layout_split::adjust_size, tui_layout_split::apply): New
functions.
(tui_layout_split::add_split, tui_layout_split::add_split)
(tui_layout_split::set_weights_from_heights)
(tui_layout_split::set_weights_from_heights): New functions.
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_gen_win_info::make_window): Update.
* tui/tui-win.c (tui_adjust_win_heights, tui_resize_all): Update.
* tui/tui-layout.c (tui_gen_win_info::resize): Update.
* tui/tui-data.h (struct tui_point): Remove.
(struct tui_gen_win_info) <origin>: Remove.
<x, y>: New fields.
* tui/tui-command.c (tui_cmd_window::resize): Update.
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-stack.h (struct tui_locator_window) <min_height>:
Implement.
* tui/tui-regs.h (struct tui_data_item_window) <min_height>:
Implement.
* tui/tui-data.h (struct tui_gen_win_info) <min_height>: New
method.
(struct tui_win_info) <min_height>: Implement.
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_gen_win_info) <can_box>: New method.
(struct tui_win_info) <can_box>: Update.
2019-12-11 Tom Tromey <tom@tromey.com>
* tui/tui-stack.h (struct tui_locator_window) <max_height>: New
method.
* tui/tui-regs.h (struct tui_data_item_window) <max_height>: New
method.
* tui/tui-data.h (struct tui_gen_win_info) <max_height>: New
method.
(struct tui_win_info) <max_height>: Now override.
2019-12-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.
2019-12-11 Joel Brobecker <brobecker@adacore.com>
GDB 9 branch created (27f7b2f64062ac9e52afc60509263c2702a9ebd0):
* version.in: Bump version to 10.0.50.DATE-git.
2019-12-11 Tom Tromey <tromey@adacore.com>
PR build/25268:
* gdbsupport/thread-pool.c (set_thread_name): New function.
(thread_pool::set_thread_count): Don't call pthread_setname_np.
(thread_pool::thread_function): Call set_thread_name.
2019-12-11 Tom Tromey <tromey@adacore.com>
* fbsd-tdep.c (fbsd_core_info_proc_status): Cast result of
bfd_get_signed_8.
2019-08-07 20:50:54 +02:00
2019-12-11 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Document -raw-values option and the related setting commands.
* printcmd.c (print_command_parse_format): Do not set opts->raw off,
only set it on when /r is given.
* valprint.c (value_print_option_defs): New element raw-values.
* Makefile.in: Add the new file.
2019-12-10 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/safe-strerror.c: Supress the unused function warning
for select_strerror_r.
2019-12-10 Christian Biesinger <cbiesinger@google.com>
* config.in: Regenerate.
* configure: Regenerate.
* gdbsupport/agent.c (gdb_connect_sync_socket): Call
safe_strerror instead of strerror.
* gdbsupport/common.m4: Don't check for strerror.
* gdbsupport/safe-strerror.c: Support both the glibc version
of strerror_r and the XSI version.
2019-12-10 Tom Tromey <tromey@adacore.com>
* ada-typeprint.c (print_choices): Use a single "?".
(print_variant_part): Print "?" if the discriminant name
is not known.
Fix scripted probe breakpoints The documentation for make-breakpoint from the Guile API and the `spec' variant of the gdb.Breakpoint constructor from the Python API state that the format acceptable for location strings is the same as that accepted by the break command. However, using the -probe qualifier at the beginning of the location string causes a GDB internal error as it attempts to decode a probe location in the wrong code path. Without this functionality, there doesn't appear to be another way to set breakpoints on probe points from Python or Guile scripts. This patch introduces a new helper function that returns a breakpoint_ops instance appropriate for a parsed location and updates the Guile and Python bindings to use said function, rather than the current hard-coded use of bkpt_breakpoint_ops. Since this logic is duplicated in the handling of the `break' and `trace' commands, those are also updated to call into the new helper function. gdb/ChangeLog: 2019-12-10 George Barrett <bob@bob131.so> Fix scripted probe breakpoints. * breakpoint.c (tracepoint_probe_breakpoint_ops): Move declaration forward. (breakpoint_ops_for_event_location_type) (breakpoint_ops_for_event_location): Add function definitions. (break_command_1, trace_command): Use breakpoint_ops_for_event_location. * breakpoint.h (breakpoint_ops_for_event_location): Add function declarations. * guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Use breakpoint_ops_for_event_location. * python/py-breakpoint.c (bppy_init): Use breakpoint_ops_for_event_location. gdb/testsuite/ChangeLog: 2019-12-10 George Barrett <bob@bob131.so> Test scripted probe breakpoints. * gdb.guile/scm-breakpoint.c (main): Add probe point. * gdb.python/py-breakpoint.c (main): Likewise. * gdb.guile/scm-breakpoint.exp (test_bkpt_probe): Add probe specifier test. * gdb.python/py-breakpoint.exp (test_bkpt_probe): Likewise.
2019-12-09 22:28:39 +01:00
2019-12-10 George Barrett <bob@bob131.so>
Fix scripted probe breakpoints.
* breakpoint.c (tracepoint_probe_breakpoint_ops): Move
declaration forward.
(breakpoint_ops_for_event_location_type)
(breakpoint_ops_for_event_location): Add function definitions.
(break_command_1, trace_command): Use
breakpoint_ops_for_event_location.
* breakpoint.h (breakpoint_ops_for_event_location): Add function
declarations.
* guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Use
breakpoint_ops_for_event_location.
* python/py-breakpoint.c (bppy_init): Use
breakpoint_ops_for_event_location.
2019-12-09 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* gdbtypes.c (rank_one_type): Return INCOMPATIBLE_TYPE_BADNESS
when ranking an lvalue argument for an rvalue parameter.
gdb/darwin-nat.c: Fix template argument for scoped_restore_tmpl This should be the type of startup_with_shell, whose type was changed from int to bool at commit 80fd28264. This fixes the build on macOS: CXX darwin-nat.o In file included from ../../gdb/darwin-nat.c:22: In file included from ../../gdb/top.h:25: In file included from ../../gdb/value.h:23: In file included from ../../gdb/frame.h:72: In file included from ../../gdb/language.h:26: In file included from ../../gdb/symtab.h:33: ../../gdb/gdbsupport/gdb_optional.h:155:19: error: no matching constructor for initialization of 'scoped_restore_tmpl<int>' new (&m_item) T (std::forward<Args>(args)...); ^ ~~~~~~~~~~~~~~~~~~~~~~~~ ../../gdb/darwin-nat.c:1995:31: note: in instantiation of function template specialization 'gdb::optional<scoped_restore_tmpl<int> >::emplace<bool *, int>' requested here restore_startup_with_shell.emplace (&startup_with_shell, 0); ^ ../../gdb/gdbsupport/scoped_restore.h:69:3: note: candidate constructor template not viable: no known conversion from 'bool *' to 'int *' for 1st argument scoped_restore_tmpl (T *var, T2 value) ^ ../../gdb/gdbsupport/scoped_restore.h:57:3: note: candidate constructor not viable: requires single argument 'var', but 2 arguments were provided scoped_restore_tmpl (T *var) ^ ../../gdb/gdbsupport/scoped_restore.h:76:3: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided scoped_restore_tmpl (const scoped_restore_tmpl<T> &other) ^ 1 error generated. gdb/ChangeLog 2019-12-08 Wataru Ashihara <wataash@wataash.com> * darwin-nat.c (darwin_nat_target::create_inferior): Fix template argument for scoped_restore_tmpl from bool to int. Change-Id: Ia0202efd34dbce69b6af5d035fa55ed89215138a
2019-12-08 09:00:43 +01:00
2019-12-08 Wataru Ashihara <wataash@wataash.com>
* darwin-nat.c (darwin_nat_target::create_inferior): Fix
template argument for scoped_restore_tmpl from bool to int.
Core file build-id support This patch uses new BFD support for detecting build-ids in core files. After this patch, it is possible to run gdb with only the core file, and gdb will automatically load the executable and debug info [example from tests]: $ gdb -nx -q (gdb) core-file corefile-buildid.core [New LWP 29471] Reading symbols from gdb.base/corefile-buildid/debugdir-exec/.build-id/36/fe5722c5a7ca3ac746a84e223c6a2a69193a24... Core was generated by `outputs/gdb.base/coref'. Program terminated with signal SIGABRT, Aborted. (gdb) This work is based on functionality available in Fedora originally written by Jan Kratochvil. Regression tested on buildbot. gdb/ChangeLog: 2019-12-07 Keith Seitz <keiths@redhat.com> * build-id.c (build_id_bfd_get): Permit bfd_core, too. (build_id_to_debug_bfd): Make static, rewriting to use build_id_to_bfd_suffix. (build_id_to_bfd_suffix): Copy of build_id_to_debug_bfd, adding `suffix' parameter. Append SUFFIX to file names when searching for matching files. (build_id_to_debug_bfd): Use build_id_to_bfd_suffix. (build_id_to_exec_bfd): Likewise. * build-id.h (build_id_to_debug_bfd): Clarify that function searches for BFD of debug info file. (build_id_to_exec_bfd): Declare. * corelow.c: Include build-id.h. (locate_exec_from_corefile_build_id): New function. (core_target_open): If no executable BFD is found, search for a core file BFD using build-id. gdb/testsuite/ChangeLog: 2019-12-07 Keith Seitz <keiths@redhat.com> * gdb.base/corefile-buildid-shlib-shr.c: New file. * gdb.base/corefile-buildid-shlib.c: New file. * gdb.base/corefile-buildid.c: New file. * gdb.base/corefile-buildid.exp: New file. Change-Id: I15e9e8e58f10c68b5cae55e2eba58df1e8aef529
2019-12-07 18:35:03 +01:00
2019-12-07 Keith Seitz <keiths@redhat.com>
* build-id.c (build_id_bfd_get): Permit bfd_core, too.
(build_id_to_debug_bfd): Make static, rewriting to use
build_id_to_bfd_suffix.
(build_id_to_bfd_suffix): Copy of build_id_to_debug_bfd,
adding `suffix' parameter. Append SUFFIX to file names
when searching for matching files.
(build_id_to_debug_bfd): Use build_id_to_bfd_suffix.
(build_id_to_exec_bfd): Likewise.
* build-id.h (build_id_to_debug_bfd): Clarify that function
searches for BFD of debug info file.
(build_id_to_exec_bfd): Declare.
* corelow.c: Include build-id.h.
(locate_exec_from_corefile_build_id): New function.
(core_target_open): If no executable BFD is found,
search for a core file BFD using build-id.
2019-12-06 Christian Biesinger <cbiesinger@google.com>
* bcache.c: Put in namespace gdb.
* bcache.h: Likewise.
* gdbtypes.c (check_types_worklist): Update.
(types_deeply_equal): Update.
* macrotab.c (struct macro_table) <bcache>: Update.
(new_macro_table): Update.
* macrotab.h (struct bcache): Put this forward declaration
inside namespace gdb.
(new_macro_table): Update.
* objfiles.h (struct objfile_per_bfd_storage) <filename_cache>:
Update.
<macro_cache>: Update.
* psymtab.h: (psymtab_storage) <psymbol_cache>: Update.
[gdb/symtab] Prefer var def over decl Consider the DWARF as generated by gcc with the tentative patch to fix gcc PR91507 - "wrong debug for completed array with previous incomplete declaration": ... <1><f4>: Abbrev Number: 2 (DW_TAG_array_type) <f5> DW_AT_type : <0xff> <f9> DW_AT_sibling : <0xff> <2><fd>: Abbrev Number: 3 (DW_TAG_subrange_type) <2><fe>: Abbrev Number: 0 <1><ff>: Abbrev Number: 4 (DW_TAG_pointer_type) <100> DW_AT_byte_size : 8 <101> DW_AT_type : <0x105> <1><105>: Abbrev Number: 5 (DW_TAG_base_type) <106> DW_AT_byte_size : 1 <107> DW_AT_encoding : 6 (signed char) <108> DW_AT_name : (indirect string, offset: 0x19f): char <1><10c>: Abbrev Number: 6 (DW_TAG_variable) <10d> DW_AT_name : zzz <111> DW_AT_decl_file : 1 <112> DW_AT_decl_line : 1 <113> DW_AT_decl_column : 14 <114> DW_AT_type : <0xf4> <118> DW_AT_external : 1 <118> DW_AT_declaration : 1 <1><118>: Abbrev Number: 2 (DW_TAG_array_type) <119> DW_AT_type : <0xff> <11d> DW_AT_sibling : <0x128> <1><12f>: Abbrev Number: 8 (DW_TAG_variable) <130> DW_AT_specification: <0x10c> <134> DW_AT_decl_line : 2 <135> DW_AT_decl_column : 7 <136> DW_AT_type : <0x118> <13a> DW_AT_location : 9 byte block: 3 30 10 60 0 0 0 0 0 (DW_OP_addr: 601030) ... The DWARF will result in two entries in the symbol table, a decl with type char *[] and a def with type char*[2]. When trying to print the value of zzz: ... $ gdb a.spec.out -batch -ex "p zzz" ... the decl (rather than the def) will be found in the symbol table, which is missing the location information, and consequently we get: ... $1 = 0x601030 <zzz> ... [ There is a fallback mechanism that finds the address of the variable in the minimal symbol table, but that's not used here, because the type of the decl does not specify a size. We could use the symbol size here to get the size of the type, but that's currently not done: PR exp/24989. Still, fixing that PR would not fix the generic case, where minimal symbol info is not available. ] Fix this by preferring defs over decls when searching in the symbol table. Build and reg-tested on x86_64-linux. gdb/ChangeLog: 2019-12-06 Tom de Vries <tdevries@suse.de> PR symtab/24971 * block.c (best_symbol, better_symbol): New function. (block_lookup_symbol_primary, block_lookup_symbol): Prefer def over decl. gdb/testsuite/ChangeLog: 2019-12-06 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/varval.exp: Add decl before def test. Change-Id: Id92326cb8ef9903b121ef9e320658eb565d0f5a9
2019-12-06 18:51:49 +01:00
2019-12-06 Tom de Vries <tdevries@suse.de>
PR symtab/24971
* block.c (best_symbol, better_symbol): New function.
(block_lookup_symbol_primary, block_lookup_symbol): Prefer def over
decl.
gdb: fix overload resolution for see-through references The overload resolution mechanism assigns badness values to the necessary conversions to be made on types to pick a champion. A badness value consists of a "rank" that scores the conversion and a "subrank" to differentiate conversions of the same kind. An auxiliary function, 'sum_ranks', is used for adding two badness values. In all of its uses, except two, 'sum_ranks' is used for populating the subrank of a badness value. The two exceptions are in 'rank_one_type': ~~~ /* See through references, since we can almost make non-references references. */ if (TYPE_IS_REFERENCE (arg)) return (sum_ranks (rank_one_type (parm, TYPE_TARGET_TYPE (arg), NULL), REFERENCE_CONVERSION_BADNESS)); if (TYPE_IS_REFERENCE (parm)) return (sum_ranks (rank_one_type (TYPE_TARGET_TYPE (parm), arg, NULL), REFERENCE_CONVERSION_BADNESS)); ~~~ Here, the result of a recursive call is combined with REFERENCE_CONVERSION_BADNESS. This leads to the problem of over-punishment by combining two ranks. Consider this: void an_overloaded_function (const foo &); void an_overloaded_function (const foo &&); ... foo arg; an_overloaded_function(arg); When ranking 'an_overloaded_function (const foo &)', the badness values REFERENCE_CONVERSION_BADNESS and CV_CONVERSION_BADNESS are combined, whereas 'rank_one_type' assigns only the REFERENCE_CONVERSION_BADNESS value to 'an_overloaded_function (const foo &&)' (there is a different execution flow for that). This yields in GDB picking the latter function as the overload champion instead of the former. In fact, the 'rank_one_type' function should have given 'an_overloaded_function (const foo &)' the CV_CONVERSION_BADNESS value, with the see-through referencing increasing the subrank a little bit. This can be achieved by introducing a new badness value, REFERENCE_SEE_THROUGH_BADNESS, which bumps up the subrank only, and using it in the two "exceptional" cases of 'sum_ranks'. gdb/ChangeLog: 2019-12-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdbtypes.h: Define the REFERENCE_SEE_THROUGH_BADNESS value. * gdbtypes.c (rank_one_type): Use REFERENCE_SEE_THROUGH_BADNESS for ranking see-through reference cases. gdb/testsuite/ChangeLog: 2019-12-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.cp/rvalue-ref-overload.cc: Add a case that involves both CV and reference conversion for overload resolution. * gdb.cp/rvalue-ref-overload.exp: Test it. Change-Id: I39ae6505ab85ad0bd21915368c82540ceeb3aae9
2019-11-12 15:12:43 +01:00
2019-12-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* gdbtypes.h: Define the REFERENCE_SEE_THROUGH_BADNESS value.
* gdbtypes.c (rank_one_type): Use REFERENCE_SEE_THROUGH_BADNESS
for ranking see-through reference cases.
2019-12-06 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* stack.c (faas_command): Check a command is provided.
* thread.c (taas_command, tfaas_command): Likewise.
2019-12-05 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* inferior.c (prune_inferiors): Only call delete_inferior,
Do not modify the inferior list.
2019-12-05 Simon Marchi <simon.marchi@polymtl.ca>
* c-exp.y: Update calls to lookup_typename,
lookup_signed_typename and lookup_unsigned_typename.
* c-lang.c (evaluate_subexp_c): Likewise.
* cp-namespace.c (cp_lookup_symbol_imports_or_template):
Likewise.
* eval.c (binop_promote): Likewise.
* gdbtypes.c (lookup_typename): Remove gdbarch parameter.
(lookup_unsigned_typename): Likewise.
(lookup_signed_typename): Likewise.
* gdbtypes.h (lookup_unsigned_typename): Likewise.
(lookup_signed_typename): Likewise.
(lookup_typename): Likewise.
* guile/scm-type.c (tyscm_lookup_typename): Update calls to
lookup_typename, lookup_signed_typename,
lookup_unsigned_typename.
* m2-exp.y: Likewise.
* printcmd.c (printf_wide_c_string): Likewise.
(ui_printf): Likewise.
* python/py-type.c (typy_lookup_typename): Likewise.
* python/py-xmethods.c (python_xmethod_worker::invoke):
Likewise.
* rust-exp.y: Likewise.
Fix (most) OpenBSD link errors This fixes these errors: ld: error: undefined symbol: x86_stopped_by_hw_breakpoint() >>> referenced by x86-nat.h:109 (../../gdb/x86-nat.h:109) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::stopped_by_hw_breakpoint()) ld: error: undefined symbol: x86_can_use_hw_breakpoint(bptype, int, int) >>> referenced by x86-nat.h:76 (../../gdb/x86-nat.h:76) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::can_use_hw_breakpoint(bptype, int, int)) ld: error: undefined symbol: x86_insert_hw_breakpoint(gdbarch*, bp_target_info*) >>> referenced by x86-nat.h:93 (../../gdb/x86-nat.h:93) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::insert_hw_breakpoint(gdbarch*, bp_target_info*)) ld: error: undefined symbol: x86_remove_hw_breakpoint(gdbarch*, bp_target_info*) >>> referenced by x86-nat.h:97 (../../gdb/x86-nat.h:97) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::remove_hw_breakpoint(gdbarch*, bp_target_info*)) ld: error: undefined symbol: x86_remove_watchpoint(unsigned long, int, target_hw_bp_type, expression*) >>> referenced by x86-nat.h:89 (../../gdb/x86-nat.h:89) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::remove_watchpoint(unsigned long, int, target_hw_bp_type, expression*)) ld: error: undefined symbol: x86_insert_watchpoint(unsigned long, int, target_hw_bp_type, expression*) >>> referenced by x86-nat.h:84 (../../gdb/x86-nat.h:84) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::insert_watchpoint(unsigned long, int, target_hw_bp_type, expression*)) ld: error: undefined symbol: x86_stopped_by_watchpoint() >>> referenced by x86-nat.h:100 (../../gdb/x86-nat.h:100) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::stopped_by_watchpoint()) ld: error: undefined symbol: x86_stopped_data_address(unsigned long*) >>> referenced by x86-nat.h:103 (../../gdb/x86-nat.h:103) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::stopped_data_address(unsigned long*)) ld: error: undefined symbol: x86_region_ok_for_hw_watchpoint(unsigned long, int) >>> referenced by x86-nat.h:79 (../../gdb/x86-nat.h:79) >>> amd64-obsd-nat.o:(x86_nat_target<obsd_nat_target>::region_ok_for_hw_watchpoint(unsigned long, int)) and ld: error: undefined symbol: x86_dr_insert_watchpoint(x86_debug_reg_state*, target_hw_bp_type, unsigned long, int) >>> referenced by x86-nat.c:156 (../../gdb/x86-nat.c:156) >>> x86-nat.o:(x86_insert_watchpoint(unsigned long, int, target_hw_bp_type, expression*)) ld: error: undefined symbol: x86_dr_remove_watchpoint(x86_debug_reg_state*, target_hw_bp_type, unsigned long, int) >>> referenced by x86-nat.c:169 (../../gdb/x86-nat.c:169) >>> x86-nat.o:(x86_remove_watchpoint(unsigned long, int, target_hw_bp_type, expression*)) ld: error: undefined symbol: x86_dr_region_ok_for_watchpoint(x86_debug_reg_state*, unsigned long, int) >>> referenced by x86-nat.c:181 (../../gdb/x86-nat.c:181) >>> x86-nat.o:(x86_region_ok_for_hw_watchpoint(unsigned long, int)) ld: error: undefined symbol: x86_dr_stopped_data_address(x86_debug_reg_state*, unsigned long*) >>> referenced by x86-nat.c:194 (../../gdb/x86-nat.c:194) >>> x86-nat.o:(x86_stopped_data_address(unsigned long*)) ld: error: undefined symbol: x86_dr_stopped_by_watchpoint(x86_debug_reg_state*) >>> referenced by x86-nat.c:206 (../../gdb/x86-nat.c:206) >>> x86-nat.o:(x86_stopped_by_watchpoint()) ld: error: undefined symbol: x86_dr_insert_watchpoint(x86_debug_reg_state*, target_hw_bp_type, unsigned long, int) >>> referenced by x86-nat.c:219 (../../gdb/x86-nat.c:219) >>> x86-nat.o:(x86_insert_hw_breakpoint(gdbarch*, bp_target_info*)) ld: error: undefined symbol: x86_dr_remove_watchpoint(x86_debug_reg_state*, target_hw_bp_type, unsigned long, int) >>> referenced by x86-nat.c:233 (../../gdb/x86-nat.c:233) >>> x86-nat.o:(x86_remove_hw_breakpoint(gdbarch*, bp_target_info*)) ld: error: undefined symbol: x86_dr_stopped_by_hw_breakpoint(x86_debug_reg_state*) >>> referenced by x86-nat.c:269 (../../gdb/x86-nat.c:269) >>> x86-nat.o:(x86_stopped_by_hw_breakpoint()) It does not fix: ld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmp_binvert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in /usr/local/lib/libgmp.a(mp_minv_tab.o) >>> referenced by tmp-dive_1.s >>> dive_1.o:(__gmpn_divexact_1) in archive /usr/local/lib/libgmp.a ld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmp_binvert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in /usr/local/lib/libgmp.a(mp_minv_tab.o) >>> referenced by tmp-bdiv_q_1.s >>> bdiv_q_1.o:(__gmpn_bdiv_q_1) in archive /usr/local/lib/libgmp.a ld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmpn_invert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in /usr/local/lib/libgmp.a(invert_limb_table.o) >>> referenced by tmp-invert_limb.s >>> invert_limb.o:(__gmpn_invert_limb) in archive /usr/local/lib/libgmp.a gdb/ChangeLog: 2019-12-04 Christian Biesinger <cbiesinger@google.com> * configure.nat (obsd64): Add missing files x86-nat.o and nat/x86-dregs.o. Change-Id: I4a443c0cf805efd7b45feaabd729a01b07772724
2019-11-22 18:03:15 +01:00
2019-12-04 Christian Biesinger <cbiesinger@google.com>
* configure.nat (obsd64): Add missing files x86-nat.o and
nat/x86-dregs.o.
2019-12-04 Tom Tromey <tom@tromey.com>
* valprint.c (val_print_string): Use metadata_style.
* go-valprint.c (print_go_string): Use metadata style.
* p-valprint.c (pascal_object_print_static_field): Use metadata
style.
* cp-valprint.c (cp_print_static_field): Use metadata style.
2019-12-04 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
* f-exp.y (COMPLEX_KEYWORD, SINGLE, DOUBLE, PRECISION): New
tokens.
(typebase): New patterns for complex, single/double precision, and
single/double complex.
(f77_keywords): Change token for complex keyword, and add single,
double, and precision keywords.
2019-12-04 Simon Marchi <simon.marchi@polymtl.ca>
* avr-tdep.c (_initialize_avr_tdep): Improve help of command
"info io_registers".
Fix regcache::cooked_read_test selftest for mep When running the regcache::cooked_read_test selftest in an all targets build, I get the following internal error: /home/simark/src/binutils-gdb/gdb/thread.c:95: internal-error: thread_info* inferior_thread(): Assertion `tp' failed. The stack trace is the followiing: #9 0x000055fe25584a52 in internal_error (file=0x55fe27a25fe0 "/home/simark/src/binutils-gdb/gdb/thread.c", line=95, fmt=0x55fe27a25c80 "%s: Assertion `%s' failed.") at /home/simark/src/binutils-gdb/gdb/gdbsupport/errors.c:55 #10 0x000055fe260674bc in inferior_thread () at /home/simark/src/binutils-gdb/gdb/thread.c:95 #11 0x000055fe25c62f0f in get_current_regcache () at /home/simark/src/binutils-gdb/gdb/regcache.c:372 #12 0x000055fe2594fcf1 in current_options () at /home/simark/src/binutils-gdb/gdb/mep-tdep.c:873 #13 0x000055fe2594ff08 in mep_register_name (gdbarch=0x62100056f510, regnr=152) at /home/simark/src/binutils-gdb/gdb/mep-tdep.c:958 #14 0x000055fe25950112 in mep_register_reggroup_p (gdbarch=0x62100056f510, regnum=152, group=0x55fe2924d540 <save_group>) at /home/simark/src/binutils-gdb/gdb/mep-tdep.c:1029 #15 0x000055fe2555ad87 in gdbarch_register_reggroup_p (gdbarch=0x62100056f510, regnum=152, reggroup=0x55fe2924d540 <save_group>) at /home/simark/src/binutils-gdb/gdb/gdbarch.c:3622 #16 0x000055fe25c61d45 in reg_buffer::save(gdb::function_view<register_status (int, unsigned char*)>) (this=0x7ffc61a0ed90, cooked_read=...) at /home/simark/src/binutils-gdb/gdb/regcache.c:247 #17 0x000055fe2552ac60 in readonly_detached_regcache::readonly_detached_regcache(gdbarch*, gdb::function_view<register_status (int, unsigned char*)>) (this=0x7ffc61a0ed90, gdbarch=0x62100056f510, cooked_read=...) at /home/simark/src/binutils-gdb/gdb/regcache.h:444 #18 0x000055fe25c61867 in readonly_detached_regcache::readonly_detached_regcache (this=0x7ffc61a0ed90, src=...) at /home/simark/src/binutils-gdb/gdb/regcache.c:212 #19 0x000055fe25c6a5ca in selftests::cooked_read_test (gdbarch=0x62100056f510) at /home/simark/src/binutils-gdb/gdb/regcache.c:1613 The problems is that mep's code ends up calling inferior_thread, which calls find_thread_ptid. find_thread_ptid searches for a thread by ptid in the thread list of the inferior that is expected to contain that thread. However, the thread list of the mock inferior set up in cooked_read_test is never initialized. So find_thread_ptid doesn't find the thread, which is an unexpected situation for inferior_thread. This is failing since this commit: 080363310650c93ad8e93018bcb6760ba5d32d1c Per-inferior thread list, thread ranges/iterators, down with ALL_THREADS, etc. Fix it by putting the mock thread in the thread list of the mock inferior in cooked_read_test. gdb/ChangeLog: * regcache.c (cooked_read_test): Initialize thread list of mock_inferior.
2019-12-04 19:35:32 +01:00
2019-12-04 Simon Marchi <simon.marchi@polymtl.ca>
* regcache.c (cooked_read_test): Initialize thread list of
mock_inferior.
2019-12-04 Simon Marchi <simon.marchi@polymtl.ca>
* aarch64-linux-tdep.c: Remove includes.
2019-12-04 Simon Marchi <simon.marchi@polymtl.ca>
* aarch64-tdep.c: Remove includes.
2019-12-04 Simon Marchi <simon.marchi@efficios.com>
* filtered-iterator.h (filtered_iterator) <operator==,
operator!=>: Compare wrapped iterators, not wrapped pointers.
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
unittests/filtered_iterator-selftests.c.
* unittests/filtered_iterator-selftests.c: New file.
2019-12-04 Tom Tromey <tromey@adacore.com>
* gdbtypes.c (create_range_type): Inherit endianity
from base type.
2019-12-04 Tom Tromey <tromey@adacore.com>
* ada-lang.c (decode_constrained_packed_array)
(ada_value_assign, value_assign_to_component): Update.
* dwarf2loc.c (rw_pieced_value, access_memory)
(dwarf2_compile_expr_to_ax): Update.
* dwarf2read.c (dwarf2_add_field): Update.
* eval.c (evaluate_subexp_standard): Update.
* gdbarch.c, gdbarch.h: Rebuild.
* gdbarch.sh (bits_big_endian): Remove.
* gdbtypes.h (union field_location): Update comment.
* target-descriptions.c (make_gdb_type): Update.
* valarith.c (value_bit_index): Update.
* value.c (struct value) <bitpos>: Update comment.
(unpack_bits_as_long, modify_field): Update.
* value.h (value_bitpos): Update comment.
2019-12-04 Tom Tromey <tromey@adacore.com>
* gdbtypes.c (type_byte_order): Move earlier. Assert for unknown
endian-ness.
2019-12-04 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (dwarf2_init_float_type)
(dwarf2_init_complex_target_type): Add byte_order parameter.
(read_base_type): Compute byte order earlier.
* gdbtypes.c (init_float_type): Add byte_order parameter.
* gdbtypes.h (init_float_type): Add byte_order parameter.
2019-12-04 Tom Tromey <tromey@adacore.com>
* unittests/tui-selftests.c: Conditionally include tui-winsource.h.
2019-12-04 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (process_structure_scope): Initialize
"discr_offset".
gdb/mi: Add -max-results parameter to some -symbol-info-* commands Adds a new parameter -max-results to -symbol-info-functions, -symbol-info-variables, -symbol-info-types, and -symbol-info-modules. This parameter limits the number of results returned. This change still leaves -symbol-info-module-functions and -symbol-info-module-variables always returning all results, fixing these commands is slightly harder. There's currently no mechanism for the user of these commands to know if the result list has been truncated if you get back the maximum number of results, so if there are exactly 10 functions and you call '-symbol-info-functions --max-results 10' the reply would appear no different than if you had 20 functions and called with a max of 10. Right now, if you get back the maximum then you should assume that there might be more results available. One other thing to note is that the global_symbol_searcher::search by default returns SIZE_MAX results, there's no longer a mechanism to return an unlimited number of results, though hopefully this will not be a huge issue. gdb/ChangeLog: * mi/mi-symbol-cmds.c (mi_symbol_info): Take extra parameter, and add it into the search spec. (parse_max_results_option): New function. (mi_info_functions_or_variables): Parse -max-results flag and pass it to mi_symbol_info. (mi_cmd_symbol_info_modules): Likewise. (mi_cmd_symbol_info_types): Likewise. * symtab.c (global_symbol_searcher::add_matching_symbols): Change return type to bool, change result container into a set, and don't add new results if we have enough already. (global_symbol_searcher::add_matching_msymbols): Change return type to bool, and don't add new results if we have enough already. (sort_search_symbols_remove_dups): Delete. (global_symbol_searcher::search): Early exit from search loop when we have enough results. Use a std::set to collect the results from calling add_matching_symbols. * symtab.h (global_symbol_searcher) <set_max_seach_results>: New member function. (global_symbol_searcher) <m_max_search_results>: New member variable. (global_symbol_searcher) <add_matching_symbols>: Update header comment and change return type to bool. (global_symbol_searcher) <add_matching_msymbols>: Update header comment and change return type to bool. gdb/doc/ChangeLog: * doc/gdb.texinfo (GDB/MI Symbol Query): Add documentation of -max-results to some -symbol-info-* commands. gdb/testsuite/ChangeLog: * gdb.mi/mi-sym-info.exp: Add tests for -max-results parameter. Change-Id: I90a28feb55b388fb46461a096c5db08b6b0bd427
2019-10-15 01:02:51 +02:00
2019-12-04 Andrew Burgess <andrew.burgess@embecosm.com>
* mi/mi-symbol-cmds.c (mi_symbol_info): Take extra parameter, and
add it into the search spec.
(parse_max_results_option): New function.
(mi_info_functions_or_variables): Parse -max-results flag and pass
it to mi_symbol_info.
(mi_cmd_symbol_info_modules): Likewise.
(mi_cmd_symbol_info_types): Likewise.
* symtab.c (global_symbol_searcher::add_matching_symbols): Change
return type to bool, change result container into a set, and don't
add new results if we have enough already.
(global_symbol_searcher::add_matching_msymbols): Change return
type to bool, and don't add new results if we have enough already.
(sort_search_symbols_remove_dups): Delete.
(global_symbol_searcher::search): Early exit from search loop when
we have enough results. Use a std::set to collect the results
from calling add_matching_symbols.
* symtab.h (global_symbol_searcher) <set_max_seach_results>: New
member function.
(global_symbol_searcher) <m_max_search_results>: New member
variable.
(global_symbol_searcher) <add_matching_symbols>: Update header
comment and change return type to bool.
(global_symbol_searcher) <add_matching_msymbols>: Update header
comment and change return type to bool.
2019-12-04 Andrew Burgess <andrew.burgess@embecosm.com>
* symtab.c (symbol_search::compare_search_syms): Update header
comment.
(global_symbol_searcher::is_suitable_msymbol): New function.
(global_symbol_searcher::expand_symtabs): New function.
(global_symbol_searcher::add_matching_symbols): New function.
(global_symbol_searcher::add_matching_msymbols): New function.
(global_symbol_searcher::search): Move most of the content
into the new functions above, and call them as needed.
* symtab.h (global_symbol_searcher) <expand_symtabs>: New member
function.
(global_symbol_searcher) <add_matching_symbols>: New member
function.
(global_symbol_searcher) <add_matching_msymbols>: New member
function.
(global_symbol_searcher) <is_suitable_msymbol>: New member
function.
2019-12-04 Andrew Burgess <andrew.burgess@embecosm.com>
* mi/mi-cmds.c (mi_cmds): Add -symbol-info-module-functions and
-symbol-info-module-variables entries.
* mi/mi-cmds.h (mi_cmd_symbol_info_module_functions): Declare.
(mi_cmd_symbol_info_module_variables): Declare.
* mi/mi-symbol-cmds.c
(module_symbol_search_iterator): New typedef.
(output_module_symbols_in_single_module_and_file): New function.
(output_module_symbols_in_single_module): New function.
(mi_info_module_functions_or_variables): New function.
(mi_cmd_symbol_info_module_functions): New function.
(mi_cmd_symbol_info_module_variables): New function.
* NEWS: Mention new MI command.
2019-12-03 Christian Biesinger <cbiesinger@google.com>
* bcache.c (hash): Remove.
(hash_continue): Remove.
* bcache.h (hash): Remove.
(hash_continue): Remove.
(struct bcache) <ctor>: Update.
* psymtab.c (psymbol_hash): Update.
* stabsread.c (hashname): Update.
* utils.h (fast_hash): Add an argument for a start value,
defaulting to zero.
2019-12-03 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* symtab.c (symbol_cache_clear_slot): Move close to cleared type.
(destroy_block_symbol_cache): New function.
(symbol_cache:~symbol_cache) Call destroy_block_symbol_cache.
(resize_symbol_cache): Likewise.
2019-12-02 Tom Tromey <tom@tromey.com>
* unittests/tui-selftests.c (run_tests): Make conditional.
(_initialize_tui_selftest): Make conditional.
2019-12-02 Christian Biesinger <cbiesinger@google.com>
* aix-thread.c (debug_aix_thread): Change type to bool.
2019-12-02 Luis Machado <luis.machado@linaro.org>
* infrun.c (follow_fork_inferior): Remove outdated FIXME comment.
gdb: Dynamic string length support Add support for strings with dynamic length using the DWARF attribute DW_AT_string_length. Currently gFortran generates DWARF for some strings that make use of DW_AT_string_length like this: <1><2cc>: Abbrev Number: 20 (DW_TAG_string_type) <2cd> DW_AT_string_length: 5 byte block: 99 bd 1 0 0 (DW_OP_call4: <0x1bd>) <2d3> DW_AT_byte_size : 4 <2d4> DW_AT_sibling : <0x2e2> In this type entry the DW_AT_string_length attribute references a second DW_TAG_formal_parameter that contains the string length. The DW_AT_byte_size indicates that the length is a 4-byte value. This commit extends GDB's DWARF parsing for strings so that we can create dynamic types as well as static types, based on the attribute the DWARF contains. I then extend the dynamic type resolution code in gdbtypes.c to add support for resolving dynamic strings. gdb/ChangeLog: * dwarf2read.c (read_tag_string_type): Read the fields required to make a dynamic string, and possibly create a dynamic range for the string. (attr_to_dynamic_prop): Setup is_reference based on the type of attribute being processed. * gdbtypes.c (is_dynamic_type_internal): Handle TYPE_CODE_STRING. (resolve_dynamic_array): Rename to... (resolve_dynamic_array_or_string): ...this, update header comment, and accept TYPE_CODE_STRING. (resolve_dynamic_type_internal): Handle TYPE_CODE_STRING. gdb/testsuite/ChangeLog: * gdb.fortran/array-slices.exp: Add test for dynamic strings. Change-Id: I03f2d181b26156f48f27a03c8a59f9bd4d71ac17
2019-11-29 01:14:35 +01:00
2019-12-01 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2read.c (read_tag_string_type): Read the fields required to
make a dynamic string, and possibly create a dynamic range for the
string.
(attr_to_dynamic_prop): Setup is_reference based on the type of
attribute being processed.
* gdbtypes.c (is_dynamic_type_internal): Handle TYPE_CODE_STRING.
(resolve_dynamic_array): Rename to...
(resolve_dynamic_array_or_string): ...this, update header comment,
and accept TYPE_CODE_STRING.
(resolve_dynamic_type_internal): Handle TYPE_CODE_STRING.
2019-12-01 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2read.c (dwarf2_per_cu_int_type): New function, takes most
of its implementation from...
(dwarf2_per_cu_addr_sized_int_type): ...here, which now just calls
the new function.
gdb/fortran: array stride support Currently GDB supports a byte or bit stride on arrays, in DWARF this would be DW_AT_bit_stride or DW_AT_byte_stride on DW_TAG_array_type. However, DWARF can also support DW_AT_byte_stride or DW_AT_bit_stride on DW_TAG_subrange_type, the tag used to describe each dimension of an array. Strides on subranges are used by gFortran to represent Fortran arrays, and this commit adds support for this to GDB. I've extended the range_bounds struct to include the stride information. The name is possibly a little inaccurate now, but this still sort of makes sense, the structure represents information about the bounds of the range, and also how to move from the lower to the upper bound (the stride). I've added initial support for bit strides, but I've never actually seen an example of this being generated. Further, I don't really see right now how GDB would currently handle a bit stride that was not a multiple of the byte size as the code in, for example, valarith.c:value_subscripted_rvalue seems geared around byte addressing. As a consequence if we see a bit stride that is not a multiple of 8 then GDB will give an error. gdb/ChangeLog: * dwarf2read.c (read_subrange_type): Read bit and byte stride and create a range with stride where appropriate. * f-valprint.c: Include 'gdbarch.h'. (f77_print_array_1): Take the stride into account when walking the array. Also convert the stride into addressable units. * gdbtypes.c (create_range_type): Initialise the stride to constant zero. (create_range_type_with_stride): New function, initialise the range as normal, and then setup the stride. (has_static_range): Include the stride here. Also change the return type to bool. (create_array_type_with_stride): Consider the range stride if the array isn't given its own stride. (resolve_dynamic_range): Resolve the stride if needed. * gdbtypes.h (struct range_bounds) <stride>: New member variable. (struct range_bounds) <flag_is_byte_stride>: New member variable. (TYPE_BIT_STRIDE): Define. (TYPE_ARRAY_BIT_STRIDE): Define. (create_range_type_with_stride): Declare. * valarith.c (value_subscripted_rvalue): Take range stride into account when walking the array. gdb/testsuite/ChangeLog: * gdb.fortran/derived-type-striding.exp: New file. * gdb.fortran/derived-type-striding.f90: New file. * gdb.fortran/array-slices.exp: New file. * gdb.fortran/array-slices.f90: New file. Change-Id: I9af2bcd1f2d4c56f76f5f3f9f89d8f06bef10d9a
2019-10-24 12:12:11 +02:00
2019-12-01 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2read.c (read_subrange_type): Read bit and byte stride and
create a range with stride where appropriate.
* f-valprint.c: Include 'gdbarch.h'.
(f77_print_array_1): Take the stride into account when walking the
array. Also convert the stride into addressable units.
* gdbtypes.c (create_range_type): Initialise the stride to
constant zero.
(create_range_type_with_stride): New function, initialise the
range as normal, and then setup the stride.
(has_static_range): Include the stride here. Also change the
return type to bool.
(create_array_type_with_stride): Consider the range stride if the
array isn't given its own stride.
(resolve_dynamic_range): Resolve the stride if needed.
* gdbtypes.h (struct range_bounds) <stride>: New member variable.
(struct range_bounds) <flag_is_byte_stride>: New member variable.
(TYPE_BIT_STRIDE): Define.
(TYPE_ARRAY_BIT_STRIDE): Define.
(create_range_type_with_stride): Declare.
* valarith.c (value_subscripted_rvalue): Take range stride into
account when walking the array.
2019-12-01 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_all_windows_info): Treat inactive TUI
specially.
2019-12-01 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_copy_source_line): Don't advance past
\0.
* unittests/tui-selftests.c: New file.
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add tui-selftests.c.
2019-12-01 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_enable): Call tui_update_variables earlier.
2019-12-01 Tom Tromey <tom@tromey.com>
* NEWS: Document new settings.
* tui/tui-wingeneral.c (box_win): Apply appropriate border style.
* tui/tui-win.c (_initialize_tui_win): Add border style
observers.
* tui/tui-io.h (tui_apply_style): Declare.
* tui/tui-io.c (tui_apply_style): Rename from apply_style. No
longer static.
(apply_ansi_escape, tui_set_reverse_mode): Update.
* cli/cli-style.h (class cli_style_option) <add_setshow_commands>:
Add "skip_intensity" parameter.
<changed>: New member.
<do_set_value>: Declare.
(tui_border_style, tui_active_border_style): Declare.
* cli/cli-style.c (tui_border_style, tui_active_border_style): New
globals.
(cli_style_option): Initialize "changed".
(cli_style_option::do_set_value): New function.
(cli_style_option::add_setshow_commands): Add "skip_intensity"
parameter. Update.
(STYLE_ADD_SETSHOW_COMMANDS): Add "SKIP" parameter.
(_initialize_cli_style): Update. Create TUI border style
commands.
2019-12-01 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_copy_source_line): Add "ndigits"
parameter.
* tui/tui-winsource.c (tui_copy_source_line): Add "ndigits"
parameter.
* tui/tui-win.h (compact_source): Declare.
* tui/tui-win.c (compact_source): New global.
(tui_set_compact_source, tui_show_compact_source): New functions.
(_initialize_tui_win): Add "compact-source" setting.
* tui/tui-source.c (tui_source_window::set_contents): Handle
compact_source setting.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Update.
* NEWS: Document new setting.
2019-11-30 Tom Tromey <tom@tromey.com>
* dwarf2read.c (dwarf2_add_field): Include field offset when
computing variant part length.
2019-11-30 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Mention define-prefix. Tell that command names can now
contain a . character.
2019-11-30 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* command.h (valid_cmd_char_p): Declare.
* cli/cli-decode.c (valid_cmd_char_p): New function factorizing
the check of valid command char.
(find_command_name_length, valid_user_defined_cmd_name_p): Use
valid_cmd_char_p.
* cli/cli-script.c (validate_comname): Likewise.
* completer.c (gdb_completer_command_word_break_characters):
Do not remove . from the word break char, update comments.
(complete_line_internal_1): Use valid_cmd_char_p.
* guile/scm-cmd.c (gdbscm_parse_command_name): Likewise.
* python/py-cmd.c (gdbpy_parse_command_name): Likewise.
2019-11-30 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-script.c (do_define_command): Ensure a redefined
prefix command is kept as a prefix command.
(define_prefix_command): New function.
(show_user_1): Report user defined prefixes.
(_initialize_cli_script): Create the new 'define-prefix' command.
Add completers for 'define' and 'document'.
* top.c (execute_command): If command is a user-defined prefix only
command, report the list of commands for this prefix command.
2019-11-29 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* valops.c (find_oload_champ): Improve debug output.
2019-11-29 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* valops.c (find_oload_champ): Print part of debug messages
before the badness vector is std::move'd.
2019-11-28 Tom Tromey <tom@tromey.com>
* value.c (creal_internal_fn): Fix comment.
2019-11-28 Tom Tromey <tom@tromey.com>
* gdbtypes.h (struct range_bounds) <flag_upper_bound_is_count,
flag_bound_evaluated>: Now unsigned.
2019-11-28 Tom Tromey <tom@tromey.com>
* guile/guile-internal.h (vlscm_scm_from_value_unsafe): Don't
declare.
2019-11-28 Mihails Strasuns <mihails.strasuns@intel.com>
* jit.c (jit_bfd_try_read_symtab): Fix printed function name in the
debug output.
* jit.c (jit_unregister_code): Add debug print to match
`jit_register_code`.
2019-11-27 Christian Biesinger <cbiesinger@google.com>
* NEWS: Mention the new multithreaded symbol loading.
2019-11-27 Christian Biesinger <cbiesinger@google.com>
* maint.c (n_worker_threads): Default to 0.
(worker_threads_disabled): New function.
* maint.h (worker_threads_disabled): New function.
* minsyms.c (minimal_symbol_reader::record_full): Call symbol_set_names
here if worker_threads_disabled () is true.
(minimal_symbol_reader::install): Skip all threading if
worker_threads_disabled () is true.
2019-11-27 Christian Biesinger <cbiesinger@google.com>
* minsyms.c (add_minsym_to_hash_table): Use a previously computed
hash code if possible.
(add_minsym_to_demangled_hash_table): Likewise.
(minimal_symbol_reader::install): Compute the hash codes for msymbol
on the background thread.
* symtab.h (struct minimal_symbol) <hash_value, demangled_hash_value>:
Add these fields.
2019-11-27 Christian Biesinger <cbiesinger@google.com>
* minsyms.c (minimal_symbol_reader::install): Also compute the hash
of the mangled name on the background thread.
* symtab.c (symbol_set_names): Allow passing in the hash of the
linkage_name.
* symtab.h (symbol_set_names): Likewise.
Fix BZ 25065 - Ensure that physnames are computed for inherited DIEs This is a fix for BZ 25065. GDB segfaults when running either gdb.cp/subtypes.exp or gdb.cp/local.exp in conjunction with using the -flto compiler/linker flag. A much simpler program, which was used to help create the test for this fix, is: -- doit.cc -- int main() { class Foo { public: int doit () { return 0; } }; Foo foo; return foo.doit (); } -- end doit.cc -- gcc -o doit -flto -g doit.cc gdb -q doit Reading symbols from doit... (gdb) ptype main::Foo type = class Foo { Segmentation fault (core dumped) The segfault occurs due to a NULL physname in c_type_print_base_struct_union in c-typeprint.c. Specifically, calling is_constructor_name() eventually causes the SIGSEGV is this code in c-typeprint.c: const char *physname = TYPE_FN_FIELD_PHYSNAME (f, j); int is_full_physname_constructor = TYPE_FN_FIELD_CONSTRUCTOR (f, j) || is_constructor_name (physname) || is_destructor_name (physname) || method_name[0] == '~'; However, looking at compute_delayed_physnames(), we see that the TYPE_FN_FIELD_PHYSNAME field should never be NULL. This field will be set to "" for NULL physnames: physname = dwarf2_physname (mi.name, mi.die, cu); TYPE_FN_FIELD_PHYSNAME (fn_flp->fn_fields, mi.index) = physname ? physname : ""; For this particular case, it turns out that compute_delayed_physnames wasn't being called, which left TYPE_FN_FIELD_PHYSNAME set to the NULL value that it started with when that data structure was allocated. The place to fix it, I think, is towards the end of inherit_abstract_dies(). My first attempt at fix caused the origin CU's method_list (which is simply the list of methods whose physnames still need to be computed) to be added to the CU which is doing the inheriting. One drawback with this approach is that compute_delayed_physnames is (eventually) called with a CU that's different than the CU in which the methods were found. It's not clear whether this will cause problems or not. A safer approach, which is what I ultimately settled on, is to call compute_delayed_physnames() from inherit_abstract_dies(). One potential drawback is that all needed types might not be known at that point. However, in my testing, I haven't seen a problem along these lines. gdb/ChangeLog: * dwarf2read.c (inherit_abstract_dies): Ensure that delayed physnames are computed for inherited DIEs. Change-Id: I6c6ffe96b301a9daab9f653956b89e3a33fa9445
2019-10-12 23:35:56 +02:00
2019-11-27 Kevin Buettner <kevinb@redhat.com>
* dwarf2read.c (inherit_abstract_dies): Ensure that delayed
physnames are computed for inherited DIEs.
2019-11-27 Tom Tromey <tromey@adacore.com>
* dwarf2read.h (struct dwarf2_per_objfile): Remove unnecessary
backslashes.
* cp-support.c: Remove unnecessary backslashes.
2019-11-27 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y (write_ambiguous_var): Replace SYMBOL_SET_LINKAGE_NAME
with sym->set_linkage_name.
* coffread.c (coff_read_enum_type): Likewise.
* mdebugread.c (parse_symbol): Likewise.
* stabsread.c (patch_block_stabs): Likewise.
(define_symbol): Likewise.
(read_enum_type): Likewise.
(common_block_end): Likewise.
* symtab.h (struct general_symbol_info) <set_linkage_name>: New
function.
(SYMBOL_SET_LINKAGE_NAME): Remove.
* xcoffread.c (process_xcoff_symbol): Replace SYMBOL_SET_LINKAGE_NAME
with sym->set_linkage_name.
2019-11-27 Andrew Burgess <andrew.burgess@embecosm.com>
* mi/mi-cmds.c (mi_cmds): Add 'symbol-info-modules' entry.
* mi/mi-cmds.h (mi_cmd_symbol_info_modules): Declare.
* mi/mi-symbol-cmds.c (mi_cmd_symbol_info_modules): New function.
* NEWS: Mention new MI command.
2019-11-27 Andrew Burgess <andrew.burgess@embecosm.com>
* mi/mi-cmds.c (mi_cmds): Add '-symbol-info-functions',
'-symbol-info-types', and '-symbol-info-variables'.
* mi/mi-cmds.h (mi_cmd_symbol_info_functions): Declare.
(mi_cmd_symbol_info_types): Declare.
(mi_cmd_symbol_info_variables): Declare.
* mi/mi-symbol-cmds.c: Add 'source.h' and 'mi-getopt.h' includes.
(output_debug_symbol): New function.
(output_nondebug_symbol): New function.
(mi_symbol_info): New function.
(mi_info_functions_or_variables): New function.
(mi_cmd_symbol_info_functions): New function.
(mi_cmd_symbol_info_types): New function.
(mi_cmd_symbol_info_variables): New function.
* NEWS: Mention new commands.
2019-11-27 Andrew Burgess <andrew.burgess@embecosm.com>
* symtab.c (symbol_to_info_string): New function, most content
moved from print_symbol_info, but updated to return a std::string.
(print_symbol_info): Update to use symbol_to_info_string and print
returned string.
* symtab.h (symbol_to_info_string): Declare new function.
2019-11-27 Andrew Burgess <andrew.burgess@embecosm.com>
* python/python.c (gdbpy_rbreak): Convert to using
global_symbol_searcher.
* symtab.c (file_matches): Convert return type to bool, change
file list to std::vector, update header comment.
(search_symbols): Rename to...
(global_symbol_searcher::search): ...this and update now its
a member function of global_symbol_searcher. Take account of the
changes to file_matches.
(symtab_symbol_info): Convert to using global_symbol_searcher.
(rbreak_command): Likewise.
(search_module_symbols): Likewise.
* symtab.h (enum symbol_search): Update comment.
(search_symbols): Remove declaration.
(class global_symbol_searcher): New class.
2019-11-26 Tom Tromey <tromey@adacore.com>
* cp-support.c (_initialize_cp_support): Conditionally initialize
gdb_demangle_attempt_core_dump.
2019-11-26 Tom Tromey <tom@tromey.com>
* python/py-function.c (fnpy_init): Update.
* value.h (add_internal_function): Adjust declaration.
* value.c (function_destroyer): Remove.
(do_add_internal_function): Don't set destroyer or copy name.
(add_internal_function): Take unique_xmalloc_ptr<char> for name.
Set name_allocated.
* python/py-cmd.c (cmdpy_destroyer): Don't free "name".
(cmdpy_init): Set name_allocated.
* cli/cli-decode.h (struct cmd_list_element) <name_allocated>: New
member.
(~cmd_list_element): Free "name" if needed.
2019-11-26 Tom Tromey <tom@tromey.com>
* value.h (add_internal_function): Add new overload. Move
documentation from value.h.
* value.c (do_add_internal_function): New function.
(add_internal_function): Use it. Add new overload.
(function_destroyer): Don't free doc.
* python/py-function.c (fnpy_init): Update.
2019-11-26 Tom Tromey <tom@tromey.com>
* python/py-cmd.c (cmdpy_destroyer): Don't free "doc".
(cmdpy_init): Set "doc_allocated".
2019-11-26 Tom Tromey <tom@tromey.com>
* gdbsupport/thread-pool.c (thread_pool::set_thread_count): Set
name of worker thread.
* gdbsupport/common.m4 (GDB_AC_COMMON): Check for
pthread_setname_np.
* configure, config.in: Rebuild.
2019-11-26 Tom Tromey <tom@tromey.com>
* python/python.c (class gdbpy_gil): New.
(struct gdbpy_event): Add constructor, destructor, operator().
(gdbpy_post_event): Use run_on_main_thread.
(gdbpy_initialize_events): Remove.
(do_start_initialization): Update.
2019-11-26 Tom Tromey <tom@tromey.com>
* NEWS: Add entry.
* maint.c (_initialize_maint_cmds): Add "worker-threads" maint
commands. Call update_thread_pool_size.
(update_thread_pool_size, maintenance_set_worker_threads): New
functions.
(n_worker_threads): New global.
2019-11-26 Christian Biesinger <cbiesinger@google.com>
Tom Tromey <tom@tromey.com>
* minsyms.c (minimal_symbol_reader::install): Use
parallel_for_each.
* gdbsupport/parallel-for.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add gdbsupport/parallel-for.h.
2019-11-26 Christian Biesinger <cbiesinger@google.com>
Tom Tromey <tom@tromey.com>
* gdbsupport/thread-pool.h: New file.
* gdbsupport/thread-pool.c: New file.
* Makefile.in (COMMON_SFILES): Add thread-pool.c.
(HFILES_NO_SRCDIR): Add thread-pool.h.
2019-11-26 Tom Tromey <tom@tromey.com>
* event-top.h (thread_local_segv_handler): Declare.
* event-top.c (thread_local_segv_handler): New global.
(install_handle_sigsegv, handle_sigsegv): New functions.
(async_init_signals): Install SIGSEGV handler.
* cp-support.c (gdb_demangle_jmp_buf): Change type. Now
thread-local.
(report_failed_demangle): New function.
(gdb_demangle): Make core_dump_allowed atomic. Remove signal
handler-setting code, instead use segv_handler. Run warning code
on main thread.
2019-11-26 Tom Tromey <tom@tromey.com>
* run-on-main-thread.c: New file.
* run-on-main-thread.h: New file.
* unittests/main-thread-selftests.c: New file.
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
main-thread-selftests.c.
(HFILES_NO_SRCDIR): Add run-on-main-thread.h.
(COMMON_SFILES): Add run-on-main-thread.c.
2019-11-26 Tom Tromey <tom@tromey.com>
* main.c (setup_alternate_signal_stack): Remove.
(captured_main_1): Use gdb::alternate_signal_stack.
* gdbsupport/alt-stack.h: New file.
Add RAII class for blocking gdb signals This adds configury support and an RAII class that can be used to temporarily block signals that are used by gdb. (This class is not used in this patch, but it split out for easier review.) The idea of this patch is that these signals should only be delivered to the main thread. So, when creating a background thread, they are temporarily blocked; the blocked state is inherited by the new thread. The sigprocmask man page says: The use of sigprocmask() is unspecified in a multithreaded process; see pthread_sigmask(3). This patch changes gdb to use pthread_sigmask when appropriate, by introducing a convenience define. I've updated gdbserver as well, because I had to touch gdbsupport, and because the threading patches will make it link against the thread library. I chose not to touch the NTO code, because I don't know anything about that platform and because I cannot test it. Finally, this modifies an existing spot in the Guile layer to use the new facility. gdb/ChangeLog 2019-11-26 Tom Tromey <tom@tromey.com> * gdbsupport/signals-state-save-restore.c (original_signal_mask): Remove comment. (save_original_signals_state, restore_original_signals_state): Use gdb_sigmask. * linux-nat.c (block_child_signals, restore_child_signals_mask) (_initialize_linux_nat): Use gdb_sigmask. * guile/guile.c (_initialize_guile): Use block_signals. * Makefile.in (HFILES_NO_SRCDIR): Add gdb-sigmask.h. * gdbsupport/gdb-sigmask.h: New file. * event-top.c (async_sigtstp_handler): Use gdb_sigmask. * cp-support.c (gdb_demangle): Use gdb_sigmask. * gdbsupport/common.m4 (GDB_AC_COMMON): Check for pthread_sigmask. * configure, config.in: Rebuild. * gdbsupport/block-signals.h: New file. gdb/gdbserver/ChangeLog 2019-11-26 Tom Tromey <tom@tromey.com> * remote-utils.c (block_unblock_async_io): Use gdb_sigmask. * linux-low.c (linux_wait_for_event_filtered, linux_async): Use gdb_sigmask. * configure, config.in: Rebuild. Change-Id: If3f37dc57dd859c226e9e4d79458a0514746e8c6
2019-09-29 16:50:15 +02:00
2019-11-26 Tom Tromey <tom@tromey.com>
* gdbsupport/signals-state-save-restore.c (original_signal_mask):
Remove comment.
(save_original_signals_state, restore_original_signals_state): Use
gdb_sigmask.
* linux-nat.c (block_child_signals, restore_child_signals_mask)
(_initialize_linux_nat): Use gdb_sigmask.
* guile/guile.c (_initialize_guile): Use block_signals.
* Makefile.in (HFILES_NO_SRCDIR): Add gdb-sigmask.h.
* gdbsupport/gdb-sigmask.h: New file.
* event-top.c (async_sigtstp_handler): Use gdb_sigmask.
* cp-support.c (gdb_demangle): Use gdb_sigmask.
* gdbsupport/common.m4 (GDB_AC_COMMON): Check for
pthread_sigmask.
* configure, config.in: Rebuild.
* gdbsupport/block-signals.h: New file.
2019-11-26 Tom Tromey <tom@tromey.com>
* acinclude.m4: Include ax_pthread.m4.
* Makefile.in (PTHREAD_CFLAGS, PTHREAD_LIBS): New variables.
(INTERNAL_CFLAGS_BASE): Use PTHREAD_CFLAGS.
(CLIBS): Use PTHREAD_LIBS.
(aclocal_m4_deps): Add ax_pthread.m4.
* config.in, configure: Rebuild.
* gdbsupport/common.m4 (GDB_AC_COMMON): Check for std::thread.
2019-11-26 Tom Tromey <tom@tromey.com>
* symtab.h (struct minimal_symbol) <name_set>: New member.
* minsyms.c (minimal_symbol_reader::record_full): Copy name.
Don't call symbol_set_names.
(minimal_symbol_reader::install): Call symbol_set_names.
Fix crashes due to python GIL released too early When running GDB tests under Valgrind, various tests are failing due to invalid memory access. Here is the stack trace reported by Valgrind, for gdb.base/freebpcmd.exp : ==18658== Invalid read of size 8 ==18658== at 0x7F9107: is_main (signalmodule.c:195) ==18658== by 0x7F9107: PyOS_InterruptOccurred (signalmodule.c:1730) ==18658== by 0x3696E2: check_quit_flag() (extension.c:829) ==18658== by 0x36980B: restore_active_ext_lang(active_ext_lang_state*) (extension.c:782) ==18658== by 0x48F617: gdbpy_enter::~gdbpy_enter() (python.c:235) ==18658== by 0x47BB71: add_thread_object(thread_info*) (object.h:470) ==18658== by 0x53A84D: operator() (std_function.h:687) ==18658== by 0x53A84D: notify (observable.h:106) ==18658== by 0x53A84D: add_thread_silent(ptid_t) (thread.c:311) ==18658== by 0x3CD954: inf_ptrace_target::create_inferior(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const& , char**, int) (inf-ptrace.c:139) ==18658== by 0x3FE644: linux_nat_target::create_inferior(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char**, int) (linux-nat.c:1094) ==18658== by 0x3D5727: run_command_1(char const*, int, run_how) (infcmd.c:633) ==18658== by 0x2C05D1: cmd_func(cmd_list_element*, char const*, int) (cli-decode.c:1948) ==18658== by 0x53F29F: execute_command(char const*, int) (top.c:639) ==18658== by 0x3638EB: command_handler(char const*) (event-top.c:586) ==18658== by 0x36468C: command_line_handler(std::unique_ptr<char, gdb::xfree_deleter<char> >&&) (event-top.c:771) ==18658== by 0x36407C: gdb_rl_callback_handler(char*) (event-top.c:217) ==18658== by 0x5B2A1F: rl_callback_read_char (callback.c:281) ==18658== by 0x36346D: gdb_rl_callback_read_char_wrapper_noexcept() (event-top.c:175) ==18658== by 0x363F70: gdb_rl_callback_read_char_wrapper(void*) (event-top.c:192) ==18658== by 0x3633AF: stdin_event_handler(int, void*) (event-top.c:514) ==18658== by 0x362504: gdb_wait_for_event (event-loop.c:857) ==18658== by 0x362504: gdb_wait_for_event(int) (event-loop.c:744) ==18658== by 0x362676: gdb_do_one_event() [clone .part.11] (event-loop.c:321) ==18658== by 0x3627AD: gdb_do_one_event (event-loop.c:303) ==18658== by 0x3627AD: start_event_loop() (event-loop.c:370) ==18658== by 0x41D35A: captured_command_loop() (main.c:381) ==18658== by 0x41F2A4: captured_main (main.c:1224) ==18658== by 0x41F2A4: gdb_main(captured_main_args*) (main.c:1239) ==18658== by 0x227D0A: main (gdb.c:32) ==18658== Address 0x10 is not stack'd, malloc'd or (recently) free'd The problem seems to be created by gdbpy_enter::~gdbpy_enter () releasing the GIL lock too early: ~gdbpy_enter () does: ... PyGILState_Release (m_state); python_gdbarch = m_gdbarch; python_language = m_language; restore_active_ext_lang (m_previous_active); } So, it releases the GIL lock, does 2 assignments and then leads to the following call sequence: restore_active_ext_lang => check_quit_flag => python.c gdbpy_check_quit_flag => PyOS_InterruptOccurred => is_main. is_main code is: static int is_main(_PyRuntimeState *runtime) { unsigned long thread = PyThread_get_thread_ident(); PyInterpreterState *interp = _PyRuntimeState_GetThreadState(runtime)->interp; return (thread == runtime->main_thread && interp == runtime->interpreters.main); } The macros and functions to access the thread state are documented as: /* Variable and macro for in-line access to current thread and interpreter state */ #define _PyRuntimeState_GetThreadState(runtime) \ ((PyThreadState*)_Py_atomic_load_relaxed(&(runtime)->gilstate.tstate_current)) /* Get the current Python thread state. Efficient macro reading directly the 'gilstate.tstate_current' atomic variable. The macro is unsafe: it does not check for error and it can return NULL. The caller must hold the GIL. See also PyThreadState_Get() and PyThreadState_GET(). */ #define _PyThreadState_GET() _PyRuntimeState_GetThreadState(&_PyRuntime) So, we see that GDB releases the GIL and then potentially calls _PyRuntimeState_GetThreadState that needs the GIL. It is not very clear why the problem is only observed when running under Valgrind. Probably caused by the slowdown due to Valgrind and/or to the 'single thread' scheduling by Valgrind. This patch fixes the crashes by releasing the GIT lock later. 2019-11-26 Philippe Waroquiers <philippe.waroquiers@skynet.be> * python/python.c (gdbpy_enter::~gdbpy_enter): Release GIL after restore_active_ext_lang, as GIL is needed for (indirectly) called PyOS_InterruptOccurred.
2019-11-23 11:08:12 +01:00
2019-11-26 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* python/python.c (gdbpy_enter::~gdbpy_enter): Release GIL after
restore_active_ext_lang, as GIL is needed for (indirectly)
called PyOS_InterruptOccurred.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* sparc-nat.c (sparc_xfer_wcookie): Sync declaration with
definition.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* remote-sim.c (simulator_command): Make static, remove
declaration.
Make functions static in unittests Enabling -Wmissing-declarations points out that a bunch of function in the unittests can be made static, do that. gdb/ChangeLog: * unittests/array-view-selftests.c (check_ptr_size_ctor2): Make static. * unittests/basic_string_view/capacity/1.cc (test01): Likewise. * unittests/basic_string_view/cons/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/cons/char/2.cc (test03): Likewise. (main): Likewise. * unittests/basic_string_view/cons/char/3.cc (test05): Likewise. (main): Likewise. * unittests/basic_string_view/element_access/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/element_access/char/empty.cc (main): Likewise. * unittests/basic_string_view/element_access/char/front_back.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/inserters/char/2.cc (test05): Likewise. (main): Likewise. * unittests/basic_string_view/modifiers/remove_prefix/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/modifiers/remove_suffix/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/modifiers/swap/char/1.cc (test01): Likewise. * unittests/basic_string_view/operations/compare/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/operations/compare/char/13650.cc (test01): Likewise. * unittests/basic_string_view/operations/copy/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/operations/data/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/operations/find/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/operations/find/char/2.cc (test02): Likewise. (main): Likewise. * unittests/basic_string_view/operations/find/char/3.cc (test03): Likewise. (main): Likewise. * unittests/basic_string_view/operations/find/char/4.cc (main): Likewise. * unittests/basic_string_view/operations/rfind/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/operations/rfind/char/2.cc (test02): Likewise. (main): Likewise. * unittests/basic_string_view/operations/rfind/char/3.cc (test03): Likewise. (main): Likewise. * unittests/basic_string_view/operations/substr/char/1.cc (test01): Likewise. (main): Likewise. * unittests/basic_string_view/operators/char/2.cc (main): Likewise. * unittests/optional/assignment/1.cc (test): Likewise. * unittests/optional/assignment/2.cc (test): Likewise. * unittests/optional/assignment/3.cc (test): Likewise. * unittests/optional/assignment/4.cc (test): Likewise. * unittests/optional/assignment/5.cc (test): Likewise. * unittests/optional/assignment/6.cc (test): Likewise. * unittests/optional/assignment/7.cc (test): Likewise. * unittests/optional/cons/copy.cc (test): Likewise. * unittests/optional/cons/default.cc (test): Likewise. * unittests/optional/cons/move.cc (test): Likewise. * unittests/optional/cons/value.cc (test): Likewise. * unittests/optional/in_place.cc (test): Likewise. * unittests/optional/observers/1.cc (test): Likewise. * unittests/optional/observers/2.cc (test): Likewise. Change-Id: I66626db864cb877cacc570d4660df633530554f5
2019-11-26 18:12:03 +01:00
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* unittests/array-view-selftests.c (check_ptr_size_ctor2): Make
static.
* unittests/basic_string_view/capacity/1.cc (test01): Likewise.
* unittests/basic_string_view/cons/char/1.cc (test01): Likewise.
(main): Likewise.
* unittests/basic_string_view/cons/char/2.cc (test03): Likewise.
(main): Likewise.
* unittests/basic_string_view/cons/char/3.cc (test05): Likewise.
(main): Likewise.
* unittests/basic_string_view/element_access/char/1.cc (test01):
Likewise.
(main): Likewise.
* unittests/basic_string_view/element_access/char/empty.cc (main):
Likewise.
* unittests/basic_string_view/element_access/char/front_back.cc
(test01): Likewise.
(main): Likewise.
* unittests/basic_string_view/inserters/char/2.cc (test05):
Likewise.
(main): Likewise.
* unittests/basic_string_view/modifiers/remove_prefix/char/1.cc
(test01): Likewise.
(main): Likewise.
* unittests/basic_string_view/modifiers/remove_suffix/char/1.cc
(test01): Likewise.
(main): Likewise.
* unittests/basic_string_view/modifiers/swap/char/1.cc (test01):
Likewise.
* unittests/basic_string_view/operations/compare/char/1.cc
(test01): Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/compare/char/13650.cc
(test01): Likewise.
* unittests/basic_string_view/operations/copy/char/1.cc (test01):
Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/data/char/1.cc (test01):
Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/find/char/1.cc (test01):
Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/find/char/2.cc (test02):
Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/find/char/3.cc (test03):
Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/find/char/4.cc (main):
Likewise.
* unittests/basic_string_view/operations/rfind/char/1.cc (test01):
Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/rfind/char/2.cc (test02):
Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/rfind/char/3.cc (test03):
Likewise.
(main): Likewise.
* unittests/basic_string_view/operations/substr/char/1.cc
(test01): Likewise.
(main): Likewise.
* unittests/basic_string_view/operators/char/2.cc (main):
Likewise.
* unittests/optional/assignment/1.cc (test): Likewise.
* unittests/optional/assignment/2.cc (test): Likewise.
* unittests/optional/assignment/3.cc (test): Likewise.
* unittests/optional/assignment/4.cc (test): Likewise.
* unittests/optional/assignment/5.cc (test): Likewise.
* unittests/optional/assignment/6.cc (test): Likewise.
* unittests/optional/assignment/7.cc (test): Likewise.
* unittests/optional/cons/copy.cc (test): Likewise.
* unittests/optional/cons/default.cc (test): Likewise.
* unittests/optional/cons/move.cc (test): Likewise.
* unittests/optional/cons/value.cc (test): Likewise.
* unittests/optional/in_place.cc (test): Likewise.
* unittests/optional/observers/1.cc (test): Likewise.
* unittests/optional/observers/2.cc (test): Likewise.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* tui-win.h (tui_set_var_cmd): Remove.
* tui-win.c (tui_set_var_cmd): Make static.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* breakpoint.h (hbreak_command_wrapper, thbreak_command_wrapper,
rbreak_command_wrapper): Remove.
* symtab.c (rbreak_command_wrapper): Remove.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* inferior.h (info_terminal_command): Remove declaration.
* inflow.c (info_terminal_command): Make static.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* inferior.c (exit_inferior_silent): Remove.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* dictionary.c (dict_empty, mdict_empty): Remove.
* dictionary.c (mdict_empty): Remove.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* arc-tdep.c (arc_insn_get_memory_base_reg): Make static.
(arc_insn_get_memory_offset): Likewise.
(arc_insn_dump): Likewise.
* cp-support.c (test_cp_symbol_name_matches): Likewise.
* csky-linux-tdep.c (csky_supply_fregset): Likewise.
* dictionary.c (dict_iterator_next): Likewise.
(dict_iter_match_first): Likewise.
(dict_iter_match_next): Likewise.
* f-lang.c (evaluate_subexp_f): Likewise.
* hppa-tdep.c (hppa_read_pc): Likewise.
* i386-tdep.c (i386_floatformat_for_type): Likewise.
* parse.c (write_exp_elt_msym): Likewise.
* ppc-linux-tdep.c (ppc_floatformat_for_type): Likewise.
* remote.c (remote_packet_size): Likewise.
(remote_notif_stop_parse): Likewise.
* rs6000-aix-tdep.c (aix_sighandle_frame_sniffer): Likewise.
* s12z-tdep.c (s12z_disassemble_info): Likewise.
* source.c (prepare_path_for_appending): Likewise.
* sparc64-linux-tdep.c
(sparc64_linux_handle_segmentation_fault); Likewise.
* stack.c (frame_selection_by_function_completer): Likewise.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* completer.c (set_gdb_completion_word_break_characters):
Remove.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* dwarf-index-write.c: Include dwarf-index-write.h.
* mi/mi-interp.c: Include mi/mi-interp.h.
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
* aarch32-tdep.c: Include aarch32-tdep.h.
* aarch32-tdep.h: Forward-declare struct target_desc.
2019-11-26 Christian Biesinger <cbiesinger@google.com>
* linux-nat.c (detach_one_lwp): Call safe_strerror instead of
strerror.
* nto-procfs.c (nto_procfs_target::create_inferior): Likewise.
* windows-nat.c (windows_nat_target::create_inferior): Likewise.
2019-11-25 Tom de Vries <tdevries@suse.de>
* contrib/words.sh: Add -c option.
2019-11-25 Christian Biesinger <cbiesinger@google.com>
* solib.c (solib_find_1): Change int to bool.
(exec_file_find): Change int to bool.
(solib_find): Change int to bool.
(solib_read_symbols): Change int to bool.
(solib_used): Change int to bool.
(solib_add): Change int to bool.
(info_sharedlibrary_command): Change int to bool.
(solib_contains_address_p): Change int to bool.
(solib_keep_data_in_core): Change int to bool.
(in_solib_dynsym_resolve_code): Change int to bool.
(reload_shared_libraries_1): Change int to bool.
(gdb_sysroot_changed): Change int to bool.
* solib.h (solib_read_symbols): Change int to bool.
(solib_contains_address_p): Change int to bool.
(solib_keep_data_in_core): Change int to bool.
(in_solib_dynsym_resolve_code): Change int to bool.
(libpthread_name_p): Change int to bool.
2019-11-25 Luis Machado <luis.machado@linaro.org>
* NEWS (New Commands): Mention "set debug remote-packet-max-chars".
* remote.c (REMOTE_DEBUG_MAX_CHAR): Remove.
(remote_packet_max_chars): New static global.
(show_remote_packet_max_chars): New function.
(remote_target::putpkt_binary): Adjust to use new
remote_packet_max_chars option.
(remote_target::getpkt_or_notif_sane_1): Likewise.
(_initialize_remote): Register new remote-packet-max-chars option.
2019-11-24 Simon Marchi <simon.marchi@efficios.com>
* m68k-linux-nat.c: Include gdbarch.h.
2019-11-24 Tom Tromey <tom@tromey.com>
* symfile.c (read_symbols): Update.
* psymtab.c (require_partial_symbols): Change type of "verbose" to
bool.
(psym_map_symtabs_matching_filename, find_pc_sect_psymtab)
(psym_lookup_symbol, psym_find_last_source_symtab)
(psym_forget_cached_source_info, psym_print_stats)
(psym_expand_symtabs_for_function, psym_expand_all_symtabs)
(psym_expand_symtabs_with_fullname, psym_map_symbol_filenames)
(psym_map_matching_symbols, psym_expand_symtabs_matching)
(psym_find_compunit_symtab_by_address)
(maintenance_print_psymbols, maintenance_info_psymtabs)
(maintenance_check_psymtabs): Update.
* psymtab.h (require_partial_symbols): Change type of "verbose" to
bool.
2019-11-22 Tom Tromey <tom@tromey.com>
* observable.h: Update comments.
2019-11-22 Tom Tromey <tromey@adacore.com>
* ada-tasks.c (ada_task_is_alive): Make parameter const.
(print_ada_task_info): Don't try to fetch thread id if task is not
alive.
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
2019-11-22 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y: Update.
* ada-lang.c (sort_choices): Update.
(ada_print_symbol_signature): Update.
(resolve_subexp): Update.
(ada_parse_renaming): Update.
(ada_read_renaming_var_value): Update.
(lesseq_defined_than): Update.
(remove_extra_symbols): Update.
(remove_irrelevant_renamings): Update.
(ada_add_block_symbols): Update.
(ada_collect_symbol_completion_matches): Update.
(ada_is_renaming_symbol): Update.
(aggregate_assign_from_choices): Update.
(ada_evaluate_subexp): Update.
(ada_has_this_exception_support): Update.
(ada_is_non_standard_exception_sym): Update.
(ada_add_exceptions_from_frame): Update.
(ada_add_global_exceptions): Update.
(ada_print_subexp): Update.
* ax-gdb.c (gen_var_ref): Update.
(gen_maybe_namespace_elt): Update.
(gen_expr_for_cast): Update.
(gen_expr): Update.
* block.h: Update.
* blockframe.c (find_pc_partial_function): Update.
* breakpoint.c (print_breakpoint_location): Update.
(update_static_tracepoint): Update.
* btrace.c (ftrace_print_function_name): Update.
(ftrace_function_switched): Update.
* buildsym.c (find_symbol_in_list): Update.
* c-exp.y: Update.
* c-typeprint.c (c_print_typedef): Update.
(c_type_print_template_args): Update.
* cli/cli-cmds.c (edit_command): Update.
(list_command): Update.
(print_sal_location): Update.
* coffread.c (patch_opaque_types): Update.
(process_coff_symbol): Update.
(coff_read_enum_type): Update.
* compile/compile-c-symbols.c (c_symbol_substitution_name): Update.
(convert_one_symbol): Update.
(hash_symname): Update.
(eq_symname): Update.
* compile/compile-cplus-symbols.c (convert_one_symbol): Update.
* compile/compile-cplus-types.c (debug_print_scope): Update.
* compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update.
* compile/compile-object-load.c (get_out_value_type): Update.
* cp-namespace.c (cp_scan_for_anonymous_namespaces): Update.
(search_symbol_list): Update.
(cp_lookup_symbol_imports_or_template): Update.
* cp-support.c (overload_list_add_symbol): Update.
* ctfread.c (psymtab_to_symtab): Update.
* dbxread.c (cp_set_block_scope): Update.
* dictionary.c (iter_match_first_hashed): Update.
(iter_match_next_hashed): Update.
(insert_symbol_hashed): Update.
(iter_match_next_linear): Update.
* dictionary.h: Update.
* dwarf2loc.c (func_get_frame_base_dwarf_block): Update.
(locexpr_describe_location_piece): Update.
(locexpr_describe_location_1): Update.
(locexpr_generate_c_location): Update.
(loclist_describe_location): Update.
(loclist_generate_c_location): Update.
* dwarf2read.c (dw2_debug_names_lookup_symbol): Update.
(read_func_scope): Update.
(process_enumeration_scope): Update.
(new_symbol): Update.
(dwarf2_const_value): Update.
(dwarf2_symbol_mark_computed): Update.
* eval.c (evaluate_funcall): Update.
(evaluate_subexp_standard): Update.
* expprint.c (print_subexp_standard): Update.
(dump_subexp_body_standard): Update.
* f-valprint.c (info_common_command_for_block): Update.
* findvar.c (get_hosting_frame): Update.
(default_read_var_value): Update.
* go-lang.c (go_symbol_package_name): Update.
* guile/scm-block.c (bkscm_print_block_smob): Update.
* guile/scm-symbol.c (syscm_print_symbol_smob): Update.
(gdbscm_symbol_name): Update.
(gdbscm_symbol_linkage_name): Update.
(gdbscm_symbol_print_name): Update.
* infcall.c (get_function_name): Update.
* infcmd.c (jump_command): Update.
(finish_command): Update.
* infrun.c (insert_exception_resume_breakpoint): Update.
* linespec.c (canonicalize_linespec): Update.
(create_sals_line_offset): Update.
(convert_linespec_to_sals): Update.
(complete_label): Update.
(find_label_symbols_in_block): Update.
* m2-typeprint.c (m2_print_typedef): Update.
* mdebugread.c (mdebug_reg_to_regnum): Update.
(parse_symbol): Update.
(mylookup_symbol): Update.
* mi/mi-cmd-stack.c (list_arg_or_local): Update.
(list_args_or_locals): Update.
* objc-lang.c (compare_selectors): Update.
(info_selectors_command): Update.
(compare_classes): Update.
(info_classes_command): Update.
(find_imps): Update.
* p-typeprint.c (pascal_print_typedef): Update.
* printcmd.c (build_address_symbolic): Update.
(info_address_command): Update.
(print_variable_and_value): Update.
* python/py-framefilter.c (extract_sym): Update.
(py_print_single_arg): Update.
* python/py-symbol.c (sympy_str): Update.
(sympy_get_name): Update.
(sympy_get_linkage_name): Update.
* python/python.c (gdbpy_rbreak): Update.
* record-btrace.c (btrace_get_bfun_name): Update.
(btrace_call_history): Update.
* rust-lang.c (rust_print_typedef): Update.
* solib-frv.c (frv_fdpic_find_canonical_descriptor): Update.
* stabsread.c (stab_reg_to_regnum): Update.
(define_symbol): Update.
(read_enum_type): Update.
(common_block_end): Update.
(cleanup_undefined_types_1): Update.
(scan_file_globals): Update.
* stack.c (print_frame_arg): Update.
(print_frame_args): Update.
(find_frame_funname): Update.
(info_frame_command_core): Update.
(iterate_over_block_locals): Update.
(print_block_frame_labels): Update.
(do_print_variable_and_value): Update.
(iterate_over_block_arg_vars): Update.
(return_command): Update.
* symmisc.c (dump_symtab_1): Update.
(print_symbol): Update.
* symtab.c (eq_symbol_entry): Update.
(symbol_cache_dump): Update.
(lookup_language_this): Update.
(find_pc_sect_line): Update.
(skip_prologue_sal): Update.
(symbol_search::compare_search_syms): Update.
(treg_matches_sym_type_name): Update.
(search_symbols): Update.
(print_symbol_info): Update.
(rbreak_command): Update.
(completion_list_add_symbol): Update.
(find_gnu_ifunc): Update.
(get_symbol_address): Update.
(search_module_symbols): Update.
(info_module_subcommand): Update.
* symtab.h (SYMBOL_NATURAL_NAME): Remove.
(SYMBOL_LINKAGE_NAME): Remove.
(SYMBOL_DEMANGLED_NAME): Remove.
(SYMBOL_PRINT_NAME): Remove.
(SYMBOL_SEARCH_NAME): Remove.
* tracepoint.c (set_traceframe_context): Update.
(validate_actionline): Update.
(collection_list::collect_symbol): Update.
(encode_actions_1): Update.
(info_scope_command): Update.
(print_one_static_tracepoint_marker): Update.
* typeprint.c (typedef_hash_table::add_template_parameters): Update.
* valops.c (address_of_variable): Update.
(find_overload_match): Update.
(find_oload_champ): Update.
Replace the MSYMBOL_*_NAME macros with member functions Improves readability. In the future, it will also allow making the name private, once the name setter functions become member functions. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_lookup_simple_minsym): Update. (ada_collect_symbol_completion_matches): Update. * ada-tasks.c (read_atcb): Update. * amd64-windows-tdep.c (amd64_skip_main_prologue): Update. (amd64_windows_skip_trampoline_code): Update. * arm-tdep.c (skip_prologue_function): Update. (arm_skip_stack_protector): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. (arm_wince_skip_main_prologue): Update. * ax-gdb.c (gen_expr): Update. * block.c (call_site_for_pc): Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (set_breakpoint_location_function): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * c-valprint.c (print_unpacked_pointer): Update. * coffread.c (coff_symfile_read): Update. * compile/compile-c-symbols.c (convert_symbol_bmsym): Update. * compile/compile-cplus-symbols.c (convert_symbol_bmsym): Update. * dwarf-index-write.c (write_psymbols): 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. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. (evaluate_subexp_for_sizeof): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * frame.c (get_prev_frame_always_1): Update. * frv-tdep.c (frv_skip_main_prologue): Update. * gnu-v2-abi.c (gnuv2_value_rtti_type): Update. * gnu-v3-abi.c (gnuv3_rtti_type): Update. (gnuv3_get_typename_from_type_info): Update. (gnuv3_skip_trampoline): Update. * hppa-tdep.c (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. * linespec.c (minsym_found): Update. * linux-fork.c (info_checkpoints_command): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. (m32c_m16c_pointer_to_address): Update. * maint.c (maintenance_translate_address): Update. * minsyms.c (add_minsym_to_hash_table): Update. (add_minsym_to_demangled_hash_table): Update. (lookup_minimal_symbol_mangled): Update. (lookup_minimal_symbol_demangled): Update. (lookup_minimal_symbol_linkage): Update. (lookup_minimal_symbol_text): Update. (lookup_minimal_symbol_by_pc_name): Update. (minimal_symbol_is_less_than): Update. (compact_minimal_symbols): Update. (build_minimal_symbol_hash_tables): Update. (find_solib_trampoline_target): 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 (info_selectors_command): Update. (info_classes_command): Update. (find_methods): Update. (find_imps): Update. * p-valprint.c (pascal_val_print): Update. * ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * printcmd.c (build_address_symbolic): Update. (info_symbol_command): Update. * psymtab.c (psymbol_name_matches): Update. (match_partial_symbol): Update. (lookup_partial_symbol): Update. (print_partial_symbols): Update. (sort_pst_symbols): Update. (maintenance_check_psymtabs): Update. * python/py-framefilter.c (py_print_frame): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rs6000-tdep.c (rs6000_skip_main_prologue): Update. (rs6000_skip_trampoline_code): Update. * sol-thread.c (info_cb): Update. * stabsread.c (scan_file_globals): Update. * stack.c (find_frame_funname): Update. (info_frame_command_core): Update. * symmisc.c (dump_msymbols): Update. * symtab.c (symbol_natural_name): Rename to.., (general_symbol_info::natural_name): ...this. (symbol_demangled_name): Rename to... (general_symbol_info::demangled_name): ...this. (symbol_search_name): Rename to... (general_symbol_info::search_name): ...this. (symbol_matches_search_name): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (search_symbols): Update. (print_msymbol_info): Update. (rbreak_command): Update. (completion_list_add_msymbol): Update. (completion_list_objc_symbol): Update. (get_msymbol_address): Update. * symtab.h (struct general_symbol_info): Add member functions natural_name (), linkage_name (), print_name (), demangled_name (), and search_name (). (SYMBOL_NATURAL_NAME): Update. (symbol_natural_name): Move to a member function on general_symbol_info. (SYMBOL_DEMANGLED_NAME): Update. (symbol_demangled_name): Move to a member function on general_symbol_info. (SYMBOL_SEARCH_NAME): Update. (symbol_search_name): Move to a member function on general_symbol_info. (MSYMBOL_NATURAL_NAME): Remove. (MSYMBOL_LINKAGE_NAME): Remove. (MSYMBOL_PRINT_NAME): Remove. (MSYMBOL_DEMANGLED_NAME): Remove. (MSYMBOL_SEARCH_NAME): Remove. * x86-tdep.c (x86_in_indirect_branch_thunk): Update. Change-Id: I65aa529843a9903e174ce799037e41f954a9fcee
2019-11-22 19:05:14 +01:00
2019-11-22 Christian Biesinger <cbiesinger@google.com>
* ada-lang.c (ada_lookup_simple_minsym): Update.
(ada_collect_symbol_completion_matches): Update.
* ada-tasks.c (read_atcb): Update.
* amd64-windows-tdep.c (amd64_skip_main_prologue): Update.
(amd64_windows_skip_trampoline_code): Update.
* arm-tdep.c (skip_prologue_function): Update.
(arm_skip_stack_protector): Update.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update.
(arm_wince_skip_main_prologue): Update.
* ax-gdb.c (gen_expr): Update.
* block.c (call_site_for_pc): Update.
* blockframe.c (find_pc_partial_function): Update.
* breakpoint.c (set_breakpoint_location_function): Update.
* btrace.c (ftrace_print_function_name): Update.
(ftrace_function_switched): Update.
* c-valprint.c (print_unpacked_pointer): Update.
* coffread.c (coff_symfile_read): Update.
* compile/compile-c-symbols.c (convert_symbol_bmsym): Update.
* compile/compile-cplus-symbols.c (convert_symbol_bmsym): Update.
* dwarf-index-write.c (write_psymbols): 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.
* eval.c (evaluate_funcall): Update.
(evaluate_subexp_standard): Update.
(evaluate_subexp_for_sizeof): Update.
* expprint.c (print_subexp_standard): Update.
(dump_subexp_body_standard): Update.
* frame.c (get_prev_frame_always_1): Update.
* frv-tdep.c (frv_skip_main_prologue): Update.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Update.
* gnu-v3-abi.c (gnuv3_rtti_type): Update.
(gnuv3_get_typename_from_type_info): Update.
(gnuv3_skip_trampoline): Update.
* hppa-tdep.c (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.
* linespec.c (minsym_found): Update.
* linux-fork.c (info_checkpoints_command): Update.
* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
(m32c_m16c_pointer_to_address): Update.
* maint.c (maintenance_translate_address): Update.
* minsyms.c (add_minsym_to_hash_table): Update.
(add_minsym_to_demangled_hash_table): Update.
(lookup_minimal_symbol_mangled): Update.
(lookup_minimal_symbol_demangled): Update.
(lookup_minimal_symbol_linkage): Update.
(lookup_minimal_symbol_text): Update.
(lookup_minimal_symbol_by_pc_name): Update.
(minimal_symbol_is_less_than): Update.
(compact_minimal_symbols): Update.
(build_minimal_symbol_hash_tables): Update.
(find_solib_trampoline_target): 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 (info_selectors_command): Update.
(info_classes_command): Update.
(find_methods): Update.
(find_imps): Update.
* p-valprint.c (pascal_val_print): Update.
* ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code): Update.
* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
* printcmd.c (build_address_symbolic): Update.
(info_symbol_command): Update.
* psymtab.c (psymbol_name_matches): Update.
(match_partial_symbol): Update.
(lookup_partial_symbol): Update.
(print_partial_symbols): Update.
(sort_pst_symbols): Update.
(maintenance_check_psymtabs): Update.
* python/py-framefilter.c (py_print_frame): Update.
* python/python.c (gdbpy_rbreak): Update.
* record-btrace.c (btrace_get_bfun_name): Update.
(btrace_call_history): Update.
* rs6000-tdep.c (rs6000_skip_main_prologue): Update.
(rs6000_skip_trampoline_code): Update.
* sol-thread.c (info_cb): Update.
* stabsread.c (scan_file_globals): Update.
* stack.c (find_frame_funname): Update.
(info_frame_command_core): Update.
* symmisc.c (dump_msymbols): Update.
* symtab.c (symbol_natural_name): Rename to..,
(general_symbol_info::natural_name): ...this.
(symbol_demangled_name): Rename to...
(general_symbol_info::demangled_name): ...this.
(symbol_search_name): Rename to...
(general_symbol_info::search_name): ...this.
(symbol_matches_search_name): Update.
(find_pc_sect_line): Update.
(skip_prologue_sal): Update.
(search_symbols): Update.
(print_msymbol_info): Update.
(rbreak_command): Update.
(completion_list_add_msymbol): Update.
(completion_list_objc_symbol): Update.
(get_msymbol_address): Update.
* symtab.h (struct general_symbol_info): Add member functions
natural_name (), linkage_name (), print_name (), demangled_name (),
and search_name ().
(SYMBOL_NATURAL_NAME): Update.
(symbol_natural_name): Move to a member function on general_symbol_info.
(SYMBOL_DEMANGLED_NAME): Update.
(symbol_demangled_name): Move to a member function on
general_symbol_info.
(SYMBOL_SEARCH_NAME): Update.
(symbol_search_name): Move to a member function on general_symbol_info.
(MSYMBOL_NATURAL_NAME): Remove.
(MSYMBOL_LINKAGE_NAME): Remove.
(MSYMBOL_PRINT_NAME): Remove.
(MSYMBOL_DEMANGLED_NAME): Remove.
(MSYMBOL_SEARCH_NAME): Remove.
* x86-tdep.c (x86_in_indirect_branch_thunk): Update.
2019-11-22 Christian Biesinger <cbiesinger@google.com>
* symtab.c (create_demangled_names_hash): Use per_bfd->
minimal_symbol_count for computing the initial size, if greater
than our default size.
2019-11-22 Tom de Vries <tdevries@suse.de>
* contrib/words.sh: Improve words extraction.
2019-11-22 Tom de Vries <tdevries@suse.de>
* contrib/words.sh: Combine sed invocations.
2019-11-21 Christian Biesinger <cbiesinger@google.com>
* Makefile.in: Update.
* demangle.c: Rename to...
* gdb-demangle.c: ..this.
(is_cplus_marker): Change return type to bool.
(_initialize_demangler): Rename to...
(_initialize_gdb_demangle): ...this.
* gdb-demangle.h (is_cplus_marker): Change return type to bool.
* symtab.h (demangle): Remove declaration; instead include
gdb-demangle.h.
2019-11-21 Tom Tromey <tromey@adacore.com>
* gdbsupport/format.c (format_pieces): Parse %I64d.
* unittests/format_pieces-selftests.c (test_windows_formats): New
function.
(run_tests): Call it.
Adjust byte order variable display/change if DW_AT_endianity is present. - Rationale: It is possible for compilers to indicate the desired byte order interpretation of scalar variables using the DWARF attribute: DW_AT_endianity A type flagged with this variable would typically use one of: DW_END_big DW_END_little which instructs the debugger what the desired byte order interpretation of the variable should be. The GCC compiler (as of V6) has a mechanism for setting the desired byte ordering of the fields within a structure or union. For, example, on a little endian target, a structure declared as: struct big { int v; short a[4]; } __attribute__( ( scalar_storage_order( "big-endian" ) ) ); could be used to ensure all the structure members have a big-endian interpretation (the compiler would automatically insert byte swap instructions before and after respective store and load instructions). - To reproduce GCC V8 is required to correctly emit DW_AT_endianity DWARF attributes in all situations when the scalar_storage_order attribute is used. A fix for (dwarf endianity instrumentation) for GCC V6-V7 can be found in the URL field of the following PR: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82509 - Test-case: A new test case (testsuite/gdb.base/endianity.*) is included with this patch. Manual testing for mixed endianity code has also been done with GCC V8. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82509#c4 - Observed vs. expected: Without this change, using scalar_storage_order that doesn't match the target, such as struct otherendian { int v; } __attribute__( ( scalar_storage_order( "big-endian" ) ) ); would behave like the following on a little endian target: Breakpoint 1 at 0x401135: file endianity.c, line 41. (gdb) run Starting program: /home/pjoot/freeware/t/a.out Missing separate debuginfos, use: debuginfo-install glibc-2.17-292.el7.x86_64 Breakpoint 1, main () at endianity.c:41 41 struct otherendian o = {3}; (gdb) n 43 do_nothing (&o); /* START */ (gdb) p o $1 = {v = 50331648} (gdb) p /x $2 = {v = 0x3000000} whereas with this gdb enhancement we can access the variable with the user specified endianity: Breakpoint 1, main () at endianity.c:41 41 struct otherendian o = {3}; (gdb) p o $1 = {v = 0} (gdb) n 43 do_nothing (&o); /* START */ (gdb) p o $2 = {v = 3} (gdb) p o.v = 4 $3 = 4 (gdb) p o.v $4 = 4 (gdb) x/4xb &o.v 0x7fffffffd90c: 0x00 0x00 0x00 0x04 (observe that the 4 byte int variable has a big endian representation in the hex dump.) gdb/ChangeLog 2019-11-21 Peeter Joot <peeter.joot@lzlabs.com> Byte reverse display of variables with DW_END_big, DW_END_little (DW_AT_endianity) dwarf attributes if different than the native byte order. * ada-lang.c (ada_value_binop): Use type_byte_order instead of gdbarch_byte_order. * ada-valprint.c (printstr): (ada_val_print_string): * ada-lang.c (value_pointer): (ada_value_binop): Use type_byte_order instead of gdbarch_byte_order. * c-lang.c (c_get_string): Use type_byte_order instead of gdbarch_byte_order. * c-valprint.c (c_val_print_array): Use type_byte_order instead of gdbarch_byte_order. * cp-valprint.c (cp_print_class_member): Use type_byte_order instead of gdbarch_byte_order. * dwarf2loc.c (rw_pieced_value): Use type_byte_order instead of gdbarch_byte_order. * dwarf2read.c (read_base_type): Handle DW_END_big, DW_END_little * f-lang.c (f_get_encoding): Use type_byte_order instead of gdbarch_byte_order. * findvar.c (default_read_var_value): Use type_byte_order instead of gdbarch_byte_order. * gdbtypes.c (check_types_equal): Require matching TYPE_ENDIANITY_NOT_DEFAULT if set. (recursive_dump_type): Print TYPE_ENDIANITY_BIG, and TYPE_ENDIANITY_LITTLE if set. (type_byte_order): new function. * gdbtypes.h (TYPE_ENDIANITY_NOT_DEFAULT): New macro. (struct main_type) <flag_endianity_not_default>: New field. (type_byte_order): New function. * infcmd.c (default_print_one_register_info): Use type_byte_order instead of gdbarch_byte_order. * p-lang.c (pascal_printstr): Use type_byte_order instead of gdbarch_byte_order. * p-valprint.c (pascal_val_print): Use type_byte_order instead of gdbarch_byte_order. * printcmd.c (print_scalar_formatted): Use type_byte_order instead of gdbarch_byte_order. * solib-darwin.c (darwin_current_sos): Use type_byte_order instead of gdbarch_byte_order. * solib-svr4.c (solib_svr4_r_ldsomap): Use type_byte_order instead of gdbarch_byte_order. * stap-probe.c (stap_modify_semaphore): Use type_byte_order instead of gdbarch_byte_order. * target-float.c (target_float_same_format_p): Use type_byte_order instead of gdbarch_byte_order. * valarith.c (scalar_binop): (value_bit_index): Use type_byte_order instead of gdbarch_byte_order. * valops.c (value_cast): Use type_byte_order instead of gdbarch_byte_order. * valprint.c (generic_emit_char): (generic_printstr): (val_print_string): Use type_byte_order instead of gdbarch_byte_order. * value.c (unpack_long): (unpack_bits_as_long): (unpack_value_bitfield): (modify_field): (pack_long): (pack_unsigned_long): Use type_byte_order instead of gdbarch_byte_order. * findvar.c (unsigned_pointer_to_address): (signed_pointer_to_address): (unsigned_address_to_pointer): (address_to_signed_pointer): (default_read_var_value): (default_value_from_register): Use type_byte_order instead of gdbarch_byte_order. * gnu-v3-abi.c (gnuv3_make_method_ptr): Use type_byte_order instead of gdbarch_byte_order. * riscv-tdep.c (riscv_print_one_register_info): Use type_byte_order instead of gdbarch_byte_order. gdb/testsuite/ChangeLog 2019-11-21 Peeter Joot <peeter.joot@lzlabs.com> * gdb.base/endianity.c: New test. * gdb.base/endianity.exp: New file. Change-Id: I4bd98c1b4508c2d7c5a5dbb15d7b7b1cb4e667e2
2017-10-06 22:13:04 +02:00
2019-11-21 Peeter Joot <peeter.joot@lzlabs.com>
Byte reverse display of variables with DW_END_big, DW_END_little
(DW_AT_endianity) dwarf attributes if different than the native
byte order.
* ada-lang.c (ada_value_binop):
Use type_byte_order instead of gdbarch_byte_order.
* ada-valprint.c (printstr):
(ada_val_print_string):
* ada-lang.c (value_pointer):
(ada_value_binop):
Use type_byte_order instead of gdbarch_byte_order.
* c-lang.c (c_get_string):
Use type_byte_order instead of gdbarch_byte_order.
* c-valprint.c (c_val_print_array):
Use type_byte_order instead of gdbarch_byte_order.
* cp-valprint.c (cp_print_class_member):
Use type_byte_order instead of gdbarch_byte_order.
* dwarf2loc.c (rw_pieced_value):
Use type_byte_order instead of gdbarch_byte_order.
* dwarf2read.c (read_base_type): Handle DW_END_big,
DW_END_little
* f-lang.c (f_get_encoding):
Use type_byte_order instead of gdbarch_byte_order.
* findvar.c (default_read_var_value):
Use type_byte_order instead of gdbarch_byte_order.
* gdbtypes.c (check_types_equal):
Require matching TYPE_ENDIANITY_NOT_DEFAULT if set.
(recursive_dump_type): Print TYPE_ENDIANITY_BIG,
and TYPE_ENDIANITY_LITTLE if set.
(type_byte_order): new function.
* gdbtypes.h (TYPE_ENDIANITY_NOT_DEFAULT): New macro.
(struct main_type) <flag_endianity_not_default>:
New field.
(type_byte_order): New function.
* infcmd.c (default_print_one_register_info):
Use type_byte_order instead of gdbarch_byte_order.
* p-lang.c (pascal_printstr):
Use type_byte_order instead of gdbarch_byte_order.
* p-valprint.c (pascal_val_print):
Use type_byte_order instead of gdbarch_byte_order.
* printcmd.c (print_scalar_formatted):
Use type_byte_order instead of gdbarch_byte_order.
* solib-darwin.c (darwin_current_sos):
Use type_byte_order instead of gdbarch_byte_order.
* solib-svr4.c (solib_svr4_r_ldsomap):
Use type_byte_order instead of gdbarch_byte_order.
* stap-probe.c (stap_modify_semaphore):
Use type_byte_order instead of gdbarch_byte_order.
* target-float.c (target_float_same_format_p):
Use type_byte_order instead of gdbarch_byte_order.
* valarith.c (scalar_binop):
(value_bit_index):
Use type_byte_order instead of gdbarch_byte_order.
* valops.c (value_cast):
Use type_byte_order instead of gdbarch_byte_order.
* valprint.c (generic_emit_char):
(generic_printstr):
(val_print_string):
Use type_byte_order instead of gdbarch_byte_order.
* value.c (unpack_long):
(unpack_bits_as_long):
(unpack_value_bitfield):
(modify_field):
(pack_long):
(pack_unsigned_long):
Use type_byte_order instead of gdbarch_byte_order.
* findvar.c (unsigned_pointer_to_address):
(signed_pointer_to_address):
(unsigned_address_to_pointer):
(address_to_signed_pointer):
(default_read_var_value):
(default_value_from_register):
Use type_byte_order instead of gdbarch_byte_order.
* gnu-v3-abi.c (gnuv3_make_method_ptr):
Use type_byte_order instead of gdbarch_byte_order.
* riscv-tdep.c (riscv_print_one_register_info):
Use type_byte_order instead of gdbarch_byte_order.
2019-11-21 Simon Marchi <simon.marchi@polymtl.ca>
* top.c (current_ui_gdb_stdout_ptr): Spell out by hand.
(current_ui_gdb_stdin_ptr): Likewise.
(current_ui_gdb_stderr_ptr): Likewise.
(current_ui_gdb_stdlog_ptr): Likewise.
(current_ui_current_uiout_ptr): Likewise.
(gen_ret_current_ui_field_ptr): Remove.
[gdb] Only force INTERP_CONSOLE ui_out for breakpoint commands in MI mode The problem reported in PR mi/25055 is that the output of the backtrace command, when executed as breakpoint command does not show when executing using the MI interpreter: ... $ gdb a.out Reading symbols from a.out... (gdb) break main Breakpoint 1 at 0x4003c0: file test.c, line 19. (gdb) commands Type commands for breakpoint(s) 1, one per line. End with a line saying just "end". >bt >end (gdb) interpreter-exec mi "-exec-run" ^done Breakpoint 1, main () at test.c:19 19 return foo (4); (gdb) ... Interestingly, the function print_frame is called twice during -exec-run: - once during tui_on_normal_stop where the ui_out is temporarily set to tui->interp_ui_out (), resulting in the part after the comma in "Breakpoint 1, main () at test.c:19" - once during execute_control_command, where the ui_out is the default for the current interpreter: mi_ui_out, which ignores calls to output text. The commit 3a87ae656c2 "Use console uiout when executing breakpoint commands" fixes the problem by temporarily switching to the ui_out of INTERP_CONSOLE in execute_control_command. This however caused a regression in redirection (escaping '#' using '\' for git commit message convenience): ... $ rm -f gdb.txt; gdb a.out Reading symbols from a.out... (gdb) break main Breakpoint 1 at 0x4003c0: file test.c, line 19. (gdb) commands Type commands for breakpoint(s) 1, one per line. End with a line saying just "end". >bt >end (gdb) set logging redirect on (gdb) set logging on Redirecting output to gdb.txt. Copying debug output to gdb.txt. (gdb) run \#0 main () at test.c:19 (gdb) q A debugging session is active. Inferior 1 [process 22428] will be killed. Quit anyway? (y or n) y $ cat gdb.txt Starting program: /data/gdb_versions/devel/a.out Breakpoint 1, main () at test.c:19 19 return foo (4); ... The problem is that the '#0 main () at test.c:19' ends up in the gdb output output rather than in gdb.txt. This is due to the fact that the redirect is setup for the current ui_out (which is tui->interp_ui_out ()), while the backtrace output is printed to the INTERP_CONSOLE ui_out. Fix this by limiting switching to INTERP_CONSOLE ui_out to when INTERP_MI is active. Tested on x86_64-linux. gdb/ChangeLog: 2019-11-21 Tom de Vries <tdevries@suse.de> PR gdb/24956 * cli/cli-script.c (execute_control_command): Only switch to INTERP_CONSOLE's ui_out when INTERP_MI is active. gdb/testsuite/ChangeLog: 2019-11-21 Tom de Vries <tdevries@suse.de> PR gdb/24956 * gdb.base/ui-redirect.exp: Test output of user-defined command. Change-Id: Id1771e7fcc9496a7d97ec2b2ea6b1487596f1ef7
2019-11-21 11:02:27 +01:00
2019-11-21 Tom de Vries <tdevries@suse.de>
PR gdb/24956
* cli/cli-script.c (execute_control_command): Only switch to
INTERP_CONSOLE's ui_out when INTERP_MI is active.
2019-11-19 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_partial_win_by_name): Move from tui-data.c.
Now static. Change type of "name".
(tui_set_win_height_command): Don't copy "arg".
* tui/tui-data.h (tui_partial_win_by_name): Don't declare.
* tui/tui-data.c (tui_partial_win_by_name): Move to tui-win.c.
2019-11-19 Ali Tamur <tamur@google.com>
* dwarf2read.c (dw2_get_file_names_reader): Replace "if (attr)" with
"if (attr != nullptr)".
(dwarf2_find_base_address): Likewise.
(dwarf2_build_include_psymtabs): Likewise.
(read_cutu_die_from_dwo): Likewise.
(read_func_scope): Likewise.
(read_call_site_scope): Likewise.
(dwarf2_get_pc_bounds): Likewise.
(dwarf2_record_block_ranges): Likewise.
(dwarf2_add_field): Likewise.
(dwarf2_add_member_fn): Likewise.
(read_structure_type): Likewise.
(read_enumeration_type): Likewise.
(read_array_type): Likewise.
(read_array_order): Likewise.
(read_set_type): Likewise.
(read_common_block): Likewise.
(read_tag_reference_type): Likewise.
(read_tag_string_type): Likewise.
(read_subroutine_type): Likewise.
(read_base_type): Likewise.
(read_subrange_type): Likewise.
(new_symbol): Likewise.
(prepare_one_comp_unit): Likewise.
2019-11-19 Tom Tromey <tromey@adacore.com>
* windows-nat.c (windows_nat_target::attach): Include GetLastError
result in error when DebugActiveProcess fails.
Fix crash with core + TUI + run Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1765117 A segfault can happen in a specific scenario when using TUI + a corefile, as explained in the bug mentioned above. The problem happens when opening a corefile on GDB: $ gdb ./core program entering TUI (C-x a), and then issuing a "run" command. GDB segfaults with the following stack trace: (top-gdb) bt #0 0x00000000004cd5da in target_ops::shortname (this=0x0) at ../../binutils-gdb/gdb/target.h:449 #1 0x0000000000ac08fb in target_shortname () at ../../binutils-gdb/gdb/target.h:1323 #2 0x0000000000ac09ae in tui_locator_window::make_status_line[abi:cxx11]() const (this=0x23e1fa0 <_locator>) at ../../binutils-gdb/gdb/tui/tui-stack.c:86 #3 0x0000000000ac1043 in tui_locator_window::rerender (this=0x23e1fa0 <_locator>) at ../../binutils-gdb/gdb/tui/tui-stack.c:231 #4 0x0000000000ac1632 in tui_show_locator_content () at ../../binutils-gdb/gdb/tui/tui-stack.c:369 #5 0x0000000000ac63b6 in tui_set_key_mode (mode=TUI_COMMAND_MODE) at ../../binutils-gdb/gdb/tui/tui.c:321 #6 0x0000000000aaf9be in tui_inferior_exit (inf=0x2d446a0) at ../../binutils-gdb/gdb/tui/tui-hooks.c:181 #7 0x000000000044cddf in std::_Function_handler<void (inferior*), void (*)(inferior*)>::_M_invoke(std::_Any_data const&, inferior*&&) (__functor=..., __args#0=@0x7fffffffd650: 0x2d446a0) at /usr/include/c++/9/bits/std_function.h:300 #8 0x0000000000757db9 in std::function<void (inferior*)>::operator()(inferior*) const (this=0x2cf3168, __args#0=0x2d446a0) at /usr/include/c++/9/bits/std_function.h:690 #9 0x0000000000757876 in gdb::observers::observable<inferior*>::notify (this=0x23de0c0 <gdb::observers::inferior_exit>, args#0=0x2d446a0) at ../../binutils-gdb/gdb/gdbsupport/observable.h:106 #10 0x000000000075532d in exit_inferior_1 (inftoex=0x2d446a0, silent=1) at ../../binutils-gdb/gdb/inferior.c:191 #11 0x0000000000755460 in exit_inferior_silent (inf=0x2d446a0) at ../../binutils-gdb/gdb/inferior.c:234 #12 0x000000000059f47c in core_target::close (this=0x2d68590) at ../../binutils-gdb/gdb/corelow.c:265 #13 0x0000000000a7688c in target_close (targ=0x2d68590) at ../../binutils-gdb/gdb/target.c:3293 #14 0x0000000000a63d74 in target_stack::push (this=0x23e1800 <g_target_stack>, t=0x23c38c8 <the_amd64_linux_nat_target>) at ../../binutils-gdb/gdb/target.c:568 #15 0x0000000000a63dbf in push_target (t=0x23c38c8 <the_amd64_linux_nat_target>) at ../../binutils-gdb/gdb/target.c:583 #16 0x0000000000748088 in inf_ptrace_target::create_inferior (this=0x23c38c8 <the_amd64_linux_nat_target>, exec_file=0x2d58d30 "/usr/bin/cat", allargs="", env=0x25f12b0, from_tty=1) at ../../binutils-gdb/gdb/inf-ptrace.c:128 #17 0x0000000000795ccb in linux_nat_target::create_inferior (this=0x23c38c8 <the_amd64_linux_nat_target>, exec_file=0x2d58d30 "/usr/bin/cat", allargs="", env=0x25f12b0, from_tty=1) at ../../binutils-gdb/gdb/linux-nat.c:1094 #18 0x000000000074eae9 in run_command_1 (args=0x0, from_tty=1, run_how=RUN_NORMAL) at ../../binutils-gdb/gdb/infcmd.c:639 ... The problem happens because 'tui_locator_window::make_status_line' needs the value of 'target_shortname' in order to update the status line. 'target_shortname' is a macro which expands to: #define target_shortname (current_top_target ()->shortname ()) and, in our scenario, 'current_top_target ()' returns NULL, which obviously causes a segfault. But why does it return NULL, since, according to its comment on target.h, it should never do that? What is happening is that we're being caught in the middle of a "target switch". We had the 'core_target' on top, because we were inspecting a corefile, but when the user decided to invoke "run" GDB had to actually create the inferior, which ends up detecting that we have a target already, and tries to close it (from target.c): /* See target.h. */ void target_stack::push (target_ops *t) { /* If there's already a target at this stratum, remove it. */ strata stratum = t->stratum (); if (m_stack[stratum] != NULL) { target_ops *prev = m_stack[stratum]; m_stack[stratum] = NULL; target_close (prev); // <-- here } ... When the current target ('core_target') is being closed, it checks for possible observers registered with it and calls them. TUI is one of those observers, it gets called, tries to update the status line, and GDB crashes. The real problem is that we are clearing 'm_stack[stratum]', but forgetting to adjust 'm_top'. Interestingly, this scenario is covered in 'target_stack::unpush', but Pedro said he forgot to call it here.. The fix, therefore, is to call '::unpush' if there's a target on the stack. This patch has been tested on the Buildbot and no regressions have been found. I'm also submitting a testcase for it. gdb/ChangeLog: 2019-11-18 Sergio Durigan Junior <sergiodj@redhat.com> Pedro Alves <palves@redhat.com> https://bugzilla.redhat.com/show_bug.cgi?id=1765117 * target.c (target_stack::push): Call 'unpush' if there's a target on top of the stack. gdb/testsuite/ChangeLog: 2019-11-18 Sergio Durigan Junior <sergiodj@redhat.com> https://bugzilla.redhat.com/show_bug.cgi?id=1765117 * gdb.tui/corefile-run.exp: New file. Change-Id: I39e2f8b538c580c8ea5bf1d657ee877e47746c8f
2019-10-30 18:58:29 +01:00
2019-11-18 Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1765117
* target.c (target_stack::push): Call 'unpush' if there's a
target on top of the stack.
Fix a bunch of python leaks due to missing calls to tp_free in *_dealloc functions. valgrind reports leaks in many python tests, such as: ==17162== VALGRIND_GDB_ERROR_BEGIN ==17162== 8,208 (5,472 direct, 2,736 indirect) bytes in 57 blocks are definitely lost in loss record 7,551 of 7,679 ==17162== at 0x4835753: malloc (vg_replace_malloc.c:307) ==17162== by 0x6EAFD1: _PyObject_New (object.c:279) ==17162== by 0x4720E6: blpy_iter(_object*) (py-block.c:92) ==17162== by 0x698772: PyObject_GetIter (abstract.c:2577) ==17162== by 0x2343BE: _PyEval_EvalFrameDefault (ceval.c:3159) ==17162== by 0x22E9E2: function_code_fastcall (call.c:283) ==17162== by 0x2340A8: _PyObject_Vectorcall (abstract.h:127) ==17162== by 0x2340A8: call_function (ceval.c:4987) ==17162== by 0x2340A8: _PyEval_EvalFrameDefault (ceval.c:3486) ==17162== by 0x22E9E2: function_code_fastcall (call.c:283) ==17162== by 0x82172B: _PyObject_Vectorcall (abstract.h:127) ==17162== by 0x82172B: method_vectorcall (classobject.c:67) ==17162== by 0x6AF474: _PyObject_Vectorcall (abstract.h:127) ==17162== by 0x6AF474: _PyObject_CallNoArg (abstract.h:153) ==17162== by 0x6AF474: _PyObject_CallFunctionVa (call.c:914) ==17162== by 0x6B0673: callmethod (call.c:1010) ==17162== by 0x6B0673: _PyObject_CallMethod_SizeT (call.c:1103) ==17162== by 0x477DFE: gdb_PyObject_CallMethod<> (python-internal.h:182) ==17162== by 0x477DFE: get_py_iter_from_func(_object*, char const*) (py-framefilter.c:272) ==17162== by 0x4791B4: py_print_args (py-framefilter.c:706) ==17162== by 0x4791B4: py_print_frame(_object*, enum_flags<frame_filter_flag>, ext_lang_frame_args, ui_out*, int, htab*) (py-framefilter.c:960) ==17162== by 0x47A130: gdbpy_apply_frame_filter(extension_language_defn const*, frame_info*, enum_flags<frame_filter_flag>, ext_lang_frame_args, ui_out*, int, int) (py-framefilter.c:1236) ==17162== by 0x369C39: apply_ext_lang_frame_filter(frame_info*, enum_flags<frame_filter_flag>, ext_lang_frame_args, ui_out*, int, int) (extension.c:563) ==17162== by 0x4EC9C9: backtrace_command_1 (stack.c:2031) ==17162== by 0x4EC9C9: backtrace_command(char const*, int) (stack.c:2183) ... Most of the leaks in python tests are due to the fact that many PyObject xxxxx_dealloc functions are missing the line to free self or obj such as: Py_TYPE (self)->tp_free (self); or Py_TYPE (obj)->tp_free (obj); With this patch, the number of python tests leaking decreases from 52 to 12. gdb/ChangeLog 2019-11-18 Philippe Waroquiers <philippe.waroquiers@skynet.be> * python/py-block.c (blpy_dealloc): Call tp_free. (blpy_block_syms_dealloc): Likewise. * python/py-finishbreakpoint.c (bpfinishpy_dealloc): Likewise. * python/py-inferior.c (infpy_dealloc): Likewise. * python/py-lazy-string.c (stpy_dealloc): Likewise. * python/py-linetable.c (ltpy_iterator_dealloc): Likewise. * python/py-symbol.c (sympy_dealloc): Likewise. * python/py-symtab.c (stpy_dealloc): Likewise. * python/py-type.c (typy_iterator_dealloc): Likewise.
2019-11-17 22:48:48 +01:00
2019-11-18 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* python/py-block.c (blpy_dealloc): Call tp_free.
(blpy_block_syms_dealloc): Likewise.
* python/py-finishbreakpoint.c (bpfinishpy_dealloc): Likewise.
* python/py-inferior.c (infpy_dealloc): Likewise.
* python/py-lazy-string.c (stpy_dealloc): Likewise.
* python/py-linetable.c (ltpy_iterator_dealloc): Likewise.
* python/py-symbol.c (sympy_dealloc): Likewise.
* python/py-symtab.c (stpy_dealloc): Likewise.
* python/py-type.c (typy_iterator_dealloc): Likewise.
2019-11-18 Christian Biesinger <cbiesinger@google.com>
* symtab.h (struct symbol) <owner>: Initialize explicitly in the
constructor instead of using a class initializer.
2019-11-15 Christian Biesinger <cbiesinger@google.com>
* Makefile.in: Replace {posix,mingw}-strerror.c with safe-strerror.c.
* configure: Regenerate.
* configure.ac: Don't source common.host.
* gdbsupport/common.host: Remove.
* gdbsupport/mingw-strerror.c: Remove.
* gdbsupport/posix-strerror.c: Rename to...
* gdbsupport/safe-strerror.c: ...this.
2019-11-15 Christian Biesinger <cbiesinger@google.com>
* maint.c (scoped_command_stats::print_time): Use localtime_r
instead of localtime (provided through gnulib if necessary).
* nat/linux-osdata.c (time_from_time_t): Use ctime_r instead
of ctime.
2019-11-15 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/common-defs.h: Include time.h before pathmax.h to
avoid compile errors.
2019-11-15 Christian Biesinger <cbiesinger@google.com>
* config.in: Regenerate.
* configure: Regenerate.
* gdbsupport/common.m4: No longer check for strerror_r.
* gdbsupport/posix-strerror.c (safe_strerror): Always call the
POSIX version of strerror_r, now that gnulib provides it if
necessary.
2019-11-14 Christian Biesinger <cbiesinger@google.com>
* README (`configure' options): Update.
2019-11-14 Tom Tromey <tromey@adacore.com>
* eval.c (evaluate_subexp_standard) <BINOP_ASSIGN>: Do not pass an
expected type for the RHS if the LHS is a convenience variable.
gdb: fix build error in unittests/vec-utils-selftests.c When building with gcc 9.2.0, I get the following build error: In file included from /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:23: /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h: In instantiation of ‘T unordered_remove(std::__debug::vector<T>&, typename std::__debug::vector<T>::iterator) [with T = selftests::vector_utils_tests::unordered_remove_tests()::obj; typename std::__debug::vector<T>::iterator = __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<selftests::vector_utils_tests::unordered_remove_tests()::obj*, std::__cxx1998::vector<selftests::vector_utils_tests::unordered_remove_tests()::obj, std::allocator<selftests::vector_utils_tests::unordered_remove_tests()::obj> > >, std::__debug::vector<selftests::vector_utils_tests::unordered_remove_tests()::obj>, std::random_access_iterator_tag>]’: /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:53:26: required from here /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h:53:5: error: implicitly-declared ‘selftests::vector_utils_tests::unordered_remove_tests()::obj::obj(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ is deprecated [-Werror=deprecated-copy] 53 | T removed = std::move (*it); | ^~~~~~~ /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:41:10: note: because ‘selftests::vector_utils_tests::unordered_remove_tests()::obj’ has user-provided ‘selftests::vector_utils_tests::unordered_remove_tests()::obj& selftests::vector_utils_tests::unordered_remove_tests()::obj::operator=(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ 41 | obj &operator= (const obj &other) | ^~~~~~~~ In file included from /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:23: /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h:58:10: error: implicitly-declared ‘selftests::vector_utils_tests::unordered_remove_tests()::obj::obj(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ is deprecated [-Werror=deprecated-copy] 58 | return removed; | ^~~~~~~ /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:41:10: note: because ‘selftests::vector_utils_tests::unordered_remove_tests()::obj’ has user-provided ‘selftests::vector_utils_tests::unordered_remove_tests()::obj& selftests::vector_utils_tests::unordered_remove_tests()::obj::operator=(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ 41 | obj &operator= (const obj &other) | ^~~~~~~~ I think gcc is just trying to be nice and recommends the good practice of providing a copy constructor if an assignment operator is provided. Silence the warning by providing that copy constructor. gdb/ChangeLog: * unittests/vec-utils-selftests.c (unordered_remove_tests::obj): Provide explicit default and copy constructor. Change-Id: I323361b1c120bf8525613b74e7e5983910e002df
2019-11-14 12:50:20 +01:00
2019-11-14 Simon Marchi <simon.marchi@polymtl.ca>
* unittests/vec-utils-selftests.c (unordered_remove_tests::obj):
Provide explicit default and copy constructor.
Fix python gdbpy_breakpoint_object leak. valgrind reports a leak when a breakpoint is created then deleted: ==1313== 40 bytes in 1 blocks are definitely lost in loss record 1,115 of 8,596 ==1313== at 0x4835753: malloc (vg_replace_malloc.c:307) ==1313== by 0x6E05BC: _PyObject_New (object.c:255) ==1313== by 0x470E4B: gdbpy_breakpoint_created(breakpoint*) (py-breakpoint.c:1023) ==1313== by 0x2946D9: operator() (std_function.h:687) ==1313== by 0x2946D9: notify (observable.h:106) ==1313== by 0x2946D9: install_breakpoint(int, std::unique_ptr<breakpoint, std::default_delete<breakpoint> >&&, int) (breakpoint.c:8136) ==1313== by 0x295BCA: create_breakpoint_sal (breakpoint.c:8878) ==1313== by 0x295BCA: create_breakpoints_sal (breakpoint.c:8919) ==1313== by 0x295BCA: create_breakpoints_sal_default (breakpoint.c:13671) ... The leak is due to a superfluous Py_INCREF when the python object is allocated inside gdbpy_breakpoint_created, when the python object is allocated locally: this object has already a refcount of 1, and the only reference is the reference from the C breakpoint object. The Py_INCREF is however needed when the python object was created from python: the python object was stored in bppy_pending_object, and gdbpy_breakpoint_created creates a new reference to this object. Solve the leak by calling 'Py_INCREF (newbp);' only in the bppy_pending_object case. Regression tested on debian/amd64 natively and under valgrind on centos/amd64. Before the patch, 795 tests have a definite leak. After the patch, 197 have a definite leak. Thanks to Tom, that helped on irc with the python refcount logic. gdb/ChangeLog 2019-11-14 Philippe Waroquiers <philippe.waroquiers@skynet.be> * python/py-finishbreakpoint.c (gdbpy_breakpoint_created): only call Py_INCREF (newbp) in the bppy_pending_object case.
2019-11-12 20:33:29 +01:00
2019-11-14 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* python/py-finishbreakpoint.c (gdbpy_breakpoint_created):
only call Py_INCREF (newbp) in the bppy_pending_object case.
2019-11-13 Tom Tromey <tromey@adacore.com>
PR build/25182:
* psympriv.h (partial_symbol): Remove static assert.
* symtab.h (general_symbol_info, symbol): Remove static assert.
2019-11-05 15:24:17 +01:00
2019-11-12 Andrew Burgess <andrew.burgess@embecosm.com>
* gdbsupport/format.c (format_pieces::format_pieces): Support
printf 'z' size modifier.
* gdbsupport/format.h (enum argclass): Add size_t_arg.
* printcmd.c (ui_printf): Handle size_t_arg.
* ui-out.c (ui_out::vmessage): Likewise.
* unittests/format_pieces-selftests.c (test_format_int_sizes): New
function.
(run_tests): Call test_format_int_sizes.
Make struct symbol inherit from general_symbol_info Since this is now no longer a POD, also give it a constructor that initializes all fields. (I have considered overloading operator new to zero-initialize the memory instead; let me know if you prefer that) gdb/ChangeLog: 2019-11-12 Christian Biesinger <cbiesinger@google.com> * ada-exp.y (write_ambiguous_var): Update. * buildsym.c (add_symbol_to_list): Update. * dwarf2read.c (read_variable): Update. (new_symbol): Update. * jit.c (finalize_symtab): Update. * language.c (language_alloc_type_symbol): Update. * symtab.c (fixup_symbol_section): Update. (initialize_objfile_symbol_1): Move code to... (initialize_objfile_symbol): ...here. Remove now-unnecessary memset. (allocate_symbol): Update. (allocate_template_symbol): Update. (get_symbol_address): Update. * symtab.h (struct symbol): Inherit from general_symbol_info instead of having as a field, and add a constructor. (SYMBOL_VALUE): Update. (SYMBOL_VALUE_ADDRESS): Update. (SET_SYMBOL_VALUE_ADDRESS): Update. (SYMBOL_VALUE_BYTES): Update. (SYMBOL_VALUE_COMMON_BLOCK): Update. (SYMBOL_BLOCK_VALUE): Update. (SYMBOL_VALUE_CHAIN): Update. (SYMBOL_LANGUAGE): Update. (SYMBOL_SECTION): Update. (SYMBOL_OBJ_SECTION): Update. (SYMBOL_SET_LANGUAGE): Update. (SYMBOL_SET_LINKAGE_NAME): Update. (SYMBOL_SET_NAMES): Update. (SYMBOL_NATURAL_NAME): Update. (SYMBOL_LINKAGE_NAME): Update. (SYMBOL_DEMANGLED_NAME): Update. (SYMBOL_SEARCH_NAME): Update. (SYMBOL_MATCHES_SEARCH_NAME): Update. (struct symbol): Update. (struct template_symbol): Update. (struct rust_vtable_symbol): Update. * xcoffread.c (SYMBOL_DUP): Update. Change-Id: I05b1628455bcce3efaa101e65ef051708d17eb07
2019-11-04 20:12:09 +01:00
2019-11-12 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y (write_ambiguous_var): Update.
* buildsym.c (add_symbol_to_list): Update.
* dwarf2read.c (read_variable): Update.
(new_symbol): Update.
* jit.c (finalize_symtab): Update.
* language.c (language_alloc_type_symbol): Update.
* symtab.c (fixup_symbol_section): Update.
(initialize_objfile_symbol_1): Move code to...
(initialize_objfile_symbol): ...here. Remove now-unnecessary memset.
(allocate_symbol): Update.
(allocate_template_symbol): Update.
(get_symbol_address): Update.
* symtab.h (struct symbol): Inherit from general_symbol_info instead
of having as a field, and add a constructor.
(SYMBOL_VALUE): Update.
(SYMBOL_VALUE_ADDRESS): Update.
(SET_SYMBOL_VALUE_ADDRESS): Update.
(SYMBOL_VALUE_BYTES): Update.
(SYMBOL_VALUE_COMMON_BLOCK): Update.
(SYMBOL_BLOCK_VALUE): Update.
(SYMBOL_VALUE_CHAIN): Update.
(SYMBOL_LANGUAGE): Update.
(SYMBOL_SECTION): Update.
(SYMBOL_OBJ_SECTION): Update.
(SYMBOL_SET_LANGUAGE): Update.
(SYMBOL_SET_LINKAGE_NAME): Update.
(SYMBOL_SET_NAMES): Update.
(SYMBOL_NATURAL_NAME): Update.
(SYMBOL_LINKAGE_NAME): Update.
(SYMBOL_DEMANGLED_NAME): Update.
(SYMBOL_SEARCH_NAME): Update.
(SYMBOL_MATCHES_SEARCH_NAME): Update.
(struct symbol): Update.
(struct template_symbol): Update.
(struct rust_vtable_symbol): Update.
* xcoffread.c (SYMBOL_DUP): Update.
2019-11-12 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_layout): Set current_layout.
(show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Don't set current_layout.
2019-11-12 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (_initialize_tui_layout): Move to end.
Make TUI resizing tests more robust As Sergio pointed out, the TUI resizing tests are flaky. Debugging this showed three main problems. 1. expect's "stty" command processes its arguments one-by-one. So, rather than requesting a single resize, it sends two separate resize requests (one for rows and one for columns). This means gdb sees two SIGWINCH signals and resizes the terminal twice. I consider this a bug in expect, but I couldn't readily see how to report a bug; and anyway the fix wouldn't propagate very quickly. This patch works around this problem by explicitly doing two separate resizes (so it will be robust if expect ever does change); and then by waiting for each resize to complete before continuing. 2. gdb uses curses to drive the console rendering. Currently the test suite looks for terminal text insertion sequences to decide when a command has completed. However, it turns out that, sometimes, curses can output things in non-obvious ways. I didn't debug into curses but I guess this can happen due to output optimizations. No matter the reason, sometimes the current approach of only tracking text insertions is not enough to detect that gdb has finished rendering. This patch fixes this problem by arranging to detect the termination output after any curses command, not just insertion. 3. Detecting when a resize has completed is tricky. In fact, I could not find a way to reliably do this. This patch fixes this problem by adding a special maint "tui-resize-message" setting to gdb. When this is enabled, gdb will print a message after each SIGWINCH has been fully processed. The test suite enables this mode and then waits for the message in order to know when control can be returned to the calling test. This patch also adds a timeout, to avoid the situation where the terminal code fails to notice a change for some reason. This lets the test at least try to continue. gdb/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * tui/tui-win.c (resize_message): New global. (show_tui_resize_message): New function. (tui_async_resize_screen): Print message if requested. (_initialize_tui_win): Add tui-resize-message setting. * NEWS: Add entry for new commands. gdb/doc/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * gdb.texinfo (Maintenance Commands): Document new command. gdb/testsuite/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * lib/tuiterm.exp (_accept): Add wait_for parameter. Check output after any command. Expect prompt after WAIT_FOR is seen. (enter_tui): Enable resize messages. (command): Expect command in output. (get_line): Avoid error when cursor appears to be off-screen. (dump_screen): Include screen size in title. (_do_resize): New proc, from "resize". (resize): Rewrite. Do resize in two steps. * gdb.tui/empty.exp (layouts): Fix entries. (check_boxes): Remove xfail. (check_text): Dump screen on failure. Change-Id: I420e0259cb99b21adcd28f671b99161eefa7a51d
2019-08-16 23:16:12 +02:00
2019-11-12 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (resize_message): New global.
(show_tui_resize_message): New function.
(tui_async_resize_screen): Print message if requested.
(_initialize_tui_win): Add tui-resize-message setting.
* NEWS: Add entry for new commands.
2019-11-11 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_initialize_readline): Add new bindable readline
functions.
2019-11-11 Christian Biesinger <cbiesinger@google.com>
* nat/linux-osdata.c (user_from_uid): Use getpwuid_r.
2019-11-10 Andrew Burgess <andrew.burgess@embecosm.com>
* python/py-symbol.c (gdbpy_lookup_static_symbols): New
function.
* python/python-internal.h (gdbpy_lookup_static_symbols):
Declare new function.
* python/python.c (python_GdbMethods): Add
gdb.lookup_static_symbols method.
* NEWS: Mention gdb.lookup_static_symbols.
2019-11-10 Andrew Burgess <andrew.burgess@embecosm.com>
* python/py-symbol.c (gdbpy_lookup_static_symbol): Lookup in
static block of current object file first. Also fix typo in
header comment.
2019-11-10 Andrew Burgess <andrew.burgess@embecosm.com>
* stack.c (set_last_displayed_sal): Delete.
(last_displayed_sal_valid): Delete.
(last_displayed_pspace): Delete.
(last_displayed_addr): Delete.
(last_displayed_symtab): Delete.
(last_displayed_line): Delete.
(class last_displayed_symtab_info_type): New.
(last_displayed_symtab_info): New static global variable.
(print_frame_info): Call methods on last_displayed_symtab_info.
(clear_last_displayed_sal): Update header comment, and make use of
last_displayed_symtab_info.
(last_displayed_sal_is_valid): Likewise.
(get_last_displayed_pspace): Likewise.
(get_last_displayed_addr): Likewise.
(get_last_displayed_symtab): Likewise.
(get_last_displayed_line): Likewise.
(get_last_displayed_sal): Likewise.
* stack.h (clear_last_displayed_sal): Update header comment.
(last_displayed_sal_is_valid): Likewise.
(get_last_displayed_pspace): Likewise.
(get_last_displayed_addr): Likewise.
(get_last_displayed_symtab): Likewise.
(get_last_displayed_line): Likewise.
(get_last_displayed_sal): Likewise.
2019-11-10 Andrew Burgess <andrew.burgess@embecosm.com>
* stack.c (frame_show_address): Convert return type to bool.
* stack.h (frame_show_address): Likewise, and update header
comment.
2019-11-10 Andrew Burgess <andrew.burgess@embecosm.com>
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add new file to the list.
* unittests/vec-utils-selftests.c: New file.
* gdbsupport/gdb_vecs.h (unordered_remove): Avoid self move assign.
2019-11-10 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_unhighlight_win): Use can_box.
(tui_highlight_win): Likewise.
(tui_win_info::check_and_display_highlight_if_needed): Likewise.
* tui/tui-data.h (struct tui_win_info) <can_highlight>: Remove.
* tui/tui-command.h (struct tui_cmd_window) <tui_cmd_window>:
Don't set can_highlight.
2019-11-10 Tom Tromey <tom@tromey.com>
* cli/cli-style.h (class cli_style_option) <cli_style_option>:
Remove unused declaration.
2019-11-08 Tom Tromey <tromey@adacore.com>
* top.c (read_command_file): Update.
(command_line_input): Make return type const.
* python/py-gdb-readline.c: Update.
* linespec.c (decode_line_2): Update.
* defs.h (command_line_input): Make return type const.
* cli/cli-script.c (read_next_line): Make return type const.
* ada-lang.c (get_selections): Update.
2019-11-06 Christian Biesinger <cbiesinger@google.com>
* linux-tdep.c (linux_info_proc): Use strtok_r instead of strtok.
* mi/mi-main.c (output_cores): Likewise.
* nat/linux-osdata.c (linux_xfer_osdata_cpus): Likewise.
(linux_xfer_osdata_modules): Likewise.
* remote.c (register_remote_support_xml): Likewise.
* sparc64-tdep.c (adi_is_addr_mapped): Likewise.
* xml-syscall.c (syscall_create_syscall_desc): Likewise.
2019-11-06 Tom Tromey <tom@tromey.com>
* tui/tui-interp.c: Don't include readline.h.
* tui/tui-hooks.c: Don't include readline.h.
* symmisc.c: Include tilde.h, not readline.h.
* symfile.c: Include tilde.h, not readline.h.
* source.c: Include tilde.h, not readline.h.
* solib.c: Include tilde.h, not readline.h.
* psymtab.c: Include tilde.h, not readline.h.
* exec.c: Include tilde.h, not readline.h.
* corelow.c: Include tilde.h, not readline.h.
* cli/cli-dump.c: Include tilde.h, not readline.h.
* cli/cli-cmds.c: Don't include readline.h.
2019-11-05 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.c (struct tui_asm_line) <addr_size>: New member.
(tui_disassemble): Set addr_size.
(tui_disasm_window::set_contents): Use addr_size.
2019-11-05 Tom Tromey <tom@tromey.com>
* rust-lang.c (rust_language_defn): Update.
* python/py-value.c (valpy_string): Call c_get_string.
* 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.c (unknown_language_defn, auto_language_defn): Update.
(default_get_string): Remove.
* guile/scm-value.c (gdbscm_value_to_string): Use c_get_string.
* go-lang.c (go_language_defn): Update.
* f-lang.c (f_language_defn): Update.
* d-lang.c (d_language_defn): Update.
* c-lang.c (c_language_defn, cplus_language_defn)
(asm_language_defn, minimal_language_defn): Update.
* ada-lang.c (ada_language_defn): Update.
* language.h (struct language_defn) <la_get_string>: Remove.
(LA_GET_STRING): Remove.
(default_get_string): Don't declare.
Style disassembly in the TUI This patch changes the TUI disassembly window to style its contents. The styling should be identical to what is seen in the CLI. This involved a bit of rearrangement, so that the source and disassembly windows could share both the copy_source_line utility function, and the ability to react to changes in "set style enabled". This version introduces a new function to strip the styling from the address string when computing the length. As a byproduct, it also removes the unused "insn_size" computation from tui_disasm_window::set_contents. gdb/ChangeLog 2019-11-05 Tom Tromey <tom@tromey.com> * tui/tui-source.h (struct tui_source_window): Inline constructor. Remove destructor. <style_changed, m_observable>: Move to superclass. * tui/tui-winsource.h (tui_copy_source_line): Declare. (struct tui_source_window_base): Move private members to end. <style_changed, m_observable>: Move from tui_source_window. * tui/tui-winsource.c (tui_copy_source_line): Move from tui-source.c. Rename from copy_source_line. Add special handling for negative line number. (tui_source_window_base::style_changed): Move from tui_source_window. (tui_source_window_base): Register observer. (~tui_source_window_base): New. * tui/tui-source.c (copy_source_line): Move to tui-winsource.c; rename. (tui_source_window::set_contents): Use tui_copy_source_line. (tui_source_window::tui_source_window): Move to tui-source.h. (tui_source_window::~tui_source_window): Remove. (tui_source_window::style_changed): Move to superclass. * tui/tui-disasm.c (tui_disassemble): Create string file with styling, when possible. Add "addr_size" parameter. (tui_disasm_window::set_contents): Use tui_copy_source_line. Don't compute maximum size. (len_without_escapes): New function Change-Id: I8722635eeecbbb1633d943a65b856404c2d467b0
2019-10-21 19:21:14 +02:00
2019-11-05 Tom Tromey <tom@tromey.com>
* tui/tui-source.h (struct tui_source_window): Inline
constructor. Remove destructor.
<style_changed, m_observable>: Move to superclass.
* tui/tui-winsource.h (tui_copy_source_line): Declare.
(struct tui_source_window_base): Move private members to end.
<style_changed, m_observable>: Move from tui_source_window.
* tui/tui-winsource.c (tui_copy_source_line): Move from
tui-source.c. Rename from copy_source_line. Add special handling
for negative line number.
(tui_source_window_base::style_changed): Move from
tui_source_window.
(tui_source_window_base): Register observer.
(~tui_source_window_base): New.
* tui/tui-source.c (copy_source_line): Move to tui-winsource.c;
rename.
(tui_source_window::set_contents): Use tui_copy_source_line.
(tui_source_window::tui_source_window): Move to tui-source.h.
(tui_source_window::~tui_source_window): Remove.
(tui_source_window::style_changed): Move to superclass.
* tui/tui-disasm.c (tui_disassemble): Create string file with
styling, when possible. Add "addr_size" parameter.
(tui_disasm_window::set_contents): Use tui_copy_source_line.
Don't compute maximum size.
(len_without_escapes): New function
2019-11-05 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_element) <line>: Now a
std::string.
* tui/tui-winsource.c (tui_show_source_line): Update.
* tui/tui-source.c (tui_source_window::set_contents): Update.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Update.
2019-11-05 Christian Biesinger <cbiesinger@google.com>
* symtab.h (gdb_static_assert): Put && operator at the beginning
of the line instead of the end.
2019-11-04 Christian Biesinger <cbiesinger@google.com>
* psympriv.h: Add static_asserts for sizeof (general_symbol_info)
and sizeof (symbol).
* symtab.h: Add a static_assert for sizeof (partial_symbol).
2019-11-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* NEWS (Changes since GDB 8.3): Document Solaris 10 removal.
* configure.host: Mark *-*-solaris2.10* obsolete.
* configure.tgt: Mark Solaris < 11 obsolete.
* MAINTAINERS (Target Instruction Set Architectures) <sparc>:
Update target triplet.
2019-11-01 Tom Tromey <tromey@adacore.com>
* utils.c (print_sys_errmsg): Simplify.
2019-11-01 Tom Tromey <tromey@adacore.com>
* gdbsupport/mingw-strerror.c (safe_strerror): Constify result.
2019-11-01 Christian Biesinger <cbiesinger@google.com>
* configure: Regenerate.
* configure.ac: Remove check for strerror_r.
* gdbsupport/common.m4: Check for strerror_r.
[ARM, thumb] Fix disassembling bug after reloading a symbol file The speed optimization from commit 5f6cac4085c95c5339b9549dc06d4f9184184fa6 made GDB skip reloading all symbols when the same symbol file is reloaded. As a result, ARM targets only read the mapping symbols the first time we load a symbol file. When reloaded, the speed optimization above will cause an early return and gdbarch_record_special_symbol won't be called to save mapping symbol data, which in turn affects disassembling of thumb instructions. First load and correct disassemble output: Dump of assembler code for function main: 0x0000821c <+0>: bx pc 0x0000821e <+2>: nop 0x00008220 <+4>: mov r0, #0 0x00008224 <+8>: bx lr Second load and incorrect disassemble output: Dump of assembler code for function main: 0x0000821c <+0>: bx pc 0x0000821e <+2>: nop 0x00008220 <+4>: movs r0, r0 0x00008222 <+6>: b.n 0x8966 0x00008224 <+8>: vrhadd.u16 d14, d14, d31 This happens because the mapping symbol data is stored in an objfile_key-based container, and that data isn't preserved across the two symbol loading operations. The following patch fixes this by storing the mapping symbol data in a bfd_key-based container, which doesn't change as long as the bfd is the same. I've also added a new test to verify the correct disassemble output. gdb/ChangeLog: 2019-11-01 Luis Machado <luis.machado@linaro.org> PR gdb/25124 * arm-tdep.c (arm_per_objfile): Rename to ... (arm_per_bfd): ... this. (arm_objfile_data_key): Rename to ... (arm_bfd_data_key): ... this. (arm_find_mapping_symbol): Adjust access to new bfd_key-based data. (arm_record_special_symbol): Likewise. gdb/testsuite/ChangeLog: 2019-11-01 Luis Machado <luis.machado@linaro.org> PR gdb/25124 * gdb.arch/pr25124.S: New file. * gdb.arch/pr25124.exp: New file. Change-Id: I22c3e6ebe9bfedad66d56fe9656994fa1761c485
2019-11-01 14:11:17 +01:00
2019-11-01 Luis Machado <luis.machado@linaro.org>
PR gdb/25124
* arm-tdep.c (arm_per_objfile): Rename to ...
(arm_per_bfd): ... this.
(arm_objfile_data_key): Rename to ...
(arm_bfd_data_key): ... this.
(arm_find_mapping_symbol): Adjust access to new bfd_key-based
data.
(arm_record_special_symbol): Likewise.
2019-10-31 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-typeprint.c (ada_print_typedef): Don't print newline at the
end.
* c-typeprint.c (c_print_typedef): Likewise.
* f-typeprint.c (f_print_typedef): Likewise.
* m2-typeprint.c (m2_print_typedef): Likewise.
* p-typeprint.c (pascal_print_typedef): Likewise.
* rust-lang.c (rust_print_typedef): Likewise.
* symtab.c (print_symbol_info): Print a newline after calling
typedef_print.
gdb: Add new commands to list module variables and functions This patch adds two new commands "info module functions" and "info module variables". These commands list all of the functions and variables grouped by module and then by file. For example: (gdb) info module functions All functions in all modules: Module "mod1": File /some/path/gdb/testsuite/gdb.fortran/info-types.f90: 35: void mod1::__copy_mod1_M1t1(Type m1t1, Type m1t1); 25: void mod1::sub_m1_a(integer(kind=4)); 31: integer(kind=4) mod1::sub_m1_b(void); Module "mod2": File /some/path/gdb/testsuite/gdb.fortran/info-types.f90: 41: void mod2::sub_m2_a(integer(kind=4), logical(kind=4)); 49: logical(kind=4) mod2::sub_m2_b(real(kind=4)); The new commands take set of flags that allow the output to be filtered, the user can filter by variable/function name, type, or containing module. As GDB doesn't currently track the relationship between a module and the variables or functions within it in the symbol table, so I filter based on the module prefix in order to find the functions or variables in each module. What this makes clear is that a user could get this same information using "info variables" and simply provide the prefix themselves, for example: (gdb) info module functions -m mod1 _a All functions matching regular expression "_a", in all modules matching regular expression "mod1": Module "mod1": File /some/path/gdb/testsuite/gdb.fortran/info-types.f90: 25: void mod1::sub_m1_a(integer(kind=4)); Is similar to: (gdb) info functions mod1::.*_a.* All functions matching regular expression "mod1::.*_a": File /some/path/gdb/testsuite/gdb.fortran/info-types.f90: 25: void mod1::sub_m1_a(integer(kind=4)); The benefits I see for a separate command are that the user doesn't have to think (or know) about the module prefix format, nor worry about building a proper regexp. The user can also easily scan across modules without having to build complex regexps. The new function search_module_symbols is extern in this patch despite only being used within symtab.c, this is because a later patch in this series will also be using this function from outside symtab.c. This patch is a new implementation of an idea originally worked on by Mark O'Connor, Chris January, David Lecomber, and Xavier Oro from ARM. gdb/ChangeLog: * symtab.c (info_module_cmdlist): New variable. (info_module_command): New function. (search_module_symbols): New function. (info_module_subcommand): New function. (struct info_modules_var_func_options): New struct. (info_modules_var_func_options_defs): New variable. (make_info_modules_var_func_options_def_group): New function. (info_module_functions_command): New function. (info_module_variables_command): New function. (info_module_var_func_command_completer): New function. (_initialize_symtab): Register new 'info module functions' and 'info module variables' commands. * symtab.h (typedef symbol_search_in_module): New typedef. (search_module_symbols): Declare new function. * NEWS: Mention new commands. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Document new 'info module variables' and 'info module functions' commands. gdb/testsuite/ChangeLog: * gdb.fortran/info-modules.exp: Update expected results, and add additional tests for 'info module functinos', and 'info module variables'. * gdb.fortran/info-types.exp: Update expected results. * gdb.fortran/info-types.f90: Extend testcase with additional module variables and functions. Change-Id: I8c2960640e2e101b77eff54027d687e21ec22e2b
2019-07-10 16:54:03 +02:00
2019-10-31 Andrew Burgess <andrew.burgess@embecosm.com>
* symtab.c (info_module_cmdlist): New variable.
(info_module_command): New function.
(search_module_symbols): New function.
(info_module_subcommand): New function.
(struct info_modules_var_func_options): New struct.
(info_modules_var_func_options_defs): New variable.
(make_info_modules_var_func_options_def_group): New function.
(info_module_functions_command): New function.
(info_module_variables_command): New function.
(info_module_var_func_command_completer): New function.
(_initialize_symtab): Register new 'info module functions' and
'info module variables' commands.
* symtab.h (typedef symbol_search_in_module): New typedef.
(search_module_symbols): Declare new function.
* NEWS: Mention new commands.
gdb/fortran: Add new 'info modules' command Add a new command 'info modules' that lists all of the modules GDB knows about from the debug information. A module is a debugging entity in the DWARF defined with DW_TAG_module, currently Fortran is known to use this tag for its modules. I'm not aware of any other language that currently makes use of DW_TAG_module. The output style is similar to the 'info type' output: (gdb) info modules All defined modules: File info-types.f90: 16: mod1 24: mod2 (gdb) Where the user is told the file the module is defined in and, on the left hand side, the line number at which the module is defined along with the name of the module. This patch is a new implementation of an idea originally worked on by Mark O'Connor, Chris January, David Lecomber, and Xavier Oro from ARM. gdb/ChangeLog: * dwarf2read.c (dw2_symtab_iter_next): Handle MODULE_DOMAIN. (dw2_expand_marked_cus): Handle MODULES_DOMAIN. (dw2_debug_names_iterator::next): Handle MODULE_DOMAIN and MODULES_DOMAIN. (scan_partial_symbols): Only create partial module symbols for non declarations. * psymtab.c (recursively_search_psymtabs): Handle MODULE_DOMAIN and MODULES_DOMAIN. * symtab.c (search_domain_name): Likewise. (search_symbols): Likewise. (print_symbol_info): Likewise. (symtab_symbol_info): Likewise. (info_modules_command): New function. (_initialize_symtab): Register 'info modules' command. * symtab.h (enum search_domain): Add MODULES_DOMAIN. * NEWS: Mention new 'info modules' command. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Document new 'info modules' command. gdb/testsuite/ChangeLog: * gdb.fortran/info-modules.exp: New file. * gdb.fortran/info-types.exp: Build with new file. * gdb.fortran/info-types.f90: Include and use new module. * gdb.fortran/info-types-2.f90: New file. Change-Id: I2b781dd5a06bcad04620ccdc45f01a0f711adfad
2019-07-09 22:38:59 +02:00
2019-10-31 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2read.c (dw2_symtab_iter_next): Handle MODULE_DOMAIN.
(dw2_expand_marked_cus): Handle MODULES_DOMAIN.
(dw2_debug_names_iterator::next): Handle MODULE_DOMAIN and
MODULES_DOMAIN.
(scan_partial_symbols): Only create partial module symbols for non
declarations.
* psymtab.c (recursively_search_psymtabs): Handle MODULE_DOMAIN
and MODULES_DOMAIN.
* symtab.c (search_domain_name): Likewise.
(search_symbols): Likewise.
(print_symbol_info): Likewise.
(symtab_symbol_info): Likewise.
(info_modules_command): New function.
(_initialize_symtab): Register 'info modules' command.
* symtab.h (enum search_domain): Add MODULES_DOMAIN.
* NEWS: Mention new 'info modules' command.
2019-10-31 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Mention $_gdb_setting, $_gdb_setting_str, $_gdb_maint_setting
and $_gdb_maint_setting_str.
Implement convenience functions to examine GDB settings. The new convenience functions $_gdb_setting and $_gdb_setting_str provide access to the GDB settings in user-defined commands. Similarly, $_gdb_maint_setting and $_gdb_maint_setting_str provide access to the GDB maintenance settings. The patch was developed following a comment of Eli about the 'set may-call-functions'. Eli said that user-defined functions should have a way to change their behavior according to this setting. Rather than have a specialized $_may_call_functions, this patch implements a general way to access any GDB setting. Compared to doing such access via Python 'gdb.parameter' and/or 'gdb.execute("set somesetting tosomevalue"): * The 'with' command is much better than the above python usage: if the user types C-c or an error happens between the set pagination off and the python "set pagination on", the above python does not restore the original setting. * Effectively, with the "gdb.parameter" python one liner, it is possible to do simple 'if' conditions, such as set and restore pagination. But mixing the "python if" within canned sequence of commands is cumbersome for non trivial combinations. E.g. if several commands have to be done for a certain condition accessed from python, I guess something like will be needed: python if __some_setting: gdb.execute("some command") python if __some_setting: gdb.execute("some other command") python if __some_setting: gdb.execute("some different command") (without speaking about nested "if-s"). With the convenience function: if $_gdb_setting("some_setting") some command some other command some different command end Integer settings (for example print elements) will also be more difficult to use. For example, a user defined function that scans and prints a linked list might want to use the value of "set print elements" to stop printing the linked list. Doing that by mixing python expression/if is likely doable, but seems not easy with the above one liners. So, in summary, the $_gdb_setting and $_gdb_setting_str avoids to have the heterogeneous mix of python and GDB commands in one single script (and of course, it works even if python is not configured, but that must be an unusual setup I guess). gdb/ChangeLog 2019-10-31 Philippe Waroquiers <philippe.waroquiers@skynet.be> * cli/cli-cmds.c (setting_cmd, value_from_setting) (gdb_setting_internal_fn, gdb_maint_setting_internal_fn) (str_value_from_setting, gdb_setting_str_internal_fn) (gdb_maint_setting_str_internal_fn): New functions. (_initialize_cli_cmds): Define the new convenience functions. * gdb/cli/cli-setshow.h (get_setshow_command_value_string): Constify. * gdb/cli/cli-setshow.c (get_setshow_command_value_string): Constify.
2019-04-28 14:38:18 +02:00
2019-10-31 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-cmds.c (setting_cmd, value_from_setting)
(gdb_setting_internal_fn, gdb_maint_setting_internal_fn)
(str_value_from_setting, gdb_setting_str_internal_fn)
(gdb_maint_setting_str_internal_fn): New functions.
(_initialize_cli_cmds): Define the new convenience functions.
* gdb/cli/cli-setshow.h (get_setshow_command_value_string): Constify.
* gdb/cli/cli-setshow.c (get_setshow_command_value_string): Constify.
2019-10-31 Christian Biesinger <cbiesinger@google.com>
* agent.c (set_can_use_agent): When the setting is turned on,
look up agent symbols if we don't have them yet.
(agent_new_objfile): Don't look up agent symbols when the agent
setting is off.
2019-10-31 Christian Biesinger <cbiesinger@google.com>
* config.in: Regenerate.
2019-10-31 Christian Biesinger <cbiesinger@google.com>
* configure: Regenerate.
* configure.ac: Check for strerror_r.
* gdbsupport/common-utils.h (safe_strerror): Change return value
to const char * and document that this function is now threadsafe.
* gdbsupport/posix-strerror.c (safe_strerror): Make buf
thread_local and call strerror_r, if available.
* utils.c (perror_string): Update.
(print_sys_errmsg): Update.
2019-10-31 Luis Machado <luis.machado@linaro.org>
* arm-tdep.c (arm_exidx_data_key): Use bfd_key instead of
objfile_key.
(arm_exidx_new_objfile): Adjust to use objfile->obfd instead of
objfile to fetch per-bfd data.
(arm_find_exidx_entry): Likewise.
2019-10-31 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/agent.c (debug_agent): Change type to bool.
(use_agent): Likewise.
(all_agent_symbols_look_up): Likewise.
(agent_loaded_p): Change return value to bool.
(agent_look_up_symbols): Update.
(agent_capability_check): Change return value to bool.
* gdbsupport/agent.h (agent_loaded_p): Likewise.
(debug_agent): Change type to bool.
(use_agent): Likewise.
(agent_capability_check): Change return value to bool.
2019-10-30 Christian Biesinger <cbiesinger@google.com>
* minsyms.c (clear_minimal_symbol_hash_tables): New function.
(build_minimal_symbol_hash_tables): Code to clear the table moved
to clear_minimal_symbol_hash_tables.
(minimal_symbol_reader::install): Call clear_minimal_symbol_hash_tables
when needed.
2019-10-29 Simon Marchi <simon.marchi@polymtl.ca>
* infcmd.c: Remove includes.
* infrun.c: Remove includes.
Clean up ada-lang.h This patch cleans up ada-lang.h: - Some functions just don't exist anymore, remove their declaration - Some functions are implemented in ada-lang.c and only used there, make them static to that file. I moved some functions higher in the file to avoid having to forward-declare them, but the implementations are unchanged. gdb/ChangeLog: * ada-lang.h (GROW_VECT): Move to ada-lang.c. (grow_vect): Remove declaration. (ada_type_of_array): Remove declaration. (ada_update_initial_language): Remove declaration. (ada_fold_name): Remove declaration. (ada_fill_in_ada_prototype): Remove declaration. (user_select_syms): Remove declaration. (get_selections): Remove declaration. (ada_tag_type): Remove declaration. (ada_value_tag): Remove declaration. (ada_is_others_clause): Remove declaration. (ada_in_variant): Remove declaration. (ada_value_struct_elt): Remove declaration. (ada_attribute_name): Remove declaration. (ada_system_address_type): Remove declaration. * ada-lang.c (ada_watch_location_expression): Make static. (GROW_VECT): Move here from ada-lang.h. (grow_vect): Make static. (ada_update_initial_language): Make static. (ada_fold_name): Make static. (ada_type_of_array): Make static. (encoded_ordered_before): Move up. (sort_choices): Move up. (print_signatures): Move up. (ada_print_symbol_signature): Move up. (get_selections): Move up and make static. (user_select_syms): Move up and make static. (ada_value_struct_elt): Move up and make static. (ada_tag_type): Make static. (ada_value_tag): Make static. (ada_is_others_clause): Make static. (ada_in_variant): Make static. (ada_attribute_name): Make static. Change-Id: If0d46ba87d6585ab674c87244068a19e84718fc9
2019-10-29 22:52:24 +01:00
2019-10-29 Simon Marchi <simon.marchi@polymtl.ca>
* ada-lang.h (GROW_VECT): Move to ada-lang.c.
(grow_vect): Remove declaration.
(ada_type_of_array): Remove declaration.
(ada_update_initial_language): Remove declaration.
(ada_fold_name): Remove declaration.
(ada_fill_in_ada_prototype): Remove declaration.
(user_select_syms): Remove declaration.
(get_selections): Remove declaration.
(ada_tag_type): Remove declaration.
(ada_value_tag): Remove declaration.
(ada_is_others_clause): Remove declaration.
(ada_in_variant): Remove declaration.
(ada_value_struct_elt): Remove declaration.
(ada_attribute_name): Remove declaration.
(ada_system_address_type): Remove declaration.
* ada-lang.c (ada_watch_location_expression): Make static.
(GROW_VECT): Move here from ada-lang.h.
(grow_vect): Make static.
(ada_update_initial_language): Make static.
(ada_fold_name): Make static.
(ada_type_of_array): Make static.
(encoded_ordered_before): Move up.
(sort_choices): Move up.
(print_signatures): Move up.
(ada_print_symbol_signature): Move up.
(get_selections): Move up and make static.
(user_select_syms): Move up and make static.
(ada_value_struct_elt): Move up and make static.
(ada_tag_type): Make static.
(ada_value_tag): Make static.
(ada_is_others_clause): Make static.
(ada_in_variant): Make static.
(ada_attribute_name): Make static.
2019-10-29 Simon Marchi <simon.marchi@polymtl.ca>
* ada-lang.c: Remove includes.
* ada-typeprint.c: Remove includes.
* ada-valprint.c: Remove includes.
2019-10-29 Simon Marchi <simon.marchi@efficios.com>
* addrmap.c: Add static assertions of type size, moved from
_initialize_addrmap.
(_initialize_addrmap): Remove.
Change some arguments to gdb::string_view instead of name+len Just some code cleanup. This change has a few benefits: - Shorter argument list in the functions - If the caller needs to calculate the string, they no longer need to explicitly call strlen - It is easy to pass std::string to this (done in one place currently) This also updates a couple of places that were passing 0/1 to a bool parameter. gdb/ChangeLog: 2019-10-29 Christian Biesinger <cbiesinger@google.com> * coffread.c (record_minimal_symbol): Update. (process_coff_symbol): Update. * dbxread.c (read_dbx_symtab): Update. * dwarf2read.c (add_partial_symbol): Update. (fixup_go_packaging): Update. (load_partial_dies): Update. (new_symbol): Update. * elfread.c (record_minimal_symbol): Change signature to use gdb::string_view instead of name+len. (elf_symtab_read): Update. (elf_rel_plt_read): Update. * mdebugread.c (parse_partial_symbols): Update. (handle_psymbol_enumerators): Update. (new_symbol): Update. * minsyms.c (minimal_symbol_reader::record_full): Change signature to use gdb::string_view instead of name+len. * minsyms.h (class minimal_symbol_reader) <record_full>: Likewise. * psympriv.h (add_psymbol_to_list): Likewise. * psymtab.c (add_psymbol_to_bcache): Likewise. (add_psymbol_to_list): Likewise. * stabsread.c (define_symbol): Update. * symtab.c (symbol_set_names): Change signature to use gdb::string_view. * symtab.h (SYMBOL_SET_NAMES): Likewise. (symbol_set_names): Likewise. * xcoffread.c (scan_xcoff_symtab): Update. Change-Id: I2675c6865e0368f9c755a1081088a53aa54dda4c
2019-10-13 13:57:14 +02:00
2019-10-29 Christian Biesinger <cbiesinger@google.com>
* coffread.c (record_minimal_symbol): Update.
(process_coff_symbol): Update.
* dbxread.c (read_dbx_symtab): Update.
* dwarf2read.c (add_partial_symbol): Update.
(fixup_go_packaging): Update.
(load_partial_dies): Update.
(new_symbol): Update.
* elfread.c (record_minimal_symbol): Change signature to use
gdb::string_view instead of name+len.
(elf_symtab_read): Update.
(elf_rel_plt_read): Update.
* mdebugread.c (parse_partial_symbols): Update.
(handle_psymbol_enumerators): Update.
(new_symbol): Update.
* minsyms.c (minimal_symbol_reader::record_full): Change signature
to use gdb::string_view instead of name+len.
* minsyms.h (class minimal_symbol_reader) <record_full>: Likewise.
* psympriv.h (add_psymbol_to_list): Likewise.
* psymtab.c (add_psymbol_to_bcache): Likewise.
(add_psymbol_to_list): Likewise.
* stabsread.c (define_symbol): Update.
* symtab.c (symbol_set_names): Change signature to use gdb::string_view.
* symtab.h (SYMBOL_SET_NAMES): Likewise.
(symbol_set_names): Likewise.
* xcoffread.c (scan_xcoff_symtab): Update.
2019-10-29 Christian Biesinger <cbiesinger@google.com>
* symtab.h (symbol_set_names): Document that copy_name must be
set to true for non-nullterminated strings.
* symtab.c (symbol_set_names): Only make a nullterminated copy of
linkage_name if the entry was not found and we need to demangle.
2019-10-29 Christian Biesinger <cbiesinger@google.com>
* Makefile.in (HFILES_NO_SRCDIR): Add gdb_binary_search.h.
* dwarf2-frame.c (bsearch_fde_cmp): Update.
(dwarf2_frame_find_fde): Replace bsearch with gdb::binary_search.
* gdbsupport/gdb_binary_search.h: New file.
2019-10-29 Christian Biesinger <cbiesinger@google.com>
* NEWS: Mention new --with-system-gdbinit-dir option.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Add new option --with-system-gdbinit-dir.
* extension.c (get_ext_lang_of_file): Return extension_language_gdb
for a ".gdb" suffix.
* main.c (get_init_files): Change system_gdbinit argument to
a vector and return the files in SYSTEM_GDBINIT_DIR in
addition to SYSTEM_GDBINIT.
(captured_main_1): Update.
(print_gdb_help): Update.
* top.c (print_gdb_configuration): Also print the value of
SYSTEM_GDBINIT_DIR.
2019-10-28 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/common-utils.h (startswith): Add an overloaded version
that takes gdb::string_view arguments.
[gdb] Fix more typos in comments (2) Fix typos in comments. NFC. Tested on x86_64-linux. gdb/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * aarch64-linux-tdep.c: Fix typos in comments. * aarch64-tdep.c: Same. * ada-lang.c: Same. * amd64-nat.c: Same. * arc-tdep.c: Same. * arch/aarch64-insn.c: Same. * block.c: Same. * breakpoint.h: Same. * btrace.h: Same. * c-varobj.c: Same. * cli/cli-decode.c: Same. * cli/cli-script.c: Same. * cli/cli-utils.h: Same. * coff-pe-read.c: Same. * coffread.c: Same. * compile/compile-cplus-symbols.c: Same. * compile/compile-object-run.c: Same. * completer.c: Same. * corelow.c: Same. * cp-support.c: Same. * demangle.c: Same. * dwarf-index-write.c: Same. * dwarf2-frame.c: Same. * dwarf2-frame.h: Same. * eval.c: Same. * frame-base.h: Same. * frame.h: Same. * gdbcmd.h: Same. * gdbtypes.h: Same. * gnu-nat.c: Same. * guile/scm-objfile.c: Same. * i386-tdep.c: Same. * i386-tdep.h: Same. * infcall.c: Same. * infcall.h: Same. * linux-nat.c: Same. * m68k-tdep.c: Same. * macroexp.c: Same. * memattr.c: Same. * mi/mi-cmd-disas.c: Same. * mi/mi-getopt.h: Same. * mi/mi-main.c: Same. * minsyms.c: Same. * nat/aarch64-sve-linux-sigcontext.h: Same. * objfiles.h: Same. * ppc-linux-nat.c: Same. * ppc-linux-tdep.c: Same. * ppc-tdep.h: Same. * progspace.h: Same. * prologue-value.h: Same. * python/py-evtregistry.c: Same. * python/py-instruction.h: Same. * record-btrace.c: Same. * record-full.c: Same. * remote.c: Same. * rs6000-tdep.c: Same. * ser-tcp.c: Same. * sol-thread.c: Same. * sparc-sol2-tdep.c: Same. * sparc64-tdep.c: Same. * stabsread.c: Same. * symfile.c: Same. * symtab.h: Same. * target.c: Same. * tracepoint.c: Same. * tui/tui-data.h: Same. * tui/tui-io.c: Same. * tui/tui-win.c: Same. * tui/tui.c: Same. * unittests/rsp-low-selftests.c: Same. * user-regs.h: Same. * utils.c: Same. * utils.h: Same. * valarith.c: Same. * valops.c: Same. * valprint.c: Same. * valprint.h: Same. * value.c: Same. * value.h: Same. * varobj.c: Same. * x86-nat.h: Same. * xtensa-tdep.c: Same. gdb/gdbserver/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * linux-aarch64-low.c: Fix typos in comments. * linux-arm-low.c: Same. * linux-low.c: Same. * linux-ppc-low.c: Same. * proc-service.c: Same. * regcache.h: Same. * server.c: Same. * tracepoint.c: Same. * win32-low.c: Same. gdb/stubs/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * ia64vms-stub.c: Fix typos in comments. * m32r-stub.c: Same. * m68k-stub.c: Same. * sh-stub.c: Same. gdb/testsuite/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * gdb.base/bigcore.c: Fix typos in comments. * gdb.base/ctf-ptype.c: Same. * gdb.base/long_long.c: Same. * gdb.dwarf2/dw2-op-out-param.S: Same. * gdb.python/py-evthreads.c: Same. * gdb.reverse/i387-stack-reverse.c: Same. * gdb.trace/tfile.c: Same. * lib/compiler.c: Same. * lib/compiler.cc: Same. Change-Id: I8573d84a577894270179ae30f46c48d806fc1beb
2019-10-26 09:55:32 +02:00
2019-10-26 Tom de Vries <tdevries@suse.de>
* aarch64-linux-tdep.c: Fix typos in comments.
* aarch64-tdep.c: Same.
* ada-lang.c: Same.
* amd64-nat.c: Same.
* arc-tdep.c: Same.
* arch/aarch64-insn.c: Same.
* block.c: Same.
* breakpoint.h: Same.
* btrace.h: Same.
* c-varobj.c: Same.
* cli/cli-decode.c: Same.
* cli/cli-script.c: Same.
* cli/cli-utils.h: Same.
* coff-pe-read.c: Same.
* coffread.c: Same.
* compile/compile-cplus-symbols.c: Same.
* compile/compile-object-run.c: Same.
* completer.c: Same.
* corelow.c: Same.
* cp-support.c: Same.
* demangle.c: Same.
* dwarf-index-write.c: Same.
* dwarf2-frame.c: Same.
* dwarf2-frame.h: Same.
* eval.c: Same.
* frame-base.h: Same.
* frame.h: Same.
* gdbcmd.h: Same.
* gdbtypes.h: Same.
* gnu-nat.c: Same.
* guile/scm-objfile.c: Same.
* i386-tdep.c: Same.
* i386-tdep.h: Same.
* infcall.c: Same.
* infcall.h: Same.
* linux-nat.c: Same.
* m68k-tdep.c: Same.
* macroexp.c: Same.
* memattr.c: Same.
* mi/mi-cmd-disas.c: Same.
* mi/mi-getopt.h: Same.
* mi/mi-main.c: Same.
* minsyms.c: Same.
* nat/aarch64-sve-linux-sigcontext.h: Same.
* objfiles.h: Same.
* ppc-linux-nat.c: Same.
* ppc-linux-tdep.c: Same.
* ppc-tdep.h: Same.
* progspace.h: Same.
* prologue-value.h: Same.
* python/py-evtregistry.c: Same.
* python/py-instruction.h: Same.
* record-btrace.c: Same.
* record-full.c: Same.
* remote.c: Same.
* rs6000-tdep.c: Same.
* ser-tcp.c: Same.
* sol-thread.c: Same.
* sparc-sol2-tdep.c: Same.
* sparc64-tdep.c: Same.
* stabsread.c: Same.
* symfile.c: Same.
* symtab.h: Same.
* target.c: Same.
* tracepoint.c: Same.
* tui/tui-data.h: Same.
* tui/tui-io.c: Same.
* tui/tui-win.c: Same.
* tui/tui.c: Same.
* unittests/rsp-low-selftests.c: Same.
* user-regs.h: Same.
* utils.c: Same.
* utils.h: Same.
* valarith.c: Same.
* valops.c: Same.
* valprint.c: Same.
* valprint.h: Same.
* value.c: Same.
* value.h: Same.
* varobj.c: Same.
* x86-nat.h: Same.
* xtensa-tdep.c: Same.
2019-10-25 Ali Tamur <tamur@google.com>
* charset.c (find_charset_names): Reflect API change.
2019-10-25 Christian Biesinger <cbiesinger@google.com>
* symtab.c (struct demangled_name_entry): Change demangled name
to a unique_xmalloc_ptr<char>, now that we don't allocate it as
part of the struct anymore.
(symbol_set_names): No longer obstack allocate + copy the demangled
name, just store the allocated name from bfd.
2019-10-25 Tom Tromey <tromey@adacore.com>
* dwarf2-frame.c (dwarf2_cie_table): Now a typedef.
(bsearch_cie_cmp, add_cie): Remove.
(find_cie): Reimplement.
(decode_frame_entry_1, decode_frame_entry): Change type. Update.
(dwarf2_build_frame_info): Update.
2019-10-24 H.J. Lu <hongjiu.lu@intel.com>
PR gdb/25126
* symfile.c (reread_symbols): Call forget_cached_source_info to
clear the stale source cache.
2019-10-24 Christian Biesinger <cbiesinger@google.com>
* configure: Regenerate.
* configure.ac: Remove code that sets python_has_threads.
2019-10-24 Christian Biesinger <cbiesinger@google.com>
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Remove the code that uses sed to get the python
version and defines HAVE_LIBPYTHON2_6 / HAVE_LIBPYTHON2_7.
gdb/python: Return None from Progspace.block_for_pc on error The documentation for Progspace.block_for_pc says: Return the innermost gdb.Block containing the given pc value. If the block cannot be found for the pc value specified, the function will return None. However, the implementation actually throws an error for invalid addresses, like this: (gdb) python print gdb.current_progspace ().block_for_pc (1) Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError: Cannot locate object file for block. Error while executing Python code. (gdb) This has been the behaviour since the command was first added (when the documentation was still as above) in this commit: commit f3e9a8177c41893858fce2bdf339dbe90b3a4ef5 Date: Wed Feb 24 21:18:28 2010 +0000 Since that commit the code in question has moved around, but the important parts are largely unchanged. The function in question is now in py-progspace.c:pspy_block_for_pc. Examining the code shows that the real state is more complex than just the function throws an error instead of returning None, instead the real situation is: 1. If we can't find a compilation unit for the $pc value then we throw an error, but 2. If we can find a compilation unit, but can't find a block within the compilation unit for the $pc then return None. I suspect for most users of the Python API this distinction is irrelevant, and I propose that we standardise on one single failure mechanism. Given the function can currently return None in some cases, and is documented to return None on error, I propose we make that the case for all error paths, which is what this patch does. As the Progspace.block_for_pc method is currently untested, I've added some basic tests including for a call with an invalid $pc. This is potentially an API breaking change, though an undocumented part of the API. Also, users should have been checking and handling a None return value anyway, so my hope is that this shouldn't be too disruptive. gdb/ChangeLog: * python/py-progspace.c (pspy_block_for_pc): Return None for all error paths. gdb/testsuite/ChangeLog: * gdb.python/py-progspace.exp: Add tests for the Progspace.block_for_pc method. Change-Id: I9cea8d2132902bcad0013d1fd39080dd5423cc57
2019-10-23 14:24:02 +02:00
2019-10-24 Andrew Burgess <andrew.burgess@embecosm.com>
* python/py-progspace.c (pspy_block_for_pc): Return None for all
error paths.
2019-10-23 Tom Tromey <tom@tromey.com>
* arc-tdep.c: Remove ".." from include.
* frv-tdep.c: Remove ".." from include.
* lm32-tdep.c: Remove ".." from include.
* microblaze-tdep.c: Remove ".." from include.
* or1k-tdep.h: Remove ".." from include.
* s12z-tdep.c: Remove ".." from include.
* Makefile.in (OPCODES_CFLAGS): Add comment.
(TOP_CFLAGS): New variable.
(INTERNAL_CFLAGS_BASE): Add TOP_CFLAGS.
Move readline to the readline/readline subdirectory readline turns out to be a bit of a stumbling block for the project to move gdbsupport (and then gdbserver) to the top-level. The issue is that readline headers are intended to be included with names like "readline/readline.h". To support this, gdb effectively adds a -I option pointing to the top-level source directory -- but, importantly, this option is not used when the system readline is used. For gdbsupport, a -I option like this would always be needed, but that in turn would break the system readline case. This was PR build/17077, fixed in commit a8a5dbcab8df0b3a9e04745d4fe8d64740acb323. Previously, we had discussed this on the gdb-patches list in terms of removing readline from the tree https://sourceware.org/ml/gdb-patches/2019-09/msg00317.html However, Eli expressed some concerns, and Joel did as well (off-list). Given those concerns, and the fact that a patch-free local readline is relatively new in gdb (it was locally patched for years), I changed my mind and decided to handle this situation by moving the readline sources down a level. That is, upstream readline is now in readline/readline, and the top-level readline directory just contains the minimal configury needed to build that. This fixes the problem because, when gdb unconditionally adds a -I$(top_srcdir), this will not find readline headers. A separate -I will be needed instead, which is exactly what's needed for --with-system-readline. gdb/ChangeLog 2019-10-23 Tom Tromey <tom@tromey.com> * Makefile.in (READLINE_DIR): Update. gdb/doc/ChangeLog 2019-10-23 Tom Tromey <tom@tromey.com> * Makefile.in (READLINE_DIR): Update. readline/ChangeLog 2019-10-23 Tom Tromey <tom@tromey.com> Move old contents to readline/ subdirectory. * aclocal.m4, configure, configure.ac, .gitignore, Makefile.am, Makefile.in, README: New files. Change-Id: Ice156a2ee09ea68722b48f64d97146d7428ea9e4
2019-10-06 00:39:44 +02:00
2019-10-23 Tom Tromey <tom@tromey.com>
* Makefile.in (READLINE_DIR): Update.
2019-10-23 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* infcall.c (call_function_by_hand_dummy): Fix the function
comment. And extract out a code section into...
(reserve_stack_space): ...this new function.
2019-10-23 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* infcall.c (value_arg_coerce): Remove an unused parameter.
(call_function_by_hand_dummy): Update the call to
'value_arg_coerce'.
2019-10-23 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* infcall.c (call_function_by_hand_dummy): Refactor.
2019-10-23 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* MAINTAINERS (Write After Approval): Add Tankut Baris Aktemur.
2019-10-23 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Don't check for sigprocmask.
* gdbsupport/common.m4 (GDB_AC_COMMON): Check for sigprocmask.
2019-10-23 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* acinclude.m4: Use m4_include, not sinclude.
[gdb/breakpoints] Fix fullname.exp when run from symlink dir I run into this error with gdb.base/fullname.exp: ... (gdb) file /data/gdb_versions/devel/build/gdb/testsuite/outputs/\ gdb.base/fullname/fullname Reading symbols from /data/gdb_versions/devel/build/gdb/testsuite/outputs/\ gdb.base/fullname/fullname... (gdb) break /data/gdb_versions/devel/build/gdb/testsuite/\ outputs/gdb.base/fullname/tmp-fullname.c:21 No source file named /data/gdb_versions/devel/build/gdb/testsuite/outputs/\ gdb.base/fullname/tmp-fullname.c. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) FAIL: gdb.base/fullname.exp: set breakpoint by full path before loading symbols - built relative ... The FAIL is due to this comparison in iterate_over_some_symtabs failing: ... 481 if (FILENAME_CMP (real_path, fullname) == 0) (gdb) p real_path $2 = 0x1a201f0 "/data/gdb_versions/devel/build/gdb/testsuite/outputs/\ gdb.base/fullname/tmp-fullname.c" (gdb) p fullname $3 = 0x1a1de80 "/home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/\ gdb.base/fullname/tmp-fullname.c" ... The difference in pathnames is due to having a symlink dir: ... $ ls -la /home/vries/gdb_versions lrwxrwxrwx 1 vries users 18 26 jun 2018 /home/vries/gdb_versions -> /data/gdb_versions ... and the test passses when eliminating it: ... $ ( cd $(pwd -P); make check RUNTESTFLAGS=gdb.base/fullname.exp ) ... The FAIL is a regression from commit a0c1ffedcf1 "Only compute realpath when basenames_may_differ is set". Before, find_and_open_source was returning a real-path, resulting in variable 'fullname' being the same as varible 'real_path' in the comparison listed above. But after, that's no longer the case. Fix the FAIL by applying gdb_realpath on the fullname variable before the comparison. Tested on x86_64-linux. I wasn't able to write a test-case. The FAIL starts at: ... $ cd build/gdb $ mv testsuite testsuite.bla $ ln -s testsuite.bla testsuite ... but already this doesn't trigger it anymore: ... $ cd build/gdb/outputs $ mv outputs outputs.bla $ ln -s outputs.bla outputs ... gdb/ChangeLog: 2019-10-23 Tom de Vries <tdevries@suse.de> PR breakpoints/24687 * symtab.c (iterate_over_some_symtabs): Apply gdb_realpath on fullname. Change-Id: I1ace62a234458781e958980f3b425edf1490df27
2019-10-23 09:33:46 +02:00
2019-10-23 Tom de Vries <tdevries@suse.de>
PR breakpoints/24687
* symtab.c (iterate_over_some_symtabs): Apply gdb_realpath on fullname.
2019-10-22 Christian Biesinger <cbiesinger@google.com>
* symtab.c (struct demangled_name_entry) <language>: Change from
bitfield to regular variable.
2019-10-22 Christian Biesinger <cbiesinger@google.com>
* symtab.c (struct demangled_name_entry): Add a constructor.
(free_demangled_name_entry): New function to call the destructor
for demangled_name_entry.
(create_demangled_names_hash): Pass free_demangled_name_entry to
htab_create_alloc.
(symbol_set_names): Call placement new for demangled_name_entry.
* utils.c: No longer include xxhash.h here, now that fast_hash
is inlined in the header.
* utils.h: Instead, include it here.
Use libxxhash for hashing, if present XXHash is faster than htab_hash_string: ------------------------------------------------------------ Benchmark Time CPU Iterations ------------------------------------------------------------ BM_xxh3 11 ns 11 ns 65887249 BM_xxh32 19 ns 19 ns 36511877 BM_xxh64 16 ns 16 ns 42964585 BM_hash_string 182 ns 182 ns 3853125 BM_iterative_hash 77 ns 77 ns 9087638 Unfortunately, XXH3 is still experimental (see https://github.com/Cyan4973/xxHash#user-content-new-experimental-hash-algorithm) However, regular XXH64 is still a lot faster than htab_hash_string per my benchmark above. I used the following string for the benchmark: static constexpr char str[] = "_ZZZL13make_gdb_typeP7gdbarchP10tdesc_typeEN16gdb_type_creator19make_gdb_type_flagsEPK22tdesc_type_with_fieldsE19__PRETTY_FUNCTION__"; htab_hash_string is currently 4.35% + 7.98% (rehashing) of gdb startup when attaching to Chrome's content_shell. An additional 5.21% is spent in msymbol_hash, which does not use this hash function. Unfortunately, since it has to lowercase the string, it can't use this hash function. BM_msymbol_hash 52 ns 52 ns 13281495 It may be worth investigating if strlen+XXHash is still faster than htab_hash_string, which would make it easier to use in more places. Debian ships xxhash as libxxhash{0,-dev}. Fedora ships it as xxhash-devel. gdb/ChangeLog: 2019-10-22 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Link with libxxhash. * config.in: Regenerate. * configure: Regenerate. * configure.ac: Search for libxxhash. * utils.c (fast_hash): Use xxhash if present. Change-Id: Icab218388b9f829522ed3977f04301ae6d4fc4ca
2019-09-27 20:32:07 +02:00
2019-10-22 Christian Biesinger <cbiesinger@google.com>
* Makefile.in: Link with libxxhash.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: Search for libxxhash.
* utils.c (fast_hash): Use xxhash if present.
2019-10-22 Christian Biesinger <cbiesinger@google.com>
* utils.h (fast_hash): New function.
* symtab.c (hash_demangled_name_entry): Call new function
fast_hash.
2019-10-22 Christian Biesinger <cbiesinger@google.com>
* symtab.c (struct demangled_name_entry): Change type of mangled
to gdb::string_view. Also adds a constructor that takes the
mangled name.
(hash_demangled_name_entry): Update.
(eq_demangled_name_entry): Update.
(free_demangled_name_entry): New function to call the destructor
now that this is not a POD anymore.
(create_demangled_names_hash): Pass free_demangled_name_entry to
htab_create_alloc.
(symbol_set_names): Update.
DWARF 5 support: Handle line table and file indexes * Fix handling of file and directory indexes in line tables; in DWARF 5 the indexes are zero-based. Make file_names field private to abstract this detail from the clients. Introduce file_names, is_valid_file_index and file_names_size methods. Reflect these changes in clients. * Handle DW_FORM_data16 in read_formatted_entries; it is used to record MD5 of the file entries in DWARF 5. * Fix a bug in line header parsing that calculates the length of the header incorrectly. (Seemingly this manifests itself only in DWARF 5). Tested with CC=/usr/bin/gcc (version 8.3.0) against master branch (also with -gsplit-dwarf and -gdwarf-4 flags) and there was no increase in the set of tests that fails. (gdb still cannot debug a 'hello world' program with DWARF 5, so for the time being, this is all we care about). This is part of an effort to support DWARF 5 in gdb. gdb/ChangeLog: * dwarf2read.c (dir_index): Change type. (file_name_index): Likewise. (line_header::include_dir_at): Change comment and implementation on whether it is DWARF 5. (line_header::is_valid_file_index): New function. (line_header::file_name_at): Change comment and implementation on whether it is DWARF 5. (line_header::file_names): Change to private field renamed as m_file_names and introduce a new accessor method. (line_header::file_names_size): New method. (line_header::include_dirs): Change to private field and rename as m_include_dirs. (dw2_get_file_names_reader): Define local var at a smaller scope and reflect API change. (dwarf2_cu::setup_type_unit_groups): Reflect API change. (process_structure_scope): Likewise. (line_header::add_include_dir): Change message and reflect renaming. (line_header::add_file_name): Likewise. (read_formatted_entries): Handle DW_FORM_data16. (dwarf_decode_line_header): Fix line header length calculation. (psymtab_include_file_name): Change comment and API. (lnp_state_machine::m_file): Update comment and reflect type change. (lnp_state_machine::record_line): Reflect type change. (dwarf_decode_lines): Reflect API change. (file_file_name): Likewise. (file_full_name): Likewise.
2019-08-27 04:22:09 +02:00
2019-10-21 Ali Tamur <tamu@google.com>
* dwarf2read.c (dir_index): Change type.
(file_name_index): Likewise.
(line_header::include_dir_at): Change comment and implementation on
whether it is DWARF 5.
(line_header::is_valid_file_index): New function.
(line_header::file_name_at): Change comment and implementation on
whether it is DWARF 5.
(line_header::file_names): Change to private field renamed as
m_file_names and introduce a new accessor method.
(line_header::file_names_size): New method.
(line_header::include_dirs): Change to private field and rename as
m_include_dirs.
(dw2_get_file_names_reader): Define local var at a smaller scope and
reflect API change.
(dwarf2_cu::setup_type_unit_groups): Reflect API change.
(process_structure_scope): Likewise.
(line_header::add_include_dir): Change message and reflect renaming.
(line_header::add_file_name): Likewise.
(read_formatted_entries): Handle DW_FORM_data16.
(dwarf_decode_line_header): Fix line header length calculation.
(psymtab_include_file_name): Change comment and API.
(lnp_state_machine::m_file): Update comment and reflect type change.
(lnp_state_machine::record_line): Reflect type change.
(dwarf_decode_lines): Reflect API change.
(file_file_name): Likewise.
(file_full_name): Likewise.
2019-10-21 Andrew Burgess <andrew.burgess@embecosm.com>
* objfiles.c (sort_cmp): Ensure that !(a < a) holds true.
2019-10-21 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_exec_info_content): Remove typedef.
2019-10-21 Tom Tromey <tom@tromey.com>
* configure.ac (nm.h): Conditionally create nm.h link. Subst
NM_H. Use AC_CONFIG_LINKS.
* configure: Rebuild.
* Makefile.in (NM_H): New variable.
(generated_files): Add NM_H. Remove gcore.
(nm.h, stamp-nmh): New targets.
2019-10-20 Tom Tromey <tom@tromey.com>
* objfiles.h (unlink_objfile, put_objfile_before): Don't declare.
* objfiles.c (unlink_objfile): Move earlier. Now static. Remove
obsolete comment.
(put_objfile_before): Now static.
2019-10-19 Simon Marchi <simon.marchi@polymtl.ca>
* gdbsupport/common-utils.h (startswith): Change return type to
bool.
Replace some more qsort calls with std::sort This has better typesafety, avoids a function pointer indirection, and can benefit from inlining. gdb/ChangeLog: 2019-10-19 Christian Biesinger <cbiesinger@google.com> * bcache.c (bcache::print_statistics): Use std::sort instead of qsort. * breakpoint.c (bp_locations_compare): Rename to... (bp_location_is_less_than): ...this, and change to std::sort semantics. (update_global_location_list): Use std::sort instead of qsort. * buildsym.c (compare_line_numbers): Rename to... (lte_is_less_than): ...this, and change to std::sort semantics. (buildsym_compunit::end_symtab_with_blockvector): Use std::sort instead of qsort. * disasm.c (compare_lines): Rename to... (line_is_less_than): ...this, and change to std::sort semantics. (do_mixed_source_and_assembly_deprecated): Call std::sort instead of qsort. * dwarf2-frame.c (qsort_fde_cmp): Rename to... (fde_is_less_than): ...this, and change to std::sort semantics. (dwarf2_build_frame_info): Call std::sort instead of qsort. * mdebugread.c (compare_blocks): (block_is_less_than): ...this, and change to std::sort semantics. (sort_blocks): Call std::sort instead of qsort. * objfiles.c (qsort_cmp): Rename to... (sort_cmp): ...this, and change to std::sort semantics. (update_section_map): Call std::sort instead of qsort. * remote.c (compare_pnums): Remove. (map_regcache_remote_table): Call std::sort instead of qsort. * utils.c (compare_positive_ints): Remove. * utils.h (compare_positive_ints): Remove. * xcoffread.c (compare_lte): Remove. (arrange_linetable): Call std::sort instead of qsort. Change-Id: Ibcddce12a3d07448701e731b7150fa23611d86de
2019-10-03 07:36:35 +02:00
2019-10-19 Christian Biesinger <cbiesinger@google.com>
* bcache.c (bcache::print_statistics): Use std::sort instead of qsort.
* breakpoint.c (bp_locations_compare): Rename to...
(bp_location_is_less_than): ...this, and change to std::sort semantics.
(update_global_location_list): Use std::sort instead of qsort.
* buildsym.c (compare_line_numbers): Rename to...
(lte_is_less_than): ...this, and change to std::sort semantics.
(buildsym_compunit::end_symtab_with_blockvector): Use std::sort
instead of qsort.
* disasm.c (compare_lines): Rename to...
(line_is_less_than): ...this, and change to std::sort semantics.
(do_mixed_source_and_assembly_deprecated): Call std::sort instead
of qsort.
* dwarf2-frame.c (qsort_fde_cmp): Rename to...
(fde_is_less_than): ...this, and change to std::sort semantics.
(dwarf2_build_frame_info): Call std::sort instead of qsort.
* mdebugread.c (compare_blocks):
(block_is_less_than): ...this, and change to std::sort semantics.
(sort_blocks): Call std::sort instead of qsort.
* objfiles.c (qsort_cmp): Rename to...
(sort_cmp): ...this, and change to std::sort semantics.
(update_section_map): Call std::sort instead of qsort.
* remote.c (compare_pnums): Remove.
(map_regcache_remote_table): Call std::sort instead of qsort.
* utils.c (compare_positive_ints): Remove.
* utils.h (compare_positive_ints): Remove.
* xcoffread.c (compare_lte): Remove.
(arrange_linetable): Call std::sort instead of qsort.
2019-10-19 Sergio Durigan Junior <sergiodj@redhat.com>
* symfile.c (init_entry_point_info): Fix typo.
* i386-darwin-tdep.c (darwin_dwarf_signal_frame_p): Fix typo.
[gdb] Fix more typos in comments Fix typos in comments. NFC. Tested on x86_64-linux. gdb/ChangeLog: 2019-10-18 Tom de Vries <tdevries@suse.de> * aarch64-tdep.c: Fix typos in comments. * ada-lang.c: Same. * ada-tasks.c: Same. * alpha-tdep.c: Same. * alpha-tdep.h: Same. * amd64-nat.c: Same. * amd64-windows-tdep.c: Same. * arc-tdep.c: Same. * arc-tdep.h: Same. * arch-utils.c: Same. * arm-nbsd-tdep.c: Same. * arm-tdep.c: Same. * ax-gdb.c: Same. * blockframe.c: Same. * btrace.c: Same. * c-varobj.c: Same. * coff-pe-read.c: Same. * coffread.c: Same. * cris-tdep.c: Same. * darwin-nat.c: Same. * dbxread.c: Same. * dcache.c: Same. * disasm.c: Same. * dtrace-probe.c: Same. * dwarf-index-write.c: Same. * dwarf2-frame-tailcall.c: Same. * dwarf2-frame.c: Same. * dwarf2read.c: Same. * eval.c: Same. * exceptions.c: Same. * fbsd-tdep.c: Same. * findvar.c: Same. * frame.c: Same. * frv-tdep.c: Same. * gnu-v3-abi.c: Same. * go32-nat.c: Same. * h8300-tdep.c: Same. * hppa-tdep.c: Same. * i386-linux-tdep.c: Same. * i386-tdep.c: Same. * ia64-libunwind-tdep.c: Same. * ia64-tdep.c: Same. * infcmd.c: Same. * infrun.c: Same. * linespec.c: Same. * linux-nat.c: Same. * linux-thread-db.c: Same. * machoread.c: Same. * mdebugread.c: Same. * mep-tdep.c: Same. * mn10300-tdep.c: Same. * namespace.c: Same. * objfiles.c: Same. * opencl-lang.c: Same. * or1k-tdep.c: Same. * osabi.c: Same. * ppc-linux-nat.c: Same. * ppc-linux-tdep.c: Same. * ppc-sysv-tdep.c: Same. * printcmd.c: Same. * procfs.c: Same. * record-btrace.c: Same. * record-full.c: Same. * remote-fileio.c: Same. * remote.c: Same. * rs6000-tdep.c: Same. * s12z-tdep.c: Same. * score-tdep.c: Same. * ser-base.c: Same. * ser-go32.c: Same. * skip.c: Same. * sol-thread.c: Same. * solib-svr4.c: Same. * solib.c: Same. * source.c: Same. * sparc-nat.c: Same. * sparc-sol2-tdep.c: Same. * sparc-tdep.c: Same. * sparc64-tdep.c: Same. * stabsread.c: Same. * stack.c: Same. * symfile.c: Same. * symtab.c: Same. * target-descriptions.c: Same. * target-float.c: Same. * thread.c: Same. * utils.c: Same. * valops.c: Same. * valprint.c: Same. * value.c: Same. * varobj.c: Same. * windows-nat.c: Same. * xcoffread.c: Same. * xstormy16-tdep.c: Same. * xtensa-tdep.c: Same. Change-Id: I5175f1b107bfa4e1cdd4a3361ccb4739e53c75c4
2019-10-18 02:48:08 +02:00
2019-10-18 Tom de Vries <tdevries@suse.de>
* aarch64-tdep.c: Fix typos in comments.
* ada-lang.c: Same.
* ada-tasks.c: Same.
* alpha-tdep.c: Same.
* alpha-tdep.h: Same.
* amd64-nat.c: Same.
* amd64-windows-tdep.c: Same.
* arc-tdep.c: Same.
* arc-tdep.h: Same.
* arch-utils.c: Same.
* arm-nbsd-tdep.c: Same.
* arm-tdep.c: Same.
* ax-gdb.c: Same.
* blockframe.c: Same.
* btrace.c: Same.
* c-varobj.c: Same.
* coff-pe-read.c: Same.
* coffread.c: Same.
* cris-tdep.c: Same.
* darwin-nat.c: Same.
* dbxread.c: Same.
* dcache.c: Same.
* disasm.c: Same.
* dtrace-probe.c: Same.
* dwarf-index-write.c: Same.
* dwarf2-frame-tailcall.c: Same.
* dwarf2-frame.c: Same.
* dwarf2read.c: Same.
* eval.c: Same.
* exceptions.c: Same.
* fbsd-tdep.c: Same.
* findvar.c: Same.
* frame.c: Same.
* frv-tdep.c: Same.
* gnu-v3-abi.c: Same.
* go32-nat.c: Same.
* h8300-tdep.c: Same.
* hppa-tdep.c: Same.
* i386-linux-tdep.c: Same.
* i386-tdep.c: Same.
* ia64-libunwind-tdep.c: Same.
* ia64-tdep.c: Same.
* infcmd.c: Same.
* infrun.c: Same.
* linespec.c: Same.
* linux-nat.c: Same.
* linux-thread-db.c: Same.
* machoread.c: Same.
* mdebugread.c: Same.
* mep-tdep.c: Same.
* mn10300-tdep.c: Same.
* namespace.c: Same.
* objfiles.c: Same.
* opencl-lang.c: Same.
* or1k-tdep.c: Same.
* osabi.c: Same.
* ppc-linux-nat.c: Same.
* ppc-linux-tdep.c: Same.
* ppc-sysv-tdep.c: Same.
* printcmd.c: Same.
* procfs.c: Same.
* record-btrace.c: Same.
* record-full.c: Same.
* remote-fileio.c: Same.
* remote.c: Same.
* rs6000-tdep.c: Same.
* s12z-tdep.c: Same.
* score-tdep.c: Same.
* ser-base.c: Same.
* ser-go32.c: Same.
* skip.c: Same.
* sol-thread.c: Same.
* solib-svr4.c: Same.
* solib.c: Same.
* source.c: Same.
* sparc-nat.c: Same.
* sparc-sol2-tdep.c: Same.
* sparc-tdep.c: Same.
* sparc64-tdep.c: Same.
* stabsread.c: Same.
* stack.c: Same.
* symfile.c: Same.
* symtab.c: Same.
* target-descriptions.c: Same.
* target-float.c: Same.
* thread.c: Same.
* utils.c: Same.
* valops.c: Same.
* valprint.c: Same.
* value.c: Same.
* varobj.c: Same.
* windows-nat.c: Same.
* xcoffread.c: Same.
* xstormy16-tdep.c: Same.
* xtensa-tdep.c: Same.
2019-10-17 Tom Tromey <tromey@adacore.com>
* configure: Rebuild.
* configure.ac: Use AC_CONFIG_HEADERS. Create stamp-h there, not
in AC_CONFIG_FILES invocation.
* Makefile.in (Makefile, data-directory/Makefile, stamp-h): Use
new-style config.status invocation.
2019-10-17 Tom de Vries <tdevries@suse.de>
* arm-nbsd-nat.c: Fix typos in comments.
* arm-tdep.c: Same.
* darwin-nat-info.c: Same.
* dwarf2read.c: Same.
* elfread.c: Same.
* event-top.c: Same.
* findvar.c: Same.
* gdbtypes.c: Same.
* hppa-tdep.c: Same.
* i386-tdep.c: Same.
* jit.c: Same.
* main.c: Same.
* mdebugread.c: Same.
* moxie-tdep.c: Same.
* nto-procfs.c: Same.
* osabi.c: Same.
* ppc-linux-tdep.c: Same.
* remote.c: Same.
* riscv-tdep.c: Same.
* s390-tdep.c: Same.
* sh-tdep.c: Same.
* sparc-linux-tdep.c: Same.
* sparc-nat.c: Same.
* stack.c: Same.
* target-descriptions.c: Same.
* top.c: Same.
* varobj.c: Same.
2019-10-16 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile) <original_name>: Now const.
2019-10-16 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/gdb_setjmp.h (SIGSETJMP): Allow passing in the value to
pass on to sigsetjmp's second argument.
* cp-support.c (gdb_demangle): Unblock SIGSEGV if we caught a crash.
DWARF reader: Reject sections with invalid sizes This is another fuzzer bug, gdb/23567. This time, the fuzzer has specifically altered the size of .debug_str: $ eu-readelf -S objdump Section Headers: [Nr] Name Type Addr Off Size ES Flags Lk Inf Al [31] .debug_str PROGBITS 0000000000000000 0057116d ffffffffffffffff 1 MS 0 0 1 When this file is loaded into GDB, the DWARF reader crashes attempting to access the string table (or it may just store a bunch of nonsense): [gdb-8.3-6-fc30] $ gdb -nx -q objdump BFD: warning: /path/to/objdump has a corrupt section with a size (ffffffffffffffff) larger than the file size Reading symbols from /path/to/objdump... Segmentation fault (core dumped) Nick has already committed a BFD patch to issue the warning seen above. [gdb master 6acc1a0b] $ gdb -BFD: warning: /path/to/objdump has a corrupt section with a size (ffffffffffffffff) larger than the file size Reading symbols from /path/to/objdump... (gdb) inf func All defined functions: File ./../include/dwarf2.def: 186: const 8 *>(.: ;'@�B); 747: const 8 *�(.: ;'@�B); 701: const 8 *�D � (.: ;'@�B); 71: const 8 *(.: ;'@�B); /* and more gibberish */ Consider read_indirect_string_at_offset_from: static const char * read_indirect_string_at_offset_from (struct objfile *objfile, bfd *abfd, LONGEST str_offset, struct dwarf2_section_info *sect, const char *form_name, const char *sect_name) { dwarf2_read_section (objfile, sect); if (sect->buffer == NULL) error (_("%s used without %s section [in module %s]"), form_name, sect_name, bfd_get_filename (abfd)); if (str_offset >= sect->size) error (_("%s pointing outside of %s section [in module %s]"), form_name, sect_name, bfd_get_filename (abfd)); gdb_assert (HOST_CHAR_BIT == 8); if (sect->buffer[str_offset] == '\0') return NULL; return (const char *) (sect->buffer + str_offset); } With sect_size being ginormous, the code attempts to access sect->buffer[GINORMOUS], and depending on the layout of memory, GDB either stores a bunch of gibberish strings or crashes. This is an attempt to mitigate this by implementing a similar approach used by BFD. In our case, we simply reject the section with the invalid length: $ ./gdb -nx -q objdump BFD: warning: /path/to/objdump has a corrupt section with a size (ffffffffffffffff) larger than the file size Reading symbols from /path/to/objdump... warning: Discarding section .debug_str which has a section size (ffffffffffffffff) larger than the file size [in module /path/to/objdump] DW_FORM_strp used without .debug_str section [in module /path/to/objdump] (No debugging symbols found in /path/to/objdump) (gdb) Unfortunately, I have not found a way to regression test this, since it requires poking ELF section headers. gdb/ChangeLog: 2019-10-16 Keith Seitz <keiths@redhat.com> PR gdb/23567 * dwarf2read.c (dwarf2_per_objfile::locate_sections): Discard sections whose size is greater than the file size. Change-Id: I896ac3b4eb2207c54e8e05c16beab3051d9b4b2f
2019-10-16 20:33:59 +02:00
2019-10-16 Keith Seitz <keiths@redhat.com>
PR gdb/23567
* dwarf2read.c (dwarf2_per_objfile::locate_sections): Discard
sections whose size is greater than the file size.
2019-10-16 Jim Wilson <jimw@sifive.com>
* riscv-tdep.c (riscv_gcc_target_options): New.
(riscv_gnu_triplet_regexp): New.
(riscv_gdbarch_init): Call set_gdbarch_gcc_triplet_options and
set_gdbarch_gnu_triplet_regexp.
2019-10-16 Christian Biesinger <cbiesinger@google.com>
* Makefile.in: Add xml-builtin.h.
* features/feature_to_c.sh: Add an include for xml-builtin.h
to ensure that the compiler checks that the types match.
* xml-builtin.h: New file.
* xml-support.c (fetch_xml_builtin): Add missing const.
* xml-support.h: Remove declaration of xml_builtins.
[gdb/tdep] Fix inferior call arg passing for amd64 We currently have 12 KFAILS in gdb.base/infcall-nested-structs.exp for PR tdep/25096. A minimal version of the failure looks like this. Consider test.c: ... struct s { int c; struct { int a; float b; } s1; }; struct s ref = { 0, { 'a', 'b' } }; int __attribute__((noinline,noclone)) check (struct s arg) { return arg.s1.a == 'a' && arg.s1.b == 'b' && arg.c == 0; } int main (void) { return check (ref); } ... When calling 'check (ref)' from main, we have '1' as expected: ... $ g++ test.c -g ; ./a.out ; echo $? 1 ... But when calling 'check (ref)' from the gdb prompt, we get '0': ... $ gdb a.out -batch -ex start -ex "p check (ref)" Temporary breakpoint 1 at 0x400518: file test.c, line 8. Temporary breakpoint 1, main () at test.c:8 8 { return check (ref); } $1 = 0 ... The layout of struct s is this: - the field c occupies 4 bytes at offset 0, - the s1.a field occupies 4 bytes at offset 4, and - the s1.b field occupies 4 bytes at offset 8. When compiling at -O2, we can see from the disassembly of main: ... 4003f0: 48 8b 3d 31 0c 20 00 mov 0x200c31(%rip),%rdi \ # 601028 <ref> 4003f7: f3 0f 10 05 31 0c 20 movss 0x200c31(%rip),%xmm0 \ # 601030 <ref+0x8> 4003fe: 00 4003ff: e9 ec 00 00 00 jmpq 4004f0 <_Z5check1s> ... that check is called with fields c and s1.a passed in %rdi, and s1.b passed in %xmm0. However, the classification in theclass (a variable representing the first and second eightbytes, to put it in SYSV X86_64 psABI terms) in amd64_push_arguments is incorrect: ... (gdb) p theclass $1 = {AMD64_INTEGER, AMD64_INTEGER} ... and therefore the struct is passed using %rdi and %rsi instead of using %rdi and %xmm0, which explains the failure. The reason that we're misclassifying the argument in amd64_classify_aggregate has to do with how nested struct are handled. Rather than using fields c and s1.a for the first eightbyte, and using field s1.b for the second eightbyte, instead field c is used for the first eightbyte, and fields s1.a and s1.b are classified together in an intermediate eightbyte, which is then used to merge with both the first and second eightbyte. Fix this by factoring out a new function amd64_classify_aggregate_field, and letting it recursively handle fields of nested structs. Tested on x86_64-linux. Tested with g++ 4.8.5, 7.4.1, 8.3.1, 9.2.1. Tested with clang++ 5.0.2 (which requires removing additional_flags=-Wno-psabi and adding additional_flags=-Wno-deprecated). gdb/ChangeLog: 2019-10-16 Tom de Vries <tdevries@suse.de> PR tdep/25096 * amd64-tdep.c (amd64_classify_aggregate_field): Factor out of ... (amd64_classify_aggregate): ... here. (amd64_classify_aggregate_field): Handled fiels of nested structs recursively. gdb/testsuite/ChangeLog: 2019-10-16 Tom de Vries <tdevries@suse.de> PR tdep/25096 * gdb.base/infcall-nested-structs.exp: Remove PR25096 KFAILs. Change-Id: Id55c74755f0a431ce31223acc86865718ae0c123
2019-10-16 17:11:56 +02:00
2019-10-16 Tom de Vries <tdevries@suse.de>
PR tdep/25096
* amd64-tdep.c (amd64_classify_aggregate_field): Factor out of ...
(amd64_classify_aggregate): ... here.
(amd64_classify_aggregate_field): Handled fiels of nested structs
recursively.
[gdb/tdep] Fix 'Unexpected register class' assert in amd64_push_arguments Atm, when executing gdb.base/infcall-nested-structs.exp on x86_64-linux, we get: ... FAIL: gdb.base/infcall-nested-structs.exp: l=c++: types-tc-tf: \ p/d check_arg_struct_02_01 (ref_val_struct_02_01) FAIL: gdb.base/infcall-nested-structs.exp: l=c++: types-ts-tf: \ p/d check_arg_struct_02_01 (ref_val_struct_02_01) FAIL: gdb.base/infcall-nested-structs.exp: l=c++: types-ti-tf: \ p/d check_arg_struct_02_01 (ref_val_struct_02_01) === gdb Summary === nr of expected passes 9255 nr of unexpected failures 3 nr of expected failures 142 ... The 3 FAILs are reported as PR tdep/25096. The 142 XFAILs are for a gdb assertion failure, reported in PR tdep/24104, which should have been KFAILs since there's a problem in gdb rather than in the environment. A minimal version of the assertion failure looks like this. Consider test.c: ... struct s { struct { } es1; long f; }; struct s ref = { {}, 'f' }; int __attribute__((noinline,noclone)) check (struct s arg) { return arg.f == 'f'; } int main (void) { return check (ref); } ... When calling 'check (ref)' from main, we have '1' as expected: ... $ g++ test3.c -g && ( ./a.out; echo $? ) 1 ... But when calling 'check (ref)' from the gdb prompt, we get: ... $ gdb a.out -batch -ex start -ex "p check (ref)" Temporary breakpoint 1 at 0x4004f7: file test.c, line 8. Temporary breakpoint 1, main () at test.c:8 8 { return check (ref); } src/gdb/amd64-tdep.c:982: internal-error: \ CORE_ADDR amd64_push_arguments(regcache*, int, value**, CORE_ADDR, \ function_call_return_method): \ Assertion `!"Unexpected register class."' failed. ... The assert happens in this loop in amd64_push_arguments: ... for (j = 0; len > 0; j++, len -= 8) { int regnum = -1; int offset = 0; switch (theclass[j]) { case AMD64_INTEGER: regnum = integer_regnum[integer_reg++]; break; case AMD64_SSE: regnum = sse_regnum[sse_reg++]; break; case AMD64_SSEUP: gdb_assert (sse_reg > 0); regnum = sse_regnum[sse_reg - 1]; offset = 8; break; default: gdb_assert (!"Unexpected register class."); } ... } ... when processing theclass[0], which is AMD64_NO_CLASS: ... (gdb) p theclass $1 = {AMD64_NO_CLASS, AMD64_INTEGER} ... The layout of struct s is that the empty field es1 occupies one byte (due to c++) at offset 0, and the long field f occupies 8 bytes at offset 8. When compiling at -O2, we can see from the disassembly of main: ... 4003f0: 48 8b 3d 41 0c 20 00 mov 0x200c41(%rip),%rdi \ # 601038 <ref+0x8> 4003f7: e9 e4 00 00 00 jmpq 4004e0 <_Z5check1s> 4003fc: 0f 1f 40 00 nopl 0x0(%rax) ... that check is called with field f passed in %rdi, meaning that the classification in theclass is correct, it's just not supported in the loop in amd64_push_arguments mentioned above. Fix the assert by implementing support for 'AMD64_NO_CLASS' in that loop. This exposes 9 more FAILs of the PR tdep/25096 type, so mark all 12 of them as KFAIL. Tested on x86_64-linux. Tested with g++ 4.8.5, 7.4.1, 8.3.1, 9.2.1. With 4.8.5, 3 of the 12 KFAILs are KPASSing. Tested with clang++ 5.0.2 (which requires removing additional_flags=-Wno-psabi and adding additional_flags=-Wno-deprecated). gdb/ChangeLog: 2019-10-16 Tom de Vries <tdevries@suse.de> PR tdep/24104 * amd64-tdep.c (amd64_push_arguments): Handle AMD64_NO_CLASS in loop that handles 'theclass'. gdb/testsuite/ChangeLog: 2019-10-16 Tom de Vries <tdevries@suse.de> PR tdep/24104 * gdb.base/infcall-nested-structs.exp: Remove XFAIL for PR tdep/24104. Add KFAIL for PR tdep/25096. Change-Id: I8b66345bbf5c00209ca75b1209fd4d60b36e9ede
2019-10-16 17:11:56 +02:00
2019-10-16 Tom de Vries <tdevries@suse.de>
PR tdep/24104
* amd64-tdep.c (amd64_push_arguments): Handle AMD64_NO_CLASS in loop
that handles 'theclass'.
2019-10-15 Andrew Burgess <andrew.burgess@embecosm.com>
* linespec.c (decode_digits_ordinary): Update comment.
* make-target-delegates: No longer need to handle VEC case.
* memrange.c (normalize_mem_ranges): Update comment.
* namespace.c (add_using_directive): Update comment.
* objc-lang.c (uniquify_strings): Update comment.
* ppc-linux-nat.c (struct thread_points): Update comment.
* probe.h (find_probes_in_objfile): Update comment.
* target.h (enum flash_preserve_mode): Update comment.
* varobj.c (varobj_restrict_range): Update comment.
* varobj.h (varobj_list_children): Update comment.
gdb: Remove vec.{c,h} and update code to not include vec.h Removes vec.c and vec.h from the source tree, and remove all the remaining includes of vec.h. There should be no user visible changes after this commit. I did have a few issues rebuilding GDB after applying this patch due to cached dependencies, I found that running this command in the build directory resolved my build issues without requiring a 'make clean': rm -fr gdb/gdbserver/gdbsupport/.deps/ gdb/ChangeLog: * Makefile.in: Remove references to vec.h and vec.c. * aarch64-tdep.c: No longer include vec.h. * ada-lang.c: Likewise. * ada-lang.h: Likewise. * arm-tdep.c: Likewise. * ax.h: Likewise. * breakpoint.h: Likewise. * charset.c: Likewise. * cp-support.h: Likewise. * dtrace-probe.c: Likewise. * dwarf2read.c: Likewise. * extension.h: Likewise. * gdb_bfd.c: Likewise. * gdbsupport/gdb_vecs.h: Likewise. * gdbsupport/vec.c: Remove. * gdbsupport/vec.h: Remove. * gdbthread.h: Likewise. * guile/scm-type.c: Likewise. * inline-frame.c: Likewise. * machoread.c: Likewise. * memattr.c: Likewise. * memrange.h: Likewise. * namespace.h: Likewise. * nat/linux-btrace.h: Likewise. * osdata.c: Likewise. * parser-defs.h: Likewise. * progspace.h: Likewise. * python/py-type.c: Likewise. * record-btrace.c: Likewise. * rust-exp.y: Likewise. * solib-target.c: Likewise. * stap-probe.c: Likewise. * target-descriptions.c: Likewise. * target-memory.c: Likewise. * target.h: Likewise. * varobj.c: Likewise. * varobj.h: Likewise. * xml-support.h: Likewise. gdb/gdbserver/ChangeLog: * Makefile.in: Remove references to vec.c. Change-Id: I0c91d7170bf1b5e992a387fcd9fe4f2abe343bb5
2019-10-07 17:38:53 +02:00
2019-10-15 Andrew Burgess <andrew.burgess@embecosm.com>
* Makefile.in: Remove references to vec.h and vec.c.
* aarch64-tdep.c: No longer include vec.h.
* ada-lang.c: Likewise.
* ada-lang.h: Likewise.
* arm-tdep.c: Likewise.
* ax.h: Likewise.
* breakpoint.h: Likewise.
* charset.c: Likewise.
* cp-support.h: Likewise.
* dtrace-probe.c: Likewise.
* dwarf2read.c: Likewise.
* extension.h: Likewise.
* gdb_bfd.c: Likewise.
* gdbsupport/gdb_vecs.h: Likewise.
* gdbsupport/vec.c: Remove.
* gdbsupport/vec.h: Remove.
* gdbthread.h: Likewise.
* guile/scm-type.c: Likewise.
* inline-frame.c: Likewise.
* machoread.c: Likewise.
* memattr.c: Likewise.
* memrange.h: Likewise.
* namespace.h: Likewise.
* nat/linux-btrace.h: Likewise.
* osdata.c: Likewise.
* parser-defs.h: Likewise.
* progspace.h: Likewise.
* python/py-type.c: Likewise.
* record-btrace.c: Likewise.
* rust-exp.y: Likewise.
* solib-target.c: Likewise.
* stap-probe.c: Likewise.
* target-descriptions.c: Likewise.
* target-memory.c: Likewise.
* target.h: Likewise.
* varobj.c: Likewise.
* varobj.h: Likewise.
* xml-support.h: Likewise.
gdb: Remove use of VEC from dwarf2read.c This removes a use of VEC from GDB, from dwarf2read.c. This removal is not very clean, and would probably benefit from additional refactoring in the future. The problem here is that the VEC is contained within struct dwarf2_per_cu_data, which is treated as POD in dwarf2read.c. As such it is actually a VEC pointer. When converting this to a std::vector in an ideal world we would not use a std::vector pointer, and use the std::vector directly. Sadly, to do that would require some rewriting in dwarf2read.c - my concern would be introducing bugs during this rewrite. If we move to a std::vector pointer then we need to take care to handle the case where the pointer is null. The old VEC library would handle null for us, making the VEC interface very clean. With std::vector we need to handle the null pointer case ourselves. The achieve this then I've added a small number of function that wrap up access to the std::vector, hopefully hiding the null pointer management. The final ugliness with this conversion is that, ideally, when wrapping a data member behind an interface I would make the data member private, however, treating the structure as POD once again prevents this, so we are left with the data member being public, but access (ideally) being through the published interface functions. There should be no user visible changes after this commit. gdb/ChangeLog: * gdb/dwarf2read.c (dwarf2_per_objfile::~dwarf2_per_objfile): Update for new std::vector based implementation. (process_psymtab_comp_unit_reader): Likewise. (scan_partial_symbols): Likewise. (recursively_compute_inclusions): Likewise. (compute_compunit_symtab_includes): Likewise. (process_imported_unit_die): Likewise. (queue_and_load_dwo_tu): Likewise. (follow_die_sig_1): Likewise. * gdb/dwarf2read.h: Remove DEF_VEC_P. (typedef dwarf2_per_cu_ptr): Remove. (struct dwarf2_per_cu_data) <imported_symtabs_empty>: New function. (struct dwarf2_per_cu_data) <imported_symtabs_push>: New function. (struct dwarf2_per_cu_data) <imported_symtabs_size>: New function. (struct dwarf2_per_cu_data) <imported_symtabs_free>: New function. (struct dwarf2_per_cu_data) <imported_symtabs>: Change to std::vector. Change-Id: Id0f4bda977c9dd83b0ba3d7fb42f7e5e2b6869c8
2019-10-02 16:38:51 +02:00
2019-10-15 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/dwarf2read.c (dwarf2_per_objfile::~dwarf2_per_objfile):
Update for new std::vector based implementation.
(process_psymtab_comp_unit_reader): Likewise.
(scan_partial_symbols): Likewise.
(recursively_compute_inclusions): Likewise.
(compute_compunit_symtab_includes): Likewise.
(process_imported_unit_die): Likewise.
(queue_and_load_dwo_tu): Likewise.
(follow_die_sig_1): Likewise.
* gdb/dwarf2read.h: Remove DEF_VEC_P.
(typedef dwarf2_per_cu_ptr): Remove.
(struct dwarf2_per_cu_data) <imported_symtabs_empty>: New
function.
(struct dwarf2_per_cu_data) <imported_symtabs_push>: New function.
(struct dwarf2_per_cu_data) <imported_symtabs_size>: New function.
(struct dwarf2_per_cu_data) <imported_symtabs_free>: New function.
(struct dwarf2_per_cu_data) <imported_symtabs>: Change to
std::vector.
2019-10-15 Tom Tromey <tromey@adacore.com>
* windows-nat.c (windows_nat_target::resume): Use %x when logging
TID.
2019-10-15 Tom Tromey <tromey@adacore.com>
* windows-nat.c (windows_nat_target::fetch_registers)
(windows_nat_target::store_registers): Rename "pid" to "tid".
2019-10-15 Tom Tromey <tromey@adacore.com>
* gdbarch.h, gdbarch.c: Rebuild.
* gdbarch.sh (gcc_target_options): Change return type to
std::string.
* compile/compile.c (get_args): Update.
* nios2-tdep.c (nios2_gcc_target_options): Return std::string.
* arm-linux-tdep.c (arm_linux_gcc_target_options): Return
std::string.
* aarch64-linux-tdep.c (aarch64_linux_gcc_target_options): Return
std::string.
* arch-utils.c (default_gcc_target_options): Return std::string.
* arch-utils.h (default_gcc_target_options): Return std::string.
* s390-tdep.c (s390_gcc_target_options): Return std::string.
2019-10-15 Christian Biesinger <cbiesinger@google.com>
* breakpoint.c (breakpoint_chain): Make static.
* tui/tui-winsource.c: Call iterate_over_breakpoints instead
of accessing breakpoint_chain.
2019-10-15 Christian Biesinger <cbiesinger@google.com>
* breakpoint.c (iterate_over_breakpoints): Change function pointer
to a gdb::function_view and return value to bool.
* breakpoint.h (iterate_over_breakpoints): Likewise.
* dummy-frame.c (pop_dummy_frame_bpt): Update.
(pop_dummy_frame): Update.
* guile/scm-breakpoint.c (bpscm_build_bp_list): Update.
(gdbscm_breakpoints): Update.
* python/py-breakpoint.c (build_bp_list): Update.
(gdbpy_breakpoints): Update.
* python/py-finishbreakpoint.c (bpfinishpy_detect_out_scope_cb):
Update.
(bpfinishpy_handle_stop): Update.
(bpfinishpy_handle_exit): Update.
* solib-svr4.c (svr4_update_solib_event_breakpoint): Update.
(svr4_update_solib_event_breakpoints): Update.
2019-10-15 Andreas Arnez <arnez@linux.ibm.com>
* s390-tdep.c (s390_effective_inner_type): Ignore static fields
when unwrapping single-field structs.
2019-10-14 Simon Marchi <simon.marchi@polymtl.ca>
* dwarf2read.c: Remove includes.
2019-10-13 Simon Marchi <simon.marchi@polymtl.ca>
* ui-out.c (ui_out::call_do_message): Silence
-Wformat-nonliteral warning.
2019-10-12 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.c: Remove some includes: continuations.h, skip.h,
mi/mi-main.h, readline/readline.h, readline/history.h. Add
include: readline/tilde.h.
2019-10-12 Christian Biesinger <cbiesinger@google.com>
* remote.c (remote_target::get_trace_status): Remove declaration of
trace_regblock_size.
2019-10-12 Christian Biesinger <cbiesinger@google.com>
* cli/cli-cmds.c (max_user_call_depth): Move comment to header.
(show_user): Remove declaration of cmdlist.
* cli/cli-cmds.h (max_user_call_depth): Declare.
* cli/cli-script.c (execute_user_command): Remove declaration
of max_user_call_depth.
2019-10-11 Jim Wilson <jimw@sifive.com>
* gdbsupport/print-utils.h (pulongest): Fix comment.
(plongest): Likewise.
(phex): Add missing comment, mention leading zeros.
(phex_nz): Add mention of no leading zeros to comment.
* riscv-tdep.c (riscv_push_dummy_code): Change %lld to %s and use
plongest instead of unsigned long long cast.
2019-10-10 Christian Biesinger <cbiesinger@google.com>
* main.c (captured_main_1): Include gdbtk.h and remove declarations
for external_editor_command and gdbtk_test.
2019-10-10 Christian Biesinger <cbiesinger@google.com>
* mi/mi-cmd-var.c (varobjdebug): Remove declaration.
* varobj.c (varobjdebug): Move comment to...
* varobj.h (varobjdebug): ...here, and declare.
2019-10-09 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_data_window::show_registers): Don't call
erase_data_content.
Make TUI window handle a unique_ptr This changes tui_gen_win_info::handle to be a specialization of unique_ptr. This is perhaps mildly uglier in some spots, due to the proliferation of "get"; but on the other hand it cleans up some manual management and it allows for the removal of tui_delete_win. gdb/ChangeLog 2019-10-09 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.h (tui_delete_win): Don't declare. * tui/tui-stack.c (tui_locator_window::rerender): Update. * tui/tui-command.c (tui_cmd_window::resize) (tui_refresh_cmd_win): Update. * tui/tui-win.c (tui_resize_all, tui_set_focus_command): Update. * tui/tui.c (tui_rl_other_window, tui_enable): Update. * tui/tui-data.c (~tui_gen_win_info): Remove. * tui/tui-layout.c (tui_gen_win_info::resize): Update. * tui/tui-io.c (update_cmdwin_start_line, tui_putc, tui_puts) (tui_redisplay_readline, tui_mld_flush) (tui_mld_erase_entire_line, tui_mld_getc, tui_getc): Update. * tui/tui-regs.c (tui_data_window::delete_data_content_windows) (tui_data_window::erase_data_content) (tui_data_item_window::rerender) (tui_data_item_window::refresh_window): Update. * tui/tui-wingeneral.c (tui_gen_win_info::refresh_window) (box_win, tui_gen_win_info::make_window) (tui_gen_win_info::make_visible): Update. (tui_delete_win): Remove. * tui/tui-winsource.c (tui_source_window_base::do_erase_source_content): Update. (tui_show_source_line, tui_source_window_base::update_tab_width) (tui_source_window_base::update_exec_info): Update. * tui/tui-data.h (struct curses_deleter): New. (struct tui_gen_win_info) <handle>: Now a unique_ptr. (struct tui_gen_win_info) <~tui_gen_win_info>: Define.
2019-10-02 01:29:49 +02:00
2019-10-09 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_delete_win): Don't declare.
* tui/tui-stack.c (tui_locator_window::rerender): Update.
* tui/tui-command.c (tui_cmd_window::resize)
(tui_refresh_cmd_win): Update.
* tui/tui-win.c (tui_resize_all, tui_set_focus_command): Update.
* tui/tui.c (tui_rl_other_window, tui_enable): Update.
* tui/tui-data.c (~tui_gen_win_info): Remove.
* tui/tui-layout.c (tui_gen_win_info::resize): Update.
* tui/tui-io.c (update_cmdwin_start_line, tui_putc, tui_puts)
(tui_redisplay_readline, tui_mld_flush)
(tui_mld_erase_entire_line, tui_mld_getc, tui_getc): Update.
* tui/tui-regs.c (tui_data_window::delete_data_content_windows)
(tui_data_window::erase_data_content)
(tui_data_item_window::rerender)
(tui_data_item_window::refresh_window): Update.
* tui/tui-wingeneral.c (tui_gen_win_info::refresh_window)
(box_win, tui_gen_win_info::make_window)
(tui_gen_win_info::make_visible): Update.
(tui_delete_win): Remove.
* tui/tui-winsource.c
(tui_source_window_base::do_erase_source_content): Update.
(tui_show_source_line, tui_source_window_base::update_tab_width)
(tui_source_window_base::update_exec_info): Update.
* tui/tui-data.h (struct curses_deleter): New.
(struct tui_gen_win_info) <handle>: Now a unique_ptr.
(struct tui_gen_win_info) <~tui_gen_win_info>: Define.
2019-10-09 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (struct tui_gen_win_info): Don't declare.
2019-10-09 Tom Tromey <tom@tromey.com>
* tui/tui-data.c (tui_win_is_auxiliary): Remove.
* tui/tui-data.h (tui_win_is_auxiliary): Don't declare.
2019-10-09 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.c (tui_get_low_disassembly_address): Compute
window height directly.
* tui/tui-layout.h (tui_default_win_viewport_height): Don't
declare.
* tui/tui-layout.c (tui_default_win_height): Remove.
(tui_default_win_viewport_height): Remove.
2019-10-09 Tom Tromey <tom@tromey.com>
* tui/tui.h: Remove comments.
2019-10-09 Tom de Vries <tdevries@suse.de>
* python/lib/gdb/printer/bound_registers.py: Use
'^builtin_type_bound128' as regexp argument for
add_builtin_pretty_printer.
2019-10-09 Christian Biesinger <cbiesinger@google.com>
* guile/guile.c (guile_extension_script_ops): Remove forward
declaration and mark as static.
(guile_script_ops): Likewise.
(extension_language_guile): Move further down in the file so
it can reference the definitions for guile_{extension_,}script_ops.
2019-10-09 Andreas Arnez <arnez@linux.ibm.com>
* s390-tdep.c (390_process_record): Handle new arch13 instructions
except SORTL, DFLTCC, and KDSA.
2019-10-08 Tom Tromey <tromey@adacore.com>
* windows-nat.c (struct windows_thread_info_struct) <sf>: Remove.
(struct safe_symbol_file_add_args): Remove.
2019-10-08 Tom Tromey <tromey@adacore.com>
* windows-nat.c: Don't include buildsym-legacy.h.
2019-10-08 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh (%p): Allow gdb-specific %p extensions.
2019-10-08 Christian Biesinger <cbiesinger@google.com>
* gdbtypes.c (overload_debug): Move comment to header.
* gdbtypes.h (overload_debug): Declare.
* valops.c: Remove declaration of overload_debug, instead
include gdbtypes.h.
2019-10-08 Christian Biesinger <cbiesinger@google.com>
* language.c (show_language_command): Pass lang_frame_mismatch_warn
through _().
(lang_frame_mismatch_warn): Make const, mark with N_(), and
move comment...
* language.h (lang_frame_mismatch_warn): ... here. Also add
declaration.
* top.c (lang_frame_mismatch_warn): Remove declaration.
(check_frame_language_change): Pass lang_frame_mismatch_warn
through _().
2019-10-07 Christian Biesinger <cbiesinger@google.com>
* c-lang.h (vtbl_ptr_name): Declare.
* cp-valprint.c (vtbl_ptr_name): Remove "extern" now that we get
it from the header.
* stabsread.c (define_symbol): Remove declaration of vtbl_ptr_name.
2019-10-07 Christian Biesinger <cbiesinger@google.com>
* charset.c (your_gdb_wchar_t_is_bogus): Replace with a
gdb_static_assert.
gdb: CTF support This patch adds the CTF (Compact Ansi-C Type Format) support in gdb. Two submissions on which this gdb work depends were posted earlier in May: * On the binutils mailing list - adding libctf which creates, updates, reads, and manipulates the CTF data. * On the gcc mailing list - expanding gcc to directly emit the CFT data with a new command line option -gt. CTF is a reduced form of debugging information whose main purpose is to describe the type of C entities such as structures, unions, typedefs and function arguments at the global scope only. It does not contain debug information about source lines, location expressions, or local variables. For more information on CTF, see the documentation in the libdtrace-ctf source tree, available here: <https://raw.githubusercontent.com/oracle/libdtrace-ctf/master/doc/ctf-format>. This patch expands struct elfinfo by adding the .ctf section, which contains CTF debugging info, and modifies elf_symfile_read() to read it. If both DWARF and CTF exist in a program, only DWARF will be read. CTF data will be read only when there is no DWARF. The two-stage symbolic reading and setting strategy, partial and full, was used. File ctfread.c contains functions to transform CTF data into gdb's internal symbol table structures by iterately reading entries from CTF sections of "data objects", "function info", "variable info", and "data types" when setting up either partial or full symbol table. If the ELF symbol table is available, e.g. not stripped, the CTF reader will associate the found type information with these symbol entries. Due to the proximity between DWARF and CTF (CTF being a much simplified subset of DWARF), some DWARF implementation was reused to support CTF. Test cases ctf-constvars.exp, ctf-cvexpr.exp, ctf-ptype.exp, and ctf-whatis.exp have been added to verify the correctness of this support. This patch has missing features and limitations which we will add and address in the future patches. gdb/ChangeLog +2019-10-07 Weimin Pan <weimin.pan@oracle.com> + + * gdb/ctfread.c: New file. + * gdb/ctfread.h: New file. + * gdb/elfread.c: Include ctfread.h. + (struct elfinfo text_p): New member ctfsect. + (elf_locate_sections): Mark CTF section. + (elf_symfile_read): Call elfctf_build_psymtabs. + * gdb/Makefile.in (LIBCTF): Add. + (CLIBS): Use it. + (CDEPS): Likewise. + (DIST): Add ctfread.c. + * Makefile.def (dependencies): Add all-libctf to all-gdb + * Makefile.in: Add "all-gdb: maybe-all-libctf" + gdb/testsuite/ChangeLog +2019-10-07 Weimin Pan <weimin.pan@oracle.com> + + * gdb.base/ctf-whatis.exp: New file. + * gdb.base/ctf-whatis.c: New file. + * gdb.base/ctf-ptype.exp: New file. + * gdb.base/ctf-ptype.c: New file. + * gdb.base/ctf-constvars.exp: New file. + * gdb.base/ctf-constvars.c: New file. + * gdb.base/ctf-cvexpr.exp: New file. +
2019-10-07 02:46:52 +02:00
2019-10-07 Weimin Pan <weimin.pan@oracle.com>
* ../Makefile.def (dependencies): Add all-libctf to all-gdb
* ../Makefile.in: Add "all-gdb: maybe-all-libctf"
gdb: CTF support This patch adds the CTF (Compact Ansi-C Type Format) support in gdb. Two submissions on which this gdb work depends were posted earlier in May: * On the binutils mailing list - adding libctf which creates, updates, reads, and manipulates the CTF data. * On the gcc mailing list - expanding gcc to directly emit the CFT data with a new command line option -gt. CTF is a reduced form of debugging information whose main purpose is to describe the type of C entities such as structures, unions, typedefs and function arguments at the global scope only. It does not contain debug information about source lines, location expressions, or local variables. For more information on CTF, see the documentation in the libdtrace-ctf source tree, available here: <https://raw.githubusercontent.com/oracle/libdtrace-ctf/master/doc/ctf-format>. This patch expands struct elfinfo by adding the .ctf section, which contains CTF debugging info, and modifies elf_symfile_read() to read it. If both DWARF and CTF exist in a program, only DWARF will be read. CTF data will be read only when there is no DWARF. The two-stage symbolic reading and setting strategy, partial and full, was used. File ctfread.c contains functions to transform CTF data into gdb's internal symbol table structures by iterately reading entries from CTF sections of "data objects", "function info", "variable info", and "data types" when setting up either partial or full symbol table. If the ELF symbol table is available, e.g. not stripped, the CTF reader will associate the found type information with these symbol entries. Due to the proximity between DWARF and CTF (CTF being a much simplified subset of DWARF), some DWARF implementation was reused to support CTF. Test cases ctf-constvars.exp, ctf-cvexpr.exp, ctf-ptype.exp, and ctf-whatis.exp have been added to verify the correctness of this support. This patch has missing features and limitations which we will add and address in the future patches. gdb/ChangeLog +2019-10-07 Weimin Pan <weimin.pan@oracle.com> + + * gdb/ctfread.c: New file. + * gdb/ctfread.h: New file. + * gdb/elfread.c: Include ctfread.h. + (struct elfinfo text_p): New member ctfsect. + (elf_locate_sections): Mark CTF section. + (elf_symfile_read): Call elfctf_build_psymtabs. + * gdb/Makefile.in (LIBCTF): Add. + (CLIBS): Use it. + (CDEPS): Likewise. + (DIST): Add ctfread.c. + * Makefile.def (dependencies): Add all-libctf to all-gdb + * Makefile.in: Add "all-gdb: maybe-all-libctf" + gdb/testsuite/ChangeLog +2019-10-07 Weimin Pan <weimin.pan@oracle.com> + + * gdb.base/ctf-whatis.exp: New file. + * gdb.base/ctf-whatis.c: New file. + * gdb.base/ctf-ptype.exp: New file. + * gdb.base/ctf-ptype.c: New file. + * gdb.base/ctf-constvars.exp: New file. + * gdb.base/ctf-constvars.c: New file. + * gdb.base/ctf-cvexpr.exp: New file. +
2019-10-07 02:46:52 +02:00
* ctfread.c: New file.
* ctfread.h: New file.
* elfread.c: Include ctfread.h.
(struct elfinfo text_p): New member ctfsect.
(elf_locate_sections): Mark CTF section.
(elf_symfile_read): Call elfctf_build_psymtabs.
* Makefile.in (LIBCTF): Add.
(CLIBS): Use it.
(CDEPS): Likewise.
(DIST): Add ctfread.c.
2019-10-07 Andrew Burgess <andrew.burgess@embecosm.com>
* ctfread.c (struct nextfield): Renamed to ...
(struct ctf_nextfield): ... this.
(struct field_info): Renamed to ...
(strut ctf_field_info): ... this.
(attach_fields_to_type): Update for renamed structures.
(ctf_add_member_cb): Likewise.
(ctf_add_enum_member_cb): Likewise.
(process_struct_members): Likewise.
(process_enum_type): Likewise.
gdb: CTF support This patch adds the CTF (Compact Ansi-C Type Format) support in gdb. Two submissions on which this gdb work depends were posted earlier in May: * On the binutils mailing list - adding libctf which creates, updates, reads, and manipulates the CTF data. * On the gcc mailing list - expanding gcc to directly emit the CFT data with a new command line option -gt. CTF is a reduced form of debugging information whose main purpose is to describe the type of C entities such as structures, unions, typedefs and function arguments at the global scope only. It does not contain debug information about source lines, location expressions, or local variables. For more information on CTF, see the documentation in the libdtrace-ctf source tree, available here: <https://raw.githubusercontent.com/oracle/libdtrace-ctf/master/doc/ctf-format>. This patch expands struct elfinfo by adding the .ctf section, which contains CTF debugging info, and modifies elf_symfile_read() to read it. If both DWARF and CTF exist in a program, only DWARF will be read. CTF data will be read only when there is no DWARF. The two-stage symbolic reading and setting strategy, partial and full, was used. File ctfread.c contains functions to transform CTF data into gdb's internal symbol table structures by iterately reading entries from CTF sections of "data objects", "function info", "variable info", and "data types" when setting up either partial or full symbol table. If the ELF symbol table is available, e.g. not stripped, the CTF reader will associate the found type information with these symbol entries. Due to the proximity between DWARF and CTF (CTF being a much simplified subset of DWARF), some DWARF implementation was reused to support CTF. Test cases ctf-constvars.exp, ctf-cvexpr.exp, ctf-ptype.exp, and ctf-whatis.exp have been added to verify the correctness of this support. This patch has missing features and limitations which we will add and address in the future patches. gdb/ChangeLog +2019-10-07 Weimin Pan <weimin.pan@oracle.com> + + * gdb/ctfread.c: New file. + * gdb/ctfread.h: New file. + * gdb/elfread.c: Include ctfread.h. + (struct elfinfo text_p): New member ctfsect. + (elf_locate_sections): Mark CTF section. + (elf_symfile_read): Call elfctf_build_psymtabs. + * gdb/Makefile.in (LIBCTF): Add. + (CLIBS): Use it. + (CDEPS): Likewise. + (DIST): Add ctfread.c. + * Makefile.def (dependencies): Add all-libctf to all-gdb + * Makefile.in: Add "all-gdb: maybe-all-libctf" + gdb/testsuite/ChangeLog +2019-10-07 Weimin Pan <weimin.pan@oracle.com> + + * gdb.base/ctf-whatis.exp: New file. + * gdb.base/ctf-whatis.c: New file. + * gdb.base/ctf-ptype.exp: New file. + * gdb.base/ctf-ptype.c: New file. + * gdb.base/ctf-constvars.exp: New file. + * gdb.base/ctf-constvars.c: New file. + * gdb.base/ctf-cvexpr.exp: New file. +
2019-10-07 02:46:52 +02:00
2019-10-07 Weimin Pan <weimin.pan@oracle.com>
* tracectf.h: Rename, was ctf.h.
* tracectf.c: Rename, was ctf.c, replace ctf.h with tracectf.h.
* tracefile.c: Likewise.
* tracepoint.c: Remove unused include ctf.h.
* mi/mi-main.c: Likewise.
* Makefile.in Replace ctf.c with tracectf.c.
2019-10-06 Joel Brobecker <brobecker@adacore.com>
* version.in: Change version number to "9.0.50.DATE-git".
2019-10-03 Tom Tromey <tom@tromey.com>
PR rust/24976:
* dwarf2read.c (quirk_rust_enum): Handle single-element unions.
2019-10-03 Andrew Burgess <andrew.burgess@embecosm.com>
* f-lang.c (f_language_defn): Use cp_get_symbol_name_matcher and
cp_search_name_hash.
* NEWS: Add entry about nested function support.
gdb/fortran: Nested subroutine support This patch is a rebase and update of the following three patches: https://sourceware.org/ml/gdb-patches/2018-11/msg00298.html https://sourceware.org/ml/gdb-patches/2018-11/msg00302.html https://sourceware.org/ml/gdb-patches/2018-11/msg00301.html I have merged these together into a single commit as the second patch, adding scope support to nested subroutines, means that some of the changes in the first patch are now no longer useful and would have to be backed out. The third patch is tightly coupled to the changes in the second of these patches and I think deserves to live together with it. There is an extra change in cp-namespace.c that is new, this resolves an issue with symbol lookup when placing breakpoints from within nested subroutines. There is also an extra test added to this commit 'nested-funcs-2.exp' that was written by Richard Bunt from ARM, this offers some additional testing of breakpoints on nested functions. After this commit it is possible to place breakpoints on nested Fortran subroutines and functions by using a fully scoped name, for example, given this simple Fortran program: program greeting call message contains subroutine message print *, "Hello World" end subroutine message end program greeting It is possible to place a breakpoint in 'message' with: (gdb) break greeting::message Breakpoint 1 at 0x4006c9: file basic.f90, line 5. What doesn't work with this commit is placing a breakpoint like this: (gdb) break message Function "message" not defined. Making this work will come in a later commit. gdb/ChangeLog: * cp-namespace.c (cp_search_static_and_baseclasses): Only search for nested static variables when searchin VAR_DOMAIN. * dwarf2read.c (add_partial_symbol): Add nested subroutines to the global scope, update comment. (add_partial_subprogram): Call add_partial_subprogram recursively for nested subroutines when processinng Fortran. (load_partial_dies): Process the child entities of a subprogram when processing Fortran. (partial_die_parent_scope): Handle building scope for Fortran nested functions. (process_die): Record that nested functions have a scope. (new_symbol): Always record Fortran subprograms on the global symbol list. (determine_prefix): How to build the prefix for Fortran subprograms. gdb/testsuite/ChangeLog: * gdb.fortran/nested-funcs.exp: Tests for placing breakpoints on nested functions. * gdb.fortran/nested-funcs.f90: Update expected results. * gdb.fortran/nested-funcs-2.exp: New file. * gdb.fortran/nested-funcs-2.f90: New file. gdb/doc/ChangeLog: * doc/gdb.texinfo (Fortran Operators): Describe scope operator.
2019-08-15 15:57:13 +02:00
2019-10-03 Bernhard Heckel <bernhard.heckel@intel.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* cp-namespace.c (cp_search_static_and_baseclasses): Only search
for nested static variables when searchin VAR_DOMAIN.
* dwarf2read.c (add_partial_symbol): Add nested subroutines to the
global scope, update comment.
(add_partial_subprogram): Call add_partial_subprogram recursively
for nested subroutines when processinng Fortran.
(load_partial_dies): Process the child entities of a subprogram
when processing Fortran.
(partial_die_parent_scope): Handle building scope
for Fortran nested functions.
(process_die): Record that nested functions have a scope.
(new_symbol): Always record Fortran subprograms on the global
symbol list.
(determine_prefix): How to build the prefix for Fortran
subprograms.
gdb: Don't ignore all SIGSTOP when the signal handler is set to pass It was observed that in a multi-threaded application on GNU/Linux, that if the user has set the SIGSTOP to be pass (using GDB's handle command) then the inferior would hang upon hitting a breakpoint. What happens is that when a thread hits the breakpoint GDB tries to stop all of the other threads by sending them a SIGSTOP and setting the stop_requested flag in the target_ops structure - this can be seen in infrun.c:stop_all_threads. GDB then waits for all of the other threads to stop. When the SIGSTOP event arrives we eventually end up in linux-nat.c:linux_nat_filter_event, which has the job of deciding if the event we're looking at (the SIGSTOP arriving in this case) is something that should be reported back to the core of GDB. One of the final actions of this function is to check if we stopped due to a signal, and if we did, and the signal has been set to 'pass' by the user then we ignore the event and resume the thread. This code already has some conditions in place that mean the event is reported to GDB even if the signal is in the set of signals to be passed to the inferior. In this commit I extend this condition such that: If the signal is a SIGSTOP, and the thread's stop_requested flag is set (indicating we're waiting for the thread to stop with a SIGSTOP) then we should report this SIGSTOP to GDB and not pass it to the inferior. With this change in place the test now passes. Regression tested on x86-64 GNU/Linux with no regressions. gdb/ChangeLog: * linux-nat.c (linux_nat_filter_event): Don't ignore SIGSTOP if we have just sent the thread a SIGSTOP and are waiting for it to arrive. gdb/testsuite/ChangeLog: * gdb.threads/stop-with-handle.c: New file. * gdb.threads/stop-with-handle.exp: New file.
2019-09-10 16:24:28 +02:00
2019-10-03 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-nat.c (linux_nat_filter_event): Don't ignore SIGSTOP if we
have just sent the thread a SIGSTOP and are waiting for it to
arrive.
2019-10-03 Andrew Burgess <andrew.burgess@embecosm.com>
* btrace.c (btrace_add_pc): Remove whitespace before the template
parameter in 'std::vector <...>'.
(parse_xml_btrace_block): Likewise.
(btrace_maint_decode_pt): Likewise.
(btrace_maint_update_packets): Likewise.
(btrace_maint_print_packets): Likewise.
* btrace.h (struct btrace_maint_info): Likewise.
* dwarf2read.c (struct type_unit_group): Likewise.
(build_type_psymtabs_reader): Likewise.
* gdbsupport/btrace-common.c (btrace_data_append): Likewise.
* gdbsupport/btrace-common.h (struct btrace_data_bts): Likewise.
* nat/linux-btrace.c (perf_event_read_bts): Likewise.
2019-10-03 Tom de Vries <tdevries@suse.de>
* cli/cli-style.c (_initialize_cli_style): Adding a '.' at the end of
the first line of the help text for set/show style metadata.
2019-10-02 Tom Tromey <tromey@adacore.com>
* Makefile.in (COMMON_SFILES): Add common-inferior.c.
* gdbsupport/common-inferior.c: New file.
* infcmd.c (startup_with_shell): Don't define.
* nat/fork-inferior.h (startup_with_shell): Don't declare.
* gdbsupport/common-inferior.h (startup_with_shell): Declare.
* inferior.h (startup_with_shell): Don't declare.
2019-10-02 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/gdb_assert.h: Include errors.h.
* gdbsupport/gdb_string_view.h: Include gdb_assert.h.
Add $_ada_exception convenience variable This adds the $_ada_exception convenience variable. It is set by the Ada exception catchpoints, and holds the address of the exception currently being thrown. This is useful because it allows more fine-grained filtering of exceptions than is possible using the existing "catch" syntax. This also simplifies Ada catchpoints somewhat; because the catchpoint must now carry the "kind", it's possible to remove many helper functions. gdb/ChangeLog 2019-10-02 Tom Tromey <tromey@adacore.com> * NEWS: Add $_ada_exception entry. * ada-lang.c (struct ada_catchpoint): Add constructor. <m_kind>: New member. (allocate_location_exception, re_set_exception): Remove "ex" parameter. (should_stop_exception): Compute $_ada_exception. (check_status_exception, print_it_exception) (print_one_exception, print_mention_exception): Remove "ex" parameter. (allocate_location_catch_exception, re_set_catch_exception) (check_status_exception, print_it_catch_exception) (print_one_catch_exception, print_mention_catch_exception) (print_recreate_catch_exception) (allocate_location_catch_exception_unhandled) (re_set_catch_exception_unhandled) (check_status_exception, print_it_catch_exception_unhandled) (print_one_catch_exception_unhandled) (print_mention_catch_exception_unhandled) (print_recreate_catch_exception_unhandled) (allocate_location_catch_assert, re_set_catch_assert) (check_status_assert, print_it_catch_assert) (print_one_catch_assert, print_mention_catch_assert) (print_recreate_catch_assert) (allocate_location_catch_handlers, re_set_catch_handlers) (check_status_handlers, print_it_catch_handlers) (print_one_catch_handlers, print_mention_catch_handlers) (print_recreate_catch_handlers): Remove. (create_ada_exception_catchpoint): Update. (initialize_ada_catchpoint_ops): Update. gdb/doc/ChangeLog 2019-10-02 Tom Tromey <tromey@adacore.com> * gdb.texinfo (Set Catchpoints, Convenience Vars): Document $_ada_exception. gdb/testsuite/ChangeLog 2019-10-02 Tom Tromey <tromey@adacore.com> * gdb.ada/catch_ex_std.exp: Add $_ada_exception test.
2019-05-31 22:50:23 +02:00
2019-10-02 Tom Tromey <tromey@adacore.com>
* NEWS: Add $_ada_exception entry.
* ada-lang.c (struct ada_catchpoint): Add constructor.
<m_kind>: New member.
(allocate_location_exception, re_set_exception): Remove
"ex" parameter.
(should_stop_exception): Compute $_ada_exception.
(check_status_exception, print_it_exception)
(print_one_exception, print_mention_exception): Remove
"ex" parameter.
(allocate_location_catch_exception, re_set_catch_exception)
(check_status_exception, print_it_catch_exception)
(print_one_catch_exception, print_mention_catch_exception)
(print_recreate_catch_exception)
(allocate_location_catch_exception_unhandled)
(re_set_catch_exception_unhandled)
(check_status_exception, print_it_catch_exception_unhandled)
(print_one_catch_exception_unhandled)
(print_mention_catch_exception_unhandled)
(print_recreate_catch_exception_unhandled)
(allocate_location_catch_assert, re_set_catch_assert)
(check_status_assert, print_it_catch_assert)
(print_one_catch_assert, print_mention_catch_assert)
(print_recreate_catch_assert)
(allocate_location_catch_handlers, re_set_catch_handlers)
(check_status_handlers, print_it_catch_handlers)
(print_one_catch_handlers, print_mention_catch_handlers)
(print_recreate_catch_handlers): Remove.
(create_ada_exception_catchpoint): Update.
(initialize_ada_catchpoint_ops): Update.
2019-10-02 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_lookup_simple_minsyms): Remove.
(create_excep_cond_exprs): Simplify exception string computation.
(ada_exception_catchpoint_cond_string): Likewise.
Handle copy relocations In ELF, if a data symbol is defined in a shared library and used by the main program, it will be subject to a "copy relocation". In this scenario, the main program has a copy of the symbol in question, and a relocation that tells ld.so to copy the data from the shared library. Then the symbol in the main program is used to satisfy all references. This patch changes gdb to handle this scenario. Data symbols coming from ELF shared libraries get a special flag that indicates that the symbol's address may be subject to copy relocation. I looked briefly into handling copy relocations by looking at the actual relocations in the main program, but this seemed difficult to do with BFD. Note that no caching is done here. Perhaps this could be changed if need be; I wanted to avoid possible problems with either objfile lifetimes and changes, or conflicts with the long-term (vapor-ware) objfile splitting project. gdb/ChangeLog 2019-10-02 Tom Tromey <tromey@adacore.com> * symmisc.c (dump_msymbols): Don't use MSYMBOL_VALUE_ADDRESS. * ada-lang.c (lesseq_defined_than): Handle LOC_STATIC. * dwarf2read.c (dwarf2_per_objfile): Add can_copy parameter. (dwarf2_has_info): Likewise. (new_symbol): Set maybe_copied on symbol when appropriate. * dwarf2read.h (dwarf2_per_objfile): Add can_copy parameter. <can_copy>: New member. * elfread.c (record_minimal_symbol): Set maybe_copied on symbol when appropriate. (elf_symfile_read): Update call to dwarf2_has_info. * minsyms.c (lookup_minimal_symbol_linkage): New function. * minsyms.h (lookup_minimal_symbol_linkage): Declare. * symtab.c (get_symbol_address, get_msymbol_address): New functions. * symtab.h (get_symbol_address, get_msymbol_address): Declare. (SYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_ADDRESS): Handle maybe_copied. (struct symbol, struct minimal_symbol) <maybe_copied>: New member.
2019-06-25 20:50:45 +02:00
2019-10-02 Tom Tromey <tromey@adacore.com>
* symmisc.c (dump_msymbols): Don't use MSYMBOL_VALUE_ADDRESS.
* ada-lang.c (lesseq_defined_than): Handle
LOC_STATIC.
* dwarf2read.c (dwarf2_per_objfile): Add can_copy
parameter.
(dwarf2_has_info): Likewise.
(new_symbol): Set maybe_copied on symbol when
appropriate.
* dwarf2read.h (dwarf2_per_objfile): Add can_copy
parameter.
<can_copy>: New member.
* elfread.c (record_minimal_symbol): Set maybe_copied
on symbol when appropriate.
(elf_symfile_read): Update call to dwarf2_has_info.
* minsyms.c (lookup_minimal_symbol_linkage): New
function.
* minsyms.h (lookup_minimal_symbol_linkage): Declare.
* symtab.c (get_symbol_address, get_msymbol_address):
New functions.
* symtab.h (get_symbol_address, get_msymbol_address):
Declare.
(SYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_ADDRESS): Handle
maybe_copied.
(struct symbol, struct minimal_symbol) <maybe_copied>:
New member.
2019-10-02 Tom Tromey <tromey@adacore.com>
* source.c (struct current_source_location): New.
(current_source_key): New global.
(current_source_symtab, current_source_line)
(current_source_pspace): Remove.
(get_source_location): New function.
(get_current_source_symtab_and_line)
(set_default_source_symtab_and_line)
(set_current_source_symtab_and_line)
(clear_current_source_symtab_and_line, select_source_symtab)
(info_source_command, print_source_lines_base)
(info_line_command, search_command_helper, _initialize_source):
Update.
2019-10-02 Tom Tromey <tromey@adacore.com>
* source.c (select_source_symtab): Don't call
decode_line_with_current_source.
2019-10-02 Andrew Burgess <andrew.burgess@embecosm.com>
* symtab.c (lookup_global_symbol): Search global block.
2019-10-02 Tom Tromey <tromey@adacore.com>
* coffread.c (process_coff_symbol): Update.
* dwarf2read.c (var_decode_location, new_symbol): Update.
* mdebugread.c (parse_symbol): Update.
* objfiles.c (relocate_one_symbol): Update.
* stabsread.c (define_symbol, fix_common_block)
(scan_file_globals): Update.
* symtab.h (SYMBOL_VALUE_ADDRESS): Expand to an rvalue.
(SET_SYMBOL_VALUE_ADDRESS): New macro.
* xcoffread.c (process_xcoff_symbol): Update.
2019-10-02 Andreas Arnez <arnez@linux.ibm.com>
* MAINTAINERS: Update my email address.
2019-10-02 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2read.c (struct type_unit_group) <tus>: Convert to
std::vector.
(build_type_psymtabs_reader): Update for std::vector.
(build_type_psymtab_dependencies): Likewise.
* dwarf2read.h: Remove use of DEF_VEC_P.
(typedef sig_type_ptr): Delete.
2019-10-02 Andrew Burgess <andrew.burgess@embecosm.com>
* btrace.c (btrace_maint_clear): Update to handle change from VEC
to std::vector.
(btrace_maint_decode_pt): Likewise, and move allocation of the
vector outside of the loop.
(btrace_maint_update_packets): Update to handle change from VEC to
std::vector.
(btrace_maint_print_packets): Likewise.
(maint_info_btrace_cmd): Likewise.
* btrace.h: Remove use of DEF_VEC_O.
(typedef btrace_pt_packet_s): Delete.
(struct btrace_maint_info) <packets>: Change fromm VEC to
std::vector.
* gdbsupport/btrace-common.h: Remove 'vec.h' include.
2019-10-02 Andrew Burgess <andrew.burgess@embecosm.com>
* btrace.c (btrace_compute_ftrace_bts): Update for std::vector,
make accesses into the vector constant references.
(btrace_add_pc): Update for std::vector.
(btrace_stitch_bts): Likewise.
(parse_xml_btrace_block): Likewise.
(btrace_maint_update_packets): Likewise.
(btrace_maint_print_packets): Likewise.
(maint_info_btrace_cmd): Likewise.
* gdbsupport/btrace-common.c (btrace_data::fini): Update for
std::vector.
(btrace_data::empty): Likewise.
(btrace_data_append): Likewise.
* gdbsupport/btrace-common.h: Remove use of DEF_VEC_O.
(typedef btrace_block_s): Delete.
(struct btrace_block): Add constructor.
(struct btrace_data_bts) <blocks>: Change to std::vector.
* nat/linux-btrace.c (perf_event_read_bts): Update for
std::vector.
(linux_read_bts): Likewise.
2019-10-01 Tom Tromey <tom@tromey.com>
* cli/cli-logging.c (show_logging_filename): Use styled_string.
2019-10-01 Tom Tromey <tom@tromey.com>
* stack.c (print_frame, info_frame_command_core): Use
styled_string.
* linux-thread-db.c (try_thread_db_load_1)
(try_thread_db_load_from_pdir_1): Use styled_string.
* auto-load.c (file_is_auto_load_safe, execute_script_contents)
(auto_load_section_scripts, info_auto_load_local_gdbinit)
(maybe_print_unsupported_script_warning)
(maybe_print_script_not_found_warning): Use styled_string.
* ada-lang.c (user_select_syms): Use styled_string.
Introduce metadata style This introduces a new "metadata" style and changes many places in gdb to use it. The idea here is to let the user distinguish gdb output from output that (conceptually at least) comes directly from the inferior. The newly-styled category includes text that gdb traditionally surrounds in "<...>", like "<unavailable>". I only added a single test for this. In many cases this output is difficult to test. Also, while developing this errors in the implementation of the new printf formats showed up as regressions. gdb/ChangeLog 2019-10-01 Tom Tromey <tom@tromey.com> * p-lang.c (pascal_printstr): Use metadata style. * value.c (show_convenience): Use metadata style. * valprint.c (valprint_check_validity, val_print_optimized_out) (val_print_not_saved, val_print_unavailable) (val_print_invalid_address, generic_val_print, val_print) (value_check_printable, val_print_array_elements): Use metadata style. * ui-out.h (class ui_out) <field_fmt>: New overload. <do_field_fmt>: Add style parameter. * ui-out.c (ui_out::field_fmt): New overload. * typeprint.c (type_print_unknown_return_type) (val_print_not_allocated, val_print_not_associated): Use metadata style. * tui/tui-out.h (class tui_ui_out) <do_field_fmt>: Add style parameter. * tui/tui-out.c (tui_ui_out::do_field_fmt): Update. * tracepoint.c (tvariables_info_1): Use metadata style. * stack.c (print_frame_arg, print_frame_info, print_frame) (info_frame_command_core): Use metadata style. * skip.c (info_skip_command): Use metadata style. * rust-lang.c (rust_print_enum): Use metadata style. * python/py-prettyprint.c (print_stack_unless_memory_error): Use metadata style. * python/py-framefilter.c (py_print_single_arg): Use metadata style. * printcmd.c (do_one_display, print_variable_and_value): Use metadata style. * p-valprint.c (pascal_val_print) (pascal_object_print_value_fields): Use metadata style. * p-typeprint.c (pascal_type_print_base): Use metadata style. * mi/mi-out.h (class mi_ui_out) <do_field_fmt>: Add style parameter. * mi/mi-out.c (mi_ui_out::do_field_fmt): Update. * m2-valprint.c (m2_print_long_set): Use metadata style. * m2-typeprint.c (m2_print_type): Use metadata style. * infcmd.c (print_return_value_1): Use metadata style. * gnu-v3-abi.c (print_one_vtable): Use metadata style. * f-valprint.c (info_common_command_for_block): Use metadata style. * f-typeprint.c (f_type_print_base): Use metadata style. * expprint.c (print_subexp_standard): Use metadata style. * cp-valprint.c (cp_print_value_fields): Use metadata style. * cli/cli-style.h (class cli_style_option): Add constructor. (metadata_style): Declare. * cli/cli-style.c (metadata_style): New global. (_initialize_cli_style): Register metadata style. * cli-out.h (class cli_ui_out) <do_field_fmt>: Add style parameter. * cli-out.c (cli_ui_out::do_field_fmt): Update. * c-typeprint.c (c_type_print_base_struct_union) (c_type_print_base_1): Use metadata style. * breakpoint.c (watchpoint_value_print) (print_one_breakpoint_location): Use metadata style. * break-catch-syscall.c (print_one_catch_syscall): Use metadata style. * break-catch-sig.c (signal_catchpoint_print_one): Use metadata style. * ada-valprint.c (val_print_packed_array_elements, printstr) (print_field_values, ada_val_print_ref, ada_val_print): Use metadata style. * ada-typeprint.c (print_array_type, ada_print_type): Use metadata style. * ada-tasks.c (print_ada_task_info, info_task): Use metadata style. * ada-lang.c (user_select_syms): Use metadata style. gdb/testsuite/ChangeLog 2019-10-01 Tom Tromey <tom@tromey.com> * lib/gdb-utils.exp (style): Handle "metadata" argument. * gdb.base/style.exp: Add metadata style test.
2019-04-03 04:00:18 +02:00
2019-10-01 Tom Tromey <tom@tromey.com>
* p-lang.c (pascal_printstr): Use metadata style.
* value.c (show_convenience): Use metadata style.
* valprint.c (valprint_check_validity, val_print_optimized_out)
(val_print_not_saved, val_print_unavailable)
(val_print_invalid_address, generic_val_print, val_print)
(value_check_printable, val_print_array_elements): Use metadata
style.
* ui-out.h (class ui_out) <field_fmt>: New overload.
<do_field_fmt>: Add style parameter.
* ui-out.c (ui_out::field_fmt): New overload.
* typeprint.c (type_print_unknown_return_type)
(val_print_not_allocated, val_print_not_associated): Use metadata
style.
* tui/tui-out.h (class tui_ui_out) <do_field_fmt>: Add style
parameter.
* tui/tui-out.c (tui_ui_out::do_field_fmt): Update.
* tracepoint.c (tvariables_info_1): Use metadata style.
* stack.c (print_frame_arg, print_frame_info, print_frame)
(info_frame_command_core): Use metadata style.
* skip.c (info_skip_command): Use metadata style.
* rust-lang.c (rust_print_enum): Use metadata style.
* python/py-prettyprint.c (print_stack_unless_memory_error): Use
metadata style.
* python/py-framefilter.c (py_print_single_arg): Use metadata
style.
* printcmd.c (do_one_display, print_variable_and_value): Use
metadata style.
* p-valprint.c (pascal_val_print)
(pascal_object_print_value_fields): Use metadata style.
* p-typeprint.c (pascal_type_print_base): Use metadata style.
* mi/mi-out.h (class mi_ui_out) <do_field_fmt>: Add style
parameter.
* mi/mi-out.c (mi_ui_out::do_field_fmt): Update.
* m2-valprint.c (m2_print_long_set): Use metadata style.
* m2-typeprint.c (m2_print_type): Use metadata style.
* infcmd.c (print_return_value_1): Use metadata style.
* gnu-v3-abi.c (print_one_vtable): Use metadata style.
* f-valprint.c (info_common_command_for_block): Use metadata
style.
* f-typeprint.c (f_type_print_base): Use metadata style.
* expprint.c (print_subexp_standard): Use metadata style.
* cp-valprint.c (cp_print_value_fields): Use metadata style.
* cli/cli-style.h (class cli_style_option): Add constructor.
(metadata_style): Declare.
* cli/cli-style.c (metadata_style): New global.
(_initialize_cli_style): Register metadata style.
* cli-out.h (class cli_ui_out) <do_field_fmt>: Add style
parameter.
* cli-out.c (cli_ui_out::do_field_fmt): Update.
* c-typeprint.c (c_type_print_base_struct_union)
(c_type_print_base_1): Use metadata style.
* breakpoint.c (watchpoint_value_print)
(print_one_breakpoint_location): Use metadata style.
* break-catch-syscall.c (print_one_catch_syscall): Use metadata
style.
* break-catch-sig.c (signal_catchpoint_print_one): Use metadata
style.
* ada-valprint.c (val_print_packed_array_elements, printstr)
(print_field_values, ada_val_print_ref, ada_val_print): Use
metadata style.
* ada-typeprint.c (print_array_type, ada_print_type): Use metadata
style.
* ada-tasks.c (print_ada_task_info, info_task): Use metadata
style.
* ada-lang.c (user_select_syms): Use metadata style.
2019-10-01 Tom Tromey <tom@tromey.com>
* cli/cli-cmds.c (pwd_command): Style output.
2019-10-01 Pedro Alves <palves@redhat.com>
Tom Tromey <tom@tromey.com>
* symtab.c (print_symbol_info): Use %ps.
(print_msymbol_info): Use %ps.
* symfile.c (symbol_file_add_with_addrs): Use %ps.
* printcmd.c (print_variable_and_value): Use %ps.
* macrocmd.c (show_pp_source_pos): Use %ps.
* infrun.c (print_exited_reason): Use ui_out::message.
* breakpoint.c (watchpoint_check, print_one_breakpoint_location)
(describe_other_breakpoints): Use ui_out::message and new
formats.
(say_where): Use new formats.
(bkpt_print_it, tracepoint_print_one_detail): Use ui_out::message
and new formats.
Introduce gdb-specific %p format suffixes This introduces a few gdb-specific %p format suffixes. This is useful for emitting gdb-specific output in an ergonomic way. It also yields code that is more i18n-friendly. The comment before ui_out::message explains the details. Note that the tests had to change a little. When using one of the gdb printf functions with styling, there can be spurious style changes emitted to the output. This did not seem worthwhile to fix, as the low-level output functions are rather spaghetti-ish already, and I didn't want to make them even worse. This change also necessitated adding support for "*" as precision and width in format_pieces. These are used in various spots in gdb, and it seemed better to me to implement them than to remove the uses. gdb/ChangeLog 2019-10-01 Pedro Alves <palves@redhat.com> Tom Tromey <tom@tromey.com> * unittests/format_pieces-selftests.c: Add gdb_format parameter. (test_gdb_formats): New function. (run_tests): Call it. (test_format_specifier): Update. * utils.h (fputs_filtered): Update comment. (vfprintf_styled, vfprintf_styled_no_gdbfmt) (fputs_styled_unfiltered): Declare. * utils.c (fputs_styled_unfiltered): New function. (vfprintf_maybe_filtered): Add gdbfmt parameter. (vfprintf_filtered): Update. (vfprintf_unfiltered, vprintf_filtered): Update. (vfprintf_styled, vfprintf_styled_no_gdbfmt): New functions. * ui-out.h (enum ui_out_flag) <unfiltered_output, disallow_ui_out_field>: New constants. (enum class field_kind): New. (struct base_field_s, struct signed_field_s): New. (signed_field): New function. (struct string_field_s): New. (string_field): New function. (struct styled_string_s): New. (styled_string): New function. (class ui_out) <message>: Add comment. <vmessage, call_do_message>: New methods. <do_message>: Add style parameter. * ui-out.c (ui_out::call_do_message, ui_out::vmessage): New methods. (ui_out::message): Rewrite. * mi/mi-out.h (class mi_ui_out) <do_message>: Add style parameter. * mi/mi-out.c (mi_ui_out::do_message): Add style parameter. * gdbsupport/format.h (class format_pieces) <format_pieces>: Add gdb_extensions parameter. (class format_piece): Add parameter to constructor. (n_int_args): New field. * gdbsupport/format.c (format_pieces::format_pieces): Add gdb_extensions parameter. Handle '*'. * cli-out.h (class cli_ui_out) <do_message>: Add style parameter. * cli-out.c (cli_ui_out::do_message): Add style parameter. Call vfprintf_styled_no_gdbfmt. (cli_ui_out::do_field_string, cli_ui_out::do_spaces) (cli_ui_out::do_text, cli_ui_out::field_separator): Allow unfiltered output. * ui-style.h (struct ui_file_style) <ptr>: New method. gdb/testsuite/ChangeLog 2019-10-01 Tom Tromey <tom@tromey.com> * gdb.base/style.exp: Update tests.
2019-06-05 10:17:16 +02:00
2019-10-01 Pedro Alves <palves@redhat.com>
Tom Tromey <tom@tromey.com>
* unittests/format_pieces-selftests.c: Add gdb_format parameter.
(test_gdb_formats): New function.
(run_tests): Call it.
(test_format_specifier): Update.
* utils.h (fputs_filtered): Update comment.
(vfprintf_styled, vfprintf_styled_no_gdbfmt)
(fputs_styled_unfiltered): Declare.
* utils.c (fputs_styled_unfiltered): New function.
(vfprintf_maybe_filtered): Add gdbfmt parameter.
(vfprintf_filtered): Update.
(vfprintf_unfiltered, vprintf_filtered): Update.
(vfprintf_styled, vfprintf_styled_no_gdbfmt): New functions.
* ui-out.h (enum ui_out_flag) <unfiltered_output,
disallow_ui_out_field>: New constants.
(enum class field_kind): New.
(struct base_field_s, struct signed_field_s): New.
(signed_field): New function.
(struct string_field_s): New.
(string_field): New function.
(struct styled_string_s): New.
(styled_string): New function.
(class ui_out) <message>: Add comment.
<vmessage, call_do_message>: New methods.
<do_message>: Add style parameter.
* ui-out.c (ui_out::call_do_message, ui_out::vmessage): New
methods.
(ui_out::message): Rewrite.
* mi/mi-out.h (class mi_ui_out) <do_message>: Add style
parameter.
* mi/mi-out.c (mi_ui_out::do_message): Add style parameter.
* gdbsupport/format.h (class format_pieces) <format_pieces>: Add
gdb_extensions parameter.
(class format_piece): Add parameter to constructor.
(n_int_args): New field.
* gdbsupport/format.c (format_pieces::format_pieces): Add
gdb_extensions parameter. Handle '*'.
* cli-out.h (class cli_ui_out) <do_message>: Add style parameter.
* cli-out.c (cli_ui_out::do_message): Add style parameter. Call
vfprintf_styled_no_gdbfmt.
(cli_ui_out::do_field_string, cli_ui_out::do_spaces)
(cli_ui_out::do_text, cli_ui_out::field_separator): Allow
unfiltered output.
* ui-style.h (struct ui_file_style) <ptr>: New method.
2019-10-01 Tom Tromey <tom@tromey.com>
* unittests/format_pieces-selftests.c: Update. Add final format.
* gdbsupport/format.c (format_pieces::format_pieces): Don't add
empty literal pieces.
Remove the ui_out_style_kind enum This removes the ui_out_style_kind enum, in favor of simply using ui_file_style references. This simplifies the code somewhat. gdb/ChangeLog 2019-10-01 Tom Tromey <tom@tromey.com> * ui-out.h (enum class ui_out_style_kind): Remove. (class ui_out) <field_string, field_stsream, do_field_string>: Change type of "style". * ui-out.c (ui_out::field_core_addr, ui_out::field_stream) (ui_out::field_string): Update. * tui/tui-out.h (class tui_ui_out) <do_field_string>: Change type of "style". * tui/tui-out.c (tui_ui_out::do_field_string): Update. * tracepoint.c (print_one_static_tracepoint_marker): Update. * stack.c (print_frame_arg, print_frame_info, print_frame): Update. * source.c (print_source_lines_base): Update. * solib.c (info_sharedlibrary_command): Update. * skip.c (info_skip_command): Update. * record-btrace.c (btrace_call_history_src_line) (btrace_call_history): Update. * python/py-framefilter.c (py_print_frame): Update. * mi/mi-out.h (class mi_ui_out) <do_field_string>: Change type of "style". * mi/mi-out.c (mi_ui_out::do_table_header) (mi_ui_out::do_field_signed, mi_ui_out::do_field_unsigned) (mi_ui_out::do_field_string): Update. * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Update. * cli-out.h (class cli_ui_out) <do_field_string>: Change type of "style". * cli-out.c (cli_ui_out::do_table_header) (cli_ui_out::do_field_signed, cli_ui_out::do_field_unsigned) (cli_ui_out::do_field_skip, cli_ui_out::do_field_string) (cli_ui_out::do_field_fmt): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update.
2019-06-06 00:21:24 +02:00
2019-10-01 Tom Tromey <tom@tromey.com>
* ui-out.h (enum class ui_out_style_kind): Remove.
(class ui_out) <field_string, field_stsream, do_field_string>:
Change type of "style".
* ui-out.c (ui_out::field_core_addr, ui_out::field_stream)
(ui_out::field_string): Update.
* tui/tui-out.h (class tui_ui_out) <do_field_string>: Change type
of "style".
* tui/tui-out.c (tui_ui_out::do_field_string): Update.
* tracepoint.c (print_one_static_tracepoint_marker): Update.
* stack.c (print_frame_arg, print_frame_info, print_frame):
Update.
* source.c (print_source_lines_base): Update.
* solib.c (info_sharedlibrary_command): Update.
* skip.c (info_skip_command): Update.
* record-btrace.c (btrace_call_history_src_line)
(btrace_call_history): Update.
* python/py-framefilter.c (py_print_frame): Update.
* mi/mi-out.h (class mi_ui_out) <do_field_string>: Change type of
"style".
* mi/mi-out.c (mi_ui_out::do_table_header)
(mi_ui_out::do_field_signed, mi_ui_out::do_field_unsigned)
(mi_ui_out::do_field_string): Update.
* disasm.c (gdb_pretty_print_disassembler::pretty_print_insn):
Update.
* cli-out.h (class cli_ui_out) <do_field_string>: Change type of
"style".
* cli-out.c (cli_ui_out::do_table_header)
(cli_ui_out::do_field_signed, cli_ui_out::do_field_unsigned)
(cli_ui_out::do_field_skip, cli_ui_out::do_field_string)
(cli_ui_out::do_field_fmt): Update.
* breakpoint.c (print_breakpoint_location): Update.
(update_static_tracepoint): Update.
2019-10-01 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* main.c (relocate_gdbinit_path_maybe_in_datadir): Remove std::string
conversion of gdb_datadir.
(captured_main_1): Remove xstrdup when assigning to gdb_datadir,
remove not needed c_str ().
2019-09-30 Ali Tamur <tamur@google.com>
* dwarf2read.c (skip_one_die): Handle DW_FORM_strx forms.
(dwarf2_string_attr): Likewise.
2019-09-30 Ali Tamur <tamur@google.com>
* dwarf2read.c (process_full_comp_unit): Remove whitespace at the EOL.
(process_full_type_unit): Likewise.
(dump_die_shallow): Likewise.
(cu_debug_loc_section): Likewise.
2019-09-28 Christian Biesinger <cbiesinger@google.com>
* minsyms.c (compare_minimal_symbols): Rename to...
(minimal_symbol_is_less_than): ...this, and adjust to STL
conventions (return bool, take arguments as references)
(minimal_symbol_reader::install): Call std::sort instead
of qsort.
2019-09-29 Christian Biesinger <cbiesinger@google.com>
* minsyms.h (msymbol_hash): Document that this is a case-insensitive
hash and why.
* objfiles.h (struct objfile_per_bfd_storage) <demangled_names_hash,
msymbol_hash, msymbol_demangled_hash>: Improve comments.
2019-09-30 Simon Marchi <simon.marchi@polymtl.ca>
* psymtab.c (add_psymbol_to_list): Move comment to psympriv.h.
* psympriv.h (add_psymbol_to_list): Move comment here and update
it.
2019-09-29 Tom de Vries <tdevries@suse.de>
* contrib/cc-with-tweaks.sh (get_tmpdir): New function.
Use $tmpdir/$(basename "$output_file").dwz instead of
"${output_file}.dwz".
2019-09-28 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/25045
* hppa-linux-nat.c: Include gdbarch.h.
2019-09-26 Christian Biesinger <cbiesinger@google.com>
* blockframe.c (find_pc_partial_function): Change return type to bool.
* elfread.c (elf_gnu_ifunc_resolve_name): Likewise.
* minsyms.c (in_gnu_ifunc_stub): Likewise.
(stub_gnu_ifunc_resolve_name): Likewise.
* symtab.c (compare_filenames_for_search): Likewise.
(compare_glob_filenames_for_search): Likewise.
(matching_obj_sections): Likewise.
(symbol_matches_domain): Likewise.
(find_line_symtab): Change out param EXACT_MATCH to bool *.
(find_line_pc): Change return type to bool.
(find_line_pc_range): Likewise.
(producer_is_realview): Likewise.
* symtab.h (symbol_matches_domain): Likewise.
(find_pc_partial_function): Likewise.
(find_pc_line_pc_range): Likewise.
(in_gnu_ifunc_stub): Likewise.
(struct gnu_ifunc_fns) <gnu_ifunc_resolve_name>: Likewise.
(find_line_pc): Likewise.
(find_line_pc_range): Likewise.
(matching_obj_sections): Likewise.
(find_line_symtab): Change out parameter to bool.
(producer_is_realview): Change return type to bool.
(compare_filenames_for_search): Likewise.
(compare_glob_filenames_for_search): Likewise.
2019-09-26 Tom Tromey <tom@tromey.com>
* Makefile.in (COMMON_SFILES): Remove gdb_usleep.c.
(HFILES_NO_SRCDIR): Remove gdb_usleep.h.
* gdb_usleep.h: Remove.
* gdb_usleep.c: Remove.
* utils.c: Don't include gdb_usleep.h.
2019-09-26 Tom Tromey <tromey@adacore.com>
* python/py-type.c (type_to_type_object): Call check_typedef
for stub types.
2019-09-26 Tom Tromey <tom@tromey.com>
* utils.h (initialize_utils): Don't declare.
* top.c (gdb_init): Don't call initialize_utils.
* utils.c (initialize_utils): Remove. Move contents...
(_initialize_utils): ... here.
2019-09-25 Tom Tromey <tom@tromey.com>
* python/py-objfile.c (objfpy_get_build_id): Use bin2hex.
* utils.h (make_hex_string): Don't declare.
* utils.c (make_hex_string): Remove.
[gdb/tdep] Handle mxcsr kernel bug on Intel Skylake CPUs On my openSUSE Leap 15.1 x86_64 Skylake system with the default (4.12) kernel, I run into: ... FAIL: gdb.base/gcore.exp: corefile restored all registers ... The problem is that there's a difference in the mxcsr register value before and after the gcore command: ... - mxcsr 0x0 [ ] + mxcsr 0x400440 [ DAZ OM ] ... This can be traced back to amd64_linux_nat_target::fetch_registers, where xstateregs is partially initialized by the ptrace call: ... char xstateregs[X86_XSTATE_MAX_SIZE]; struct iovec iov; amd64_collect_xsave (regcache, -1, xstateregs, 0); iov.iov_base = xstateregs; iov.iov_len = sizeof (xstateregs); if (ptrace (PTRACE_GETREGSET, tid, (unsigned int) NT_X86_XSTATE, (long) &iov) < 0) perror_with_name (_("Couldn't get extended state status")); amd64_supply_xsave (regcache, -1, xstateregs); ... after which amd64_supply_xsave is called. The amd64_supply_xsave call is supposed to only use initialized parts of xstateregs, but due to a kernel bug on intel skylake (fixed from 4.14 onwards by commit 0852b374173b "x86/fpu: Add FPU state copying quirk to handle XRSTOR failure on Intel Skylake CPUs") it can happen that the mxcsr part of xstateregs is not initialized, while amd64_supply_xsave expects it to be initialized, which explains the FAIL mentioned above. Fix the undetermined behaviour by initializing xstateregs before calling ptrace, which makes sure we get a 0x0 for mxcsr when this kernel bug occurs, and which also happens to fix the FAIL. Furthermore, add an xfail for this FAIL which triggers the same kernel bug: ... FAIL: gdb.arch/amd64-init-x87-values.exp: check_setting_mxcsr_before_enable: \ check new value of MXCSR is still in place ... Both FAILs pass when using a 5.3 kernel instead on the system mentioned above. Tested on x86_64-linux. gdb/ChangeLog: 2019-09-24 Tom de Vries <tdevries@suse.de> PR gdb/23815 * amd64-linux-nat.c (amd64_linux_nat_target::fetch_registers): Initialize xstateregs before ptrace PTRACE_GETREGSET call. gdb/testsuite/ChangeLog: 2019-09-24 Tom de Vries <tdevries@suse.de> PR gdb/24598 * gdb.arch/amd64-init-x87-values.exp: Add xfail.
2019-09-24 23:38:49 +02:00
2019-09-24 Tom de Vries <tdevries@suse.de>
PR gdb/23815
* amd64-linux-nat.c (amd64_linux_nat_target::fetch_registers):
Initialize xstateregs before ptrace PTRACE_GETREGSET call.
2019-09-23 Dimitar Dimitrov <dimitar@dinux.eu>
* NEWS: Mention new simulator port for PRU.
2019-09-23 Christian Biesinger <cbiesinger@google.com>
* ada-exp.y (write_object_remaining): Update.
* ada-lang.c (ada_decode): Return a std::string instead of a char*
and eliminate the static buffer.
(ada_decode_symbol): Update.
(ada_la_decode): Update.
(ada_sniff_from_mangled_name): Update.
(is_valid_name_for_wild_match): Update.
(ada_lookup_name_info::matches): Update and simplify.
(name_matches_regex): Update.
(ada_add_global_exceptions): Update.
* ada-lang.h (ada_decode): Update signature.
* ada-varobj.c (ada_varobj_describe_simple_array_child): Update.
* dwarf-index-write.c (debug_names::insert): Update.
2019-09-21 Simon Marchi <simon.marchi@polymtl.ca>
* solib-svr4.c (svr4_iterate_over_objfiles_in_search_order): Fix
formatting.
2019-09-21 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.h (bp_location) <inserted, permanent, duplicate>:
Change "nonzero" to "true" in documentation.
2019-09-20 Christian Biesinger <cbiesinger@google.com>
* solib-darwin.c (darwin_lookup_lib_symbol): Remove.
(_initialize_darwin_solib): Don't set
darwin_so_ops.lookup_lib_global_symbol.
* solib-svr4.c (set_solib_svr4_fetch_link_map_offsets): Call
set_gdbarch_iterate_over_objfiles_in_search_order.
(elf_lookup_lib_symbol): Rename to...
(svr4_iterate_over_objfiles_in_search_order): this, and update
to iterate semantics.
(_initialize_svr4_solib): Don't set lookup_lib_global_symbol.
* solib.c (solib_global_lookup): Remove.
* solist.h (struct target_so_ops): Remove lookup_lib_global_symbol.
(solib_global_lookup): Remove.
* symtab.c (lookup_global_or_static_symbol): Remove call to
solib_global_lookup.
2019-09-20 Joel Brobecker <brobecker@adacore.com>
* NEWS: Move entries about default MI version now being
version 3, and about the GDB/MI fix for multi-location
breakpoints to the "since GDB 8.3" section.
2019-09-20 Joel Brobecker <brobecker@adacore.com>
GDB 8.3.1 released.
Remove Cell Broadband Engine debugging support This patch implements removal of Cell/B.E. support, including - Support for the spu-*-* target - Support for native stand-alone SPU debugging - Support for integrated debugging of combined PPU/SPU applications - Remote debugging (gdbserver) support for all the above. The patch also removes the TARGET_OBJECT_SPU target object type, as this is available only on Cell/B.E. targets, including - Native Linux support - Core file support (including core file generation) - Remote target support, including removal of the qXfer:spu:read and qXfer:spu:write remote protocal packets and associated support in gdbserver. gdb/ChangeLog 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * NEWS: Mention that Cell/B.E. debugging support was removed. * MAINTAINERS: Remove spu target. * config/djgpp/fnchange.lst: Remove entries for removed files. * Makefile.in (ALL_TARGET_OBS): Remove solib-spu.o, spu-multiarch.o, and spu-tdep.o. (HFILES_NO_SRCDIR): Remove solib-spu.h and spu-tdep.h. (ALLDEPFILES): Remove solib-spu.c, spu-linux-nat.c, spu-multiarch.c, and spu-tdep.c. * spu-linux-nat.c: Remove file. * spu-multiarch.c: Remove file. * spu-tdep.c: Remove file. * spu-tdep.h: Remove file. * solib-spu.c: Remove file. * solib-spu.h: Remove file. * configure.host (powerpc64*-*-linux*): Remove Cell/B.E. support. * configure.nat (spu-linux): Remove. * configure.tgt (powerpc*-*-linux*): Remove solib-spu.o and solib-multiarch.o from gdb_target_obs. (spu*-*-*): Remove. * arch/ppc-linux-common.h (struct ppc_linux_features): Remove "cell" feature flag. (ppc_linux_no_features): Update. * arch/ppc-linux-common.c (ppc_linux_match_description): Remove Cell/B.E. support. * arch/ppc-linux-tdesc.h (tdesc_powerpc_cell32l): Remove declaration. (tdesc_powerpc_cell64l): Likewise. * nat/ppc-linux.h (PPC_FEATURE_CELL): Remove. * ppc-linux-nat.c (ppc_linux_nat_target::read_description): Remove Cell/B.E. support. * ppc-linux-tdep.h: Do not include "solib-spu.h" or "spu-tdep.h". Do not include "features/rs6000/powerpc-cell32l.c" or "features/rs6000/powerpc-cell64l.c". (ppc_linux_spu_section): Remove. (ppc_linux_core_read_description): Remove Cell/B.E. support. (spe_context_objfile, spe_context_lm_addr, spe_context_offset, spe_context_cache_ptid, spe_context_cache_ptid): Remove. (ppc_linux_spe_context_lookup): Remove. (ppc_linux_spe_context_inferior_created): Remove. (ppc_linux_spe_context_solib_loaded): Remove. (ppc_linux_spe_context_solib_unloaded): Remove. (ppc_linux_spe_context): Remove. (struct ppu2spu_cache): Remove. (ppu2spu_prev_arch, ppu2spu_this_id, ppu2spu_prev_register): Remove. (struct ppu2spu_data): Remove. (ppu2spu_unwind_register, ppu2spu_sniffer, ppu2spu_dealloc_cache, ppu2spu_unwind): Remove. (ppc_linux_init_abi): Remove Cell/B.E. support. * rs6000-tdep.h (rs6000_gdbarch_init): Remove Cell/B.E. support. * features/Makefile (rs6000/powerpc-cell32l-expedite): Remove. (rs6000/powerpc-cell64l-expedite): Likewise (WHICH): Remove rs6000/powerpc-cell32l and rs6000/powerpc-cell64l. (XMLTOC): Remove rs6000/powerpc-cell32l.xml and rs6000/powerpc-cell64l.xml. * features/rs6000/powerpc-cell32l.xml: Remove. * features/rs6000/powerpc-cell64l.xml: Likewise. * features/rs6000/powerpc-cell32l.c: Remove generated file. * features/rs6000/powerpc-cell64l.c: Likewise. * regformats/rs6000/powerpc-cell32l.dat: Remove generated file. * regformats/rs6000/powerpc-cell64l.dat: Likewise. * regformats/reg-spu.dat: Remove. * target.h (enum target_object): Remove TARGET_OBJECT_SPU. * corelow.c (struct spuid_list): Remove. (add_to_spuid_list): Remove. (core_target::xfer_partial): Remove support for TARGET_OBJECT_SPU. * remote.c (PACKET_qXfer_spu_read, PACKET_qXfer_spu_write): Remove. (remote_protocol_features): Remove associated entries. (_initialize_remote): No longer initialize them. (remote_target::xfer_partial): Remove support for TARGET_OBJECT_SPU. * linux-nat.c (SPUFS_MAGIC): Remove. (linux_proc_xfer_spu): Remove. (spu_enumerate_spu_ids): Remove. (linux_nat_target::xfer_partial): Remove support for TARGET_OBJECT_SPU. * linux-tdep.c (-linux_spu_make_corefile_notes): Remove. (linux_make_corefile_notes): No longer call it. * regcache.c (cooked_read_test): Remove bfd_arch_spu special case. (cooked_write_test): Likewise. gdb/doc/ChangeLog 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * doc/gdb.texinfo (Remote Configuration): Remove documentation for qXfer:spu:read and qXfer:spu:write. (General Query Packets): Likewise. (Cell Broadband Engine SPU architecture): Remove subsection. gdb/gdbserver/ChangeLog 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * configure.srv (ipa_ppc_linux_regobj): Remove powerpc-cell32l-ipa.o and powerpc-cell64l-ipa.o. (powerpc*-*-linux*): Remove powerpc-cell32l.o and powerpc-cell64l.o from srv_regobj. Remove rs6000/powerpc-cell32l.xml and rs6000/powerpc-cell64l.xml from srv_xmlfiles. (spu*-*-*): Remove. * spu-low.c: Remove file. * linux-ppc-low.c (INSTR_SC, NR_spu_run): Remove. (parse_spufs_run): Remove. (ppc_get_pc): Remove Cell/B.E. support. (ppc_set_pc): Likewise. (ppc_breakpoint_at): Likewise. (ppc_arch_setup): Likewise. (ppc_get_ipa_tdesc_idx): Do not handle tdesc_powerpc_cell64l or tdesc_powerpc_cell32l. (initialize_low_arch): Do not call init_registers_powerpc_cell64l or init_registers_powerpc_cell32l. * linux-ppc-ipa.c (get_ipa_tdesc): Do not handle PPC_TDESC_CELL. (initialize_low_tracepoint): Do not call init_registers_powerpc_cell64l or init_registers_powerpc_cell32l. * linux-ppc-tdesc-init.h (PPC_TDESC_CELL): Mark as unused. (init_registers_powerpc_cell32l): Remove prototype. (init_registers_powerpc_cell64l): Likewise. * target.h (struct target_ops): Remove qxfer_spu member. * server.c (handle_qxfer_spu): Remove. (qxfer_packets): Remove entry for "spu". (handle_query): No longer support qXfer:spu:read or qXfer:spu:write. * linux-low.c (SPUFS_MAGIC): Remove. (spu_enumerate_spu_ids): Remove. (linux_qxfer_spu): Remove. (linux_target_ops): Remove qxfer_spu member. * lynx-low.c (lynx_target_ops): Remove qxfer_spu member. * nto-low.c (nto_target_ops): Remove qxfer_spu member. * win32-low.c (win32_target_ops): Remove qxfer_spu member. gdb/testsuite/ChangeLog 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * gdb.arch/spu-info.exp: Remove file. * gdb.arch/spu-info.c: Remove file. * gdb.arch/spu-ls.exp: Remove file. * gdb.arch/spu-ls.c: Remove file. * gdb.asm/asm-source.exp: Remove support for spu*-*-*. * gdb.asm/spu.inc: Remove file. * gdb.base/dump.exp: Remove support for spu*-*-*. * gdb.base/stack-checking.exp: Likewise. * gdb.base/overlays.exp: Likewise. * gdb.base/ovlymgr.c: Likewise. * gdb.base/spu.ld: Remove file. * gdb.cp/bs15503.exp: Remove support for spu*-*-*. * gdb.cp/cpexprs.exp: Likewise. * gdb.cp/exception.exp: Likewise. * gdb.cp/gdb2495.exp: Likewise. * gdb.cp/mb-templates.exp: Likewise. * gdb.cp/pr9167.exp: Likewise. * gdb.cp/userdef.exp: Likewise. * gdb.xml/tdesc-regs.exp: Remove support for spu*-*-*. * gdb.cell: Remove directory. * lib/cell.exp: Remove file.
2019-09-20 23:06:57 +02:00
2019-09-20 Ulrich Weigand <uweigand@de.ibm.com>
* NEWS: Mention that Cell/B.E. debugging support was removed.
* MAINTAINERS: Remove spu target.
* config/djgpp/fnchange.lst: Remove entries for removed files.
* Makefile.in (ALL_TARGET_OBS): Remove solib-spu.o,
spu-multiarch.o, and spu-tdep.o.
(HFILES_NO_SRCDIR): Remove solib-spu.h and spu-tdep.h.
(ALLDEPFILES): Remove solib-spu.c, spu-linux-nat.c,
spu-multiarch.c, and spu-tdep.c.
* spu-linux-nat.c: Remove file.
* spu-multiarch.c: Remove file.
* spu-tdep.c: Remove file.
* spu-tdep.h: Remove file.
* solib-spu.c: Remove file.
* solib-spu.h: Remove file.
* configure.host (powerpc64*-*-linux*): Remove Cell/B.E. support.
* configure.nat (spu-linux): Remove.
* configure.tgt (powerpc*-*-linux*): Remove solib-spu.o and
solib-multiarch.o from gdb_target_obs.
(spu*-*-*): Remove.
* arch/ppc-linux-common.h (struct ppc_linux_features): Remove "cell"
feature flag.
(ppc_linux_no_features): Update.
* arch/ppc-linux-common.c (ppc_linux_match_description): Remove
Cell/B.E. support.
* arch/ppc-linux-tdesc.h (tdesc_powerpc_cell32l): Remove declaration.
(tdesc_powerpc_cell64l): Likewise.
* nat/ppc-linux.h (PPC_FEATURE_CELL): Remove.
* ppc-linux-nat.c (ppc_linux_nat_target::read_description): Remove
Cell/B.E. support.
* ppc-linux-tdep.h: Do not include "solib-spu.h" or "spu-tdep.h".
Do not include "features/rs6000/powerpc-cell32l.c" or
"features/rs6000/powerpc-cell64l.c".
(ppc_linux_spu_section): Remove.
(ppc_linux_core_read_description): Remove Cell/B.E. support.
(spe_context_objfile, spe_context_lm_addr, spe_context_offset,
spe_context_cache_ptid, spe_context_cache_ptid): Remove.
(ppc_linux_spe_context_lookup): Remove.
(ppc_linux_spe_context_inferior_created): Remove.
(ppc_linux_spe_context_solib_loaded): Remove.
(ppc_linux_spe_context_solib_unloaded): Remove.
(ppc_linux_spe_context): Remove.
(struct ppu2spu_cache): Remove.
(ppu2spu_prev_arch, ppu2spu_this_id, ppu2spu_prev_register): Remove.
(struct ppu2spu_data): Remove.
(ppu2spu_unwind_register, ppu2spu_sniffer, ppu2spu_dealloc_cache,
ppu2spu_unwind): Remove.
(ppc_linux_init_abi): Remove Cell/B.E. support.
* rs6000-tdep.h (rs6000_gdbarch_init): Remove Cell/B.E. support.
* features/Makefile (rs6000/powerpc-cell32l-expedite): Remove.
(rs6000/powerpc-cell64l-expedite): Likewise
(WHICH): Remove rs6000/powerpc-cell32l and rs6000/powerpc-cell64l.
(XMLTOC): Remove rs6000/powerpc-cell32l.xml and
rs6000/powerpc-cell64l.xml.
* features/rs6000/powerpc-cell32l.xml: Remove.
* features/rs6000/powerpc-cell64l.xml: Likewise.
* features/rs6000/powerpc-cell32l.c: Remove generated file.
* features/rs6000/powerpc-cell64l.c: Likewise.
* regformats/rs6000/powerpc-cell32l.dat: Remove generated file.
* regformats/rs6000/powerpc-cell64l.dat: Likewise.
* regformats/reg-spu.dat: Remove.
* target.h (enum target_object): Remove TARGET_OBJECT_SPU.
* corelow.c (struct spuid_list): Remove.
(add_to_spuid_list): Remove.
(core_target::xfer_partial): Remove support for TARGET_OBJECT_SPU.
* remote.c (PACKET_qXfer_spu_read, PACKET_qXfer_spu_write): Remove.
(remote_protocol_features): Remove associated entries.
(_initialize_remote): No longer initialize them.
(remote_target::xfer_partial): Remove support for TARGET_OBJECT_SPU.
* linux-nat.c (SPUFS_MAGIC): Remove.
(linux_proc_xfer_spu): Remove.
(spu_enumerate_spu_ids): Remove.
(linux_nat_target::xfer_partial): Remove support for TARGET_OBJECT_SPU.
* linux-tdep.c (-linux_spu_make_corefile_notes): Remove.
(linux_make_corefile_notes): No longer call it.
* regcache.c (cooked_read_test): Remove bfd_arch_spu special case.
(cooked_write_test): Likewise.
2019-09-20 Tom Tromey <tom@tromey.com>
* NEWS: Mention case-sensitivity of TUI commands.
* tui/tui-win.c (tui_set_focus_command): Now case-sensitive.
(tui_set_win_height_command, parse_scrolling_args): Likewise.
* tui/tui-layout.c (tui_layout_command): Now case-sensitive.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_source_window::set_contents): Use
make_unique_xstrdup.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Use
make_unique_xstrdup.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-data.c: Remove separator comments.
* tui/tui-layout.c: Remove separator comments.
* tui/tui-win.c: Remove separator comments.
* tui/tui-wingeneral.c: Remove separator comments.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui.h (strcat_to_buf): Don't declare.
* tui/tui.c (strcat_to_buf): Remove.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-source.h (struct tui_source_window) <m_fullname>: Rename
from "fullname".
* tui/tui-source.c (tui_source_window::set_contents)
(tui_source_window::location_matches_p)
(tui_source_window::maybe_update): Update.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <get_current_group>:
Update.
<m_regs_content, m_regs_column_count, m_current_group>: Add "m_"
prefix.
* tui/tui-regs.c (tui_data_window::last_regs_line_no)
(tui_data_window::line_from_reg_element_no)
(tui_data_window::first_reg_element_no_inline)
(tui_data_window::show_registers)
(tui_data_window::show_register_group)
(tui_data_window::display_registers_from)
(tui_data_window::display_registers_from_line)
(tui_data_window::first_data_item_displayed)
(tui_data_window::delete_data_content_windows)
(tui_data_window::erase_data_content)
(tui_data_window::do_scroll_vertical)
(tui_data_window::refresh_window)
(tui_data_window::check_register_values): Update.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN): Remove define.
(struct tui_locator_window) <full_name, proc_name>: Now
std::string.
* tui/tui-stack.c (tui_locator_window::make_status_line)
(tui_locator_window::set_locator_fullname)
(tui_locator_window::set_locator_info): Update.
* tui/tui-source.c (tui_source_window::set_contents)
(tui_source_window::showing_source_p): Update.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_locator_window::set_locator_fullname):
Don't call tui_locator_win_info_ptr.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_resize_all): Don't call refresh.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use 1 as
height for locator.
* tui/tui-stack.c (tui_locator_window::rerender): Call scrollok.
* tui/tui-layout.c (show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Use 1 as height for locator.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_enable): Update.
* tui/tui-win.c (tui_sigwinch_handler, tui_async_resize_screen):
Update.
* tui/tui-data.h (tui_win_resized, tui_set_win_resized_to):
Update.
* tui/tui-data.c (win_resized): Now bool.
(tui_win_resized): Return bool.
(tui_set_win_resized_to): Accept a bool.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <show_register_group>:
Change type of "refresh_values_only".
* tui/tui-regs.c (tui_data_window::show_register_group): Change
type of "refresh_values_only".
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.c (struct tui_asm_line) <addr_string, insn>: Now
std::string.
(tui_disassemble): Add "pos" parameter.
(tui_disasm_window::set_contents): Simplify.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<show_source_content>: Now private.
* tui/tui-winsource.c
(tui_source_window_base::show_source_content): Don't handle empty
content case.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_disasm_command)
(show_source_or_disasm_and_command): Don't call
show_source_content.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-stack.h (struct tui_locator_window) <make_status_line>:
Declare.
* tui/tui-stack.c (tui_locator_window::make_status_line): Rename
from tui_make_status_line.
(tui_locator_window::rerender): Update.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_make_status_line): Return std::string.
(tui_locator_window::rerender): Update.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<~tui_source_window_base>: Don't declare.
<fullname>: Remove.
* tui/tui-winsource.c (~tui_source_window_base): Remove.
* tui/tui-source.h (struct tui_source_window) <fullname>: New
member.
* tui/tui-source.c (tui_source_window::set_contents): Update.
(tui_source_window::location_matches_p)
(tui_source_window::maybe_update): Update.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (~tui_source_element): Remove.
(tui_source_element): Update.
(struct tui_source_element) <line>: Now a unique_xmalloc_ptr.
* tui/tui-winsource.c (tui_show_source_line): Update.
* tui/tui-source.c (tui_source_window::set_contents): Update.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Update.
2019-09-20 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (tui_clear_source_windows_detail): Don't
declare.
* tui/tui-layout.c (tui_add_win_to_layout): Don't call
tui_clear_source_windows_detail.
* tui/tui-winsource.h (struct tui_source_window_base)
<clear_detail>: Don't declare.
* tui/tui-winsource.c (tui_source_window_base::clear_detail):
Remove.
* tui/tui-data.c (tui_clear_source_windows_detail): Remove.
2019-09-20 Tom Tromey <tromey@adacore.com>
PR ada/24919:
* block.c (contained_in): Fix final return value.
bfd macro conversion to inline functions This converts some of the macros that access struct bfd fields to inline functions. bfd/ * archive.c (bfd_generic_archive_p): Use bfd_set_thin_archive. * bfd-in.h (bfd_get_filename, bfd_get_cacheable, bfd_get_format), (bfd_get_target, bfd_get_flavour, bfd_family_coff, bfd_big_endian), (bfd_little_endian, bfd_header_big_endian, bfd_header_little_endian), (bfd_get_file_flags, bfd_applicable_file_flags), (bfd_applicable_section_flags, bfd_has_map, bfd_is_thin_archive), (bfd_valid_reloc_types, bfd_usrdata, bfd_get_start_address), (bfd_get_symcount, bfd_get_outsymbols, bfd_count_sections), (bfd_get_dynamic_symcount, bfd_get_symbol_leading_char): Delete. * bfd/bfd.c (bfd_get_filename, bfd_get_cacheable, bfd_get_format), (bfd_get_file_flags, bfd_get_start_address, bfd_get_symcount), (bfd_get_dynamic_symcount, bfd_get_outsymbols, bfd_count_sections), (bfd_has_map, bfd_is_thin_archive, bfd_set_thin_archive), (bfd_usrdata, bfd_set_usrdata): New inline functions. * targets.c (bfd_get_target, bfd_get_flavour), (bfd_applicable_file_flags, bfd_family_coff, bfd_big_endian), (bfd_little_endian, bfd_header_big_endian), (bfd_header_little_endian, bfd_applicable_section_flags), (bfd_get_symbol_leading_char): New inline functions. * bfd-in2.h: Regenerate. binutils/ * ar.c (write_archive): Use bfd_set_thin_archive. gdb/ * gdb_bfd.c (gdb_bfd_ref, gdb_bfd_unref): Use bfd_set_usrdata. * dwarf2read.c (dwarf2_read_gdb_index, dwarf2_read_debug_names), (read_indirect_string_from_dwz): Use bfd accessor. * dwarf2read.h (struct dwz_file <filename>): Likewise. * machoread.c (macho_symfile_read_all_oso): Likewise. * solib.c (solib_bfd_open): Likewise. ld/ * ldelf.c (ldelf_after_open, ldelf_place_orphan * ldlang.c (walk_wild_file, lang_process): Use bfd_usrdata. (load_symbols, ldlang_add_file): Use bfd_set_usrdata. * ldmain.c (add_archive_element): Use bfd_usrdata. * ldlang.h (bfd_input_just_syms): New inline function. * emultempl/aarch64elf.em (build_section_lists): Use it. * emultempl/mmo.em (mmo_place_orphan): Likewise. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise. * emultempl/ppc64elf.em (build_section_lists): Likewise. sim/ * ppc/emul_generic.c (emul_add_tree_options): Delete old bfd code.
2019-09-19 04:21:04 +02:00
2019-09-20 Alan Modra <amodra@gmail.com>
* gdb_bfd.c (gdb_bfd_ref, gdb_bfd_unref): Use bfd_set_usrdata.
* dwarf2read.c (dwarf2_read_gdb_index, dwarf2_read_debug_names),
(read_indirect_string_from_dwz): Use bfd accessor.
* dwarf2read.h (struct dwz_file <filename>): Likewise.
* machoread.c (macho_symfile_read_all_oso): Likewise.
* solib.c (solib_bfd_open): Likewise.
2019-09-19 Christian Biesinger <cbiesinger@google.com>
* eval.c: Move declaration of overload_resolution to...
* value.h: ...here.
2019-09-19 Christian Biesinger <cbiesinger@google.com>
* arm-linux-nat.c: Remove extern declaration for arm_apcs_32.
* arm-linux-tdep.c: Likewise.
* arm-nbsd-nat.c: Likewise.
* arm-tdep.h: Declare arm_apcs_32.
* arm-tdep.c: Move documentation for arm_apcs_32 to arm-tdep.h.
2019-09-19 Christian Biesinger <cbiesinger@google.com>
* dwarf2loc.c: Remove extern declaration of dwarf_always_disassemble.
* dwarf2read.h: Declare dwarf_always_disassemble.
2019-09-19 Tom de Vries <tdevries@suse.de>
PR gdb/25009
* source-cache.c (source_cache::ensure): Catch exception thrown during
construction of the highlighter.
bfd_section_* macros This large patch removes the unnecessary bfd parameter from various bfd section macros and functions. The bfd is hardly ever used and if needed for the bfd_set_section_* or bfd_rename_section functions can be found via section->owner except for the com, und, abs, and ind std_section special sections. Those sections shouldn't be modified anyway. The patch also removes various bfd_get_section_<field> macros, replacing their use with bfd_section_<field>, and adds bfd_set_section_lma. I've also fixed a minor bug in gas where compressed section renaming was done directly rather than calling bfd_rename_section. This would have broken bfd_get_section_by_name and similar functions, but that hardly mattered at such a late stage in gas processing. bfd/ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma), (bfd_get_section_lma, bfd_get_section_alignment), (bfd_get_section_size, bfd_get_section_flags), (bfd_get_section_userdata): Delete. (bfd_section_name, bfd_section_size, bfd_section_vma), (bfd_section_lma, bfd_section_alignment): Lose bfd parameter. (bfd_section_flags, bfd_section_userdata): New. (bfd_is_com_section): Rename parameter. * section.c (bfd_set_section_userdata, bfd_set_section_vma), (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section), (bfd_set_section_size): Delete bfd parameter, rename section parameter. (bfd_set_section_lma): New. * bfd-in2.h: Regenerate. * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param, update callers. * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h, * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c, * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c, * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c, * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c, * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c, * xcofflink.c: Update throughout for bfd section macro and function changes. binutils/ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c, * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c, * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c, * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update throughout for bfd section macro and function changes. gas/ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c, * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c, * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c, * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c, * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c, * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c, * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c, * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c, * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c, * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c, * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c, * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c, * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c, * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c, * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c, * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c, * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c, * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c, * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c, * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c, * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c, * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c, * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for bfd section macro and function changes. * write.c (compress_debug): Use bfd_rename_section. gdb/ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c, * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c, * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c, * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h, * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c, * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c, * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c, * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c, * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c, * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c, * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c, * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c, * solib-spu.c, * solib-svr4.c, * solib-target.c, * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c, * symmisc.c, * symtab.c, * target.c, * windows-nat.c, * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c, * mi/mi-interp.c: Update throughout for bfd section macro and function changes. * gcore (gcore_create_callback): Use bfd_set_section_lma. * spu-tdep.c (spu_overlay_new_objfile): Likewise. gprof/ * corefile.c, * symtab.c: Update throughout for bfd section macro and function changes. ld/ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c, * emultempl/aarch64elf.em, * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/armelf.em, * emultempl/cr16elf.em, * emultempl/cskyelf.em, * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em, * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em, * emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update throughout for bfd section macro and function changes. libctf/ * ctf-open-bfd.c: Update throughout for bfd section macro changes. opcodes/ * arc-ext.c: Update throughout for bfd section macro changes. sim/ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c, * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c, * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c, * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c, * rx/trace.c: Update throughout for bfd section macro changes.
2019-09-16 12:55:17 +02:00
2019-09-18 Alan Modra <amodra@gmail.com>
* aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c,
* coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c,
* dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c,
* exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h,
* hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c,
* i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c,
* maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c,
* mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c,
* objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c,
* ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c,
* rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c,
* s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c,
* solib-spu.c, * solib-svr4.c, * solib-target.c,
* spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c,
* symmisc.c, * symtab.c, * target.c, * windows-nat.c,
* xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c,
* mi/mi-interp.c: Update throughout for bfd section macro and
function changes.
* gcore (gcore_create_callback): Use bfd_set_section_lma.
* spu-tdep.c (spu_overlay_new_objfile): Likewise.
2019-09-18 Tom Tromey <tom@tromey.com>
* NEWS: Add entry.
* tui/tui.c (tui_initialize_readline): Set name of keymap. Do not
call rl_initialize.
(tui_enable): Do not call rl_initialize.
2019-09-18 Christian Groessler <chris@groessler.org>
* alpha-linux-nat.c: Include gdbarch.h.
gdb: remove local extern declaration of cli_styling Following the int -> bool conversion of boolean options (commit 491144b5e21b ("Change boolean options to bool instead of int")), I see this ASAN error: ==357543==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55555b25d440 at pc 0x5555583ce9e1 bp 0x7fffffffd390 sp 0x7fffffffd380 READ of size 4 at 0x55555b25d440 thread T0 #0 0x5555583ce9e0 in term_cli_styling /home/simark/src/binutils-gdb/gdb/ui-file.c:111 #1 0x5555583cf8b0 in stdio_file::can_emit_style_escape() /home/simark/src/binutils-gdb/gdb/ui-file.c:308 #2 0x5555584450d2 in set_output_style /home/simark/src/binutils-gdb/gdb/utils.c:1442 #3 0x5555584491af in fprintf_styled(ui_file*, ui_file_style const&, char const*, ...) /home/simark/src/binutils-gdb/gdb/utils.c:2143 #4 0x5555582fa13c in print_gdb_version(ui_file*, bool) /home/simark/src/binutils-gdb/gdb/top.c:1339 #5 0x555557b723ab in captured_main_1 /home/simark/src/binutils-gdb/gdb/main.c:981 #6 0x555557b7353b in captured_main /home/simark/src/binutils-gdb/gdb/main.c:1172 #7 0x555557b735d0 in gdb_main(captured_main_args*) /home/simark/src/binutils-gdb/gdb/main.c:1197 #8 0x55555700a53d in main /home/simark/src/binutils-gdb/gdb/gdb.c:32 #9 0x7ffff64c9ee2 in __libc_start_main (/usr/lib/libc.so.6+0x26ee2) #10 0x55555700a30d in _start (/home/simark/build/binutils-gdb/gdb/gdb+0x1ab630d) 0x55555b25d441 is located 0 bytes to the right of global variable 'cli_styling' defined in '/home/simark/src/binutils-gdb/gdb/cli/cli-style.c:31:6' (0x55555b25d440) of size 1 The reason of this is that we have this declaration of cli_styling in cli/cli-style.h: extern bool cli_styling; but ui-file.c uses its own local declaration: extern int cli_styling; Because of that, the code in ui-file.c thinks the variable is 4 bytes long, when it is actually 1 byte long, so the generated code reads past the variable. Fix it by removing the declaration and making ui-file.c include cli/cli-style.h. gdb/ChangeLog: * ui-file.c: Include cli/cli-style.h. (term_cli_styling): Remove cli_styling declaration.
2019-09-18 19:33:33 +02:00
2019-09-18 Simon Marchi <simon.marchi@polymtl.ca>
* ui-file.c: Include cli/cli-style.h.
(term_cli_styling): Remove cli_styling declaration.
2019-09-18 Alan Modra <amodra@gmail.com>
* arm-tdep.c (arm_record_special_symbol): Update bfd_get_section
to bfd_asymbol_section.
2019-09-18 Alan Modra <amodra@gmail.com>
* amd64-dicos-tdep.c (amd64_dicos_osabi_sniffer): Constify target.
* i386-cygwin-tdep.c (i386_cygwin_init_abi): Likewise.
* i386-dicos-tdep.c (i386_dicos_osabi_sniffer): Likewise.
2019-09-18 Alan Modra <amodra@gmail.com>
* solib-spu.c (spu_bfd_open): Use bfd_set_filename.
* spu-linux-nat.c (spu_bfd_open): Likewise.
2019-09-18 Christian Biesinger <cbiesinger@google.com>
* dwarf2loc.c: Change extern declaration of dwarf_always_disassemble
to bool to match definition in dwarf2read.c.
Change boolean options to bool instead of int This is for add_setshow_boolean_cmd as well as the gdb::option interface. gdb/ChangeLog: 2019-09-17 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_ignore_descriptive_types_p): Change to bool. (print_signatures): Likewise. (trust_pad_over_xvs): Likewise. * arch/aarch64-insn.c (aarch64_debug): Likewise. * arch/aarch64-insn.h (aarch64_debug): Likewise. * arm-linux-nat.c (arm_apcs_32): Likewise. * arm-linux-tdep.c (arm_apcs_32): Likewise. * arm-nbsd-nat.c (arm_apcs_32): Likewise. * arm-tdep.c (arm_debug): Likewise. (arm_apcs_32): Likewise. * auto-load.c (debug_auto_load): Likewise. (auto_load_gdb_scripts): Likewise. (global_auto_load): Likewise. (auto_load_local_gdbinit): Likewise. (auto_load_local_gdbinit_loaded): Likewise. * auto-load.h (global_auto_load): Likewise. (auto_load_local_gdbinit): Likewise. (auto_load_local_gdbinit_loaded): Likewise. * breakpoint.c (disconnected_dprintf): Likewise. (breakpoint_proceeded): Likewise. (automatic_hardware_breakpoints): Likewise. (always_inserted_mode): Likewise. (target_exact_watchpoints): Likewise. (_initialize_breakpoint): Update. * breakpoint.h (target_exact_watchpoints): Change to bool. * btrace.c (maint_btrace_pt_skip_pad): Likewise. * cli/cli-cmds.c (trace_commands): Likewise. * cli/cli-cmds.h (trace_commands): Likewise. * cli/cli-decode.c (add_setshow_boolean_cmd): Change int* argument to bool*. * cli/cli-logging.c (logging_overwrite): Change to bool. (logging_redirect): Likewise. (debug_redirect): Likewise. * cli/cli-option.h (option_def) <boolean>: Change return type to bool*. (struct boolean_option_def) <get_var_address_cb_>: Change return type to bool. <boolean_option_def>: Update. (struct flag_option_def): Change default type of Context to bool from int. <flag_option_def>: Change return type of var_address_cb_ to bool*. * cli/cli-setshow.c (do_set_command): Cast to bool* instead of int*. (get_setshow_command_value_string): Likewise. * cli/cli-style.c (cli_styling): Change to bool. (source_styling): Likewise. * cli/cli-style.h (source_styling): Likewise. (cli_styling): Likewise. * cli/cli-utils.h (struct qcs_flags) <quiet, cont, silent>: Change to bool. * command.h (var_types): Update comment. (add_setshow_boolean_cmd): Change int* var argument to bool*. * compile/compile-cplus-types.c (debug_compile_cplus_types): Change to bool. (debug_compile_cplus_scopes): Likewise. * compile/compile-internal.h (compile_debug): Likewise. * compile/compile.c (compile_debug): Likewise. (struct compile_options) <raw>: Likewise. * cp-support.c (catch_demangler_crashes): Likewise. * cris-tdep.c (usr_cmd_cris_version_valid): Likewise. (usr_cmd_cris_dwarf2_cfi): Likewise. * csky-tdep.c (csky_debug): Likewise. * darwin-nat.c (enable_mach_exceptions): Likewise. * dcache.c (dcache_enabled_p): Likewise. * defs.h (info_verbose): Likewise. * demangle.c (demangle): Likewise. (asm_demangle): Likewise. * dwarf-index-cache.c (debug_index_cache): Likewise. * dwarf2-frame.c (dwarf2_frame_unwinders_enabled_p): Likewise. * dwarf2-frame.h (dwarf2_frame_unwinders_enabled_p): Likewise. * dwarf2read.c (check_physname): Likewise. (use_deprecated_index_sections): Likewise. (dwarf_always_disassemble): Likewise. * eval.c (overload_resolution): Likewise. * event-top.c (set_editing_cmd_var): Likewise. (exec_done_display_p): Likewise. * event-top.h (set_editing_cmd_var): Likewise. (exec_done_display_p): Likewise. * exec.c (write_files): Likewise. * fbsd-nat.c (debug_fbsd_lwp): Likewise (debug_fbsd_nat): Likewise. * frame.h (struct frame_print_options) <print_raw_frame_arguments>: Likewise. (struct set_backtrace_options) <backtrace_past_main>: Likewise. <backtrace_past_entry> Likewise. * gdb-demangle.h (demangle): Likewise. (asm_demangle): Likewise. * gdb_bfd.c (bfd_sharing): Likewise. * gdbcore.h (write_files): Likewise. * gdbsupport/common-debug.c (show_debug_regs): Likewise. * gdbsupport/common-debug.h (show_debug_regs): Likewise. * gdbthread.h (print_thread_events): Likewise. * gdbtypes.c (opaque_type_resolution): Likewise. (strict_type_checking): Likewise. * gnu-nat.c (gnu_debug_flag): Likewise. * guile/scm-auto-load.c (auto_load_guile_scripts): Likewise. * guile/scm-param.c (pascm_variable): Add boolval. (add_setshow_generic): Update. (pascm_param_value): Update. (pascm_set_param_value_x): Update. * hppa-tdep.c (hppa_debug): Change to bool.. * infcall.c (may_call_functions_p): Likewise. (coerce_float_to_double_p): Likewise. (unwind_on_signal_p): Likewise. (unwind_on_terminating_exception_p): Likewise. * infcmd.c (startup_with_shell): Likewise. * inferior.c (print_inferior_events): Likewise. * inferior.h (startup_with_shell): Likewise. (print_inferior_events): Likewise. * infrun.c (step_stop_if_no_debug): Likewise. (detach_fork): Likewise. (debug_displaced): Likewise. (disable_randomization): Likewise. (non_stop): Likewise. (non_stop_1): Likewise. (observer_mode): Likewise. (observer_mode_1): Likewise. (set_observer_mode): Update. (sched_multi): Change to bool. * infrun.h (debug_displaced): Likewise. (sched_multi): Likewise. (step_stop_if_no_debug): Likewise. (non_stop): Likewise. (disable_randomization): Likewise. * linux-tdep.c (use_coredump_filter): Likewise. (dump_excluded_mappings): Likewise. * linux-thread-db.c (auto_load_thread_db): Likewise. (check_thread_db_on_load): Likewise. * main.c (captured_main_1): Update. * maint-test-options.c (struct test_options_opts) <flag_opt, xx1_opt, xx2_opt, boolean_opt>: Change to bool. * maint-test-settings.c (maintenance_test_settings_boolean): Likewise. * maint.c (maintenance_profile_p): Likewise. (per_command_time): Likewise. (per_command_space): Likewise. (per_command_symtab): Likewise. * memattr.c (inaccessible_by_default): Likewise. * mi/mi-main.c (mi_async): Likewise. (mi_async_1): Likewise. * mips-tdep.c (mips64_transfers_32bit_regs_p): Likewise. * nat/fork-inferior.h (startup_with_shell): Likewise. * nat/linux-namespaces.c (debug_linux_namespaces): Likewise. * nat/linux-namespaces.h (debug_linux_namespaces): Likewise. * nios2-tdep.c (nios2_debug): Likewise. * or1k-tdep.c (or1k_debug): Likewise. * parse.c (parser_debug): Likewise. * parser-defs.h (parser_debug): Likewise. * printcmd.c (print_symbol_filename): Likewise. * proc-api.c (procfs_trace): Likewise. * python/py-auto-load.c (auto_load_python_scripts): Likewise. * python/py-param.c (union parmpy_variable): Add "bool boolval" field. (set_parameter_value): Update. (add_setshow_generic): Update. * python/py-value.c (copy_py_bool_obj): Change argument from int* to bool*. * python/python.c (gdbpy_parameter_value): Cast to bool* instead of int*. * ravenscar-thread.c (ravenscar_task_support): Change to bool. * record-btrace.c (record_btrace_target::store_registers): Update. * record-full.c (record_full_memory_query): Change to bool. (record_full_stop_at_limit): Likewise. * record-full.h (record_full_memory_query): Likewise. * remote-notif.c (notif_debug): Likewise. * remote-notif.h (notif_debug): Likewise. * remote.c (use_range_stepping): Likewise. (interrupt_on_connect): Likewise. (remote_break): Likewise. * ser-tcp.c (tcp_auto_retry): Likewise. * ser-unix.c (serial_hwflow): Likewise. * skip.c (debug_skip): Likewise. * solib-aix.c (solib_aix_debug): Likewise. * spu-tdep.c (spu_stop_on_load_p): Likewise. (spu_auto_flush_cache_p): Likewise. * stack.c (struct backtrace_cmd_options) <full, no_filters, hide>: Likewise. (struct info_print_options) <quiet>: Likewise. * symfile-debug.c (debug_symfile): Likewise. * symfile.c (auto_solib_add): Likewise. (separate_debug_file_debug): Likewise. * symfile.h (auto_solib_add): Likewise. (separate_debug_file_debug): Likewise. * symtab.c (basenames_may_differ): Likewise. (struct filename_partial_match_opts) <dirname, basename>: Likewise. (struct info_print_options) <quiet, exclude_minsyms>: Likewise. (struct info_types_options) <quiet>: Likewise. * symtab.h (demangle): Likewise. (basenames_may_differ): Likewise. * target-dcache.c (stack_cache_enabled_1): Likewise. (code_cache_enabled_1): Likewise. * target.c (trust_readonly): Likewise. (may_write_registers): Likewise. (may_write_memory): Likewise. (may_insert_breakpoints): Likewise. (may_insert_tracepoints): Likewise. (may_insert_fast_tracepoints): Likewise. (may_stop): Likewise. (auto_connect_native_target): Likewise. (target_stop_and_wait): Update. (target_async_permitted): Change to bool. (target_async_permitted_1): Likewise. (may_write_registers_1): Likewise. (may_write_memory_1): Likewise. (may_insert_breakpoints_1): Likewise. (may_insert_tracepoints_1): Likewise. (may_insert_fast_tracepoints_1): Likewise. (may_stop_1): Likewise. * target.h (target_async_permitted): Likewise. (may_write_registers): Likewise. (may_write_memory): Likewise. (may_insert_breakpoints): Likewise. (may_insert_tracepoints): Likewise. (may_insert_fast_tracepoints): Likewise. (may_stop): Likewise. * thread.c (struct info_threads_opts) <show_global_ids>: Likewise. (make_thread_apply_all_options_def_group): Change argument from int* to bool*. (thread_apply_all_command): Update. (print_thread_events): Change to bool. * top.c (confirm): Likewise. (command_editing_p): Likewise. (history_expansion_p): Likewise. (write_history_p): Likewise. (info_verbose): Likewise. * top.h (confirm): Likewise. (history_expansion_p): Likewise. * tracepoint.c (disconnected_tracing): Likewise. (circular_trace_buffer): Likewise. * typeprint.c (print_methods): Likewise. (print_typedefs): Likewise. * utils.c (debug_timestamp): Likewise. (sevenbit_strings): Likewise. (pagination_enabled): Likewise. * utils.h (sevenbit_strings): Likewise. (pagination_enabled): Likewise. * valops.c (overload_resolution): Likewise. * valprint.h (struct value_print_options) <prettyformat_arrays, prettyformat_structs, vtblprint, unionprint, addressprint, objectprint, stop_print_at_null, print_array_indexes, deref_ref, static_field_print, pascal_static_field_print, raw, summary, symbol_print, finish_print>: Likewise. * windows-nat.c (new_console): Likewise. (cygwin_exceptions): Likewise. (new_group): Likewise. (debug_exec): Likewise. (debug_events): Likewise. (debug_memory): Likewise. (debug_exceptions): Likewise. (useshell): Likewise. * windows-tdep.c (maint_display_all_tib): Likewise. * xml-support.c (debug_xml): Likewise.
2019-09-14 21:36:58 +02:00
2019-09-17 Christian Biesinger <cbiesinger@google.com>
* ada-lang.c (ada_ignore_descriptive_types_p): Change to bool.
(print_signatures): Likewise.
(trust_pad_over_xvs): Likewise.
* arch/aarch64-insn.c (aarch64_debug): Likewise.
* arch/aarch64-insn.h (aarch64_debug): Likewise.
* arm-linux-nat.c (arm_apcs_32): Likewise.
* arm-linux-tdep.c (arm_apcs_32): Likewise.
* arm-nbsd-nat.c (arm_apcs_32): Likewise.
* arm-tdep.c (arm_debug): Likewise.
(arm_apcs_32): Likewise.
* auto-load.c (debug_auto_load): Likewise.
(auto_load_gdb_scripts): Likewise.
(global_auto_load): Likewise.
(auto_load_local_gdbinit): Likewise.
(auto_load_local_gdbinit_loaded): Likewise.
* auto-load.h (global_auto_load): Likewise.
(auto_load_local_gdbinit): Likewise.
(auto_load_local_gdbinit_loaded): Likewise.
* breakpoint.c (disconnected_dprintf): Likewise.
(breakpoint_proceeded): Likewise.
(automatic_hardware_breakpoints): Likewise.
(always_inserted_mode): Likewise.
(target_exact_watchpoints): Likewise.
(_initialize_breakpoint): Update.
* breakpoint.h (target_exact_watchpoints): Change to bool.
* btrace.c (maint_btrace_pt_skip_pad): Likewise.
* cli/cli-cmds.c (trace_commands): Likewise.
* cli/cli-cmds.h (trace_commands): Likewise.
* cli/cli-decode.c (add_setshow_boolean_cmd): Change int* argument
to bool*.
* cli/cli-logging.c (logging_overwrite): Change to bool.
(logging_redirect): Likewise.
(debug_redirect): Likewise.
* cli/cli-option.h (option_def) <boolean>: Change return type to bool*.
(struct boolean_option_def) <get_var_address_cb_>: Change return type
to bool.
<boolean_option_def>: Update.
(struct flag_option_def): Change default type of Context to bool
from int.
<flag_option_def>: Change return type of var_address_cb_ to bool*.
* cli/cli-setshow.c (do_set_command): Cast to bool* instead of int*.
(get_setshow_command_value_string): Likewise.
* cli/cli-style.c (cli_styling): Change to bool.
(source_styling): Likewise.
* cli/cli-style.h (source_styling): Likewise.
(cli_styling): Likewise.
* cli/cli-utils.h (struct qcs_flags) <quiet, cont, silent>: Change
to bool.
* command.h (var_types): Update comment.
(add_setshow_boolean_cmd): Change int* var argument to bool*.
* compile/compile-cplus-types.c (debug_compile_cplus_types): Change to
bool.
(debug_compile_cplus_scopes): Likewise.
* compile/compile-internal.h (compile_debug): Likewise.
* compile/compile.c (compile_debug): Likewise.
(struct compile_options) <raw>: Likewise.
* cp-support.c (catch_demangler_crashes): Likewise.
* cris-tdep.c (usr_cmd_cris_version_valid): Likewise.
(usr_cmd_cris_dwarf2_cfi): Likewise.
* csky-tdep.c (csky_debug): Likewise.
* darwin-nat.c (enable_mach_exceptions): Likewise.
* dcache.c (dcache_enabled_p): Likewise.
* defs.h (info_verbose): Likewise.
* demangle.c (demangle): Likewise.
(asm_demangle): Likewise.
* dwarf-index-cache.c (debug_index_cache): Likewise.
* dwarf2-frame.c (dwarf2_frame_unwinders_enabled_p): Likewise.
* dwarf2-frame.h (dwarf2_frame_unwinders_enabled_p): Likewise.
* dwarf2read.c (check_physname): Likewise.
(use_deprecated_index_sections): Likewise.
(dwarf_always_disassemble): Likewise.
* eval.c (overload_resolution): Likewise.
* event-top.c (set_editing_cmd_var): Likewise.
(exec_done_display_p): Likewise.
* event-top.h (set_editing_cmd_var): Likewise.
(exec_done_display_p): Likewise.
* exec.c (write_files): Likewise.
* fbsd-nat.c (debug_fbsd_lwp): Likewise
(debug_fbsd_nat): Likewise.
* frame.h (struct frame_print_options) <print_raw_frame_arguments>:
Likewise.
(struct set_backtrace_options) <backtrace_past_main>: Likewise.
<backtrace_past_entry> Likewise.
* gdb-demangle.h (demangle): Likewise.
(asm_demangle): Likewise.
* gdb_bfd.c (bfd_sharing): Likewise.
* gdbcore.h (write_files): Likewise.
* gdbsupport/common-debug.c (show_debug_regs): Likewise.
* gdbsupport/common-debug.h (show_debug_regs): Likewise.
* gdbthread.h (print_thread_events): Likewise.
* gdbtypes.c (opaque_type_resolution): Likewise.
(strict_type_checking): Likewise.
* gnu-nat.c (gnu_debug_flag): Likewise.
* guile/scm-auto-load.c (auto_load_guile_scripts): Likewise.
* guile/scm-param.c (pascm_variable): Add boolval.
(add_setshow_generic): Update.
(pascm_param_value): Update.
(pascm_set_param_value_x): Update.
* hppa-tdep.c (hppa_debug): Change to bool..
* infcall.c (may_call_functions_p): Likewise.
(coerce_float_to_double_p): Likewise.
(unwind_on_signal_p): Likewise.
(unwind_on_terminating_exception_p): Likewise.
* infcmd.c (startup_with_shell): Likewise.
* inferior.c (print_inferior_events): Likewise.
* inferior.h (startup_with_shell): Likewise.
(print_inferior_events): Likewise.
* infrun.c (step_stop_if_no_debug): Likewise.
(detach_fork): Likewise.
(debug_displaced): Likewise.
(disable_randomization): Likewise.
(non_stop): Likewise.
(non_stop_1): Likewise.
(observer_mode): Likewise.
(observer_mode_1): Likewise.
(set_observer_mode): Update.
(sched_multi): Change to bool.
* infrun.h (debug_displaced): Likewise.
(sched_multi): Likewise.
(step_stop_if_no_debug): Likewise.
(non_stop): Likewise.
(disable_randomization): Likewise.
* linux-tdep.c (use_coredump_filter): Likewise.
(dump_excluded_mappings): Likewise.
* linux-thread-db.c (auto_load_thread_db): Likewise.
(check_thread_db_on_load): Likewise.
* main.c (captured_main_1): Update.
* maint-test-options.c (struct test_options_opts) <flag_opt, xx1_opt,
xx2_opt, boolean_opt>: Change to bool.
* maint-test-settings.c (maintenance_test_settings_boolean): Likewise.
* maint.c (maintenance_profile_p): Likewise.
(per_command_time): Likewise.
(per_command_space): Likewise.
(per_command_symtab): Likewise.
* memattr.c (inaccessible_by_default): Likewise.
* mi/mi-main.c (mi_async): Likewise.
(mi_async_1): Likewise.
* mips-tdep.c (mips64_transfers_32bit_regs_p): Likewise.
* nat/fork-inferior.h (startup_with_shell): Likewise.
* nat/linux-namespaces.c (debug_linux_namespaces): Likewise.
* nat/linux-namespaces.h (debug_linux_namespaces): Likewise.
* nios2-tdep.c (nios2_debug): Likewise.
* or1k-tdep.c (or1k_debug): Likewise.
* parse.c (parser_debug): Likewise.
* parser-defs.h (parser_debug): Likewise.
* printcmd.c (print_symbol_filename): Likewise.
* proc-api.c (procfs_trace): Likewise.
* python/py-auto-load.c (auto_load_python_scripts): Likewise.
* python/py-param.c (union parmpy_variable): Add "bool boolval" field.
(set_parameter_value): Update.
(add_setshow_generic): Update.
* python/py-value.c (copy_py_bool_obj): Change argument from int*
to bool*.
* python/python.c (gdbpy_parameter_value): Cast to bool* instead of
int*.
* ravenscar-thread.c (ravenscar_task_support): Change to bool.
* record-btrace.c (record_btrace_target::store_registers): Update.
* record-full.c (record_full_memory_query): Change to bool.
(record_full_stop_at_limit): Likewise.
* record-full.h (record_full_memory_query): Likewise.
* remote-notif.c (notif_debug): Likewise.
* remote-notif.h (notif_debug): Likewise.
* remote.c (use_range_stepping): Likewise.
(interrupt_on_connect): Likewise.
(remote_break): Likewise.
* ser-tcp.c (tcp_auto_retry): Likewise.
* ser-unix.c (serial_hwflow): Likewise.
* skip.c (debug_skip): Likewise.
* solib-aix.c (solib_aix_debug): Likewise.
* spu-tdep.c (spu_stop_on_load_p): Likewise.
(spu_auto_flush_cache_p): Likewise.
* stack.c (struct backtrace_cmd_options) <full, no_filters, hide>:
Likewise.
(struct info_print_options) <quiet>: Likewise.
* symfile-debug.c (debug_symfile): Likewise.
* symfile.c (auto_solib_add): Likewise.
(separate_debug_file_debug): Likewise.
* symfile.h (auto_solib_add): Likewise.
(separate_debug_file_debug): Likewise.
* symtab.c (basenames_may_differ): Likewise.
(struct filename_partial_match_opts) <dirname, basename>: Likewise.
(struct info_print_options) <quiet, exclude_minsyms>: Likewise.
(struct info_types_options) <quiet>: Likewise.
* symtab.h (demangle): Likewise.
(basenames_may_differ): Likewise.
* target-dcache.c (stack_cache_enabled_1): Likewise.
(code_cache_enabled_1): Likewise.
* target.c (trust_readonly): Likewise.
(may_write_registers): Likewise.
(may_write_memory): Likewise.
(may_insert_breakpoints): Likewise.
(may_insert_tracepoints): Likewise.
(may_insert_fast_tracepoints): Likewise.
(may_stop): Likewise.
(auto_connect_native_target): Likewise.
(target_stop_and_wait): Update.
(target_async_permitted): Change to bool.
(target_async_permitted_1): Likewise.
(may_write_registers_1): Likewise.
(may_write_memory_1): Likewise.
(may_insert_breakpoints_1): Likewise.
(may_insert_tracepoints_1): Likewise.
(may_insert_fast_tracepoints_1): Likewise.
(may_stop_1): Likewise.
* target.h (target_async_permitted): Likewise.
(may_write_registers): Likewise.
(may_write_memory): Likewise.
(may_insert_breakpoints): Likewise.
(may_insert_tracepoints): Likewise.
(may_insert_fast_tracepoints): Likewise.
(may_stop): Likewise.
* thread.c (struct info_threads_opts) <show_global_ids>: Likewise.
(make_thread_apply_all_options_def_group): Change argument from int*
to bool*.
(thread_apply_all_command): Update.
(print_thread_events): Change to bool.
* top.c (confirm): Likewise.
(command_editing_p): Likewise.
(history_expansion_p): Likewise.
(write_history_p): Likewise.
(info_verbose): Likewise.
* top.h (confirm): Likewise.
(history_expansion_p): Likewise.
* tracepoint.c (disconnected_tracing): Likewise.
(circular_trace_buffer): Likewise.
* typeprint.c (print_methods): Likewise.
(print_typedefs): Likewise.
* utils.c (debug_timestamp): Likewise.
(sevenbit_strings): Likewise.
(pagination_enabled): Likewise.
* utils.h (sevenbit_strings): Likewise.
(pagination_enabled): Likewise.
* valops.c (overload_resolution): Likewise.
* valprint.h (struct value_print_options) <prettyformat_arrays,
prettyformat_structs, vtblprint, unionprint, addressprint, objectprint,
stop_print_at_null, print_array_indexes, deref_ref, static_field_print,
pascal_static_field_print, raw, summary, symbol_print, finish_print>:
Likewise.
* windows-nat.c (new_console): Likewise.
(cygwin_exceptions): Likewise.
(new_group): Likewise.
(debug_exec): Likewise.
(debug_events): Likewise.
(debug_memory): Likewise.
(debug_exceptions): Likewise.
(useshell): Likewise.
* windows-tdep.c (maint_display_all_tib): Likewise.
* xml-support.c (debug_xml): Likewise.
gdb: Look for compilation directory relative to directory search path The 'directory' command allows the user to provide a list of filesystem directories in which to search for source code. The directories in this search path are used as the base directory for the source filename from the debug information (DW_AT_name). Thus the directory search path provides alternatives to the existing compilation directory from the debug information (DW_AT_comp_dir). Generally speaking, DW_AT_name stores the filename argument passed to the compiler (including any directory components), and DW_AT_comp_dir stores the current working directory from which the compiler was executed. For example: $ cd /path/to/project/subdir1 $ gcc -c a/test.c -g The corresponding debug information will look like this: DW_AT_name : a/test.c DW_AT_comp_dir : /path/to/project/subdir1 When compiling with the -fdebug-prefix-map GCC option, the compilation directory can be arbitrarily rewritten. In the above example, we may rewrite the compilation directory as follows: $ gcc -c a/test.c -g -fdebug-prefix-map=/path/to/project= In this case, the corresponding debug information will look like: DW_AT_name : a/test.c DW_AT_comp_dir : /subdir1 This prevents GDB from finding the corresponding source code based on the debug information alone. In some cases, a substitute-path command can be used to re-map a consistent prefix in the rewritten compilation directory to the real filesystem path. However, there may not be a consistent prefix remaining in the debug symbols (for example in a project that has source code in many subdirectories under the project's root), thereby requiring multiple substitute-path rules. In this case, it is easier to add the missing prefix to the directory search path via the 'directory' command. The function find_and_open_source currently searches in: SEARCH_PATH/FILENAME where SEARCH_PATH corresponds to each individual entry in the directory search path (which is guaranteed to contain the compilation directory from the debug information, as well as the current working directory). FILENAME corresponds to the source filename (DW_AT_name), which may have directory components in it. In addition, GDB searches in: SEARCH_PATH/FILE_BASENAME where FILE_BASENAME is the basename of the DW_AT_name entry. This change modifies find_and_open_source to additionally search in: SEARCH_PATH/COMP_DIR/FILENAME where COMP_DIR is the compilation directory from the debug symbols. In the example given earlier, running: (gdb) directory /path/to/project will now allow GDB to correctly locate the source code from the debug information. gdb/ChangeLog: * source.c (prepare_path_for_appending): New function. (openp): Make use of new function. (find_and_open_source): Search for the compilation directory and source file as a relative path beneath the directory search path. gdb/doc/ChangeLog: * gdb.texinfo (Source Path): Additional text to better describe how the source path directory list is used when searching for source files. gdb/testsuite/ChangeLog: * gdb.base/source-dir.exp: Add extra test for mapped compilation directory.
2019-09-12 17:16:06 +02:00
2019-09-17 Mike Gulick <mgulick@mathworks.com>
* source.c (prepare_path_for_appending): New function.
(openp): Make use of new function.
(find_and_open_source): Search for the compilation directory and
source file as a relative path beneath the directory search path.
2019-09-17 Andrew Burgess <andrew.burgess@embecosm.com>
* source-cache.c (source_cache::get_line_charpos): Catch
exceptions and return false, this matches the behaviour documented
in the header file.
2019-09-17 Joel Brobecker <brobecker@adacore.com>
* ada-tasks.c (info_task): Remove quoting of the task's name.
2019-09-16 Christian Biesinger <cbiesinger@google.com>
* symfile.c (auto_solib_add): Replace comment with a reference
to the header file.
2019-09-14 Christian Biesinger <cbiesinger@google.com>
* NEWS: Mention that gdb can now be compiled with Python 3
on Windows.
2019-09-12 Andrew Burgess <andrew.burgess@embecosm.com>
* maint.c (maint_print_section_data::maint_print_section_data):
Force use of 'float log10 (float)' by casting the argument to
float.
gdb: Have 'maint info sections' print all sections again In this commit: commit 6eac171f0624303d944ff1a1ae4d0e3b0a63c800 Date: Fri Aug 16 00:25:14 2019 +0200 [gdb] Make maint info sections print relocated addresses A couple of things broke with the 'maintenance info sections' command, here is some before output: (gdb) maintenance info sections Exec file: `/path/to/gdb/build/gdb/testsuite/outputs/gdb.base/maint/maint', file type elf64-x86-64. [0] 0x00400238->0x00400254 at 0x00000238: .interp ALLOC LOAD READONLY DATA HAS_CONTENTS [1] 0x00400254->0x00400274 at 0x00000254: .note.ABI-tag ALLOC LOAD READONLY DATA HAS_CONTENTS [2] 0x00400274->0x00400298 at 0x00000274: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS [3] 0x00400298->0x004002bc at 0x00000298: .gnu.hash ALLOC LOAD READONLY DATA HAS_CONTENTS [4] 0x004002c0->0x00400380 at 0x000002c0: .dynsym ALLOC LOAD READONLY DATA HAS_CONTENTS [5] 0x00400380->0x004003e3 at 0x00000380: .dynstr ALLOC LOAD READONLY DATA HAS_CONTENTS [6] 0x004003e4->0x004003f4 at 0x000003e4: .gnu.version ALLOC LOAD READONLY DATA HAS_CONTENTS [7] 0x004003f8->0x00400418 at 0x000003f8: .gnu.version_r ALLOC LOAD READONLY DATA HAS_CONTENTS [8] 0x00400418->0x00400460 at 0x00000418: .rela.dyn ALLOC LOAD READONLY DATA HAS_CONTENTS [9] 0x00400460->0x004004c0 at 0x00000460: .rela.plt ALLOC LOAD READONLY DATA HAS_CONTENTS [10] 0x004004c0->0x004004d7 at 0x000004c0: .init ALLOC LOAD READONLY CODE HAS_CONTENTS [11] 0x004004e0->0x00400530 at 0x000004e0: .plt ALLOC LOAD READONLY CODE HAS_CONTENTS [12] 0x00400530->0x00400802 at 0x00000530: .text ALLOC LOAD READONLY CODE HAS_CONTENTS [13] 0x00400804->0x0040080d at 0x00000804: .fini ALLOC LOAD READONLY CODE HAS_CONTENTS [14] 0x00400810->0x0040084e at 0x00000810: .rodata ALLOC LOAD READONLY DATA HAS_CONTENTS [15] 0x00400850->0x004008c4 at 0x00000850: .eh_frame_hdr ALLOC LOAD READONLY DATA HAS_CONTENTS [16] 0x004008c8->0x00400ab8 at 0x000008c8: .eh_frame ALLOC LOAD READONLY DATA HAS_CONTENTS [17] 0x00600e00->0x00600e08 at 0x00000e00: .init_array ALLOC LOAD DATA HAS_CONTENTS [18] 0x00600e08->0x00600e10 at 0x00000e08: .fini_array ALLOC LOAD DATA HAS_CONTENTS [19] 0x00600e10->0x00600ff0 at 0x00000e10: .dynamic ALLOC LOAD DATA HAS_CONTENTS [20] 0x00600ff0->0x00601000 at 0x00000ff0: .got ALLOC LOAD DATA HAS_CONTENTS [21] 0x00601000->0x00601038 at 0x00001000: .got.plt ALLOC LOAD DATA HAS_CONTENTS [22] 0x00601038->0x0060103c at 0x00001038: .data ALLOC LOAD DATA HAS_CONTENTS [23] 0x00601040->0x006012c8 at 0x0000103c: .bss ALLOC [24] 0x00000000->0x0000002c at 0x0000103c: .comment READONLY HAS_CONTENTS [25] 0x00000000->0x00000060 at 0x00001068: .debug_aranges READONLY HAS_CONTENTS [26] 0x00000000->0x0000061b at 0x000010c8: .debug_info READONLY HAS_CONTENTS [27] 0x00000000->0x00000264 at 0x000016e3: .debug_abbrev READONLY HAS_CONTENTS [28] 0x00000000->0x000001e6 at 0x00001947: .debug_line READONLY HAS_CONTENTS [29] 0x00000000->0x00000487 at 0x00001b2d: .debug_str READONLY HAS_CONTENTS (gdb) And here is the output after the above commit: (gdb) maintenance info sections +maintenance info sections Exec file: `/path/to/gdb/build/gdb/testsuite/outputs/gdb.base/maint/maint', file type elf64-x86-64. 0x00400238->0x00400254 at 0x00000238: .interp ALLOC LOAD READONLY DATA HAS_CONTENTS 0x00400254->0x00400274 at 0x00000254: .note.ABI-tag ALLOC LOAD READONLY DATA HAS_CONTENTS 0x00400274->0x00400298 at 0x00000274: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS 0x00400298->0x004002bc at 0x00000298: .gnu.hash ALLOC LOAD READONLY DATA HAS_CONTENTS 0x004002c0->0x00400380 at 0x000002c0: .dynsym ALLOC LOAD READONLY DATA HAS_CONTENTS 0x00400380->0x004003e3 at 0x00000380: .dynstr ALLOC LOAD READONLY DATA HAS_CONTENTS 0x004003e4->0x004003f4 at 0x000003e4: .gnu.version ALLOC LOAD READONLY DATA HAS_CONTENTS 0x004003f8->0x00400418 at 0x000003f8: .gnu.version_r ALLOC LOAD READONLY DATA HAS_CONTENTS 0x00400418->0x00400460 at 0x00000418: .rela.dyn ALLOC LOAD READONLY DATA HAS_CONTENTS 0x00400460->0x004004c0 at 0x00000460: .rela.plt ALLOC LOAD READONLY DATA HAS_CONTENTS 0x004004c0->0x004004d7 at 0x000004c0: .init ALLOC LOAD READONLY CODE HAS_CONTENTS 0x004004e0->0x00400530 at 0x000004e0: .plt ALLOC LOAD READONLY CODE HAS_CONTENTS 0x00400530->0x00400802 at 0x00000530: .text ALLOC LOAD READONLY CODE HAS_CONTENTS 0x00400804->0x0040080d at 0x00000804: .fini ALLOC LOAD READONLY CODE HAS_CONTENTS 0x00400810->0x0040084e at 0x00000810: .rodata ALLOC LOAD READONLY DATA HAS_CONTENTS 0x00400850->0x004008c4 at 0x00000850: .eh_frame_hdr ALLOC LOAD READONLY DATA HAS_CONTENTS 0x004008c8->0x00400ab8 at 0x000008c8: .eh_frame ALLOC LOAD READONLY DATA HAS_CONTENTS 0x00600e00->0x00600e08 at 0x00000e00: .init_array ALLOC LOAD DATA HAS_CONTENTS 0x00600e08->0x00600e10 at 0x00000e08: .fini_array ALLOC LOAD DATA HAS_CONTENTS 0x00600e10->0x00600ff0 at 0x00000e10: .dynamic ALLOC LOAD DATA HAS_CONTENTS 0x00600ff0->0x00601000 at 0x00000ff0: .got ALLOC LOAD DATA HAS_CONTENTS 0x00601000->0x00601038 at 0x00001000: .got.plt ALLOC LOAD DATA HAS_CONTENTS 0x00601038->0x0060103c at 0x00001038: .data ALLOC LOAD DATA HAS_CONTENTS 0x00601040->0x006012c8 at 0x0000103c: .bss ALLOC 0x00000000->0x00000000 at 0x00000000: *COM* IS_COMMON 0x00000000->0x00000000 at 0x00000000: *UND* 0x00000000->0x00000000 at 0x00000000: *ABS* 0x00000000->0x00000000 at 0x00000000: *IND* (gdb) We lost the section index numbers, but more importantly, we lost the information about the .debug* sections. We also gained entries for the "fake" sections *COM*, *UND*, *ABS*, and *IND*. I noticed this when running: make check-gdb RUNTESTFLAGS="--target_board=cc-with-gdb-index gdb.base/maint.exp" As this test relies on looking in the 'maint info sections' output to see if we have a .debug_names or .gdb_index section, and these are debug sections so they no longer show up in the 'main info sections' output, the gdb.base/maint.exp test fails. This commit restores the old behaviour while keeping the important change that the above commit introduced, the addresses printed for sections are the relocated addresses where appropriate. The above commit mentions using this test: make check-gdb RUNTESTFLAGS="CFLAGS_FOR_TARGET='-pie' gdb.base/compare-sections.exp" And this still passes after this commit. The output for 'maint info sections' now looks like this: (gdb) maintenance info sections Exec file: `/home/andrew/projects/binutils-gdb/build/gdb/testsuite/outputs/gdb.base/maint/maint', file type elf64-x86-64. [0] 0x00400238->0x00400254 at 0x00000238: .interp ALLOC LOAD READONLY DATA HAS_CONTENTS [1] 0x00400254->0x00400274 at 0x00000254: .note.ABI-tag ALLOC LOAD READONLY DATA HAS_CONTENTS [2] 0x00400274->0x00400298 at 0x00000274: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS [3] 0x00400298->0x004002bc at 0x00000298: .gnu.hash ALLOC LOAD READONLY DATA HAS_CONTENTS [4] 0x004002c0->0x00400380 at 0x000002c0: .dynsym ALLOC LOAD READONLY DATA HAS_CONTENTS [5] 0x00400380->0x004003e3 at 0x00000380: .dynstr ALLOC LOAD READONLY DATA HAS_CONTENTS [6] 0x004003e4->0x004003f4 at 0x000003e4: .gnu.version ALLOC LOAD READONLY DATA HAS_CONTENTS [7] 0x004003f8->0x00400418 at 0x000003f8: .gnu.version_r ALLOC LOAD READONLY DATA HAS_CONTENTS [8] 0x00400418->0x00400460 at 0x00000418: .rela.dyn ALLOC LOAD READONLY DATA HAS_CONTENTS [9] 0x00400460->0x004004c0 at 0x00000460: .rela.plt ALLOC LOAD READONLY DATA HAS_CONTENTS [10] 0x004004c0->0x004004d7 at 0x000004c0: .init ALLOC LOAD READONLY CODE HAS_CONTENTS [11] 0x004004e0->0x00400530 at 0x000004e0: .plt ALLOC LOAD READONLY CODE HAS_CONTENTS [12] 0x00400530->0x00400802 at 0x00000530: .text ALLOC LOAD READONLY CODE HAS_CONTENTS [13] 0x00400804->0x0040080d at 0x00000804: .fini ALLOC LOAD READONLY CODE HAS_CONTENTS [14] 0x00400810->0x0040084e at 0x00000810: .rodata ALLOC LOAD READONLY DATA HAS_CONTENTS [15] 0x00400850->0x004008c4 at 0x00000850: .eh_frame_hdr ALLOC LOAD READONLY DATA HAS_CONTENTS [16] 0x004008c8->0x00400ab8 at 0x000008c8: .eh_frame ALLOC LOAD READONLY DATA HAS_CONTENTS [17] 0x00600e00->0x00600e08 at 0x00000e00: .init_array ALLOC LOAD DATA HAS_CONTENTS [18] 0x00600e08->0x00600e10 at 0x00000e08: .fini_array ALLOC LOAD DATA HAS_CONTENTS [19] 0x00600e10->0x00600ff0 at 0x00000e10: .dynamic ALLOC LOAD DATA HAS_CONTENTS [20] 0x00600ff0->0x00601000 at 0x00000ff0: .got ALLOC LOAD DATA HAS_CONTENTS [21] 0x00601000->0x00601038 at 0x00001000: .got.plt ALLOC LOAD DATA HAS_CONTENTS [22] 0x00601038->0x0060103c at 0x00001038: .data ALLOC LOAD DATA HAS_CONTENTS [23] 0x00601040->0x006012c8 at 0x0000103c: .bss ALLOC [24] 0x00000000->0x0000002c at 0x0000103c: .comment READONLY HAS_CONTENTS [25] 0x00000000->0x00000060 at 0x00001068: .debug_aranges READONLY HAS_CONTENTS [26] 0x00000000->0x0000061b at 0x000010c8: .debug_info READONLY HAS_CONTENTS [27] 0x00000000->0x00000264 at 0x000016e3: .debug_abbrev READONLY HAS_CONTENTS [28] 0x00000000->0x000001e6 at 0x00001947: .debug_line READONLY HAS_CONTENTS [29] 0x00000000->0x00000487 at 0x00001b2d: .debug_str READONLY HAS_CONTENTS (gdb) This is basically as it was before, except that the index numbers are now padded so the section information all lines up. When GDB has relocated a section then the relocated addresses will be printed, otherwise the non-relocated addresses from the bfd will be printed. I've added a test to gdb.base/maint.exp to do some basic validation of the output format. gdb/ChangeLog: * maint.c: Add 'cmath' include. (struct maint_print_section_data): New structure. (print_section_index): New function. (print_bfd_section_info): Add header comment, small whitespace cleanup, and update to call new print_section_index function. (print_objfile_section_info): Likewise. (maint_obj_section_from_bfd_section): New function. (print_bfd_section_info_maybe_relocated): New function. (maintenance_info_sections): Add header comment, always use bfd_map_over_sections instead of ALL_OBJFILE_OSECTIONS. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Add test for 'maint info sections'.
2019-09-01 00:44:40 +02:00
2019-09-12 Andrew Burgess <andrew.burgess@embecosm.com>
* maint.c: Add 'cmath' include.
(struct maint_print_section_data): New structure.
(print_section_index): New function.
(print_bfd_section_info): Add header comment, small whitespace
cleanup, and update to call new print_section_index function.
(print_objfile_section_info): Likewise.
(maint_obj_section_from_bfd_section): New function.
(print_bfd_section_info_maybe_relocated): New function.
(maintenance_info_sections): Add header comment, always use
bfd_map_over_sections instead of ALL_OBJFILE_OSECTIONS.
gdb: Don't fault for 'maint print psymbols' when using an index I found that these tests: make check-gdb RUNTESTFLAGS="--target_board=cc-with-gdb-index gdb.base/maint.exp" make check-gdb RUNTESTFLAGS="--target_board=cc-with-debug-names gdb.base/maint.exp" were causing GDB to segfault. It turns out that this test runs this command: maint print psymbols -pc main /path/to/some/file which tries to lookup the partial_symtab for 'main'. The problem is that there is no partial_symtab for 'main' as we are using the .gdb_index or .debug_names instead of partial_symtabs. What happens is that maintenance_print_symbols calls find_pc_sect_psymtab, which looks for the partial_symtab in the objfile's objfile->partial_symtabs->psymtabs_addrmap. This is a problem because when we are using the indexes psymtabs_addrmap is reused to hold things other than partial_symtabs, this can be seen in dwarf2read.c in create_addrmap_from_index and create_addrmap_from_aranges. If we then lookup in psymtabs_addrmap we end up returning a pointer to something that isn't really a partial_symtab, after which everything goes wrong. Initially I simply added a check at the start of find_pc_sect_psymtab that the objfile had some partial_symtabs, like: if (objfile->partial_symtabs->psymtabs == NULL) return NULL; Figuring that if there were no partial_symtabs at all then this function should always return NULL, however, this caused a failure in the test gdb.python/py-event.exp which I didn't dig into too deeply, but seems to be that in this tests there are initially no psymtabs, but the second part of find_pc_sect_psymtab does manage to read some in from somewhere, with the check I added the test fails as we returned NULL here and this caused GDB to load in the full symtabs earlier than was expected. Instead I chose to guard only the access to psymtabs_addrmap with a check that the function has some psymtabs. This allows my original tests to pass, and the py-event.exp test to pass too. Now, a good argument can be made that we simply should never call find_pc_sect_psymtab on an objfile that is using indexes instead of partial_symtabs. I did consider this approach, we could easily add an assert into find_pc_sect_psymtab that if we find a partial_symtab in psymtabs_addrmap then the psymtabs pointer must be non-null. The responsibility would then be on the user of find_pc_sect_psymtab to ensure that the objfile being checked is suitable. In the end I didn't take this approach as the check in find_pc_sect_psymtab is cheap and this ensures that any future miss-uses of the function will not cause problems. I also extended the comment on psymtabs_addrmap to indicate that it holds more than just partial_symtabs as this was not at all clear from the original comment, and caused me some confusion when I was initially debugging this problem. gdb/ChangeLog: * psymtab.c (find_pc_sect_psymtab): Move baseaddr local into more inner scope, add check that the objfile has psymtabs before checking psymtabs_addrmap. * psymtab.h (psymtab_storage) <psymtabs_addrmap>: Extend comment.
2019-08-31 22:46:27 +02:00
2019-09-12 Andrew Burgess <andrew.burgess@embecosm.com>
* psymtab.c (find_pc_sect_psymtab): Move baseaddr local into more
inner scope, add check that the objfile has psymtabs before
checking psymtabs_addrmap.
* psymtab.h (psymtab_storage) <psymtabs_addrmap>: Extend comment.
Output the Ada task name in more messages. With this patch, we e.g. get: [Switching to task 2 "task_list(1)"] [Current task is 2 "task_list(1)"] instead of [Switching to task 2] [Current task is 2] The logic to produce the taskno optionally followed by the task name has been factorized in the task_to_str function. Task names are output between double quotes in the new messages, similarly to what GDB does for thread names. However, no quotes are put around task names in 'info tasks' Name column. This was discussed with Tom, that preferred no quotes there, while I was more in favour of visual consistency. I discussed with a few more users, which led to (exactly) 50% preferring quotes and 50% preferring no quotes :). To arrive to the decision to remove the quotes, the following "killing args" were used: * To have quotes or to not have quotes, that is the question; yes but not *THE* question :). * If there is not a clear majority that prefers quotes, better to not disturb the existing user basis for a (somewhat) irrelevant aspect. * The opinion of the reviewer has more weight. So, compared to the previous version, this version remotes the quotes in 'info tasks'. It improves the alignement of 'info tasks' output. With this patch, we get: (gdb) info task ID TID P-ID Pri State Name * 1 555555759030 48 Runnable main_task 2 555555759e30 1 48 Selective Wait mit (gdb) instead of (gdb) info task ID TID P-ID Pri State Name * 1 555555759030 48 Runnable main_task 2 555555759e30 1 48 Selective Wait mit (gdb) (e.g. the first one properly shows parent and priority under the correct header). This is version 4 of the 'task name' patch. Compared to version 3, the changes are: output task names between quotes but not in 'info tasks' gdb/ChangeLog 2019-09-12 Philippe Waroquiers <philippe.waroquiers@skynet.be> * NEWS: Announce that Ada task names are now shown at more places, and between quotes (except in info task output). * gdb/ada-tasks.c (task_to_str): New function. (display_current_task_id): Call task_to_str. (task_command_1): Likewise. (print_ada_task_info): In non-mi mode, Properly align headers and data when task-id length is > 9 (9 is the default for a 32 bits CORE_ADDR). gdb/doc/ChangeLog 2019-09-12 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.texinfo (Ada Tasks): Tell the task name is printed, update examples. gdb/testsuite/ChangeLog 2019-09-12 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.ada/rdv_wait.exp: Update to new task names. * gdb.base/task_switch_in_core.exp: Likewise. * gdb.base/info_sources_base.c: Likewise.
2019-06-08 19:47:51 +02:00
2019-09-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Announce that Ada task names are now shown at more places,
and between quotes (except in info task output).
* gdb/ada-tasks.c (task_to_str): New function.
(display_current_task_id): Call task_to_str.
(task_command_1): Likewise.
(print_ada_task_info): In non-mi mode, Properly align headers and data
when task-id length is > 9 (9 is the default for a 32 bits CORE_ADDR).
2019-09-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* procfs.c (procfs_target::wait) <PR_FAULTED>: Get signal from
prstatus.pr_lwp.pr_info instead of making it up.
2019-09-11 Christian Biesinger <cbiesinger@google.com>
* auto-load.c (auto_load_expand_dir_vars): Update.
* defs.h (gdb_datadir): Change to std::string.
(python_libdir): Likewise.
(relocate_gdb_directory): Change return type to std::string.
* guile/guile.c (gdbscm_data_directory): Update.
(initialize_scheme_side): Update.
* jit.c (jit_reader_dir): Change to std::string.
(jit_reader_load_command): Update.
* main.c (gdb_datadir): Change to std::string.
(python_libdir): Likewise.
(set_gdb_data_directory): Update.
(relocate_path): Change to return std::string.
(relocate_gdb_directory): Change to return std::string.
(relocate_gdbinit_path_maybe_in_datadir): Update.
(captured_main_1): Update.
* python/python.c (do_start_initialization): Update.
* top.c (show_gdb_datadir): Update.
* xml-syscall.c (xml_init_syscalls_info): Update.
(init_syscalls_info): Update.
2019-09-11 Christian Biesinger <cbiesinger@google.com>
* main.c (relocate_gdbinit_path_maybe_in_datadir): Factor this code
out of get_init_files.
(get_init_files): Update.
2019-09-11 Christian Biesinger <cbiesinger@google.com>
* main.c (get_init_files): Change to use std::string.
(captured_main_1): Update.
(print_gdb_help): Update.
2019-09-11 Ali Tamur <tamur@google.com>
*gdb/target-float.c (host_float_ops<T>::to_longest): Update
implementation.
2019-09-11 Christian Biesinger <cbiesinger@google.com>
* dbxread.c (read_dbx_symtab): Update.
* dwarf2read.c (load_partial_dies): Update.
* mdebugread.c (parse_partial_symbols): Update.
(handle_psymbol_enumerators): Update.
* psympriv.h (add_psymbol_to_list): Change type of copy_names to bool.
* psymtab.c (add_psymbol_to_bcache): Likewise.
(add_psymbol_to_list): Likewise.
* symtab.c (symbol_set_names): Likewise.
* symtab.h (symbol_set_names): Likewise.
* xcoffread.c (scan_xcoff_symtab): Update.
2019-09-11 Tom Tromey <tom@tromey.com>
* symfile-mem.c (symbol_file_add_from_memory): Use
bfd_set_filename.
* solib-darwin.c (darwin_bfd_open): Use bfd_set_filename.
* solib-aix.c (solib_aix_bfd_open): Use bfd_set_filename.
2019-09-10 Tom Tromey <tromey@adacore.com>
* dwarf-index-write.c (write_psymbols): Extend error message.
(debug_names::insert): Add Ada code.
(debug_names::write_psymbols): Remove Ada check.
(debug_names) <m_string_obstack>: New member.
* dwarf2read.c (gdb_index_symbol_name_matcher): Remove.
(gdb_index_symbol_name_matcher::matches): Remove.
(mapped_index_base::find_name_components_bounds): Add "lang"
parameter.
(mapped_index_base::build_name_components): Also split names
according to Ada syntax.
(dw2_expand_symtabs_matching_symbol): Loop over languages. Change
type of "match_callback".
(check_match, check_find_bounds_finds)
(dw2_expand_symtabs_matching): Update.
(dw2_debug_names_iterator): Add new constructor.
(dw2_debug_names_map_matching_symbols): New function.
(dw2_debug_names_expand_symtabs_matching): Update.
(dwarf2_debug_names_functions): Use
dw2_debug_names_map_matching_symbols.
2019-09-10 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (dw2_get_file_names_reader): Add the
CU's file name to the results.
2019-09-10 Tom Tromey <tromey@adacore.com>
* ada-lang.c (add_nonlocal_symbols): Combine calls to
map_matching_symbols. Update.
* dwarf2read.c (dw2_map_matching_symbols): Update.
* psymtab.c (match_partial_symbol): Change type; update.
(psym_map_matching_symbols): Likewise.
* symfile-debug.c (debug_qf_map_matching_symbols): Change
type; update.
* symfile.h (struct quick_symbol_functions)
<map_matching_symbols>: Change "name" to be a lookup_name_info.
Remove "match".
2019-09-10 Tom Tromey <tromey@adacore.com>
* psymtab.c (map_block): Remove.
(psym_map_matching_symbols): Use iterate_over_symbols_terminated.
* symtab.c (iterate_over_symbols_terminated): New function.
* symtab.c (iterate_over_symbols_terminated): Declare.
2019-09-10 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_iterate_over_symbols): Return bool.
* language.h (struct language_defn) <la_iterate_over_symbols>:
Return bool.
* symtab.c (iterate_over_symbols): Return bool.
* symtab.h (iterate_over_symbols): Return bool.
2019-09-10 Tom Tromey <tromey@adacore.com>
* ada-lang.c (aux_add_nonlocal_symbols): Change type.
(add_nonlocal_symbols): Update.
* dwarf2read.c (dw2_map_matching_symbols): Change type.
* psymtab.c (map_block, psym_map_matching_symbols): Change type.
* symfile-debug.c (debug_qf_map_matching_symbols): Change type.
* symfile.h (struct quick_symbol_functions) <map_matching_symbols>:
Change type of "callback". Remove "data".
2019-09-09 Ali Tamur <tamur@google.com>
* dwarf2read.c (comp_unit_head): Update comment.
(dwarf2_dwo_name): New function declaration.
(dwarf_unit_type_name): New function declaration.
(read_comp_unit_head): Add support for new compilation units,
DW_UT_partial, DW_UT_skeleton, DW_UT_split_compile, DW_UT_split_type.
Particularly, DW_UT_skeleton and DW_UT_split_compile have dwo_id
(currently named as "signature") in their header. Also clarify error
messages.
(lookup_dwo_id): New function. Returns the dwo id of the given
compile unit.
(lookup_dwo_unit): Use the new lookup_dwo_id function.
(init_cutu_and_read_dies): Use the new dwarf2_dwo_name and lookup_dwo_id
functions.
(create_dwo_cu_reader): Use the added lookup_dwo_id function.
(dwarf2_dwo_name): Get the dwo name if present.
(dwarf_unit_type_name): Convert DW_UT_* types to string for diagnostic
purposes.
2019-09-09 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_all_windows_info): Use ui_out.
Fix leak detected in python.c initialization code. Valgrind reports the below leak. Make the variable progname_copy static, so that Valgrind continues to find a pointer to the memory given to Python. Note that the comment in do_start_initialization and the Python documentation indicates that the progname given to Py_SetProgramName cannot be freed. However, in Python 3.7.4, Py_SetProgramName does: void Py_SetProgramName(const wchar_t *program_name) { ... PyMem_RawFree(_Py_path_config.program_name); _Py_path_config.program_name = _PyMem_RawWcsdup(program_name); So, it looks like 3.7.4 Python duplicates its argument, which explains the leak found by Valgrind. It looks better to respect the doc and not have GDB freeing the string given to Py_SetProgramName, and avoid the leak error by declaring the progname_copy static. This will work with Python versions that really use this string without duplicating it, and avoids a leak report for Python version that duplicates it. ==4023== 200 bytes in 1 blocks are definitely lost in loss record 4,545 of 7,116^M ==4023== at 0x4C29F33: malloc (vg_replace_malloc.c:307)^M ==4023== by 0x446D27: xmalloc (alloc.c:60)^M ==4023== by 0x657C77: do_start_initialization (python.c:1610)^M ==4023== by 0x657C77: _initialize_python() (python.c:1823)^M ==4023== by 0x75FE24: initialize_all_files() (init.c:231)^M ==4023== by 0x708A94: gdb_init(char*) (top.c:2242)^M ==4023== by 0x5E7460: captured_main_1 (main.c:857)^M ==4023== by 0x5E7460: captured_main (main.c:1161)^M ==4023== by 0x5E7460: gdb_main(captured_main_args*) (main.c:1186)^M ==4023== by 0x4122D4: main (gdb.c:32)^M gdb/ChangeLog 2019-09-09 Philippe Waroquiers <philippe.waroquiers@skynet.be> * python/python.c (do_start_initialization): Make progname_copy static, to avoid a leak report.
2019-09-07 20:54:44 +02:00
2019-09-09 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* python/python.c (do_start_initialization): Make progname_copy static,
to avoid a leak report.
2019-09-08 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (box_win): Truncate long window titles.
2019-09-07 Simon Marchi <simon.marchi@efficios.com>
* dwarf2read.c (struct dw2_symtab_iterator) <block_index>:
Change type to gdb::optional<block_enum>.
(dw2_symtab_iter_init): Change block_index parameter type
to gdb::optional<block_enum>.
(dw2_lookup_symbol): Change block_index parameter
type to block_enum.c
(dw2_debug_names_lookup_symbol): Likewise.
* psymtab.c (psym_lookup_symbol): Likewise.
* symfile-debug.c (debug_qf_lookup_symbol): Likewise.
* symfile.h (struct quick_symbol_functions) <lookup_symbol>:
Likewise.
2019-09-06 Christian Biesinger <cbiesinger@google.com>
* defs.h (relocate_gdb_directory): Change int to bool in
signature and rename flag to relocatable.
* main.c (relocate_path): Likewise.
(relocate_gdb_directory): Likewise.
bfd_get_filename This macro says: /* Cast from const char * to char * so that caller can assign to a char * without a warning. */ I reckon that isn't such a good idea since it can result in char* variables where const char* is appropriate. Not very many places need the char* cast. bfd/ * aout-target.h (object_p): Formatting. * bfd-in.h (bfd_get_filename): Don't cast to char*. * corefile.c (generic_core_file_matches_executable_p): Constify variables and remove cast. * bfd-in2.h: Regenerate. binutils/ * nm.c (print_object_filename_bsd, print_object_filename_sysv), (print_object_filename_posix, print_archive_filename_bsd), (print_archive_filename_sysv, print_archive_filename_posix), (print_archive_member_bsd, print_archive_member_sysv), (print_archive_member_posix): Constify parameter. (struct output_fns <print_object_filename, print_archive_filename>), (<print_archive_member>): Likewise. * objcopy.c (copy_archive): Add cast for make_tempdir. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_search_needed): Constify variable. * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_after_open): Likewise. gdb/ * coffread.c (coff_symfile_read): Constify filename variable. * dbxread.c (dbx_symfile_init, coffstab_build_psymtabs), (elfstab_build_psymtabs, stabsect_build_psymtabs): Likewise. * gdb_bfd.c (gdb_bfd_close_or_warn): Likewise. * solib.c (reload_shared_libraries_1): Likewise. * symfile.c (reread_symbols): Likewise. * solib-aix.c (solib_aix_bfd_open): Add cast for xfree of filename. * solib-darwin.c (darwin_bfd_open): Likewise. * symfile-mem.c (symbol_file_add_from_memory): Likewise. sim/cris/ * sim-if.c (sim_open): Constify filename variable.
2019-09-06 04:37:05 +02:00
2019-09-06 Alan Modra <amodra@gmail.com>
* coffread.c (coff_symfile_read): Constify filename variable.
* dbxread.c (dbx_symfile_init, coffstab_build_psymtabs),
(elfstab_build_psymtabs, stabsect_build_psymtabs): Likewise.
* gdb_bfd.c (gdb_bfd_close_or_warn): Likewise.
* solib.c (reload_shared_libraries_1): Likewise.
* symfile.c (reread_symbols): Likewise.
* solib-aix.c (solib_aix_bfd_open): Add cast for xfree of filename.
* solib-darwin.c (darwin_bfd_open): Likewise.
* symfile-mem.c (symbol_file_add_from_memory): Likewise.
2019-09-03 Andrew Burgess <andrew.burgess@embecosm.com>
* psymtab.c (print_partial_symbols): Handle missing domain_enum
values MODULE_DOMAIN and COMMON_BLOCK_DOMAIN.
Handle biased types In Ada, the programmer can request that a range type with a non-zero base be stored in the minimal number of bits required for the range. This is done by biasing the values; so, for example, a range of -7..-4 may be stored as two bits with a bias of -7. This patch implements this for gdb. It is done by adding a bias to struct range_bounds and then adjusting a few spots to handle this. The test case is written to use -fgnat-encodings=minimal, but a future compiler patch will change the compiler to emit DW_AT_GNU_bias with -fgnat-encodings=gdb. It seemed good to get the gdb patch in first. Tested on x86-64 Fedora 29; plus a variety of targets using AdaCore's internal test suite. gdb/ChangeLog 2019-09-03 Tom Tromey <tromey@adacore.com> * ada-valprint.c (ada_val_print_num): Don't recurse for range types. (has_negatives): Unbias a range type bound. * dwarf2read.c (read_subrange_type): Handle DW_AT_GNU_bias. * gdbtypes.c (operator==): Handle new field. (create_range_type): Add "bias" parameter. (create_static_range_type, resolve_dynamic_range): Update. * gdbtypes.h (struct range_bounds) <bias>: New member. (create_range_type): Add bias parameter. * printcmd.c (print_scalar_formatted): Unbias range types. * value.c (unpack_long): Unbias range types. (pack_long): Bias range types. gdb/testsuite/ChangeLog 2019-09-03 Tom Tromey <tromey@adacore.com> * gdb.ada/bias.exp: New file. * gdb.ada/bias/bias.adb: New file. * gdb.ada/print_chars.exp: Add regression test. * gdb.ada/print_chars/foo.adb (My_Character): New type. (MC): New variable.
2019-05-13 21:21:48 +02:00
2019-09-03 Tom Tromey <tromey@adacore.com>
* ada-valprint.c (ada_val_print_num): Don't recurse for range
types.
(has_negatives): Unbias a range type bound.
* dwarf2read.c (read_subrange_type): Handle DW_AT_GNU_bias.
* gdbtypes.c (operator==): Handle new field.
(create_range_type): Add "bias" parameter.
(create_static_range_type, resolve_dynamic_range): Update.
* gdbtypes.h (struct range_bounds) <bias>: New member.
(create_range_type): Add bias parameter.
* printcmd.c (print_scalar_formatted): Unbias range types.
* value.c (unpack_long): Unbias range types.
(pack_long): Bias range types.
2019-09-02 Alan Hayward <alan.hayward@arm.com>
* solib-svr4.c (svr4_find_and_create_probe_breakpoints): Check all
probe arguments.
2019-09-02 Alan Hayward <alan.hayward@arm.com>
* break-catch-throw.c (fetch_probe_arguments): Use gdbarch.
* dtrace-probe.c (dtrace_probe::get_argument_count): Likewise.
* probe.c (probe_safe_evaluate_at_pc) (compute_probe_arg)
(compile_probe_arg): Likewise.
* probe.h (get_argument_count): Likewise.
* solib-svr4.c (solib_event_probe_action): Likewise.
* stap-probe.c (stap_probe::get_argument_count): Likewise.
2019-09-02 Alan Hayward <alan.hayward@arm.com>
* solib-svr4.c (svr4_find_and_create_probe_breakpoints): Move
code to here...
(svr4_create_solib_event_breakpoints): ...from here.
2019-08-30 Sergio Durigan Junior <sergiodj@redhat.com>
* nat/fork-inferior.c (trace_start_error): Remove "\nError: "
suffix from warning message.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<refresh_all>: Don't declare.
* tui/tui-winsource.c (tui_source_window_base::refresh_all):
Remove.
* tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or
tui_show_locator_content.
* tui/tui-regs.h (struct tui_data_window) <refresh_all>: Don't
declare.
* tui/tui-regs.c (tui_data_window::refresh_all): Remove.
* tui/tui-data.h (struct tui_win_info) <refresh_all>: Don't
declare.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-io.c (tui_cont_sig): Don't call wrefresh.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (_initialize_tui_stack): Move later.
Remove unnecessary forward declarations.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_locator_window::set_locator_fullname): Call
rerender.
(tui_update_locator_fullname, tui_show_frame_info): Don't call
tui_show_locator_content.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_show_locator_content): Move lower. Rewrite.
(tui_locator_window::rerender): Rewrite using body of previous
tui_show_locator_content.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-stack.h (struct tui_locator_window) <set_locator_info,
set_locator_fullname>: New methods.
* tui/tui-stack.c (tui_locator_window::set_locator_fullname):
Rename from tui_set_locator_fullname.
(tui_locator_window::set_locator_info): Rename from
tui_set_locator_info. Return bool.
(tui_update_locator_fullname, tui_show_frame_info): Update.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_layout): Don't call tui_refresh_all.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_gen_win_info::refresh_window): Don't
call touchwin.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (box_win): Assume win_info and
win_info->handle cannot be NULL.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_item_window) <rerender,
refresh_window>: Declare.
* tui/tui-regs.c (tui_data_window::display_registers_from): Call
resize.
(tui_data_item_window::rerender): Rename from
tui_display_register.
(tui_data_item_window::refresh_window): New method.
* tui/tui-layout.c (tui_gen_win_info::resize): Do nothing on
no-op.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <regs_content,
regs_column_count, current_group>: Move later. Now private.
<get_current_group>: New method.
* tui/tui-regs.c (tui_reg_command): Update.
* tui/tui-layout.c (tui_set_layout): Update.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_data_window::display_registers_from_line)
(tui_data_window::rerender): Don't call
check_and_display_highlight_if_needed.
(tui_data_window::refresh_all): Remove call to
erase_data_content.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_data_window::last_regs_line_no)
(tui_data_window::display_registers_from)
(tui_data_window::display_reg_element_at_line)
(tui_data_window::display_registers_from_line): Remove checks of
"empty".
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <display_all_data>:
Don't declare.
* tui/tui-regs.c (tui_data_window::show_registers): Call
rerender.
(tui_data_window::rerender): Rename from display_all_data.
(tui_data_window::rerender): Remove old implementation.
2019-08-30 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_data_window::display_all_data): Change
text.
* tui/tui-data.h (NO_DATA_STRING): Remove define.
Fix PR win32/24284: tcp_auto_retry doesn't work in MinGW This was reported by Bernhard Wodok, along with a patch to fix the issue. I adjusted the patch a bit, and I'm submitting the patch on his behalf. According to Bernhard, the issue can be reproduced by doing: 1. start gdb 2. enter 'target remote :2345' 3. observe that it throws a "connection refused" error immediately instead of waiting and throwing a timeout error I.e., I believe it can be reproduced by our current tests, which is why I'm not proposing any extra tests here (well, I don't use nor have any Windows system to test this, so...). The problem happens because, on ser-tcp:wait_for_connect, we call 'gdb_select' passing 0 as its first argument, which, when using MinGW, ends up using the 'gdb_select' version from mingw-hdep.c, and when the first argument is 0 this means that WaitForMultipleObjects will be called with 0 as its first argument as well. According to the MS API docs, this is forbidden: https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects The proposed fix is simple: we just call Sleep when N == 0 (and when TIMEOUT is non-NULL), and return 0. It makes sense to me. Both Bernhard and Paul Carroll confirmed that the fix works. I'm Cc'ing Bernhard in case you have any questions about the patch. OK? gdb/ChangeLog: 2019-08-29 Bernhard Wodok <barto@gmx.net> Sergio Durigan Junior <sergiodj@redhat.com> PR win32/24284 * mingw-hdep.c (gdb_select): Handle case when 'n' is zero.
2019-08-27 17:40:31 +02:00
2019-08-29 Bernhard Wodok <barto@gmx.net>
Sergio Durigan Junior <sergiodj@redhat.com>
PR win32/24284
* mingw-hdep.c (gdb_select): Handle case when 'n' is zero.
2019-08-28 Andrew Burgess <andrew.burgess@embecosm.com>
* symtab.c (search_symbols): Don't include MODULE_DOMAIN symbols
when searching for types.
2019-08-28 Andrew Burgess <andrew.burgess@embecosm.com>
* f-lang.c (f_language_defn): Use f_print_typedef.
* f-lang.h (f_print_typedef): Declare.
* f-typeprint.c (f_print_typedef): Define.
2019-08-27 Christian Biesinger <cbiesinger@google.com>
* nat/linux-namespaces.c (mnsh_main): Initialize fd (to -1).
gdb: Add new -n flag to some info commands The 'info variables', its alias 'whereis', and 'info functions' all include non-debug symbols in the output by default. The list of non-debug symbols can sometimes be quite long, resulting in the debug symbol based results being scrolled off the screen. This commit adds a '-n' flag to all of the commands listed above that excludes the non-debug symbols from the results, leaving just the debug symbol based results. gdb/ChangeLog: * cli/cli-utils.c (info_print_options_defs): Delete. (make_info_print_options_def_group): Delete. (extract_info_print_options): Delete. (info_print_command_completer): Delete. (info_print_args_help): Add extra parameter, and optionally include text about -n flag. * cli/cli-utils.h (struct info_print_options): Delete. (extract_info_print_options): Delete declaration. (info_print_command_completer): Delete declaration. (info_print_args_help): Add extra parameter, extend header comment. * python/python.c (gdbpy_rbreak): Pass additional parameter to search_symbols. * stack.c (struct info_print_options): New type. (info_print_options_defs): New file scoped variable. (make_info_print_options_def_group): New static function. (info_print_command_completer): New static function. (info_locals_command): Update to use new local functions. (info_args_command): Likewise. (_initialize_stack): Add extra parameter to calls to info_print_args_help. * symtab.c (search_symbols): Add extra parameter, use this to possibly excluse non-debug symbols. (symtab_symbol_info): Add extra parameter, which is passed on to search_symbols. (struct info_print_options): New type. (info_print_options_defs): New file scoped variable. (make_info_print_options_def_group): New static function. (info_print_command_completer): New static function. (info_variables_command): Update to use local functions, and pass extra parameter through to symtab_symbol_info. (info_functions_command): Likewise. (info_types_command): Pass additional argument through to symtab_symbol_info. (rbreak_command): Pass extra argument to search_symbols. (_initialize_symtab): Add extra arguments for calls to info_print_args_help, and update help text for 'info variables', 'whereis', and 'info functions' commands. * symtab.h (search_symbols): Add extra argument to declaration. * NEWS: Mention new flags. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Add information about the -n flag to "info variables" and "info functions". gdb/testsuite/ChangeLog: * gdb.base/info-fun.exp: Extend to test the -n flag for 'info functions'. Reindent as needed. * gdb.base/info-var-f1.c: New file. * gdb.base/info-var-f2.c: New file. * gdb.base/info-var.exp: New file. * gdb.base/info-var.h: New file.
2019-07-22 17:53:06 +02:00
2019-08-27 Andrew Burgess <andrew.burgess@embecosm.com>
* cli/cli-utils.c (info_print_options_defs): Delete.
(make_info_print_options_def_group): Delete.
(extract_info_print_options): Delete.
(info_print_command_completer): Delete.
(info_print_args_help): Add extra parameter, and optionally
include text about -n flag.
* cli/cli-utils.h (struct info_print_options): Delete.
(extract_info_print_options): Delete declaration.
(info_print_command_completer): Delete declaration.
(info_print_args_help): Add extra parameter, extend header
comment.
* python/python.c (gdbpy_rbreak): Pass additional parameter to
search_symbols.
* stack.c (struct info_print_options): New type.
(info_print_options_defs): New file scoped variable.
(make_info_print_options_def_group): New static function.
(info_print_command_completer): New static function.
(info_locals_command): Update to use new local functions.
(info_args_command): Likewise.
(_initialize_stack): Add extra parameter to calls to
info_print_args_help.
* symtab.c (search_symbols): Add extra parameter, use this to
possibly excluse non-debug symbols.
(symtab_symbol_info): Add extra parameter, which is passed on to
search_symbols.
(struct info_print_options): New type.
(info_print_options_defs): New file scoped variable.
(make_info_print_options_def_group): New static function.
(info_print_command_completer): New static function.
(info_variables_command): Update to use local functions, and pass
extra parameter through to symtab_symbol_info.
(info_functions_command): Likewise.
(info_types_command): Pass additional argument through to
symtab_symbol_info.
(rbreak_command): Pass extra argument to search_symbols.
(_initialize_symtab): Add extra arguments for calls to
info_print_args_help, and update help text for 'info variables',
'whereis', and 'info functions' commands.
* symtab.h (search_symbols): Add extra argument to declaration.
* NEWS: Mention new flags.
2019-08-26 Christian Biesinger <cbiesinger@google.com>
* symtab.c (lookup_static_symbol): Call the new function (and move
it down to be next to lookup_global_symbol).
(struct global_sym_lookup_data): Add block_enum member and rename to...
(struct global_or_static_sym_lookup_data): ...this.
(lookup_symbol_global_iterator_cb): Pass block_index instead of
GLOBAL_BLOCK to lookup_symbol_in_objfile and rename to...
(lookup_symbol_global_or_static_iterator_cb): ...this.
(lookup_global_or_static_symbol): New function.
(lookup_global_symbol): Call new function.
2019-08-26 Tom de Vries <tdevries@suse.de>
PR c++/24852
* break-catch-throw.c (fetch_probe_arguments): Improve error mesage
when pc_probe.prob == NULL.
2019-08-25 Simon Marchi <simon.marchi@efficios.com>
* dwarf2read.c (dw2_debug_names_iterator::next): Rename local
variable symbol_linkage to symbol_linkage_.
2019-08-25 Simon Marchi <simon.marchi@efficios.com>
* dwarf2read.c (dw2_debug_names_iterator::next): Use enum to
represent whether the symbol is static, dynamic, or we don't
know.
2019-08-25 Yoshinori Sato <ysato@users.sourceforge.jp>
* gdb/rx-tdep.c (rx_register_names): New.
(rx_register_name): Delete.
(rx_psw_type): Delete.
(rx_fpsw_type): Delete.
(rx_register_type): Delete.
(rx_gdbarch_init): Convert target-descriptions.
(_initialize_rx_tdep): Add initialize_tdesc_rx.
* gdb/features/Makefile: Add rx.xml.
* gdb/features/rx.xml: New.
* gdb/features/rx.c: Generated.
* gdb/NEWS: Mention target description support.
Fix compile warning in symtab.c My compiler (g++ 8.2) can't tell that *bsc_ptr and *slot_ptr are only used in the cases when it does get initialized. Just initialize the vars earlier to avoid the warning, there does not seem to be a downside to it. ../../gdb/symtab.c: In function ‘block_symbol lookup_static_symbol(const char*, domain_enum)’: ../../gdb/symtab.c:1366:11: warning: ‘slot’ may be used uninitialized in this function [-Wmaybe-uninitialized] xfree (slot->value.not_found.name); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../gdb/symtab.c:2578:29: note: ‘slot’ was declared here struct symbol_cache_slot *slot; ^~~~ ../../gdb/symtab.c:1405:3: warning: ‘bsc’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (bsc == NULL) ^~ ../../gdb/symtab.c:2577:30: note: ‘bsc’ was declared here struct block_symbol_cache *bsc; ^~~ ../../gdb/symtab.c: In function ‘block_symbol lookup_global_symbol(const char*, const block*, domain_enum)’: ../../gdb/symtab.c:1366:11: warning: ‘slot’ may be used uninitialized in this function [-Wmaybe-uninitialized] xfree (slot->value.not_found.name); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../gdb/symtab.c:2658:29: note: ‘slot’ was declared here struct symbol_cache_slot *slot; ^~~~ ../../gdb/symtab.c:1409:14: warning: ‘bsc’ may be used uninitialized in this function [-Wmaybe-uninitialized] ++bsc->collisions; ~~~~~^~~~~~~~~~ ../../gdb/symtab.c:2657:30: note: ‘bsc’ was declared here struct block_symbol_cache *bsc; ^~~ gdb/ChangeLog: 2019-08-22 Christian Biesinger <cbiesinger@google.com> * symtab.c (symbol_cache_lookup): Always initialize *bsc_ptr and *slot_ptr.
2019-08-09 21:25:15 +02:00
2019-08-22 Christian Biesinger <cbiesinger@google.com>
* symtab.c (symbol_cache_lookup): Always initialize *bsc_ptr and
*slot_ptr.
2019-08-23 Sergio Durigan Junior <sergiodj@redhat.com>
* configure.ac: Don't check for 'dlfcn.h' (moved to
gdbsupport/common.m4).
* Makefile.in (COMMON_SFILES): Move 'gdb-dlfcn.c' to
'gdbsupport/'.
(HFILES_NO_SRCDIR): Likewise, for 'gdb-dlfcn.h'.
* compile/compile-c-support.c: Include
'gdbsupport/gdb-dlfcn.h'.
* gdbsupport/common.m4: Check for 'dlfcn.h'.
* gdb-dlfcn.c: Move to...
* gdbsupport/gdb-dlfcn.c: ... here.
* gdb-dlfcn.h: Move to...
* gdbsupport/gdb-dlfcn.h: ... here.
2019-08-23 Sandra Loosemore <sandra@codesourcery.com>
* nios2-tdep.c (struct reg_value): Improve comments. Make
the offset field signed.
2019-08-22 Christian Biesinger <cbiesinger@google.com>
* python/lib/gdb/__init__.py (_execute_file): New function.
* python/python.c (python_run_simple_file): Call gdb._execute_file
on Windows.
2019-08-22 Andrew Burgess <andrew.burgess@embecosm.com>
* f-exp.y (yylex): Remove is_a_field_of_this local variable, and
all uses as this was never set to anything but a zero value.
2019-08-21 Bogdan Harjoc <harjoc@gmail.com>
* cli/cli-cmds.c (with_command_1): Error out if no arguments.
2019-08-21 Christian Biesinger <cbiesinger@google.com>
* tui/tui-data.h (tui_gen_win_info): Add an =default
move constructor, required by some GCC versions.
2019-08-21 Jinke Fan <fanjinke51@yeah.net>
* go32-nat.c (go32_sysinfo): Add hygon_p.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <last_regs_line_no,
line_from_reg_element_no, first_reg_element_no_inline,
display_all_data, delete_data_content_windows,
erase_data_content>: Now private.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (box_win): Change type of highlight_flag.
(tui_unhighlight_win, tui_highlight_win)
(tui_win_info::make_window): Update.
* tui/tui-data.h (HILITE, NO_HILITE): Remove.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (PROC_PREFIX, LINE_PREFIX, PC_PREFIX)
(MIN_LINE_WIDTH, MIN_PROC_WIDTH, MAX_TARGET_WIDTH)
(MAX_PID_WIDTH): Move to tui-stack.c.
* tui/tui-stack.c (PROC_PREFIX, LINE_PREFIX, PC_PREFIX)
(MIN_LINE_WIDTH, MIN_PROC_WIDTH, MAX_TARGET_WIDTH)
(MAX_PID_WIDTH): Move from tui-data.h.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_make_window): Don't declare.
* tui/tui-wingeneral.c (box_win): Change type of win_info.
(box_win): Update.
(tui_gen_win_info::make_window): Rename from tui_make_window.
(tui_win_info::make_window): New method.
(tui_gen_win_info::make_visible): Update.
* tui/tui-source.c (tui_source_window::set_contents): Update.
* tui/tui-regs.c (tui_data_window::show_register_group): Update.
(tui_data_window::display_registers_from): Update.
* tui/tui-layout.c (tui_gen_win_info::resize): Update.
* tui/tui-data.h (struct tui_gen_win_info) <make_window>:
Declare.
<can_box>: Remove.
<title>: Remove.
(struct tui_win_info) <make_window>: Declare.
<can_box>: Now virtual.
<title>: New member.
* tui/tui-data.c (~tui_gen_win_info): Don't free title.
* tui/tui-command.c (tui_cmd_window::resize): Update.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <display_regs>: Remove.
* tui/tui-regs.c (tui_data_window::show_registers): Update.
(tui_data_window::check_register_values): Update.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window): Use
DISABLE_COPY_AND_ASSIGN.
<regs_content>: Change type, removing unique_ptr.
<tui_data_window>: Add move constructor.
* tui/tui-regs.c (tui_data_window::show_registers)
(tui_data_window::show_register_group)
(tui_data_window::display_registers_from)
(tui_data_window::display_registers_from)
(tui_data_window::first_data_item_displayed)
(tui_data_window::delete_data_content_windows)
(tui_data_window::rerender, tui_data_window::refresh_window)
(tui_data_window::check_register_values): Update.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <show_registers,
show_register_group>: Declare.
(tui_show_register_group): Don't declare.
* tui/tui-regs.c (tui_data_window::show_registers): Rename from
tui_show_registers.
(tui_data_window::show_register_group): Rename from
tui_show_register_group.
(tui_data_window::check_register_values, tui_reg_command):
Update.
* tui/tui-layout.c (tui_set_layout): Update.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_window) <check_register_values>:
Declare.
(tui_check_register_values): Don't declare.
* tui/tui-regs.c (tui_data_window::check_register_values): Rename
from tui_check_register_values.
* tui/tui-hooks.c (tui_register_changed): Update.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_reg_layout): Move later.
(tui_show_registers): Don't enable TUI mode or change layout.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_item_window)
<~tui_data_item_window>: Remove.
<content>: Now a unique_xmalloc_ptr.
* tui/tui-regs.c (tui_register_format): Return a
unique_xmalloc_ptr.
(tui_get_register): Update.
(~tui_data_item_window): Remove.
(tui_data_window::display_registers_from, tui_display_register):
Update.
* tui/tui-io.h (tui_expand_tabs): Update.
* tui/tui-io.c (tui_expand_tabs): Return a unique_xmalloc_ptr.
Remove "col" parameter.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_item_window) <value>: Remove
field.
* tui/tui-regs.c (~tui_data_item_window): Update.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_register_format, tui_get_register): Move
earlier.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_reg_command): Remove NULL check.
2019-08-20 Tom Tromey <tom@tromey.com>
* tui/tui-source.h (struct tui_source_window): Update.
* tui/tui-regs.c (tui_show_registers): Update.
* tui/tui-disasm.h (struct tui_disasm_window): Update.
* tui/tui-data.h (NO_SRC_STRING, NO_DISASSEM_STRING)
(NO_REGS_STRING): Remove defines.
2019-08-20 Conrad Meyer <cem@FreeBSD.org>
* remote.c (remote_target::remote_btrace_maybe_reopen): Avoid
unnecessary thread walk if remote doesn't support the packet.
2019-08-19 Tom Tromey <tromey@adacore.com>
* python/py-value.c (value_has_field): Fix indentation.
2019-08-19 Tom Tromey <tromey@adacore.com>
* printcmd.c (do_one_display, info_display_command): Update.
* block.h (contained_in): Return bool. Add allow_nested
parameter.
* block.c (contained_in): Return bool. Add allow_nested
parameter.
2019-08-19 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Disallow the combination of -static-libstdc++ and
source highlight.
* source-cache.c (get_language_name): Handle rust.
(source_cache::get_source_lines): Ignore highlighting exceptions.
Remove the TUI execution info window The TUI execution info window is unusual in that it is always linked to a source or disassembly window. Even updates of its content are handled by the source window, so it really has no life of its own. This patch removes this window entirely and puts its functionality directly into the source window. This simplifies the code somewhat. This is a user-visible change, because now the box around the source (or disassembly) window encloses the execution info as well. I consider this an improvement as well, though. Note that this patch caused ncurses to start emitting the "CSI Z" sequence, so I've added this to the test suite terminal implementation. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui.h (enum tui_win_type) <EXEC_INFO_WIN>: Remove. * tui/tui-winsource.h (struct tui_exec_info_window): Remove. (struct tui_source_window_base) <make_visible, refresh_window, resize>: Remove methods. <execution_info>: Remove field. * tui/tui-winsource.c (tui_source_window_base::do_erase_source_content) (tui_show_source_line, tui_source_window_base) (~tui_source_window_base): Update. (tui_source_window_base::resize) (tui_source_window_base::make_visible) (tui_source_window_base::refresh_window): Remove. (tui_source_window_base::update_exec_info): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * tui/tui-disasm.c (tui_disasm_window::set_contents): Update. gdb/testsuite/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * lib/tuiterm.exp (_csi_Z): New proc. * gdb.tui/basic.exp: Update window positions. * gdb.tui/empty.exp: Update window positions.
2019-07-13 02:18:10 +02:00
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui.h (enum tui_win_type) <EXEC_INFO_WIN>: Remove.
* tui/tui-winsource.h (struct tui_exec_info_window): Remove.
(struct tui_source_window_base) <make_visible, refresh_window,
resize>: Remove methods.
<execution_info>: Remove field.
* tui/tui-winsource.c (tui_source_window_base::do_erase_source_content)
(tui_show_source_line, tui_source_window_base)
(~tui_source_window_base): Update.
(tui_source_window_base::resize)
(tui_source_window_base::make_visible)
(tui_source_window_base::refresh_window): Remove.
(tui_source_window_base::update_exec_info): Update.
* tui/tui-source.c (tui_source_window::set_contents): Update.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Update.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-hooks.c (tui_remove_hooks): Don't set
deprecated_query_hook.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_windows_with_addr)
(tui_update_source_windows_with_line): Update.
* tui/tui-source.h (struct tui_source_window)
<show_symtab_source>: Declare.
(tui_show_symtab_source): Don't declare.
* tui/tui-source.c (tui_show_symtab_source): Rename from
tui_show_symtab_source.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<set_contents>: Declare.
* tui/tui-winsource.c
(tui_source_window_base::update_source_window_as_is): Update.
* tui/tui-source.h (struct tui_source_window) <set_contents>:
Declare.
(tui_set_source_content): Don't declare.
* tui/tui-source.c (tui_source_window::set_contents): Rename from
tui_set_source_content.
* tui/tui-disasm.h (struct tui_disasm_window) <set_contents>:
Declare.
(tui_set_disassem_content): Don't declare.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Rename from
tui_set_disassem_content.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<update_breakpoint_info>: Declare.
(tui_update_breakpoint_info): Don't declare.
* tui/tui-winsource.c (tui_source_window_base::update_source_window_as_is)
(tui_update_all_breakpoint_info): Update.
(tui_source_window_base::update_breakpoint_info): Rename from
tui_update_breakpoint_info.
(tui_source_window_base::update_exec_info): Update.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<update_source_window>: Declare.
(tui_update_source_window): Don't declare.
* tui/tui-winsource.c
(tui_source_window_base::update_source_window): Rename from
tui_update_source_window.
(tui_source_window_base::rerender): Update.
* tui/tui-source.c (tui_source_window::maybe_update): Update.
* tui/tui-disasm.c (tui_show_disassem)
(tui_show_disassem_and_update_source)
(tui_disasm_window::maybe_update): Update.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<update_source_window_as_is>: Declare.
(tui_update_source_window_as_is): Don't declare.
* tui/tui-winsource.c (tui_update_source_window): Update
(tui_source_window_base::update_source_window_as_is): Rename from
tui_update_source_window_as_is.
(tui_source_window_base::refill): Update.
* tui/tui-source.c (tui_show_symtab_source): Update.
* tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical):
Update.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_update_source_window)
(tui_update_source_window_as_is): Remove "noerror" parameter.
* tui/tui-winsource.c (tui_update_source_window)
(tui_update_source_window_as_is): Remove "noerror" parameter.
(tui_update_source_windows_with_addr)
(tui_update_source_windows_with_line)
(tui_source_window_base::rerender)
(tui_source_window_base::refill): Update.
* tui/tui-source.h (tui_set_source_content)
(tui_show_symtab_source): Remove "noerror" parameter.
* tui/tui-source.c (tui_set_source_content): Remove "noerror"
parameter.
(tui_show_symtab_source): Likewise.
(tui_source_window::maybe_update): Update.
* tui/tui-disasm.c (tui_show_disassem)
(tui_show_disassem_and_update_source)
(tui_disasm_window::do_scroll_vertical)
(tui_disasm_window::maybe_update): Update.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_is_window_visible): Update.
* tui/tui-wingeneral.c (tui_make_window)
(tui_gen_win_info::make_visible, tui_refresh_all): Update.
* tui/tui-win.c (window_name_completer, tui_refresh_all_win)
(tui_set_focus_command, tui_all_windows_info, update_tab_width)
(tui_set_win_height_command, parse_scrolling_args): Update.
* tui/tui-source.c (tui_source_window::style_changed): Update.
* tui/tui-regs.c (tui_show_registers)
(tui_data_window::first_data_item_displayed)
(tui_data_window::delete_data_content_windows)
(tui_check_register_values, tui_reg_command): Update.
* tui/tui-disasm.c (tui_show_disassem): Update.
* tui/tui-data.h (struct tui_gen_win_info) <is_visible>: New
method.
<is_visible>: Remove field.
* tui/tui-data.c (tui_next_win, tui_prev_win)
(tui_delete_invisible_windows): Update.
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<m_has_locator>: Remove.
* tui/tui-layout.c (show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Update.
2019-08-16 Alan Hayward <alan.hayward@arm.com>
* NEWS (Other MI changes): New subsection.
* aarch64-tdep.c (aarch64_get_pc_address_flags): New function.
(aarch64_gdbarch_init): Add aarch64_get_pc_address_flags.
* arch-utils.c (default_get_pc_address_flags): New function.
* arch-utils.h (default_get_pc_address_flags): New declaration.
* gdbarch.sh: Add get_pc_address_flags.
* gdbarch.c: Regenerate.
* gdbarch.h: Likewise.
* stack.c (print_pc): New function.
(print_frame_info) (print_frame): Call print_pc.
2019-08-16 Tom de Vries <tdevries@suse.de>
* maint.c (maintenance_info_sections): Also handle !ALLOBJ case using
print_objfile_section_info.
TUI resize unification The TUI currently has two different ways to resize a window: the resize method, and the methods make_invisible_and_set_new_height and make_visible_with_new_height. There's no deep reason to have two different ways to resize a window, so this patch unifies them, leaving just the "resize" method. This also changes the locator to be handled more like an ordinary window and less like an adjunct of the associated source window. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-io.c (tui_puts_internal): Check TUI_CMD_WIN before calling update_cmdwin_start_line. * tui/tui-winsource.h (struct tui_source_window_base) <do_make_visible_with_new_height, set_new_height>: Don't declare. <rerender>: Declare. * tui/tui-winsource.c (tui_source_window_base::update_tab_width): Call rerender. (tui_source_window_base::set_new_height): Remove. (tui_source_window_base::rerender): Rename from do_make_visible_with_new_height. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use resize method. (tui_win_info::make_invisible_and_set_new_height) (tui_win_info::make_visible_with_new_height): Remove. * tui/tui-stack.h (struct tui_locator_window) <rerender>: Declare. * tui/tui-stack.c (tui_locator_window::rerender): New method. * tui/tui-regs.h (struct tui_data_window) <set_new_height, do_make_visible_with_new_height>: Don't declare. <rerender>: Declare. * tui/tui-regs.c (tui_data_window::rerender): Rename from set_new_height. (tui_data_window::do_make_visible_with_new_height): Remove. * tui/tui-layout.c (show_source_disasm_command, show_data): Don't call tui_show_locator_content. (tui_gen_win_info::resize): Call rerender. (show_source_or_disasm_and_command): Don't call tui_show_locator_content. * tui/tui-data.h (struct tui_gen_win_info) <rerender>: New method. (struct tui_win_info) <rerender>: Declare. <set_new_height, make_invisible_and_set_new_height, make_visible_with_new_height>: Don't declare. * tui/tui-data.c (tui_win_list::rerender): New method. * tui/tui-command.h (struct tui_cmd_window) <do_make_visible_with_new_height>: Don't declare. * tui/tui-command.c (tui_cmd_window::do_make_visible_with_new_height): Remove. gdb/testsuite/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * gdb.tui/empty.exp: Enable resizing tests.
2019-07-10 01:29:13 +02:00
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-io.c (tui_puts_internal): Check TUI_CMD_WIN before
calling update_cmdwin_start_line.
* tui/tui-winsource.h (struct tui_source_window_base)
<do_make_visible_with_new_height, set_new_height>: Don't declare.
<rerender>: Declare.
* tui/tui-winsource.c (tui_source_window_base::update_tab_width):
Call rerender.
(tui_source_window_base::set_new_height): Remove.
(tui_source_window_base::rerender): Rename from
do_make_visible_with_new_height.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use
resize method.
(tui_win_info::make_invisible_and_set_new_height)
(tui_win_info::make_visible_with_new_height): Remove.
* tui/tui-stack.h (struct tui_locator_window) <rerender>:
Declare.
* tui/tui-stack.c (tui_locator_window::rerender): New method.
* tui/tui-regs.h (struct tui_data_window) <set_new_height,
do_make_visible_with_new_height>: Don't declare.
<rerender>: Declare.
* tui/tui-regs.c (tui_data_window::rerender): Rename from
set_new_height.
(tui_data_window::do_make_visible_with_new_height): Remove.
* tui/tui-layout.c (show_source_disasm_command, show_data): Don't
call tui_show_locator_content.
(tui_gen_win_info::resize): Call rerender.
(show_source_or_disasm_and_command): Don't call
tui_show_locator_content.
* tui/tui-data.h (struct tui_gen_win_info) <rerender>: New
method.
(struct tui_win_info) <rerender>: Declare.
<set_new_height, make_invisible_and_set_new_height,
make_visible_with_new_height>: Don't declare.
* tui/tui-data.c (tui_win_list::rerender): New method.
* tui/tui-command.h (struct tui_cmd_window)
<do_make_visible_with_new_height>: Don't declare.
* tui/tui-command.c
(tui_cmd_window::do_make_visible_with_new_height): Remove.
2019-08-15 Tom Tromey <tromey@adacore.com>
* ada-exp.y (convert_char_literal): Handle "Q%c" encoding.
* ada-lang.c (ada_enum_name): Likewise.
2019-08-15 Christian Biesinger <cbiesinger@google.com>
* python/lib/gdb/__init__.py (GdbOutputFile): Rename to have a
leading underscore.
(GdbOutputErrorFile): Likewise.
(global scope): Adjust constructor calls to GdbOutput{,Error}File
accordingly.
(execute_unwinders): Rename to have a leading underscore.
(auto_load_packages): Likewise.
(global scope): Adjust call to auto_load_packages accordingly.
(GdbSetPythonDirectory): Likewise.
* python/py-unwind.c (pyuw_sniffer): Call _execute_unwinders
instead of execute_unwinders.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_layout, show_source_disasm_command)
(show_data): Don't change window visibility.
(tui_gen_win_info::resize): Remove special case for command
window. Use wresize, when available.
(show_source_or_disasm_and_command): Don't change window
visibility.
* tui/tui-command.h (struct tui_cmd_window) <resize>: Declare.
<make_visible>: New method.
* tui/tui-command.c (tui_cmd_window::resize): New method.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_iterator): New.
(struct tui_source_windows): New.
* tui/tui-winsource.c (tui_display_main): Update.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights)
(new_height_ok, parse_scrolling_args): Update.
* tui/tui-layout.c (show_layout, show_data): Update.
* tui/tui-data.h (tui_source_windows, tui_clear_source_windows)
(tui_add_to_source_windows): Don't declare.
* tui/tui-data.c (source_windows, tui_source_windows)
(tui_clear_source_windows, tui_add_to_source_windows): Remove.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base) <resize>:
Rename from reset.
* tui/tui-winsource.c (tui_source_window_base::resize): Rename.
* tui/tui-layout.c (show_source_disasm_command, show_data):
Update.
(tui_gen_win_info::resize): Rename.
(show_source_or_disasm_and_command): Update.
* tui/tui-data.h (struct tui_gen_win_info) <resize>: Rename from
reset.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_initialize_static_data): Remove.
* tui/tui-interp.c (tui_interp::init): Don't call
tui_initialize_static_data.
* tui/tui-data.h (tui_initialize_static_data): Don't declare.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (tui_default_win_viewport_height): Don't
examine tui_win_list.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_clear_source_content): Don't declare.
* tui/tui-winsource.c (tui_update_source_window_as_is): Don't call
tui_clear_source_content.
(tui_clear_source_content): Remove.
(tui_source_window_base::do_erase_source_content): Hoist call to
content.clear().
* tui/tui-stack.c (tui_show_frame_info): Don't call
tui_clear_source_content.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<do_erase_source_content>: New method.
<erase_source_content>: New method.
(tui_erase_source_content): Don't declare.
* tui/tui-winsource.c (tui_clear_source_content): Update.
(tui_source_window_base::do_erase_source_content): Rename from
tui_erase_source_content.
(tui_source_window_base::show_source_content): Update.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Update.
* tui/tui-source.h (struct tui_source_window)
<erase_source_content>: New method.
* tui/tui-disasm.h (struct tui_disasm_window)
<erase_source_content>: New method.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_alloc_source_buffer): Don't declare.
(struct tui_source_element): Add DISABLE_COPY_AND_ASSIGN, and move
constructor.
* tui/tui-winsource.c (tui_alloc_source_buffer): Remove.
* tui/tui-source.c (tui_set_source_content): Update.
* tui/tui-disasm.c (tui_set_disassem_content): Update.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_line_is_displayed): Don't declare.
* tui/tui-winsource.c (tui_line_is_displayed): Move to
tui-source.c.
* tui/tui-source.h (struct tui_source_window) <line_is_displayed>:
Declare.
* tui/tui-source.c (tui_source_window::line_is_displayed): New
method.
(tui_source_window::maybe_update): Update.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_addr_is_displayed): Don't declare.
* tui/tui-winsource.c (tui_addr_is_displayed): Move to
tui-disasm.c.
* tui/tui-disasm.h (struct tui_disasm_window) <addr_is_displayed>:
Declare.
* tui/tui-disasm.c (tui_disasm_window::addr_is_displayed): New
method.
(tui_disasm_window::maybe_update): Update.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<maybe_update>: Declare.
* tui/tui-stack.c (tui_show_frame_info): Call maybe_update
method.
* tui/tui-source.h (struct tui_source_window) <maybe_update>:
Declare.
* tui/tui-source.c (tui_source_window::maybe_update): New method.
* tui/tui-disasm.h (struct tui_disasm_window) <maybe_update>:
Declare.
* tui/tui-disasm.c (tui_disasm_window::maybe_update): New method.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_make_status_line): Use string constructor.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c: Include tui-stack.h.
* tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN)
(struct tui_locator_window): Move from tui-data.h.
* tui/tui-stack.c (_locator, tui_locator_win_info_ptr)
(tui_initialize_static_data): Move from tui-data.c.
* tui/tui-data.h (MAX_LOCATOR_ELEMENT_LEN)
(struct tui_locator_window): Move to tui-stack.c.
* tui/tui-data.c (_locator, tui_locator_win_info_ptr)
(tui_initialize_static_data): Move to tui-stack.c.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_disasm_command)
(show_source_or_disasm_and_command): Use make_visible method, not
tui_make_window.
* tui/tui-command.h (struct tui_cmd_window) <make_visible>:
Remove.
2019-08-15 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_make_window): Update.
* tui/tui-wingeneral.c (tui_make_window): Remove "box_it"
parameter.
(tui_gen_win_info::make_visible): Update.
* tui/tui-regs.c (tui_data_window::display_registers_from):
Update.
* tui/tui-layout.c (show_source_disasm_command)
(show_source_or_disasm_and_command): Update.
* tui/tui-data.h (struct tui_gen_win_info) <can_box>: New method.
(enum tui_box): Remove.
(struct tui_win_info) <can_box>: New method.
* tui/tui-command.h (struct tui_cmd_window) <can_box>: New
method.
2019-08-15 Tom de Vries <tdevries@suse.de>
* linux-nat-trad.c: Include gdbarch.h.
2019-08-14 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aarch64_analyze_prologue): Allow any valid
register sizes.
2019-08-14 Tom Tromey <tromey@adacore.com>
* darwin-nat.c: Include gdbarch.h.
* darwin-nat-info.c: Include gdbarch.h.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_gen_win_info) <last_visible_line>:
Remove.
* tui/tui-data.c (tui_initialize_static_data): Update.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_exec_info_window)
<~tui_exec_info_window, maybe_allocate_content, get_content,
m_content>: Remove.
(struct tui_source_window_base) <set_exec_info_content,
show_exec_info_content>: Don't declare.
* tui/tui-winsource.c
(tui_exec_info_window::maybe_allocate_content): Remove.
(tui_source_window_base::update_exec_info): Rename from
set_exec_info_content.
(tui_source_window_base::show_exec_info_content)
(tui_source_window_base::update_exec_info): Remove.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_clear_exec_info_content): Don't
declare.
* tui/tui-winsource.c (tui_update_source_window_as_is)
(tui_update_source_windows_with_addr, tui_erase_source_content):
Update.
(tui_clear_exec_info_content): Remove.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_erase_exec_info_content): Don't
declare.
* tui/tui-winsource.c (tui_source_window_base::refresh_all): Don't
call tui_erase_exec_info_content.
(tui_clear_exec_info_content): Rename from
tui_erase_exec_info_content.
(tui_clear_exec_info_content): Delete.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<show_exec_info_content>: Declare.
(tui_show_exec_info_content): Don't declare.
* tui/tui-winsource.c
(tui_source_window_base::show_exec_info_content): Rename from
tui_show_exec_info_content.
(tui_source_window_base::update_exec_info): Update.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element)
(TUI_BP_HIT_POS, TUI_BP_BREAK_POS, TUI_EXEC_POS)
(TUI_EXECINFO_SIZE, tui_exec_info_content): Move ...
* tui/tui-winsource.h (enum tui_bp_flag, tui_bp_flags, struct
tui_source_element, TUI_BP_HIT_POS, TUI_BP_BREAK_POS)
(TUI_EXEC_POS, TUI_EXECINFO_SIZE, tui_exec_info_content):
... here.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<update_exec_info>: Declare.
(tui_update_exec_info): Don't declare.
* tui/tui-winsource.c (tui_update_source_window_as_is)
(tui_source_window_base::refresh_all)
(tui_update_all_breakpoint_info): Update.
(tui_source_window_base::update_exec_info): Rename from
tui_update_exec_info.
* tui/tui-stack.c (tui_show_frame_info): Update.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<set_exec_info_content>: Declare.
(tui_set_exec_info_content): Don't declare.
* tui/tui-winsource.c
(tui_source_window_base::set_exec_info_content): Rename from
tui_set_exec_info_content.
(tui_update_exec_info): Update.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<show_source_content>: Declare.
(tui_show_source_content): Don't declare.
* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
(tui_source_window_base::show_source_content): Rename from
tui_show_source_content.
(tui_source_window_base::refresh_all): Update.
* tui/tui-layout.c (show_source_disasm_command)
(show_source_or_disasm_and_command): Update.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_erase_source_content)
(tui_show_source_content, tui_source_window_base::refresh_all):
Update.
* tui/tui-wingeneral.h
(tui_check_and_display_highlight_if_needed): Don't declare.
* tui/tui-wingeneral.c
(tui_win_info::check_and_display_highlight_if_needed): Rename from
check_and_display_highlight_if_needed.
* tui/tui-win.c (tui_rehighlight_all)
(tui_win_info::make_visible_with_new_height): Update.
* tui/tui-regs.c (tui_data_window::display_registers_from_line)
(tui_data_window::erase_data_content)
(tui_data_window::display_all_data): Update.
* tui/tui-data.h (struct tui_win_info)
<check_and_display_highlight_if_needed>: Declare.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_resize_all): Call
tui_delete_invisible_windows.
* tui/tui-layout.c (show_layout): Call
tui_delete_invisible_windows.
* tui/tui-data.h (tui_delete_invisible_windows): Declare.
* tui/tui-data.c (tui_delete_invisible_windows): New function.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.c (tui_show_disassem): Add assertion. Don't call
tui_add_win_to_layout.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.h (tui_default_win_height): Don't declare.
* tui/tui-layout.c (tui_default_win_height): Now static.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_layout): Unify all layout cases into a
single switch.
(show_source_disasm_command, show_source_or_disasm_and_command):
Don't check current layout.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (make_all_visible): Remove.
(tui_make_all_invisible): Simplify.
* tui/tui-layout.c (tui_make_all_invisible): Move from
tui-wingeneral.c; simplify.
(show_layout): Hoist call to tui_make_all_invisible.
(show_data): Don't call tui_make_all_invisible.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_make_all_visible): Don't declare.
* tui/tui-wingeneral.c (tui_make_all_visible): Remove.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (current_layout, tui_current_layout): Move from
tui-data.c.
(show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Don't use
tui_set_current_layout_to.
* tui/tui-data.h (tui_set_current_layout_to): Don't declare.
* tui/tui-data.c (current_layout, tui_current_layout): Move to
tui-layout.c.
(tui_set_current_layout_to): Remove.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (tui_set_layout): Update.
* tui/tui-data.h (struct tui_layout_def): Remove.
(tui_layout_def): Don't declare.
* tui/tui-data.c (layout_def): Remove.
(tui_layout_def): Remove.
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<clear_detail>: No longer "override".
* tui/tui-regs.h (struct tui_data_window) <clear_detail>: Remove.
* tui/tui-regs.c (tui_data_window::clear_detail): Remove.
* tui/tui-data.h (struct tui_win_info) <clear_detail>: Remove.
* tui/tui-command.h (struct tui_cmd_window) <clear_detail>:
Remove.
* tui/tui-command.c (tui_cmd_window::clear_detail): Remove.
2019-08-13 Tom Tromey <tromey@adacore.com>
* tracepoint.c: Don't include readline.h or history.h.
2019-08-12 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Check for readline 7.
* NEWS: Mention readline 7 requirement.
* README: Update.
2019-08-12 Tom Tromey <tom@tromey.com>
* mingw-hdep.c (gdb_select): Remove readline hack.
2019-08-09 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* blockframe.c (find_pc_partial_function): Set *block to nullptr
when the function fails.
2019-08-09 Andreas Arnez <arnez@linux.ibm.com>
* s390-tdep.c (s390_type_align): New function.
(s390_gdbarch_init): Set it as type_align gdbarch method.
2019-08-09 Tom de Vries <tdevries@suse.de>
PR gdb/24591
* dwarf2read.c (dwarf2_fetch_die_loc_sect_off): Adjust pc_high and
pc_low with relocation offset.
2019-08-07 Tom Tromey <tromey@adacore.com>
* stack.c (print_frame_arg, read_frame_local, read_frame_arg)
(print_frame_args): Update.
* python/py-framefilter.c (py_print_single_arg, enumerate_args):
Update.
* mi/mi-cmd-stack.c (list_arg_or_local): Update.
* frame.h (struct frame_arg): Add initializers.
<error>: Now a unique_xmalloc_ptr.
AArch64 pauth: Indicate unmasked addresses in backtrace Armv8.3-a Pointer Authentication causes the function return address to be obfuscated on entry to some functions. GDB must unmask the link register in order to produce a backtrace. The following patch adds markers of [PAC] to the bracktrace, to indicate which addresses needed unmasking. This includes the backtrace when using MI. For example, consider the following backtrace: (gdb) bt 0 0x0000000000400490 in puts@plt () 1 0x00000000004005dc in foo ("hello") at cbreak-lib.c:6 2 0x0000000000400604 [PAC] in bar () at cbreak-lib.c:12 3 0x0000000000400620 [PAC] in main2 () at cbreak.c:17 4 0x00000000004005b4 in main () at cbreak-3.c:10 The functions in cbreak-lib use pointer auth, which masks the return address to the previous function, causing the addresses of bar (in the library) and main2 (in the main binary) to require unmasking in order to unwind the backtrace. An extra bool is added alongside the prev_pc in the frame structure. At the point at which the link register is unmasked, the AArch64 port calls into frame to sets the bool. This is the most efficient way of doing it. The marker is also added to the python frame printer, which is always printed if set. The marker is not explicitly exposed to the python code. I expect this will potentially cause issues with some tests in the testsuite when Armv8.3 pointer authentication is used. This should be fixed up in the the future once real hardware is available for full testsuite testing. gdb/ChangeLog: * NEWS: Expand the Pointer Authentication entry. * aarch64-tdep.c (aarch64_frame_unmask_address): Rename from this. (aarch64_frame_unmask_lr): ... to this. (aarch64_prologue_prev_register, aarch64_dwarf2_prev_register): Call aarch64_frame_unmask_lr. * frame.c (struct frame_info): Add "masked" variable. (frame_set_previous_pc_masked) (frame_get_pc_masked): New functions. (fprint_frame): Check for masked pc. * frame.h (frame_set_previous_pc_masked) (frame_get_pc_masked): New declarations. * python/py-framefilter.c (py_print_frame): Check for masked pc. * stack.c (print_frame): Check for masked pc. gdb/doc/ChangeLog: * gdb.texinfo (AArch64 Pointer Authentication): New subsection.
2019-08-07 10:47:57 +02:00
2019-08-07 Alan Hayward <alan.hayward@arm.com>
* NEWS: Expand the Pointer Authentication entry.
* aarch64-tdep.c (aarch64_frame_unmask_address): Rename from this.
(aarch64_frame_unmask_lr): ... to this.
(aarch64_prologue_prev_register, aarch64_dwarf2_prev_register):
Call aarch64_frame_unmask_lr.
* frame.c (struct frame_info): Add "masked" variable.
(frame_set_previous_pc_masked) (frame_get_pc_masked): New functions.
(fprint_frame): Check for masked pc.
* frame.h (frame_set_previous_pc_masked) (frame_get_pc_masked): New
declarations.
* python/py-framefilter.c (py_print_frame): Check for masked pc.
* stack.c (print_frame): Check for masked pc.
2019-08-06 Tom Tromey <tom@tromey.com>
* stabsread.c (patch_block_stabs, read_one_struct_field)
(read_enum_type): Use obstack_strndup.
* rust-exp.y (rust_parser::copy_name): Use obstack_strndup.
* gdb_obstack.h (obstack_strndup): Use obstack_strndup.
* dwarf2read.c (guess_full_die_structure_name)
(anonymous_struct_prefix): Use obstack_strndup.
* dbxread.c (cp_set_block_scope): Use obstack_strndup.
* c-exp.y (yylex): Use obstack_strndup.
* ada-exp.y (write_object_renaming, write_ambiguous_var)
(write_var_or_type): Use obstack_strndup.
2019-08-06 Tom Tromey <tom@tromey.com>
* symfile.c (reread_symbols): Use obstack_strdup.
* stabsread.c (read_type): Use obstack_strdup.
* gdb_obstack.h (obstack_strdup): New overload.
* dwarf2read.c (dwarf2_compute_name, create_dwo_unit_in_dwp_v1)
(create_dwo_unit_in_dwp_v2, build_error_marker_type)
(dwarf2_canonicalize_name): Use obstack_strdup.
* dbxread.c (read_dbx_symtab): Use obstack_strdup.
* cp-support.c (inspect_type, replace_typedefs_qualified_name):
Use obstack_strdup.
2019-08-06 Tom Tromey <tom@tromey.com>
* gdb_obstack.h (obstack_strdup): Define.
* gdb_obstack.c (obstack_strdup): Don't define.
2019-08-06 Tom Tromey <tom@tromey.com>
* xcoffread.c (SYMNAME_ALLOC, process_xcoff_symbol): Use
obstack_strdup.
* typeprint.c (typedef_hash_table::find_global_typedef): Use
obstack_strdup.
* symfile.c (allocate_compunit_symtab): Use obstack_strdup.
* stabsread.c (common_block_start): Use obstack_strdup.
* objfiles.c (set_objfile_main_name, objfile): Use
obstack_strdup.
* namespace.c (add_using_directive): Use obstack_strdup.
* mdebugread.c (parse_symbol, parse_type): Use obstack_strdup.
* jit.c (finalize_symtab): Use obstack_strdup.
* dwarf2read.c (fixup_go_packaging, dwarf2_physname)
(guess_partial_die_structure_name, partial_die_info::fixup)
(dwarf2_name): Use obstack_strdup.
* coffread.c (coff_read_struct_type, coff_read_enum_type): Use
obstack_strdup.
* c-exp.y (scan_macro_expansion): Use obstack_strdup.
* buildsym.c (buildsym_compunit::end_symtab_with_blockvector): Use
obstack_strdup.
* ada-lang.c (ada_decode_symbol): Use obstack_strdup.
2019-08-07 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* unittests/help-doc-selftests.c: New file.
* Makefile.in: Add the new file.
Make first and last lines of 'command help documentation' consistent. With this patch, the help docs now respect 2 invariants: * The first line of a command help is terminated by a '.' character. * The last character of a command help is not a newline character. Note that the changes for the last invariant were done by Tom, as part of : [PATCH] Remove trailing newlines from help text https://sourceware.org/ml/gdb-patches/2019-06/msg00050.html but some occurrences have been re-introduced since then. Some help docs had to be rephrased/restructured to respect the above invariants. Before this patch, print_doc_line was printing the first line of a command help documentation, but stopping at the first '.' or ',' character. This was giving inconsistent results : * The first line of command helps was sometimes '.' terminated, sometimes not. * The first line of command helps was not always designed to be readable/understandable/unambiguous when stopping at the first '.' or ',' character. This e.g. created the following inconsistencies/problems: < catch exception -- Catch Ada exceptions < catch handlers -- Catch Ada exceptions < catch syscall -- Catch system calls by their names < down-silently -- Same as the `down' command while the new help is: > catch exception -- Catch Ada exceptions, when raised. > catch handlers -- Catch Ada exceptions, when handled. > catch syscall -- Catch system calls by their names, groups and/or numbers. > down-silently -- Same as the `down' command, but does not print anything. Also, the command help doc should not be terminated by a newline character, but this was not respected by all commands. The cli-option -OPT framework re-introduced some occurences. So, the -OPT build help framework was changed to not output newlines at the end of %OPTIONS% replacement. This patch changes the help documentations to ensure the 2 invariants given above. It implied to slightly rephrase or restructure some help docs. Based on the above invariants, print_doc_line (called by 'apropos' and 'help' commands to print the first line of a command help) now outputs the full first line of a command help. This all results in a lot of small changes in the produced help docs. There are less code changes than changes in the help docs, as a lot of docs are produced by some code (e.g. the remote packet usage settings). gdb/ChangeLog 2019-08-07 Philippe Waroquiers <philippe.waroquiers@skynet.be> * cli/cli-decode.h (print_doc_line): Add for_value_prefix argument. * cli/cli-decode.c (print_doc_line): Likewise. It now prints the full first line, except when FOR_VALUE_PREFIX. In this case, the trailing '.' is not output, and the first character is uppercased. (print_help_for_command): Update call to print_doc_line. (print_doc_of_command): Likewise. * cli/cli-setshow.c (deprecated_show_value_hack): Likewise. * cli/cli-option.c (append_indented_doc): Do not append newline. (build_help_option): Append newline after first appended_indented_doc only if a second call is done. (build_help): Append 2 new lines before each option, except the first one. * compile/compile.c (_initialize_compile): Add new lines after %OPTIONS%, when not at the end of the help. Change help doc or code producing the help doc to respect the invariants. * maint-test-options.c (_initialize_maint_test_options): Likewise. Also removed the new line after 'Options:', as all other commands do not put an empty line between 'Options:' and the first option. * printcmd.c (_initialize_printcmd): Likewise. * stack.c (_initialize_stack): Likewise. * interps.c (interpreter_exec_cmd): Fix "Usage:" line that was incorrectly telling COMMAND is optional. * ada-lang.c (_initialize_ada_language): Change help doc or code producing the help doc to respect the invariants. * ada-tasks.c (_initialize_ada_tasks): Likewise. * breakpoint.c (_initialize_breakpoint): Likewise. * cli/cli-cmds.c (_initialize_cli_cmds): Likewise. * cli/cli-logging.c (_initialize_cli_logging): Likewise. * cli/cli-setshow.c (_initialize_cli_setshow): Likewise. * cli/cli-style.c (cli_style_option::add_setshow_commands, _initialize_cli_style): Likewise. * corelow.c (core_target_info): Likewise. * dwarf-index-cache.c (_initialize_index_cache): Likewise. * dwarf2read.c (_initialize_dwarf2_read): Likewise. * filesystem.c (_initialize_filesystem): Likewise. * frame.c (_initialize_frame): Likewise. * gnu-nat.c (add_task_commands): Likewise. * infcall.c (_initialize_infcall): Likewise. * infcmd.c (_initialize_infcmd): Likewise. * interps.c (_initialize_interpreter): Likewise. * language.c (_initialize_language): Likewise. * linux-fork.c (_initialize_linux_fork): Likewise. * maint-test-settings.c (_initialize_maint_test_settings): Likewise. * maint.c (_initialize_maint_cmds): Likewise. * memattr.c (_initialize_mem): Likewise. * printcmd.c (_initialize_printcmd): Likewise. * python/lib/gdb/function/strfns.py (_MemEq, _StrLen, _StrEq, _RegEx): Likewise. * ravenscar-thread.c (_initialize_ravenscar): Likewise. * record-btrace.c (_initialize_record_btrace): Likewise. * record-full.c (_initialize_record_full): Likewise. * record.c (_initialize_record): Likewise. * regcache-dump.c (_initialize_regcache_dump): Likewise. * regcache.c (_initialize_regcache): Likewise. * remote.c (add_packet_config_cmd, init_remote_threadtests, _initialize_remote): Likewise. * ser-tcp.c (_initialize_ser_tcp): Likewise. * serial.c (_initialize_serial): Likewise. * skip.c (_initialize_step_skip): Likewise. * source.c (_initialize_source): Likewise. * stack.c (_initialize_stack): Likewise. * symfile.c (_initialize_symfile): Likewise. * symtab.c (_initialize_symtab): Likewise. * target-descriptions.c (_initialize_target_descriptions): Likewise. * top.c (init_main): Likewise. * tracefile-tfile.c (tfile_target_info): Likewise. * tracepoint.c (_initialize_tracepoint): Likewise. * tui/tui-win.c (_initialize_tui_win): Likewise. * utils.c (add_internal_problem_command): Likewise. * valprint.c (value_print_option_defs): Likewise. gdb/testsuite/ChangeLog 2019-08-07 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.base/style.exp: Update tests for help doc new invariants. * gdb.base/help.exp: Likewise.
2019-06-09 11:16:20 +02:00
2019-08-07 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-decode.h (print_doc_line): Add for_value_prefix argument.
* cli/cli-decode.c (print_doc_line): Likewise. It now prints
the full first line, except when FOR_VALUE_PREFIX. In this case,
the trailing '.' is not output, and the first character is uppercased.
(print_help_for_command): Update call to print_doc_line.
(print_doc_of_command): Likewise.
* cli/cli-setshow.c (deprecated_show_value_hack): Likewise.
* cli/cli-option.c (append_indented_doc): Do not append newline.
(build_help_option): Append newline after first appended_indented_doc
only if a second call is done.
(build_help): Append 2 new lines before each option, except the first
one.
* compile/compile.c (_initialize_compile): Add new lines after
%OPTIONS%, when not at the end of the help.
Change help doc or code
producing the help doc to respect the invariants.
* maint-test-options.c (_initialize_maint_test_options): Likewise.
Also removed the new line after 'Options:', as all other commands
do not put an empty line between 'Options:' and the first option.
* printcmd.c (_initialize_printcmd): Likewise.
* stack.c (_initialize_stack): Likewise.
* interps.c (interpreter_exec_cmd): Fix "Usage:" line that was
incorrectly telling COMMAND is optional.
* ada-lang.c (_initialize_ada_language): Change help doc or code
producing the help doc to respect the invariants.
* ada-tasks.c (_initialize_ada_tasks): Likewise.
* breakpoint.c (_initialize_breakpoint): Likewise.
* cli/cli-cmds.c (_initialize_cli_cmds): Likewise.
* cli/cli-logging.c (_initialize_cli_logging): Likewise.
* cli/cli-setshow.c (_initialize_cli_setshow): Likewise.
* cli/cli-style.c (cli_style_option::add_setshow_commands,
_initialize_cli_style): Likewise.
* corelow.c (core_target_info): Likewise.
* dwarf-index-cache.c (_initialize_index_cache): Likewise.
* dwarf2read.c (_initialize_dwarf2_read): Likewise.
* filesystem.c (_initialize_filesystem): Likewise.
* frame.c (_initialize_frame): Likewise.
* gnu-nat.c (add_task_commands): Likewise.
* infcall.c (_initialize_infcall): Likewise.
* infcmd.c (_initialize_infcmd): Likewise.
* interps.c (_initialize_interpreter): Likewise.
* language.c (_initialize_language): Likewise.
* linux-fork.c (_initialize_linux_fork): Likewise.
* maint-test-settings.c (_initialize_maint_test_settings): Likewise.
* maint.c (_initialize_maint_cmds): Likewise.
* memattr.c (_initialize_mem): Likewise.
* printcmd.c (_initialize_printcmd): Likewise.
* python/lib/gdb/function/strfns.py (_MemEq, _StrLen, _StrEq,
_RegEx): Likewise.
* ravenscar-thread.c (_initialize_ravenscar): Likewise.
* record-btrace.c (_initialize_record_btrace): Likewise.
* record-full.c (_initialize_record_full): Likewise.
* record.c (_initialize_record): Likewise.
* regcache-dump.c (_initialize_regcache_dump): Likewise.
* regcache.c (_initialize_regcache): Likewise.
* remote.c (add_packet_config_cmd, init_remote_threadtests,
_initialize_remote): Likewise.
* ser-tcp.c (_initialize_ser_tcp): Likewise.
* serial.c (_initialize_serial): Likewise.
* skip.c (_initialize_step_skip): Likewise.
* source.c (_initialize_source): Likewise.
* stack.c (_initialize_stack): Likewise.
* symfile.c (_initialize_symfile): Likewise.
* symtab.c (_initialize_symtab): Likewise.
* target-descriptions.c (_initialize_target_descriptions): Likewise.
* top.c (init_main): Likewise.
* tracefile-tfile.c (tfile_target_info): Likewise.
* tracepoint.c (_initialize_tracepoint): Likewise.
* tui/tui-win.c (_initialize_tui_win): Likewise.
* utils.c (add_internal_problem_command): Likewise.
* valprint.c (value_print_option_defs): Likewise.
2019-08-06 Frank Ch. Eigler <fche@redhat.com>
PR build/24886
* configure.ac: Drop enable-libmcheck support.
* configure, config.in: Rebuild.
* libmcheck.m4: Remove.
* acinclude.m4: Don't include it.
* Makefile.in: Don't distribute it.
* top.c (print_gdb_configuration): Don't mention it.
2019-08-06 Tom Tromey <tom@tromey.com>
* utils.c (set_output_style): Sometimes pass stream to
emit_style_escape.
* ui-out.h (class ui_out) <can_emit_style_escape>: Declare.
* record-btrace.c (btrace_insn_history): Update.
* mi/mi-out.h (class mi_ui_out) <can_emit_style_escape>: New
method.
* disasm.h (gdb_pretty_print_disassembler): Add uiout parameter.
Update initializers.
<m_uiout>: New field.
<m_di>: Move lower.
* disasm.c (gdb_pretty_print_disassembler::pretty_print_insn):
Remove "uiout" parameter.
(dump_insns): Update.
* cli-out.h (class cli_ui_out) <can_emit_style_escape>: Declare.
* cli-out.c (cli_ui_out::can_emit_style_escape): New method.
2019-08-06 Christian Biesinger <cbiesinger@google.com>
* symtab.c (symbol_cache_lookup): Change int to enum block_enum.
(error_in_psymtab_expansion): Likewise.
(lookup_symbol_via_quick_fns): Likewise.
(basic_lookup_transparent_type_quick): Likewise.
(basic_lookup_transparent_type_1): Likewise.
2019-08-06 Tom Tromey <tromey@adacore.com>
* source.c (last_source_error): Now bool.
(print_source_lines_base): Make "noprint" bool. Only open
source file when last_source_visited changes.
Add file offsets to the source cache Currently, gdb stores the number of lines and an array of file offsets for the start of each line in struct symtab. This patch moves this information to the source cache. This has two benefits. First, it allows gdb to read a source file less frequently. Currently, a source file may be read multiple times: once when computing the file offsets, once when highlighting, and then pieces may be read again while printing source lines. With this change, the file is read once for its source text and file offsets; and then perhaps read again if it is evicted from the cache. Second, if multiple symtabs cover the same source file, then this will share the file offsets between them. I'm not sure whether this happens in practice. gdb/ChangeLog 2019-08-06 Tom Tromey <tromey@adacore.com> * annotate.c (annotate_source_line): Use g_source_cache. * source-cache.c (source_cache::get_plain_source_lines): Change parameters. Populate m_offset_cache. (source_cache::ensure): New method. (source_cache::get_line_charpos): New method. (extract_lines): Move lower. Change parameters. (source_cache::get_source_lines): Move lower. * source-cache.h (class source_cache): Update comment. <get_line_charpos>: New method. <get_source_lines>: Update comment. <clear>: Clear m_offset_cache. <get_plain_source_lines>: Change parameters. <ensure>: New method <m_offset_cache>: New member. * source.c (forget_cached_source_info_for_objfile): Update. (info_source_command): Use g_source_cache. (find_source_lines, open_source_file_with_line_charpos): Remove. (print_source_lines_base, search_command_helper): Use g_source_cache. * source.h (open_source_file_with_line_charpos): Don't declare. * symtab.h (struct symtab) <nlines, line_charpos>: Remove. * tui/tui-source.c (tui_source_window::do_scroll_vertical): Use g_source_cache.
2019-07-22 22:31:43 +02:00
2019-08-06 Tom Tromey <tromey@adacore.com>
* annotate.c (annotate_source_line): Use g_source_cache.
* source-cache.c (source_cache::get_plain_source_lines): Change
parameters. Populate m_offset_cache.
(source_cache::ensure): New method.
(source_cache::get_line_charpos): New method.
(extract_lines): Move lower. Change parameters.
(source_cache::get_source_lines): Move lower.
* source-cache.h (class source_cache): Update comment.
<get_line_charpos>: New method.
<get_source_lines>: Update comment.
<clear>: Clear m_offset_cache.
<get_plain_source_lines>: Change parameters.
<ensure>: New method
<m_offset_cache>: New member.
* source.c (forget_cached_source_info_for_objfile): Update.
(info_source_command): Use g_source_cache.
(find_source_lines, open_source_file_with_line_charpos): Remove.
(print_source_lines_base, search_command_helper): Use g_source_cache.
* source.h (open_source_file_with_line_charpos): Don't declare.
* symtab.h (struct symtab) <nlines, line_charpos>: Remove.
* tui/tui-source.c (tui_source_window::do_scroll_vertical):
Use g_source_cache.
2019-08-06 Tom Tromey <tromey@adacore.com>
* source-cache.c (source_cache::get_plain_source_lines):
Remove "first_line" and "last_line" parameters.
(source_cache::get_source_lines): Cache plain text.
* source-cache.h (class source_cache)
<get_plain_source_lines>: Update.
2019-08-06 Tom Tromey <tromey@adacore.com>
* source-cache.c (extract_lines): No longer a method.
Changed type of parameter. Include final newline.
(selftests::extract_lines_test): New function.
(_initialize_source_cache): Likewise.
* source-cache.h (class source_cache)
<extract_lines>: Don't declare.
2019-08-06 Tom Tromey <tromey@adacore.com>
* breakpoint.c (init_breakpoint_sal): Update.
(breakpoint): Update.
* breakpoint.h (struct breakpoint) <filter>: Now a
unique_xmalloc_ptr.
2019-08-05 Christian Biesinger <cbiesinger@google.com>
* NEWS: Mention dictionary access on blocks.
* python/py-block.c (blpy_getitem): New function.
(block_object_as_mapping): New struct.
(block_object_type): Use new struct for tp_as_mapping field.
2019-08-05 Christian Biesinger <cbiesinger@google.com>
* objfiles.h (objfile): Add a comment describing partial symbols.
2019-08-05 Tom Tromey <tromey@adacore.com>
* compile/compile.c (_initialize_compile): Use _(), not N_().
* thread.c (_initialize_thread): Use _(), not N_().
* stack.c (_initialize_stack): Use _(), not N_().
* printcmd.c (_initialize_printcmd): Use _(), not N_().
2019-08-04 Simon Marchi <simon.marchi@polymtl.ca>
* dwarf2read.c (struct dw2_symtab_iterator):
<want_specific_block>: Remove.
<block_index>: Change type to gdb::optional.
(dw2_symtab_iter_init): Remove WANT_SPECIFIC_BLOCK parameter,
change type of BLOCK_INDEX parameter to gdb::optional.
(dw2_symtab_iter_next): Re-write in function of gdb::optional.
(dw2_lookup_symbol): Don't pass argument for
WANT_SPECIFIC_BLOCK.
(dw2_expand_symtabs_for_function): Don't pass argument for
WANT_SPECIFIC_BLOCK, pass empty optional for BLOCK_INDEX.
(class dw2_debug_names_iterator)
<dw2_debug_names_iterator>: Remove WANT_SPECIFIC_BLOCK
parameter, change BLOCK_INDEX type to gdb::optional.
<m_want_specific_block>: Remove.
<m_block_index>: Change type to gdb::optional.
(dw2_debug_names_iterator::next): Change type of IS_STATIC to
gdb::optional. Re-write in function of gdb::optional.
(dw2_debug_names_lookup_symbol): Don't pass argument for
WANT_SPECIFIC_BLOCK.
(dw2_debug_names_expand_symtabs_for_function): Don't pass
argument for WANT_SPECIFIC_BLOCK, pass empty optional for
BLOCK_INDEX.
2019-08-03 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Mention changes to "info sources" command.
2019-08-03 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* symtab.c (filename_partial_match_opts): New struct type.
(struct output_source_filename_data): New members
regexp, c_regexp, partial_match.
(output_source_filename): Use new members to decide to print file.
(info_sources_option_defs): New variable.
(make_info_sources_options_def_group, print_info_sources_header,
info_sources_command_completer):
New functions.
(info_sources_command): Read new optional arguments.
(_initialize_symtab): Update info sources help.
2019-08-02 Alexandre Oliva <oliva@adacore.com>
* ada-lang.c (exception_support_info_v0): Renamed from...
(default_exception_support_info): ... this. Create new
definition for v1.
(ada_has_this_exception_support): Look up catch_handlers_sym.
(ada_exception_support_info_sniffer): Try v0 after default.
2019-08-01 Tom Tromey <tromey@adacore.com>
* ia64-libunwind-tdep.h (struct libunwind_descr): Include
gdbarch.h.
2019-08-01 Christian Biesinger <cbiesinger@google.com>
* s12z-tdep.c: Fix include path for s12z-opc.h.
2019-08-01 Alan Hayward <alan.hayward@arm.com>
* NEWS: Require GNU make 3.82.
2019-07-16 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_copy_win, tui_box_win): Don't
declare.
2019-07-30 Tom Tromey <tromey@adacore.com>
* block.c (contained_in): Remove BLOCK_FUNCTION check.
Allow display of negative offsets in print_address_symbolic() When examining addresses associated with blocks with non-contiguous address ranges, it's not uncommon to see large positive offsets which, for some address width, actually represent a smaller negative offset. Here's an example taken from the test case (using the dw2-ranges-func-lo-cold executable): (gdb) x/5i foo_cold 0x40110d <foo+4294967277>: push %rbp 0x40110e <foo+4294967278>: mov %rsp,%rbp 0x401111 <foo+4294967281>: callq 0x401106 <baz> 0x401116 <foo+4294967286>: nop 0x401117 <foo+4294967287>: pop %rbp This commit, in conjuction with an earlier patch from this series, causes cases like the above to be displayed like this (below) instead: (gdb) x/5i foo_cold 0x40110d <foo_cold>: push %rbp 0x40110e <foo-18>: mov %rsp,%rbp 0x401111 <foo-15>: callq 0x401106 <baz> 0x401116 <foo-10>: nop 0x401117 <foo-9>: pop %rbp Note that the address of foo_cold is now (due to another patch) being displayed as <foo_cold> instead of <foo+BigOffset>. The subsequent lines are shown as negative offsets from foo. Disassembly using the "disassemble" command is somewhat affected by these changes: Before: (gdb) disassemble foo_cold Dump of assembler code for function foo: Address range 0x401120 to 0x40113b: 0x0000000000401120 <+0>: push %rbp 0x0000000000401121 <+1>: mov %rsp,%rbp 0x0000000000401124 <+4>: callq 0x401119 <bar> 0x0000000000401129 <+9>: mov 0x2ef1(%rip),%eax # 0x404020 <e> 0x000000000040112f <+15>: test %eax,%eax 0x0000000000401131 <+17>: je 0x401138 <foo+24> 0x0000000000401133 <+19>: callq 0x40110d <foo+4294967277> 0x0000000000401138 <+24>: nop 0x0000000000401139 <+25>: pop %rbp 0x000000000040113a <+26>: retq Address range 0x40110d to 0x401119: 0x000000000040110d <+-19>: push %rbp 0x000000000040110e <+-18>: mov %rsp,%rbp 0x0000000000401111 <+-15>: callq 0x401106 <baz> 0x0000000000401116 <+-10>: nop 0x0000000000401117 <+-9>: pop %rbp 0x0000000000401118 <+-8>: retq End of assembler dump. After: (gdb) disassemble foo_cold Dump of assembler code for function foo: Address range 0x401120 to 0x40113b: 0x0000000000401120 <+0>: push %rbp 0x0000000000401121 <+1>: mov %rsp,%rbp 0x0000000000401124 <+4>: callq 0x401119 <bar> 0x0000000000401129 <+9>: mov 0x2ef1(%rip),%eax # 0x404020 <e> 0x000000000040112f <+15>: test %eax,%eax 0x0000000000401131 <+17>: je 0x401138 <foo+24> 0x0000000000401133 <+19>: callq 0x40110d <foo_cold> 0x0000000000401138 <+24>: nop 0x0000000000401139 <+25>: pop %rbp 0x000000000040113a <+26>: retq Address range 0x40110d to 0x401119: 0x000000000040110d <-19>: push %rbp 0x000000000040110e <-18>: mov %rsp,%rbp 0x0000000000401111 <-15>: callq 0x401106 <baz> 0x0000000000401116 <-10>: nop 0x0000000000401117 <-9>: pop %rbp 0x0000000000401118 <-8>: retq End of assembler dump. Note that negative offsets are now displayed without the leading "+". Also, the callq to foo_cold is now displayed as such instead of a callq to foo with a large positive offset. gdb/ChangeLog: * printcmd.c (print_address_symbolic): Print negative offsets. (build_address_symbolic): Force signed arithmetic when computing offset.
2019-06-03 03:12:28 +02:00
2019-07-30 Kevin Buettner <kevinb@redhat.com>
* printcmd.c (print_address_symbolic): Print negative offsets.
(build_address_symbolic): Force signed arithmetic when computing
offset.
2019-07-30 Christian Biesinger <cbiesinger@google.com>
PR/24474: Add a function to lookup static variables.
* NEWS: Mention this new function.
* python/py-symbol.c (gdbpy_lookup_static_symbol): New function.
* python/python-internal.h (gdbpy_lookup_static_symbol): New function.
* python/python.c (python_GdbMethods): Add new function.
2019-07-29 Christian Biesinger <cbiesinger@google.com>
* NEWS: Mention new functions Objfile.lookup_{global,static}_symbol.
* python/py-objfile.c (objfpy_lookup_global_symbol): New function.
(objfpy_lookup_static_symbol): New function.
(objfile_object_methods): Add new functions.
2019-07-29 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Mention 'set|show print frame-info'. Mention new
'presence' value for 'frame-arguments'. Mention new '-frame-info'
backtrace argument. Mention that python frame filtering code
is now consistent with what 'backtrace' command prints.
Implement 'set print frame-info|frame-arguments presence'. New settings allow to better control what frame information is printed. 'set print frame-info' allows to override the default frame information printed when a GDB command prints a frame. The backtrace command has a new option -frame-info to override this global setting. It is now possible to have very short frame information by using the new 'set print frame-arguments presence' and 'set print frame-info short-location'. Combined with 'set print address off', a backtrace will only show the essential information to see the function call chain, e.g.: (gdb) set print address off (gdb) set print frame-arguments presence (gdb) set print frame-info short-location (gdb) bt #0 break_me () #1 call_me (...) #2 main () (gdb) This is handy in particular for big backtraces with functions having many arguments. Python frame filter printing logic has been updated to respect the new setting in non MI mode. Also, the default frame information printed was inconsistent when backtrace was printing the frame information itself, or when the python frame filtering code was printing the frame information. This patch changes the default of python frame filtering to have a consistent behaviour regarding printed frame-information, whatever the presence/activity/matches of python filters. 2019-07-29 Philippe Waroquiers <philippe.waroquiers@skynet.be> * frame.h (enum print_what): New value 'SHORT_LOCATION', update comments. (print_frame_info_auto, print_frame_info_source_line, print_frame_info_location, print_frame_info_source_and_location, print_frame_info_location_and_address, print_frame_info_short_location): New declarations. (struct frame_print_options): New member print_frame_info. * extension.h (enum ext_lang_frame_args): New value CLI_PRESENCE. * stack.h (get_user_print_what_frame_info): New declaration. (frame_show_address): New declaration. * stack.c (print_frame_arguments_choices): New value 'presence'. (print_frame_info_auto, print_frame_info_source_line, print_frame_info_location, print_frame_info_source_and_location, print_frame_info_location_and_address, print_frame_info_short_location, print_frame_info_choices, print_frame_info_print_what): New definitions. (print_frame_args): Only print dots for args if print frame-arguments is 'presence'. (frame_print_option_defs): New element for "frame-info". (get_user_print_what_frame_info): New function. (frame_show_address): Make non static. Move comment to stack.h. (print_frame_info_to_print_what): New function. (print_frame_info): Update comment. Use fp_opts.print_frame_info to decide what to print. (backtrace_command_1): Handle the new print_frame_arguments_presence value. (_initialize_stack): Call add_setshow_enum_cmd for frame-info. * python/py-framefilter.c (py_print_args): Handle CLI_PRESENCE. (py_print_frame): In non-mi mode, use LOCATION as default for print_what, similarly to frame information printed directly by backtrace command. Handle frame-info user option in non MI mode.
2019-05-04 23:40:56 +02:00
2019-07-29 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* frame.h (enum print_what): New value 'SHORT_LOCATION', update
comments.
(print_frame_info_auto, print_frame_info_source_line,
print_frame_info_location, print_frame_info_source_and_location,
print_frame_info_location_and_address, print_frame_info_short_location):
New declarations.
(struct frame_print_options): New member print_frame_info.
* extension.h (enum ext_lang_frame_args): New value CLI_PRESENCE.
* stack.h (get_user_print_what_frame_info): New declaration.
(frame_show_address): New declaration.
* stack.c (print_frame_arguments_choices): New value 'presence'.
(print_frame_info_auto, print_frame_info_source_line,
print_frame_info_location, print_frame_info_source_and_location,
print_frame_info_location_and_address, print_frame_info_short_location,
print_frame_info_choices, print_frame_info_print_what): New definitions.
(print_frame_args): Only print dots for args if print frame-arguments
is 'presence'.
(frame_print_option_defs): New element for "frame-info".
(get_user_print_what_frame_info): New function.
(frame_show_address): Make non static. Move comment to stack.h.
(print_frame_info_to_print_what): New function.
(print_frame_info): Update comment. Use fp_opts.print_frame_info
to decide what to print.
(backtrace_command_1): Handle the new print_frame_arguments_presence
value.
(_initialize_stack): Call add_setshow_enum_cmd for frame-info.
* python/py-framefilter.c (py_print_args): Handle CLI_PRESENCE.
(py_print_frame): In non-mi mode, use LOCATION as default for
print_what, similarly to frame information printed directly by
backtrace command. Handle frame-info user option in non MI mode.
2019-07-27 Kevin Buettner <kevinb@redhat.com>
* linux-thread-db.c (thread_db_target::thread_handle_to_thread_info):
Add case for debugging 32-bit target on 64-bit host. Revise
comment.
Fix stepping bug associated with non-contiguous blocks I recently noticed the following behavior while debugging dw2-ranges-func-low-cold. This is one of the test programs associated with the test gdb.dwarf2/dw2-ranges-func.exp. (gdb) b 70 Breakpoint 1 at 0x401129: file dw2-ranges-func-lo-cold.c, line 70. (gdb) run Starting program: dw2-ranges-func-lo-cold Breakpoint 1, foo () at dw2-ranges-func-lo-cold.c:70 70 if (e) foo_cold (); /* foo foo_cold call */ (gdb) set var e=1 (gdb) step [Inferior 1 (process 12545) exited normally] This is incorrect. When stepping, we expect a step to occur. We do not expect the program to exit. Instead, we should see the following behavior: ... (gdb) set var e=1 (gdb) step foo () at dw2-ranges-func-lo-cold.c:54 54 baz (); /* foo_cold baz call */ (Note that I've shortened the paths in the above sessions to improve readability.) The bug is in fill_in_stop_func() in infrun.c. While working on non-contiguous address range improvements in 2018, I replaced the call to find_pc_partial_function() with a call to find_function_entry_range_from_pc(). Although this seemed like the right thing to do at the time, I now think that calling find_pc_partial_function (along with some other tweaks) is the right thing to do. For blocks with a single contiguous range, these functions do pretty much the same thing: when the function succeeds, the function name, start address, and end address are all filled in. Additionally, find_pc_partial_function contains an additional output parameter which is set to the block containing that PC. For blocks with non-contiguous ranges, find_pc_partial_function sets the start and end addresses to the start and end addresses of the range containing the pc. find_function_entry_range_from_pc does what it says; it sets the start and end addresses to those of the range containing the entry pc. The reason that I had thought that using the entry pc range was correct is due to the fact that fill_in_stop_func() contains some code for advancing past the function start and entry point. To do this, we'd need the range that contains the entry pc. However, when stepping, we actually want the range that contains the stop pc. If that range also contains the entry pc, we should then attempt to advance stop_func_start past the start offset and entry point. (I haven't thought very hard about the reason for advancing the stop_func_start in this manner. Since it's been there for quite a while, I'm assuming that it's still a good idea.) Back when I wrote the test case, I had included a test for doing the step shown in the example above. I had problems with it, however. At the time, I thought it was due to differing compiler versions, so I disabled that portion of the test. I have now reenabled those tests, but have left in place the logic which may be used to disable it. The changes to dw2-ranges-func.exp depend on my other recent changes to the file which have not been pushed yet. Finally, I'll note that the only caller of find_function_entry_range_from_pc() is/was fill_in_stop_func(). Once this commit goes in, it'll be dead code. I considered removing it, but I think that it ought to be used (instead of find_pc_partial_function) for determining the correct range to scan for prologue analysis, so I'm going to leave it in place for now. gdb/ChangeLog: * infrun.c (fill_in_stop_func): Use find_pc_partial_function instead of find_function_entry_range_from_pc. testsuite/ChangeLog: * gdb.dwarf2/dw2-ranges-func.exp (enable_foo_cold_stepping): Enable tests associated with this flag. Adjust regex referencing "foo_low" to now refer to "foo_cold" instead.
2019-07-14 00:59:44 +02:00
2019-07-27 Kevin Buettner <kevinb@redhat.com>
* infrun.c (fill_in_stop_func): Use find_pc_partial_function
instead of find_function_entry_range_from_pc.
Prefer symtab symbol over minsym for function names in non-contiguous blocks The discussion on gdb-patches which led to this patch may be found here: https://www.sourceware.org/ml/gdb-patches/2019-05/msg00018.html Here's a brief synopsis/analysis: Eli Zaretskii, while debugging a Windows emacs executable, found that functions comprised of more than one (non-contiguous) address range were not being displayed correctly in a backtrace. This is the example that Eli provided: (gdb) bt #0 0x76a63227 in KERNELBASE!DebugBreak () from C:\Windows\syswow64\KernelBase.dll #1 0x012e7b89 in emacs_abort () at w32fns.c:10768 #2 0x012e1f3b in print_vectorlike.cold () at print.c:1824 #3 0x011d2dec in print_object (obj=<optimized out>, printcharfun=XIL(0), escapeflag=true) at print.c:2150 The function print_vectorlike consists of two address ranges, one of which contains "cold" code which is expected to not execute very often. There is a minimal symbol, print_vectorlike.cold.65, which is the address of the "cold" range. GDB is prefering this minsym over the the name provided by the DWARF info due to some really old code in GDB which handles "certain pathological cases". This comment reads as follows: /* In certain pathological cases, the symtabs give the wrong function (when we are in the first function in a file which is compiled without debugging symbols, the previous function is compiled with debugging symbols, and the "foo.o" symbol that is supposed to tell us where the file with debugging symbols ends has been truncated by ar because it is longer than 15 characters). This also occurs if the user uses asm() to create a function but not stabs for it (in a file compiled with -g). So look in the minimal symbol tables as well, and if it comes up with a larger address for the function use that instead. I don't think this can ever cause any problems; there shouldn't be any minimal symbols in the middle of a function; if this is ever changed many parts of GDB will need to be changed (and we'll create a find_pc_minimal_function or some such). */ In an earlier version of this patch, I had left the code for the pathological case intact, but those who reviwed that patch recommended removing it. So that's what I've done - I've removed it. gdb/ChangeLog: * stack.c (find_frame_funname): Remove code which preferred minsym over symtab sym in "certain pathological cases".
2019-07-04 02:32:21 +02:00
2019-07-27 Kevin Buettner <kevinb@redhat.com>
* stack.c (find_frame_funname): Remove code which preferred
minsym over symtab sym in "certain pathological cases".
Restrict use of minsym names when printing addresses in disassembled code build_address_symbolic contains some code which causes it to prefer the minsym over the the function symbol in certain cases. The cases where this occurs are the same as the "certain pathological cases" that used to exist in find_frame_funname(). This commit largely disables that code; it will only prefer the minsym when the address of minsym is identical to that of the address under consideration AND the function address for the symbtab sym is not the same as the address under consideration. So, without this change, when using the dw2-ranges-func-lo-cold executable from the gdb.dwarf2/dw2-ranges-func.exp test, GDB exhibits the following behavior: (gdb) x/5i foo_cold 0x40110d <foo+4294967277>: push %rbp 0x40110e <foo+4294967278>: mov %rsp,%rbp 0x401111 <foo+4294967281>: callq 0x401106 <baz> 0x401116 <foo+4294967286>: nop 0x401117 <foo+4294967287>: pop %rbp On the other hand, still without this change, using the dw2-ranges-func-hi-cold executable from the same test, GDB does this instead: (gdb) x/5i foo_cold 0x401128 <foo_cold>: push %rbp 0x401129 <foo_cold+1>: mov %rsp,%rbp 0x40112c <foo_cold+4>: callq 0x401134 <baz> 0x401131 <foo_cold+9>: nop 0x401132 <foo_cold+10>: pop %rbp This is inconsistent behavior. When foo_cold is at a lower address than the function's entry point, the symtab symbol (foo) is displayed along with a large positive offset which would wrap around the address space if the address space were only 32 bits wide. (A later patch fixes this problem by displaying negative offsets.) This commit makes the behavior uniform for both the "lo-cold" and "hi-cold" cases: lo-cold: (gdb) x/5i foo_cold 0x40110d <foo_cold>: push %rbp 0x40110e <foo-18>: mov %rsp,%rbp 0x401111 <foo-15>: callq 0x401106 <baz> 0x401116 <foo-10>: nop 0x401117 <foo-9>: pop %rbp hi-cold: (gdb) x/5i foo_cold 0x401128 <foo_cold>: push %rbp 0x401129 <foo+35>: mov %rsp,%rbp 0x40112c <foo+38>: callq 0x401134 <baz> 0x401131 <foo+43>: nop 0x401132 <foo+44>: pop %rbp In both cases, the symbol shown for the address at which foo_cold resides is shown as <foo_cold>. Subsequent offsets are shown as either negative or positive offsets from the entry pc for foo. When disassembling a function, care must be taken to NOT display <+0> as the offset for the second range. For this reason, I found it necessary to add the "prefer_sym_over_minsym" parameter to build_address_symbolic. The type of this flag is a bool; do_demangle ought to be a bool also, so I made this change at the same time. gdb/ChangeLog: * valprint.h (build_address_symbolic): Add "prefer_sym_over_minsym" parameter. Change type of "do_demangle" to bool. * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Pass suitable "prefer_sym_over_minsym" flag to build_address_symbolic(). Don't output "+" for negative offsets. * printcmd.c (print_address_symbolic): Update invocation of build_address_symbolic to include a "prefer_sym_over_minsym" flag. (build_address_symbolic): Add "prefer_sym_over_minsym" parameter. Restrict cases in which use of minimal symbol is preferred to that of a found symbol. Update comments.
2019-07-04 02:35:21 +02:00
* valprint.h (build_address_symbolic): Add "prefer_sym_over_minsym"
parameter. Change type of "do_demangle" to bool.
* disasm.c (gdb_pretty_print_disassembler::pretty_print_insn):
Pass suitable "prefer_sym_over_minsym" flag to
build_address_symbolic(). Don't output "+" for negative offsets.
* printcmd.c (print_address_symbolic): Update invocation of
build_address_symbolic to include a "prefer_sym_over_minsym"
flag.
(build_address_symbolic): Add "prefer_sym_over_minsym" parameter.
Restrict cases in which use of minimal symbol is preferred to that
of a found symbol. Update comments.
dwarf2-frame.c: Fix FDE processing bug involving non-contiguous ranges In the course of revising the test case for gdb.dwarf2/dw2-ranges-func.exp, I added a new .c file which would cause the "cold" range to be at a higher address than the rest of the function. In these tests, the range in question isn't really cold in the sense that a compiler has determined that it'll be executed less frequently. Instead, it's simply the range that does not include the entry pc. These tests are intended to mimic the output of such a compiler, so I'll continue to refer to this range as "cold" in the following discussion. The original test case had only tested a cold range placed at lower addresses than the rest of the function. During testing of the new code where the cold range was placed at higher addresses, I found that I could produce the following backtrace: (gdb) bt #0 0x0000000000401138 in baz () at dw2-ranges-func-hi-cold.c:72 #1 0x0000000000401131 in foo_cold () at dw2-ranges-func-hi-cold.c:64 #2 0x000000000040111e in foo () at dw2-ranges-func-hi-cold.c:50 #3 0x0000000000401144 in main () at dw2-ranges-func-hi-cold.c:78 This is correct, except that we'd like to see foo() listed instead of foo_cold(). (I handle that problem in another patch.) Now look at what happens for a similar backtrace where the cold range is at a lower address than the foo's entry pc: (gdb) bt #0 0x000000000040110a in baz () at dw2-ranges-func-lo-cold.c:48 #1 0x0000000000401116 in foo () at dw2-ranges-func-lo-cold.c:54 #2 0x00007fffffffd4c0 in ?? () #3 0x0000000000401138 in foo () at dw2-ranges-func-lo-cold.c:70 Note that the backtrace doesn't go all the way back to main(). Moreover, frame #2 is messed up. I had seen this behavior when I had worked on the non-contiguous address problem last year. At the time I convinced myself that the mangled backtrace was "okay" since we're doing strange things with the DWARF assembler. We're taking a function called foo_cold (though it was originally called foo_low - my recent changes to the test case changed the name) and via the magic of the DWARF assembler, we're combining it into a separate (non-contiguous) range for foo. Thus, it was a surprise to me when I got a good and complete backtrace when the cold symbol is placed at an address that's greater than entry pc. The function dwarf2_frame_cache (in dwarf2-frame.c) is making this call: if (get_frame_func_if_available (this_frame, &entry_pc)) ... If that call succeeds (returns a true value), the FDE is then processed up to the entry pc. It doesn't make sense to do this, however, when the FDE in question does not contain the entry pc. This can happen when the function in question is comprised of more than one (non-contiguous) address range. My fix is to add some comparisons to the test above to ensure that ENTRY_PC is within the address range covered by the FDE. gdb/ChangeLog: * dwarf2-frame.c (dwarf2_frame_cache): Don't decode FDE instructions for entry pc when entry pc is out of range for that FDE.
2019-06-01 22:42:29 +02:00
* dwarf2-frame.c (dwarf2_frame_cache): Don't decode FDE instructions
for entry pc when entry pc is out of range for that FDE.
2019-07-26 Brian Callahan <bcallah@openbsd.org>
PR gdb/24839:
* gdb/obsd-nat.c (obsd_nat_target::pid_to_str): Fix typo in return
type.
2019-07-25 Christian Biesinger <cbiesinger@google.com>
* python/py-objfile.c (add_separate_debug_file): Fix comment about
this function's Python signature.
2019-07-24 Christian Biesinger <cbiesinger@google.com>
* compile/compile-object-load.c (compile_object_load): Pass GLOBAL_SCOPE.
* solib-spu.c (spu_lookup_lib_symbol): Pass GLOBAL_SCOPE.
* solib-svr4.c (elf_lookup_lib_symbol): Pass GLOBAL_SCOPE.
* symtab.c (lookup_global_symbol_from_objfile): Add a scope parameter.
* symtab.h (lookup_global_symbol_from_objfile): Likewise.
2019-07-24 Yoshinori Sato <ysato@users.sourceforge.jp>
* h8300-tdep.c (h8300_register_name_common): New.
h8300_register_name): Use h8300_register_name_common.
(h8300s_register_name): Likewise.
(h8300sx_register_name): Likewise.
(h8300h_register_nam): New.
(h8300_gdbarch_init): Use h8300h_register_name in h8300h machine.
[gdb][Arm]: gdb cannot step across CMSE secure entry function code. GDB is not able to execute "step" command on function calls of Armv8-M cmse secure entry functions. Everytime GNU linker come across definition of any cmse secure entry function in object file(s), it creates two new instructions secure gateway (sg) and original branch destination (b.w), place those two instructions in ".gnu.sgstubs" section of executable. Any function calls to these cmse secure entry functions is re-directed through secure gateway (sg) present in ".gnu.sgstubs" section. Example: Following is a function call to cmse secure entry function "foo": ... bl xxxx <foo> --->(a) ... <foo> xxxx: push {r7, lr} GNU linker on finding out "foo" is a cmse secure entry function, created sg and b.w instructions and place them in ".gnu.sgstubs" section (marked by c). The "bl" instruction (marked by a) which is a call to cmse secure entry function is modified by GNU linker (as marked by b) and call flow is re-directly through secure gateway (sg) in ".gnu.sgstubs" section. ... bl yyyy <foo> ---> (b) ... section .gnu.sgstubs: ---> (c) yyyy <foo> yyyy: sg // secure gateway b.w xxxx <__acle_se_foo> // original_branch_dest ... 0000xxxx <__acle_se_foo> xxxx: push {r7, lr} ---> (d) On invoking GDB, when the control is at "b" and we pass "step" command, the pc returns "yyyy" (sg address) which is a trampoline and which does not exist in source code. So GDB jumps to next line without jumping to "__acle_se_foo" (marked by d). The above details are published on the Arm website [1], please refer to section 5.4 (Entry functions) and section 3.4.4 (C level development flow of secure code). [1] https://developer.arm.com/architectures/cpu-architecture/m-profile/docs/ecm0359818/latest/armv8-m-security-extensions-requirements-on-development-tools-engineering-specification This patch fixes above problem by returning target pc "xxxx" to GDB on executing "step" command at "b", so that the control jumps to "__acle_se_foo" (marked by d). gdb/ChangeLog: * arm-tdep.c (arm_skip_cmse_entry): New function. (arm_is_sgstubs_section): New function. (arm_skip_stub): Add call to arm_skip_cmse_entry function. gdb/testsuite/ChangeLog: * gdb.arch/arm-cmse-sgstubs.c: New test. * gdb.arch/arm-cmse-sgstubs.exp: New file.
2019-07-23 12:21:11 +02:00
2019-07-23 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* arm-tdep.c (arm_skip_cmse_entry): New function.
(arm_is_sgstubs_section): New function.
(arm_skip_stub): Add call to arm_skip_cmse_entry function.
2019-07-22 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_win_info::make_invisible_and_set_new_height):
Don't self-assign.
gdb: Show type summary for anonymous structures from c_print_typedef Currently each language has a la_print_typedef method, this is only used for the "info types" command. The documentation for "info types" says: Print a brief description of all types whose names match the regular expression @var{regexp} (or all types in your program, if you supply no argument). However, if we consider this C code: typedef struct { int a; } my_type; Then currently with "info types" this will be printed like this: 3: typedef struct { int a; } my_type; I see two problems with this, first the indentation is clearly broken, second, if the struct contained more fields then it feels like the actual type names could easily get lost in the noise. Given that "info types" is about discovering type names, I think there is an argument to be made that we should focus on giving _only_ the briefest summary for "info types", and if the user wants to know more they can take the type name and plug it into "ptype". As such, I propose that a better output would be: 3: typedef struct {...} my_type; The user understands that there is a type called `my_type`, and that it's an alias for an anonymous structure type. The change to achieve this turns out to be pretty simple, but only effects languages that make use of c_print_typedef, which are C, C++, asm, minimal, d, go, objc, and opencl. Other languages will for now do whatever they used to do. The patch to change how anonymous structs are displayed also changes the display of anonymous enums, consider this code sample: typedef enum { AA, BB, CC } anon_enum_t; This used to be displayed like this: 3: typedef enum {AA, BB, CC} anon_enum_t; Which will quickly become cluttered for enums with a large number of values. The modified output looks like this: 3: typedef enum {...} anon_enum_t; Again, the user can always make use of ptype if they want to see the details of the anon_enum_t type. It is worth pointing out that this change (to use {...}) only effects anonymous structs and enums, named types don't change with this patch, consider this code: struct struct_t { int i; }; enum enum_t { AA, BB, CC }; The output from 'info types' remains unchanged, like this: 4: enum enum_t; 1: struct struct_t; An additional area of interest is how C++ handles anonymous types used within a typedef; enums are handled basically inline with how C handles them, but structs (and classes) are slightly different. The behaviour before the patch is different, and is unchanged by this patch. Consider this code compiled for C++: typedef struct { int i; } struct_t; Both before and after this patch, this is show by 'info types' as: 3: typedef struct_t struct_t; Unions are displayed similarly to structs in both C and C++, the handling of anonymous unions changes for C in the same way that it changes for anonymous structs. I did look at ada, as this is the only language to actually have some tests for "info types", however, as I understand it ada doesn't really support typedefs, however, by forcing the language we can see what ada would print. So, if we 'set language ada', then originally we printed this: 3: record a: int; end record Again the indentation is clearly broken, but we also have no mention of the type name at all, which is odd, but understandable given the lack of typedefs. If I make a similar change as I'm proposing for C, then we now get this output: 3: record ... end record Which is even less informative I think. However, the original output _is_ tested for in gdb.ada/info_auto_lang.exp, and its not clear to me if the change is a good one or not, so for now I have left this out. gdb/ChangeLog: * c-typeprint.c (c_print_typedef): Pass -1 instead of 0 to type_print. gdb/testsuite/ChangeLog: * gdb.ada/info_auto_lang.exp: Update expected results. * gdb.base/info-types.c: Add additional types to check. * gdb.base/info-types.exp: Update expected results.
2019-07-12 12:26:32 +02:00
2019-07-22 Andrew Burgess <andrew.burgess@embecosm.com>
* c-typeprint.c (c_print_typedef): Pass -1 instead of 0 to
type_print.
2019-07-22 Andrew Burgess <andrew.burgess@embecosm.com>
* symtab.c (search_symbols): Adjust msymbol matching type arrays
so that GDB doesn't match any msymbols when searching in the
TYPES_DOMAIN.
(print_symbol_info): Print using typedef_print or type_print based
on the type of the symbol. Add updated FIXME comment moved from...
(_initialize_symtab): ... move and update FIXME comment to above.
2019-07-22 Andrew Burgess <andrew.burgess@embecosm.com>
* NEWS: Mention adding -q option to "info types".
* symtab.c (struct info_types_options): New struct.
(info_types_options_defs): New variable.
(make_info_types_options_def_group): New function.
(info_types_command): Use gdb::option framework to parse options.
(info_types_command_completer): New function.
(_initialize_symtab): Extend the help text on "info types" and
register command completer.
2019-07-21 Christian Biesinger <cbiesinger@google.com>
* symtab.c (lookup_symbol_in_objfile_symtabs): Change int to block_enum.
(lookup_symbol_in_objfile): Change int to block_enum and add a
gdb_assert to make sure block_index is GLOBAL_BLOCK or STATIC_BLOCK.
2019-07-20 Christian Biesinger <cbiesinger@google.com>
* MAINTAINERS (Write After Approval): Add self.
2019-07-19 Andrew Burgess <andrew.burgess@embecosm.com>
* riscv-tdep.c (riscv_push_dummy_code): Write a 4-byte nop
instruction to the dummy code region.
2019-07-19 Tom Tromey <tromey@adacore.com>
* contrib/ari/gdb_ari.sh: Mention C++11, not ISO C 90.
(ARGSUSED, PARAMS, __func__): Remove rules.
2019-07-19 Alan Hayward <alan.hayward@arm.com>
* arm-tdep.c (_initialize_arm_tdep): Remove xml tests.
* features/arm/arm-with-iwmmxt.c: Remove.
* features/arm/arm-with-iwmmxt.xml: Remove.
* features/arm/arm-with-m-fpa-layout.c: Remove.
* features/arm/arm-with-m-fpa-layout.xml: Remove.
* features/arm/arm-with-m-vfp-d16.c: Remove.
* features/arm/arm-with-m-vfp-d16.xml: Remove.
* features/arm/arm-with-m.c: Remove.
* features/arm/arm-with-m.xml: Remove.
* features/arm/arm-with-neon.c: Remove.
* features/arm/arm-with-neon.xml: Remove.
* features/arm/arm-with-vfpv2.c: Remove.
* features/arm/arm-with-vfpv2.xml: Remove.
* features/arm/arm-with-vfpv3.c: Remove.
* features/arm/arm-with-vfpv3.xml: Remove.
2019-07-19 Alan Hayward <alan.hayward@arm.com>
* arm-tdep.c (_initialize_arm_tdep): Add xml regression tests.
2019-07-19 Alan Hayward <alan.hayward@arm.com>
* arch/aarch32.c (aarch32_create_target_description): Create
target descriptions using features.
* arch/arm.c (arm_create_target_description)
(arm_create_mprofile_target_description): Likewise.
* arm-tdep.c (_initialize_arm_tdep): Remove tdesc init calls.
2019-07-19 Alan Hayward <alan.hayward@arm.com>
* Makefile.in: Add new files.
* aarch32-tdep.c: New file.
* aarch32-tdep.h: New file.
* aarch64-linux-nat.c (aarch64_linux_nat_target::read_description):
Call aarch32_read_description.
* arch/aarch32.c: New file.
* arch/aarch32.h: New file.
* arch/arm.c (arm_create_target_description)
(arm_create_mprofile_target_description): New function.
* arch/arm.h (arm_fp_type, arm_m_profile_type): New enum.
(arm_create_target_description)
(arm_create_mprofile_target_description): New declaration.
* arm-fbsd-tdep.c (arm_fbsd_read_description_auxv): Call
read_description functions.
* arm-linux-nat.c (arm_linux_nat_target::read_description):
Likewise.
* arm-linux-tdep.c (arm_linux_core_read_description): Likewise.
* arm-tdep.c (tdesc_arm_list): New variable.
(arm_register_g_packet_guesses): Call create description functions.
(arm_read_description) (arm_read_mprofile_description): New
function.
* arm-tdep.h (arm_read_description)
(arm_read_mprofile_description): Add declaration.
* configure.tgt: Add new files.
2019-07-18 Guillaume LABARTHE <guillaume.labarthe@gmail.com>
* top.c (new_ui_command): Open specified terminal just once.
2019-07-18 Tom Tromey <tromey@adacore.com>
* symtab.c (main_name): Constify return type.
* symfile.c (set_initial_language): Update.
* symtab.h (main_name): Constify return type.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_window)
(tui_update_source_window_as_is)
(tui_update_source_windows_with_line): Remove return.
* tui/tui-disasm.c (tui_show_disassem)
(tui_show_disassem_and_update_source): Remove return.
* tui/tui.c (tui_reset): Remove return.
* tui/tui-wingeneral.c
(tui_check_and_display_highlight_if_needed): Remove return.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (parse_scrolling_args): Throw separate errors.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_exec_info_window)
(struct tui_source_window_base): Move from tui-data.h.
* tui/tui-winsource.c: Move many method definitions from
elsewhere. Remove "structuring" comments.
* tui/tui-wingeneral.c (tui_source_window_base::make_visible)
(tui_source_window_base::refresh_window): Move to
tui-winsource.c.
* tui/tui-win.c (tui_source_window_base::refresh_all)
(tui_source_window_base::update_tab_width)
(tui_source_window_base::set_new_height)
(tui_source_window_base::do_make_visible_with_new_height): Move to
tui-winsource.c.
* tui/tui-source.h: Update.
* tui/tui-source.c (tui_source_window_base::reset): Move to
tui-winsource.c.
* tui/tui-disasm.h: Update.
* tui/tui-data.h (struct tui_exec_info_window): Move to
tui-winsource.h.
(struct tui_source_window_base): Likewise.
* tui/tui-data.c (tui_source_window_base::clear_detail)
(tui_source_window_base, ~tui_source_window_base): Move to
tui-winsource.c.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_resize_all)
(tui_source_window_base::update_tab_width)
(tui_adjust_win_heights): Update.
(tui_win_info::make_invisible_and_set_new_height): Rename from
make_invisible_and_set_new_height.
* tui/tui-data.h (struct tui_win_info)
<make_invisible_and_set_new_height>: New method.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui.c: Update.
* tui/tui-source.h (struct tui_source_window): Move from
tui-data.h.
* tui/tui-layout.c: Update.
* tui/tui-disasm.c: Update.
* tui/tui-data.h (struct tui_source_window): Move to
tui-source.h.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.h (struct tui_disasm_window): Move from
tui-data.h.
* tui/tui-data.h (struct tui_disasm_window): Move to
tui-disasm.h.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (struct tui_data_item_window): Move from
tui-data.h.
* tui/tui-regs.c (tui_data_item_window): Move from tui-data.c.
* tui/tui-data.h (struct tui_data_item_window): Move to
tui-regs.h.
* tui/tui-data.c (~tui_data_item_window): Move to tui-regs.c.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui.c: Update.
* tui/tui-win.c (tui_cmd_window::do_make_visible_with_new_height)
(tui_cmd_window::max_height): Move to tui-command.c.
* tui/tui-layout.c: Update.
* tui/tui-data.h (struct tui_cmd_window): Move to tui-command.h.
* tui/tui-data.c (tui_cmd_window::clear_detail): Move to
tui-command.c.
* tui/tui-command.h (struct tui_cmd_window): Move from
tui-data.h.
* tui/tui-command.c: Remove "structuring" comments.
(tui_cmd_window::clear_detail)
(tui_cmd_window::do_make_visible_with_new_height)
(tui_cmd_window::max_height): Move from elsewhere.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-io.c (tui_dispatch_ctrl_char): Move from tui-command.c.
Now static.
* tui/tui-command.h (tui_dispatch_ctrl_char): Don't declare.
* tui/tui-command.c (tui_dispatch_ctrl_char): Move to tui-io.c.
Rearrange TUI data window code An earlier patch caused tui-windata.h to be essentially empty. And, other earlier patches implemented TUI data window methods in any spot that happened to be convenient at the time. This patch rearranges all the data window code to be somewhat more organized. It moves tui_data_window to tui-regs.h, and moves the implementation of all methods to tui-regs.c. It then removes tui-windata.h and tui-windata.c. It also removes the "structuring" comments from tui-regs.c; these are not the usual gdb style, and were out of date anyhow. Finally, it moves _initialize_tui_regs to the end of the file, per the usual gdb convention. gdb/ChangeLog 2019-07-17 Tom Tromey <tom@tromey.com> * tui/tui.c: Update. * tui/tui-wingeneral.c (tui_data_window::refresh_window): Move to tui-regs.c. * tui/tui-windata.h: Remove file. * tui/tui-windata.c: Remove file. * tui/tui-win.c (tui_data_window::set_new_height) (tui_data_window::do_make_visible_with_new_height): Move to tui-regs.c. * tui/tui-regs.h (struct tui_data_window): Move from tui-data.h. * tui/tui-regs.c: Remove "structuring" comments. (tui_data_window::first_data_item_displayed) (tui_data_window::delete_data_content_windows) (tui_data_window::erase_data_content) (tui_data_window::display_all_data) (tui_data_window::refresh_all) (tui_data_window::do_scroll_vertical) (tui_data_window::clear_detail, tui_data_window::set_new_height) (tui_data_window::do_make_visible_with_new_height) (tui_data_window::refresh_window): Move from elsewhere. (_initialize_tui_regs): Move to end of file. * tui/tui-layout.c: Update. * tui/tui-hooks.c: Update. * tui/tui-data.h (struct tui_data_window): Move to tui-regs.h. * tui/tui-data.c (tui_data_window::clear_detail): Move to tui-regs.c. * Makefile.in (SUBDIR_TUI_SRCS): Remove tui-windata.c.
2019-07-02 23:41:08 +02:00
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui.c: Update.
* tui/tui-wingeneral.c (tui_data_window::refresh_window): Move to
tui-regs.c.
* tui/tui-windata.h: Remove file.
* tui/tui-windata.c: Remove file.
* tui/tui-win.c (tui_data_window::set_new_height)
(tui_data_window::do_make_visible_with_new_height): Move to
tui-regs.c.
* tui/tui-regs.h (struct tui_data_window): Move from tui-data.h.
* tui/tui-regs.c: Remove "structuring" comments.
(tui_data_window::first_data_item_displayed)
(tui_data_window::delete_data_content_windows)
(tui_data_window::erase_data_content)
(tui_data_window::display_all_data)
(tui_data_window::refresh_all)
(tui_data_window::do_scroll_vertical)
(tui_data_window::clear_detail, tui_data_window::set_new_height)
(tui_data_window::do_make_visible_with_new_height)
(tui_data_window::refresh_window): Move from elsewhere.
(_initialize_tui_regs): Move to end of file.
* tui/tui-layout.c: Update.
* tui/tui-hooks.c: Update.
* tui/tui-data.h (struct tui_data_window): Move to tui-regs.h.
* tui/tui-data.c (tui_data_window::clear_detail): Move to
tui-regs.c.
* Makefile.in (SUBDIR_TUI_SRCS): Remove tui-windata.c.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-io.c (tui_puts_internal): Call wrefresh if newline is
seen.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_source_window_base::set_new_height)
(tui_source_window_base::do_make_visible_with_new_height): Use
m_has_locator field directly.
* tui/tui-data.h (struct tui_win_info) <has_locator>: Remove
method.
(struct tui_source_window_base) <has_locator>: Likewise.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_make_visible, tui_make_invisible):
Don't declare.
* tui/tui-wingeneral.c (tui_make_visible, tui_make_invisible):
Remove.
* tui/tui-win.c (tui_source_window_base::set_new_height)
(tui_source_window_base::set_new_height)
(make_invisible_and_set_new_height)
(tui_source_window_base::do_make_visible_with_new_height)
(tui_source_window_base::do_make_visible_with_new_height):
Update.
* tui/tui-layout.c (show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Update.
* tui/tui-layout.c (show_layout): Update.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_data_window): Remove.
(show_data): Unify creation and re-initialization cases.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_source_window, make_disasm_window):
Remove.
(show_data): Unify creation and re-initialization cases.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_command_window): Remove.
(show_source_disasm_command, show_source_or_disasm_and_command):
Unify creation and re-initialization cases.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_or_disasm_and_command): Unify
creation and re-initialization cases.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_get_register): Return void.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_gen_win_info::make_visible):
Simplify.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_disasm_command): Simplify window
resetting.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui.h (tui_set_layout_by_name): Don't declare.
* tui/tui-regs.c (tui_reg_layout): New function.
(tui_show_registers, tui_reg_command): Use it.
* tui/tui-layout.c (LAYOUT_USAGE): Remove.
(tui_layout_command): Rename from tui_set_layout_by_name. Change
parameters.
(tui_layout_command): Remove.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.h (tui/tui-layout): Return void.
* tui/tui-layout.c (tui_set_layout): Return void. Add assert.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_disasm_command, show_data):
Update.
(reset_locator): Remove.
(show_source_or_disasm_and_command): Update.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_source_window_base::reset): Remove
win_type parameter.
* tui/tui-layout.c (make_command_window, make_source_window)
(make_disasm_window, make_data_window)
(show_source_disasm_command, show_data, tui_gen_win_info::reset)
(reset_locator, show_source_or_disasm_and_command): Update.
* tui/tui-data.h (struct tui_gen_win_info) <reset>: Remove
win_type parameter.
(struct tui_source_window_base) <reset>: Likewise.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_disasm_command): Use
reset_locator.
(reset_locator): New function.
(init_and_make_win): Remove.
(show_source_or_disasm_and_command): Use reset_locator.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_set_exec_info_content): Remove
condition.
* tui/tui-wingeneral.c (tui_source_window_base::make_visible):
Remove condition.
* tui/tui-source.c (tui_source_window_base::reset): New method.
* tui/tui-layout.c (make_command_window): Don't call
init_and_make_win.
(make_source_window, make_disasm_window): Don't call
make_source_or_disasm_window.
(make_data_window): Don't call init_and_make_win. Change calling
convention.
(show_source_disasm_command, show_data): Simplify.
(make_source_or_disasm_window): Remove.
(show_source_or_disasm_and_command): Simplify.
* tui/tui-data.h (struct tui_gen_win_info) <reset>: Now virtual.
(struct tui_source_window_base) <reset>: Likewise.
<execution_info>: Remove initializer.
* tui/tui-data.c (tui_source_window_base): Initialize
execution_info.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (tui_set_layout): Remove regs_populate
variable.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_rl_other_window): Update.
* tui/tui-wingeneral.c (tui_data_window::refresh_window): Call
superclass method first. Always iterate over regs_content.
(tui_unhighlight_win, tui_highlight_win): Use refresh_window
method.
* tui/tui-win.c (tui_set_focus_command): Update.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_set_focus_command): Rename from
tui_set_focus. Call tui_enable.
(tui_set_focus_command): Remove.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_show_exec_info_content): Don't call
refresh_window.
* tui/tui-wingeneral.c (tui_gen_win_info::refresh_window): Call
touchwin.
(tui_data_window::refresh_window): Call refresh_window on data
items. Always call superclass refresh_window.
(tui_win_info::refresh): Remove.
(tui_source_window_base::refresh_window): Update.
(tui_refresh_all): Update.
* tui/tui-layout.c (show_source_disasm_command): Remove call to
refresh_window.
(show_source_or_disasm_and_command): Likewise.
* tui/tui-data.h (struct tui_win_info) <refresh>: Remove.
(struct tui_source_window_base) <refresh>: Likewise.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_clear_source_content)
(tui_show_source_content): Update.
* tui/tui-source.c (tui_source_window::showing_source_p): Check
whether content is empty.
* tui/tui-data.h (struct tui_source_window_base) <content_in_use>:
Remove.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_erase_source_content): Clear the
window's contents.
* tui/tui-source.h (tui_set_source_content_nil): Don't declare.
* tui/tui-source.c (tui_set_source_content_nil): Remove.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (UNDEFINED_ITEM): Remove define.
(struct tui_data_item_window): Update.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (MAX_CONTENT_COUNT, TUI_NULL_STR)
(DEFAULT_HISTORY_COUNT, WITH_LOCATOR, NO_LOCATOR): Remove
defines.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_erase_source_content)
(tui_clear_source_content): Remove "display_prompt" parameter.
* tui/tui-winsource.c (tui_update_source_window_as_is)
(tui_update_source_windows_with_addr): Update.
(tui_clear_source_content): Remove "display_prompt" parameter.
(tui_erase_source_content): Likewise. Simplify.
(tui_show_source_content): Update.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Update.
* tui/tui-stack.c (tui_show_frame_info): Update.
* tui/tui-data.h (EMPTY_SOURCE_PROMPT, NO_EMPTY_SOURCE_PROMPT):
Remove defines.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
* tui/tui-disasm.h (tui_set_disassem_content): Add win_info
parameter.
* tui/tui-disasm.c (tui_set_disassem_content): Add win_info
parameter.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_clear_source_content)
(tui_show_source_content, tui_show_exec_info_content)
(tui_clear_exec_info_content): Update.
* tui/tui-stack.c (tui_show_locator_content): Update.
(tui_show_frame_info): Update.
* tui/tui-source.h (tui_source_window): Don't declare.
* tui/tui-source.c (tui_source_window::showing_source_p): Rename
from tui_source_is_displayed.
* tui/tui-data.h (struct tui_gen_win_info) <content_in_use>:
Remove field.
(struct tui_source_window_base) <content_in_use>: New field. Now
bool.
(struct tui_source_window) <showing_source_p>: New method.
(TUI_SRC_WIN): Change cast.
* tui/tui-data.c (tui_initialize_static_data): Update.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_breakpoint_info): Use
location_matches_p.
* tui/tui-source.c (tui_source_window::location_matches_p): New
method.
* tui/tui-disasm.c (tui_disasm_window::location_matches_p): New
method.
* tui/tui-data.h (struct tui_source_window_base)
<location_matches_p>: New method.
(struct tui_source_window, struct tui_disasm_window)
<location_matches_p>: Likewise.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_set_win_height_command): Rename from
tui_set_win_height.
(tui_set_win_height_command): Remove.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_source_window): New constructor. Add
observer.
(~tui_source_window): New destructor.
(tui_source_window::style_changed): New method.
* tui/tui-hooks.c (tui_redisplay_source): Remove.
(tui_attach_detach_observers): Update.
* tui/tui-data.h (struct tui_source_window): Make constructor not
inline. Add destructor.
(struct tui_source_window) <style_changed>: New method.
<m_observable>: New member.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-data.c (tui_clear_source_windows_detail): Fix typo.
* tui/tui-win.c (tui_resize_all): Fix typo.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_refresh_all): Update.
* tui/tui-wingeneral.c (make_all_visible): Use foreach.
(tui_refresh_all): Remove "list" parameter. Use foreach.
* tui/tui-win.c (window_name_completer): Use foreach.
(tui_refresh_all_win, tui_rehighlight_all, tui_all_windows_info)
(update_tab_width): Likewise.
* tui/tui-layout.c (show_layout): Update.
* tui/tui-data.h (class tui_window_iterator): New.
(struct all_tui_windows): New.
* tui/tui-data.c (tui_partial_win_by_name): Use foreach.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_reg_next, tui_reg_prev): Add "current_group"
parameter. Don't reference globals.
(tui_reg_command): Update.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_show_registers): Simplify.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_show_registers): Update.
(tui_show_register_group): Add win_info parameter.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_data_window::display_reg_element_at_line):
Rename from tui_display_reg_element_at_line.
(tui_data_window::display_registers_from_line): Update.
* tui/tui-data.h (struct tui_data_window)
<display_reg_element_at_line>: New method.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (tui_display_registers_from)
(tui_display_registers_from_line): Don't declare.
* tui/tui-windata.c (tui_data_window::display_all_data)
(tui_data_window::refresh_all)
(tui_data_window::do_scroll_vertical): Update.
* tui/tui-regs.c (tui_data_window::display_registers_from): Rename
from tui_display_registers_from.
(tui_display_reg_element_at_line): Update.
(tui_data_window::display_registers_from_line): Rename from
tui_display_registers_from_line.
* tui/tui-data.h (struct tui_data_window) <display_registers_from,
display_registers_from_line>: New methods.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_erase_data_content): Don't declare.
* tui/tui-windata.c (tui_data_window::erase_data_content): Rename
from tui_erase_data_content.
(tui_data_window::display_all_data)
(tui_data_window::refresh_all)
(tui_data_window::do_scroll_vertical): Update.
* tui/tui-regs.c (tui_show_registers): Update.
* tui/tui-data.h (struct tui_data_window) <erase_data_content>:
New method.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_delete_data_content_windows): Don't
declare.
* tui/tui-windata.c
(tui_data_window::delete_data_content_windows): Rename from
tui_delete_data_content_windows.
(tui_data_window::display_all_data)
(tui_data_window::do_scroll_vertical): Update.
* tui/tui-data.h (struct tui_data_window)
<delete_data_content_windows>: New method.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_refresh_data_win): Don't declare.
* tui/tui-regs.h (tui_first_reg_element_inline): Don't declare.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_display_all_data): Don't declare.
* tui/tui-windata.c (tui_data_window::display_all_data): Rename
from tui_display_all_data.
* tui/tui-win.c
(tui_data_window::do_make_visible_with_new_height): Update.
* tui/tui-regs.c (tui_show_registers): Update.
* tui/tui-layout.c (tui_set_layout): Update.
* tui/tui-data.h (struct tui_data_window) <display_all_data>: New
method.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_display_data_from): Don't declare.
* tui/tui-windata.c (tui_display_data_from): Remove.
(tui_data_window::refresh_all): Update.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_display_data_from_line): Don't declare.
* tui/tui-windata.c (tui_display_data_from_line): Remove.
(tui_display_data_from, tui_data_window::do_scroll_vertical): Call
tui_display_registers_from_line.
* tui/tui-regs.h (tui_display_registers_from_line): Update.
* tui/tui-regs.c (tui_display_registers_from_line): Remove
"force_display" parameter.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (tui_first_reg_element_no_inline): Don't
declare.
* tui/tui-regs.c (tui_data_window::first_reg_element_no_inline):
Rename from tui_first_reg_element_no_inline.
(tui_display_reg_element_at_line)
(tui_display_registers_from_line): Update.
* tui/tui-data.h (struct tui_data_window)
<first_reg_element_no_inline>: New method.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-windata.c (tui_display_data_from)
(tui_data_window::do_scroll_vertical): Update.
* tui/tui-regs.h (tui_line_from_reg_element_no): Don't declare.
* tui/tui-regs.c (tui_data_window::line_from_reg_element_no):
Rename from tui_line_from_reg_element_no.
(tui_display_registers_from_line): Update.
* tui/tui-data.h (struct tui_data_window)
<line_from_reg_element_no>: New method.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-regs.h (tui_last_regs_line_no): Don't declare.
* tui/tui-regs.c (tui_data_window::last_regs_line_no): Rename from
tui_last_regs_line_no.
(tui_display_reg_element_at_line)
(tui_display_registers_from_line): Update.
* tui/tui-data.h (struct tui_data_window) <last_regs_line_no>: New
method.
2019-07-17 Tom Tromey <tom@tromey.com>
PR tui/24722:
* tui/tui-winsource.h (tui_update_all_breakpoint_info)
(tui_update_breakpoint_info): Add "being_deleted" parameter.
* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
(tui_update_all_breakpoint_info): Add "being_deleted" parameter.
(tui_update_breakpoint_info): Likewise.
* tui/tui-hooks.c (tui_event_create_breakpoint)
(tui_event_delete_breakpoint, tui_event_modify_breakpoint):
Update.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_show_frame_info): Consolidate "if"s.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_window_as_is)
(tui_update_source_windows_with_addr): Update.
* tui/tui-source.h (tui_set_source_content)
(tui_show_symtab_source): Add "win_info" parameter.
* tui/tui-source.c (tui_set_source_content): Add "win_info"
parameter.
(tui_show_symtab_source): Likewise.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c
(tui_check_and_display_highlight_if_needed): Check can_highlight.
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_win_info) <can_scroll>: New method.
(struct tui_cmd_window) <can_scroll>: New method.
* tui/tui-command.c (tui_dispatch_ctrl_char): Use can_scroll
method.
Rename field_int to field_signed This renames ui_out::field_int to field_signed, and field_fmt_int to field_fmt_signed; and changes the type of the "value" parameter from int to LONGEST. Tested by the buildbot. gdb/ChangeLog 2019-07-17 Tom Tromey <tromey@adacore.com> * ui-out.h (class ui_out) <field_signed, field_fmt_signed, do_field_signed>: Rename. Change type of "value". * ui-out.c (ui_out::field_signed): Rename from field_int. Change type of "value". (ui_out::field_fmt_signed): Rename from field_fmt_int. Change type of "value". * tui/tui-out.h (class tui_ui_out) <do_field_signed>: Rename from do_field_int. Change type of "value". * tui/tui-out.c (tui_ui_out::do_field_signed): Rename from do_field_int. Change type of "value". * tracepoint.c (trace_status_mi, tfind_1) (print_one_static_tracepoint_marker): Update. * thread.c (print_thread_info_1, print_selected_thread_frame): Update. * stack.c (print_frame, print_frame_info): Update. * spu-tdep.c (info_spu_signal_command, info_spu_dma_cmdlist): Update. * source.c (print_source_lines_base): Update. * skip.c (info_skip_command): Update. * record-btrace.c (btrace_ui_out_decode_error) (btrace_call_history_src_line): Update. * python/py-framefilter.c (py_print_single_arg, py_print_frame): Update. * progspace.c (print_program_space): Update. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Update. * mi/mi-out.h (class mi_ui_out) <do_field_signed>: Rename from do_field_int. Change type of "value". * mi/mi-out.c (mi_ui_out::do_table_begin) (mi_ui_out::do_table_header): Update. (mi_ui_out::do_field_signed): Rename from do_field_int. Change type of "value". * mi/mi-main.c (mi_cmd_thread_list_ids, print_one_inferior) (mi_cmd_data_list_changed_registers, output_register) (mi_cmd_data_read_memory, mi_load_progress) (mi_cmd_trace_frame_collected): Update. * mi/mi-interp.c (mi_on_normal_stop_1, mi_output_solib_attribs): Update. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create) (mi_cmd_var_delete, mi_cmd_var_info_num_children) (mi_cmd_var_list_children, varobj_update_one): Update. * mi/mi-cmd-stack.c (mi_cmd_stack_info_depth) (mi_cmd_stack_list_args, list_arg_or_local): Update. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Update. * inferior.c (print_inferior): Update. * gdb_bfd.c (print_one_bfd): Update. * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Update. * darwin-nat-info.c (darwin_debug_regions_recurse): Update. * cli-out.h (class cli_ui_out) <do_field_signed>: Rename from do_field_int. Change type of "value". * cli-out.c (cli_ui_out::do_field_signed): Rename from do_field_int. Change type of "value". * breakpoint.c (watchpoint_check, print_breakpoint_location) (print_one_breakpoint_location, print_it_catch_fork) (print_one_catch_fork, print_it_catch_vfork) (print_one_catch_vfork, print_it_catch_solib) (print_it_catch_exec, print_it_ranged_breakpoint) (print_mention_watchpoint, print_mention_masked_watchpoint) (bkpt_print_it, update_static_tracepoint): Update. * break-catch-throw.c (print_it_exception_catchpoint): Update. * break-catch-syscall.c (print_it_catch_syscall): Update. * ada-tasks.c (print_ada_task_info): Update. * ada-lang.c (print_it_exception, print_mention_exception): Update.
2019-07-17 16:34:23 +02:00
2019-07-17 Tom Tromey <tromey@adacore.com>
* ui-out.h (class ui_out) <field_signed, field_fmt_signed,
do_field_signed>: Rename. Change type of "value".
* ui-out.c (ui_out::field_signed): Rename from field_int.
Change type of "value".
(ui_out::field_fmt_signed): Rename from field_fmt_int. Change
type of "value".
* tui/tui-out.h (class tui_ui_out) <do_field_signed>: Rename from
do_field_int. Change type of "value".
* tui/tui-out.c (tui_ui_out::do_field_signed): Rename from
do_field_int. Change type of "value".
* tracepoint.c (trace_status_mi, tfind_1)
(print_one_static_tracepoint_marker): Update.
* thread.c (print_thread_info_1, print_selected_thread_frame):
Update.
* stack.c (print_frame, print_frame_info): Update.
* spu-tdep.c (info_spu_signal_command, info_spu_dma_cmdlist):
Update.
* source.c (print_source_lines_base): Update.
* skip.c (info_skip_command): Update.
* record-btrace.c (btrace_ui_out_decode_error)
(btrace_call_history_src_line): Update.
* python/py-framefilter.c (py_print_single_arg, py_print_frame):
Update.
* progspace.c (print_program_space): Update.
* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Update.
* mi/mi-out.h (class mi_ui_out) <do_field_signed>: Rename from
do_field_int. Change type of "value".
* mi/mi-out.c (mi_ui_out::do_table_begin)
(mi_ui_out::do_table_header): Update.
(mi_ui_out::do_field_signed): Rename from do_field_int. Change
type of "value".
* mi/mi-main.c (mi_cmd_thread_list_ids, print_one_inferior)
(mi_cmd_data_list_changed_registers, output_register)
(mi_cmd_data_read_memory, mi_load_progress)
(mi_cmd_trace_frame_collected): Update.
* mi/mi-interp.c (mi_on_normal_stop_1, mi_output_solib_attribs):
Update.
* mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create)
(mi_cmd_var_delete, mi_cmd_var_info_num_children)
(mi_cmd_var_list_children, varobj_update_one): Update.
* mi/mi-cmd-stack.c (mi_cmd_stack_info_depth)
(mi_cmd_stack_list_args, list_arg_or_local): Update.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Update.
* inferior.c (print_inferior): Update.
* gdb_bfd.c (print_one_bfd): Update.
* disasm.c (gdb_pretty_print_disassembler::pretty_print_insn):
Update.
* darwin-nat-info.c (darwin_debug_regions_recurse): Update.
* cli-out.h (class cli_ui_out) <do_field_signed>: Rename from
do_field_int. Change type of "value".
* cli-out.c (cli_ui_out::do_field_signed): Rename from
do_field_int. Change type of "value".
* breakpoint.c (watchpoint_check, print_breakpoint_location)
(print_one_breakpoint_location, print_it_catch_fork)
(print_one_catch_fork, print_it_catch_vfork)
(print_one_catch_vfork, print_it_catch_solib)
(print_it_catch_exec, print_it_ranged_breakpoint)
(print_mention_watchpoint, print_mention_masked_watchpoint)
(bkpt_print_it, update_static_tracepoint): Update.
* break-catch-throw.c (print_it_exception_catchpoint): Update.
* break-catch-syscall.c (print_it_catch_syscall): Update.
* ada-tasks.c (print_ada_task_info): Update.
* ada-lang.c (print_it_exception, print_mention_exception):
Update.
2019-07-17 Andrew Burgess <andrew.burgess@embecosm.com>
PR breakpoints/24541
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* gdbarch.sh: Adjust return type and parameter types for
'stap_adjust_register'.
(i386_stap_adjust_register): Adjust signature and return new
register name.
* stap-probe.c (stap_parse_register_operand): Adjust use of
'gdbarch_stap_adjust_register'.
2019-07-17 Tom Tromey <tromey@adacore.com>
* s390-linux-nat.c (s390_watch_area): Remove typedef. Don't
declare VEC.
(struct s390_debug_reg_state) <watch_areas, break_areas>: Now
std::vector.
(struct s390_process_info): Add initializers.
(s390_add_process): Use new.
(s390_linux_nat_target::low_forget_process): Use delete.
(s390_linux_nat_target::low_new_fork)
(s390_linux_nat_target::stopped_by_watchpoint)
(s390_linux_nat_target::low_prepare_to_resume)
(s390_linux_nat_target::insert_watchpoint)
(s390_linux_nat_target::insert_hw_breakpoint)
(s390_linux_nat_target::remove_watchpoint)
(s390_linux_nat_target::remove_hw_breakpoint): Update.
2019-07-16 John Baldwin <jhb@FreeBSD.org>
* aarch64-fbsd-nat.c: Include regcache.h.
(getregs_supplies, getfpregs_supplies): Remove unused gdbarch
argument.
(aarch64_fbsd_nat_target::fetch_registers)
(aarch64_fbsd_nat_target::store_registers): Remove gdbarch
variable.
* arm-fbsd-nat.c, riscv-fbsd-nat.c: Likewise.
2019-07-16 John Baldwin <jhb@FreeBSD.org>
* fbsd-nat.c: Include gdbarch.h.
2019-07-15 Tom Tromey <tromey@adacore.com>
* mi/mi-out.c (mi_ui_out::do_field_int): Use plongest.
2019-07-15 Tom Tromey <tromey@adacore.com>
* mi/mi-out.h (class mi_ui_out) <do_field_unsigned>: Declare.
* mi/mi-out.c (mi_ui_out::do_field_unsigned): New method.
* cli-out.h (class cli_ui_out) <do_field_unsigned>: Declare.
* cli-out.c (cli_ui_out::do_field_int): New method.
* ui-out.c (ui_out::field_unsigned): New method.
* symfile.c (generic_load): Use field_unsigned.
(print_transfer_performance): Likewise.
* record-btrace.c (ui_out_field_uint): Remove.
(btrace_call_history_insn_range, btrace_call_history): Use
field_unsigned.
* disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Use
field_unsigned.
* ui-out.h (class ui_out) <field_unsigned>: New method.
<do_field_unsigned>: Likewise.
2019-07-15 Tom Tromey <tromey@adacore.com>
* mi/mi-main.c (list_available_thread_groups): Use field_string.
* mi/mi-interp.c (mi_memory_changed): Use field_string.
* target.c (flash_erase_command): Use field_string.
* infrun.c (print_signal_received_reason): Use field_string.
* i386-tdep.c (i386_mpx_print_bounds): Use field_string.
* breakpoint.c (maybe_print_thread_hit_breakpoint): Use
field_string.
* ada-tasks.c (print_ada_task_info): Use field_string.
2019-07-15 Tom Tromey <tromey@adacore.com>
* target.c (flash_erase_command): Use field_core_addr.
* symfile.c (generic_load): Use field_core_addr.
* sparc64-linux-tdep.c (sparc64_linux_handle_segmentation_fault):
Use field_core_addr.
* i386-linux-tdep.c (i386_linux_handle_segmentation_fault): Use
field_core_addr.
2019-07-12 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2loc.c (dwarf2_evaluate_property): Sign extend property
value if its desired type is smaller than a CORE_ADDR and signed.
gdb: Carry default property type around with dynamic properties This commit is preparation for the next one, with the aim of better supporting signed dynamic properties on targets where the address size specified in the DWARF headers is smaller than a CORE_ADDR, for example debugging an i386 application on x86-64. Consider this small Fortran program 'bounds.f90': program test integer, allocatable :: array (:) allocate (array (-5:5)) array(3) = 1 end program test Compiled with 'gfortran -m32 -g3 -O0 -o bounds bounds.f90'. The DWARF for 'array' looks like this: <2><97>: Abbrev Number: 10 (DW_TAG_variable) <98> DW_AT_name : (indirect string, offset: 0x0): array <9c> DW_AT_decl_file : 1 <9d> DW_AT_decl_line : 2 <9e> DW_AT_type : <0xaf> <a2> DW_AT_location : 2 byte block: 91 58 (DW_OP_fbreg: -40) <2><a5>: Abbrev Number: 11 (DW_TAG_lexical_block) <a6> DW_AT_low_pc : 0x80485c3 <aa> DW_AT_high_pc : 0x8b <2><ae>: Abbrev Number: 0 <1><af>: Abbrev Number: 12 (DW_TAG_array_type) <b0> DW_AT_data_location: 2 byte block: 97 6 (DW_OP_push_object_address; DW_OP_deref) <b3> DW_AT_allocated : 4 byte block: 97 6 30 2e (DW_OP_push_object_address; DW_OP_deref; DW_OP_lit0; DW_OP_ne) <b8> DW_AT_type : <0x2a> <2><bc>: Abbrev Number: 13 (DW_TAG_subrange_type) <bd> DW_AT_lower_bound : 4 byte block: 97 23 10 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 16; DW_OP_deref) <c2> DW_AT_upper_bound : 4 byte block: 97 23 14 6 (DW_OP_push_object_address; DW_OP_plus_uconst: 20; DW_OP_deref) <c7> DW_AT_byte_stride : 6 byte block: 97 23 c 6 34 1e (DW_OP_push_object_address; DW_OP_plus_uconst: 12; DW_OP_deref; DW_OP_lit4; DW_OP_mul) <2><ce>: Abbrev Number: 0 If we look at the DW_AT_lower_bound attribute, which will become a dynamic property that GDB evaluates when needed by calling dwarf2_evaluate_property. The process of evaluating a dynamic property requires GDB to execute each DW_OP_* operation, the results of these operations is held on a stack of 'struct value *'s. When the entire expression is evaluated the result is on top of the stack. If we look at DW_AT_lower_bound then the last operation is DW_OP_deref, this loads a signed address the size of which matches the DWARF address size, and so in our i386 on x86-64 situation, the top of the stack will be a signed 4-byte value. The problem is how these values are fetched from the stack. Currently they are always fetched by a call to dwarf_expr_context::fetch_address, which converts the value to an unsigned value with a length matching the values current length, before converting to a CORE_ADDR. This means we loose the signed nature of the property. I wonder if the best solution for dealing with signed properties will be to move away from an over reliance on fetch_address, and instead come up with a new solution that considers the current type of the value on the stack, and the type that the value needs to become; basically a solution built around casting rather than assuming we always want an address. However, before we can start to even think about moving away from fetch_address, there is a more urgent issue to fix, which is we don't currently know what type each property should be. We just hold the value of the property in a CORE_ADDR as returned by fetch_address, and rely on higher level code (outside of the DWARF expression evaluation code) to fix things up for us. This is what this patch aims to address. When creating a dynamic property (see attr_to_dynamic_prop in dwarf2read.c) we can sometimes figure out the type of a property; if the property is a reference to another DIE then it will have a DW_AT_type attribute. However, the DW_AT_lower_bound case above isn't a reference to another DIE, it's just a DWARF expression. We don't have any indication for what type the property should have. Luckily, the DWARF spec helps us out, for the lower and upper bounds 5.13 of the DWARFv5 spec tells us that without any other type information the bounds are signed integers the same size as a DWARF address. It is my belief that we can find a suitable default type for every dynamic property, either specified explicitly in the DWARF spec, or we can infer an obvious choice if the spec doesn't help us. This commit extends the creation of all dynamic properties to include suggesting a suitable default type, all dynamic properties now always carry their type around with them. In later commits we can use this property type to ensure that the value we extract from the DWARF stack is handled in a suitable manor to correctly maintain its sign extension. There should be no user visible changes from this commit. The actual fix to correctly support negative array bounds will come later. gdb/ChangeLog: * dwarf2loc.c (dwarf2_evaluate_property): Update to take account of changes to field names, and use new is_reference field to decide if a property is a reference or not. * dwarf2loc.h (struct dwarf2_locexpr_baton): Add 'is_reference' field. (struct dwarf2_property_baton): Update header comment, rename 'referenced_type' to 'property_type' and update comments. * dwarf2read.c (attr_to_dynamic_prop): Add extra parameter to hold default property type, store in property baton, update to take accound of renamed field. (read_func_scope): Update call to attr_to_dynamic_prop. (read_array_type): Likewise. (dwarf2_per_cu_addr_sized_int_type): New function. (read_subrange_index_type): Move type finding code to dwarf2_per_cu_addr_sized_int_type. (read_subrange_type): Update calls to attr_to_dynamic_prop. (dwarf2_per_cu_addr_type): New function. (set_die_type): Update calls to attr_to_dynamic_prop.
2019-05-08 14:16:03 +02:00
2019-07-12 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2loc.c (dwarf2_evaluate_property): Update to take account
of changes to field names, and use new is_reference field to
decide if a property is a reference or not.
* dwarf2loc.h (struct dwarf2_locexpr_baton): Add 'is_reference'
field.
(struct dwarf2_property_baton): Update header comment, rename
'referenced_type' to 'property_type' and update comments.
* dwarf2read.c (attr_to_dynamic_prop): Add extra parameter to hold
default property type, store in property baton, update to take
accound of renamed field.
(read_func_scope): Update call to attr_to_dynamic_prop.
(read_array_type): Likewise.
(dwarf2_per_cu_addr_sized_int_type): New function.
(read_subrange_index_type): Move type finding code to
dwarf2_per_cu_addr_sized_int_type.
(read_subrange_type): Update calls to attr_to_dynamic_prop.
(dwarf2_per_cu_addr_type): New function.
(set_die_type): Update calls to attr_to_dynamic_prop.
2019-07-12 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2read.c (read_subrange_index_type): New function.
(read_subrange_type): Move code into new function and call it.
* gdbtypes.c (create_range_type): Add some asserts.
2019-07-12 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2loc.c (dwarf2_evaluate_property): Change return type, and
update return statements.
* dwarf2loc.h (dwarf2_evaluate_property): Update return type on
declaration, and update comment to match.
* gdbtypes.c (resolve_dynamic_array): Update call to
dwarf2_evaluate_property to match new return type.
2019-07-12 Andrew Burgess <andrew.burgess@embecosm.com>
* valarith.c (value_subscripted_rvalue): Change lowerbound
parameter type from int to LONGEST.
* value.h (value_subscripted_rvalue): Likewise in declaration.
2019-07-11 Andrew Burgess <andrew.burgess@embecosm.com>
* cli/cli-utils.c (info_print_command_completer): New function.
* cli/cli-utils.h: Add 'completer.h' include, and forward
declaration for 'struct cmd_list_element'.
(info_print_command_completer): Declare.
* stack.c (_initialize_stack): Add completer for 'info locals' and
'info args'.
* symtab.c (_initialize_symtab): Add completer for 'info
variables' and 'info functions'.
* NEWS: Mention completion for additional info commands.
2019-07-11 Andrew Burgess <andrew.burgess@embecosm.com>
* cli/cli-utils.c (extract_info_print_args): Delete.
(extract_arg_maybe_quoted): Delete.
(info_print_options_defs): New variable.
(make_info_print_options_def_group): New function.
(extract_info_print_options): Define new function.
* cli/cli-utils.h (extract_info_print_args): Delete.
(struct info_print_options): New structure.
(extract_info_print_options): Declare new function.
* stack.c (info_locals_command): Update to use new
extract_info_print_options, also add a header comment.
(info_args_command): Likewise.
* symtab.c (info_variables_command): Likewise.
(info_functions_command): Likewise.
2019-07-11 Andrew Burgess <andrew.burgess@embecosm.com>
* cli/cli-option.c (parse_option): Use extract_string_maybe_quoted
to extract string arguments.
* common/common-utils.c (extract_string_maybe_quoted): New function.
* common/common-utils.h (extract_string_maybe_quoted): Declare.
2019-07-11 Tom Tromey <tromey@adacore.com>
* main.c (get_init_files): Use GDBINIT, not gdbinit.
* auto-load.c (file_is_auto_load_safe): Use GDBINIT, not gdbinit.
* top.h (gdbinit): Don't declare.
* cli/cli-cmds.c (init_cli_cmds): Remove, merging contents
into...
(_initialize_cli_cmds): ...here. Use GDBINIT, not gdbinit.
* top.c (gdb_init): Don't call init_cli_cmds.
(gdbinit): Remove.
* cli/cli-cmds.h (init_cli_cmds): Don't declare.
2019-07-11 Tom Tromey <tromey@adacore.com>
* python/py-inferior.c (add_thread_object): Don't use thread_obj
after it has been moved.
2019-07-10 Simon Marchi <simon.marchi@polymtl.ca>
* valops.c (value_must_coerce_to_target): Change return type to
bool.
* value.h (value_must_coerce_to_target): Likewise.
2019-07-10 Simon Marchi <simon.marchi@efficios.com>
* breakpoint.c (is_hardware_watchpoint): Remove
forward-declaration.
(is_masked_watchpoint): Change return type to bool.
(is_tracepoint): Likewise.
(is_breakpoint): Likewise.
(is_hardware_watchpoint): Likewise.
(is_watchpoint): Likewise.
(is_no_memory_software_watchpoint): Likewise.
(is_catchpoint): Likewise.
(breakpoint_1): Make FILTER parameter's return type bool.
is_masked_watchpoint): Change return type to bool.
(save_breakpoints): Make FILTER parameter's return type bool.
* breakpoint.h (is_breakpoint): Change return type to bool.
(is_watchpoint): Likewise.
(is_catchpoint): Likewise.
(is_tracepoint): Likewise.
Don't include gdbarch.h from defs.h I touched symtab.h and was surprised to see how many files were rebuilt. I looked into it a bit, and found that defs.h includes gdbarch.h, which in turn includes many things. gdbarch.h is only needed by a minority ofthe files in gdb, so this patch removes the include from defs.h and updates the fallout. I did "wc -l" on the files in build/gdb/.deps; this patch reduces the line count from 139935 to 137030; so there are definitely future build-time savings here. Note that while I configured with --enable-targets=all, it's possible that some *-nat.c file needs an update. I could not test all of these. The buildbot caught a few problems along these lines. gdb/ChangeLog 2019-07-10 Tom Tromey <tom@tromey.com> * defs.h: Don't include gdbarch.h. * aarch64-ravenscar-thread.c, aarch64-tdep.c, alpha-bsd-tdep.h, alpha-linux-tdep.c, alpha-mdebug-tdep.c, arch-utils.h, arm-tdep.h, ax-general.c, btrace.c, buildsym-legacy.c, buildsym.h, c-lang.c, cli/cli-decode.h, cli/cli-dump.c, cli/cli-script.h, cli/cli-style.h, coff-pe-read.h, compile/compile-c-support.c, compile/compile-cplus.h, compile/compile-loc2c.c, corefile.c, cp-valprint.c, cris-linux-tdep.c, ctf.c, d-lang.c, d-namespace.c, dcache.c, dicos-tdep.c, dictionary.c, disasm-selftests.c, dummy-frame.c, dummy-frame.h, dwarf2-frame-tailcall.c, dwarf2expr.c, expression.h, f-lang.c, frame-base.c, frame-unwind.c, frv-linux-tdep.c, gdbarch-selftests.c, gdbtypes.h, go-lang.c, hppa-nbsd-tdep.c, hppa-obsd-tdep.c, i386-dicos-tdep.c, i386-tdep.h, ia64-vms-tdep.c, interps.h, language.c, linux-record.c, location.h, m2-lang.c, m32r-linux-tdep.c, mem-break.c, memattr.c, mn10300-linux-tdep.c, nios2-linux-tdep.c, objfiles.h, opencl-lang.c, or1k-linux-tdep.c, p-lang.c, parser-defs.h, ppc-tdep.h, probe.h, python/py-record-btrace.c, record-btrace.c, record.h, regcache-dump.c, regcache.h, riscv-fbsd-tdep.c, riscv-linux-tdep.c, rust-exp.y, sh-linux-tdep.c, sh-nbsd-tdep.c, source-cache.c, sparc-nbsd-tdep.c, sparc-obsd-tdep.c, sparc-ravenscar-thread.c, sparc64-fbsd-tdep.c, std-regs.c, target-descriptions.h, target-float.c, tic6x-linux-tdep.c, tilegx-linux-tdep.c, top.c, tracefile.c, trad-frame.c, type-stack.h, ui-style.c, utils.c, utils.h, valarith.c, valprint.c, varobj.c, x86-tdep.c, xml-support.h, xtensa-linux-tdep.c, cli/cli-cmds.h: Update. * s390-linux-nat.c, procfs.c, inf-ptrace.c: Likewise.
2019-06-09 23:21:02 +02:00
2019-07-10 Tom Tromey <tom@tromey.com>
* defs.h: Don't include gdbarch.h.
* aarch64-ravenscar-thread.c, aarch64-tdep.c, alpha-bsd-tdep.h,
alpha-linux-tdep.c, alpha-mdebug-tdep.c, arch-utils.h, arm-tdep.h,
ax-general.c, btrace.c, buildsym-legacy.c, buildsym.h, c-lang.c,
cli/cli-decode.h, cli/cli-dump.c, cli/cli-script.h,
cli/cli-style.h, coff-pe-read.h, compile/compile-c-support.c,
compile/compile-cplus.h, compile/compile-loc2c.c, corefile.c,
cp-valprint.c, cris-linux-tdep.c, ctf.c, d-lang.c, d-namespace.c,
dcache.c, dicos-tdep.c, dictionary.c, disasm-selftests.c,
dummy-frame.c, dummy-frame.h, dwarf2-frame-tailcall.c,
dwarf2expr.c, expression.h, f-lang.c, frame-base.c,
frame-unwind.c, frv-linux-tdep.c, gdbarch-selftests.c, gdbtypes.h,
go-lang.c, hppa-nbsd-tdep.c, hppa-obsd-tdep.c, i386-dicos-tdep.c,
i386-tdep.h, ia64-vms-tdep.c, interps.h, language.c,
linux-record.c, location.h, m2-lang.c, m32r-linux-tdep.c,
mem-break.c, memattr.c, mn10300-linux-tdep.c, nios2-linux-tdep.c,
objfiles.h, opencl-lang.c, or1k-linux-tdep.c, p-lang.c,
parser-defs.h, ppc-tdep.h, probe.h, python/py-record-btrace.c,
record-btrace.c, record.h, regcache-dump.c, regcache.h,
riscv-fbsd-tdep.c, riscv-linux-tdep.c, rust-exp.y,
sh-linux-tdep.c, sh-nbsd-tdep.c, source-cache.c,
sparc-nbsd-tdep.c, sparc-obsd-tdep.c, sparc-ravenscar-thread.c,
sparc64-fbsd-tdep.c, std-regs.c, target-descriptions.h,
target-float.c, tic6x-linux-tdep.c, tilegx-linux-tdep.c, top.c,
tracefile.c, trad-frame.c, type-stack.h, ui-style.c, utils.c,
utils.h, valarith.c, valprint.c, varobj.c, x86-tdep.c,
xml-support.h, xtensa-linux-tdep.c, cli/cli-cmds.h: Update.
* s390-linux-nat.c, procfs.c, inf-ptrace.c: Likewise.
2019-07-10 Tom Tromey <tromey@adacore.com>
* ada-lang.h (is_ada_exception_catchpoint): Declare.
* breakpoint.c (init_ada_exception_breakpoint): Register as
bp_catchpoint.
(print_one_breakpoint_location, print_one_breakpoint): Use
is_ada_exception_catchpoint.
* ada-lang.c (class ada_catchpoint_location): Pass
bp_loc_software_breakpoint to bp_location constructor.
(is_ada_exception_catchpoint): New function.
2019-07-10 Tom Tromey <tromey@adacore.com>
* arm-tdep.c (arm_exidx_entry_s): Remove typedef. Don't define
VEC.
(struct arm_exidx_entry): New method operator<.
(struct arm_exidx_data) <section_maps>: Change type.
(arm_exidx_data_free): Remove.
(arm_exidx_data_key): Change type. Move lower.
(arm_exidx_new_objfile): Update.
(arm_compare_exidx_entries): Remove.
(arm_find_exidx_entry, _initialize_arm_tdep)
2019-07-10 Tom Tromey <tromey@adacore.com>
* solib-spu.c (ocl_program_data_key): Change type.
(append_ocl_sos, ocl_enable_break, _initialize_spu_solib):
Update.
2019-07-10 Tom Tromey <tromey@adacore.com>
* solib-aix.c (lm_info_aix_p): Remove typedef. Don't define VEC.
(struct solib_aix_inferior_data) <library_list>: Change type.
(solib_aix_inferior_data_handle): Change type.
(get_solib_aix_inferior_data): Update.
(solib_aix_free_library_list): Remove.
(library_list_start_library): Update.
(solib_aix_parse_libraries, solib_aix_get_library_list): Change
return type.
(solib_aix_get_library_list)
(solib_aix_solib_create_inferior_hook, solib_aix_current_sos)
(solib_aix_normal_stop_observer, _initialize_solib_aix): Update.
2019-07-10 Tom Tromey <tromey@adacore.com>
* solib-dsbt.c (struct dsbt_info): Add initializers.
(solib_dsbt_pspace_data): Change type.
(dsbt_pspace_data_cleanup): Remove.
(get_dsbt_info, _initialize_dsbt_solib): Update.
2019-07-10 Tom Tromey <tromey@adacore.com>
* spu-tdep.c (spu_overlay_data): Change type.
(spu_get_overlay_table, spu_overlay_new_objfile)
(_initialize_spu_tdep): Update.
2019-07-10 Tom Tromey <tromey@adacore.com>
* gdb-stabs.h (struct dbx_symfile_info): Add initializers and
destructor.
(dbx_objfile_data_key): Change type and declare later.
(DBX_SYMFILE_INFO): Rewrite.
* dbxread.c (dbx_objfile_data_key): Change type.
(dbx_symfile_init): Update.
(~dbx_symfile_info): Rename from dbx_free_symfile_info. Update.
(coffstab_build_psymtabs, elfstab_build_psymtabs)
(stabsect_build_psymtabs, _initialize_dbxread): Update.
2019-07-10 Tom Tromey <tromey@adacore.com>
* jit.c (jit_program_space_key): Change type. Move lower.
(get_jit_program_space_data): Update.
(jit_program_space_data_cleanup): Remove.
(jit_breakpoint_deleted, free_objfile_data, _initialize_jit):
Update.
(struct jit_program_space_data): Add initializers.
2019-07-10 Tom Tromey <tromey@adacore.com>
* solib-darwin.c (struct darwin_info): Add initializers.
(solib_darwin_pspace_data): Change type.
(darwin_pspace_data_cleanup): Remove.
(get_darwin_info, _initialize_darwin_solib): Update.
2019-07-10 Tom Tromey <tromey@adacore.com>
* remote-sim.c (struct sim_inferior_data): Add initializers,
constructor, and destructor.
(sim_inferior_data_key): Change type. Move lower.
(check_for_duplicate_sim_descriptor): Update.
(get_sim_inferior_data): Use new. Update.
(~sim_inferior_data_cleanup): Rename from
sim_inferior_data_cleanup. Simplify.
(gdbsim_close_inferior, simulator_command)
(sim_command_completer, _initialize_remote_sim): Update.
(next_pid, INITIAL_PID): Move earlier.
2019-07-10 Tom Tromey <tromey@adacore.com>
* python/python-internal.h (create_thread_object): Return
gdbpy_ref.
* python/py-infthread.c (create_thread_object): Return gdbpy_ref.
* python/py-inferior.c (struct threadlist_entry): Add
constructor.
<thread_obj>: Now a gdbpy_ref.
(thread_to_thread_object): Update.
(add_thread_object): Use new.
(delete_thread_object): Use delete.
(infpy_threads): Update.
(py_free_inferior): Update. Construct "inf_obj" after acquiring
GIL.
2019-07-10 Tom Tromey <tromey@adacore.com>
* valops.c (value_cast): Specialize error message for Ada.
2019-07-10 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.c (breakpoint_1): Update doc and parameter names.
2019-07-10 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.h (bpstat_explains_signal, bpstat_causes_stop,
bpstat_should_step): Return bool, adjust comments.
* breakpoint.c (bpstat_explains_signal, bpstat_causes_stop,
bpstat_should_step): Likewise.
2019-07-10 Alan Hayward <alan.hayward@arm.com>
* features/Makefile: Use feature target descriptions for Arm.
* features/arm/arm-core.c: Generate new file.
* features/arm/arm-fpa.c: Likewise.
* features/arm/arm-m-profile-with-fpa.xml: Likewise.
* features/arm/arm-m-profile.c: Likewise.
* features/arm/arm-vfpv2.c: Likewise.
* features/arm/arm-vfpv3.c: Likewise.
* features/arm/xscale-iwmmxt.c: Likewise.
* target-descriptions.c (maint_print_c_tdesc_cmd): Add Arm.
2019-07-10 Alan Hayward <alan.hayward@arm.com>
* arm-linux-nat.c (arm_linux_nat_target::read_description): Check
ptrace earlier.
2019-07-10 Alan Hayward <alan.hayward@arm.com>
* features/aarch64-pauth.c: Regenerate.
2019-07-09 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.h (struct bpstat_what) <is_longjmp>: Change type to
bool.
(bpstat_what): Use false instead of 0.
Make "maint info breakpoints" show "catch catch/throw/rethrow" locations This commit makes "maint info breakpoints" show the internal locations of C++ exception catchpoints: (gdb) info breakpoints Num Type Disp Enb Address What 2 catchpoint keep y exception catch With multiple locations: (gdb) maint info breakpoints Num Type Disp Enb Address What 2 catchpoint keep y exception catch 2.1 y 0x000000000040545f <__cxa_begin_catch+95> inf 1 2.2 y 0x00007ffff71dbe0f <__cxxabiv1::__cxa_begin_catch(void*)+95> inf 1 (gdb) With a single location: (gdb) maint info breakpoints 2 Num Type Disp Enb Address What 2 catchpoint keep y exception catch inf 1 2.1 y 0x00007ffff7bc0b7f <__cxa_begin_catch+95> inf 1 With no locations: (gdb) maint info breakpoints 2 Num Type Disp Enb Address What 2 catchpoint keep y exception catch inf 1 Other catchpoints still show the same way, here a catch signal: (gdb) info breakpoints Num Type Disp Enb Address What 3 catchpoint keep y signal "<standard signals>" (gdb) maint info breakpoints Num Type Disp Enb Address What 3 catchpoint keep y signal "<standard signals>" inf 1 (gdb) Note: I considered making the locations be printed from within breakpoint_ops::print_one(), but gave up given the handling for the broken MI v2 output: /* The mi2 broken format: the main breakpoint tuple ends here, the locations are outside. */ if (!use_fixed_output) bkpt_tuple_emitter.reset (); in print_one_breakpoint. gdb/ChangeLog: 2019-07-09 Pedro Alves <palves@redhat.com> * break-catch-throw.c (is_exception_catchpoint): New. * breakpoint.c (print_one_breakpoint_location): New parameter 'raw_loc'. Handle it. Use is_watchpoint/is_catchpoint/is_exception_catchpoint instead of looking at the breakpoint's type. (print_one_breakpoint): If handling "maint info breakpoints", also print locations of exception catchpoints. * breakpoint.h (is_exception_catchpoint): Declare.
2019-07-09 20:26:16 +02:00
2019-07-09 Pedro Alves <palves@redhat.com>
* break-catch-throw.c (is_exception_catchpoint): New.
* breakpoint.c (print_one_breakpoint_location): New parameter
'raw_loc'. Handle it. Use
is_watchpoint/is_catchpoint/is_exception_catchpoint instead of
looking at the breakpoint's type.
(print_one_breakpoint): If handling "maint info breakpoints", also
print locations of exception catchpoints.
* breakpoint.h (is_exception_catchpoint): Declare.
"catch catch/throw/rethrow", breakpoint -> catchpoint Currently, with: (gdb) catch catch Catchpoint 1 (catch) (gdb) catch throw Catchpoint 2 (throw) (gdb) catch rethrow Catchpoint 3 (rethrow) You get: (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x0000000000b122af exception catch 2 breakpoint keep y 0x0000000000b1288d exception throw 3 breakpoint keep y 0x0000000000b12931 exception rethrow I think it doesn't make much sense usability-wise, to show a catchpoint as a breakpoint. The fact that GDB sets a breakpoint at some magic address in the C++ run time is an implementation detail, IMO. And as seen in the previous patch, such a catchpoint can end up with more than one location/address even, so showing a single address isn't entirely accurate. This commit hides the addresses from view, and makes GDB show "catchpoint" for type as well: (gdb) info breakpoints Num Type Disp Enb Address What 1 catchpoint keep y exception catch 2 catchpoint keep y exception throw 3 catchpoint keep y exception rethrow This comment in the code seems telling: /* We need to reset 'type' in order for code in breakpoint.c to do the right thing. */ cp->type = bp_breakpoint; It kind of suggests that the reason catchpoints end up shown as breakpoints was that it was easier to implement them that way, rather than a desired property. This commit fixes things up to make it possible to have bp_catch breakpoints have software/hardware breakpoint locations, thus eliminating the need for that hack: - redo breakpoint_address_is_meaningful in terms of the location's type rather than breakpoint type. - teach bpstat_what about stepping over the catchpoint locations. - install a allocate_location method for "catch catch/throw/rethrow", one that forces the location type. Note that this also reverts the gdb hunk from: commit 2a8be20359dba9cc684fd3ffa222d985399f3b18 Commit: Tom Tromey <tom@tromey.com> CommitDate: Sat Oct 6 22:17:45 2018 -0600 Fix Python gdb.Breakpoint.location crash because now "catch throw" catchpoints hit the if (obj->bp->type != bp_breakpoint) Py_RETURN_NONE; check above, and, adjusts the testcase to no longer expect to see the catchpoint in the gdb.breakpoints() list. (Note: might make sense to do the same to Ada exception catchpoints.) gdb/ChangeLog: 2019-07-09 Pedro Alves <palves@redhat.com> * break-catch-throw.c (print_one_exception_catchpoint): Skip the "addr" field. (allocate_location_exception_catchpoint): New. (handle_gnu_v3_exceptions): Don't reset 'type' to bp_breakpoint. (initialize_throw_catchpoint_ops): Install allocate_location_exception_catchpoint as allocate_location method. * breakpoint.c (bpstat_what) <bp_catch>: Set action to BPSTAT_WHAT_SINGLE if not stopping and the location's type is not bp_loc_other. (breakpoint_address_is_meaningful): Delete. (bl_address_is_meaningful): New. (breakpoint_locations_match): Adjust comment. (bp_location_from_bp_type): New, factored out of... (bp_location::bp_location(breakpoint *)): ... this. (bp_location::bp_location(breakpoint *, bp_loc_type)): New, factored out of... (bp_location::bp_location(breakpoint *)): ... this. Reimplement. (bp_loc_is_permanent): Use bl_address_is_meaningful instead of breakpoint_address_is_meaningful. (bp_locations_compare): Adjust comment. (update_global_location_list): Use bl_address_is_meaningful instead of breakpoint_address_is_meaningful. * breakpoint.h (bp_location::bp_location(breakpoint *)): New explicit. (bp_location::bp_location(breakpoint *, bp_loc_type)): Declare. * python/py-breakpoint.c (bppy_get_location): No longer check whether location is null. gdb/doc/ChangeLog: 2019-07-09 Pedro Alves <palves@redhat.com> * gdb.texinfo (C++ Exception GDB/MI Catchpoint Commands): Adjust examples to show type=catchpoint instead of type=breakpoint and an address. gdb/testsuite/ChangeLog: 2019-07-09 Pedro Alves <palves@redhat.com> * gdb.cp/catch-multi-stdlib.exp: Adjust expected "info breakpoints" output. * gdb.cp/exception.exp: Adjust expected "info breakpoints" output. * gdb.python/py-breakpoint.exp: No longer expect that "catch throw" creates breakpoint. * gdb.mi/mi-catch-cpp-exceptions.exp (setup_catchpoint): Expect 'type="catchpoint"'.
2019-07-09 20:26:16 +02:00
2019-07-09 Pedro Alves <palves@redhat.com>
* break-catch-throw.c (print_one_exception_catchpoint): Skip the
"addr" field.
(allocate_location_exception_catchpoint): New.
(handle_gnu_v3_exceptions): Don't reset 'type' to bp_breakpoint.
(initialize_throw_catchpoint_ops): Install
allocate_location_exception_catchpoint as allocate_location
method.
* breakpoint.c (bpstat_what) <bp_catch>: Set action to
BPSTAT_WHAT_SINGLE if not stopping and the location's type is not
bp_loc_other.
(breakpoint_address_is_meaningful): Delete.
(bl_address_is_meaningful): New.
(breakpoint_locations_match): Adjust comment.
(bp_location_from_bp_type): New, factored out of...
(bp_location::bp_location(breakpoint *)): ... this.
(bp_location::bp_location(breakpoint *, bp_loc_type)): New,
factored out of...
(bp_location::bp_location(breakpoint *)): ... this. Reimplement.
(bp_loc_is_permanent): Use bl_address_is_meaningful instead of
breakpoint_address_is_meaningful.
(bp_locations_compare): Adjust comment.
(update_global_location_list): Use bl_address_is_meaningful
instead of breakpoint_address_is_meaningful.
* breakpoint.h (bp_location::bp_location(breakpoint *)): New
explicit.
(bp_location::bp_location(breakpoint *, bp_loc_type)): Declare.
* python/py-breakpoint.c (bppy_get_location): No longer check
whether location is null.
Fix "info break" + "catch catch" + -static-{libstdc++,libgcc} If you debug current GDB, set a "catch catch/throw/rethrow" catchpoint, and then do "info breakpoints", the top GDB hits an internal error: (top-gdb) catch catch Catchpoint 1 (catch) (top-gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y src/gdb/breakpoint.c:6040: internal-error: void print_one_breakpoint_location(breakpoint*, bp_location*, int, bp_location**, int): Assertion `b->loc == NULL || b->loc->next == NULL' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) The assertion in question is asserting that a breakpoint with a print_one method only has one location, and it fails because this catchpoint ends up with two locations. Internally, "catch catch" sets a breakpoint at __cxa_begin_catch. If we do that manually, we see the locations: (top-gdb) b -qualified __cxa_begin_catch Breakpoint 2 at 0xb122b0 (2 locations) (top-gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep y <MULTIPLE> 2.1 y 0x0000000000b122b0 <__cxa_begin_catch> 2.2 y 0x00007ffff2f4ddb0 in __cxxabiv1::__cxa_begin_catch(void*) at ../../../../libstdc++-v3/libsupc++/eh_catch.cc:41 Note that I had used -qualified. It seems strange that we get a location for a namespaced symbol, but that happens because the minimal symbol for that address is indeed called __cxa_begin_catch. The real issue is that gdb is linked with -static-libgcc/-static-libstdc++. And then, it _also_ ends up with shared libstc++ loaded: (top-gdb) info sharedlibrary stdc++ From To Syms Read Shared Object Library 0x00007ffff2f4b380 0x00007ffff2ffc018 Yes /lib64/libstdc++.so.6 Location 2.2 is set within libstdc++.so.6's range: (top-gdb) p 0x00007ffff2f4b380 <= 0x00007ffff2f4ddb0 && 0x00007ffff2f4ddb0 < 0x00007ffff2ffc018 $1 = true So due to -static-lib*, we end up with _two_ copies of the __cxa_begin_catch code: (top-gdb) disassemble 0x0000000000b122b0 Dump of assembler code for function __cxa_begin_catch: 0x0000000000b122b0 <+0>: push %rbx 0x0000000000b122b1 <+1>: mov %rdi,%rbx 0x0000000000b122b4 <+4>: callq 0xb11a80 <__cxa_get_globals> 0x0000000000b122b9 <+9>: movabs $0xb8b1aabcbcd4d500,%rdx ... (top-gdb) disassemble 0x00007ffff2f4ddb0 Dump of assembler code for function __cxxabiv1::__cxa_begin_catch(void*): 0x00007ffff2f4ddb0 <+0>: push %rbx 0x00007ffff2f4ddb1 <+1>: mov %rdi,%rbx 0x00007ffff2f4ddb4 <+4>: callq 0x7ffff2f4a090 <__cxa_get_globals@plt> 0x00007ffff2f4ddb9 <+9>: movabs $0xb8b1aabcbcd4d500,%rdx ... I think we end up with libstdc++.so.6 loaded because libsource-highlight.so depends on it. Irrespective of whether it's a good idea to use -static-libgcc/-static-libstdc++, GDB should not crash. Since there are two copies of the code, it seems right to have more than one location. So the fix is just to remove the assertion. A testcase is included, which mimics the scenerio described above, with binary linked with -static-lib{stdc++,gcc} and a shared library that is linked normally, along with other combinations for good measure. gdb/ChangeLog: 2019-07-09 Pedro Alves <palves@redhat.com> PR c++/15468 * breakpoint.c (print_one_breakpoint_location): Remove single-location assert. gdb/testsuite/ChangeLog: 2019-07-09 Pedro Alves <palves@redhat.com> PR c++/15468 * gdb.cp/except-multi-location-lib.cc: New. * gdb.cp/except-multi-location-main.cc: New. * gdb.cp/except-multi-location.exp: New.
2019-07-09 20:26:15 +02:00
2019-07-09 Pedro Alves <palves@redhat.com>
PR c++/15468
* breakpoint.c (print_one_breakpoint_location): Remove
single-location assert.
Rename common to gdbsupport This is the next patch in the ongoing series to move gdbsever to the top level. This patch just renames the "common" directory. The idea is to do this move in two parts: first rename the directory (this patch), then move the directory to the top. This approach makes the patches a bit more tractable. I chose the name "gdbsupport" for the directory. However, as this patch was largely written by sed, we could pick a new name without too much difficulty. Tested by the buildbot. gdb/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * contrib/ari/gdb_ari.sh: Change common to gdbsupport. * configure: Rebuild. * configure.ac: Change common to gdbsupport. * gdbsupport: Rename from common. * acinclude.m4: Change common to gdbsupport. * Makefile.in (CONFIG_SRC_SUBDIR, COMMON_SFILES) (HFILES_NO_SRCDIR, stamp-version, ALLDEPFILES): Change common to gdbsupport. * aarch64-tdep.c, ada-lang.c, ada-lang.h, agent.c, alloc.c, amd64-darwin-tdep.c, amd64-dicos-tdep.c, amd64-fbsd-nat.c, amd64-fbsd-tdep.c, amd64-linux-nat.c, amd64-linux-tdep.c, amd64-nbsd-tdep.c, amd64-obsd-tdep.c, amd64-sol2-tdep.c, amd64-tdep.c, amd64-windows-tdep.c, arch-utils.c, arch/aarch64-insn.c, arch/aarch64.c, arch/aarch64.h, arch/amd64.c, arch/amd64.h, arch/arm-get-next-pcs.c, arch/arm-linux.c, arch/arm.c, arch/i386.c, arch/i386.h, arch/ppc-linux-common.c, arch/riscv.c, arch/riscv.h, arch/tic6x.c, arm-tdep.c, auto-load.c, auxv.c, ax-gdb.c, ax-general.c, ax.h, breakpoint.c, breakpoint.h, btrace.c, btrace.h, build-id.c, build-id.h, c-lang.h, charset.c, charset.h, cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c, cli/cli-dump.c, cli/cli-option.h, cli/cli-script.c, coff-pe-read.c, command.h, compile/compile-c-support.c, compile/compile-c.h, compile/compile-cplus-symbols.c, compile/compile-cplus-types.c, compile/compile-cplus.h, compile/compile-loc2c.c, compile/compile.c, completer.c, completer.h, contrib/ari/gdb_ari.sh, corefile.c, corelow.c, cp-support.c, cp-support.h, cp-valprint.c, csky-tdep.c, ctf.c, darwin-nat.c, debug.c, defs.h, disasm-selftests.c, disasm.c, disasm.h, dtrace-probe.c, dwarf-index-cache.c, dwarf-index-cache.h, dwarf-index-write.c, dwarf2-frame.c, dwarf2expr.c, dwarf2loc.c, dwarf2read.c, event-loop.c, event-top.c, exceptions.c, exec.c, extension.h, fbsd-nat.c, features/aarch64-core.c, features/aarch64-fpu.c, features/aarch64-pauth.c, features/aarch64-sve.c, features/i386/32bit-avx.c, features/i386/32bit-avx512.c, features/i386/32bit-core.c, features/i386/32bit-linux.c, features/i386/32bit-mpx.c, features/i386/32bit-pkeys.c, features/i386/32bit-segments.c, features/i386/32bit-sse.c, features/i386/64bit-avx.c, features/i386/64bit-avx512.c, features/i386/64bit-core.c, features/i386/64bit-linux.c, features/i386/64bit-mpx.c, features/i386/64bit-pkeys.c, features/i386/64bit-segments.c, features/i386/64bit-sse.c, features/i386/x32-core.c, features/riscv/32bit-cpu.c, features/riscv/32bit-csr.c, features/riscv/32bit-fpu.c, features/riscv/64bit-cpu.c, features/riscv/64bit-csr.c, features/riscv/64bit-fpu.c, features/tic6x-c6xp.c, features/tic6x-core.c, features/tic6x-gp.c, filename-seen-cache.h, findcmd.c, findvar.c, fork-child.c, gcore.c, gdb_bfd.c, gdb_bfd.h, gdb_proc_service.h, gdb_regex.c, gdb_select.h, gdb_usleep.c, gdbarch-selftests.c, gdbthread.h, gdbtypes.h, gnu-nat.c, go32-nat.c, guile/guile.c, guile/scm-ports.c, guile/scm-safe-call.c, guile/scm-type.c, i386-fbsd-nat.c, i386-fbsd-tdep.c, i386-go32-tdep.c, i386-linux-nat.c, i386-linux-tdep.c, i386-tdep.c, i387-tdep.c, ia64-libunwind-tdep.c, ia64-linux-nat.c, inf-child.c, inf-ptrace.c, infcall.c, infcall.h, infcmd.c, inferior-iter.h, inferior.c, inferior.h, inflow.c, inflow.h, infrun.c, infrun.h, inline-frame.c, language.h, linespec.c, linux-fork.c, linux-nat.c, linux-tdep.c, linux-thread-db.c, location.c, machoread.c, macrotab.h, main.c, maint.c, maint.h, memattr.c, memrange.h, mi/mi-cmd-break.h, mi/mi-cmd-env.c, mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-interp.c, mi/mi-main.c, mi/mi-parse.h, minsyms.c, mips-linux-tdep.c, namespace.h, nat/aarch64-linux-hw-point.c, nat/aarch64-linux-hw-point.h, nat/aarch64-linux.c, nat/aarch64-sve-linux-ptrace.c, nat/amd64-linux-siginfo.c, nat/fork-inferior.c, nat/linux-btrace.c, nat/linux-btrace.h, nat/linux-namespaces.c, nat/linux-nat.h, nat/linux-osdata.c, nat/linux-personality.c, nat/linux-procfs.c, nat/linux-ptrace.c, nat/linux-ptrace.h, nat/linux-waitpid.c, nat/mips-linux-watch.c, nat/mips-linux-watch.h, nat/ppc-linux.c, nat/x86-dregs.c, nat/x86-dregs.h, nat/x86-linux-dregs.c, nat/x86-linux.c, nto-procfs.c, nto-tdep.c, objfile-flags.h, objfiles.c, objfiles.h, obsd-nat.c, observable.h, osdata.c, p-valprint.c, parse.c, parser-defs.h, ppc-linux-nat.c, printcmd.c, probe.c, proc-api.c, procfs.c, producer.c, progspace.h, psymtab.h, python/py-framefilter.c, python/py-inferior.c, python/py-ref.h, python/py-type.c, python/python.c, record-btrace.c, record-full.c, record.c, record.h, regcache-dump.c, regcache.c, regcache.h, remote-fileio.c, remote-fileio.h, remote-sim.c, remote.c, riscv-tdep.c, rs6000-aix-tdep.c, rust-exp.y, s12z-tdep.c, selftest-arch.c, ser-base.c, ser-event.c, ser-pipe.c, ser-tcp.c, ser-unix.c, skip.c, solib-aix.c, solib-target.c, solib.c, source-cache.c, source.c, source.h, sparc-nat.c, spu-linux-nat.c, stack.c, stap-probe.c, symfile-add-flags.h, symfile.c, symfile.h, symtab.c, symtab.h, target-descriptions.c, target-descriptions.h, target-memory.c, target.c, target.h, target/waitstatus.c, target/waitstatus.h, thread-iter.h, thread.c, tilegx-tdep.c, top.c, top.h, tracefile-tfile.c, tracefile.c, tracepoint.c, tracepoint.h, tui/tui-io.c, ui-file.c, ui-out.h, unittests/array-view-selftests.c, unittests/child-path-selftests.c, unittests/cli-utils-selftests.c, unittests/common-utils-selftests.c, unittests/copy_bitwise-selftests.c, unittests/environ-selftests.c, unittests/format_pieces-selftests.c, unittests/function-view-selftests.c, unittests/lookup_name_info-selftests.c, unittests/memory-map-selftests.c, unittests/memrange-selftests.c, unittests/mkdir-recursive-selftests.c, unittests/observable-selftests.c, unittests/offset-type-selftests.c, unittests/optional-selftests.c, unittests/parse-connection-spec-selftests.c, unittests/ptid-selftests.c, unittests/rsp-low-selftests.c, unittests/scoped_fd-selftests.c, unittests/scoped_mmap-selftests.c, unittests/scoped_restore-selftests.c, unittests/string_view-selftests.c, unittests/style-selftests.c, unittests/tracepoint-selftests.c, unittests/unpack-selftests.c, unittests/utils-selftests.c, unittests/xml-utils-selftests.c, utils.c, utils.h, valarith.c, valops.c, valprint.c, value.c, value.h, varobj.c, varobj.h, windows-nat.c, x86-linux-nat.c, xml-support.c, xml-support.h, xml-tdesc.h, xstormy16-tdep.c, xtensa-linux-nat.c, dwarf2read.h: Change common to gdbsupport. gdb/gdbserver/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac: Change common to gdbsupport. * acinclude.m4: Change common to gdbsupport. * Makefile.in (SFILES, OBS, GDBREPLAY_OBS, IPA_OBJS) (version-generated.c, gdbsupport/%-ipa.o, gdbsupport/%.o): Change common to gdbsupport. * ax.c, event-loop.c, fork-child.c, gdb_proc_service.h, gdbreplay.c, gdbthread.h, hostio-errno.c, hostio.c, i387-fp.c, inferiors.c, inferiors.h, linux-aarch64-tdesc-selftest.c, linux-amd64-ipa.c, linux-i386-ipa.c, linux-low.c, linux-tic6x-low.c, linux-x86-low.c, linux-x86-tdesc-selftest.c, linux-x86-tdesc.c, lynx-i386-low.c, lynx-low.c, mem-break.h, nto-x86-low.c, regcache.c, regcache.h, remote-utils.c, server.c, server.h, spu-low.c, symbol.c, target.h, tdesc.c, tdesc.h, thread-db.c, tracepoint.c, win32-i386-low.c, win32-low.c: Change common to gdbsupport.
2019-05-06 04:29:24 +02:00
2019-07-09 Tom Tromey <tom@tromey.com>
* contrib/ari/gdb_ari.sh: Change common to gdbsupport.
* configure: Rebuild.
* configure.ac: Change common to gdbsupport.
* gdbsupport: Rename from common.
* acinclude.m4: Change common to gdbsupport.
* Makefile.in (CONFIG_SRC_SUBDIR, COMMON_SFILES)
(HFILES_NO_SRCDIR, stamp-version, ALLDEPFILES): Change common to
gdbsupport.
* aarch64-tdep.c, ada-lang.c, ada-lang.h, agent.c, alloc.c,
amd64-darwin-tdep.c, amd64-dicos-tdep.c, amd64-fbsd-nat.c,
amd64-fbsd-tdep.c, amd64-linux-nat.c, amd64-linux-tdep.c,
amd64-nbsd-tdep.c, amd64-obsd-tdep.c, amd64-sol2-tdep.c,
amd64-tdep.c, amd64-windows-tdep.c, arch-utils.c,
arch/aarch64-insn.c, arch/aarch64.c, arch/aarch64.h, arch/amd64.c,
arch/amd64.h, arch/arm-get-next-pcs.c, arch/arm-linux.c,
arch/arm.c, arch/i386.c, arch/i386.h, arch/ppc-linux-common.c,
arch/riscv.c, arch/riscv.h, arch/tic6x.c, arm-tdep.c, auto-load.c,
auxv.c, ax-gdb.c, ax-general.c, ax.h, breakpoint.c, breakpoint.h,
btrace.c, btrace.h, build-id.c, build-id.h, c-lang.h, charset.c,
charset.h, cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c,
cli/cli-dump.c, cli/cli-option.h, cli/cli-script.c,
coff-pe-read.c, command.h, compile/compile-c-support.c,
compile/compile-c.h, compile/compile-cplus-symbols.c,
compile/compile-cplus-types.c, compile/compile-cplus.h,
compile/compile-loc2c.c, compile/compile.c, completer.c,
completer.h, contrib/ari/gdb_ari.sh, corefile.c, corelow.c,
cp-support.c, cp-support.h, cp-valprint.c, csky-tdep.c, ctf.c,
darwin-nat.c, debug.c, defs.h, disasm-selftests.c, disasm.c,
disasm.h, dtrace-probe.c, dwarf-index-cache.c,
dwarf-index-cache.h, dwarf-index-write.c, dwarf2-frame.c,
dwarf2expr.c, dwarf2loc.c, dwarf2read.c, event-loop.c,
event-top.c, exceptions.c, exec.c, extension.h, fbsd-nat.c,
features/aarch64-core.c, features/aarch64-fpu.c,
features/aarch64-pauth.c, features/aarch64-sve.c,
features/i386/32bit-avx.c, features/i386/32bit-avx512.c,
features/i386/32bit-core.c, features/i386/32bit-linux.c,
features/i386/32bit-mpx.c, features/i386/32bit-pkeys.c,
features/i386/32bit-segments.c, features/i386/32bit-sse.c,
features/i386/64bit-avx.c, features/i386/64bit-avx512.c,
features/i386/64bit-core.c, features/i386/64bit-linux.c,
features/i386/64bit-mpx.c, features/i386/64bit-pkeys.c,
features/i386/64bit-segments.c, features/i386/64bit-sse.c,
features/i386/x32-core.c, features/riscv/32bit-cpu.c,
features/riscv/32bit-csr.c, features/riscv/32bit-fpu.c,
features/riscv/64bit-cpu.c, features/riscv/64bit-csr.c,
features/riscv/64bit-fpu.c, features/tic6x-c6xp.c,
features/tic6x-core.c, features/tic6x-gp.c, filename-seen-cache.h,
findcmd.c, findvar.c, fork-child.c, gcore.c, gdb_bfd.c, gdb_bfd.h,
gdb_proc_service.h, gdb_regex.c, gdb_select.h, gdb_usleep.c,
gdbarch-selftests.c, gdbthread.h, gdbtypes.h, gnu-nat.c,
go32-nat.c, guile/guile.c, guile/scm-ports.c,
guile/scm-safe-call.c, guile/scm-type.c, i386-fbsd-nat.c,
i386-fbsd-tdep.c, i386-go32-tdep.c, i386-linux-nat.c,
i386-linux-tdep.c, i386-tdep.c, i387-tdep.c,
ia64-libunwind-tdep.c, ia64-linux-nat.c, inf-child.c,
inf-ptrace.c, infcall.c, infcall.h, infcmd.c, inferior-iter.h,
inferior.c, inferior.h, inflow.c, inflow.h, infrun.c, infrun.h,
inline-frame.c, language.h, linespec.c, linux-fork.c, linux-nat.c,
linux-tdep.c, linux-thread-db.c, location.c, machoread.c,
macrotab.h, main.c, maint.c, maint.h, memattr.c, memrange.h,
mi/mi-cmd-break.h, mi/mi-cmd-env.c, mi/mi-cmd-stack.c,
mi/mi-cmd-var.c, mi/mi-interp.c, mi/mi-main.c, mi/mi-parse.h,
minsyms.c, mips-linux-tdep.c, namespace.h,
nat/aarch64-linux-hw-point.c, nat/aarch64-linux-hw-point.h,
nat/aarch64-linux.c, nat/aarch64-sve-linux-ptrace.c,
nat/amd64-linux-siginfo.c, nat/fork-inferior.c,
nat/linux-btrace.c, nat/linux-btrace.h, nat/linux-namespaces.c,
nat/linux-nat.h, nat/linux-osdata.c, nat/linux-personality.c,
nat/linux-procfs.c, nat/linux-ptrace.c, nat/linux-ptrace.h,
nat/linux-waitpid.c, nat/mips-linux-watch.c,
nat/mips-linux-watch.h, nat/ppc-linux.c, nat/x86-dregs.c,
nat/x86-dregs.h, nat/x86-linux-dregs.c, nat/x86-linux.c,
nto-procfs.c, nto-tdep.c, objfile-flags.h, objfiles.c, objfiles.h,
obsd-nat.c, observable.h, osdata.c, p-valprint.c, parse.c,
parser-defs.h, ppc-linux-nat.c, printcmd.c, probe.c, proc-api.c,
procfs.c, producer.c, progspace.h, psymtab.h,
python/py-framefilter.c, python/py-inferior.c, python/py-ref.h,
python/py-type.c, python/python.c, record-btrace.c, record-full.c,
record.c, record.h, regcache-dump.c, regcache.c, regcache.h,
remote-fileio.c, remote-fileio.h, remote-sim.c, remote.c,
riscv-tdep.c, rs6000-aix-tdep.c, rust-exp.y, s12z-tdep.c,
selftest-arch.c, ser-base.c, ser-event.c, ser-pipe.c, ser-tcp.c,
ser-unix.c, skip.c, solib-aix.c, solib-target.c, solib.c,
source-cache.c, source.c, source.h, sparc-nat.c, spu-linux-nat.c,
stack.c, stap-probe.c, symfile-add-flags.h, symfile.c, symfile.h,
symtab.c, symtab.h, target-descriptions.c, target-descriptions.h,
target-memory.c, target.c, target.h, target/waitstatus.c,
target/waitstatus.h, thread-iter.h, thread.c, tilegx-tdep.c,
top.c, top.h, tracefile-tfile.c, tracefile.c, tracepoint.c,
tracepoint.h, tui/tui-io.c, ui-file.c, ui-out.h,
unittests/array-view-selftests.c,
unittests/child-path-selftests.c, unittests/cli-utils-selftests.c,
unittests/common-utils-selftests.c,
unittests/copy_bitwise-selftests.c, unittests/environ-selftests.c,
unittests/format_pieces-selftests.c,
unittests/function-view-selftests.c,
unittests/lookup_name_info-selftests.c,
unittests/memory-map-selftests.c, unittests/memrange-selftests.c,
unittests/mkdir-recursive-selftests.c,
unittests/observable-selftests.c,
unittests/offset-type-selftests.c, unittests/optional-selftests.c,
unittests/parse-connection-spec-selftests.c,
unittests/ptid-selftests.c, unittests/rsp-low-selftests.c,
unittests/scoped_fd-selftests.c,
unittests/scoped_mmap-selftests.c,
unittests/scoped_restore-selftests.c,
unittests/string_view-selftests.c, unittests/style-selftests.c,
unittests/tracepoint-selftests.c, unittests/unpack-selftests.c,
unittests/utils-selftests.c, unittests/xml-utils-selftests.c,
utils.c, utils.h, valarith.c, valops.c, valprint.c, value.c,
value.h, varobj.c, varobj.h, windows-nat.c, x86-linux-nat.c,
xml-support.c, xml-support.h, xml-tdesc.h, xstormy16-tdep.c,
xtensa-linux-nat.c, dwarf2read.h: Change common to gdbsupport.
gdb: Don't skip prologue for explicit line breakpoints in assembler It was observed that in some cases, placing a breakpoint in an assembler file using filename:line-number syntax would result in the breakpoint being placed at a different line within the file. For example, consider this x86-64 assembler: test: push %rbp /* Break here. */ mov %rsp, %rbp nop /* Stops here. */ The user places the breakpoint using file:line notation targeting the line marked 'Break here', GDB actually stops at the line marked 'Stops here'. The reason is that the label 'test' is identified as the likely start of a function, and the call to symtab.c:skip_prologue_sal causes GDB to skip forward over the instructions that GDB believes to be part of the prologue. I believe however, that when debugging assembler code, where the user has instruction-by-instruction visibility, if they ask for a specific line, GDB should (as far as possible) stop on that line, and not perform any prologue skipping. I don't believe that the behaviour of higher level languages should change, in these cases skipping the prologue seems like the correct thing to do. In order to implement this change I needed to extend our current tracking of when the user has requested an explicit line number. We already tracked this in some cases, but not in others (see the changes in linespec.c). However, once I did this I started to see some additional failures (in tests gdb.base/break-include.exp gdb.base/ending-run.exp gdb.mi/mi-break.exp gdb.mi/mi-reverse.exp gdb.mi/mi-simplerun.exp) where we currently expected a breakpoint placed at one file and line number to be updated to reference a different line number, this was fixed by removing some code in symtab.c:skip_prologue_sal. My concern here is that removing this check didn't cause anything else to fail. I have a new test that covers my original case, this is written for x86-64 as most folk have access to such a target, however, any architecture that has a prologue scanner can be impacted by this change. gdb/ChangeLog: * linespec.c (decode_digits_list_mode): Set explicit_line to a bool value. (decode_digits_ordinary): Set explicit_line field in sal. * symtab.c (skip_prologue_sal): Don't skip prologue for a symtab_and_line that was set on an explicit line number in assembler code. Do always update the recorded symtab and line if we do skip the prologue. gdb/testsuite/ChangeLog: * gdb.arch/amd64-break-on-asm-line.S: New file. * gdb.arch/amd64-break-on-asm-line.exp: New file.
2019-06-12 00:33:53 +02:00
2019-07-09 Andrew Burgess <andrew.burgess@embecosm.com>
* linespec.c (decode_digits_list_mode): Set explicit_line to a
bool value.
(decode_digits_ordinary): Set explicit_line field in sal.
* symtab.c (skip_prologue_sal): Don't skip prologue for a
symtab_and_line that was set on an explicit line number in
assembler code. Do always update the recorded symtab and line if
we do skip the prologue.
2019-07-09 Andrew Burgess <andrew.burgess@embecosm.com>
* breakpoint.c (set_breakpoint_location_function): Remove
explicit_loc parameter.
(momentary_breakpoint_from_master): Update call to
set_breakpoint_location_function.
(add_location_to_breakpoint): Likewise.
2019-07-09 Andrew Burgess <andrew.burgess@embecosm.com>
* riscv-tdep.c (riscv_features_from_gdbarch_info): Don't modify
required features based on default bfd type when no specific bfd
is present.
2019-07-08 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Mention that GDB printf and eval commands can now print
C-style and Ada-style convenience var strings without
calling the inferior.
* printcmd.c (printf_c_string): Locally print GDB internal var
instead of transiting via the inferior.
(printf_wide_c_string): Likewise.
2019-07-04 Alan Hayward <alan.hayward@arm.com>
PR breakpoints/25011
* symfile.c (symbol_file_command): Call solib_create_inferior_hook.
2019-07-04 Tom Tromey <tom@tromey.com>
PR tui/24724:
* tui/tui-winsource.c (tui_clear_source_content): Update.
(tui_source_window_base::set_is_exec_point_at): Fix comment.
(tui_update_breakpoint_info): Update.
(tui_set_exec_info_content): Update.
* tui/tui-source.c (tui_set_source_content_nil): Update.
* tui/tui-disasm.c (tui_set_disassem_content): Don't set
has_break.
* tui/tui-data.h (enum tui_bp_flag): New.
(tui_bp_flags): New enum flags type.
(struct tui_source_element) <break_mode>: Change type. Rename
from has_break.
(TUI_BP_ENABLED, TUI_BP_DISABLED, TUI_BP_HIT)
(TUI_BP_CONDITIONAL, TUI_BP_HARDWARE): Don't define. Now enum
constants.
* tui/tui-winsource.h: Fix comment.
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* aarch32-linux-nat.h (VFP_REGS_SIZE): Remove define.
* aarch64-linux-nat.c (fetch_fpregs_from_thread)
(store_fpregs_to_thread)
(aarch64_linux_nat_target::read_description): Use ARM_VFP3_REGS_SIZE.
* arch/arm.h (IWMMXT_VEC_REGISTER_SIZE, ARM_CORE_REGS_SIZE)
(ARM_FP_REGS_SIZE, ARM_VFP2_REGS_SIZE, ARM_VFP3_REGS_SIZE)
(IWMMXT_REGS_SIZE): Add define.
* arm-linux-nat.c (IWMMXT_REGS_SIZE): Remove define.
(fetch_vfp_regs, store_vfp_regs)
(arm_linux_nat_target::read_description): Use ARM_VFP3_REGS_SIZE.
* arm-tdep.c (arm_register_g_packet_guesses): Use new defines.
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* arch/arm-get-next-pcs.c (thumb_get_next_pcs_raw): Use ARM_
defines.
* arch/arm-linux.c (arm_linux_sigreturn_next_pc_offset): Likewise.
* arch/arm.h (INT_REGISTER_SIZE) Rename from...
(ARM_INT_REGISTER_SIZE): ...to this.
(ARM_FP_REGISTER_SIZE) (ARM_VFP_REGISTER_SIZE): Add define.
* arm-linux-tdep.c (ARM_LINUX_JB_ELEMENT_SIZE)
(ARM_LINUX_SIZEOF_GREGSET, arm_linux_supply_gregset)
(arm_linux_collect_gregset, supply_nwfpe_register)
(collect_nwfpe_register, arm_linux_collect_nwfpe): Use ARM_
defines.
* arm-linux-tdep.h (ARM_LINUX_SIZEOF_NWFPE, NWFPE_FPSR_OFFSET)
(NWFPE_FPCR_OFFSET, NWFPE_TAGS_OFFSET): Likewise
* arm-nbsd-tdep.c (ARM_NBSD_JB_ELEMENT_SIZE): Likewise.
* arm-tdep.c (arm_push_dummy_call, arm_extract_return_value)
(arm_return_in_memory, arm_store_return_value)
(arm_get_longjmp_target, arm_register_g_packet_guesses)
(arm_record_ld_st_multiple): Likewise.
* arm-tdep.h (FP_REGISTER_SIZE, VFP_REGISTER_SIZE): Remove.
* arm-wince-tdep.c (ARM_WINCE_JB_ELEMENT_SIZE): Use ARM_ defines.
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Use
AARCH64_DISPLACED_MODIFIED_INSNS.
* aarch64-tdep.c (struct aarch64_displaced_step_data)
(aarch64_displaced_step_copy_insn): Likewise.
* aarch64-tdep.h (DISPLACED_MODIFIED_INSNS): Rename from..
(AARCH64_DISPLACED_MODIFIED_INSNS): ...to this.
* arm-linux-tdep.c (arm_linux_cleanup_svc): Use
ARM_DISPLACED_MODIFIED_INSNS.
* arm-tdep.c (arm_gdbarch_init): Likewise.
* arm-tdep.h (DISPLACED_MODIFIED_INSNS): Rename from..
(ARM_DISPLACED_MODIFIED_INSNS): ...to this.
(struct arm_displaced_step_closure): Use
ARM_DISPLACED_MODIFIED_INSNS.
i386/AArch64: Remove unused xml files Remove all the xml files that are no longer used by gdbserver, and remove their entries from the makefile. gdb/ChangeLog: * features/Makefile: Remove unused xml files. * features/aarch64.xml: Remove. * features/i386/amd64-avx-avx512-linux.xml: Remove. * features/i386/amd64-avx-avx512.xml: Remove. * features/i386/amd64-avx-linux.xml: Remove. * features/i386/amd64-avx-mpx-avx512-pku-linux.xml: Remove. * features/i386/amd64-avx-mpx-avx512-pku.xml: Remove. * features/i386/amd64-avx-mpx-linux.xml: Remove. * features/i386/amd64-avx-mpx.xml: Remove. * features/i386/amd64-avx.xml: Remove. * features/i386/amd64-linux.xml: Remove. * features/i386/amd64-mpx-linux.xml: Remove. * features/i386/amd64-mpx.xml: Remove. * features/i386/amd64.xml: Remove. * features/i386/i386-avx-avx512-linux.xml: Remove. * features/i386/i386-avx-avx512.xml: Remove. * features/i386/i386-avx-linux.xml: Remove. * features/i386/i386-avx-mpx-avx512-pku-linux.xml: Remove. * features/i386/i386-avx-mpx-avx512-pku.xml: Remove. * features/i386/i386-avx-mpx-linux.xml: Remove. * features/i386/i386-avx-mpx.xml: Remove. * features/i386/i386-avx.xml: Remove. * features/i386/i386-linux.xml: Remove. * features/i386/i386-mmx-linux.xml: Remove. * features/i386/i386-mmx.xml: Remove. * features/i386/i386-mpx-linux.xml: Remove. * features/i386/i386-mpx.xml: Remove. * features/i386/i386.xml: Remove. * features/i386/x32-avx-avx512-linux.xml: Remove. * features/i386/x32-avx-linux.xml: Remove. * features/i386/x32-linux.xml: Remove.
2019-07-04 12:53:25 +02:00
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* features/Makefile: Remove unused xml files.
* features/aarch64.xml: Remove.
* features/i386/amd64-avx-avx512-linux.xml: Remove.
* features/i386/amd64-avx-avx512.xml: Remove.
* features/i386/amd64-avx-linux.xml: Remove.
* features/i386/amd64-avx-mpx-avx512-pku-linux.xml: Remove.
* features/i386/amd64-avx-mpx-avx512-pku.xml: Remove.
* features/i386/amd64-avx-mpx-linux.xml: Remove.
* features/i386/amd64-avx-mpx.xml: Remove.
* features/i386/amd64-avx.xml: Remove.
* features/i386/amd64-linux.xml: Remove.
* features/i386/amd64-mpx-linux.xml: Remove.
* features/i386/amd64-mpx.xml: Remove.
* features/i386/amd64.xml: Remove.
* features/i386/i386-avx-avx512-linux.xml: Remove.
* features/i386/i386-avx-avx512.xml: Remove.
* features/i386/i386-avx-linux.xml: Remove.
* features/i386/i386-avx-mpx-avx512-pku-linux.xml: Remove.
* features/i386/i386-avx-mpx-avx512-pku.xml: Remove.
* features/i386/i386-avx-mpx-linux.xml: Remove.
* features/i386/i386-avx-mpx.xml: Remove.
* features/i386/i386-avx.xml: Remove.
* features/i386/i386-linux.xml: Remove.
* features/i386/i386-mmx-linux.xml: Remove.
* features/i386/i386-mmx.xml: Remove.
* features/i386/i386-mpx-linux.xml: Remove.
* features/i386/i386-mpx.xml: Remove.
* features/i386/i386.xml: Remove.
* features/i386/x32-avx-avx512-linux.xml: Remove.
* features/i386/x32-avx-linux.xml: Remove.
* features/i386/x32-linux.xml: Remove.
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* regformats/aarch64.dat: Remove.
* regformats/i386/amd64-avx-avx512-linux.dat: Remove.
* regformats/i386/amd64-avx-linux.dat: Remove.
* regformats/i386/amd64-avx-mpx-avx512-pku-linux.dat: Remove.
* regformats/i386/amd64-avx-mpx-linux.dat: Remove.
* regformats/i386/amd64-linux.dat: Remove.
* regformats/i386/amd64-mpx-linux.dat: Remove.
* regformats/i386/amd64.dat: Remove.
* regformats/i386/i386-avx-avx512-linux.dat: Remove.
* regformats/i386/i386-avx-linux.dat: Remove.
* regformats/i386/i386-avx-mpx-avx512-pku-linux.dat: Remove.
* regformats/i386/i386-avx-mpx-linux.dat: Remove.
* regformats/i386/i386-linux.dat: Remove.
* regformats/i386/i386-mmx-linux.dat: Remove.
* regformats/i386/i386-mpx-linux.dat: Remove.
* regformats/i386/i386.dat: Remove.
* regformats/i386/x32-avx-avx512-linux.dat: Remove.
* regformats/i386/x32-avx-linux.dat: Remove.
* regformats/i386/x32-linux.dat: Remove.
i386/AArch64: Remove old xml tests Both the i386, X86_64 and AArch64 builds of gdbserver include a bunch of legacy xml files, dat files and auto generated C files, when building for unit test. These tests exists back from when feature target descriptions were added to prove that the new target descriptions were identical to the original older versions. The old files are not used for anything other than these tests. Now that this has been proven, we are not gaining anything by keeping the original files and tests. Should new functionality be added, it would break the tests, unless the functionality was backported to the xml. There is no requirement that we must match the exact xml from N releases ago. It adds obfuscation, where as the feature target descriptions were meant to simplify the code. In addition, there are a bunch of xml and dat files which are completely unused. This patch removes the selftests and the target descriptions from gdbserver. Update the unittest to allow 0 tests (note, this failed on other targets that never had any tests). gdb/ChangeLog: * aarch64-tdep.c: Remove xml self tests. * amd64-linux-tdep.c: Likewise. * amd64-tdep.c: Likewise. * i386-linux-tdep.c: Likewise. * i386-tdep.c: Likewise. gdb/gdbserver/ChangeLog: * configure.srv: Remove legacy xml. * linux-aarch64-low.c (initialize_low_arch): Remove initialize_low_tdesc call. * linux-aarch64-tdesc-selftest.c: Remove file. * linux-aarch64-tdesc.h (initialize_low_tdesc): Remove. * linux-x86-low.c (initialize_low_arch): Remove initialize_low_tdesc call. * linux-x86-tdesc-selftest.c: Remove file. * linux-x86-tdesc.h (initialize_low_tdesc): Remove. gdb/testsuite/ChangeLog: * gdb.server/unittest.exp: Allow 0 unit tests to run.
2019-07-04 12:48:16 +02:00
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c: Remove xml self tests.
* amd64-linux-tdep.c: Likewise.
* amd64-tdep.c: Likewise.
* i386-linux-tdep.c: Likewise.
* i386-tdep.c: Likewise.
2019-07-03 Pedro Alves <palves@redhat.com>
PR cli/24732
* cli/cli-cmds.c (struct pipe_cmd_opts): New.
(pipe_cmd_option_defs): New.
(make_pipe_cmd_options_def_group): New.
(pipe_command): Use gdb::option::process_options.
(pipe_command_completer): New function.
(_initialize_cli_cmds): Install completer for "pipe" command.
Teach gdb::option about string options A following patch will make the "pipe" command use the gdb::option framework for option processing. However, "pipe"'s only option today is a string option, "-d DELIM", and gdb::option does not support string options yet. This commit adds support for string options, mapped to var_string. For now, a string is parsed up until the first whitespace. I imagine that we'll need to add support for quoting so that we could do: (gdb) cmd -option 'some -string' without gdb confusing the "-string" for an option. This doesn't seem important for pipe, so I'm leaving it for another day. One thing I'm not happy with, is that the string data is managed as a raw malloc-allocated char *, which means that we need to xfree it manually. This is because var_string settings work that way too. Although with var_string settings we're leaking the strings at gdb exit, that was never really a problem. For options though, leaking is undesirable. I think we should tackle that for both settings and options at the same time, so for now I'm just managing the malloced data manually. It's a bit ugly in option_def_and_value, but at least that's hidden from view. For testing, this adds a new "-string" option to "maint test-settings", and then tweaks gdb.base/options.exp to exercise it. gdb/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * cli/cli-option.c (union option_value) <string>: New field. (struct option_def_and_value): Add ctor, move ctor, dtor and use DISABLE_COPY_AND_ASSIGN. (option_def_and_value::clear_value): New. (parse_option, save_option_value_in_ctx, get_val_type_str) (add_setshow_cmds_for_options): Handle var_string. * cli-option.h (union option_def::var_address) <string>: New field. (struct string_option_def): New. * maint-test-options.c (struct test_options_opts): Add default ctor and use DISABLE_COPY_AND_ASSIGN. <string_opt>: New field. (test_options_opts::~test_options_opts): New. (test_options_opts::dump): Also dump "-string". (test_options_option_defs): Install "string. gdb/testsuite/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * gdb.base/options.exp (expect_none, expect_flag, expect_bool) (expect_integer): Adjust to expect "-string". (expect_string): New. (all_options): Expect "-string". (test-flag, test-boolean): Adjust to expect "-string". (test-string): New proc. (top level): Call it.
2019-07-03 17:57:49 +02:00
2019-07-03 Pedro Alves <palves@redhat.com>
* cli/cli-option.c (union option_value) <string>: New field.
(struct option_def_and_value): Add ctor, move ctor, dtor and
use DISABLE_COPY_AND_ASSIGN.
(option_def_and_value::clear_value): New.
(parse_option, save_option_value_in_ctx, get_val_type_str)
(add_setshow_cmds_for_options): Handle var_string.
* cli-option.h (union option_def::var_address) <string>: New
field.
(struct string_option_def): New.
* maint-test-options.c (struct test_options_opts): Add default
ctor and use DISABLE_COPY_AND_ASSIGN.
<string_opt>: New field.
(test_options_opts::~test_options_opts): New.
(test_options_opts::dump): Also dump "-string".
(test_options_option_defs): Install "string.
Make gdb::option::complete_options save processed arguments too Currently, gdb::option::complete_options just discards any processed option argument, because no completer needs that data. When completing "pipe -d XXX gdbcmd XXX" however, the completer needs to know about -d's argument (XXX), in order to know where input is already past the gdb command and the delimiter. In this commit, the fix for that is the factoring out of the save_option_value_in_ctx function and calling it in complete_options. For testing, this makes "maint show test-options-completion-result" show the processed options too, like what the "maint test-options" subcommands output when run. Then, of course, gdb.base/options.exp is adjusted. Doing this exposed a couple latent bugs, which is what the other gdb changes in the patch are for: - in the var_enum case, without the change, we'd end up with a null enum argument, and print: "-enum (null)" - The get_ulongest change is necessary to avoid advancing PP in a case where we end up throwing an error, e.g., when parsing "11x". Without the change the operand pointer shown by "maint show test-options-completion-result" would be left pointing at "x" instead of "11x". gdb/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * cli/cli-option.c (parse_option) <var_enum>: Don't return an option_value with a null enumeration. (complete_options): Save the option values in the context. (save_option_value_in_ctx): New, factored out from ... (process_options): ... here. * cli/cli-utils.c (get_ulongest): Don't advance PP until the end of the function. * maint-test-options.c (test_options_opts::dump): New, factored out from ... (maintenance_test_options_command_mode): ... here. (maintenance_test_options_command_completion_result): Delete. (maintenance_test_options_command_completion_text): Update comment. (maintenance_show_test_options_completion_result): Change prototype. Just print maintenance_test_options_command_completion_text. (save_completion_result): New. (maintenance_test_options_completer_mode): Pass options context to complete_options, and then save a dump. (_initialize_maint_test_options): Use add_cmd to install "maint show test-options-completion-result". gdb/testsuite/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * gdb.base/options.exp (test-misc, test-flag, test-boolean) (test-uinteger, test-enum): Adjust res_test_gdb_... calls to pass the expected output in the success.
2019-07-03 17:57:48 +02:00
2019-07-03 Pedro Alves <palves@redhat.com>
* cli/cli-option.c (parse_option) <var_enum>: Don't return an
option_value with a null enumeration.
(complete_options): Save the option values in the context.
(save_option_value_in_ctx): New, factored out from ...
(process_options): ... here.
* cli/cli-utils.c (get_ulongest): Don't advance PP until the end
of the function.
* maint-test-options.c (test_options_opts::dump): New, factored
out from ...
(maintenance_test_options_command_mode): ... here.
(maintenance_test_options_command_completion_result): Delete.
(maintenance_test_options_command_completion_text): Update
comment.
(maintenance_show_test_options_completion_result): Change
prototype. Just print
maintenance_test_options_command_completion_text.
(save_completion_result): New.
(maintenance_test_options_completer_mode): Pass options context to
complete_options, and then save a dump.
(_initialize_maint_test_options): Use add_cmd to install "maint
show test-options-completion-result".
Introduce the "with" command ( See original discussion and prototype here: https://sourceware.org/ml/gdb-patches/2019-05/msg00570.html ) (gdb) help with Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING. Usage: with SETTING [VALUE] [-- COMMAND] Usage: w SETTING [VALUE] [-- COMMAND] With no COMMAND, repeats the last executed command. SETTING is any setting you can change with the "set" subcommands. E.g.: with language pascal -- print obj with print elements unlimited -- print obj As can be seen above, the "with" command is just like "set", but instead of setting the setting permanently, it sets the setting, runs a command and then restores the setting. (gdb) p g_s $1 = {a = 1, b = 2, c = 3} (gdb) with language ada -- print g_s $2 = (a => 1, b => 2, c => 3) Warning: the current language does not match this frame. (gdb) show language The current source language is "auto; currently c". (gdb) with print elements 100 -- with print object on -- print 1 $3 = 1 You can shorten things a bit though, as long as unambiguous. So this: (gdb) with print elements 100 -- with print object off -- print 1 is the same as: (gdb) w p el 100 -- w p o 0 -- p 1 Note that the patch adds a "w" alias for "with", as "w" is not currently taken: (gdb) w Ambiguous command "w": watch, wh, whatis, where, while, while-stepping, winheight, ws. Let me know if you'd prefer to reserve "w" for one of the other commands above. IMHO, this command will end up being used frequently enough that it deserves the "w" shorthand. A nice feature is that this is fully integrated with TAB-completion: (gdb) with p[TAB] pagination print prompt python (gdb) with print [TAB] address max-depth static-members array max-symbolic-offset symbol array-indexes null-stop symbol-filename asm-demangle object symbol-loading demangle pascal_static-members thread-events elements pretty type entry-values raw union frame-arguments repeats vtbl inferior-events sevenbit-strings (gdb) with print [TAB] (gdb) with print elements unlimited -- thread apply all -[TAB] -ascending -c -q -s (gdb) with print elements unlimited -- print -[TAB] -address -max-depth -repeats -vtbl -array -null-stop -static-members -array-indexes -object -symbol -elements -pretty -union The main advantage of this new command compared to command options, like the new "print -OPT", is that this command works with any setting, and, it works nicely when you want to override a setting while running a user-defined command, like: (gdb) with print pretty -- usercmd The disadvantage is that it isn't as compact or easy to type. I think of command options and this command as complementary. I think that even with this new command, it makes sense to continue developing the command options in the direction of exposing most-oft-used settings as command options. Inspired by Philippe's "/" command proposal, if no command is specified, then the last command is re-invoked, under the overridden setting: (gdb) p g_s $1 = {a = 1, b = 2, c = 3} (gdb) with language ada $2 = (a => 1, b => 2, c => 3) Warning: the current language does not match this frame. Note: "with" requires "--" to separate the setting from the command. It might be possible to do without that, but, I haven't tried it yet, and I think that this can go in without it. We can always downgrade to making "--" optional if we manage to make it work. On to the patch itself, the implementation of the command is simpler than one might expect. A few details: - I factored out a bit from pipe_command into repeat_previous directly, because otherwise I'd need to copy&paste the same code and same error message in the with command. - The parse_cli_var_uinteger / parse_cli_var_zuinteger_unlimited / do_set_command changes are necessary since we can now pass an empty string as argument. - do_show_command was split in two, as a FIXME comment suggests, but for a different reason: we need to get a string version of a "set" command's value, and we already had code for that in do_show_command. That code is now factored out to the new get_setshow_command_value_string function. - There's a new "maint with" command added too: (gdb) help maint with Like "with", but works with "maintenance set" variables. Usage: maintenance with SETTING [VALUE] [-- COMMAND] With no COMMAND, repeats the last executed command. SETTING is any setting you can change with the "maintenance set" subcommands. "with" and "maint with" share 99% of the implementation. This might be useful on its own, but it's also useful for testing, since with this, we can use the "maint set/show test-settings" settings for exercising the "with" machinery with all the command type variants (all enum var_types). This is done in the new gdb/base/with.exp testcase. The documentation bits are originally based on Philippe's docs for the "/" command, hence the attribution in the ChangeLog. gdb/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * NEWS (New commands): Mention "with" and "maint with". * cli/cli-cmds.c (with_command_1, with_command_completer_1) (with_command, with_command_completer): New. (pipe_command): Adjust to new repeat_previous interface. (_initialize_cli_cmds): Install the "with" command and its "w" alias. * cli/cli-cmds.h (with_command_1, with_command_completer_1): New declarations. * cli/cli-setshow.c (parse_cli_var_uinteger) (parse_cli_var_zuinteger_unlimited, do_set_command): Handle empty argument strings for all var_types. (get_setshow_command_value_string): New, factored out from ... (do_show_command): ... this. * cli/cli-setshow.h: Include <string>. (get_setshow_command_value_string): Declare. * command.h (repeat_previous): Now returns const char *. Adjust comment. * maint.c: Include "cli/cli-cmds.h". (maintenance_with_cmd, maintenance_with_cmd_completer): New. (_initialize_maint_cmds): Register the "maintenance with" command. * top.c (repeat_previous): Move bits from pipe_command here: Return the saved command line, if any; error out if there's no command to relaunch. gdb/doc/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.texinfo (Command Settings): New node documenting the general concept of settings, how to change them, and the new "with" command. (Maintenance Commands): Document "maint with". gdb/testsuite/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * gdb.base/with.c: New file. * gdb.base/with.exp: New file.
2019-07-03 14:34:20 +02:00
2019-07-03 Pedro Alves <palves@redhat.com>
* NEWS (New commands): Mention "with" and "maint with".
* cli/cli-cmds.c (with_command_1, with_command_completer_1)
(with_command, with_command_completer): New.
(pipe_command): Adjust to new repeat_previous
interface.
(_initialize_cli_cmds): Install the "with" command and its "w"
alias.
* cli/cli-cmds.h (with_command_1, with_command_completer_1): New
declarations.
* cli/cli-setshow.c (parse_cli_var_uinteger)
(parse_cli_var_zuinteger_unlimited, do_set_command): Handle empty
argument strings for all var_types.
(get_setshow_command_value_string): New, factored out from ...
(do_show_command): ... this.
* cli/cli-setshow.h: Include <string>.
(get_setshow_command_value_string): Declare.
* command.h (repeat_previous): Now returns const char *. Adjust
comment.
* maint.c: Include "cli/cli-cmds.h".
(maintenance_with_cmd, maintenance_with_cmd_completer): New.
(_initialize_maint_cmds): Register the "maintenance with" command.
* top.c (repeat_previous): Move bits from pipe_command here:
Return the saved command line, if any; error out if there's no
command to relaunch.
"maint test-settings set/show" -> "maint set/show test-settings" This commit renames "maint test-settings set/show" to "maint set/show test-settings". This helps the following patch, which introduce a "maint with" command what works with all "maint set" settings. gdb/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * NEWS (New commands): Mention "maint set/show test-settings" instead of "maint test-settings". * maint-test-settings.c (maintenance_test_settings_list): Delete. (maintenance_test_settings_set_list): Rename to ... (maintenance_set_test_settings_list): ... this. (maintenance_test_settings_show_list): Rename to ... (maintenance_show_test_settings_list): ... this. (maintenance_test_settings_cmd): Delete. (maintenance_test_settings_set_cmd): ... (maintenance_set_test_settings_cmd): ... this. (maintenance_test_settings_show_cmd): ... (maintenance_show_test_settings_cmd): ... this. (maintenance_test_settings_show_value_cmd): (maintenance_show_test_settings_value_cmd): ... this. (_initialize_maint_test_settings): No longer install the "maint test-settings" prefix command. Rename "maint test-settings set" to "maint set test-settings", and "maint test-settings show" to "maint show test-settings". Adjust all subcommands. gdb/doc/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * gdb.texinfo (Maintenance Commands): Document "maint set/show test-settings" instead of "maint test-settings set/show". gdb/testsuite/ChangeLog: 2019-07-03 Pedro Alves <palves@redhat.com> * gdb.base/settings.exp: Replace all references to "maint test-settings set" with references to "maint set test-settings", and all references to "maint test-settings show" with references to "maint show test-settings".
2019-07-03 14:34:19 +02:00
2019-07-03 Pedro Alves <palves@redhat.com>
* NEWS (New commands): Mention "maint set/show test-settings"
instead of "maint test-settings".
* maint-test-settings.c (maintenance_test_settings_list): Delete.
(maintenance_test_settings_set_list): Rename to ...
(maintenance_set_test_settings_list): ... this.
(maintenance_test_settings_show_list): Rename to ...
(maintenance_show_test_settings_list): ... this.
(maintenance_test_settings_cmd): Delete.
(maintenance_test_settings_set_cmd): ...
(maintenance_set_test_settings_cmd): ... this.
(maintenance_test_settings_show_cmd): ...
(maintenance_show_test_settings_cmd): ... this.
(maintenance_test_settings_show_value_cmd):
(maintenance_show_test_settings_value_cmd): ... this.
(_initialize_maint_test_settings): No longer install the "maint
test-settings" prefix command. Rename "maint test-settings set"
to "maint set test-settings", and "maint test-settings show" to
"maint show test-settings". Adjust all subcommands.
2019-07-03 Pedro Alves <palves@redhat.com>
* maint-test-settings.c: Fix file's intro comment. Replace all
references to "test-options" with references to "test-settings",
in comments.
2019-07-03 Pedro Alves <palves@redhat.com>
* maint-test-settings.c (maintenance_test_settings_xxx)
(maintenance_test_settings_yyy, maintenance_test_settings_zzz):
New.
(maintenance_test_settings_enums): Use them.
(maintenance_test_settings_enum): Default to
maintenance_test_settings_xxx.
(_initialize_maint_test_settings): Initialize
MAINTENANCE_TEST_SETTINGS_FILENAME.
2019-07-02 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.h (remove_breakpoints_inf): Change return type to
void, move function documentation here.
* breakpoint.c (remove_breakpoints_inf): Change return type to
void, move function documentation to header.
2019-07-02 Pedro Alves <palves@redhat.com>
* NEWS (Completion improvements): Mention "info threads".
* thread.c (struct info_threads_opts, info_threads_option_defs)
(make_info_threads_options_def_group): New.
(info_threads_command): Use gdb::option::process_options.
(info_threads_command_completer): New.
(_initialize_thread): Use gdb::option::build_help to build the
help text for "info threads".
2019-07-02 Simon Marchi <simon.marchi@polymtl.ca>
* defs.h (generic_load): Move from here...
* symfile.h (generic_load): ... to here. Rename name parameter
to args.
* symfile.c (generic_load): Add comment.
2019-07-01 Tom Tromey <tromey@adacore.com>
* dwarf2read.c
(dw2_debug_names_iterator::find_vec_in_debug_names): Hoist
declaration of without_params. Fix formatting.
2019-07-01 Tom Tromey <tromey@adacore.com>
* ada-exp.y (find_primitive_type): Update.
* ada-lang.h (ada_lookup_symbol): Update.
* ada-lang.c (ada_lookup_symbol): Remove "is_a_field_of_this"
parameter.
(ada_lookup_encoded_symbol, ada_lookup_symbol_nonlocal): Update.
Adjust i386 registers on SystemTap probes' arguments (PR breakpoints/24541) This bug has been reported on PR breakpoints/24541, but it is possible to reproduce it easily by running: make check-gdb TESTS=gdb.base/stap-probe.exp RUNTESTFLAGS='--target_board unix/-m32' The underlying cause is kind of complex, and involves decisions made by GCC and the sys/sdt.h header file about how to represent a probe argument that lives in a register in 32-bit programs. I'll use Andrew's example on the bug to illustrate the problem. libstdc++ has a probe named "throw" with two arguments. On i386, the probe is: stapsdt 0x00000028 NT_STAPSDT (SystemTap probe descriptors) Provider: libstdcxx Name: throw Location: 0x00072c96, Base: 0x00133d64, Semaphore: 0x00000000 Arguments: 4@%si 4@%di I.e., the first argument is an unsigned 32-bit value (represented by the "4@") that lives on %si, and the second argument is an unsigned 32-bit value that lives on %di. Note the discrepancy between the argument size reported by the probe (32-bit) and the register size being used to store the value (16-bit). However, if you take a look at the disassemble of a program that uses this probe, you will see: 00072c80 <__cxa_throw@@CXXABI_1.3>: 72c80: 57 push %edi 72c81: 56 push %esi 72c82: 53 push %ebx 72c83: 8b 74 24 10 mov 0x10(%esp),%esi 72c87: e8 74 bf ff ff call 6ec00 <__cxa_finalize@plt+0x980> 72c8c: 81 c3 74 e3 10 00 add $0x10e374,%ebx 72c92: 8b 7c 24 14 mov 0x14(%esp),%edi 72c96: 90 nop <----------------- PROBE IS HERE 72c97: e8 d4 a2 ff ff call 6cf70 <__cxa_get_globals@plt> 72c9c: 83 40 04 01 addl $0x1,0x4(%eax) 72ca0: 83 ec 04 sub $0x4,%esp 72ca3: ff 74 24 1c pushl 0x1c(%esp) 72ca7: 57 push %edi 72ca8: 56 push %esi 72ca9: e8 62 a3 ff ff call 6d010 <__cxa_init_primary_exception@plt> 72cae: 8d 70 40 lea 0x40(%eax),%esi 72cb1: c7 00 01 00 00 00 movl $0x1,(%eax) 72cb7: 89 34 24 mov %esi,(%esp) 72cba: e8 61 96 ff ff call 6c320 <_Unwind_RaiseException@plt> 72cbf: 89 34 24 mov %esi,(%esp) 72cc2: e8 c9 84 ff ff call 6b190 <__cxa_begin_catch@plt> 72cc7: e8 d4 b3 ff ff call 6e0a0 <_ZSt9terminatev@plt> 72ccc: 66 90 xchg %ax,%ax 72cce: 66 90 xchg %ax,%ax Note how the program is actually using %edi, and not %di, to store the second argument. This is the problem here. GDB will basically read the probe argument, then read the contents of %di, and then cast this value to uint32_t, which causes the wrong value to be obtained. In the gdb.base/stap-probe.exp case, this makes GDB read the wrong memory location, and not be able to display a test string. In Andrew's example, this causes GDB to actually stop at a "catch throw" when it should actually have *not* stopped. After some discussion with Frank Eigler and Jakub Jelinek, it was decided that this bug should be fixed on the client side (i.e., the program that actually reads the probes), and this is why I'm proposing this patch. The idea is simple: we will have a gdbarch method, which, for now, is only used by i386. The generic code that deals with register operands on gdb/stap-probe.c will call this method if it exists, passing the current parse information, the register name and its number. The i386 method will then verify if the register size is greater or equal than the size reported by the stap probe (the "4@" part). If it is, we're fine. Otherwise, it will check if we're dealing with any of the "extendable" registers (like ax, bx, si, di, sp, etc.). If we are, it will change the register name to include the "e" prefix. I have tested the patch here in many scenarios, and it fixes Andrew's bug and also the regressions I mentioned before, on gdb.base/stap-probe.exp. No regressions where found on other tests. Comments? gdb/ChangeLog: 2019-06-27 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/24541 * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh: Add 'stap_adjust_register'. * i386-tdep.c: Include '<unordered_set>'. (i386_stap_adjust_register): New function. (i386_elf_init_abi): Register 'i386_stap_adjust_register'. * stap-probe.c (stap_parse_register_operand): Call 'gdbarch_stap_adjust_register'.
2019-06-26 23:34:50 +02:00
2019-06-28 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/24541
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* gdbarch.sh: Add 'stap_adjust_register'.
* i386-tdep.c: Include '<unordered_set>'.
(i386_stap_adjust_register): New function.
(i386_elf_init_abi): Register 'i386_stap_adjust_register'.
* stap-probe.c (stap_parse_register_operand): Call
'gdbarch_stap_adjust_register'.
Fix crash when using PYTHONMALLOC=debug (PR python/24742) This bug was originally reported against Fedora GDB: https://bugzilla.redhat.com/show_bug.cgi?id=1723564 The problem is that GDB will crash in the following scenario: - PYTHONMALLOC=debug or PYTHONDEVMODE=1 is set. - The Python debuginfo is installed. - GDB is used to debug Python. The crash looks like this: $ PYTHONMALLOC=debug gdb -args python3 -c pass GNU gdb (GDB) Fedora 8.3-3.fc30 Reading symbols from python3... Reading symbols from /usr/lib/debug/usr/bin/python3.7m-3.7.3-3.fc30.x86_64.debug... (gdb) run Starting program: /usr/bin/python3 -c pass Missing separate debuginfos, use: dnf debuginfo-install glibc-2.29-9.fc30.x86_64 Debug memory block at address p=0x5603977bf330: API '' 8098648152243306496 bytes originally requested The 7 pad bytes at p-7 are not all FORBIDDENBYTE (0xfb): at p-7: 0x03 *** OUCH at p-6: 0x00 *** OUCH at p-5: 0x00 *** OUCH at p-4: 0x00 *** OUCH at p-3: 0x00 *** OUCH at p-2: 0x00 *** OUCH at p-1: 0x00 *** OUCH Because memory is corrupted at the start, the count of bytes requested may be bogus, and checking the trailing pad bytes may segfault. The 8 pad bytes at tail=0x706483999ad1f330 are Segmentation fault (core dumped) It's hard to determine what happens, but after doing some investigation and talking to Victor Stinner I found that GDB should not use the Python memory allocation functions before the Python interpreter is initialized (which makes sense). However, we do just that on python/python.c:do_start_initialization: ... progsize = strlen (progname.get ()); progname_copy = (wchar_t *) PyMem_Malloc ((progsize + 1) * sizeof (wchar_t)); ... /* Note that Py_SetProgramName expects the string it is passed to remain alive for the duration of the program's execution, so it is not freed after this call. */ Py_SetProgramName (progname_copy); ... Py_Initialize (); PyEval_InitThreads (); Upon reading the Python 3 C API documentation, I found (https://docs.python.org/3.5/c-api/memory.html): To avoid memory corruption, extension writers should never try to operate on Python objects with the functions exported by the C library: malloc(), calloc(), realloc() and free(). This will result in mixed calls between the C allocator and the Python memory manager with fatal consequences, because they implement different algorithms and operate on different heaps. However, one may safely allocate and release memory blocks with the C library allocator for individual purposes[...] And Py_SetProgramName seems like a very simple call that doesn't need a Python-allocated memory to work on. So I'm proposing this patch, which simply replaces PyMem_Malloc by xmalloc. Testing this is more complicated. First, the crash is completely non-deterministic; I was able to reproduce it 10 times in a row, and then I wasn't able to reproduce it anymore. I found that if you completely remove your build directory and rebuild GDB from scratch, you can reproduce it again confidently. And with my patch, I confirmed that the bug doesn't manifest even in this situation. No regressions found. OK to apply? gdb/ChangeLog: 2019-06-28 Sergio Durigan Junior <sergiodj@redhat.com> PR python/24742 https://bugzilla.redhat.com/show_bug.cgi?id=1723564 * python/python.c (do_start_initialization): Use 'xmalloc' instead of 'PyMem_Malloc'.
2019-06-27 19:14:26 +02:00
2019-06-28 Sergio Durigan Junior <sergiodj@redhat.com>
PR python/24742
https://bugzilla.redhat.com/show_bug.cgi?id=1723564
* python/python.c (do_start_initialization): Use 'xmalloc'
instead of 'PyMem_Malloc'.
2019-06-28 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (partial_die_info::read): Prefer the linkage name
for Ada.
2019-06-27 Tom Tromey <tromey@adacore.com>
* arm-tdep.c (arm_objfile_data_key): Move lower. Change type to
objfile_key.
(arm_find_mapping_symbol, arm_record_special_symbol)
(_initialize_arm_tdep): Update.
(arm_objfile_data_free): Remove.
2019-06-27 Tom Tromey <tromey@adacore.com>
* cp-valprint.c (cp_print_value_fields): Pass opts, not options,
to cp_print_static_field.
2019-06-26 Tom Tromey <tromey@adacore.com>
* minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove.
* minsyms.h (lookup_minimal_symbol_solib_trampoline): Don't
declare.
2019-06-26 Alan Hayward <alan.hayward@arm.com>
* features/aarch64-core.c (create_feature_aarch64_core):
Regenerate.
* features/aarch64-core.xml: Add cpsr flags.
2019-06-26 Alan Hayward <alan.hayward@arm.com>
* arm-tdep.c (arm_gnu_triplet_regexp): New function.
(arm_gdbarch_init): Add arm_gnu_triplet_regexp.
arm-tdep: sort mapping symbols after parsing all minimal symbols Somebody on IRC reported a while ago that loading a big ARM program in GDB was very slow. Their profiling pointed out that a big amount of time was spent in VEC_safe_insert (arm_mapping_symbol_s, *map_p, idx, &new_map_sym); I was able to verify this as well. ARM mapping symbols are special ELF symbols named $a, $d and $t indicating that symbols starting at this address up to the next mapping symbol (in terms of address) are of type "ARM code", "data" and "Thumb code", respectively. GDB records these symbols in vectors (one for each section) in arm-tdep.c. These vectors are sorted by symbol address, to allow for quick lookup. The current approach is to insert new symbols at the right position to keep the vectors sorted at all time. This is done based on the assumption that mapping symbols come already almost sorted from the binary, as explains this comment in arm_record_special_symbol: /* Assume that most mapping symbols appear in order of increasing value. If they were randomly distributed, it would be faster to always push here and then sort at first use. */ Well, it turns out this is not the case. The original reporter mentioned that mapping symbols in their binaries are not nearly sorted, and this is not my experience either (at least in the binary used in the benchmark below). So if the values don't come nearly sorted, doing insertions to keep the vectors sorted ends up being of the order of number_of_mapping_symbols ^ 2. This patch changes it just like the comment above says, to just append to the vector in arm_record_special_symbol and sort the vector on first use. Benchmark ========= I have done some benchmarks using an --enable-targets=all GDB, compiled with -O2, running on x86-64 and parsing file dce18d22e5c2ecb6a3a57372f4e6ef614130bc.debug from this package: https://launchpad.net/ubuntu/+source/firefox/66.0.3+build1-0ubuntu1/+build/16608691/+files/firefox-dbg_66.0.3+build1-0ubuntu1_armhf.deb This file is the separate debug info for libxul.so (part of firefox) for ARM. I have added some traces to measure the execution time of just elf_symtab_read and ran GDB like this: ./gdb --data-directory=data-directory -nx -batch .../path/to/usr/lib/debug/.build-id/65/dce18d22e5c2ecb6a3a57372f4e6ef614130bc.debug Since the new code sorts the vectors on first use, it would be difficult to benchmark it as-is and be fair, since the "before" version does more work in elf_symtab_read. So I have actually benchmarked a version of the patch that did sort all the vectors at the end of elf_symtab_read, so the sorting would be considered in the measured execution time. Here's the measured execution time of elf_symtab_read, averaged on 3 runs: insert sorted (before): 28.678s sort after (after): 1.760s And here's the total execution time of the command above (just one run). The time is now mostly spent in reading DWARF. insert sorted: 71.12s user 2.71s system 99% cpu 1:14.03 total sort after: 46.42s user 2.60s system 99% cpu 49.147 total I tried for fun on my Raspberry Pi 3, the run time of elf_symtab_read goes from ~259s to ~9s, reading the same file. gdb/ChangeLog: * arm-tdep.c (struct arm_per_objfile) <section_maps_sorted>: New field. (arm_find_mapping_symbol): Sort mapping symbol vectors on first use. (arm_record_special_symbol): Don't insert new symbol in sorted position, push it at the end.
2019-06-25 20:22:30 +02:00
2019-06-25 Simon Marchi <simon.marchi@polymtl.ca>
* arm-tdep.c (struct arm_per_objfile) <section_maps_sorted>: New
field.
(arm_find_mapping_symbol): Sort mapping symbol vectors on first
use.
(arm_record_special_symbol): Don't insert new symbol in sorted
position, push it at the end.
2019-06-25 Simon Marchi <simon.marchi@polymtl.ca>
* arm-tdep.c (struct arm_mapping_symbol) (operator <): New.
(arm_mapping_symbol_s): Remove.
(DEF_VEC_O(arm_mapping_symbol_s)): Remove.
(arm_mapping_symbol_vec): New typedef.
(struct arm_per_objfile): Add constructor.
<section_maps>: Change type to
std::unique_ptr<arm_mapping_symbol_vec[]>.
(arm_compare_mapping_symbols): Remove.
(arm_find_mapping_symbol): Adjust to section_maps type change.
(arm_objfile_data_free): Call delete on arm_per_objfile.
(arm_record_special_symbol): Adjust to section_maps type change.
Allocate arm_per_objfile with new.
2019-06-25 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-cmds.c (alias_command): Compare the alias prefix
with the command prefix.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_delete_win): Remove "return".
* tui/tui-data.c (~tui_gen_win_info): Remove "if".
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (init_and_make_win): Assert on unrecognized
type.
* tui/tui-data.h (struct tui_gen_win_info): Make constructor
protected.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c
(tui_source_window_base::set_is_exec_point_at): Add check against
LOA_ADDRESS.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_set_source_content): Don't check before
xfree.
* tui/tui-disasm.c (tui_disassemble): Don't check before xfree.
Remove union tui_which_element This removes union tui_which_element, instead moving the content directly into tui_source_window_base. This allows for the deletion of a fair amount of code. Now the TUI window hierarchy is more type-safe. In particular, there is never any confusion now about which members are in use by which subtype. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_update_source_window_as_is) (tui_alloc_source_buffer, tui_line_is_displayed) (tui_addr_is_displayed): Change type of win_info. * tui/tui-winsource.c (tui_update_source_window_as_is) (tui_clear_source_content, tui_show_source_line) (tui_show_source_content, tui_source_window_base::refill) (tui_source_window_base::set_is_exec_point_at) (tui_source_window_base::set_is_exec_point_at) (tui_update_breakpoint_info, tui_set_exec_info_content): Update. (tui_alloc_source_buffer, tui_line_is_displayed) (tui_addr_is_displayed): Change type of win_info. Update. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights) (tui_source_window_base::do_make_visible_with_new_height): Update. * tui/tui-source.c (tui_set_source_content) (tui_set_source_content_nil) (tui_source_window::do_scroll_vertical): Update. * tui/tui-layout.c (show_layout): Update. * tui/tui-disasm.c (tui_set_disassem_content) (tui_disasm_window::do_scroll_vertical): Update. * tui/tui-data.h (tui_win_content): Remove. (struct tui_gen_win_info) <content, content_size>: Remove. (struct tui_source_element): Add initializers and destructor. (union tui_which_element, struct tui_win_element): Remove. (struct tui_source_window_base) <content>: New field. (struct tui_data_window): Remove destructor. (tui_alloc_content, tui_free_win_content) (tui_free_all_source_wins_content): Don't declare. * tui/tui-data.c (tui_initialize_static_data): Update. (init_content_element, tui_alloc_content): Remove. (~tui_gen_win_info): Update. (~tui_data_window, tui_free_all_source_wins_content) (tui_free_win_content, free_content, free_content_elements): Remove.
2019-06-23 22:27:04 +02:00
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_update_source_window_as_is)
(tui_alloc_source_buffer, tui_line_is_displayed)
(tui_addr_is_displayed): Change type of win_info.
* tui/tui-winsource.c (tui_update_source_window_as_is)
(tui_clear_source_content, tui_show_source_line)
(tui_show_source_content, tui_source_window_base::refill)
(tui_source_window_base::set_is_exec_point_at)
(tui_source_window_base::set_is_exec_point_at)
(tui_update_breakpoint_info, tui_set_exec_info_content): Update.
(tui_alloc_source_buffer, tui_line_is_displayed)
(tui_addr_is_displayed): Change type of win_info. Update.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights)
(tui_source_window_base::do_make_visible_with_new_height):
Update.
* tui/tui-source.c (tui_set_source_content)
(tui_set_source_content_nil)
(tui_source_window::do_scroll_vertical): Update.
* tui/tui-layout.c (show_layout): Update.
* tui/tui-disasm.c (tui_set_disassem_content)
(tui_disasm_window::do_scroll_vertical): Update.
* tui/tui-data.h (tui_win_content): Remove.
(struct tui_gen_win_info) <content, content_size>: Remove.
(struct tui_source_element): Add initializers and destructor.
(union tui_which_element, struct tui_win_element): Remove.
(struct tui_source_window_base) <content>: New field.
(struct tui_data_window): Remove destructor.
(tui_alloc_content, tui_free_win_content)
(tui_free_all_source_wins_content): Don't declare.
* tui/tui-data.c (tui_initialize_static_data): Update.
(init_content_element, tui_alloc_content): Remove.
(~tui_gen_win_info): Update.
(~tui_data_window, tui_free_all_source_wins_content)
(tui_free_win_content, free_content, free_content_elements):
Remove.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_clear_source_content)
(tui_erase_source_content, tui_show_source_content): Change type
of win_info.
* tui/tui-winsource.c (tui_clear_source_content)
(tui_erase_source_content, tui_show_source_content): Change type
of win_info.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Update.
* tui/tui-source.h (tui_set_source_content_nil): Change type of
win_info.
* tui/tui-source.c (tui_set_source_content_nil): Change type of
win_info.
* tui/tui-layout.c (show_source_or_disasm_and_command): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_clear_source_content)
(tui_source_window_base::set_is_exec_point_at): Update.
* tui/tui-source.c (tui_set_source_content_nil): Update.
* tui/tui-data.h (struct tui_source_element) <is_exec_point>: Now
a bool.
* tui/tui-data.c (init_content_element): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_gen_win_info::make_visible): Update.
* tui/tui-win.c (make_invisible_and_set_new_height): Update.
* tui/tui-layout.c (init_and_make_win): Update.
* tui/tui.h (enum tui_win_type): Update.
* tui/tui-data.h (tui_win_is_auxiliary): Rename from
tui_win_is_auxillary.
* tui/tui-data.c (tui_win_is_auxiliary): Rename from
tui_win_is_auxillary.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_data_window::refresh_window): Update.
* tui/tui-windata.c (tui_data_window::first_data_item_displayed)
(tui_delete_data_content_windows, tui_display_all_data)
(tui_data_window::do_scroll_vertical, tui_display_data_from):
Update.
* tui/tui-win.c (tui_data_window::set_new_height): Simplify.
* tui/tui-regs.c (tui_last_regs_line_no)
(tui_line_from_reg_element_no, tui_first_reg_element_no_inline)
(tui_show_registers): Update.
(tui_show_register_group): Return void. Update.
(tui_display_registers_from, tui_display_reg_element_at_line)
(tui_display_registers_from_line, tui_check_register_values):
Update.
* tui/tui-data.h (union tui_which_element) <data_window>: Remove
member.
(struct tui_data_window) <regs_content>: Now a std::vector.
<regs_content_count>: Remove.
(tui_add_content_elements, tui_free_data_content): Don't declare.
* tui/tui-data.c (tui_data_window::clear_detail): Update.
(init_content_element): Remove DATA_WIN case. Add assert.
(tui_add_content_elements): Remove.
(tui_data_window): Update.
(tui_free_data_content): Remove.
(free_content_elements): Remove DATA_WIN case.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.c (tui_data_item_window): Update.
* tui/tui-windata.h (tui_check_data_values): Don't declare.
* tui/tui-windata.c (tui_display_all_data)
(tui_display_data_from_line): Update.
(tui_check_data_values): Remove.
* tui/tui-regs.c (tui_show_register_group)
(tui_display_reg_element_at_line): Update.
* tui/tui-hooks.c (tui_register_changed)
(tui_refresh_frame_and_register_information): Call
tui_check_register_values.
* tui/tui-data.h (struct tui_data_window) <data_content,
data_content_count, data_type>: Remove.
(enum tui_data_type): Remove.
* tui/tui-data.c (tui_data_window::clear_detail)
(~tui_data_window): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_first_data_item_displayed): Don't
declare.
* tui/tui-windata.c (tui_data_window::first_data_item_displayed):
Rename from tui_first_data_item_displayed. Update.
(tui_data_window::refresh_all)
(tui_data_window::do_scroll_vertical): Update.
* tui/tui-data.h (struct tui_data_window)
<first_data_item_displayed>: Declare new method.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (tui_init_generic_part): Don't declare.
* tui/tui-data.c (tui_init_generic_part): Remove, moving
contents...
(tui_initialize_static_data): ...here.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_show_registers, tui_show_register_group)
(tui_display_registers_from, tui_check_register_values): Update.
(tui_display_register): Remove win_info parameter; update.
(tui_get_register): Change type of parameters.
* tui/tui-data.h (struct tui_data_element): Remove.
(union tui_which_element) <data>: Remove.
<data_window>: Change type.
(struct tui_data_item_window): New.
* tui/tui-data.c (init_content_element): Remove DATA_ITEM_WIN
case. Add assert.
(~tui_data_item_window): New destructor.
(free_content_elements): Remove DATA_ITEM_WIN case.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui.h (enum tui_win_type) <MAX_WINDOWS, UNDEFINED_WIN>:
Remove.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_command_element): Remove.
(union tui_which_element) <command>: Remove.
* tui/tui-data.c (init_content_element): Remove CMD_WIN case. Add
assert.
(free_content_elements): Remove CMD_WIN case.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (tui_set_layout): Update.
* tui/tui-data.h (struct tui_layout_def) <split>: Remove.
* tui/tui-data.c (layout_def): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_refresh_all): Update.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights)
(tui_source_window_base::set_new_height): Update.
* tui/tui-stack.c (tui_make_status_line): Change parameter type.
Update.
(tui_set_locator_fullname, tui_set_locator_info)
(tui_show_frame_info): Update.
* tui/tui-source.c (tui_set_source_content)
(tui_source_is_displayed): Update.
* tui/tui-layout.c (show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Update.
* tui/tui-disasm.c (tui_set_disassem_content)
(tui_get_begin_asm_address): Update.
* tui/tui-data.h (struct tui_locator_element): Remove.
(union tui_which_element) <locator>: Remove.
(struct tui_locator_window): New.
(tui_locator_win_info_ptr): Change return type.
* tui/tui-data.c (_locator): Change type.
(tui_locator_win_info_ptr): Change return type.
(init_content_element): Remove LOCATOR_WIN case. Add assert.
(tui_alloc_content): Add assert.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c
(tui_exec_info_window::maybe_allocate_content): New method.
(tui_set_exec_info_content, tui_show_exec_info_content): Update.
* tui/tui-layout.c (init_and_make_win): Add EXEC_INFO_WIN case.
(make_source_or_disasm_window): Add cast.
* tui/tui-data.h (union tui_which_element) <simple_string>:
Remove.
(struct tui_source_info): New.
(struct tui_source_window_base) <execution_info>: Change type.
* tui/tui-data.c (init_content_element): Remove EXEC_INFO_WIN
case, and add assert.
(tui_alloc_content): Add assert.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (tui_alloc_win_info): Don't declare.
* tui/tui-layout.c (init_and_make_win): Use "new" directly.
* tui/tui-data.c (tui_alloc_win_info): Remove.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_set_win_focus_to): Don't check window type.
* tui/tui-wingeneral.c (tui_unhighlight_win): Check
can_highlight.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_source_window_base::update_tab_width): Call
make_visible_with_new_height method.
(tui_win_info::make_visible_with_new_height): New method.
(tui_source_window_base::do_make_visible_with_new_height)
(tui_data_window::do_make_visible_with_new_height)
(tui_cmd_window::do_make_visible_with_new_height): New methods.
(make_visible_with_new_height): Remove.
(tui_resize_all, tui_adjust_win_heights): Use
make_visible_with_new_height method.
* tui/tui-data.h (struct tui_win_info)
<do_make_visible_with_new_height, make_visible_with_new_height>:
New methods.
(struct tui_source_window_base, struct tui_data_window)
(struct tui_cmd_window) <do_make_visible_with_new_height>: New
methods.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_source_window_base::update_tab_width): New
method.
(update_tab_width): Call update_tab_width method.
* tui/tui-data.h (struct tui_win_info)
(struct tui_source_window_base) <update_tab_width>: New methods.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_make_window): Change type of "box_it"
parameter.
* tui/tui-wingeneral.c (tui_make_window): Change type of "box_it"
parameter.
(tui_gen_win_info::make_visible): Update.
* tui/tui-layout.c (init_and_make_win): Change type of "box_it"
parameter.
* tui/tui-data.h (enum tui_box): New enum.
(BOX_WINDOW, DONT_BOX_WINDOW): Remove defines.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_source_or_disasm_window): Always use
init_and_make_win for EXEC_INFO_WIN.
* tui/tui-data.h (struct tui_gen_win_info) <~tui_gen_win_info>: No
longer inline.
(struct tui_win_info) <~tui_win_info>: Inline.
(tui_source_exec_info_win_ptr, tui_disassem_exec_info_win_ptr):
Don't declare.
* tui/tui-data.c (source_win, disasm_win): Remove globals.
(tui_source_exec_info_win_ptr, tui_disassem_exec_info_win_ptr):
Remove.
(tui_initialize_static_data): Update.
(~tui_gen_win_info): Handle more cleanup here.
(~tui_source_window_base): Delete "execution_info".
(~tui_win_info): Move code to ~tui_gen_win_info; remove.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_command_window): Don't set
can_highlight.
(show_source_disasm_command): Call the reset method.
(show_data): Don't set can_highlight. Call the reset method.
(tui_gen_win_info::reset): Rename from init_gen_win_info
(init_and_make_win): Simplify. Return tui_gen_win_info.
(show_source_or_disasm_and_command): Call the reset method.
* tui/tui-data.h (struct tui_gen_win_info) <reset>: New method.
(struct tui_cmd_window): Set can_highlight.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_gen_win_info::make_visible): Rename
from make_visible.
(tui_make_visible, tui_make_invisible): Rewrite.
(tui_win_info::make_visible): Remove.
(tui_source_window_base::make_visible): Update.
* tui/tui-data.h (struct tui_gen_win_info) <make_visible>: New
method. Moved from...
(struct tui_win_info) <make_visible>: ...here.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c
(tui_source_window_base::do_scroll_horizontal): Remove direction
parameter.
* tui/tui-windata.c (tui_data_window::do_scroll_vertical): Remove
direction parameter.
* tui/tui-win.c (tui_win_info::forward_scroll)
(tui_win_info::backward_scroll, tui_win_info::left_scroll)
(tui_win_info::right_scroll): Update.
* tui/tui-source.c (tui_source_window::do_scroll_vertical): Remove
direction parameter.
* tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Remove
direction parameter.
* tui/tui-data.h (enum tui_scroll_direction): Remove.
(struct tui_win_info) <do_scroll_vertical, do_scroll_horizontal>:
Remove direction parameter.
(struct tui_source_window_base, struct tui_source_window)
(struct tui_disasm_window, struct tui_data_window)
(struct tui_cmd_window): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_set_exec_info_content)
(tui_show_exec_info_content, tui_erase_exec_info_content)
(tui_clear_exec_info_content, tui_update_exec_info): Change
argument to tui_source_window_base.
* tui/tui-winsource.c (tui_set_exec_info_content)
(tui_show_exec_info_content, tui_erase_exec_info_content)
(tui_clear_exec_info_content, tui_update_exec_info): Change
argument to tui_source_window_base.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_set_exec_info_content): Return void.
* tui/tui-winsource.c (tui_set_exec_info_content): Return void.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_set_exec_info_content): Remove NULL
check.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_alloc_source_buffer): Change return
type to void.
* tui/tui-winsource.c (tui_alloc_source_buffer): Change return
type to void.
* tui/tui-source.c (tui_set_source_content): Update.
* tui/tui-disasm.c (tui_set_disassem_content): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (window_name_completer, tui_set_focus)
(tui_all_windows_info): Use name method.
* tui/tui-data.h (struct tui_gen_win_info)
(struct tui_source_window, struct tui_disasm_window)
(struct tui_data_window, struct tui_cmd_window) <name>: New
method.
(tui_win_name): Don't declare.
* tui/tui-data.c (tui_partial_win_by_name): Use name method.
(tui_win_name): Remove.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_update_source_window)
(tui_update_source_window_as_is): Change parameter type.
* tui/tui-winsource.c (tui_update_source_window): Change win_info
to be a tui_source_window_base.
(tui_update_source_window_as_is): Likewise.
* tui/tui-win.c (make_visible_with_new_height): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_erase_source_content)
(tui_show_source_content, tui_show_exec_info_content)
(tui_erase_exec_info_content): Use refresh_window method.
* tui/tui-wingeneral.h (tui_refresh_win): Don't declare.
* tui/tui-wingeneral.c (tui_gen_win_info::refresh_window): Rename
from tui_refresh_win.
(tui_data_window::refresh_window): New method.
(tui_win_info::refresh, tui_source_window_base::refresh)
(tui_refresh_all): Use refresh_window method.
* tui/tui-stack.c (tui_show_locator_content): Call refresh_window
method.
* tui/tui-regs.c (tui_display_register): Call refresh_window
method.
* tui/tui-layout.c (show_source_disasm_command)
(show_source_or_disasm_and_command): Call refresh_window method.
* tui/tui-data.h (struct tui_gen_win_info)
(struct tui_data_window, struct tui_cmd_window) <refresh_window>:
New method.
Derive tui_win_info from tui_gen_win_info This changes tui_win_info to derive from tui_gen_win_info, rather than having a tui_gen_win_info as a member. This removes a layer of member access from the entire TUI, which is why this patch is so large. This change will enable further removal of switches based on window type. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_rl_other_window, tui_enable) (tui_is_window_visible, tui_get_command_dimension): Update. * tui/tui-winsource.c (tui_update_source_window_as_is) (tui_clear_source_content, tui_erase_source_content) (tui_show_source_line, tui_source_window_base::refill) (tui_source_window_base::do_scroll_horizontal) (tui_source_window_base::set_is_exec_point_at) (tui_update_breakpoint_info, tui_set_exec_info_content) (tui_alloc_source_buffer, tui_line_is_displayed) (tui_addr_is_displayed): Update. * tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win) (tui_check_and_display_highlight_if_needed) (tui_win_info::make_visible, tui_win_info::refresh) (tui_refresh_all): Update. * tui/tui-windata.c (tui_first_data_item_displayed) (tui_delete_data_content_windows, tui_erase_data_content) (tui_display_all_data, tui_data_window::refresh_all) (tui_check_data_values): Update. * tui/tui-win.c (window_name_completer, tui_update_gdb_sizes) (tui_set_win_focus_to, tui_win_info::forward_scroll) (tui_win_info::backward_scroll, tui_refresh_all_win) (tui_resize_all, tui_set_focus, tui_all_windows_info) (update_tab_width, tui_set_win_height, tui_adjust_win_heights) (tui_source_window_base::set_new_height) (tui_data_window::set_new_height) (make_invisible_and_set_new_height) (make_visible_with_new_height, new_height_ok) (parse_scrolling_args): Update. * tui/tui-stack.c (tui_show_frame_info): Update. * tui/tui-source.c (tui_set_source_content) (tui_set_source_content_nil, tui_source_is_displayed) (tui_source_window::do_scroll_vertical): Update. * tui/tui-regs.c (tui_show_registers, tui_show_register_group) (tui_display_registers_from, tui_display_reg_element_at_line) (tui_check_register_values, tui_reg_command): Update. * tui/tui-layout.c (tui_default_win_height) (show_source_disasm_command, show_data, init_and_make_win) (show_source_or_disasm_and_command): Update. * tui/tui-io.c (update_cmdwin_start_line, tui_putc, tui_puts) (tui_redisplay_readline, tui_mld_flush) (tui_mld_erase_entire_line, tui_mld_getc, tui_cont_sig) (tui_getc): Update. * tui/tui-disasm.c (tui_set_disassem_content) (tui_disasm_window::do_scroll_vertical): Update. * tui/tui-data.h (struct tui_gen_win_info) <~tui_gen_win_info>: Now virtual. (struct tui_win_info): Derive from tui_gen_win_info. <~tui_win_info>: Mark as override. <generic>: Remove member. * tui/tui-data.c (tui_cmd_window::clear_detail, tui_next_win) (tui_prev_win, tui_partial_win_by_name, tui_win_info) (~tui_data_window, ~tui_win_info) (tui_free_all_source_wins_content): Update. * tui/tui-command.c (tui_refresh_cmd_win): Update.
2019-06-17 00:03:54 +02:00
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_rl_other_window, tui_enable)
(tui_is_window_visible, tui_get_command_dimension): Update.
* tui/tui-winsource.c (tui_update_source_window_as_is)
(tui_clear_source_content, tui_erase_source_content)
(tui_show_source_line, tui_source_window_base::refill)
(tui_source_window_base::do_scroll_horizontal)
(tui_source_window_base::set_is_exec_point_at)
(tui_update_breakpoint_info, tui_set_exec_info_content)
(tui_alloc_source_buffer, tui_line_is_displayed)
(tui_addr_is_displayed): Update.
* tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win)
(tui_check_and_display_highlight_if_needed)
(tui_win_info::make_visible, tui_win_info::refresh)
(tui_refresh_all): Update.
* tui/tui-windata.c (tui_first_data_item_displayed)
(tui_delete_data_content_windows, tui_erase_data_content)
(tui_display_all_data, tui_data_window::refresh_all)
(tui_check_data_values): Update.
* tui/tui-win.c (window_name_completer, tui_update_gdb_sizes)
(tui_set_win_focus_to, tui_win_info::forward_scroll)
(tui_win_info::backward_scroll, tui_refresh_all_win)
(tui_resize_all, tui_set_focus, tui_all_windows_info)
(update_tab_width, tui_set_win_height, tui_adjust_win_heights)
(tui_source_window_base::set_new_height)
(tui_data_window::set_new_height)
(make_invisible_and_set_new_height)
(make_visible_with_new_height, new_height_ok)
(parse_scrolling_args): Update.
* tui/tui-stack.c (tui_show_frame_info): Update.
* tui/tui-source.c (tui_set_source_content)
(tui_set_source_content_nil, tui_source_is_displayed)
(tui_source_window::do_scroll_vertical): Update.
* tui/tui-regs.c (tui_show_registers, tui_show_register_group)
(tui_display_registers_from, tui_display_reg_element_at_line)
(tui_check_register_values, tui_reg_command): Update.
* tui/tui-layout.c (tui_default_win_height)
(show_source_disasm_command, show_data, init_and_make_win)
(show_source_or_disasm_and_command): Update.
* tui/tui-io.c (update_cmdwin_start_line, tui_putc, tui_puts)
(tui_redisplay_readline, tui_mld_flush)
(tui_mld_erase_entire_line, tui_mld_getc, tui_cont_sig)
(tui_getc): Update.
* tui/tui-disasm.c (tui_set_disassem_content)
(tui_disasm_window::do_scroll_vertical): Update.
* tui/tui-data.h (struct tui_gen_win_info) <~tui_gen_win_info>:
Now virtual.
(struct tui_win_info): Derive from tui_gen_win_info.
<~tui_win_info>: Mark as override.
<generic>: Remove member.
* tui/tui-data.c (tui_cmd_window::clear_detail, tui_next_win)
(tui_prev_win, tui_partial_win_by_name, tui_win_info)
(~tui_data_window, ~tui_win_info)
(tui_free_all_source_wins_content): Update.
* tui/tui-command.c (tui_refresh_cmd_win): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (init_and_make_win): Use new.
* tui/tui-data.h (struct tui_gen_win_info): Add constructor,
destructor, initializers.
(tui_alloc_generic_win_info): Don't declare.
* tui/tui-data.c (_locator): Add argument to constructor.
(source_win, disasm_win): New globals.
(exec_info): Remove.
(tui_source_exec_info_win_ptr, tui_disassem_exec_info_win_ptr):
Update.
(tui_alloc_generic_win_info): Remove.
(init_content_element): Use new.
(tui_win_info::tui_win_info): Update.
(free_content_elements) <case DATA_WIN>: Use delete.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_refresh_win): Update.
* tui/tui-windata.c (tui_first_data_item_displayed)
(tui_delete_data_content_windows): Update.
* tui/tui-win.c (tui_data_window::set_new_height): Update.
* tui/tui-regs.c (tui_show_registers, tui_show_register_group)
(tui_display_registers_from, tui_check_register_values): Update.
* tui/tui-data.h (union tui_which_element) <data_window>: Now a
pointer.
* tui/tui-data.c (init_content_element): Update. Allocate the new
window.
(tui_free_data_content): Update.
(free_content_elements) <case DATA_WIN>: Free the window.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win):
Update.
* tui/tui-layout.c (make_command_window)
(show_source_disasm_command, show_data, init_and_make_win)
(show_source_or_disasm_and_command): Update.
* tui/tui-data.h (struct tui_win_info) <set_highlight>: New
method.
<can_highight, is_highlighted>: Now bool.
(tui_set_win_highlight): Don't declare.
* tui/tui-data.c (tui_set_win_highlight): Remove.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (make_visible): Remove check of window
type.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_win_info::max_height)
(tui_cmd_window::max_height): New methods.
(new_height_ok): Call max_height.
* tui/tui-data.h (struct tui_win_info, struct tui_cmd_window)
<max_height>: New method.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_source_window_base::set_new_height)
(tui_data_window::set_new_height): New methods.
(make_invisible_and_set_new_height): Call set_new_height method.
* tui/tui-data.h (struct tui_win_info)
(struct tui_source_window_base, struct tui_data_window)
<set_new_height>: New method.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_rl_other_window): Call the refresh_all method.
* tui/tui-windata.c (tui_data_window::refresh_all): Rename from
tui_refresh_data_win.
* tui/tui-win.c (tui_source_window_base::refresh_all): New
method.
(tui_refresh_all_win): Call the refresh_all method.
(tui_set_focus): Likewise.
* tui/tui-data.h (struct tui_win_info) <refresh_all>: New method.
(struct tui_source_window_base, struct tui_data_window) <refresh>:
Likewise.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_refill_source_window)
(tui_set_is_exec_point_at): Don't declare.
* tui/tui-winsource.c (tui_update_source_windows_with_addr)
(tui_source_window_base::refill): Rename from
tui_refill_source_window.
(tui_source_window_base::do_scroll_horizontal): Update.
(tui_source_window_base::set_is_exec_point_at): Rename from
tui_set_is_exec_point_at.
(tui_update_all_breakpoint_info): Update.
* tui/tui-stack.c (tui_show_frame_info): Update.
* tui/tui-layout.c (show_data): Add cast.
* tui/tui-hooks.c (tui_redisplay_source): Call refill method.
* tui/tui-data.h (struct tui_source_window_base) <refill,
set_is_exec_point_at>: New methods.
(tui_source_windows, tui_add_to_source_windows): Update types.
(tui_add_to_source_windows): Remove redundant declaration.
* tui/tui-data.c (source_windows): Store tui_source_window_base.
(tui_source_windows): Change return type.
(tui_clear_source_windows_detail): Update.
(tui_add_to_source_windows): Change type of parameter.
(tui_free_all_source_wins_content): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_win_info::refresh)
(tui_source_window_base::refresh): New methods.
(tui_refresh_all): Call the refresh method.
* tui/tui-data.h (struct tui_win_info)
(struct tui_source_window_base) <refresh>: New method.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui.h (tui_is_window_visible): Return bool.
* tui/tui.c (tui_is_window_visible): Return bool.
* tui/tui-wingeneral.c (tui_make_window, make_visible)
(tui_make_visible, tui_make_invisible)
(tui_win_info::make_visible)
(tui_source_window_base::make_visible, make_all_visible)
(tui_make_all_visible, tui_make_all_invisible): Update.
* tui/tui-windata.c (tui_delete_data_content_windows): Update.
* tui/tui-data.h (struct tui_gen_win_info) <is_visible>: Now
bool.
(struct tui_win_info, struct tui_source_window_base)
(struct tui_cmd_window) <make_visible>: Change parameter to bool.
* tui/tui-data.c (tui_init_generic_part): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_win_info::make_visible)
(tui_source_window_base::make_visible): New methods.
(make_all_visible): Make method call.
* tui/tui-data.h (struct tui_win_info) <make_visible>: New method.
(struct tui_source_window_base, struct tui_cmd_window): Override
make_visible.
(tui_win_is_source_type): Don't declare.
* tui/tui-data.c (tui_win_is_source_type): Remove.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_or_disasm_and_command): Remove
NULL check.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_data_window, struct tui_cmd_window):
Inline constructor. Add initializers for members.
* tui/tui-data.c (tui_data_window, tui_cmd_window): Remove
constructors; now inline in class.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_show_registers): Update.
* tui/tui-data.h (struct tui_data_window) <display_regs>: Now
bool.
* tui/tui-data.c (tui_data_window::clear_detail)
(tui_data_window): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-windata.c (tui_display_all_data)
(tui_display_data_from_line, tui_display_data_from)
(tui_check_data_values, tui_data_window::do_scroll_vertical):
Update.
* tui/tui-regs.c (tui_last_regs_line_no)
(tui_line_from_reg_element_no, tui_first_reg_element_no_inline)
(tui_show_registers, tui_show_register_group)
(tui_display_registers_from, tui_display_reg_element_at_line)
(tui_display_registers_from_line, tui_check_register_values)
(tui_reg_next, tui_reg_prev): Update.
* tui/tui-layout.c (tui_set_layout, show_data): Update.
* tui/tui-data.h (struct tui_data_info): Remove. Move contents to
tui_data_window.
(struct tui_win_info) <detail>: Remove. Add new fields from
tui_data_info.
(TUI_DATA_WIN): Add cast.
* tui/tui-data.c (tui_data_window::clear_detail, tui_data_window)
(~tui_data_window): Simplify.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_source_disasm_command)
(show_source_or_disasm_and_command): Update.
* tui/tui-io.c (update_cmdwin_start_line)
(tui_redisplay_readline): Update.
* tui/tui-data.h (struct tui_command_info): Remove.
(struct tui_win_info) <detail>: Remove command_info member.
(struct tui_data_window) <start_line>: New member, from
tui_command_info.
(TUI_CMD_WIN): Add casts.
Remove struct tui_source_info The tui_source_info struct is used as a member of the "detail" union in tui_win_info, and this member of the union is only used by source and disassembly windows. This patch removes tui_source_info and moves its members directly to tui_source_window_base. This simplifies the code by removing a layer of references from many places. In a few spots, a new cast was needed, but most of these will be removed by the end of the series. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_update_source_window) (tui_refill_source_window) (tui_source_window_base::do_scroll_horizontal) (tui_update_breakpoint_info, tui_set_exec_info_content) (tui_show_exec_info_content, tui_erase_exec_info_content) (tui_clear_exec_info_content): Update. * tui/tui-wingeneral.c (make_all_visible, tui_refresh_all): Update. * tui/tui-win.c (make_invisible_and_set_new_height) (make_visible_with_new_height): Update. * tui/tui-source.c (tui_set_source_content) (tui_show_symtab_source): Update. * tui/tui-layout.c (extract_display_start_addr) (show_source_disasm_command, show_data) (make_source_or_disasm_window) (show_source_or_disasm_and_command): Update. * tui/tui-disasm.c (tui_set_disassem_content): Simplify. (tui_disasm_window::do_scroll_vertical): Remove shadowing "gdbarch". * tui/tui-data.h (struct tui_source_info): Remove. Move contents to tui_source_window_base. (struct tui_win_info) <detail>: Remove source_info member. (struct tui_source_window_base) <has_locator>: Inline. Move contents from tui_source_info; rename has_locator member to m_has_locator. (TUI_SRC_WIN, TUI_DISASM_WIN): Add casts. * tui/tui-data.c (tui_source_window_base::has_locator): Move to header file. (tui_source_window_base::clear_detail, ~tui_source_window_base): Simplify. (tui_free_all_source_wins_content): Cast to tui_source_window_base.
2019-06-16 21:46:18 +02:00
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_window)
(tui_refill_source_window)
(tui_source_window_base::do_scroll_horizontal)
(tui_update_breakpoint_info, tui_set_exec_info_content)
(tui_show_exec_info_content, tui_erase_exec_info_content)
(tui_clear_exec_info_content): Update.
* tui/tui-wingeneral.c (make_all_visible, tui_refresh_all):
Update.
* tui/tui-win.c (make_invisible_and_set_new_height)
(make_visible_with_new_height): Update.
* tui/tui-source.c (tui_set_source_content)
(tui_show_symtab_source): Update.
* tui/tui-layout.c (extract_display_start_addr)
(show_source_disasm_command, show_data)
(make_source_or_disasm_window)
(show_source_or_disasm_and_command): Update.
* tui/tui-disasm.c (tui_set_disassem_content): Simplify.
(tui_disasm_window::do_scroll_vertical): Remove shadowing
"gdbarch".
* tui/tui-data.h (struct tui_source_info): Remove. Move contents
to tui_source_window_base.
(struct tui_win_info) <detail>: Remove source_info member.
(struct tui_source_window_base) <has_locator>: Inline.
Move contents from tui_source_info; rename has_locator member to
m_has_locator.
(TUI_SRC_WIN, TUI_DISASM_WIN): Add casts.
* tui/tui-data.c (tui_source_window_base::has_locator): Move to
header file.
(tui_source_window_base::clear_detail, ~tui_source_window_base):
Simplify.
(tui_free_all_source_wins_content): Cast to
tui_source_window_base.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (make_invisible_and_set_new_height)
(make_visible_with_new_height): Call has_locator method.
* tui/tui-layout.c (show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Update for bool change.
* tui/tui-data.h (struct tui_source_info) <has_locator>: Now bool.
(tui_win_info) <has_locator>: New method.
(struct tui_source_window_base) <has_locator>: New method.
(tui_win_has_locator): Don't declare.
* tui/tui-data.c (tui_source_window_base::has_locator): Rename
from tui_win_has_locator.
(tui_source_window_base): Use false, not FALSE.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (tui_clear_win_detail): Don't declare.
* tui/tui-data.c (tui_clear_source_windows_detail): Call the
clear_detail method directly.
(tui_clear_win_detail): Remove.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Use
"this", not TUI_DISASM_WIN.
Introduce methods for scrolling This changes the TUI to use virtual methods on the various window types for scrolling. Window-specific functions for this purpose are renamed to be methods, and the generic tui_scroll function is removed as it is no longer called. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_horizontal_source_scroll): Don't declare. * tui/tui-winsource.c (tui_source_window_base::do_scroll_horizontal): Rename from tui_horizontal_source_scroll. * tui/tui-windata.h (tui_vertical_data_scroll): Don't declare. * tui/tui-windata.c (tui_data_window::do_scroll_vertical): Rename from tui_vertical_data_scroll. * tui/tui-win.h (tui_scroll): Don't declare. * tui/tui-win.c (tui_win_info::forward_scroll) (tui_win_info::backward_scroll, tui_win_info::left_scroll) (tui_win_info::right_scroll): Rename and update. (tui_scroll_forward_command, tui_scroll_backward_command) (tui_scroll_left_command, tui_scroll_right_command): Update. (tui_scroll): Remove. * tui/tui-source.h: Don't declare tui_vertical_source_scroll. * tui/tui-source.c (tui_source_window::do_scroll_vertical): Rename from tui_vertical_source_scroll. * tui/tui-disasm.h (tui_vertical_disassem_scroll): Don't declare. * tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Rename from tui_vertical_disassem_scroll. * tui/tui-data.h (struct tui_win_info) <do_scroll_vertical, do_scroll_horizontal>: New methods. <forward_scroll, backward_scroll, left_scroll, right_scroll>: Likewise. (struct tui_source_window_base): Add do_scroll_horizontal. (struct tui_source_window, struct tui_disasm_window): Add do_scroll_vertical. (struct tui_data_window, struct tui_cmd_window): Add do_scroll_horizontal and do_scroll_vertical. * tui/tui-command.c (tui_dispatch_ctrl_char): Use method calls.
2019-06-16 19:22:38 +02:00
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (tui_horizontal_source_scroll): Don't
declare.
* tui/tui-winsource.c
(tui_source_window_base::do_scroll_horizontal): Rename from
tui_horizontal_source_scroll.
* tui/tui-windata.h (tui_vertical_data_scroll): Don't declare.
* tui/tui-windata.c (tui_data_window::do_scroll_vertical): Rename
from tui_vertical_data_scroll.
* tui/tui-win.h (tui_scroll): Don't declare.
* tui/tui-win.c (tui_win_info::forward_scroll)
(tui_win_info::backward_scroll, tui_win_info::left_scroll)
(tui_win_info::right_scroll): Rename and update.
(tui_scroll_forward_command, tui_scroll_backward_command)
(tui_scroll_left_command, tui_scroll_right_command): Update.
(tui_scroll): Remove.
* tui/tui-source.h: Don't declare tui_vertical_source_scroll.
* tui/tui-source.c (tui_source_window::do_scroll_vertical): Rename
from tui_vertical_source_scroll.
* tui/tui-disasm.h (tui_vertical_disassem_scroll): Don't declare.
* tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Rename
from tui_vertical_disassem_scroll.
* tui/tui-data.h (struct tui_win_info) <do_scroll_vertical,
do_scroll_horizontal>: New methods.
<forward_scroll, backward_scroll, left_scroll, right_scroll>:
Likewise.
(struct tui_source_window_base): Add do_scroll_horizontal.
(struct tui_source_window, struct tui_disasm_window): Add
do_scroll_vertical.
(struct tui_data_window, struct tui_cmd_window): Add
do_scroll_horizontal and do_scroll_vertical.
* tui/tui-command.c (tui_dispatch_ctrl_char): Use method calls.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_source_window_base): New struct.
(struct tui_source_window): Derive from tui_source_window_base.
(struct tui_disasm_window): New struct.
* tui/tui-data.c (tui_source_window_base::clear_detail): Rename
from tui_source_window::clear_detail.
(tui_source_window_base): Rename from tui_source_window.
(~tui_source_window_base): Rename from ~tui_source_window.
(tui_alloc_win_info): Create a tui_disasm_window.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_source_window)
(struct tui_data_window): Declare destructors.
* tui/tui-data.c (~tui_source_window, ~tui_data_window): New
destructors.
(tui_win_info): Simplify.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_display_main)
(tui_update_source_windows_with_addr)
(tui_update_all_breakpoint_info): Update.
* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights)
(new_height_ok, parse_scrolling_args): Update.
* tui/tui-stack.c (tui_show_frame_info): Update.
* tui/tui-data.h (struct tui_list): Remove.
(tui_source_windows): Return a reference to a std::vector.
* tui/tui-data.c (source_windows): Now a std::vector.
(tui_source_windows): Change return type.
(tui_clear_source_windows): Rewrite.
(tui_clear_source_windows_detail, tui_add_to_source_windows)
(tui_free_all_source_wins_content): Rewrite.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_win_info, struct tui_source_window)
(struct tui_data_window, struct tui_cmd_window): Declare
clear_detail method.
* tui/tui-data.c (tui_source_window::clear_detail)
(tui_cmd_window::clear_detail, tui_data_window::clear_detail): New
methods.
(tui_clear_win_detail): Simplify.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_source_window, make_disasm_window)
(make_source_or_disasm_window): Remove win_info_ptr parameter.
Return the new window.
(show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_command_window): Remove win_info_ptr
parameter. Return the new window.
(show_source_disasm_command): Update and remove NULL check.
(show_source_or_disasm_and_command): Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (init_and_make_win): Remove NULL check.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_win_info): Make constructor
protected. Make destructor virtual. Add initializers.
(tui_source_window, tui_data_window, tui_cmd_window): New
classes.
* tui/tui-data.c (tui_win_info): Rename from init_win_info. Now a
constructor. Add "type" parameter.
(tui_source_window, tui_data_window, tui_cmd_window): New
constructors.
(tui_alloc_win_info): Instantiate the appropriate subclass.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_resize_all): Use delete.
* tui/tui-data.h (struct tui_win_info) <~tui_win_info>: Declare
destructor.
(tui_free_window): Don't declare.
* tui/tui-data.c (~tui_win_info): Rename from tui_free_window.
Update.
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_win_info): Add constructor.
* tui/tui-data.c (tui_alloc_win_info): Use new.
(tui_free_window): Use delete.
2019-06-22 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_first_data_element_no_in_line): Don't
declare.
* tui/tui-windata.c (tui_first_data_element_no_in_line): Remove.
2019-06-22 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (tui_del_window, tui_del_data_windows): Don't
declare.
* tui/tui-data.c (tui_del_window, tui_del_data_windows): Remove.
[gdb] Fix s390x -m31 build When building gdb on s390x with -m31, we run into this Wformat warning (which Werror turns into an error): ... gdb/dwarf2read.c: In function \ 'void create_addrmap_from_aranges(dwarf2_per_objfile*, \ dwarf2_section_info*)': gdb/dwarf2read.c:3277:22: error: format '%zu' expects argument of type \ 'size_t', but argument 3 has type 'int' [-Werror=format=] warning (_("Section .debug_aranges in %s entry at offset %zu " ... The Wformat warning is triggered in this statement: ... warning (_("Section .debug_aranges in %s entry at offset %zu " "length %s exceeds section length %s, " "ignoring .debug_aranges."), objfile_name (objfile), entry_addr - section->buffer, plongest (bytes_read + entry_length), pulongest (section->size)); ... where 'entry_addr - section->buffer' is of type ptrdiff_t and '%zu' prints an unsigned with the same size as size_t/ssize_t. On s390x with -m31, we have: - size_t : unsigned long int (32-bit) - ptrdiff_t: int (32-bit) Wformat warns against this because even though long int and int have the same size, the types are not compatible. [ The Wformat warning is to similar to what we would get for x86_64 -m32 (where long and int are also the same size) and: ... int i; printf ("%ld", i); ... ] Fix this by using '%s' and plongest instead of '%zu' to print ptrdiff_t. Build and reg-tested on x86_64. gdb/ChangeLog: 2019-06-22 Tom de Vries <tdevries@suse.de> * dwarf2read.c (create_addrmap_from_aranges) (read_debug_names_from_section): Print ptrdiff_t using '%s' and plongest instead of '%zu'.
2019-06-22 10:59:37 +02:00
2019-06-22 Tom de Vries <tdevries@suse.de>
* dwarf2read.c (create_addrmap_from_aranges)
(read_debug_names_from_section): Print ptrdiff_t using '%s' and plongest
instead of '%zu'.
2019-06-21 Simon Marchi <simon.marchi@efficios.com>
* dwarf2read.h (dwarf2_section_info_def): Remove.
(DEF_VEC_O (dwarf2_section_info_def)): Remove.
* dwarf2read.c (struct dwo_sections) <types>: Change type to
std::vector<dwarf2_section_info>.
(struct dwo_file) <~dwo_file>: Remove.
(dwarf2_per_objfile::~dwarf2_per_objfile): Don't manually free
types field.
(dwarf2_per_objfile::locate_sections): Adjust to std::vector.
(dwarf2_read_debug_names): Likewise.
(create_debug_types_hash_table): Change parameter type to
array_view, adjust code accordingly.
(dwarf2_locate_dwo_sections): Adjust to std::vector.
(partial_die_info::fixup): Likewise.
(determine_prefix): Likewise.
* dwarf-index-write.c (write_psymtabs_to_index): Adjust.
2019-06-21 Simon Marchi <simon.marchi@polymtl.ca>
* dwarf2read.c (struct dwo_file) <dbfd>: Change type to
gdb_bfd_ref_ptr.
<~dwo_file>: Remove call to gdb_bfd_unref.
(open_and_init_dwo_file): Move gdb_bfd_ref_ptr into dbfd field. Call
gdb_bfd_ref_ptr::get.
2019-06-21 Simon Marchi <simon.marchi@polymtl.ca>
* dwarf2read.h (struct dwarf2_per_objfile) <dwo_files>: Change
type to htab_up.
* dwarf2read.c (struct dwo_file): Initialize fields.
<~dwo_file>: New.
(free_dwo_file): Remove, move content to ~dwo_file.
(struct dwo_file_deleter): Remove.
(dwo_file_up>: Remove custom deleter.
(free_dwo_files): Remove.
(dwarf2_per_objfile::~dwarf2_per_objfile): Don't explicitly free
dwo_files.
(process_skeletonless_type_units): Call unique_ptr::get.
(allocate_dwo_file_hash_table): Add deleter to created hash
table. Change return type to htab_up.
(lookup_dwo_file_slot): Don't memset dwo_file, call
unique_ptr::get.
(create_dwo_unit_in_dwp_v1): Allocate dwo_file with new.
(create_dwo_unit_in_dwp_v2): Likewise.
(open_and_init_dwo_file): Likewise.
(free_dwo_file_from_slot): Remove.
2019-06-21 Simon Marchi <simon.marchi@polymtl.ca>
* dwarf2read.h (struct dwarf2_section_info) <readin,
is_virtual>: Change type to bool.
* dwarf2read.c (dwarf2_read_section, create_dwp_v2_section): Use
true instead of 1.
2019-06-19 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (tui_init_content_element): Don't declare.
2019-06-19 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (tui_init_win_info): Don't declare.
2019-06-19 Tom de Vries <tdevries@suse.de>
* dwarf2read.h (abstract_to_concrete): Change type to
std::unordered_map<sect_offset, std::vector<sect_offset>,
gdb::hash_enum<sect_offset>>.
2019-06-19 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <case OP_ATR_FIRST>: Handle
EVAL_AVOID_SIDE_EFFECTS specially.
2019-06-19 Tom Tromey <tromey@adacore.com>
* source-cache.c (highlighter): New global.
(source_cache::get_source_lines): Create a highlighter on demand.
2019-06-18 Andrew Burgess <andrew.burgess@embecosm.com>
* defs.h (deprecated_interactive_hook): Delete declaration.
* interps.c (clear_interpreter_hooks): Remove use of
deprecated_interactive_hook.
* top.c (deprecated_interactive_hook): Delete definition.
* utils.c (maybe_quit): Remove use of deprecated_interactive_hook.
2019-06-18 Tom de Vries <tdevries@suse.de>
PR gdb/24515
* dwarf2read.h (abstract_to_concrete): Change type from
std::unordered_map<die_info_ptr, std::vector<die_info_ptr>> to
std::unordered_map<sect_offset, std::vector<sect_offset>>.
* dwarf2read.c (read_variable): Update.
(dwarf2_fetch_die_loc_sect_off): Update.
[gdb] Fix heap-buffer-overflow in child_path When compiling gdb with '-lasan -fsanitizer=address' and running tests with: - export ASAN_OPTIONS="detect_leaks=0:alloc_dealloc_mismatch=0", and - a target board using local-board.exp, which sets sysroot to "" we run into a heap-buffer-overflow in child_path for f.i. gdb.arch/amd64-byte: ... ==3997==ERROR: AddressSanitizer: heap-buffer-overflow on address \ 0x60200002abcf at pc 0x5602acdf6872 bp 0x7ffe5237a090 sp 0x7ffe5237a080 READ of size 1 at 0x60200002abcf thread T0 #0 0x5602acdf6871 in child_path(char const*, char const*) \ gdb/common/pathstuff.c:161 #1 0x5602adb06587 in find_separate_debug_file gdb/symfile.c:1483 #2 0x5602adb06f2f in find_separate_debug_file_by_debuglink[abi:cxx11](...) \ gdb/symfile.c:1563 #3 0x5602ad13b743 in elf_symfile_read gdb/elfread.c:1293 #4 0x5602adb01cfa in read_symbols gdb/symfile.c:798 #5 0x5602adb03769 in syms_from_objfile_1 gdb/symfile.c:1000 #6 0x5602adb039d0 in syms_from_objfile gdb/symfile.c:1017 #7 0x5602adb04551 in symbol_file_add_with_addrs gdb/symfile.c:1124 #8 0x5602adb04ebf in symbol_file_add_from_bfd(...) gdb/symfile.c:1204 #9 0x5602ada5a78d in solib_read_symbols(...) gdb/solib.c:695 #10 0x5602ada5bdae in solib_add(char const*, int, int) gdb/solib.c:1004 #11 0x5602ada49bcd in enable_break gdb/solib-svr4.c:2394 #12 0x5602ada4dae9 in svr4_solib_create_inferior_hook gdb/solib-svr4.c:3028 #13 0x5602ada5d4f1 in solib_create_inferior_hook(int) gdb/solib.c:1215 #14 0x5602ad347f66 in post_create_inferior(target_ops*, int) \ gdb/infcmd.c:467 #15 0x5602ad348b3c in run_command_1 gdb/infcmd.c:663 #16 0x5602ad348e55 in run_command gdb/infcmd.c:686 #17 0x5602acd7d32b in do_const_cfunc gdb/cli/cli-decode.c:106 #18 0x5602acd84bfe in cmd_func(cmd_list_element*, char const*, int) \ gdb/cli/cli-decode.c:1892 #19 0x5602adc62a90 in execute_command(char const*, int) gdb/top.c:630 #20 0x5602ad5053e6 in catch_command_errors gdb/main.c:372 #21 0x5602ad507eb1 in captured_main_1 gdb/main.c:1138 #22 0x5602ad5081ec in captured_main gdb/main.c:1163 #23 0x5602ad508281 in gdb_main(captured_main_args*) gdb/main.c:1188 #24 0x5602ac9ddc3a in main gdb/gdb.c:32 #25 0x7f582b56eb96 in __libc_start_main \ (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #26 0x5602ac9dda09 in _start \ (/home/smarchi/build/binutils-gdb/gdb/gdb+0x19a2a09) 0x60200002abcf is located 1 bytes to the left of 1-byte region \ [0x60200002abd0,0x60200002abd1) allocated by thread T0 here: #0 0x7f582e0e4b50 in __interceptor_malloc \ (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x5602acdd3656 in xmalloc gdb/common/common-utils.c:44 #2 0x5602aefe17d1 in xstrdup libiberty/xstrdup.c:34 #3 0x5602acdf61f6 in gdb_realpath(char const*) gdb/common/pathstuff.c:80 #4 0x5602adb06278 in find_separate_debug_file gdb/symfile.c:1444 #5 0x5602adb06f2f in find_separate_debug_file_by_debuglink[abi:cxx11](...) \ gdb/symfile.c:1563 #6 0x5602ad13b743 in elf_symfile_read gdb/elfread.c:1293 #7 0x5602adb01cfa in read_symbols gdb/symfile.c:798 #8 0x5602adb03769 in syms_from_objfile_1 gdb/symfile.c:1000 #9 0x5602adb039d0 in syms_from_objfile gdb/symfile.c:1017 #10 0x5602adb04551 in symbol_file_add_with_addrs gdb/symfile.c:1124 #11 0x5602adb04ebf in symbol_file_add_from_bfd(...) gdb/solib.c:695 #13 0x5602ada5bdae in solib_add(char const*, int, int) gdb/solib.c:1004 #14 0x5602ada49bcd in enable_break gdb/solib-svr4.c:2394 #15 0x5602ada4dae9 in svr4_solib_create_inferior_hook gdb/solib-svr4.c:3028 #16 0x5602ada5d4f1 in solib_create_inferior_hook(int) gdb/solib.c:1215 #17 0x5602ad347f66 in post_create_inferior(target_ops*, int) \ gdb/infcmd.c:467 #18 0x5602ad348b3c in run_command_1 gdb/infcmd.c:663 #19 0x5602ad348e55 in run_command gdb/infcmd.c:686 #20 0x5602acd7d32b in do_const_cfunc gdb/cli/cli-decode.c:106 #21 0x5602acd84bfe in cmd_func(cmd_list_element*, char const*, int) \ gdb/cli/cli-decode.c:1892 #22 0x5602adc62a90 in execute_command(char const*, int) gdb/top.c:630 #23 0x5602ad5053e6 in catch_command_errors gdb/main.c:372 #24 0x5602ad507eb1 in captured_main_1 gdb/main.c:1138 #25 0x5602ad5081ec in captured_main gdb/main.c:1163 #26 0x5602ad508281 in gdb_main(captured_main_args*) gdb/main.c:1188 #27 0x5602ac9ddc3a in main gdb/gdb.c:32 #28 0x7f582b56eb96 in __libc_start_main \ (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) SUMMARY: AddressSanitizer: heap-buffer-overflow gdb/common/pathstuff.c:161 \ in child_path(char const*, char const*) Shadow bytes around the buggy address: 0x0c047fffd520: fa fa fd fd fa fa fd fd fa fa fd fa fa fa fd fa 0x0c047fffd530: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa 0x0c047fffd540: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa 0x0c047fffd550: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fa 0x0c047fffd560: fa fa fd fa fa fa fd fa fa fa fd fa fa fa 00 00 =>0x0c047fffd570: fa fa 07 fa fa fa 00 fa fa[fa]01 fa fa fa fa fa 0x0c047fffd580: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fffd590: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fffd5a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fffd5b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fffd5c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==3997==ABORTING ... The direct cause is that child_path gets called with parent == "", so this test: ... if (IS_DIR_SEPARATOR (parent[parent_len - 1])) ... accesses parent[-1]. [ There is an open discussion (1) about whether an empty sysroot should indeed be represented internally as "". But this patch focuses on fixing the heap-buffer-overflow without any redesign. ] Fix this by guarding the test with 'parent_len > 0'. Note that the fix makes child_path behave the same for: - parent == "/" && child == "/foo" (returns "foo") - parent == "" and child == "/foo" (returns "foo"). Build and reg-tested on x86_64-linux. (1) https://sourceware.org/ml/gdb-patches/2019-05/msg00193.html gdb/ChangeLog: 2019-06-17 Tom de Vries <tdevries@suse.de> PR gdb/24617 * common/pathstuff.c (child_path): Make sure parent_len > 0 before accessing parent[parent_len - 1].
2019-06-17 22:25:06 +02:00
2019-06-17 Tom de Vries <tdevries@suse.de>
PR gdb/24617
* common/pathstuff.c (child_path): Make sure parent_len > 0 before
accessing parent[parent_len - 1].
2019-06-17 Paul Pluzhnikov <ppluzhnikov@google.com>
PR gdb/24364
* gdb/dtrace-probe.c (dtrace_static_probe_ops::get_probe): Don't
call dtrace_process_dof with NULL dof.
2019-06-16 Tom de Vries <tdevries@suse.de>
PR gdb/24445
* contrib/gdb-add-index.sh: Update to handle dwz-m-ed executable.
2019-06-16 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win)
(make_all_visible): Use address of member.
2019-06-16 Tom Tromey <tom@tromey.com>
* tui/tui-data.c (tui_clear_win_detail, init_win_info)
(tui_free_window, free_content, free_content_elements): Remove
unnecessary cast.
* tui/tui-windata.c (tui_display_all_data): Remove unnecessary
cast.
* tui/tui-regs.c (tui_show_register_group)
(tui_display_registers_from, tui_display_reg_element_at_line):
Remove unnecessary cast.
2019-06-16 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-nat.c (normal_mask): Delete.
(_initialize_linux_nat): Don't initialise normal_mask.
Write index for dwz -m file PR 24445 ("dwz multifile index not written to index cache") exposed the fact that we are not doing things right when we generate an index for an object file that has is linked to a dwz file. The same happens whether the index is generated with the intent of populating the index cache or using the save gdb-index command. The problem can be observed when running these tests with the cc-with-dwz-m board: FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats FAIL: gdb.dwarf2/gdb-index.exp: index used FAIL: gdb.dwarf2/gdb-index.exp: index used after symbol reloading When generating the index for such file and inspecting the CU list of the resulting index (with readelf --debug-dump=gdb_index), we can see something like: CU table: [ 0] 0x0 - 0xb9 [ 1] 0x0 - 0x44 This is supposed to be a sorted list of the ranges of all CUs in the file this index represents, so already having some overlap is a red flag. It turns out that we save the ranges of CUs coming from both the main file and the dwz file in the same index. After digging a little bit, it became quite obvious that the index in the main file should only list the CUs present in the main file, and a separate index should be generated for the dwz file, listing the CUs present in that file. First, that's what happens if you run dwz on a file that already has a GDB index embedded. Second, dwarf2read.c has code to read an index from a dwz file. The index in the dwz file is actually required to be present, if the main file has an index. So this patch changes write_psymtabs_to_index to generate an index for the dwz file, if present. That index only contains a CU list, just like what the dwz tool does when processing a file that already contains an index. Some notes about the implementation: - The file management (creating a temp file, make sure it's close/removed on error - in the right order) is a bit heavy in write_psymtabs_to_index, and I needed to add a third file. I factored this pattern in a separate class, index_wip_file. - It became a bit tedious to keep the call to assert_file_size in write_psymtabs_to_index, write_gdbindex would have had to return two sizes. Instead, I moved the calls to assert_file_size where the file is written. The downside is that we lose the filename at this point, but it was only used for the very improbable case of ftell failing, so I think it's not a problem. - The actual writing of the index file is factored out to write_gdbindex_1, so it can be re-used for both index files. - While the "save gdb-index" command will now write two .gdb-index files, this patch does not update the gdb-add-index.sh script, this will come in a later patch. gdb/ChangeLog: YYYY-MM-DD Simon Marchi <simon.marchi@efficios.com> PR gdb/24445 * dwarf-index-write.h (write_psymtabs_to_index): Add dwz_basename parameter. * dwarf-index-write.c (write_gdbindex): Move file writing to write_gdbindex_1. Change return type void. (assert_file_size): Move up, remove filename parameter. (write_gdbindex_1): New function. (write_debug_names): Change return type to void, call assert_file_size. (struct index_wip_file): New struct. (write_psymtabs_to_index): Add dwz_basename parameter. Move file logic to index_wip_file. Write index for dwz file if needed. (save_gdb_index_command): Pass basename of dwz file, if present. * dwarf-index-cache.c (index_cache::store): Obtain and pass build-id of dwz file, if present. * dwarf2read.c (struct dwz_file): Move to dwarf2read.h. (dwarf2_get_dwz_file): Likewise. * dwarf2read.h (struct dwz_file): Move from dwarf2read.c. (dwarf2_get_dwz_file): Likewise. gdb/testsuite/ChangeLog: YYYY-MM-DD Tom de Vries <tdevries@suse.de> PR gdb/24445 * gdb.dwarf2/gdb-index.exp (add_gdb_index): Update dwz file with generated index.
2019-06-16 16:13:56 +02:00
2019-06-16 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/24445
* dwarf-index-write.h (write_psymtabs_to_index): Add
dwz_basename parameter.
* dwarf-index-write.c (write_gdbindex): Move file writing to
write_gdbindex_1. Change return type void.
(assert_file_size): Move up, remove filename parameter.
(write_gdbindex_1): New function.
(write_debug_names): Change return type to void, call
assert_file_size.
(struct index_wip_file): New struct.
(write_psymtabs_to_index): Add dwz_basename parameter. Move
file logic to index_wip_file. Write index for dwz file if
needed.
(save_gdb_index_command): Pass basename of dwz file, if present.
* dwarf-index-cache.c (index_cache::store): Obtain and pass
build-id of dwz file, if present.
* dwarf2read.c (struct dwz_file): Move to dwarf2read.h.
(dwarf2_get_dwz_file): Likewise.
* dwarf2read.h (struct dwz_file): Move from dwarf2read.c.
(dwarf2_get_dwz_file): Likewise.
2019-06-16 Tom Tromey <tom@tromey.com>
* coffread.c (process_coff_symbol): Use xstrdup.
* value.c (create_internalvar): Use xstrdup.
Remove unnecessary casts of NULL I noticed some unnecessary casts of NULL. This removes all the unnecessary ones, leaving only ones where we must ensure that NULL has pointer type for passing through varargs. I removed a couple of useless casts of 0 that I noticed while writing this. Tested by rebuilding. gdb/ChangeLog 2019-06-16 Tom Tromey <tom@tromey.com> * valops.c (value_cast, value_slice): Remove unnecessary cast. * breakpoint.c (stopin_command, stopat_command) (until_break_command, decode_location_default): Remove unnecessary cast. * utils.c (subset_compare): Remove unnecessary cast. * ada-lang.c (ada_update_initial_language): Remove unnecessary cast. * linespec.c (decode_line_with_last_displayed): Remove unnecessary cast. * infcmd.c (path_command): Remove unnecessary cast. * coffread.c (decode_type): Remove unnecessary cast. * xcoffread.c (read_xcoff_symtab): Remove unnecessary cast. * mipsread.c (mipscoff_symfile_read): Remove unnecessary cast. * tui/tui-stack.c (tui_show_locator_content) (tui_show_frame_info): Remove unnecessary cast. * tui/tui-win.c (tui_scroll_forward_command) (tui_scroll_backward_command, tui_set_focus, tui_set_win_height) (parse_scrolling_args): Remove unnecessary cast. * tui/tui-data.c (init_win_info, tui_del_window) (tui_free_window, tui_del_data_windows, tui_free_data_content) (free_content_elements): Remove unnecessary cast. * tui/tui-windata.c (tui_first_data_item_displayed): Remove unnecessary cast. * tui/tui-source.c (tui_set_source_content) (tui_vertical_source_scroll): Remove unnecessary cast. * tui/tui-layout.c (tui_default_win_height): Remove unnecessary cast. * tui/tui-io.c (tui_initialize_io): Remove unnecessary cast. * tui/tui-regs.c (tui_display_registers_from) (tui_display_register): Remove unnecessary cast. * tui/tui-wingeneral.c (tui_refresh_win, tui_delete_win) (tui_unhighlight_win, tui_highlight_win, tui_make_window) (make_visible): Remove unnecessary cast. * tui/tui-winsource.c (tui_erase_source_content) (tui_update_breakpoint_info, tui_set_exec_info_content): Remove unnecessary cast. * ax-gdb.c (agent_command_1): Remove unnecessary cast. * cli/cli-setshow.c (cmd_show_list): Remove unnecessary cast. * stabsread.c (read_type, read_array_type, read_range_type): Remove unnecessary cast. * mdebugread.c (mdebug_build_psymtabs): Remove unnecessary cast. (parse_symbol, parse_type, upgrade_type, parse_external) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref): Remove unnecessary cast. * gdb_bfd.c (gdb_bfd_map_section): Remove unnecessary cast.
2019-06-16 17:56:35 +02:00
2019-06-16 Tom Tromey <tom@tromey.com>
* valops.c (value_cast, value_slice): Remove unnecessary cast.
* breakpoint.c (stopin_command, stopat_command)
(until_break_command, decode_location_default): Remove unnecessary
cast.
* utils.c (subset_compare): Remove unnecessary cast.
* ada-lang.c (ada_update_initial_language): Remove unnecessary
cast.
* linespec.c (decode_line_with_last_displayed): Remove unnecessary
cast.
* infcmd.c (path_command): Remove unnecessary cast.
* coffread.c (decode_type): Remove unnecessary cast.
* xcoffread.c (read_xcoff_symtab): Remove unnecessary cast.
* mipsread.c (mipscoff_symfile_read): Remove unnecessary cast.
* tui/tui-stack.c (tui_show_locator_content)
(tui_show_frame_info): Remove unnecessary cast.
* tui/tui-win.c (tui_scroll_forward_command)
(tui_scroll_backward_command, tui_set_focus, tui_set_win_height)
(parse_scrolling_args): Remove unnecessary cast.
* tui/tui-data.c (init_win_info, tui_del_window)
(tui_free_window, tui_del_data_windows, tui_free_data_content)
(free_content_elements): Remove unnecessary cast.
* tui/tui-windata.c (tui_first_data_item_displayed): Remove
unnecessary cast.
* tui/tui-source.c (tui_set_source_content)
(tui_vertical_source_scroll): Remove unnecessary cast.
* tui/tui-layout.c (tui_default_win_height): Remove unnecessary
cast.
* tui/tui-io.c (tui_initialize_io): Remove unnecessary cast.
* tui/tui-regs.c (tui_display_registers_from)
(tui_display_register): Remove unnecessary cast.
* tui/tui-wingeneral.c (tui_refresh_win, tui_delete_win)
(tui_unhighlight_win, tui_highlight_win, tui_make_window)
(make_visible): Remove unnecessary cast.
* tui/tui-winsource.c (tui_erase_source_content)
(tui_update_breakpoint_info, tui_set_exec_info_content): Remove
unnecessary cast.
* ax-gdb.c (agent_command_1): Remove unnecessary cast.
* cli/cli-setshow.c (cmd_show_list): Remove unnecessary cast.
* stabsread.c (read_type, read_array_type, read_range_type):
Remove unnecessary cast.
* mdebugread.c (mdebug_build_psymtabs): Remove unnecessary cast.
(parse_symbol, parse_type, upgrade_type, parse_external)
(parse_partial_symbols, psymtab_to_symtab_1, cross_ref): Remove
unnecessary cast.
* gdb_bfd.c (gdb_bfd_map_section): Remove unnecessary cast.
2019-06-16 Tom Tromey <tom@tromey.com>
* tui/tui-data.c (tui_alloc_generic_win_info)
(tui_alloc_win_info, tui_add_content_elements): Remove NULL
checks.
2019-03-01 12:12:33 +01:00
2019-06-16 Bernhard Heckel <bernhard.heckel@intel.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* f-typeprint.c (f_print_type): Don't return early for not
associated or not allocated types.
(f_type_print_varspec_suffix): Add print_rank parameter and print
ranks of array types in case they dangling.
(f_type_print_base): Add print_rank parameter.
gdb/mi: New commands to catch C++ exceptions Adds some MI commands to catch C++ exceptions. The new commands are -catch-throw, -catch-rethrow, and -catch-catch, these all correspond to the CLI commands 'catch throw', 'catch rethrow', and 'catch catch'. Each MI command takes two optional arguments, '-t' has the effect of calling 'tcatch' instead of 'catch', for example: (gdb) -catch-throw -t Is the same as: (gdb) tcatch throw There is also a '-r REGEXP' argument that can supply a regexp to match against the exception type, so: (gdb) -catch-catch -r PATTERN Is the same as: (gdb) catch catch PATTERN The change in print_mention_exception_catchpoint might seem a little strange; changing the output from using ui_out::field_int and ui_out::text to using ui_out::message. The print_mention_exception_catchpoint is used as the 'print_mention' method for the exception catchpoint breakpoint object. Most of the other 'print_mention' methods (see breakpoint.c) use either printf_filtered, of ui_out::message. Using field_int was causing an unexpected field to be added to the MI output. Here's the output without the change in print_mention_exception_catchpoint: (gdb) -catch-throw ^done,bkptno="1",bkpt={number="1",type="breakpoint",disp="keep", enabled="y",addr="0x00000000004006c0", what="exception throw",catch-type="throw", thread-groups=["i1"],times="0"} Notice the breakpoint number appears in both the 'bkptno' field, and the 'number' field within the 'bkpt' tuple. Here's the output with the change in print_mention_exception_catchpoint: (gdb) -catch-throw ^done,bkpt={number="1",type="breakpoint",disp="keep", enabled="y",addr="0x00000000004006c0", what="exception throw",catch-type="throw", thread-groups=["i1"],times="0"} gdb/ChangeLog: * NEWS: Mention new MI commands. * break-catch-throw.c (enum exception_event_kind): Move to breakpoint.h. (print_mention_exception_catchpoint): Output text as a single message. (catch_exception_command_1): Rename to... (catch_exception_event): ...this, make non-static, update header command, and change some parameter types. (catch_catch_command): Update for changes to catch_exception_command_1. (catch_throw_command): Likewise. (catch_rethrow_command): Likewise. * breakpoint.c (enum exception_event_kind): Delete. * breakpoint.h (enum exception_event_kind): Moved here from break-catch-throw.c. (catch_exception_event): Declare. * mi/mi-cmd-catch.c (mi_cmd_catch_exception_event): New function. (mi_cmd_catch_throw): New function. (mi_cmd_catch_rethrow): New function. (mi_cmd_catch_catch): New function. * mi/mi-cmds.c (mi_cmds): Add 'catch-throw', 'catch-rethrow', and 'catch-catch' entries. * mi/mi-cmds.h (mi_cmd_catch_throw): Declare. (mi_cmd_catch_rethrow): Declare. (mi_cmd_catch_catch): Declare. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Catchpoint Commands): Add menu entry to new node. (C++ Exception GDB/MI Catchpoint Commands): New node to describe new MI commands. gdb/testsuite/ChangeLog: * gdb.mi/mi-catch-cpp-exceptions.cc: New file. * gdb.mi/mi-catch-cpp-exceptions.exp: New file. * lib/mi-support.exp (mi_expect_stop): Handle 'exception-caught' as a stop reason.
2019-05-08 20:01:36 +02:00
2019-06-15 Andrew Burgess <andrew.burgess@embecosm.com>
* NEWS: Mention new MI commands.
* break-catch-throw.c (enum exception_event_kind): Move to
breakpoint.h.
(print_mention_exception_catchpoint): Output text as a single
message.
(catch_exception_command_1): Rename to...
(catch_exception_event): ...this, make non-static, update header
command, and change some parameter types.
(catch_catch_command): Update for changes to
catch_exception_command_1.
(catch_throw_command): Likewise.
(catch_rethrow_command): Likewise.
* breakpoint.c (enum exception_event_kind): Delete.
* breakpoint.h (enum exception_event_kind): Moved here from
break-catch-throw.c.
(catch_exception_event): Declare.
* mi/mi-cmd-catch.c (mi_cmd_catch_exception_event): New function.
(mi_cmd_catch_throw): New function.
(mi_cmd_catch_rethrow): New function.
(mi_cmd_catch_catch): New function.
* mi/mi-cmds.c (mi_cmds): Add 'catch-throw', 'catch-rethrow', and
'catch-catch' entries.
* mi/mi-cmds.h (mi_cmd_catch_throw): Declare.
(mi_cmd_catch_rethrow): Declare.
(mi_cmd_catch_catch): Declare.
2019-06-15 Andrew Burgess <andrew.burgess@embecosm.com>
* annotate.c (annotate_source_line): Change return type to void,
update implementation to match.
* annotate.h (annotate_source_line): Change return type to void,
update header comment.
* stack.c (print_frame_info): Don't change what frame information
is printed based on whether annotations are on or not.
gdb: Remove an update of current_source_line and current_source_symtab While reviewing some of the annotation code I noticed that identify_source_line (in source.c) sets current_source_line, current_source_symtab, and also calls clear_lines_listed_range. This seems a little strange, identify_source_line is really a wrapper around annotate_source, and is only called when annotation_level is greater than 0 (so annotations are turned on). It seems weird (to me) that when annotations are on we update GDB's idea of the "current" line/symtab, but when they are off we don't, given that annotations are really about communicating GDB's state to a user (GUI) and surely shouldn't be changing GDB's behaviour. This commit removes from identify_source_line all of the setting of current line/symtab and the call to clear_lines_listed_range, after doing this GDB still passes all tests, so I don't believe these lines were actually required. With this code removed identify_source_line is only a wrapper around annotate_source, so I moved identify_source_line to annotate.c and renamed it to annotate_source_line. gdb/ChangeLog: * annotate.c: Add 'source.h' and 'objfiles.h' includes. (annotate_source): Make static. (annotate_source_line): Moved from source.c and renamed from identify_source_line. Update the return type. * annotate.h (annotate_source): Delete declaration. (annotate_source_line): Declaration moved from source.h, and renamed from identify_source_line. Return type updated. * source.c (identify_source_line): Moved to annotate.c and renamed to annotate_source_line. (info_line_command): Remove check of annotation_level. * source.h (identify_source_line): Move declaration to annotate.h and rename to annotate_source_line. * stack.c: Add 'annotate.h' include. (print_frame_info): Remove check of annotation_level before calling annotate_source_line.
2019-06-12 23:34:26 +02:00
2019-06-15 Andrew Burgess <andrew.burgess@embecosm.com>
* annotate.c: Add 'source.h' and 'objfiles.h' includes.
(annotate_source): Make static.
(annotate_source_line): Moved from source.c and renamed from
identify_source_line. Update the return type.
* annotate.h (annotate_source): Delete declaration.
(annotate_source_line): Declaration moved from source.h, and
renamed from identify_source_line. Return type updated.
* source.c (identify_source_line): Moved to annotate.c and renamed
to annotate_source_line.
(info_line_command): Remove check of annotation_level.
* source.h (identify_source_line): Move declaration to annotate.h
and rename to annotate_source_line.
* stack.c: Add 'annotate.h' include.
(print_frame_info): Remove check of annotation_level before
calling annotate_source_line.
2019-06-15 Andrew Burgess <andrew.burgess@embecosm.com>
* source-cache.c (source_cache::get_plain_source_lines): Use
open_source_file_with_line_charpos instead of just
open_source_file, remove call to find_source_lines.
(source_cache::get_source_lines): Likewise.
* source.c (find_source_lines): Make static.
(get_filename_and_charpos): Renamed into...
(open_source_file_with_line_charpos): ..this along with changes to
return a scoped_fd, and some other minor clean ups.
(identify_source_line): Use open_source_file_with_line_charpos.
(search_command_helper): Use open_source_file_with_line_charpos
instead of just open_source_file, remove call to
find_source_lines.
* source.h (open_source_file_with_line_charpos): Declare new
function.
(find_source_lines): Delete declaration.
2019-06-15 Andrew Burgess <andrew.burgess@embecosm.com>
* source.c (get_filename_and_charpos): Remove fullname
parameter.
(identify_source_line): Update call to get_filename_and_charpos.
2019-06-14 Tom Tromey <tromey@adacore.com>
PR gdb/24502:
* ui-style.h (skip_ansi_escape): Update comment.
* ui-file.h (class no_terminal_escape_file): New class.
* ui-file.c (no_terminal_escape_file::write)
(no_terminal_escape_file::puts): New methods.
* cli/cli-logging.c (handle_redirections): Use
no_terminal_escape_file.
2019-06-14 Tom Tromey <tromey@adacore.com>
* NEWS: Move convenience variable news above Python news.
Move gnulib to top level This patch moves the gdb/gnulib subdirectory to the top level. It adjusts the top-level build system to build gnulib when necessary, and changes gdb to use this. However, gdbserver still builds its own copy of gnulib, just from the new source location. A small hack was needed to ensure that gnulib is only built when gdb is enabled. The Makefile only provides an ordering -- the directory must be mentioned in configdirs to actually be compiled at all. Most of the patch is just a "git mv" of gnulib, though a few minor path adjustments were needed in some files there. Tested by the buildbot. ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * MAINTAINERS: Add gnulib. * gnulib: New directory, move from gdb/gnulib. * configure.ac (host_libs): Add gnulib. * configure: Rebuild. * Makefile.def (host_modules, dependencies): Add gnulib. * Makefile.in: Rebuild. gdb/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * gnulib: Move directory to top-level. * configure.ac: Don't configure gnulib. * configure: Rebuild. * common/common-defs.h: Use new path to gnulib. * Makefile.in (GNULIB_BUILDDIR): Now ../gnulib. (GNULIB_H): Remove. (INCGNU): Look in new gnulib location. (HFILES_NO_SRCDIR): Remove gnulib files. (SUBDIR, REQUIRED_SUBDIRS): Remove gnulib. (generated_files): Remove GNULIB_H. ($(LIBGNU), all-lib): Remove targets. (distclean): Don't mention GNULIB_BUILDDIR. ($(GNULIB_BUILDDIR)/Makefile): Remove target. gdb/gdbserver/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * configure.ac: Use new path to gnulib. * configure: Rebuild. * Makefile.in (INCGNU, $(GNULIB_BUILDDIR)/Makefile): Use new path to gnulib. gnulib/ChangeLog 2019-06-14 Tom Tromey <tom@tromey.com> * update-gnulib.sh: Adjust paths. * Makefile.in: Adjust paths. * configure.ac: Adjust paths. Use ACX_LARGEFILE. * configure: Rebuild.
2019-05-06 01:35:20 +02:00
2019-06-14 Tom Tromey <tom@tromey.com>
* gnulib: Move directory to top-level.
* configure.ac: Don't configure gnulib.
* configure: Rebuild.
* common/common-defs.h: Use new path to gnulib.
* Makefile.in (GNULIB_BUILDDIR): Now ../gnulib.
(GNULIB_H): Remove.
(INCGNU): Look in new gnulib location.
(HFILES_NO_SRCDIR): Remove gnulib files.
(SUBDIR, REQUIRED_SUBDIRS): Remove gnulib.
(generated_files): Remove GNULIB_H.
($(LIBGNU), all-lib): Remove targets.
(distclean): Don't mention GNULIB_BUILDDIR.
($(GNULIB_BUILDDIR)/Makefile): Remove target.
2019-06-14 Tom Tromey <tromey@adacore.com>
* symfile.c (add_symbol_file_command): Remove obsolete comment.
Warn if symbol file does not provide any symbols.
2019-06-14 Tom Tromey <tromey@adacore.com>
* source.c (find_and_open_source): Respect basenames_may_differ.
2019-06-14 Andrew Burgess <andrew.burgess@embecosm.com>
* annotate.c (annotate_breakpoints_invalid): Make use of
scoped_restore_terminal_state.
(annotate_frames_invalid): Likewise.
2019-06-14 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <case BINOP_ASSIGN>: Always
allow assignment to an internalvar.
2019-06-14 Tom Tromey <tromey@adacore.com>
* ada-lex.l: Allow "_" in attribute names.
2019-06-14 Tom Tromey <tromey@adacore.com>
PR gdb/24653:
* regcache.c (registers_changed): Don't call alloca.
* top.c (execute_command): Don't call alloca.
2019-06-13 Pedro Alves <palves@redhat.com>
* cli/cli-setshow.c (cli/cli-setshow.c): New parameter
'expression'. When parsing an expression, error out if there's
junk after "unlimited".
(parse_cli_var_uinteger, parse_cli_var_zuinteger_unlimited)
(do_set_command): Adjust calls to is_unlimited_literal.
2019-06-13 Pedro Alves <palves@redhat.com>
* compile/compile.c (make_compile_options_def_group): Add braces
around array_view initializer.
* thread.c (make_thread_apply_all_options_def_group)
(make_thread_apply_all_options_def_group): Likewise.
2019-06-13 Pedro Alves <palves@redhat.com>
* NEWS (New commands): Mention "maint test-options
require-delimiter", "maint test-options unknown-is-error", "maint
test-options unknown-is-operand" and "maint show
test-options-completion-result".
(New command options, command completion): New section.
(Completion improvements): New section.
Mention that you can abbreviate "unlimited".
2019-06-13 Pedro Alves <palves@redhat.com>
* cli/cli-utils.c (parse_flags, parse_flags_qcs): Delete.
* cli/cli-utils.h (parse_flags, parse_flags_qcs): Delete.
* unittests/cli-utils-selftests.c (test_parse_flags)
(test_parse_flags_qcs): Delete.
(test_cli_utils): Don't call deleted functions.
Make "thread apply" use the gdb::option framework Similarly to the "frame apply" patch, this makes the "thread apply" family of commands -- "thread apply TID", "thread apply all" and "taas" use the gdb::option framework for '-'-style options. No new options are added, but there are some user-visible changes: - Can now abbreviate and complete "-ascending" - We now have a completer for "thread apply" commands Can now complete options ("thread apply all -[TAB]"), and also, 'thread apply all COMMAND[TAB]' now does what you'd expect, by making use of the new complete_command routine. - "help" output tweaked with auto-generated option descriptions: ~~~ Usage: thread apply all [OPTION]... COMMAND Prints per-inferior thread number and target system's thread id followed by COMMAND output. By default, an error raised during the execution of COMMAND aborts "thread apply". Options: -ascending Call COMMAND for all threads in ascending order. The default is descending order. -q Disables printing the thread information. -c Print any error raised by COMMAND and continue. -s Silently ignore any errors or empty output produced by COMMAND. ~~~ The "By default ..." sentence is new as well. gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * thread.c: Include "cli/cli-option.h". (tp_array_compar_ascending): Global. (tp_array_compar): Delete function. (tp_array_compar_ascending, tp_array_compar_descending): New functions. (ascending_option_def, qcs_flag_option_def) (thr_qcs_flags_option_defs) (make_thread_apply_all_options_def_group) (make_thread_apply_options_def_group): New. (thread_apply_all_command): Use gdb::option::process_options. (thread_apply_command_completer) (thread_apply_all_command_completer): New. (thread_apply_command): Use gdb::option::process_options. (_initialize_thread): Delete THREAD_APPLY_FLAGS_HELP, replace it with a new THREAD_APPLY_OPTION_HELP. Use gdb::option::build_help to generate help text of "thread apply". Adjust "taas"'s help. * tid-parse.c (tid_range_parser::in_thread_range): New method. * tid-parse.h (tid_range_parser::in_thread_range): New method. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.base/options.exp (test-thread-apply): New. (top level): Call it.
2019-06-13 01:06:54 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* thread.c: Include "cli/cli-option.h".
(tp_array_compar_ascending): Global.
(tp_array_compar): Delete function.
(tp_array_compar_ascending, tp_array_compar_descending): New
functions.
(ascending_option_def, qcs_flag_option_def)
(thr_qcs_flags_option_defs)
(make_thread_apply_all_options_def_group)
(make_thread_apply_options_def_group): New.
(thread_apply_all_command): Use gdb::option::process_options.
(thread_apply_command_completer)
(thread_apply_all_command_completer): New.
(thread_apply_command): Use gdb::option::process_options.
(_initialize_thread): Delete THREAD_APPLY_FLAGS_HELP, replace it
with a new THREAD_APPLY_OPTION_HELP. Use gdb::option::build_help
to generate help text of "thread apply". Adjust "taas"'s help.
* tid-parse.c (tid_range_parser::in_thread_range): New method.
* tid-parse.h (tid_range_parser::in_thread_range): New method.
"thread apply 1 -- -" vs "frame apply level 0 -- -" With the following patch, we'll be able to explicitly tell "thread apply" where options end, using the "--" delimiter. A test added by that patch caught a pre-existing inconsistency: (gdb) thread apply 1 -- - Invalid thread ID: - (gdb) frame apply level 0 -- - #0 main () at threads.c:55 Cannot enable the TUI when output is not a terminal Above, "thread apply" did not try to run the command, while "frame apply level" did. ("-" is a valid TUI command.) That "-" is past "--", so it should have not been confused with an invalid TID, in the "thread apply" case. That error actually doesn't come from the TID parser, but instead from thread_apply_command directly. So that error/check needs tweaking. The next question is what to tweak it to. "-" is actually a valid TUI command: (gdb) help - Scroll window backward. Usage: - [WIN] [N] (gdb) frame apply level 0 -- - #0 main () at threads.c:55 Cannot enable the TUI when output is not a terminal While I don't imagine it being useful to use that "-" command with "thread apply" or "frame apply level", the fact is that you can use it with "frame apply level", but not with "thread apply". And since it's an actual command, pedantically it seems right to allow it. That's what this commit does. Note: simply removing the "isalpha" check regresses gdb.multi/tids.exp -- see related commit 3f5b7598805c. gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * thread.c (thread_apply_command): Check for invalid TID with isdigit instead of !isalpha.
2019-06-13 01:06:54 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* thread.c (thread_apply_command): Check for invalid TID with
isdigit instead of !isalpha.
Make "frame apply" support -OPT options This adds support for '-'-style options to the "frame apply" family of commands -- "frame apply COUNT", "frame apply level", "frame apply all", "faas" and "tfaas". The -q/-c/-s flags were already supported, -past-main/-past-entry is new: ~~~ (gdb) help frame apply all Apply a command to all frames. Usage: frame apply all [OPTION]... COMMAND Prints the frame location information followed by COMMAND output. By default, an error raised during the execution of COMMAND aborts "frame apply". Options: -q Disables printing the frame location information. -c Print any error raised by COMMAND and continue. -s Silently ignore any errors or empty output produced by COMMAND. -past-main [on|off] Set whether backtraces should continue past "main". Normally the caller of "main" is not of interest, so GDB will terminate the backtrace at "main". Set this if you need to see the rest of the stack trace. -past-entry [on|off] Set whether backtraces should continue past the entry point of a program. Normally there are no callers beyond the entry point of a program, so GDB will terminate the backtrace there. Set this if you need to see the rest of the stack trace. ~~~ TAB completion of options is now supported. Also, TAB completion of COMMAND in "frame apply all COMMAND" does the right thing now, making use of complete_command, added by the previous patch. E.g.: (gdb) thread apply all -ascending frame apply all -past-main print -[TAB] -address -elements -pretty -symbol -array -null-stop -repeats -union -array-indexes -object -static-members -vtbl (gdb) thread apply all -ascending frame apply all -past-main print glo[TAB] global1 global2 The change to tfaas_command is necessary because otherwise you get this: (gdb) tfaas -- Unrecognized option at: frame apply all -s -- That's because the above is equivalent to: (gdb) thread apply all -s frame apply all -s -- and the "--" instructs "thread apply" to consider everything up to "--" as its command options. And from that view, "frame" is an invalid option. The change makes tfaas be equivalent to: (gdb) thread apply all -s -- frame apply all -s -- gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * cli/cli-utils.c (parse_flags_qcs): Use validate_flags_qcs. (validate_flags_qcs): New. * cli/cli-utils.h (struct qcs_flags): Change field types to int. (validate_flags_qcs): Declare. * stack.c (qcs_flag_option_def, fr_qcs_flags_option_defs): New. (make_frame_apply_options_def_group): New. (frame_apply_command_count): Process options with gdb::option::process_options. (frame_apply_completer): New. (frame_apply_level_completer, frame_apply_all_completer) (frame_apply_completer): New. (_initialize_stack): Update help of "frame apply", "frame apply level", "frame apply all" and "faas" to mention supported options and install command completers. * stack.h (frame_apply_all_completer): Declare. * thread.c: Include "stack.h". (tfaas_command): Add "--". (_initialize_thread): Update help "tfaas" to mention supported options and install command completer. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.base/options.exp (test-frame-apply): New. (top level): Test print commands with different "frame apply" prefixes.
2019-06-13 01:06:53 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* cli/cli-utils.c (parse_flags_qcs): Use validate_flags_qcs.
(validate_flags_qcs): New.
* cli/cli-utils.h (struct qcs_flags): Change field types to int.
(validate_flags_qcs): Declare.
* stack.c (qcs_flag_option_def, fr_qcs_flags_option_defs): New.
(make_frame_apply_options_def_group): New.
(frame_apply_command_count): Process options with
gdb::option::process_options.
(frame_apply_completer): New.
(frame_apply_level_completer, frame_apply_all_completer)
(frame_apply_completer): New.
(_initialize_stack): Update help of "frame apply", "frame apply
level", "frame apply all" and "faas" to mention supported options
and install command completers.
* stack.h (frame_apply_all_completer): Declare.
* thread.c: Include "stack.h".
(tfaas_command): Add "--".
(_initialize_thread): Update help "tfaas" to mention supported
options and install command completer.
2019-06-13 Pedro Alves <palves@redhat.com>
* completer.c (complete_nested_command_line): New.
(gdb_completion_word_break_characters_throw): Add assertion.
* completer.h (complete_nested_command_line): Declare.
2019-06-13 Pedro Alves <palves@redhat.com>
* stack.c (parse_backtrace_qualifiers): New.
(backtrace_command): Use it.
(backtrace_command_completer): Complete on qualifiers.
Make "backtrace" support -OPT options This adds support for comand options to the "backtrace" command. We'll get: (gdb) bt - -entry-values -hide -past-main -frame-arguments -no-filters -raw-frame-arguments -full -past-entry ~~~~ (gdb) help backtrace Print backtrace of all stack frames, or innermost COUNT frames. Usage: backtrace [OPTION]... [QUALIFIER]... [COUNT | -COUNT] Options: -entry-values no|only|preferred|if-needed|both|compact|default Set printing of function arguments at function entry GDB can sometimes determine the values of function arguments at entry, in addition to their current values. This option tells GDB whether to print the current value, the value at entry (marked as val@entry), or both. Note that one or both of these values may be <optimized out>. -frame-arguments all|scalars|none Set printing of non-scalar frame arguments -raw-frame-arguments [on|off] Set whether to print frame arguments in raw form. If set, frame arguments are printed in raw form, bypassing any pretty-printers for that value. -past-main [on|off] Set whether backtraces should continue past "main". Normally the caller of "main" is not of interest, so GDB will terminate the backtrace at "main". Set this if you need to see the rest of the stack trace. -past-entry [on|off] Set whether backtraces should continue past the entry point of a program. Normally there are no callers beyond the entry point of a program, so GDB will terminate the backtrace there. Set this if you need to see the rest of the stack trace. -full Print values of local variables. -no-filters Prohibit frame filters from executing on a backtrace. -hide Causes Python frame filter elided frames to not be printed. For backward compatibility, the following qualifiers are supported: full - same as -full option. no-filters - same as -no-filters option. hide - same as -hide. With a negative COUNT, print outermost -COUNT frames. ~~~~ Implementation wise, this: - Moves relevant options/settings globals to structures. - Tweaks a number of functions to pass down references to such structures. - Adds option_def structures describing the options/settings. - Makes backtrace_command parse the options, with gdb::option::process_options. - Tweaks "backtrace"'s help to describe the new options. - Adds testcases. Note that backtrace is a PROCESS_OPTIONS_UNKNOWN_IS_OPERAND command, because of the "-COUNT" argument. The COUNT/-COUNT argument is currently parsed as an expression. I considered whether it would be prudent here to require "--", but concluded that the risk of causing a significant breakage here is much lower compared to "print", since printing the expression is not the whole point of the "backtrace" command. Seems OK to me to require typing "backtrace -past-main -- -p" if the user truly wants to refer to the negative of a backtrace count stored in an inferior variable called "p". gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * frame.c: Include "cli/cli-option.h. (user_set_backtrace_options): New. (backtrace_past_main, backtrace_past_entry, backtrace_limit): Delete. (get_prev_frame): Adjust. (boolean_option_def, uinteger_option_def) (set_backtrace_option_defs): New. (_initialize_frame): Adjust and use gdb::option::add_setshow_cmds_for_options to install "set backtrace past-main" and "set backtrace past-entry". * frame.h: Include "cli/cli-option.h". (struct frame_print_options): Forward declare. (print_frame_arguments_all, print_frame_arguments_scalars) (print_frame_arguments_none): Declare. (print_entry_values): Delete declaration. (struct frame_print_options, user_frame_print_options): New. (struct set_backtrace_options): New. (set_backtrace_option_defs, user_set_backtrace_options): Declare. * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames) (mi_cmd_stack_list_locals, mi_cmd_stack_list_args) (mi_cmd_stack_list_variables): Pass down USER_FRAME_PRINT_OPTIONS. (list_args_or_locals): Add frame_print_options parameter. (mi_cmd_stack_info_frame): Pass down USER_FRAME_PRINT_OPTIONS. * python/py-framefilter.c (enumerate_args): Pass down USER_FRAME_PRINT_OPTIONS. * stack.c: Include "cli/cli-option.h". (print_frame_arguments_all, print_frame_arguments_scalars) (print_frame_arguments_none): Declare. (print_raw_frame_arguments, print_entry_values): Delete. (user_frame_print_options): New. (boolean_option_def, enum_option_def, frame_print_option_defs): New. (struct backtrace_cmd_options): New. (bt_flag_option_def): New. (backtrace_command_option_defs): New. (print_stack_frame): Pass down USER_FRAME_PRINT_OPTIONS. (print_frame_arg, read_frame_arg, print_frame_args) (print_frame_info, print_frame): Add frame_print_options parameter and use it. (info_frame_command_core): Pass down USER_FRAME_PRINT_OPTIONS. (backtrace_command_1): Add frame_print_options and backtrace_cmd_options parameters and use them. (make_backtrace_options_def_group): New. (backtrace_command): Process command options with gdb::option::process_options. (backtrace_command_completer): New. (_initialize_stack): Extend "backtrace"'s help to mention supported options. Install completer for "backtrace". Install some settings commands with add_setshow_cmds_for_options. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.base/options.exp (test-backtrace): New. (top level): Call it.
2019-06-13 01:06:53 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* frame.c: Include "cli/cli-option.h.
(user_set_backtrace_options): New.
(backtrace_past_main, backtrace_past_entry, backtrace_limit):
Delete.
(get_prev_frame): Adjust.
(boolean_option_def, uinteger_option_def)
(set_backtrace_option_defs): New.
(_initialize_frame): Adjust and use
gdb::option::add_setshow_cmds_for_options to install "set
backtrace past-main" and "set backtrace past-entry".
* frame.h: Include "cli/cli-option.h".
(struct frame_print_options): Forward declare.
(print_frame_arguments_all, print_frame_arguments_scalars)
(print_frame_arguments_none): Declare.
(print_entry_values): Delete declaration.
(struct frame_print_options, user_frame_print_options): New.
(struct set_backtrace_options): New.
(set_backtrace_option_defs, user_set_backtrace_options): Declare.
* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
(mi_cmd_stack_list_locals, mi_cmd_stack_list_args)
(mi_cmd_stack_list_variables): Pass down USER_FRAME_PRINT_OPTIONS.
(list_args_or_locals): Add frame_print_options parameter.
(mi_cmd_stack_info_frame): Pass down USER_FRAME_PRINT_OPTIONS.
* python/py-framefilter.c (enumerate_args): Pass down
USER_FRAME_PRINT_OPTIONS.
* stack.c: Include "cli/cli-option.h".
(print_frame_arguments_all, print_frame_arguments_scalars)
(print_frame_arguments_none): Declare.
(print_raw_frame_arguments, print_entry_values): Delete.
(user_frame_print_options): New.
(boolean_option_def, enum_option_def, frame_print_option_defs):
New.
(struct backtrace_cmd_options): New.
(bt_flag_option_def): New.
(backtrace_command_option_defs): New.
(print_stack_frame): Pass down USER_FRAME_PRINT_OPTIONS.
(print_frame_arg, read_frame_arg, print_frame_args)
(print_frame_info, print_frame): Add frame_print_options parameter
and use it.
(info_frame_command_core): Pass down USER_FRAME_PRINT_OPTIONS.
(backtrace_command_1): Add frame_print_options and
backtrace_cmd_options parameters and use them.
(make_backtrace_options_def_group): New.
(backtrace_command): Process command options with
gdb::option::process_options.
(backtrace_command_completer): New.
(_initialize_stack): Extend "backtrace"'s help to mention
supported options. Install completer for "backtrace".
Install some settings commands with add_setshow_cmds_for_options.
"set print raw frame-arguments" -> "set print raw-frame-arguments" A following patch will introduce options for the "backtrace" command, based on some "set print" and "set backtrace" settings. There's one setting in particular that is a bit annoying if we want to describe the backtrace options and the settings commands using the same data structures: "set print raw frame-arguments" The problem is that space between "raw" and "frame-arguments". Calling the option "bt -raw frame-arguments" would be odd. So I'm calling the option "bt -raw-frame-arguments" instead. And for consistency, this patch renames the set/show commands to: "set print raw-frame-arguments" "show print raw-frame-arguments" I.e., dash instead of space. The old commands are left in place, but marked deprecated. We need to adjust a couple testcases, because the relevant tests use gdb_test_no_output and the old commands are no longer silent: (gdb) set print raw frame-arguments on Warning: command 'set print raw frame-arguments' is deprecated. Use 'set print raw-frame-arguments'. gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * NEWS (Changed commands): Mention set/show print raw-frame-arguments, and that "set/show print raw frame-arguments" are now deprecated. * cli/cli-decode.c (add_setshow_boolean_cmd): Now returns the command. * command.h (add_setshow_boolean_cmd): Return cmd_list_element *. * stack.c (_initialize_stack): Install "set/show print raw-frame-arguments", and deprecate "set/show print raw frame-arguments". * valprint.c (_initialize_valprint): Deprecate "set/show print raw". gdb/doc/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.texinfo (Print Settings): Document "set/show print raw-frame-arguments" instead of "set/show print raw frame-arguments". gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.guile/scm-frame-args.exp: Use "set print raw-frame-arguments" instead of "set print raw frame-arguments". * gdb.python/py-frame-args.exp: Likewise.
2019-06-13 01:06:53 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* NEWS (Changed commands): Mention set/show print raw-frame-arguments,
and that "set/show print raw frame-arguments" are now deprecated.
* cli/cli-decode.c (add_setshow_boolean_cmd): Now returns the
command.
* command.h (add_setshow_boolean_cmd): Return cmd_list_element *.
* stack.c (_initialize_stack): Install "set/show print
raw-frame-arguments", and deprecate "set/show print raw
frame-arguments".
* valprint.c (_initialize_valprint): Deprecate "set/show print
raw".
Migrate rest of compile commands to new options framework As I was in the neighbourhood, I converted the other "compile" subcommands to the new options framework too. Specifically, "compile code" and "compile file". The user-visible changes are: - All abbreviations of "-raw" are accepted now, instead of just -r. Obviously that means "-ra" is now accepted. - Option completion now works. - "compile file" did not have a completer yet, and now it knows to complete on filenames. - You couldn't use "compile file" with a file named "-something". You can now, with "compile file -- -something". gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * compile/compile.c (struct compile_options): New. (compile_flag_option_def, compile_command_option_defs) (make_compile_options_def_group): New. (compile_file_command): Handle options with gdb::option::process_options. (compile_file_command_completer): New function. (compile_code_command): Handle options with gdb::option::process_options. (compile_code_command_completer): New function. (_initialize_compiler): Install completers for "compile code" and "compile file". Mention available options in "compile code" and "compile code"'s help. * completer.c (advance_to_completion_word): New, factored out from ... (advance_to_expression_complete_word_point): ... this. (advance_to_filename_complete_word_point): New. * completer.h (advance_to_filename_complete_word_point): New declaration. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.compile/compile.exp: Adjust expected output to option processing changes.
2019-06-13 01:06:53 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* compile/compile.c (struct compile_options): New.
(compile_flag_option_def, compile_command_option_defs)
(make_compile_options_def_group): New.
(compile_file_command): Handle options with
gdb::option::process_options.
(compile_file_command_completer): New function.
(compile_code_command): Handle options with
gdb::option::process_options.
(compile_code_command_completer): New function.
(_initialize_compiler): Install completers for "compile code" and
"compile file". Mention available options in "compile code" and
"compile code"'s help.
* completer.c (advance_to_completion_word): New, factored out from
...
(advance_to_expression_complete_word_point): ... this.
(advance_to_filename_complete_word_point): New.
* completer.h (advance_to_filename_complete_word_point): New
declaration.
Make "print" and "compile print" support -OPT options This patch adds support for "print -option optval --", etc. Likewise for "compile print". We'll get: ~~~~~~ (gdb) help print Print value of expression EXP. Usage: print [[OPTION]... --] [/FMT] [EXP] Options: -address [on|off] Set printing of addresses. -array [on|off] Set pretty formatting of arrays. -array-indexes [on|off] Set printing of array indexes. -elements NUMBER|unlimited Set limit on string chars or array elements to print. "unlimited" causes there to be no limit. -max-depth NUMBER|unlimited Set maximum print depth for nested structures, unions and arrays. When structures, unions, or arrays are nested beyond this depth then they will be replaced with either '{...}' or '(...)' depending on the language. Use "unlimited" to print the complete structure. -null-stop [on|off] Set printing of char arrays to stop at first null char. -object [on|off] Set printing of C++ virtual function tables. -pretty [on|off] Set pretty formatting of structures. -repeats NUMBER|unlimited Set threshold for repeated print elements. "unlimited" causes all elements to be individually printed. -static-members [on|off] Set printing of C++ static members. -symbol [on|off] Set printing of symbol names when printing pointers. -union [on|off] Set printing of unions interior to structures. -vtbl [on|off] Set printing of C++ virtual function tables. Note: because this command accepts arbitrary expressions, if you specify any command option, you must use a double dash ("--") to mark the end of option processing. E.g.: "print -o -- myobj". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I want to highlight the comment above about "--". At first, I thought we could make the print command parse the options, and if the option wasn't recognized, fallback to parsing as an expression. Then, if the user wanted to disambiguate, he'd use the "--" option delimiter. For example, if you had a variable called "object" and you wanted to print its negative, you'd have to do: (gdb) print -- -object After getting that working, I saw that gdb.pascal/floats.exp regressed, in these tests: gdb_test "print -r" " = -1\\.2(499.*|5|500.*)" gdb_test "print -(r)" " = -1.2(499.*|5|500.*)" gdb_test "print -(r + s)" " = -3\\.4(499.*|5|500.*)" It's the first one that I found most concerning. It regressed because "-r" is the abbreviation of "-raw". I realized then that the behavior change was a bit risker than I'd like, considering scripts, wrappers around gdb, etc., and even user expectation. So instead, I made the print command _require_ the "--" options delimiter if you want to specify any option. So: (gdb) print -r is parsed as an expression, and (gdb) print -r -- is parsed as an option. I noticed that that's also what lldb's expr (the equivalent of print) does to handle the same problem. Going back the options themselves, note that: - you can shorten option names, as long as unambiguous. - For boolean options, 0/1 stand for off/on. - For boolean options, "true" is implied. So these are all equivalent: (gdb) print -object on -static-members off -pretty on -- foo (gdb) print -object -static-members off -pretty -- foo (gdb) print -object -static-members 0 -pretty -- foo (gdb) print -o -st 0 -p -- foo TAB completion is fully supported: (gdb) p -[TAB] -address -elements -pretty -symbol -array -null-stop -repeats -union -array-indexes -object -static-members -vtbl Note that the code is organized such that some of the options and the "set/show" commands code is shared. In particular, the "print" options and the corresponding "set print" commands are defined with the same structures. The commands are installed with the gdb::option::add_setshow_cmds_for_options function. gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * compile/compile.c: Include "cli/cli-option.h". (compile_print_value): Scope data pointer is now a value_print_options pointer; adjust. (compile_print_command): Process options. Scope data pointer is now a value_print_options pointer; adjust. (_initialize_compile): Update "compile print"'s help to include supported options. Install a completer for "compile print". * cp-valprint.c (show_vtblprint, show_objectprint) (show_static_field_print): Delete. (_initialize_cp_valprint): Don't install "set print static-members", "set print vtbl", "set print object" here. * printcmd.c: Include "cli/cli-option.h" and "common/gdb_optional.h". (print_command_parse_format): Rework to fill in a value_print_options instead of a format_data. (print_value): Change parameter type from format_data pointer to value_print_options reference. Adjust. (print_command_1): Process options. Adjust to pass down a value_print_options. (print_command_completer): New. (_initialize_printcmd): Install print_command_completer as handle_brkchars completer for the "print" command. Update "print"'s help to include supported options. * valprint.c: Include "cli/cli-option.h". (show_vtblprint, show_objectprint, show_static_field_print): Moved here from cp-valprint.c. (boolean_option_def, uinteger_option_def) (value_print_option_defs, make_value_print_options_def_group): New. Use gdb::option::add_setshow_cmds_for_options to install "set print elements", "set print null-stop", "set print repeats", "set print pretty", "set print union", "set print array", "set print address", "set print symbol", "set print array-indexes". * valprint.h: Include <string> and "cli/cli-option.h". (make_value_print_options_def_group): Declare. (print_value): Change parameter type from format_data pointer to value_print_options reference. (print_command_completer): Declare. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.base/options.exp: Build executable. (test-print): New procedure. (top level): Call it, once for "print" and another for "compile print".
2019-06-13 01:06:53 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* compile/compile.c: Include "cli/cli-option.h".
(compile_print_value): Scope data pointer is now a
value_print_options pointer; adjust.
(compile_print_command): Process options. Scope data pointer is
now a value_print_options pointer; adjust.
(_initialize_compile): Update "compile print"'s help to include
supported options. Install a completer for "compile print".
* cp-valprint.c (show_vtblprint, show_objectprint)
(show_static_field_print): Delete.
(_initialize_cp_valprint): Don't install "set print
static-members", "set print vtbl", "set print object" here.
* printcmd.c: Include "cli/cli-option.h" and
"common/gdb_optional.h".
(print_command_parse_format): Rework to fill in a
value_print_options instead of a format_data.
(print_value): Change parameter type from format_data pointer to
value_print_options reference. Adjust.
(print_command_1): Process options. Adjust to pass down a
value_print_options.
(print_command_completer): New.
(_initialize_printcmd): Install print_command_completer as
handle_brkchars completer for the "print" command. Update
"print"'s help to include supported options.
* valprint.c: Include "cli/cli-option.h".
(show_vtblprint, show_objectprint, show_static_field_print): Moved
here from cp-valprint.c.
(boolean_option_def, uinteger_option_def)
(value_print_option_defs, make_value_print_options_def_group):
New. Use gdb::option::add_setshow_cmds_for_options to install
"set print elements", "set print null-stop", "set print repeats",
"set print pretty", "set print union", "set print array", "set
print address", "set print symbol", "set print array-indexes".
* valprint.h: Include <string> and "cli/cli-option.h".
(make_value_print_options_def_group): Declare.
(print_value): Change parameter type from format_data pointer to
value_print_options reference.
(print_command_completer): Declare.
Introduce generic command options framework This commit adds a generic command options framework, that makes it easy enough to add '-'-style options to commands in a uniform way, instead of each command implementing option parsing in its own way. Options are defined in arrays of option_def objects (for option definition), and the same options definitions are used for supporting TAB completion, and also for generating the relevant help fragment of the "help" command. See the gdb::options::build_help function, which returns a string with the result of replacing %OPTIONS% in a template string with an auto-generated "help" string fragment for all the passed-in options. Since most options in GDB are in the form of "-OPT", with a single dash, this is the format that the framework supports. I like to think of gdb's "-OPT" as the equivalent to getopt's long options format ("--OPT"), and gdb's "/" as the equivalent to getopt's short options format. getopt's short options format allows mixing several one-character options, like "ls -als", kind of similar to gdb's "x /FMT" and "disassemble /MOD", etc. While with gdb's "-" options, the option is expected to have a full name, and to be abbreviatable. E.g., "watch -location", "break -function main", etc. This patch only deals with "-" options. The above comment serves more to disclose why I don't think we should support mixing several unrelated options in a single "-" option invocation, like "thread apply -qcs" instead of "thread apply -q -c -s". The following patches will add uses of the infrastructure to several key commands. Most notably, "print", "compile print", "backtrace", "frame apply" and "thread apply". I tried to add options to several commands in order to make sure the framework didn't leave that many open holes open. Options use the same type as set commands -- enum var_types. So boolean options are var_boolean, enum options are var_enum, etc. The idea is to share code between settings commands and command options. The "print" options will be based on the "set print" commands, and their names will be the same. Actually, their definitions will be the same too. There is a function to create "set/show" commands from an array for option definitions: /* Install set/show commands for options defined in OPTIONS. DATA is a pointer to the structure that holds the data associated with the OPTIONS array. */ extern void add_setshow_cmds_for_options (command_class cmd_class, void *data, gdb::array_view<const option_def> options, struct cmd_list_element **set_list, struct cmd_list_element **show_list); That will be used by several following patches. Other features: - You can use the "--" delimiter to explicitly indicate end of options. Several existing commands use this token sequence for this effect already, so this just standardizes it. - You can shorten option names, as long as unambiguous. Currently, some commands allow this (e.g., break -function), while others do not (thread apply all -ascending). As GDB allows abbreviating command names and other things, it feels more GDB-ish to allow abbreviating option names too, to me. - For boolean options, 0/1 stands for off/on, just like with boolean "set" commands. - For boolean options, "true" is implied, just like with boolean "set commands. These are the option types supported, with a few examples: - boolean options (var_boolean). The option's argument is optional. (gdb) print -pretty on -- *obj (gdb) print -pretty off -- *obj (gdb) print -p -- *obj (gdb) print -p 0 -- *obj - flag options (like var_boolean, but no option argument (on/off)) (gdb) thread apply all -s COMMAND - enum options (var_enum) (gdb) bt -entry-values compact (gdb) bt -e c - uinteger options (var_uinteger) (gdb) print -elements 100 -- *obj (gdb) print -e 100 -- *obj (gdb) print -elements unlimited -- *obj (gdb) print -e u -- *obj - zuinteger-unlimited options (var_zuinteger_unlimited) (gdb) print -max-depth 100 -- obj (gdb) print -max-depth -1 -- obj (gdb) print -max-depth unlimited -- obj Other var_types could be supported, of course. These were just the types that I needed for the commands that I ported over, in the following patches. It was interesting (and unfortunate) to find that we need at least 3 different modes to cover the existing commands: - Commands that require ending options with "--" if you specify any option: "print" and "compile print". - Commands that do not want to require "--", and want to error out if you specify an unknown option (i.e., an unknown argument that starts with '-'): "compile code" / "compile file". - Commands that do not want to require "--", and want to process unknown options themselves: "bt", because of "bt -COUNT", "thread/frame apply", because "-" is a valid command. The different behavior is encoded in the process_options_mode enum, passed to process_options/complete_options. For testing, this patch adds one representative maintenance command for each of the process_options_mode values, that are used by the testsuite to exercise the options framework: (gdb) maint test-options require-delimiter (gdb) maint test-options unknown-is-error (gdb) maint test-options unknown-is-operand and adds another command to help with TAB-completion testing: (gdb) maint show test-options-completion-result See their description at the top of the maint-test-options.c file. Docs/NEWS are in a patch later in the series. gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * Makefile.in (SUBDIR_CLI_SRCS): Add cli/cli-option.c. (COMMON_SFILES): Add maint-test-settings.c. * cli/cli-decode.c (boolean_enums): New global, factored out from ... (add_setshow_boolean_cmd): ... here. * cli/cli-decode.h (boolean_enums): Declare. * cli/cli-option.c: New file. * cli/cli-option.h: New file. * cli/cli-setshow.c (parse_cli_boolean_value(const char **)): New, factored out from ... (parse_cli_boolean_value(const char *)): ... this. (is_unlimited_literal): Change parameter type to pointer to pointer. Adjust and advance ARG pointer. (parse_cli_var_uinteger, parse_cli_var_zuinteger_unlimited) (parse_cli_var_enum): New, factored out from ... (do_set_command): ... this. Adjust. * cli/cli-setshow.h (parse_cli_boolean_value) (parse_cli_var_uinteger, parse_cli_var_zuinteger_unlimited) (parse_cli_var_enum): Declare. * cli/cli-utils.c: Include "cli/cli-option.h". (get_ulongest): New. * cli/cli-utils.h (get_ulongest): Declare. (check_for_argument): New overloads. * maint-test-options.c: New file. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.base/options.c: New file. * gdb.base/options.exp: New file.
2019-06-13 01:06:53 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* Makefile.in (SUBDIR_CLI_SRCS): Add cli/cli-option.c.
(COMMON_SFILES): Add maint-test-settings.c.
* cli/cli-decode.c (boolean_enums): New global, factored out from
...
(add_setshow_boolean_cmd): ... here.
* cli/cli-decode.h (boolean_enums): Declare.
* cli/cli-option.c: New file.
* cli/cli-option.h: New file.
* cli/cli-setshow.c (parse_cli_boolean_value(const char **)): New,
factored out from ...
(parse_cli_boolean_value(const char *)): ... this.
(is_unlimited_literal): Change parameter type to pointer to
pointer. Adjust and advance ARG pointer.
(parse_cli_var_uinteger, parse_cli_var_zuinteger_unlimited)
(parse_cli_var_enum): New, factored out from ...
(do_set_command): ... this. Adjust.
* cli/cli-setshow.h (parse_cli_boolean_value)
(parse_cli_var_uinteger, parse_cli_var_zuinteger_unlimited)
(parse_cli_var_enum): Declare.
* cli/cli-utils.c: Include "cli/cli-option.h".
(get_ulongest): New.
* cli/cli-utils.h (get_ulongest): Declare.
(check_for_argument): New overloads.
* maint-test-options.c: New file.
2019-06-13 Pedro Alves <palves@redhat.com>
* cli/cli-utils.c (number_or_range_parser::get_number): Do not
parse a range if "-" is at the end of the string.
2019-06-13 Pedro Alves <palves@redhat.com>
* cli/cli-setshow.c (parse_auto_binary_operation)
(parse_cli_boolean_value): Don't allow "o".
2019-06-13 Pedro Alves <palves@redhat.com>
* Makefile.in (COMMON_SFILES): Add maint-test-settings.c.
* NEWS: Mention maint test-settings KIND.
* maint-test-settings.c: New file.
2019-06-13 Pedro Alves <palves@redhat.com>
* cli/cli-decode.c (add_setshow_cmd_full): Remove "show"
completer.
(add_setshow_string_cmd, add_setshow_string_noescape_cmd): Remove
"set" completers.
2019-06-13 Pedro Alves <palves@redhat.com>
* cli/cli-setshow.c (do_set_command) <var_enum>: Detect junk
after item.
2019-06-13 Pedro Alves <palves@redhat.com>
* cli/cli-setshow.c (is_unlimited_literal): Allow abbreviations.
2019-06-13 Pedro Alves <palves@redhat.com>
* ax-gdb.c (agent_command_1): Remove skip_spaces call.
* breakpoint.c (watch_maybe_just_location): Remove skip_spaces
call.
* cli/cli-cmds.c (apropos_command): Remove skip_spaces call.
* cli/cli-utils.c (extract_info_print_args): Remove skip_spaces
calls.
(check_for_argument): Skip spaces after argument.
Fix TID parser bug I noticed this inconsistency in the error messages below: (gdb) print --1 Left operand of assignment is not an lvalue. (gdb) thread apply 1 print --1 Thread 1 (Thread 0x7ffff7fb6740 (LWP 17805)): inverted range The "inverted range" error happens because get_number_trailer returns 0 to indicate error, but number_or_range_parser::get_number is not checking for that. I tried detected the error there, but that doesn't work because number_of_range_parser is used in places that _do_ want to legitimately handle 0. IMO we should fix get_number_trailer's interface or use something else when we want to parse 0 too. I've decided to fix it in a different way, similarly to how number_or_range_parser::finished was changed in commit 529c08b25ec7 ("Add helper functions parse_flags and parse_flags_qcs"). Seems like a good change, even if we tweaked number_or_range_parser::get_number, as it simplifies thread_apply_command and makes them consistent with number_or_range_parser::finished(). We now get the same error message in both cases: (gdb) print --1 Left operand of assignment is not an lvalue. (gdb) thread apply 1 print --1 Thread 1 (Thread 0x7ffff7fb6740 (LWP 17805)): Left operand of assignment is not an lvalue. gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * thread.c (thread_apply_command): Adjust TID parsing. * tid-parse.c (tid_range_parser::finished): Ensure parsing end is detected before end of string. (tid_is_in_list): Error out if LIST is invalid. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.multi/tids.exp: Adjust expected output. Add "thread apply 1 foo --1" test.
2019-06-13 01:06:52 +02:00
2019-06-13 Pedro Alves <palves@redhat.com>
* thread.c (thread_apply_command): Adjust TID parsing.
* tid-parse.c (tid_range_parser::finished): Ensure parsing end is
detected before end of string.
(tid_is_in_list): Error out if LIST is invalid.
2019-06-13 Pedro Alves <palves@redhat.com>
* completer.c (complete_line_internal_1): Rewind completion word
point.
(completion_tracker::advance_custom_word_point_by): Change
parameter type to int.
* completer.h (completion_tracker::advance_custom_word_point_by):
Likewise.
2019-06-13 Pedro Alves <palves@redhat.com>
* completer.c (advance_to_completion_word): Handle delimiters.
2019-06-11 Bernhard Heckel <bernhard.heckel@intel.com>
* dwarf2read.c (add_partial_symbol): Skip nameless modules.
2019-06-11 Tom Tromey <tom@tromey.com>
* common/common-utils.c (xmalloc, xrealloc, xcalloc)
(xmalloc_failed): Move to alloc.c.
* alloc.c: New file.
* Makefile.in (COMMON_SFILES): Add alloc.c.
2019-06-11 Tom Tromey <tom@tromey.com>
* nat/linux-waitpid.c: Don't include server.h.
(linux_debug): Remove.
(my_waitpid): Update.
Remove trailing newlines from help text I noticed recently that some command had a trailing newline in its "help" output. So, I temporarily hacked cli-decode.c to print something when a new command was installed that had a trailing newline in its help message, and wrote this patch, which removes all the ones I could find this way. (There could still be a few more in *-nat files.) Tested on x86-64 Fedora 29. gdb/ChangeLog 2019-06-11 Tom Tromey <tromey@adacore.com> * infcall.c (_initialize_infcall): Remove trailing newline from help. * user-regs.c (_initialize_user_regs): Remove trailing newline from help. * typeprint.c (_initialize_typeprint): Remove trailing newline from help. * reverse.c (_initialize_reverse): Remove trailing newlines from help. * tracepoint.c (_initialize_tracepoint): Remove trailing newlines from help. * language.c (add_set_language_command): Remove trailing newline from help. * infcmd.c (_initialize_infcmd): Remove trailing newlines from help. * disasm.c (_initialize_disasm): Remove trailing newline from help. * top.c (init_main): Remove trailing newline from help. * interps.c (_initialize_interpreter): Remove trailing newline from help. * btrace.c (_initialize_btrace): Remove trailing newlines from help. * breakpoint.c (_initialize_breakpoint): Remove trailing newline from help. * python/python.c (_initialize_python): Remove trailing newline from help. * spu-tdep.c (_initialize_spu_tdep): Remove trailing newlines from help. * tui/tui-win.c (_initialize_tui_win): Remove trailing newlines from help. Reformat some text. * tui/tui-stack.c (_initialize_tui_stack): Remove trailing newline from help. * tui/tui-layout.c (_initialize_tui_layout): Remove trailing newline from help.
2019-06-04 14:17:09 +02:00
2019-06-11 Tom Tromey <tromey@adacore.com>
* infcall.c (_initialize_infcall): Remove trailing newline from
help.
* user-regs.c (_initialize_user_regs): Remove trailing newline
from help.
* typeprint.c (_initialize_typeprint): Remove trailing newline
from help.
* reverse.c (_initialize_reverse): Remove trailing newlines from
help.
* tracepoint.c (_initialize_tracepoint): Remove trailing newlines
from help.
* language.c (add_set_language_command): Remove trailing newline
from help.
* infcmd.c (_initialize_infcmd): Remove trailing newlines from
help.
* disasm.c (_initialize_disasm): Remove trailing newline from
help.
* top.c (init_main): Remove trailing newline from help.
* interps.c (_initialize_interpreter): Remove trailing newline
from help.
* btrace.c (_initialize_btrace): Remove trailing newlines from
help.
* breakpoint.c (_initialize_breakpoint): Remove trailing newline
from help.
* python/python.c (_initialize_python): Remove trailing newline
from help.
* spu-tdep.c (_initialize_spu_tdep): Remove trailing newlines from
help.
* tui/tui-win.c (_initialize_tui_win): Remove trailing newlines
from help. Reformat some text.
* tui/tui-stack.c (_initialize_tui_stack): Remove trailing newline
from help.
* tui/tui-layout.c (_initialize_tui_layout): Remove trailing
newline from help.
2019-06-11 Tom Tromey <tromey@adacore.com>
* darwin-nat.c (darwin_decode_exception_message)
(darwin_decode_message, darwin_nat_target::kill): Fix shadowing.
2019-06-10 Andrew Burgess <andrew.burgess@embecosm.com>
* valops.c (value_slice): Check for not allocated or not
associated values.
[gdb] Fix heap-buffer-overflow in cp_find_first_component_aux When compiling gdb with '-lasan -fsanitizer=address' and running tests with: - export ASAN_OPTIONS="detect_leaks=0:alloc_dealloc_mismatch=0", - target board cc-with-gdb-index, - the "[gdb/testsuite] Fix gdb.base/break-probes.exp with native-gdbserver" commit reverted to avoid running into PR24617, we get with gdb.arch/amd64-init-x87-values.exp: ... ==31229==ERROR: AddressSanitizer: heap-buffer-overflow on address \ 0x62500098c93c at pc 0x000000bcc748 bp 0x7ffe39487660 sp 0x7ffe39487658 READ of size 1 at 0x62500098c93c thread T0 #0 0xbcc747 in cp_find_first_component_aux src/gdb/cp-support.c:999 #1 0xbcc6e9 in cp_find_first_component(char const*) \ src/gdb/cp-support.c:977 #2 0xcc2cf3 in mapped_index_base::build_name_components() \ src/gdb/dwarf2read.c:4499 #3 0xcc3322 in dw2_expand_symtabs_matching_symbol src/gdb/dwarf2read.c:4552 #4 0xcc817f in dw2_expand_symtabs_matching src/gdb/dwarf2read.c:5228 #5 0xfe8f48 in iterate_over_all_matching_symtabs src/gdb/linespec.c:1147 #6 0x1003506 in add_matching_symbols_to_info src/gdb/linespec.c:4413 #7 0xffe21b in find_function_symbols src/gdb/linespec.c:3886 #8 0xffe4a2 in find_linespec_symbols src/gdb/linespec.c:3914 #9 0xfee3ad in linespec_parse_basic src/gdb/linespec.c:1865 #10 0xff5128 in parse_linespec src/gdb/linespec.c:2655 #11 0xff8872 in event_location_to_sals src/gdb/linespec.c:3150 #12 0xff90a8 in decode_line_full(event_location const*, int, \ program_space*, symtab*, int, linespec_result*, \ char const*, char const*) src/gdb/linespec.c:3230 #13 0x9ce449 in parse_breakpoint_sals src/gdb/breakpoint.c:9057 #14 0x9ea022 in create_sals_from_location_default src/gdb/breakpoint.c:13708 #15 0x9e2c1f in bkpt_create_sals_from_location src/gdb/breakpoint.c:12514 #16 0x9cff06 in create_breakpoint(gdbarch*, event_location const*, \ char const*, int, char const*, int, int, bptype, int, \ auto_boolean, breakpoint_ops const*, int, int, int, \ unsigned int) src/gdb/breakpoint.c:9238 #17 0x9d114a in break_command_1 src/gdb/breakpoint.c:9402 #18 0x9d1b60 in break_command(char const*, int) src/gdb/breakpoint.c:9473 #19 0xac96aa in do_const_cfunc src/gdb/cli/cli-decode.c:106 #20 0xad0e5a in cmd_func(cmd_list_element*, char const*, int) \ src/gdb/cli/cli-decode.c:1892 #21 0x15226f6 in execute_command(char const*, int) src/gdb/top.c:630 #22 0xddde37 in command_handler(char const*) src/gdb/event-top.c:586 #23 0xdde7c1 in command_line_handler(std::unique_ptr<char, \ gdb::xfree_deleter<char> >&&) src/gdb/event-top.c:773 #24 0xddc9e8 in gdb_rl_callback_handler src/gdb/event-top.c:217 #25 0x16f2198 in rl_callback_read_char src/readline/callback.c:220 #26 0xddc5a1 in gdb_rl_callback_read_char_wrapper_noexcept \ src/gdb/event-top.c:175 #27 0xddc773 in gdb_rl_callback_read_char_wrapper src/gdb/event-top.c:192 #28 0xddd9f5 in stdin_event_handler(int, void*) src/gdb/event-top.c:514 #29 0xdd7d8f in handle_file_event src/gdb/event-loop.c:731 #30 0xdd8607 in gdb_wait_for_event src/gdb/event-loop.c:857 #31 0xdd629c in gdb_do_one_event() src/gdb/event-loop.c:321 #32 0xdd6344 in start_event_loop() src/gdb/event-loop.c:370 #33 0x10a7715 in captured_command_loop src/gdb/main.c:331 #34 0x10aa548 in captured_main src/gdb/main.c:1173 #35 0x10aa5d8 in gdb_main(captured_main_args*) src/gdb/main.c:1188 #36 0x87bd35 in main src/gdb/gdb.c:32 #37 0x7f16e1434f89 in __libc_start_main (/lib64/libc.so.6+0x20f89) #38 0x87bb49 in _start (build/gdb/gdb+0x87bb49) 0x62500098c93c is located 0 bytes to the right of 8252-byte region \ [0x62500098a900,0x62500098c93c) allocated by thread T0 here: #0 0x7f16e359a600 in malloc (/usr/lib64/libasan.so.5+0xeb600) #1 0x1742ddf in bfd_malloc src/bfd/libbfd.c:275 #2 0x1738824 in bfd_get_full_section_contents src/bfd/compress.c:253 #3 0xe30044 in gdb_bfd_map_section(bfd_section*, unsigned long*) \ src/gdb/gdb_bfd.c:704 #4 0xcb56bf in dwarf2_read_section(objfile*, dwarf2_section_info*) \ src/gdb/dwarf2read.c:2539 #5 0xd5bcd0 in get_gdb_index_contents_from_section<dwarf2_per_objfile> \ src/gdb/dwarf2read.c:6217 #6 0xd7fc7d in gdb::function_view<gdb::array_view<unsigned char const> \ (...) const src/gdb/common/function-view.h:284 #7 0xd7fddd in gdb::function_view<gdb::array_view<unsigned char const> \ (...) src/gdb/common/function-view.h:278 #8 0xd730cf in gdb::function_view<gdb::array_view<unsigned char const> \ (...) const src/gdb/common/function-view.h:247 #9 0xcbc7ee in dwarf2_read_gdb_index src/gdb/dwarf2read.c:3582 #10 0xcce731 in dwarf2_initialize_objfile(objfile*, dw_index_kind*) \ src/gdb/dwarf2read.c:6297 #11 0xdb88c4 in elf_symfile_read src/gdb/elfread.c:1256 #12 0x141262a in read_symbols src/gdb/symfile.c:798 #13 0x14140a7 in syms_from_objfile_1 src/gdb/symfile.c:1000 #14 0x1414393 in syms_from_objfile src/gdb/symfile.c:1017 #15 0x1414fb7 in symbol_file_add_with_addrs src/gdb/symfile.c:1124 #16 0x14159b7 in symbol_file_add_from_bfd(bfd*, char const*, \ enum_flags<symfile_add_flag>, std::vector<other_sections, \ std::allocator<other_sections> >*, \ enum_flags<objfile_flag>, objfile*) src/gdb/symfile.c:1203 #17 0x1415b6c in symbol_file_add(char const*, enum_flags<symfile_add_flag>, std::vector<other_sections, \ std::allocator<other_sections> >*, \ enum_flags<objfile_flag>) src/gdb/symfile.c:1216 #18 0x1415f2f in symbol_file_add_main_1 src/gdb/symfile.c:1240 #19 0x1418599 in symbol_file_command(char const*, int) \ src/gdb/symfile.c:1675 #20 0xde2fa6 in file_command src/gdb/exec.c:433 #21 0xac96aa in do_const_cfunc src/gdb/cli/cli-decode.c:106 #22 0xad0e5a in cmd_func(cmd_list_element*, char const*, int) \ src/gdb/cli/cli-decode.c:1892 #23 0x15226f6 in execute_command(char const*, int) src/gdb/top.c:630 #24 0xddde37 in command_handler(char const*) src/gdb/event-top.c:586 #25 0xdde7c1 in command_line_handler(std::unique_ptr<char, \ gdb::xfree_deleter<char> >&&) src/gdb/event-top.c:773 #26 0xddc9e8 in gdb_rl_callback_handler src/gdb/event-top.c:217 #27 0x16f2198 in rl_callback_read_char src/readline/callback.c:220 #28 0xddc5a1 in gdb_rl_callback_read_char_wrapper_noexcept \ src/gdb/event-top.c:175 #29 0xddc773 in gdb_rl_callback_read_char_wrapper src/gdb/event-top.c:192 SUMMARY: AddressSanitizer: heap-buffer-overflow src/gdb/cp-support.c:999 in \ cp_find_first_component_aux Shadow bytes around the buggy address: 0x0c4a801298d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4a801298e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4a801298f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4a80129900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4a80129910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c4a80129920: 00 00 00 00 00 00 00[04]fa fa fa fa fa fa fa fa 0x0c4a80129930: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4a80129940: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4a80129950: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4a80129960: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4a80129970: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==31229==ABORTING ... The problem happens as follows. The executable amd64-init-x87-values gets an index (due to target board cc-with-gdb-index), which looks as follows: ... Hex dump of section '.gdb_index': 0x00000000 08000000 18000000 28000000 28000000 ........(...(... 0x00000010 3c000000 3c200000 00000000 00000000 <...< .......... 0x00000020 2e000000 00000000 d4004000 00000000 ..........@..... 0x00000030 db004000 00000000 00000000 00000000 ..@............. 0x00000040 00000000 00000000 00000000 00000000 ................ 0x00000050 00000000 00000000 00000000 00000000 ................ ... more zeroes ... 0x00002010 00000000 00000000 00000000 00000000 ................ 0x00002020 00000000 00000000 00000000 00000000 ................ 0x00002030 00000000 00000000 00000000 ............ ... The structure of this index is: ... header : [0x0, 0x18) : size 0x18 culist : [0x18 ,0x28) : size 0x10 typesculist : [0x28, 0x28) : size 0x0 adress area : [0x28, 0x3c) : size 0x14 symbol table : [0x3c, 0x203c) : size 0x2000 constant pool: [0x203c, 0x203c): size 0x0 EOF : 0x203c ... Note that the symbol table consists entirely of empty slots (where an empty slot is a pair of 32-bit zeroes), and that the constant pool is empty. The problem happens here in mapped_index_base::build_name_components: ... auto count = this->symbol_name_count (); for (offset_type idx = 0; idx < count; idx++) { if (this->symbol_name_slot_invalid (idx)) continue; const char *name = this->symbol_name_at (idx); ... when accessing the slot at idx == 0 in the symbol table, symbol_name_slot_invalid returns false so we calculate name, which is calculated using 'constant_pool + symbol_table[idx].name', which means we get name == constant_pool. And given that the constant pool is empty, name now points past the memory allocated for the index, and when we access name[0] for the first time in cp_find_first_component_aux, we run into the heap-buffer-overflow. Fix this by fixing the definition of symbol_name_slot_invalid: ... - return bucket.name == 0 && bucket.vec; + return bucket.name == 0 && bucket.vec == 0; ... Tested on x86_64-linux. gdb/ChangeLog: 2019-06-10 Tom de Vries <tdevries@suse.de> PR gdb/24618 * dwarf2read.c (struct mapped_index::symbol_name_slot_invalid): Make sure an empty slot (defined by a 32-bit zero pair) is recognized as invalid.
2019-06-10 20:27:09 +02:00
2019-06-10 Tom de Vries <tdevries@suse.de>
PR gdb/24618
* dwarf2read.c (struct mapped_index::symbol_name_slot_invalid): Make
sure an empty slot (defined by a 32-bit zero pair) is recognized as
invalid.
[gdb] Fix dynamic-stack-buffer-overflow in linespec_lexer_lex_string When compiling gdb with '-lasan -fsanitizer=address' and running tests with 'export ASAN_OPTIONS="detect_leaks=0:alloc_dealloc_mismatch=0"', I run into: ... ERROR: GDB process no longer exists UNRESOLVED: gdb.linespec/cpls-abi-tag.exp: \ test_abi_tag: completion: at tag: tab complete "b test_abi_tag_function[abi:" ... In more detail: ... ==3637==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address \ 0x7fff5952bbdd at pc 0x000000fe5c57 bp 0x7fff5952af30 sp 0x7fff5952af28 READ of size 1 at 0x7fff5952bbdd thread T0 #0 0xfe5c56 in linespec_lexer_lex_string src/gdb/linespec.c:727 #1 0xfe7473 in linespec_lexer_lex_one src/gdb/linespec.c:946 #2 0xfe799d in linespec_lexer_consume_token src/gdb/linespec.c:982 #3 0xff446d in parse_linespec src/gdb/linespec.c:2564 #4 0xff78be in linespec_complete(completion_tracker&, char const*, \ symbol_name_match_type) src/gdb/linespec.c:2961 #5 0xb9299c in complete_address_and_linespec_locations \ src/gdb/completer.c:573 #6 0xb93e90 in location_completer(cmd_list_element*, completion_tracker&, \ char const*, char const*) src/gdb/completer.c:919 #7 0xb940c5 in location_completer_handle_brkchars src/gdb/completer.c:956 #8 0xb957ec in complete_line_internal_normal_command \ src/gdb/completer.c:1208 #9 0xb96507 in complete_line_internal_1 src/gdb/completer.c:1430 #10 0xb965c2 in complete_line_internal src/gdb/completer.c:1449 #11 0xb98630 in gdb_completion_word_break_characters_throw \ src/gdb/completer.c:1862 #12 0xb98838 in gdb_completion_word_break_characters() \ src/gdb/completer.c:1897 #13 0x16c6362 in _rl_find_completion_word src/readline/complete.c:943 #14 0x16ca8d0 in rl_complete_internal src/readline/complete.c:1843 #15 0x16c460c in rl_complete src/readline/complete.c:408 #16 0x16b3368 in _rl_dispatch_subseq src/readline/readline.c:774 #17 0x16b3092 in _rl_dispatch src/readline/readline.c:724 #18 0x16b2939 in readline_internal_char src/readline/readline.c:552 #19 0x16f1fb0 in rl_callback_read_char src/readline/callback.c:201 #20 0xddc5a1 in gdb_rl_callback_read_char_wrapper_noexcept \ src/gdb/event-top.c:175 #21 0xddc773 in gdb_rl_callback_read_char_wrapper src/gdb/event-top.c:192 #22 0xddd9f5 in stdin_event_handler(int, void*) src/gdb/event-top.c:514 #23 0xdd7d8f in handle_file_event src/gdb/event-loop.c:731 #24 0xdd8607 in gdb_wait_for_event src/gdb/event-loop.c:857 #25 0xdd629c in gdb_do_one_event() src/gdb/event-loop.c:321 #26 0xdd6344 in start_event_loop() src/gdb/event-loop.c:370 #27 0x10a7715 in captured_command_loop src/gdb/main.c:331 #28 0x10aa548 in captured_main src/gdb/main.c:1173 #29 0x10aa5d8 in gdb_main(captured_main_args*) src/gdb/main.c:1188 #30 0x87bd35 in main src/gdb/gdb.c:32 #31 0x7fb0364c6f89 in __libc_start_main (/lib64/libc.so.6+0x20f89) #32 0x87bb49 in _start (build/gdb/gdb+0x87bb49) Address 0x7fff5952bbdd is located in stack of thread T0 at offset 557 in frame #0 0xb93702 in location_completer(cmd_list_element*, completion_tracker&, \ char const*, char const*) src/gdb/completer.c:831 This frame has 4 object(s): [32, 40) 'copy' [96, 104) 'location' [160, 168) 'text' [224, 256) 'completion_info' <== Memory access at offset 557 overflows \ this variable HINT: this may be a false positive if your program uses some custom stack \ unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: dynamic-stack-buffer-overflow \ src/gdb/linespec.c:727 in linespec_lexer_lex_string Shadow bytes around the buggy address: 0x10006b29d720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10006b29d730: 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 f2 f2 0x10006b29d740: f2 f2 00 f2 f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 0x10006b29d750: f2 f2 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 0x10006b29d760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10006b29d770: 00 00 00 00 ca ca ca ca 00 00 00[05]cb cb cb cb 0x10006b29d780: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 0x10006b29d790: 00 f2 f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f3 f3 f3 f3 0x10006b29d7a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10006b29d7b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10006b29d7c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==3637==ABORTING ... The problem happens in linespec_lexer_lex_string when lexing "b test_abi_tag_function[abi:\0" (using a notation where we make the implicit terminating \0 explicit). We arrrive here with (PARSER_STREAM (parser)) == ":\0": ... /* Do not tokenize ABI tags such as "[abi:cxx11]". */ else if (PARSER_STREAM (parser) - start > 4 && startswith (PARSER_STREAM (parser) - 4, "[abi")) ++(PARSER_STREAM (parser)); ... and consume ':', after which we end up here and consume '\0': ... /* Advance the stream. */ ++(PARSER_STREAM (parser)); ... after which (PARSER_STREAM (parser)) points past the end of the string. Fix this by removing the first "++(PARSER_STREAM (parser))", and add an assert to the second one to detect moving past the end-of-string. Build and tested on x86_64-linux. gdb/ChangeLog: 2019-06-10 Tom de Vries <tdevries@suse.de> PR gdb/24611 * linespec.c (linespec_lexer_lex_string): Remove incorrect "++(PARSER_STREAM (parser))" for "[abi"-prefixed colon. Add assert.
2019-06-10 20:17:14 +02:00
2019-06-10 Tom de Vries <tdevries@suse.de>
PR gdb/24611
* linespec.c (linespec_lexer_lex_string): Remove incorrect
"++(PARSER_STREAM (parser))" for "[abi"-prefixed colon. Add assert.
[gdb/symtab] Fix symbol loading performance regression The commit "[gdb/symtab] Fix language of duplicate static minimal symbol" introduces a performance regression, when loading a cc1 executable build with -O0 -g and gcc 7.4.0. The performance regression, measured in 'real' time is about 175%. The slower execution comes from the fact that the fix in symbol_set_names makes the call to symbol_find_demangled_name unconditional. Fix this by reverting the commit, and redoing the fix as follows. Recapturing the original problem, the first time symbol_set_names is called with gsymbol.language == lang_auto and linkage_name == "_ZL3foov", the name is not present in the per_bfd->demangled_names_hash hash table, so symbol_find_demangled_name is called to demangle the name, after which the mangled/demangled pair is added to the hashtable. The call to symbol_find_demangled_name also sets gsymbol.language to lang_cplus. The second time symbol_set_names is called with gsymbol.language == lang_auto and linkage_name == "_ZL3foov", the name is present in the hash table, so the demangled name from the hash table is used. However, the language of the symbol remains lang_auto. Fix this by adding a field language in struct demangled_name_entry, and using the field in symbol_set_names to set the language of gsymbol, if necessary. Tested on x86_64-linux. gdb/ChangeLog: 2019-06-10 Tom de Vries <tdevries@suse.de> PR symtab/24545 * symtab.c (struct demangled_name_entry): Add language field. (symbol_set_names): Revert "[gdb/symtab] Fix language of duplicate static minimal symbol". Set and use language field.
2019-06-10 20:05:04 +02:00
2019-06-10 Tom de Vries <tdevries@suse.de>
PR symtab/24545
* symtab.c (struct demangled_name_entry): Add language field.
(symbol_set_names): Revert "[gdb/symtab] Fix language of duplicate
static minimal symbol". Set and use language field.
2019-06-10 Tom Tromey <tromey@adacore.com>
* ada-lang.c (_initialize_ada_language): Update help text.
Remove newlines from warnings ARI pointed out that a recent patch introduced a call to "warning" with a string that ended in a newline: https://sourceware.org/ml/gdb-patches/2019-06/msg00000.html This is generally forbidden, I believe, because warning adds its own newline. This patch removes all of the trailing newlines I was able to find. I searched for 'warning (.*\\n"' and then fixed the ones where the newline appeared at the end of the string (some had internal newlines). Tested on x86-64 Fedora 29. gdb/ChangeLog 2019-06-10 Tom Tromey <tromey@adacore.com> * m32c-tdep.c (m32c_m16c_address_to_pointer): Don't end warning with a newline. * guile/guile.c (handle_boot_error): Don't end warning with a newline. * cli/cli-cmds.c (exit_status_set_internal_vars): Don't end warning with a newline. * s12z-tdep.c (s12z_skip_prologue): Don't end warning with a newline. (s12z_frame_cache): Likewise. * dwarf-index-cache.c (index_cache::store): Don't end warning with a newline. * solib-svr4.c (disable_probes_interface): Don't end warning with a newline. * nat/fork-inferior.c (fork_inferior): Don't end warning with a newline. * python/python.c (do_finish_initialization): Don't end warning with a newline. gdb/gdbserver/ChangeLog 2019-06-10 Tom Tromey <tromey@adacore.com> * remote-utils.c (look_up_one_symbol, relocate_instruction): Don't end warning with a newline. * linux-s390-low.c (s390_get_wordsize): Don't end warning with a newline. * thread-db.c (attach_thread): Don't end warning with a newline. (thread_db_notice_clone): Likewise. * tracepoint.c (gdb_agent_helper_thread): Don't end warning with a newline. * linux-x86-low.c (x86_get_min_fast_tracepoint_insn_len): Don't end warning with a newline.
2019-06-03 16:07:29 +02:00
2019-06-10 Tom Tromey <tromey@adacore.com>
* m32c-tdep.c (m32c_m16c_address_to_pointer): Don't end warning
with a newline.
* guile/guile.c (handle_boot_error): Don't end warning with a
newline.
* cli/cli-cmds.c (exit_status_set_internal_vars): Don't end
warning with a newline.
* s12z-tdep.c (s12z_skip_prologue): Don't end warning with a
newline.
(s12z_frame_cache): Likewise.
* dwarf-index-cache.c (index_cache::store): Don't end warning with
a newline.
* solib-svr4.c (disable_probes_interface): Don't end warning with
a newline.
* nat/fork-inferior.c (fork_inferior): Don't end warning with a
newline.
* python/python.c (do_finish_initialization): Don't end warning
with a newline.
2019-06-10 Tom Tromey <tom@tromey.com>
* python/py-breakpoint.c (gdbpy_breakpoint_created)
(gdbpy_breakpoint_deleted, gdbpy_breakpoint_modified): Use
gdbpy_enter.
2019-06-10 Tom Tromey <tromey@adacore.com>
* elfread.c (elf_read_minimal_symbols): Don't set the dbx objfile
data.
(elf_new_init): Don't call stabsread_new_init.
* dbxread.c (coffstab_build_psymtabs): Set dbx objfile data.
(elfstab_build_psymtabs): Likewise. Call stabsread_new_init.
* coffread.c (coff_symfile_init): Don't set the dbx objfile data.
2019-06-10 Tom de Vries <tdevries@suse.de>
PR symtab/16264
PR symtab/24517
* dwarf2read.c (read_func_scope): Handle DW_AT_main_subprogram.
Apply substitute-path to relative filenames as well When source file path is relative to the build directory (which is considered a good practice and is enforced in certain buildsystems, such as meson), gdb only applies substitute-path to the build directory path. Then gdb appends the source file path to the rewritten build directory path, and tries to access that. This fails if either two of the following conditions are true: a) The user didn't specify substitute-path for the build directory. This is highly likely, since path substitution for build directories is not documented anywhere, and since gdb does not tell[0] the user the path to the build directory, just the source file path. b) The source file path changed. This can also easily happen, since a source path that is relative to the build directory can include any number of directory names that are not part of the program source tree (starting with the name of the root directory of the source tree). Gdb will not apply substitute-path to that relative path, thus there is no way for the user to tell gdb about these changes. This commit changes the code to apply substitute-path to all filenames, both relative and absolute. This way it is possible to do things like: set substitute-path ../foobar-1.0 /src/my/foobar-1.0 which is completely in line with the user expectations. This might break unusual cases where build directory path is also relative (is that even possible?) and happens to match the path to the source directory (i.e. happens to match a substitution rule). [0]: There's a "maintenance info symtabs" command that does show the names of the build directories, but normal users are not required to know or use that. gdb/ChangeLog 2019-06-06 Руслан Ижбулатов <lrn1986@gmail.com> * source.c (find_and_open_source): Also rewrite relative file names.
2019-02-28 11:25:41 +01:00
2019-06-06 Руслан Ижбулатов <lrn1986@gmail.com>
* source.c (find_and_open_source): Also rewrite relative file
names.
2019-04-26 Amos Bird <amosbird@gmail.com>
* annotate.c (annotate_thread_exited): Add "thread-exited"
annotation.
2019-06-06 Tom Tromey <tromey@adacore.com>
* maint.h (class scoped_command_stats): Use
DISABLE_COPY_AND_ASSIGN.
<print_time>: New method.
* maint.c (scoped_command_stats, ~scoped_command_stats): Call
print_time.
(scoped_command_stats::print_time): New method.
2019-06-05 Andrew Burgess <andrew.burgess@embecosm.com>
* riscv-tdep.c (riscv_insn::decode): Gracefully ignore
instructions of lengths 6 or 8 bytes.
Introduce and use make_unique_xstrdup Adds an utility function to make it shorter to write the common case of wrapping an xstrdup with a unique_xmalloc_ptr, and uses it throughout. Note: I tried to put this in common/common-utils.h near skip_spaces, etc. but that is included in common/common-defs.h before common/gdb_unique_ptr.h is included, so it would fail to compile because gdb::unique_xmalloc_ptr isn't defined at that point yet. I tried moving the gdb_unique_ptr.h inclusion before common-utils.h, but that doesn't work because gdb_unique_ptr.h depends on common-utils.h for xfree. gdb/ChangeLog: 2019-06-04 Pedro Alves <palves@redhat.com> * common/gdb_unique_ptr.h (make_unique_xstrdup): New. * ada-lang.c (catch_ada_completer): Use make_unique_xstrdup. * breakpoint.c (condition_completer): Likewise. * cli/cli-dump.c (scan_expression): Likewise. * common/filestuff.c (mkdir_recursive): Likewise. * common/gdb_tilde_expand.c (gdb_tilde_expand_up) * common/pathstuff.c (gdb_realpath, gdb_realpath_keepfile) (gdb_abspath): Likewise. * compile/compile-cplus-types.c (compile_cplus_instance::decl_name): Likewise. * completer.c (complete_explicit_location): (signal_completer, reg_or_group_completer_1): Likewise. * cp-support.c (cp_remove_params_if_any): Likewise. * fbsd-tdep.c (fbsd_core_vnode_path): Likewise. * guile/scm-safe-call.c (gdbscm_safe_eval_string): Likewise. * infcmd.c (strip_bg_char): Likewise. * linespec.c (copy_token_string): Likewise. * mi/mi-main.c (output_cores): Likewise. * psymtab.c (psymtab_search_name): * symfile.c (test_set_ext_lang_command): Likewise. * target.c (target_fileio_read_stralloc): Likewise. * tui/tui-regs.c (tui_reggroup_completer): Likewise. * value.c (complete_internalvar): Likewise. gdb/gdbserver/ChangeLog: 2019-06-04 Pedro Alves <palves@redhat.com> * server.c (captured_main): Use make_unique_xstrdup.
2019-06-04 23:40:54 +02:00
2019-06-04 Pedro Alves <palves@redhat.com>
* common/gdb_unique_ptr.h (make_unique_xstrdup): New.
* ada-lang.c (catch_ada_completer): Use make_unique_xstrdup.
* breakpoint.c (condition_completer): Likewise.
* cli/cli-dump.c (scan_expression): Likewise.
* common/filestuff.c (mkdir_recursive): Likewise.
* common/gdb_tilde_expand.c (gdb_tilde_expand_up)
* common/pathstuff.c (gdb_realpath, gdb_realpath_keepfile)
(gdb_abspath): Likewise.
* compile/compile-cplus-types.c
(compile_cplus_instance::decl_name): Likewise.
* completer.c (complete_explicit_location):
(signal_completer, reg_or_group_completer_1): Likewise.
* cp-support.c (cp_remove_params_if_any): Likewise.
* fbsd-tdep.c (fbsd_core_vnode_path): Likewise.
* guile/scm-safe-call.c (gdbscm_safe_eval_string): Likewise.
* infcmd.c (strip_bg_char): Likewise.
* linespec.c (copy_token_string): Likewise.
* mi/mi-main.c (output_cores): Likewise.
* psymtab.c (psymtab_search_name):
* symfile.c (test_set_ext_lang_command): Likewise.
* target.c (target_fileio_read_stralloc): Likewise.
* tui/tui-regs.c (tui_reggroup_completer): Likewise.
* value.c (complete_internalvar): Likewise.
2019-06-04 Christian Biesinger <cbiesinger@google.com>
Add objfile property to gdb.Type.
2019-06-04 23:44:36 +02:00
* NEWS: Mention Python API addition.
* python/py-type.c (typy_get_objfile): New method.
2019-06-03 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Mention the new set|show style [title|highlight].
Mention changes to "show style", "help" and "apropos".
2019-06-03 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-decode.h (apropos_cmd): Add verbose argument.
* cli/cli-decode.c (apropos_cmd): Likewise. Use print_doc_of_command
instead of print_help_for_command.
(print_doc_of_command): New function.
(help_list): Add 'apropos -v word' suggestion.
(print_help_for_command): Style the command name using title style.
* cli/cli-cmds.c (apropos_command): Parse optional -v flag.
(_initialize_cli_cmds): Describe -v in apropos_command help.
2019-06-03 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-style.h (cli_style_option): Add name in constructor,
add m_name class member, add constructor with intensity,
add name class function.
(cli_style_option::add_setshow_commands): Remove name argument.
(highlight_style, title_style): New styles.
* cli/cli-style.c (do_show): New function that shows a style
characteristic styling the style name with itself.
(set_style_name): New function.
(STYLE_ADD_SETSHOW_COMMANDS): Remove NAME arguments.
Update all callers according to the changes in cli/cli-style.h.
* utils.h (fputs_highlighted): New function.
* utils.c (fputs_highlighted): Likewise.
2019-05-31 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Mention new pipe command and new convenience variables.
Implement | (pipe) command. The pipe command allows to run a GDB command, and pipe its output to a shell command: (gdb) help pipe Send the output of a gdb command to a shell command. Usage: | [COMMAND] | SHELL_COMMAND Usage: | -d DELIM COMMAND DELIM SHELL_COMMAND Usage: pipe [COMMAND] | SHELL_COMMAND Usage: pipe -d DELIM COMMAND DELIM SHELL_COMMAND Executes COMMAND and sends its output to SHELL_COMMAND. The -d option indicates to use the string DELIM to separate COMMAND from SHELL_COMMAND, in alternative to |. This is useful in case COMMAND contains a | character. With no COMMAND, repeat the last executed command and send its output to SHELL_COMMAND. (gdb) For example: (gdb) pipe print some_data_structure | grep -B3 -A3 something The pipe character is defined as an alias for pipe command, so that the above can be typed as: (gdb) | print some_data_structure | grep -B3 -A3 something If no GDB COMMAND is given, then the previous command is relaunched, and its output is sent to the given SHELL_COMMAND. This also defines convenience vars $_shell_exitcode and $_shell_exitsignal to record the exit code and exit signal of the last shell command launched by GDB e.g. by "shell", "pipe", ... gdb/ChangeLog 2019-05-31 Philippe Waroquiers <philippe.waroquiers@skynet.be> * cli/cli-cmds.c (pipe_command): New function. (_initialize_cli_cmds): Call add_com for pipe_command. Define | as an alias for pipe. (exit_status_set_internal_vars): New function. (shell_escape): Call exit_status_set_internal_vars. cli/cli-decode.c (find_command_name_length): Recognize | as a single character command.
2019-04-20 14:14:23 +02:00
2019-05-31 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-cmds.c (pipe_command): New function.
(_initialize_cli_cmds): Call add_com for pipe_command.
Define | as an alias for pipe.
(exit_status_set_internal_vars): New function.
(shell_escape): Call exit_status_set_internal_vars.
cli/cli-decode.c (find_command_name_length): Recognize | as
a single character command.
2019-05-31 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdbcmd.h (execute_command_to_ui_file): New declaration.
top.c (execute_command_to_ui_file): New function, mostly a copy
of execute_command_to_string.
(execute_command_to_string): Implement by calling
execute_command_to_ui_file.
Add previous_saved_command_line to allow a command to repeat a previous command. Currently, a previous command can be repeated when the user types an empty line. This is implemented in handle_line_of_input by returning saved_command_line in case an empty line has been input. If we want a command to repeat the previous command, we need to save the previous saved_command_line, as when a command runs, the saved_command_line already contains the current command line of the command being executed. As suggested by Tom, the previous_saved_command_line is made static. At the same time, saved_command_line is also made static. The support functions/variables for the repeat command logic are now all located inside top.c. gdb/ChangeLog 2019-05-31 Philippe Waroquiers <philippe.waroquiers@skynet.be> * top.h (saved_command_line): Remove declaration. * top.c (previous_saved_command_line, previous_repeat_arguments): New variables. (saved_command_line): Make static, define together with other 'repeat variables'. (dont_repeat): Clear repeat_arguments. (repeat_previous, get_saved_command_line, save_command_line): New functions. (gdb_init): Initialize saved_command_line and previous_saved_command_line. * main.c (captured_main_1): Remove saved_command_line initialization. * event-top.c (handle_line_of_input): Update to use the new 'repeat' related functions instead of direct access to saved_command_line. * command.h (repeat_previous, get_saved_command_line, save_command_line): New declarations. (dont_repeat): Add comment.
2019-04-20 14:02:29 +02:00
2019-05-31 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* top.h (saved_command_line): Remove declaration.
* top.c (previous_saved_command_line, previous_repeat_arguments):
New variables.
(saved_command_line): Make static, define together with other
'repeat variables'.
(dont_repeat): Clear repeat_arguments.
(repeat_previous, get_saved_command_line, save_command_line):
New functions.
(gdb_init): Initialize saved_command_line
and previous_saved_command_line.
* main.c (captured_main_1): Remove saved_command_line initialization.
* event-top.c (handle_line_of_input): Update to use
the new 'repeat' related functions instead of direct access to
saved_command_line.
* command.h (repeat_previous, get_saved_command_line,
save_command_line): New declarations.
(dont_repeat): Add comment.
2019-05-30 Tom Tromey <tromey@adacore.com>
* gdbtypes.h (struct range_bounds) <flag_upper_bound_is_count>:
Fix comment.
(TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED): Rewrite comment.
2019-05-30 Jan Vrany <jan.vrany@fit.cvut.cz>
PR cli/24587
* completer.c (complete): Initialize variable word.
2019-05-29 Sergio Durigan Junior <sergiodj@redhat.com>
Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1715008
* dwarf2read.c (dwarf_decode_macro_bytes): Move check to see if
'body' is NULL to the outter 'if', protecting the '!is_define'
situation as well.
2019-05-29 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (partial_die_parent_scope): Call dwarf_tag_name.
(dwarf_unknown): New function.
(dwarf_tag_name, dwarf_attr_name, dwarf_form_name)
(dwarf_type_encoding_name): Use dwarf_unknown.
2019-05-29 Tom Tromey <tromey@adacore.com>
PR c++/20020:
* cp-valprint.c (cp_print_value_fields): Call
cp_print_static_field inside "try".
2019-05-29 Tom Tromey <tromey@adacore.com>
* inflow.c (struct terminal_info): Add default operator=.
* configure: Rebuild.
* warning.m4 (AM_GDB_WARNINGS): Add -Wdeprecated-copy,
-Wdeprecated-copy-dtor, -Wredundant-move.
2019-05-29 Tom Tromey <tromey@adacore.com>
* NEWS: Add entry.
* infcmd.c (print_return_value_1): Handle finish_print
option.
(show_print_finish): New function.
(_initialize_infcmd): Add "set/show print finish" commands.
* valprint.c (user_print_options): Initialize new member.
* valprint.h (struct value_print_options) <finish_print>: New
member.
2019-05-28 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_remove_Xbn_suffix)
(find_old_style_renaming_symbol)
(parse_old_style_renaming): Remove.
(ada_find_renaming_symbol): Don't call
find_old_style_renaming_symbol.
(ada_is_renaming_symbol): Rename from
ada_find_renaming_symbol. Remove "block" parameter. Return
bool. Now static.
(ada_read_var_value): Update and simplify.
* ada-exp.y (write_var_or_type): Remove old code.
2019-05-28 Alan Hayward <alan.hayward@arm.com>
PR gdb/25010
* event-top.c: Remove include comment.
* inflow.c (class scoped_ignore_sigttou): Move from here...
* inflow.h (class scoped_ignore_sigttou): ...to here.
* ser-unix.c (hardwire_drain_output): Block SIGTTOU during drain.
* top.c: Remove include comment.
2019-05-27 Tom Tromey <tom@tromey.com>
* NEWS: Fix typo.
2019-05-22 Tom Tromey <tromey@adacore.com>
* target.c (target_follow_exec): Constify parameter.
* target-delegates.c: Rebuild.
* remote.c (remote_target::follow_exec): Constify parameter.
* infrun.c (follow_exec): Constify parameter.
* target.h (struct target_ops) <follow_exec>: Constify parameter.
(target_follow_exec): Likewise.
2019-05-22 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aarch64_execute_dwarf_cfa_vendor_op): Treat
DW_CFA_AARCH64_negate_ra_state as nop on non pauth targets.
2019-05-22 Alan Hayward <alan.hayward@arm.com>
* NEWS: Add debugredirect and testsuite sections.
2019-05-22 Simon Cook <simon.cook@embecosm.com>
* riscv-tdep.c (riscv_gdbarch_init): Support determining flen from
target descriptions using exclusively floating point register name
aliases.
2019-05-21 Andrew Burgess <andrew.burgess@embecosm.com>
PR gdb/18644:
* f-lang.c (build_fortran_types): Handle the case where
gdbarch_floatformat_for_type returns a nullptr.
2019-05-21 Tom de Vries <tdevries@suse.de>
PR cli/24587
* cli/cli-cmds.c (complete_command): Fix use of unitialized variable.
gdb/fortran: Use floatformats_ia64_quad for fortran 16-byte floats PR gdb/18644 is caused by GDB using the wrong floating point format for gfortran's 16-byte floating point type, including when the 16-byte float is used as the component of a 32-byte complex type. This commit addresses the issue in two places, first in i386-tdep.c, there is already some code to force the use of floatformats_ia64_quad for specific named types, this is extended to include the type names that gfortran uses for its 16-byte floats. Second, the builtin 16-byte float type (in f-lang.c) is changed so it no longer uses gdbarch_long_double_format. On i386 this type is not 16-bytes, but is smaller, this is not what gfortran is expecting. Instead we now use gdbarch_floatformat_for_type and ask for a 16-byte (128 bit) type using the common gfortran type name. This is then spotted in i386-tdep.c (thanks to the first change above) and we again get floatformats_ia64_quad returned. This patch was tested on X86-64/GNU-Linux using '--target_board=unix' and '--target_board=unix/-m32', and resolves all of the known failures associated with PR gdb/18644. I've also added the test case from the original bug report. gdb/ChangeLog: PR gdb/18644: * f-lang.c (build_fortran_types): Use floatformats_ia64_quad for 16-byte floats. * i386-tdep.c (i386_floatformat_for_type): Use floatformats_ia64_quad for the 16-byte floating point component within a fortran 32-byte complex number. gdb/testsuite/ChangeLog: PR gdb/18644 * gdb.fortran/complex.exp: Remove setup_kfail calls. * gdb.fortran/printing-types.exp: Add new test. * gdb.fortran/printing-types.f90: Add 16-byte real variable for testing. * gdb.fortran/type-kinds.exp (test_cast_1_to_type_kind): Remove setup_kfail call.
2019-05-03 16:23:55 +02:00
2019-05-18 Andrew Burgess <andrew.burgess@embecosm.com>
PR gdb/18644:
* f-lang.c (build_fortran_types): Use floatformats_ia64_quad for
16-byte floats.
* i386-tdep.c (i386_floatformat_for_type): Use
floatformats_ia64_quad for the 16-byte floating point component
within a fortran 32-byte complex number.
2019-05-18 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2read.c (struct cu_partial_die_info): Add constructor,
delete default constructor.
(find_partial_die): Update to return const struct.
(partial_die_parent_scope): Move variable declaration into scope
of its use and change its type to auto.
(guess_partial_die_structure_name): Likewise.
(partial_die_info::fixup): Likewise.
2019-05-17 Tom Tromey <tromey@adacore.com>
* source.c (find_and_open_source): Remove cast.
2019-05-17 Tom Tromey <tromey@adacore.com>
* annotate.c (annotate_source): Make "filename" const.
* annotate.h (annotate_source): Use const.
2019-05-17 16:35:08 +02:00
2019-05-17 Alan Hayward <alan.hayward@arm.com>
* disasm.c (set_disassembler_options): Send errors to stderr.
2019-05-17 15:15:01 +02:00
2019-05-17 Alan Hayward <alan.hayward@arm.com>
* cli/cli-interp.c (struct saved_output_files): Add saved entry.
(cli_interp_base::set_logging): Check debug_redirect.
* cli/cli-interp.h (set_logging): Add debug_redirect parameter.
* cli/cli-logging.c (debug_redirect): Add static variable.
(pop_output_files): Add default param.
(handle_redirections): Print debug setting.
(show_logging_command): Likewise.
(_initialize_cli_logging): Add debugredirect command.
* interps.c (current_interp_set_logging): Add debug_redirect
parameter.
* interps.h (set_logging): Add debug_redirect parameter.
(current_interp_set_logging): Likewise.
* mi/mi-common.h: Likewise.
* mi/mi-interp.c (mi_interp::set_logging): Likewise.
2019-05-17 Alan Hayward <alan.hayward@arm.com>
Tom Tromey <tromey@adacore.com>
* cli/cli-interp.c (cli_interp_base::set_logging): Create tee_file
directly.
* cli/cli-interp.h (make_logging_output): Remove declaration.
* cli/cli-logging.c (make_logging_output): Remove function.
* mi/mi-interp.c (mi_interp::set_logging): Create tee_file
directly.
* ui-file.c (tee_file::tee_file): Remove bools.
(tee_file::~tee_file): Remove deletes.
* ui-file.h (tee_file): Remove bools.
2019-01-28 Jan Vrany <jan.vrany@fit.cvut.cz>
* mi/mi-cmds.h (mi_cmd_complete): New function.
* mi/mi-main.c (mi_cmd_complete): Likewise.
* mi/mi-cmds.c: Define new MI command -complete.
* NEWS: Mention new -complete command.
2019-01-24 Jan Vrany <jan.vrany@fit.cvut.cz>
* completer.h (complete): New function.
* completer.c (complete): Likewise.
* cli/cli-cmds.c: (complete_command): Update to use new complete()
function defined in completer.h.
2019-05-17 Jan Vrany <jan.vrany@fit.cvut.cz>
* MAINTAINERS (Write After Approval): Add myself.
[gdb] Fix heap-use-after-free in typename_concat When running gdb using AddressSanitizer, and loading a cc1plus binary built with profiledbootstrap and -flto, we run into a heap-use-after-free error: ... $ LD_PRELOAD=/usr/lib64/libasan.so.3 ./gdb -batch cc1plus ==26855==ERROR: AddressSanitizer: heap-use-after-free on address \ 0x62100ad8a8b0 at pc 0x7f13803cc9e3 bp 0x7ffe55b0d090 sp 0x7ffe55b0c840 READ of size 47 at 0x62100ad8a8b0 thread T0 #0 0x7f13803cc9e2 (/usr/lib64/libasan.so.3+0x3e9e2) #1 0x5e7a0d in typename_concat gdb/dwarf2read.c:22661 #2 0x5c6437 in partial_die_full_name gdb/dwarf2read.c:8876 #3 0x5c6555 in add_partial_symbol gdb/dwarf2read.c:8893 #4 0x5c6ecf in add_partial_subprogram gdb/dwarf2read.c:9156 #5 0x5c5e90 in scan_partial_symbols gdb/dwarf2read.c:8668 #6 0x5c6c0a in add_partial_namespace gdb/dwarf2read.c:9081 #7 0x5c5f99 in scan_partial_symbols gdb/dwarf2read.c:8702 #8 0x5c48b6 in process_psymtab_comp_unit_reader gdb/dwarf2read.c:8056 #9 0x5c3c1f in init_cutu_and_read_dies gdb/dwarf2read.c:7689 #10 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140 #11 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500 #12 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337 #13 0x612359 in read_psyms gdb/elfread.c:1311 #14 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115 #15 0x867d7b in read_symbols gdb/symfile.c:821 #16 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000 #17 0x8684a1 in syms_from_objfile gdb/symfile.c:1017 #18 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124 #19 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \ enum_flags<symfile_add_flag>, std::vector<other_sections, \ std::allocator<other_sections> >*, \ enum_flags<objfile_flag>, objfile*) gdb/symfile.c:1204 #20 0x868b64 in symbol_file_add(char const*, \ enum_flags<symfile_add_flag>, \ std::vector<other_sections, \ std::allocator<other_sections> >*, \ enum_flags<objfile_flag>) gdb/symfile.c:1217 #21 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240 #22 0x868bd0 in symbol_file_add_main(char const*, \ enum_flags<symfile_add_flag>) gdb/symfile.c:1231 #23 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395 #24 0x71f10e in catch_command_errors gdb/main.c:372 #25 0x71ff5f in captured_main_1 gdb/main.c:1043 #26 0x72045d in captured_main gdb/main.c:1163 #27 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188 #28 0x40fd7d in main gdb/gdb.c:32 #29 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49) #30 0x40fc89 in _start (/data/gdb_versions/devel/build/gdb/gdb+0x40fc89) 0x62100ad8a8b0 is located 944 bytes inside of 4064-byte region \ [0x62100ad8a500,0x62100ad8b4e0) freed by thread T0 here: #0 0x7f13804523a0 in __interceptor_free (/usr/lib64/libasan.so.3+0xc43a0) #1 0x435e44 in xfree<void> gdb/common/common-utils.h:60 #2 0xa82c25 in call_freefun libiberty/obstack.c:103 #3 0xa83098 in _obstack_free libiberty/obstack.c:280 #4 0x4367da in auto_obstack::~auto_obstack() gdb/gdb_obstack.h:101 #5 0x5ed72c in dwarf2_cu::~dwarf2_cu() gdb/dwarf2read.c:25341 #6 0x5fb5bb in std::default_delete<dwarf2_cu>::operator()(dwarf2_cu*) const \ /usr/include/c++/7/bits/unique_ptr.h:78 #7 0x5f7334 in std::unique_ptr<dwarf2_cu, \ std::default_delete<dwarf2_cu> >::~unique_ptr() \ /usr/include/c++/7/bits/unique_ptr.h:268 #8 0x5c3ce5 in init_cutu_and_read_dies gdb/dwarf2read.c:7624 #9 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140 #10 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500 #11 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337 #12 0x612359 in read_psyms gdb/elfread.c:1311 #13 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115 #14 0x867d7b in read_symbols gdb/symfile.c:821 #15 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000 #16 0x8684a1 in syms_from_objfile gdb/symfile.c:1017 #17 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124 #18 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \ enum_flags<symfile_add_flag>, std::vector<other_sections, \ std::allocator<other_sections> >*, \ enum_flags<objfile_flag>, objfile*) gdb/symfile.c:1204 #19 0x868b64 in symbol_file_add(char const*, \ enum_flags<symfile_add_flag>, std::vector<other_sections, \ std::allocator<other_sections> >*, \ enum_flags<objfile_flag>) gdb/symfile.c:1217 #20 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240 #21 0x868bd0 in symbol_file_add_main(char const*, \ enum_flags<symfile_add_flag>) gdb/symfile.c:1231 #22 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395 #23 0x71f10e in catch_command_errors gdb/main.c:372 #24 0x71ff5f in captured_main_1 gdb/main.c:1043 #25 0x72045d in captured_main gdb/main.c:1163 #26 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188 #27 0x40fd7d in main gdb/gdb.c:32 #28 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49) previously allocated by thread T0 here: #0 0x7f13804526b8 in __interceptor_malloc (/usr/lib64/libasan.so.3+0xc46b8) #1 0x5114b5 in xmalloc gdb/common/common-utils.c:44 #2 0xa82bd5 in call_chunkfun libiberty/obstack.c:94 #3 0xa82eda in _obstack_newchunk libiberty/obstack.c:206 #4 0x477310 in allocate_on_obstack::operator new(unsigned long, obstack*) \ gdb/gdb_obstack.h:117 #5 0x5dea8c in load_partial_dies gdb/dwarf2read.c:18571 #6 0x5c487f in process_psymtab_comp_unit_reader gdb/dwarf2read.c:8054 #7 0x5c3c1f in init_cutu_and_read_dies gdb/dwarf2read.c:7689 #8 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140 #9 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500 #10 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337 #11 0x612359 in read_psyms gdb/elfread.c:1311 #12 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115 #13 0x867d7b in read_symbols gdb/symfile.c:821 #14 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000 #15 0x8684a1 in syms_from_objfile gdb/symfile.c:1017 #16 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124 #17 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \ enum_flags<symfile_add_flag>, \ std::vector<other_sections, \ std::allocator<other_sections> >*, \ enum_flags<objfile_flag>, objfile*) gdb/symfile.c:1204 #18 0x868b64 in symbol_file_add(char const*, enum_flags<symfile_add_flag>, \ std::vector<other_sections, \ std::allocator<other_sections> >*, \ enum_flags<objfile_flag>) gdb/symfile.c:1217 #19 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240 #20 0x868bd0 in symbol_file_add_main(char const*, \ enum_flags<symfile_add_flag>) gdb/symfile.c:1231 #21 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395 #22 0x71f10e in catch_command_errors gdb/main.c:372 #23 0x71ff5f in captured_main_1 gdb/main.c:1043 #24 0x72045d in captured_main gdb/main.c:1163 #25 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188 #26 0x40fd7d in main gdb/gdb.c:32 #27 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49) ... This error happens as follows. The function find_partial_die has a cu argument, but returns a pdi which may or may not be from that cu: ... /* Find a partial DIE at OFFSET, which may or may not be in CU, except in the case of .debug_types DIEs which do not reference outside their CU (they do however referencing other types via DW_FORM_ref_sig8). */ static struct partial_die_info * find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) ... So the pdi returned by find_partial_die here in partial_die_parent_scope may be from another cu: ... partial_die_parent_scope (struct partial_die_info *pdi, struct dwarf2_cu *cu) { const char *grandparent_scope; struct partial_die_info *parent, *real_pdi; /* We need to look at our parent DIE; if we have a DW_AT_specification, then this means the parent of the specification DIE. */ real_pdi = pdi; while (real_pdi->has_specification) real_pdi = find_partial_die (real_pdi->spec_offset, real_pdi->spec_is_dwz, cu); parent = real_pdi->die_parent; ... in which case both real_pdi and parent will be not from cu, but from another one, say cu2. Subsequently, cu's comp_unit_obstack is used to set parent->scope: ... parent->scope = typename_concat (&cu->comp_unit_obstack, grandparent_scope, parent->name, 0, cu); ... So, we use cu->comp_unit_obstack to assign a value to the scope field of a pdi belonging to cu2, and when cu is deleted, the scope field points to a freed value. Fix this by making find_partial_die return the cu corresponding to the returned pdi, and handling this at the call sites. Tested on x86_64-linux. gdb/ChangeLog: 2019-05-17 Tom de Vries <tdevries@suse.de> PR gdb/24094 * dwarf2read.c (struct cu_partial_die_info): New struct. (find_partial_die): Return cu_partial_die_info. (partial_die_parent_scope, guess_partial_die_structure_name) (partial_die_info::fixup): Handle new return type of find_partial_die.
2019-05-17 09:35:19 +02:00
2019-05-17 Tom de Vries <tdevries@suse.de>
PR gdb/24094
* dwarf2read.c (struct cu_partial_die_info): New struct.
(find_partial_die): Return cu_partial_die_info.
(partial_die_parent_scope, guess_partial_die_structure_name)
(partial_die_info::fixup): Handle new return type of find_partial_die.
2019-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/24541
* stap-probe.c (stap_parse_register_operand): Make "regname" an
"std::string", simplifying the algorithm.
2019-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
* stap-probe.c (handle_stap_probe): Fix complaint formatting.
(stap_static_probe_ops::get_probes): Likewise.
2019-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
* stap-probe.c (stap_parse_register_operand): Make "if (*p->arg ==
'-')" and "else if".
(stap_parse_single_operand): Join checks for
"gdbarch_stap_parse_special_token_p" and
"gdbarch_stap_parse_special_token" in the same "if" statement.
Invert check when verifying for operation on register
displacement.
2019-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
* stap-probe.c (stap_get_opcode): Update comment.
(stap_get_expected_argument_type): Likewise.
(handle_stap_probe): Likewise.
2019-05-16 Sergio Durigan Junior <sergiodj@redhat.com>
* i386-tdep.c (i386_stap_parse_special_token_triplet): Change
return type to 'bool'. Adjust comment. Use 'bool' when
appropriate.
(i386_stap_parse_special_token_three_arg_disp): Likewise.
* stap-probe.c (stap_parse_argument_1): Likewise.
(stap_is_operator): Likewise.
(stap_is_generic_prefix): Likewise.
(stap_is_register_prefix): Likewise.
(stap_is_register_indirection_prefix): Likewise.
(stap_is_integer_prefix): Likewise.
(stap_generic_check_suffix): Likewise.
(stap_check_integer_suffix): Likewise.
(stap_check_register_suffix): Likewise.
(stap_check_register_indirection_suffix): Likewise.
(stap_parse_register_operand): Likewise.
(stap_parse_single_operand): Likewise.
(stap_parse_argument_1): Likewise.
(stap_probe::get_argument_count): Likewise.
(stap_is_operator): Likewise.
2019-05-16 Tom Tromey <tromey@adacore.com>
* darwin-nat.c (thread_info_from_private_thread_info): Add struct
keyword to foreach.
2019-05-15 Simon Marchi <simon.marchi@efficios.com>
* linux-thread-db.c (try_thread_db_load_1): Change return type
to bool.
(try_thread_db_load): Likewise.
(try_thread_db_load_from_pdir_1): Likewise.
(try_thread_db_load_from_pdir): Likewise.
(try_thread_db_load_from_sdir): Likewise.
(try_thread_db_load_from_dir): Likewise.
(thread_db_load_search): Likewise.
(has_libpthread): Likewise.
(thread_db_load): Likewise.
2019-05-15 Sergio Durigan Junior <sergiodj@redhat.com>
Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
* dwarf2read.c (parse_macro_definition): Check whether 'body' is
NULL, and complain/return if that's the case.
2019-05-15 John Darrington <john@darrington.wattle.id.au>
* s12z-tdep.c (push_pull_get_stack_adjustment): New function.
(advance, posn, abstract_read_memory): New functions.
[struct mem_read_abstraction]: New struct.
(s12z_frame_cache): Use opcodes API to interpret stack frame code.
2019-05-14 Tom Tromey <tromey@adacore.com>
* ada-lang.c (coerce_unspec_val_to_type): Only set address when
value is not lval_memory.
2019-05-14 Tom Tromey <tromey@adacore.com>
* solib.c (info_sharedlibrary_command): Style the file name.
2019-05-14 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aarch64_vnh_type): Add half view.
(aarch64_vnv_type): Likewise.
* target-descriptions.c (make_gdb_type): Add TDESC_TYPE_IEEE_HALF.
* common/tdesc.c: Likewise.
* common/tdesc.h (enum tdesc_type_kind): Likewise.
* features/aarch64-fpu.c (create_feature_aarch64_fpu): Regenerate.
* features/aarch64-fpu.xml: Add ieee half view.
* features/aarch64-sve.c (create_feature_aarch64_fpu): Likewise.
* gdbtypes.c (gdbtypes_post_init): Add builtin_half
* gdbtypes.h (struct builtin_type): Likewise.
(struct objfile_type): Likewise.
2019-05-12 17:47:37 +02:00
2019-05-12 Paul Naert <paul.naert@polymtl.ca>
* language.c (language_sniff_from_mangled_name): Fix "langauge"
typo.
* location.h (string_to_event_location): Likewise.
2019-05-11 Joel Brobecker <brobecker@adacore.com>
GDB 8.3 released.
Fix GDB build when using --disable-gdbmi Since commit b4be1b064860 ("Fix MI output for multi-location breakpoints") we get this error when building with --disable-gdbmi: CXXLD gdb /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:6358: error: undefined reference to 'mi_multi_location_breakpoint_output_fixed(ui_out*)' This is due to breakpoint.c using a function defined in mi/mi-main.c, even though mi/mi-main.c isn't included in the build. To fix it, use the flags feature of ui_out. mi_ui_out has the new fix_multi_location_breakpoint_output flag set for versions >= 3. Also, move the global variable fix_multi_location_breakpoint_output to breakpoint.c, so it can be read there even when we build without MI. I renamed it to fix_multi_location_breakpoint_output_globally so it doesn't clash with the new enumerator. gdb/ChangeLog: * breakpoint.h (fix_multi_location_breakpoint_output_globally): New variable declaration. * breakpoint.c (fix_multi_location_breakpoint_output_globally): New variable. (print_one_breakpoint): Use ui_out::test_flags and new global variable to compute use_fixed_output. * mi/mi-main.h (mi_multi_location_breakpoint_output_fixed): Remove. * mi/mi-main.c (fix_multi_location_breakpoint_output): Remove. (mi_multi_location_breakpoint_output_fixed): Remove. (mi_cmd_fix_multi_location_breakpoint_output): Adjust to set the new variable. * mi/mi-out.c (mi_ui_out::mi_ui_out): Set fix_multi_location_breakpoint_output flag if version >= 3. * ui-out.h (enum ui_out_flag) <fix_multi_location_breakpoint_output>: New enumerator.
2019-05-10 23:22:09 +02:00
2019-05-10 Simon Marchi <simon.marchi@efficios.com>
* breakpoint.h (fix_multi_location_breakpoint_output_globally):
New variable declaration.
* breakpoint.c (fix_multi_location_breakpoint_output_globally):
New variable.
(print_one_breakpoint): Use ui_out::test_flags and new global
variable to compute use_fixed_output.
* mi/mi-main.h (mi_multi_location_breakpoint_output_fixed):
Remove.
* mi/mi-main.c (fix_multi_location_breakpoint_output): Remove.
(mi_multi_location_breakpoint_output_fixed): Remove.
(mi_cmd_fix_multi_location_breakpoint_output): Adjust to set the
new variable.
* mi/mi-out.c (mi_ui_out::mi_ui_out): Set
fix_multi_location_breakpoint_output flag if version >= 3.
* ui-out.h (enum ui_out_flag)
<fix_multi_location_breakpoint_output>: New enumerator.
cc-with-tweaks: show dwz stderr and verify result When running the gdb.base/index-cache.exp test case with the cc-with-dwz-m board, I noticed that the final executable didn't actually contain a .gnu_debugaltlink section with the name of the external dwz file: $ readelf --debug-dump=links testsuite/outputs/gdb.base/index-cache/index-cache * empty * Running dwz by hand, I realized it's because dwz complains that the output .debug_info section is empty and fails: $ gcc ~/src/binutils-gdb/gdb/testsuite/gdb.base/index-cache.c -g3 -O0 -o a && cp a b $ dwz -m foo a b dwz: foo: .debug_info section not present $ echo $? 1 This is because index-cache.c is trivial (just an empty main) and dwz doesn't find anything to factor out to the dwz file. [1] I think that cc-with-tweaks should fail in this scenario: if the user asks for an external dwz file to be generated (the -m flag), then it should be an error if cc-with-tweaks doesn't manage to produce an executable with the proper link to this external dwz file. Otherwise, the test runs with a regular non-dwzified executable, which gives a false sense of security about whether the feature under test works with dwzified executables. So this patch adds checks for that after invoking dwz. It also removes the 2>&1 to allow the error message to be printed like so: Running /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/index-cache.exp ... gdb compile failed, dwz: /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/index-cache/index-cache.dwz: .debug_info section not present - In the -m case (multi-file compression), we check if the expected output file exists. - In the -z case (single-file compression), we check if the file contents has changed. This should catch cases where dwz doesn't modify the file because it's not worth it. It was chosen not to check for dwz's exit code, as it is not very reliable up to dwz 0.12. With this patch, fewer tests will pass than before with the cc-with-dwz and cc-with-dwz-m boards, but those were false positives anyway, as the test ran with regular executables. [1] Note that dwz has been patched by Tom de Vries to work correctly in this case, so we can use dwz master to run the test: https://sourceware.org/git/?p=dwz.git;a=commit;h=08becc8b33453b6d013a65e7eeae57fc1881e801 gdb/ChangeLog: * contrib/cc-with-tweaks.sh: Validate dwz's work.
2019-05-10 22:29:00 +02:00
2019-05-10 Simon Marchi <simon.marchi@efficios.com>
* contrib/cc-with-tweaks.sh: Validate dwz's work.
2019-05-10 Tom Tromey <tromey@adacore.com>
* ada-lang.c (catch_ada_completer): New function.
(_initialize_ada_language): Use it.
2019-05-10 Tom Tromey <tromey@adacore.com>
* thread.c (print_thread_info): Make "requested_threads" const.
* gdbthread.h (print_thread_info): Make "requested_threads"
const.
* ada-tasks.c (print_ada_task_info): Make "taskno_str" const.
* ada-lang.h (print_ada_task_info): Make "taskno_str" const.
2019-05-08 Tom Tromey <tom@tromey.com>
* gdbtypes.c (objfile_type_data): Change type.
(objfile_type, _initialize_gdbtypes): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* dwarf2-frame.c (dwarf2_frame_objfile_data): Change type.
(dwarf2_frame_find_fde, dwarf2_build_frame_info)
(_initialize_dwarf2_frame): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* objc-lang.c (objc_objfile_data): Change type.
(find_methods): Update.
(_initialize_objc_lang): Remove.
2019-05-08 Tom Tromey <tom@tromey.com>
* stabsread.c (rs6000_builtin_type_data): Change type.
(rs6000_builtin_type, _initialize_stabsread): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* mips-tdep.c (mips_pdr_data): Remove.
(_initialize_mips_tdep): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* hppa-tdep.c (hppa_objfile_priv_data): Change type.
(hppa_init_objfile_priv_data, read_unwind_info)
(find_unwind_entry, _initialize_hppa_tdep): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* elfread.c (elf_objfile_gnu_ifunc_cache_data): Change type.
(elf_gnu_ifunc_record_cache): Update. Don't allocate hash table
on obstack.
(elf_gnu_ifunc_resolve_by_cache, _initialize_elfread): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* mdebugread.c (basic_type_data): Change type.
(basic_type, _initialize_mdebugread): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* common/gdb_unique_ptr.h (struct noop_deleter): New.
2019-05-08 Tom Tromey <tom@tromey.com>
* nto-tdep.c (nto_inferior_data_reg): Change type.
(nto_inferior_data): Update.
(nto_inferior_data_cleanup, nto_new_inferior_data)
(_initialize_nto_tdep): Remove.
* nto-tdep.h (struct nto_inferior_data): Add initializers.
2019-05-08 Tom Tromey <tom@tromey.com>
* ada-lang.c (struct ada_inferior_data): Add initializers.
(ada_inferior_data): Change type.
(ada_inferior_data_cleanup): Remove.
(get_ada_inferior_data, ada_inferior_exit)
(struct ada_pspace_data): Add initializers, destructor.
(ada_pspace_data_handle): Change type.
(get_ada_pspace_data): Update.
(ada_pspace_data_cleanup): Remove.
2019-05-08 Tom Tromey <tom@tromey.com>
* coffread.c (struct coff_symfile_info): Add initializers.
(coff_objfile_data_key): Move lower. Change type.
(coff_symfile_init, coff_symfile_read, _initialize_coffread):
Update.
(coff_free_info): Remove.
2019-05-08 Tom Tromey <tom@tromey.com>
* fbsd-tdep.c (struct fbsd_pspace_data): Add initializers.
(fbsd_pspace_data_handle): Move lower. Change type.
(get_fbsd_pspace_data): Update.
(fbsd_pspace_data_cleanup): Remove.
(_initialize_fbsd_tdep): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* ada-tasks.c (ada_tasks_pspace_data_handle): Change type.
(get_ada_tasks_pspace_data): Update.
(ada_tasks_pspace_data_cleanup): Remove.
(_initialize_tasks): Update.
(ada_tasks_inferior_data_handle): Change type.
(get_ada_tasks_inferior_data): Update.
(ada_tasks_inferior_data_cleanup): Remove.
(struct ada_tasks_pspace_data): Add initializers.
2019-05-08 Tom Tromey <tom@tromey.com>
* symfile.h (struct sym_probe_fns) <sym_get_probes>: Change type.
* symfile-debug.c (debug_sym_get_probes): Change type.
* stap-probe.c (handle_stap_probe):
(stap_static_probe_ops::get_probes): Change type.
* probe.h (class static_probe_ops) <get_probes>: Change type.
* probe.c (class any_static_probe_ops) <get_probes>: Change type.
(parse_probes_in_pspace): Update.
(find_probes_in_objfile, find_probe_by_pc, collect_probes):
Update.
(any_static_probe_ops::get_probes): Change type.
* elfread.c (elfread_data): New typedef.
(probe_key): Change type.
(elf_get_probes): Likewise. Update.
(probe_key_free): Remove.
(_initialize_elfread): Update.
* dtrace-probe.c (class dtrace_static_probe_ops) <get_probes>:
Change type.
(dtrace_process_dof_probe, dtrace_process_dof)
(dtrace_static_probe_ops::get_probe): Change type.
2019-05-08 Tom Tromey <tom@tromey.com>
* xcoffread.c (struct xcoff_symfile_info): Rename from
coff_symfile_info. Add initializers.
(xcoff_objfile_data_key): Move lower. Change type.
(XCOFF_DATA): Rewrite.
(xcoff_free_info): Remove.
(xcoff_symfile_init, _initialize_xcoffread, read_xcoff_symtab)
(read_symbol, read_symbol_lineno, find_linenos, init_stringtab)
(xcoff_initial_scan): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* solib-svr4.c (struct svr4_info): Add initializers and
destructor.
<probes_table>: Now an htab_up.
(solib_svr4_pspace_data): Change type.
(free_probes_table): Simplify.
(~svr4_info): Rename from svr4_pspace_data_cleanup.
(get_svr4_info, probes_table_htab_remove_objfile_probes)
(probes_table_remove_objfile_probes, register_solib_event_probe)
(solib_event_probe_at, svr4_update_solib_event_breakpoint)
(_initialize_svr4_solib): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* remote.c (remote_pspace_data): Change type.
(remote_pspace_data_cleanup): Remove.
(get_remote_exec_file, set_pspace_remote_exec_file)
(_initialize_remote): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* breakpoint.c (breakpoint_objfile_key): Change type.
(get_breakpoint_objfile_data): Update.
(free_breakpoint_objfile_data): Remove.
(_initialize_breakpoint): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* linux-tdep.c (struct linux_info): Add initializers.
(linux_inferior_data): Move. Change type.
(invalidate_linux_cache_inf): Update.
(linux_inferior_data_cleanup): Remove.
(get_linux_inferior_data, _initialize_linux_tdep): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* auxv.c (auxv_inferior_data): Move. Change type.
(auxv_inferior_data_cleanup): Remove.
(invalidate_auxv_cache_inf): Rewrite.
(get_auxv_inferior_data, _initialize_auxv): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* symfile-debug.c (struct debug_sym_fns_data): Add initializers.
(symfile_debug_objfile_data_key): Change type.
(symfile_debug_installed, debug_qf_has_symbols)
(debug_qf_find_last_source_symtab)
(debug_qf_forget_cached_source_info)
(debug_qf_map_symtabs_matching_filename, debug_qf_lookup_symbol)
(debug_qf_print_stats, debug_qf_dump)
(debug_qf_expand_symtabs_for_function)
(debug_qf_expand_all_symtabs)
(debug_qf_expand_symtabs_with_fullname)
(debug_qf_map_matching_symbols)
(debug_qf_expand_symtabs_matching)
(debug_qf_find_pc_sect_compunit_symtab)
(debug_qf_map_symbol_filenames)
(debug_qf_find_compunit_symtab_by_address, debug_sym_get_probes)
(debug_sym_new_init, debug_sym_init, debug_sym_read)
(debug_sym_read_psymbols, debug_sym_finish, debug_sym_offsets)
(debug_sym_read_linetable, debug_sym_relocate): Update.
(symfile_debug_free_objfile): Remove.
(install_symfile_debug_logging, _initialize_symfile_debug):
Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* dwarf2read.h (struct dwarf2_per_objfile): Don't inherit from
allocate_on_obstack.
* dwarf2read.c (dwarf2_objfile_data_key): Change type.
(get_dwarf2_per_objfile): Update.
(set_dwarf2_per_objfile): Remove.
(dwarf2_has_info, dwarf2_get_section_info): Update.
(dwarf2_free_objfile): Remove.
(_initialize_dwarf2_read): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* auto-load.c (struct auto_load_pspace_info): Add destructor and
initializers.
<unsupported_script_warning_printed,
script_not_found_warning_printed>: Now bool.
(auto_load_pspace_data): Change type.
(~auto_load_pspace_info): Rename from
auto_load_pspace_data_cleanup.
(get_auto_load_pspace_data, init_loaded_scripts_info)
(clear_section_scripts, maybe_print_unsupported_script_warning)
(maybe_print_script_not_found_warning, _initialize_auto_load):
Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* objfiles.c (objfile_pspace_info): Add destructor and
initializers.
(objfiles_pspace_data): Change type.
(~objfile_pspace_info): Rename from objfiles_pspace_data_cleanup.
(get_objfile_pspace_data): Update.
(objfiles_bfd_data): Change type.
(get_objfile_bfd_data): Update.
(objfile_bfd_data_free, _initialize_objfiles): Remove.
2019-05-08 Tom Tromey <tom@tromey.com>
* break-catch-syscall.c (catch_syscall_inferior_data): Move.
Change type.
(get_catch_syscall_inferior_data): Update.
(catch_syscall_inferior_data_cleanup): Remove.
(_initialize_break_catch_syscall): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* inflow.c (struct terminal_info): Add destructor and
initializers.
(inflow_inferior_data): Change type.
(~terminal_info): Rename from inflow_inferior_data_cleanup.
(get_inflow_inferior_data, inflow_inferior_exit)
(swap_terminal_info, _initialize_inflow): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* target-dcache.c (target_dcache_cleanup): Remove.
(target_dcache_aspace_key): Change type.
(target_dcache_init_p, target_dcache_invalidate)
(target_dcache_get, target_dcache_get_or_init)
(_initialize_target_dcache): Update.
* dcache.h (struct dcache_deleter): New.
2019-05-08 Tom Tromey <tom@tromey.com>
* symtab.c (struct symbol_cache): Add destructor and
initializers.
(symbol_cache_key): Move. Change type.
(make_symbol_cache, free_symbol_cache): Remove.
(get_symbol_cache): Update.
(symbol_cache_cleanup): Remove.
(ALL_PSPACES, symbol_cache_flush)
(maintenance_print_symbol_cache)
(maintenance_print_symbol_cache_statistics, _initialize_symtab):
Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* symtab.c (struct main_info): Add destructor and initializers.
(main_progspace_key): Move. Change type.
(get_main_info): Update.
(main_info_cleanup): Remove.
(_initialize_symtab): Update.
2019-05-08 Tom Tromey <tom@tromey.com>
* registry.h (DECLARE_REGISTRY): Define the _key class.
2019-05-08 Andrew Burgess <andrew.burgess@embecosm.com>
* NEWS: Merge two 'New commands' sections.
When debugging a mixed Ada/C program using this scenario: - set print frame-arguements all - an Ada function named pck.call_me calls a C function named break_me - you put a breakpoint in break_me and the program reaches this breakpoint. Now display the backtrace: (gdb) bt #0 break_me () at [...] #1 0x000000000040243e in pck.call_me ( s={P_ARRAY = 0x7fffffffe21c, P_BOUNDS = 0x41e6e8}) at [...] whereas we should expect: (gdb) bt #0 break_me () at [...] #1 0x000000000040243e in pck.call_me (s="test") at [...] The problem is that GDB prints the S parameter in the pck.call_me Ada function using the current language, so the C one, because the program is stopped in a C function, whereas it should use the pck.call_me frame one. This behavior is ok when user manually changes the language but it's not the right one when language is auto. This patch fixes this problem so now when using auto language, all Ada frame arguments are printed using Ada like syntax when the frame is part of Ada code, even if the program is stopped in a frame using a different language. If the user explicitly sets a language (using "set language ...") then no change here, all the Ada frame arguments are printed using this language. gdb/ChangeLog: * ada-valprint.c (ada_val_print_gnat_array): Remove language parameter and use Ada language definition instead. (ada_val_print_ptr): Remove unused language parameter. (ada_val_print_num): Remove language parameter and use Ada language definition instead. (ada_val_print_enum, ada_val_print_flt): Remove unused language parameter. (ada_val_print_struct_union, ada_val_print_ref): Remove language parameter and use Ada language definition instead. (ada_val_print_1): Update all ada_val_print_xxx calls. Remove language parameter. (ada_val_print): Update ada_val_print_1 call. gdb/testsuite/ChangeLog: * gdb.ada/frame_arg_lang.exp: New testcase. * gdb.ada/frame_arg_lang/bla.adb: New file. * gdb.ada/frame_arg_lang/pck.ads: New file. * gdb.ada/frame_arg_lang/pck.adb: New file. * gdb.ada/frame_arg_lang/foo.c: New file. Tested on x86_64-linux, no regressions.
2019-05-08 18:55:44 +02:00
2019-05-08 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (ada_val_print_gnat_array): Remove language
parameter and use Ada language definition instead.
(ada_val_print_ptr): Remove unused language parameter.
(ada_val_print_num): Remove language parameter and use Ada language
definition instead.
(ada_val_print_enum, ada_val_print_flt): Remove unused language
parameter.
(ada_val_print_struct_union, ada_val_print_ref): Remove language
parameter and use Ada language definition instead.
(ada_val_print_1): Update all ada_val_print_xxx calls.
Remove language parameter.
(ada_val_print): Update ada_val_print_1 call.
2019-05-08 Tom Tromey <tromey@adacore.com>
* remote.c (remote_hw_watchpoint_limit)
(remote_hw_watchpoint_length_limit, remote_hw_breakpoint_limit):
Now static.
2019-05-08 Tom Tromey <tromey@adacore.com>
* maint.c (_initialize_maint_cmds): Move initialization code to
remote.c.
(watchdog, show_watchdog): Move to remote.c.
* remote.c (watchdog, show_watchdog): Move from maint.c. Make
"watchdog" static.
(_initialize_remote): Move initialization code from maint.c.
* defs.h (watchdog): Don't declare.
2019-05-08 Tom Tromey <tromey@adacore.com>
* tui/tui-interp.c: Include main.h.
* interps.c: Include main.h.
* main.h (interpreter_p): Declare.
* defs.h (interpreter_p): Don't declare.
2019-05-08 Tom Tromey <tromey@adacore.com>
* dwarf2loc.c: Include dwarf2read.h.
* defs.h (read_unsigned_leb128): Don't declare.
* dwarf2read.h (read_unsigned_leb128): Declare.
2019-05-08 Tom Tromey <tromey@adacore.com>
* utils.c (fputs_maybe_filtered): Call can_emit_style_escape as a
method.
2019-05-08 Tom Tromey <tromey@adacore.com>
* utils.c (fputs_maybe_filtered): Reset style after paging, even
when no wrap column is set.
2019-05-08 Tom Tromey <tromey@adacore.com>
* c-lang.c (c_get_string): Handle non-C-style arrays.
Change ptype/o to print bit offset Consider this short C example: struct inner { unsigned x; unsigned y : 3; unsigned z : 3; }; struct outer { unsigned char o : 3; struct inner i __attribute__ ((packed)); }; When I use "ptype/o" on this, I get: (gdb) ptype/o struct outer /* offset | size */ type = struct outer { /* 0: 5 | 1 */ unsigned char o : 3; /* XXX 5-bit hole */ /* 1 | 8 */ struct inner { /* 1 | 4 */ unsigned int x; /* 5:29 | 4 */ unsigned int y : 3; /* 5:26 | 4 */ unsigned int z : 3; /* XXX 2-bit padding */ /* XXX 3-byte padding */ /* total size (bytes): 8 */ } i; /* total size (bytes): 9 */ } In the location of "o" ("0: 5"), the "5" means "there are 5 bits left relative to the size of the underlying type. I find this very difficult to follow. On irc, Sergio said that this choice came because it is what pahole does. However, I think it's not very useful, and maybe is just an artifact of the way that DW_AT_bit_offset was defined in DWARF 3. This patch changes ptype/o to print the offset of a bitfield in a more natural way, that is, using the bit number according to the platform's bit numbering. With this patch, the output is now: (gdb) ptype/o struct outer /* offset | size */ type = struct outer { /* 0: 0 | 1 */ unsigned char o : 3; /* XXX 5-bit hole */ /* 1 | 8 */ struct inner { /* 1 | 4 */ unsigned int x; /* 5: 0 | 4 */ unsigned int y : 3; /* 5: 3 | 4 */ unsigned int z : 3; /* XXX 2-bit padding */ /* XXX 3-byte padding */ /* total size (bytes): 8 */ } i; /* total size (bytes): 9 */ } This is better, IMO, because now the "offset" of a bitfield is consistent with the offset of an ordinary member, referring to its offset from the start of the structure. gdb/ChangeLog 2019-05-08 Tom Tromey <tromey@adacore.com> * typeprint.c (print_offset_data::update): Print the bit offset, not the number of bits remaining. gdb/doc/ChangeLog 2019-05-08 Tom Tromey <tromey@adacore.com> * gdb.texinfo (Symbols): Document change to ptype/o. gdb/testsuite/ChangeLog 2019-05-08 Tom Tromey <tromey@adacore.com> * gdb.base/ptype-offsets.exp: Update tests.
2019-04-29 17:55:56 +02:00
2019-05-08 Tom Tromey <tromey@adacore.com>
* typeprint.c (print_offset_data::update): Print the bit offset,
not the number of bits remaining.
2019-05-08 Tom Tromey <tromey@adacore.com>
* typeprint.c (print_offset_data::maybe_print_hole): Add extra
padding at end of comment.
2019-05-08 Tom Tromey <tromey@adacore.com>
* dwarf2loc.c (dwarf2_evaluate_property) <PROP_ADDR_OFFSET>:
Compare main types.
2019-05-06 Tom Tromey <tom@tromey.com>
* common/scoped_mmap.c: Include common-defs.h.
* common/scoped_mmap.h: Don't include config.h.
2019-05-04 Tom Tromey <tom@tromey.com>
* aarch64-tdep.c (stack_item_t): Remove typedef and DEF_VEC.
(struct aarch64_call_info): Add initializers.
<si>: Now a std::vector.
(pass_on_stack, aarch64_push_dummy_call): Update.
2019-05-04 Simon Marchi <simon.marchi@efficios.com>
Tom Tromey <tom@tromey.com>
* ppc-linux-nat.c (thread_points_p): Remove typedef and DEF_VEC.
(ppc_threads): Now a std::vector. Now static.
(hwdebug_find_thread_points_by_tid)
(ppc_linux_nat_target::low_new_thread, ppc_linux_thread_exit):
Update.
2019-05-04 Tom Tromey <tom@tromey.com>
* arc-tdep.c (arc_tdesc_init): Return bool.
2019-05-04 Tom Tromey <tom@tromey.com>
* arm-linux-nat.c (arm_linux_nat_target::can_use_hw_breakpoint):
Use gdb_assert_not_reached.
2019-05-04 Tom Tromey <tom@tromey.com>
* compile/compile-cplus-types.c (compile_cplus_convert_enum): Use
"false".
2019-05-04 Tom Tromey <tom@tromey.com>
* arc-tdep.c (arc_tdesc_init): Use bool.
2019-05-04 Tom Tromey <tom@tromey.com>
* stack.c (select_frame_for_mi): Use "false", not "FALSE".
2019-05-04 Tom Tromey <tom@tromey.com>
* cli/cli-cmds.c (valid_command_p): Return bool.
2019-05-04 Tom Tromey <tom@tromey.com>
* cli/cli-decode.c (valid_user_defined_cmd_name_p): Return bool.
* command.h (valid_user_defined_cmd_name_p): Channge return type.
2019-05-04 Raul Tambre <raul@tambre.ee>
* python/lib/gdb/prompt.py (_ExtendedPrompt)
<before_prompt_hook, get_show_string>: Fix incorrect use of 'is'
operator for comparison.
2019-05-04 Tom Tromey <tom@tromey.com>
* psymtab.c (psymbol_name_matches, match_partial_symbol)
(lookup_partial_symbol, print_partial_symbols)
(recursively_search_psymtabs, sort_pst_symbols, psymbol_hash)
(psymbol_compare): Update.
(add_psymbol_to_bcache): Clear the entire psymbol.
(maintenance_check_psymtabs): Update.
* psympriv.h (struct partial_symbol): Don't derive from
general_symbol_info.
<obj_section, unrelocated_address, address,
set_unrelocated_address>: Update.
<ginfo>: New member.
* dwarf-index-write.c (write_psymbols, debug_names::insert)
(debug_names::write_psymbols): Update.
2019-05-04 Tom de Vries <tdevries@suse.de>
* contrib/cc-with-tweaks.sh: Support -n arg.
2019-05-04 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* corelow.c (core_target::detach): Ensure frame cache and
register caches are cleared.
inferior.c (exit_inferior_1): Likewise.
2019-05-03 Sandra Loosemore <sandra@codesourcery.com>
Tom Tromey <tom@tromey.com>
* dictionary.c (collate_pending_symbols_by_language): Remove
"struct" from foreach.
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_in_objfile_from_linkage_name): Remove "struct" from
foreach.
* ser-tcp.c (net_open): Remove "struct" from foreach.
* objfiles.c (objfile_relocate, objfile_rebase)
(objfile_has_symbols): Remove "struct" from foreach.
* minsyms.c (lookup_minimal_symbol_by_pc_section): Remove "struct"
from foreach.
* dwarf2read.c (handle_struct_member_die): Remove "struct" from
foreach.
* darwin-nat.c (thread_info_from_private_thread_info): Remove
"struct" from foreach.
* ada-lang.c (create_excep_cond_exprs)
(ada_exception_catchpoint_cond_string): Remove "struct" from
foreach.
2019-05-03 Tom Tromey <tromey@adacore.com>
* ada-exp.y (convert_char_literal): Check suffix of each
enumerator.
2019-05-03 Dilyan Palauzov <dilyan.palauzov@aegee.org>
PR ada/21406:
* ada-exp.y (yywrap): Don't define.
* ada-lex.l (%option): Add noyywrap
(yywrap): Remove.
2019-05-03 Eli Zaretskii <eliz@gnu.org>
* common/common-defs.h [__MINGW32__ || __CYGWIN__]: Define
_WIN32_WINNT to the XP level, unless already defined to a higher
level.
* unittests/parse-connection-spec-selftests.c:
* ser-tcp.c:
* common/netstuff.c [USE_WIN32API]: Remove the _WIN32_WINNT
override.
* symfile.c (find_separate_debug_file): Remove colon from the
drive spec of DOS/Windows file names of the target, so that the
file name produced from DEBUGDIR and the target's directory will
be valid on DOS/Windows systems.
2019-05-02 Andrew Burgess <andrew.burgess@embecosm.com>
* rust-lang.c (val_print_struct): Handle printing structures
containing strings.
2019-05-02 Tom Tromey <tromey@adacore.com>
* valarith.c (_initialize_valarith): Remove.
2019-05-01 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_value_primitive_field): Treat more fields as
bitfields.
2019-05-01 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_value_assign): Correctly compute starting offset
for big-endian copies.
2019-04-30 Ali Tamur <tamur@google.com>
* gdb/dwarf2read.c (read_3_bytes): New declaration.
(read_attribute_value): Added DW_FORM_strx1-4 cases.
(read_3_bytes): New function.
2019-04-30 Joel Brobecker <brobecker@adacore.com>
* windows-nat.c (main_thread_id): Delete.
(handle_output_debug_string): Replace main_thread_id by
current_event.dwThreadId.
(fake_create_process): Likewise.
(get_windows_debug_event) <CREATE_PROCESS_DEBUG_EVENT>:
Do not set main_thread_id.
<LOAD_DLL_DEBUG_EVENT>: Replace main_thread_id by
current_event.dwThreadId.
<UNLOAD_DLL_DEBUG_EVENT>: Likewise.
(Windows) fix thr != nullptr assert failure in delete_thread_1 We have observed that GDB would randomly trip the following assertion failure when debugging on Windows. When allowing the program to run until the inferior exits, we occasionally see: (gdb) cont Continuing. [Thread 48192.0xd100 exited with code 1] [Thread 48192.0x10ad8 exited with code 1] [Thread 48192.0x36e28 exited with code 0] [Thread 48192.0x52be4 exited with code 0] [Thread 48192.0x5aa40 exited with code 0] ../../src/gdb/thread.c:453: internal-error: void delete_thread_1(thread_inf o*, bool): Assertion `thr != nullptr' failed. Running the same scenario with some additional traces enabled... (gdb) set verbose (gdb) set debugevents ... allows us to understand what the issue is. To understand, we need to first look at the events received when starting the program, and in particular which threads got created how. First, we get a CREATE_PROCESS_DEBUG_EVENT for tid=0x442a8: gdb: kernel event for pid=317536 tid=0x442a8 code=CREATE_PROCESS_DEBUG_EVENT) Shortly after, we get some CREATE_THREAD_DEBUG_EVENT events, one of them being for tid=0x4010c: gdb: kernel event for pid=317536 tid=0x4010c code=CREATE_THREAD_DEBUG_EVENT) Fast forward a bit of debugging, and we do a "cont" as above, at which point the programs reaches the end, and the system reports "exit" events. The first interesting one is the following: gdb: kernel event for pid=317536 tid=0x442a8 code=EXIT_THREAD_DEBUG_EVENT) This is reporting a thread-exit event for a thread whose tid is the TID of what we call the "main thread". That's the thread that was created when we received the CREATE_PROCESS_DEBUG_EVENT notification, and whose TID is actually stored in a global variable named main_thread_id. This is not something we expected, as the assumption we made was that the main thread would exit last, and we would be notified of it via an EXIT_PROCESS_DEBUG_EVENT. But apparently, this is not always true, at least on Windows Server 2012 and 2016 where this issue has been observed happening randomly. The consequence of the above notification is that we call windows_delete_thread for that thread, which removes it from our list of known threads. And a little bit later, then we then get the EXIT_PROCESS_DEBUG_EVENT, and we can see that the associated tid is not the main_thread_id, but rather the tid of one of the threads that was created during the lifetime of the program, in this case tid=0x4010c: gdb: kernel event for pid=317536 tid=0x4010c code=EXIT_PROCESS_DEBUG_EVENT) And the debug trace printed right after shows why we're crashing: [Deleting Thread 317536.0x442a8] We are trying to delete the thread whose tid=0x442a8, which is the main_thread_id! As we have already deleted that thread before, the search for it returns a nullptr, which then trips the assertion check in delete_thread_1. This commit fixes this issue. It ignores the open question of what to do with the main_thread_id global, particularly after that thread has been removed from our list of threads. This will be dealt with as a separate patch, to allow cherry-picking this patch into a release branch. For now, we fix the code so as to avoid this crash. gdb/ChangeLog: * windows-nat.c (get_windows_debug_event) <EXIT_PROCESS_DEBUG_EVENT>: Use current_event.dwThreadId instead of main_thread_id.
2019-04-30 22:59:17 +02:00
2019-04-30 Joel Brobecker <brobecker@adacore.com>
* windows-nat.c (get_windows_debug_event) <EXIT_PROCESS_DEBUG_EVENT>:
Use current_event.dwThreadId instead of main_thread_id.
2019-04-30 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_lookup_simple_minsyms): New function.
(create_excep_cond_exprs): Iterate over program spaces.
(ada_exception_catchpoint_cond_string): Examine all minimal
symbols for exception types.
2019-04-30 Tom Tromey <tromey@adacore.com>
PR c++/24470:
* dwarf2read.c (process_structure_scope): Handle case where type
has template parameters but no symbol was created.
2019-04-30 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
* f-typeprint.c (f_type_print_base): Print 'allocatable' type
qualifier.
* gdbtypes.h (TYPE_IS_ALLOCATABLE): Define.
2019-04-30 Andrew Burgess <andrew.burgess@embecosm.com>
* f-typeprint.c (f_print_type): Update rules for printing
whitespace.
(f_type_print_varspec_suffix): Likewise.
2019-04-30 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
* f-typeprint.c (f_type_print_varspec_suffix): Handle printing
function arguments.
2019-04-30 Andrew Burgess <andrew.burgess@embecosm.com>
* f-lang.c (build_fortran_types): Change name of void type to
lower case.
* f-typeprint.c (f_type_print_base): Print the name of the void
type, rather than a fixed string.
* f-valprint.c (f_decorations): Use lower case void string.
2019-04-30 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
* dwarf2read.c (dwarf2_init_complex_target_type): Use different
types for Fortran.
2019-04-30 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
David Lecomber <david.lecomber@arm.com>
* f-exp.y (BINOP_INTRINSIC): New token.
(exp): New parser rule handling BINOP_INTRINSIC.
(f77_keywords): Add new builtin procedures.
* f-lang.c (evaluate_subexp_f): Handle BINOP_MOD, UNOP_FORTRAN_CEILING,
UNOP_FORTRAN_FLOOR, BINOP_FORTRAN_MODULO, BINOP_FORTRAN_CMPLX.
(operator_length_f): Handle UNOP_FORTRAN_CEILING,
UNOP_FORTRAN_FLOOR, BINOP_FORTRAN_MODULO, BINOP_FORTRAN_CMPLX.
(print_unop_subexp_f): New function.
(print_binop_subexp_f): New function.
(print_subexp_f): Handle UNOP_FORTRAN_CEILING, UNOP_FORTRAN_FLOOR,
BINOP_FORTRAN_MODULO, BINOP_FORTRAN_CMPLX.
(dump_subexp_body_f): Likewise.
(operator_check_f): Likewise.
* fortran-operator.def: Add UNOP_FORTRAN_CEILING, UNOP_FORTRAN_FLOOR,
BINOP_FORTRAN_MODULO, BINOP_FORTRAN_CMPLX
gdb/fortran: Introduce fortran-operator.def file Future commits will add more Fortran specific expression operators. In preparation for these new operators, this commit adds a new fortran-operator.def file similar to how GDB already has ada-operator.def. I've moved UNOP_KIND the Fortran specific operator I introduced in commit 4d00f5d8f6c4 into this file, and renamed it to make it clearer that the operator is Fortran specific. I've then updated the Fortran exp_descriptor table (exp_descriptor_f) to use entirely Fortran specific functions that now handle UNOP_FORTRAN_KIND (the new name for UNOP_KIND). There should be no visible changes for standard users after this commit, though for developers, the output when 'set debug expression 1' is now better, before: (gdb) p kind (l1) Dump of expression @ 0x2ccc7a0, before conversion to prefix form: Language fortran, 5 elements, 16 bytes each. Index Opcode Hex Value String Value 0 OP_VAR_VALUE 42 *............... 1 OP_NULL 47730176 .N.............. 2 BINOP_INTDIV 47729184 J.............. 3 OP_VAR_VALUE 42 *............... 4 UNOP_KIND 78 N............... Dump of expression @ 0x2ccc7a0, after conversion to prefix form: Expression: `Invalid expression (gdb) and after: (gdb) p kind (l1) Dump of expression @ 0x294d0b0, before conversion to prefix form: Language fortran, 5 elements, 16 bytes each. Index Opcode Hex Value String Value 0 OP_VAR_VALUE 40 (............... 1 unknown opcode: 224 44088544 ................ 2 unknown opcode: 208 44087504 ................ 3 OP_VAR_VALUE 40 (............... 4 UNOP_FORTRAN_KIND 119 w............... Dump of expression @ 0x294d0b0, after conversion to prefix form: Expression: `KIND(test::l1)' Language fortran, 5 elements, 16 bytes each. 0 UNOP_FORTRAN_KIND 1 OP_VAR_VALUE Block @0x2a0bce0, symbol @0x2a0b8d0 (l1) $1 = 1 (gdb) gdb/ChangeLog: * gdb/expprint.c (dump_subexp_body_standard): Remove use of UNOP_KIND. * gdb/expression.h (exp_opcode): Include 'fortran-operator.def'. * gdb/f-exp.y (exp): Rename UNOP_KIND to UNOP_FORTRAN_KIND. * gdb/f-lang.c (evaluate_subexp_f): Likewise. (operator_length_f): New fuction. (print_subexp_f): New function. (op_name_f): New function. (dump_subexp_body_f): New function. (operator_check_f): New function. (exp_descriptor_f): Replace standard expression handling functions with new functions. * gdb/fortran-operator.def: New file. * gdb/parse.c (operator_length_standard): Remove use of UNOP_KIND. * gdb/std-operator.def: Remove UNOP_KIND.
2019-04-01 22:01:09 +02:00
2019-04-30 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/expprint.c (dump_subexp_body_standard): Remove use of
UNOP_KIND.
* gdb/expression.h (exp_opcode): Include 'fortran-operator.def'.
* gdb/f-exp.y (exp): Rename UNOP_KIND to UNOP_FORTRAN_KIND.
* gdb/f-lang.c (evaluate_subexp_f): Likewise.
(operator_length_f): New fuction.
(print_subexp_f): New function.
(op_name_f): New function.
(dump_subexp_body_f): New function.
(operator_check_f): New function.
(exp_descriptor_f): Replace standard expression handling functions
with new functions.
* gdb/fortran-operator.def: New file.
* gdb/parse.c (operator_length_standard): Remove use of UNOP_KIND.
* gdb/std-operator.def: Remove UNOP_KIND.
2019-04-30 Andrew Burgess <andrew.burgess@embecosm.com>
* std-operator.def: Remove unbalanced, stray double quote
character.
gdb: Introduce 'print max-depth' feature Introduce a new print setting max-depth which can be set with 'set print max-depth DEPTH'. The default value of DEPTH is 20, but this can also be set to unlimited. When GDB is printing a value containing nested structures GDB will stop descending at depth DEPTH. Here is a small example: typedef struct s1 { int a; } s1; typedef struct s2 { s1 b; } s2; typedef struct s3 { s2 c; } s3; typedef struct s4 { s3 d; } s4; s4 var = { { { { 3 } } } }; The following table shows how various depth settings affect printing of 'var': | Depth Setting | Result of 'p var' | |---------------+--------------------------------| | Unlimited | $1 = {d = {c = {b = {a = 3}}}} | | 4 | $1 = {d = {c = {b = {a = 3}}}} | | 3 | $1 = {d = {c = {b = {...}}}} | | 2 | $1 = {d = {c = {...}}} | | 1 | $1 = {d = {...}} | | 0 | $1 = {...} | Only structures, unions, and arrays are replaced in this way, scalars and strings are not replaced. The replacement is counted from the level at which you print, not from the top level of the structure. So, consider the above example and this GDB session: (gdb) set print max-depth 2 (gdb) p var $1 = {d = {c = {...}}} (gdb) p var.d $2 = {c = {b = {...}}} (gdb) p var.d.c $3 = {b = {a = 3}} Setting the max-depth to 2 doesn't prevent the user from exploring deeper into 'var' by asking for specific sub-fields to be printed. The motivation behind this feature is to try and give the user more control over how much is printed when examining large, complex data structures. The default max-depth of 20 means that there is a change in GDB's default behaviour. Someone printing a data structure with 20 levels of nesting will now see '{...}' instead of their data, they would need to adjust the max depth, or call print again naming a specific field in order to dig deeper into their data structure. If this is considered a problem then we could increase the default, or even make the default unlimited. This commit relies on the previous commit, which added a new field to the language structure, this new field was a string that contained the pattern that should be used when a structure/union/array is replaced in the output, this allows languages to use a syntax that is more appropriate, mostly this will be selecting the correct types of bracket '(...)' or '{...}', both of which are currently in use. This commit should have no impact on MI output, expressions are printed through the MI using -var-create and then -var-list-children. As each use of -var-list-children only ever displays a single level of an expression then the max-depth setting will have no impact. This commit also adds the max-depth mechanism to the scripting language pretty printers following basically the same rules as for the built in value printing. One quirk is that when printing a value using the display hint 'map', if the keys of the map are structs then GDB will hide the keys one depth level after it hides the values, this ensures that GDB produces output like this: $1 = map_object = {[{key1}] = {...}, [{key2}] = {...}} Instead of this less helpful output: $1 = map_object = {[{...}] = {...}, [{...}] = {...}} This is covered by the new tests in gdb.python/py-nested-maps.exp. gdb/ChangeLog: * cp-valprint.c (cp_print_value_fields): Allow an additional level of depth when printing anonymous structs or unions. * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Don't print either the top-level value, or the children if the max-depth is exceeded. (ppscm_print_children): When printing the key of a map, allow one extra level of depth. * python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Don't print either the top-level value, or the children if the max-depth is exceeded. (print_children): When printing the key of a map, allow one extra level of depth. * python/py-value.c (valpy_format_string): Add max_depth keyword. * valprint.c: (PRINT_MAX_DEPTH_DEFAULT): Define. (user_print_options): Initialise max_depth field. (val_print_scalar_or_string_type_p): New function. (val_print): Check to see if the max depth has been reached. (val_print_check_max_depth): Define new function. (show_print_max_depth): New function. (_initialize_valprint): Add 'print max-depth' option. * valprint.h (struct value_print_options) <max_depth>: New field. (val_print_check_max_depth): Declare new function. * NEWS: Document new feature. gdb/doc/ChangeLog: * gdb.texinfo (Print Settings): Document 'print max-depth'. * guile.texi (Guile Pretty Printing API): Document that 'print max-depth' can effect the display of a values children. * python.texi (Pretty Printing API): Likewise. (Values From Inferior): Document max_depth keyword. gdb/testsuite/ChangeLog: * gdb.base/max-depth.c: New file. * gdb.base/max-depth.exp: New file. * gdb.python/py-nested-maps.c: New file. * gdb.python/py-nested-maps.exp: New file. * gdb.python/py-nested-maps.py: New file. * gdb.python/py-format-string.exp (test_max_depth): New proc. (test_all_common): Call test_max_depth. * gdb.fortran/max-depth.exp: New file. * gdb.fortran/max-depth.f90: New file. * gdb.go/max-depth.exp: New file. * gdb.go/max-depth.go: New file. * gdb.modula2/max-depth.exp: New file. * gdb.modula2/max-depth.c: New file. * lib/gdb.exp (get_print_expr_at_depths): New proc.
2019-03-21 16:13:23 +01:00
2019-04-29 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
Daniel Everett <daniel.everett@arm.com>
Nick Forrington <nick.forrington@arm.com>
Richard Bunt <richard.bunt@arm.com>
* cp-valprint.c (cp_print_value_fields): Allow an additional level
of depth when printing anonymous structs or unions.
* guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer):
Don't print either the top-level value, or the children if the
max-depth is exceeded.
(ppscm_print_children): When printing the key of a map, allow one
extra level of depth.
* python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Don't
print either the top-level value, or the children if the max-depth
is exceeded.
(print_children): When printing the key of a map, allow one extra
level of depth.
* python/py-value.c (valpy_format_string): Add max_depth keyword.
* valprint.c: (PRINT_MAX_DEPTH_DEFAULT): Define.
(user_print_options): Initialise max_depth field.
(val_print_scalar_or_string_type_p): New function.
(val_print): Check to see if the max depth has been reached.
(val_print_check_max_depth): Define new function.
(show_print_max_depth): New function.
(_initialize_valprint): Add 'print max-depth' option.
* valprint.h (struct value_print_options) <max_depth>: New field.
(val_print_check_max_depth): Declare new function.
* NEWS: Document new feature.
gdb: Introduce new language field la_is_string_type_p This commit is preparation work for the next commit, and by itself makes no user visible change to GDB. I've split this work into a separate commit in order to make code review easier. This commit adds a new field 'la_is_string_type_p' to the language struct, this predicate will return true if a type is a string type for the given language. Some languages already have a "is this a string" predicate that I was able to reuse, while for other languages I've had to add a new predicate. In this case I took inspiration from the value printing code for that language - what different conditions would result in printing something as a string. A default "is this a string" method has also been added that looks for TYPE_CODE_STRING, this is the fallback I've used for a couple of languages. In this commit I add the new field and initialise it for each language, however at this stage the new field is never used. gdb/ChangeLog: * ada-lang.c (ada_language_defn): Initialise new field. * c-lang.c (c_is_string_type_p): New function. (c_language_defn): Initialise new field. (cplus_language_defn): Initialise new field. (asm_language_defn): Initialise new field. (minimal_language_defn): Initialise new field. * c-lang.h (c_is_string_type_p): Declare new function. * d-lang.c (d_language_defn): Initialise new field. * f-lang.c (f_is_string_type_p): New function. (f_language_defn): Initialise new field. * go-lang.c (go_is_string_type_p): New function. (go_language_defn): Initialise new field. * language.c (default_is_string_type_p): New function. (unknown_language_defn): Initialise new field. (auto_language_defn): Initialise new field. * language.h (struct language_defn) <la_is_string_type_p>: New member variable. (default_is_string_type_p): Declare new function. * m2-lang.c (m2_language_defn): Initialise new field. * objc-lang.c (objc_language_defn): Initialise new field. * opencl-lang.c (opencl_language_defn): Initialise new field. * p-lang.c (pascal_is_string_type_p): New function. (pascal_language_defn): Initialise new field. * rust-lang.c (rust_is_string_type_p): New function. (rust_language_defn): Initialise new field.
2019-04-10 00:06:41 +02:00
2019-04-29 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_language_defn): Initialise new field.
* c-lang.c (c_is_string_type_p): New function.
(c_language_defn): Initialise new field.
(cplus_language_defn): Initialise new field.
(asm_language_defn): Initialise new field.
(minimal_language_defn): Initialise new field.
* c-lang.h (c_is_string_type_p): Declare new function.
* d-lang.c (d_language_defn): Initialise new field.
* f-lang.c (f_is_string_type_p): New function.
(f_language_defn): Initialise new field.
* go-lang.c (go_is_string_type_p): New function.
(go_language_defn): Initialise new field.
* language.c (default_is_string_type_p): New function.
(unknown_language_defn): Initialise new field.
(auto_language_defn): Initialise new field.
* language.h (struct language_defn) <la_is_string_type_p>: New
member variable.
(default_is_string_type_p): Declare new function.
* m2-lang.c (m2_language_defn): Initialise new field.
* objc-lang.c (objc_language_defn): Initialise new field.
* opencl-lang.c (opencl_language_defn): Initialise new field.
* p-lang.c (pascal_is_string_type_p): New function.
(pascal_language_defn): Initialise new field.
* rust-lang.c (rust_is_string_type_p): New function.
(rust_language_defn): Initialise new field.
2019-04-29 Andrew Burgess <andrew.burgess@embecosm.com>
* language.h (struct language_defn) <la_struct_too_deep_ellipsis>:
New field.
* ada-lang.c (ada_language_defn): Initialise new field.
* c-lang.c (c_language_defn): Likewise.
(cplus_language_defn): Likewise.
(asm_language_defn): Likewise.
(minimal_language_defn): Likewise.
* d-lang.c (d_language_defn): Likewise.
* f-lang.c (f_language_defn): Likewise.
* go-lang.c (go_language_defn): Likewise.
* language.c (unknown_language_defn): Likewise.
(auto_language_defn): Likewise.
* m2-lang.c (m2_language_defn): Likewise.
* objc-lang.c (objc_language_defn): Likewise.
* opencl-lang.c (opencl_language_defn): Likewise.
* p-lang.c (pascal_language_defn): Likewise.
* rust-lang.c (rust_language_defn): Likewise.
2019-04-29 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_is_character_type): Change return type to bool.
(ada_is_string_type): Likewise.
* ada-lang.h (ada_is_character_type): Update declaration
(ada_is_string_type): Likewise.
2019-04-27 Philippe Waroquiers <philippe.waroquiers@skynet.be>
Support style in 'frame|thread apply'
* gdbcmd.h (execute_command_to_string): New term_out parameter.
* record.c (record_start, record_stop): Update callers of
execute_command_to_string with false.
* guile/guile.c (gdbscm_execute_gdb_command): Likewise.
* ui-file.h (class ui_file): New term_out and can_emit_style_escape
methods.
(class string_file): New constructor with term_out parameter.
Override methods term_out and can_emit_style_escape. New member
term_out.
(class stdio_file): Override can_emit_style_escape.
(class tee_file): Override term_out and can_emit_style_escape.
* utils.h (can_emit_style_escape): Remove.
* utils.c (can_emit_style_escape): Likewise.
Update all callers of can_emit_style_escape (SOMESTREAM) to
SOMESTREAM->can_emit_style_escape.
* source-cache.c (source_cache::get_source_lines): Likewise.
* stack.c (frame_apply_command_count): Call execute_command_to_string
passing the term_out characteristic of the current gdb_stdout.
* thread.c (thr_try_catch_cmd): Likewise.
* top.c (execute_command_to_string): pass term_out parameter
to construct the string_file for the command output.
* ui-file.c (term_cli_styling): New function (most code moved
from utils.c can_emit_style_escape).
(string_file::string_file, string_file::can_emit_style_escape,
stdio_file::can_emit_style_escape, tee_file::term_out,
tee_file::can_emit_style_escape): New functions.
2019-04-27 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Mention the new set|show may-call-functions.
* infcall.c (may_call_functions_p): New variable.
(show_may_call_functions_p): New function.
(call_function_by_hand_dummy): Throws an error if not
may-call-functions.
(_initialize_infcall): Call add_setshow_boolean_cmd for
may-call-functions.
2019-04-25 Keith Seitz <keiths@redhat.com>
PR c++/24367
* cp-support.c (inspect_type): Don't attempt substitutions
of symbol with the same name.
2019-04-25 Tom Tromey <tromey@adacore.com>
PR gdb/24475:
* event-top.c (gdb_rl_callback_handler): Make "gdb_rl_expt"
static.
Make exception handling more efficient This makes exception handling more efficient in a few spots, through the use of const- and rvalue-references. I wrote this patch by commenting out the gdb_exception copy constructor and then examining the resulting error messages one by one, introducing the use of std::move where appropriate. gdb/ChangeLog 2019-04-25 Tom Tromey <tromey@adacore.com> * xml-support.c (struct gdb_xml_parser) <set_error>: Take an rvalue reference. (gdb_xml_start_element_wrapper, gdb_xml_end_element_wrapper) (gdb_xml_parser::parse): Use std::move. * python/python-internal.h (gdbpy_convert_exception): Take a const reference. * python/py-value.c (valpy_getitem, valpy_nonzero): Use std::move. * python/py-utils.c (gdbpy_convert_exception): Take a const reference. * python/py-inferior.c (infpy_write_memory, infpy_search_memory): Use std::move. * python/py-breakpoint.c (bppy_set_condition, bppy_set_commands): Use std::move. * mi/mi-main.c (mi_print_exception): Take a const reference. * main.c (handle_command_errors): Take a const reference. * linespec.c (parse_linespec): Use std::move. * infcall.c (run_inferior_call): Use std::move. (call_function_by_hand_dummy): Use std::move. * exec.c (try_open_exec_file): Use std::move. * exceptions.h (exception_print, exception_fprintf) (exception_print_same): Update. * exceptions.c (print_exception, exception_print) (exception_fprintf, exception_print_same): Change parameters to const reference. * event-top.c (gdb_rl_callback_read_char_wrapper): Update. * common/new-op.c: Use std::move. * common/common-exceptions.h (struct gdb_exception): Add move constructor. (struct gdb_exception_error, struct gdb_exception_quit, struct gdb_quit_bad_alloc): Change constructor to move constructor. (throw_exception): Change parameter to rvalue reference. * common/common-exceptions.c (throw_exception): Take rvalue reference. * cli/cli-interp.c (safe_execute_command): Use std::move. * breakpoint.c (insert_bp_location, location_to_sals): Use std::move.
2019-04-24 14:50:06 +02:00
2019-04-25 Tom Tromey <tromey@adacore.com>
* xml-support.c (struct gdb_xml_parser) <set_error>: Take an
rvalue reference.
(gdb_xml_start_element_wrapper, gdb_xml_end_element_wrapper)
(gdb_xml_parser::parse): Use std::move.
* python/python-internal.h (gdbpy_convert_exception): Take a const
reference.
* python/py-value.c (valpy_getitem, valpy_nonzero): Use
std::move.
* python/py-utils.c (gdbpy_convert_exception): Take a const
reference.
* python/py-inferior.c (infpy_write_memory, infpy_search_memory):
Use std::move.
* python/py-breakpoint.c (bppy_set_condition, bppy_set_commands):
Use std::move.
* mi/mi-main.c (mi_print_exception): Take a const reference.
* main.c (handle_command_errors): Take a const reference.
* linespec.c (parse_linespec): Use std::move.
* infcall.c (run_inferior_call): Use std::move.
(call_function_by_hand_dummy): Use std::move.
* exec.c (try_open_exec_file): Use std::move.
* exceptions.h (exception_print, exception_fprintf)
(exception_print_same): Update.
* exceptions.c (print_exception, exception_print)
(exception_fprintf, exception_print_same): Change parameters to
const reference.
* event-top.c (gdb_rl_callback_read_char_wrapper): Update.
* common/new-op.c: Use std::move.
* common/common-exceptions.h (struct gdb_exception): Add move
constructor.
(struct gdb_exception_error, struct gdb_exception_quit, struct
gdb_quit_bad_alloc): Change constructor to move constructor.
(throw_exception): Change parameter to rvalue reference.
* common/common-exceptions.c (throw_exception): Take rvalue
reference.
* cli/cli-interp.c (safe_execute_command): Use std::move.
* breakpoint.c (insert_bp_location, location_to_sals): Use
std::move.
2019-04-25 Tom Tromey <tromey@adacore.com>
* guile/scm-exception.c (gdbscm_scm_from_gdb_exception)
(gdbscm_throw_gdb_exception): Take a gdbscm_gdb_exception.
* guile/scm-block.c, guile/scm-breakpoint.c, guile/scm-cmd.c,
guile/scm-disasm.c, guile/scm-frame.c, guile/scm-lazy-string.c,
guile/scm-math.c, guile/scm-param.c, guile/scm-ports.c,
guile/scm-symbol.c, guile/scm-symtab.c, guile/scm-type.c,
guile/scm-value.c: Use unpack.
* guile/guile-internal.h (gdbscm_scm_from_gdb_exception): Take a
gdbscm_gdb_exception.
(gdbscm_throw_gdb_exception): Likewise.
(struct gdbscm_gdb_exception): New.
(unpack): New function.
(gdbscm_wrap): Use unpack.
2019-04-25 Tom Tromey <tromey@adacore.com>
* event-top.c (gdb_rl_callback_read_char_wrapper_noexcept)
(gdb_rl_callback_handler): Use std::move.
* common/common-exceptions.h (struct gdb_exception): Add move
assignment operator.
(throw_exception_sjlj): Change "exception" to const reference.
* common/common-exceptions.c (exceptions_state_mc_catch): Update.
(throw_exception_sjlj): Change "exception" to const reference.
2019-04-25 Tom Tromey <tromey@adacore.com>
* xml-support.c (gdb_xml_parser::gdb_xml_parser): Update.
* python/py-value.c (valpy_getitem, valpy_nonzero): Update.
* python/py-inferior.c (infpy_write_memory, infpy_search_memory):
Update.
* python/py-breakpoint.c (bppy_set_condition, bppy_set_commands):
Update.
* mi/mi-interp.c (mi_interp::exec): Update.
* linespec.c (parse_linespec): Update.
* infcall.c (run_inferior_call): Update.
* guile/scm-value.c (gdbscm_value_to_lazy_string): Update.
* guile/scm-symbol.c (gdbscm_lookup_symbol)
(gdbscm_lookup_global_symbol): Update.
* guile/scm-param.c (gdbscm_parameter_value): Update.
* guile/scm-frame.c (gdbscm_frame_read_register)
(gdbscm_frame_read_var): Update.
* guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Update.
* exec.c (try_open_exec_file): Update.
* event-top.c (gdb_rl_callback_read_char_wrapper_noexcept)
(gdb_rl_callback_handler): Update.
* common/common-exceptions.h (exception_none): Don't declare.
* common/common-exceptions.c (exception_none): Don't define.
(struct catcher) <exception>: Update.
* cli/cli-interp.c (safe_execute_command): Update.
* breakpoint.c (insert_bp_location, location_to_sals): Update.
2019-04-25 Ali Tamur <tamur@google.com>
* dwarf2read.c (skip_one_die): Add DW_FORM_strx.
(read_attribute_value): Likewise.
(dwarf2_read_addr_index): Update comment.
(read_str_index): Add DW_FORM_strx.
(dwarf2_string_attr): Likewise.
(dwarf2_const_value_attr): Likewise.
(dump_die_shallow): Likewise.
(dwarf2_fetch_constant_bytes): Likewise.
(skip_form_bytes): Likewise.
* testsuite/lib/dwarf.exp (_handle_DW_FORM): Add DW_FORM_strx.
2019-04-25 Sergio Durigan Junior <sergiodj@redhat.com>
PR corefiles/11608
PR corefiles/18187
* linux-tdep.c (dump_mapping_p): Add new parameters ADDR and
OFFSET. Verify if current mapping contains an ELF header.
(linux_find_memory_regions_full): Adjust call to
dump_mapping_p.
2019-04-25 Sandra Loosemore <sandra@codesourcery.com>
Kang Li <kanglictf@gmail.com>
PR gdb/21600
* dwarf2-frame.c (read_initial_length): Be consistent about using
unsigned representation of length.
(decode_frame_entry_1): Likewise. Check for wraparound of
end pointer as well as buffer overflow.
2019-04-24 Sergio Durigan Junior <sergiodj@redhat.com>
* aarch64-tdep.c (aarch64_gdbarch_init): Use "pulongest" to print
"vq".
2019-04-24 Tom Tromey <tromey@adacore.com>
* amd64-tdep.c (amd64_has_unaligned_fields): Ignore bitfields.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* s12z-tdep.c (s12z_unwind_pc): Delete.
(s12z_unwind_sp): Delete.
(s12z_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* rl78-tdep.c (rl78_unwind_sp): Delete.
(rl78_gdbarch_init): Don't register deleted function with gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* xstormy16-tdep.c (xstormy16_unwind_sp): Delete.
(xstormy16_unwind_pc): Delete.
(xstormy16_dummy_id): Delete.
(xstormy16_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* vax-tdep.c (vax_unwind_pc): Delete.
(vax_gdbarch_init): Don't register deleted function with gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* v850-tdep.c (v850_unwind_sp): Delete.
(v850_unwind_pc): Delete.
(v850_dummy_id): Delete.
(v850_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* tilegx-tdep.c (tilegx_unwind_sp): Delete.
(tilegx_unwind_pc): Delete.
(tilegx_unwind_dummy_id): Delete.
(tilegx_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* tic6x-tdep.c (tic6x_unwind_sp): Delete.
(tic6x_dummy_id): Delete.
(tic6x_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* sparc-tdep.c (sparc_unwind_pc): Delete.
(sparc32_gdbarch_init): Don't register deleted function with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* sh-tdep.c (sh_unwind_sp): Delete.
(sh_unwind_pc): Delete.
(sh_dummy_id): Delete.
(sh_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* score-tdep.c (score_unwind_sp): Delete.
(score_unwind_pc): Delete.
(score_dummy_id): Delete.
(score_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* rx-tdep.c (rx_unwind_pc): Delete.
(rx_unwind_sp): Delete.
(rx_dummy_id): Delete.
(rx_gdbarch_init): Don't register deleted functions with
gdbarch. Update comment.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* rs6000-tdep.c (rs6000_unwind_pc): Delete.
(rs6000_dummy_id): Delete.
(rs6000_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* or1k-tdep.c (or1k_dummy_id): Delete.
(or1k_gdbarch_init): Don't register deleted function with gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* nios2-tdep.c (nios2_dummy_id): Delete.
(nios2_unwind_sp): Delete.
(nios2_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* nds32-tdep.c (nds32_dummy_id): Delete.
(nds32_unwind_pc): Delete.
(nds32_unwind_sp): Delete.
(nds32_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* msp430-tdep.c (msp430_unwind_pc): Delete.
(msp430_unwind_sp): Delete.
(msp430_dummy_id): Delete.
(msp430_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* moxie-tdep.c (moxie_unwind_sp): Delete.
(moxie_unwind_pc): Delete.
(moxie_dummy_id): Delete.
(moxie_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* mn10300-tdep.c (mn10300_dummy_id): Delete.
(mn10300_unwind_pc): Delete.
(mn10300_unwind_sp): Delete.
(mn10300_push_dummy_call): Use gdbarch_unwind_sp not
mn10300_unwind_sp.
(mn10300_frame_unwind_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* mep-tdep.c (mep_unwind_pc): Delete.
(mep_unwind_sp): Delete.
(mep_dummy_id): Delete.
(mep_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* m68hc11-tdep.c (m68hc11_unwind_pc): Delete.
(m68hc11_unwind_sp): Delete.
(m68hc11_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* m32r-tdep.c (m32r_unwind_sp): Delete.
(m32r_unwind_pc): Delete.
(m32r_dummy_id): Delete.
(m32r_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* m32c-tdep.c (m32c_unwind_pc): Delete.
(m32c_unwind_sp): Delete.
(m32c_dummy_id): Delete.
(m32c_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/lm32-tdep.c (lm32_unwind_sp): Delete.
(lm32_unwind_pc): Delete.
(lm32_dummy_id): Delete.
(lm32_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/iq2000-tdep.c (iq2000_unwind_sp): Delete.
(iq2000_unwind_pc): Delete.
(iq2000_dummy_id): Delete.
(iq2000_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* nds32-tdep.c (nds32_type_align): Delete.
(nds32_push_dummy_call): Use type_align instead.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* arm-tdep.c (arm_type_align): Only handle vector override case.
(arm_push_dummy_call): Use type_align.
(arm_gdbarch_init): Register arm_type_align gdbarch function.
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
* aarch64-tdep.c (aarch64_type_align): Only handle vector override
case.
(pass_on_stack): Use type_align.
(aarch64_gdbarch_init): Register aarch64_type_align gdbarch
function.
2019-04-23 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (line_header::file_name_at): Remove unused
overload.
2019-04-23 Tom de Vries <tdevries@suse.de>
PR gdb/24438
* contrib/cc-with-tweaks.sh: Remove superfluous .alt file after dwz
invocation.
2019-03-27 Ali Tamur <tamur@google.com>
* dwarf2-frame.c(dwarf_expr_executor::get_addr_index): Update comment
* dwarf2expr.c(dwarf_expr_context::execute_stack_op): Add DW_OP_addrx
* dwarf2expr.h(dwarf_expr_context::offset): Update comment
(dwarf_expr_context::get_addr_index): Likewise
* dwarf2loc.c(dwarf_evaluate_loc_desc::get_addr_index): Likewise
(symbol_needs_eval_context::get_addr_index): Likewise
(disassemble_dwarf_expression): Add DW_OP_addrx
* dwarf2read.c(attr_value_as_address): Add DW_FORM_addrx
(read_cutu_die_from_dwo): Update comment
(skip_one_die): Add DW_FORM_addrx
(read_attribute_value): Likewise
(var_decode_location): Add DW_OP_addrx
(dwarf2_const_value_attr): Add DW_FORM_addrx
(dump_die_shallow): Likewise
(dwarf2_fetch_constant_bytes): Likewise
(decode_locdesc): Add DW_OP_addrx
(skip_form_bytes): Add DW_FORM_addrx
2019-04-17 00:35:31 +02:00
2019-04-22 Ali Tamur <tamur@google.com>
* MAINTAINERS (Write After Approval): Add self.
solib-svr4: Pass down svr4_info as much as possible While reviewing https://sourceware.org/ml/gdb-patches/2019-04/msg00141.html I noticed that we relied heavily on global state through the get_svr4_info function, which uses current_program_space. I thought we could improve this (make things more explicit and easier to follow) by - Making get_svr4_info accept a program_space parameter, making it return the SVR4 info for that program space. - Passing down the svr4_info object from callers as much as possible. This means looking up the svr4_info for the appropriate program space at the entry points of the solib-svr4.c file and passing it down. For now, these entry points (most of them are "methods" of svr4_so_ops) rely on current_program_space, but we can later try to change the target_so_ops interface to pass down the program space. gdb/ChangeLog: * solib-svr4.c (get_svr4_info): Add pspace parameter. (svr4_keep_data_in_core): Pass current_program_space to get_svr4_info. (open_symbol_file_object): Likewise. (svr4_default_sos): Add info parameter. (svr4_read_so_list): Likewise. (svr4_current_sos_direct): Adjust functions calls to pass down info. (svr4_current_sos_1): Add info parameter. (svr4_current_sos): Call get_svr4_info, pass info down to svr4_current_sos_1. (svr4_fetch_objfile_link_map): Pass objfile->pspace to get_svr4_info. (svr4_in_dynsym_resolve_code): Pass current_program_space to get_svr4_info. (probes_table_htab_remove_objfile_probes): Pass objfile->pspace to get_svr4_info. (probes_table_remove_objfile_probes): Likewise. (register_solib_event_probe): Add info parameter. (solist_update_incremental): Pass info parameter down to svr4_read_so_list. (disable_probes_interface): Add info parameter. (svr4_handle_solib_event): Pass current_program_space to get_svr4_info. Adjust disable_probes_interface cleanup. (svr4_create_probe_breakpoints): Add info parameter, pass it down to register_solib_event_probe. (svr4_create_solib_event_breakpoints): Add info parameter, pass it down to svr4_create_probe_breakpoints. (enable_break): Pass info down to svr4_create_solib_event_breakpoints. (svr4_solib_create_inferior_hook): Pass current_program_space to get_svr4_info. (svr4_clear_solib): Likewise.
2019-04-22 20:02:36 +02:00
2019-04-22 Simon Marchi <simon.marchi@efficios.com>
* solib-svr4.c (get_svr4_info): Add pspace parameter.
(svr4_keep_data_in_core): Pass current_program_space to get_svr4_info.
(open_symbol_file_object): Likewise.
(svr4_default_sos): Add info parameter.
(svr4_read_so_list): Likewise.
(svr4_current_sos_direct): Adjust functions calls to pass down
info.
(svr4_current_sos_1): Add info parameter.
(svr4_current_sos): Call get_svr4_info, pass info down to
svr4_current_sos_1.
(svr4_fetch_objfile_link_map): Pass objfile->pspace to
get_svr4_info.
(svr4_in_dynsym_resolve_code): Pass current_program_space to
get_svr4_info.
(probes_table_htab_remove_objfile_probes): Pass objfile->pspace
to get_svr4_info.
(probes_table_remove_objfile_probes): Likewise.
(register_solib_event_probe): Add info parameter.
(solist_update_incremental): Pass info parameter down to
svr4_read_so_list.
(disable_probes_interface): Add info parameter.
(svr4_handle_solib_event): Pass current_program_space to
get_svr4_info. Adjust disable_probes_interface cleanup.
(svr4_create_probe_breakpoints): Add info parameter, pass it
down to register_solib_event_probe.
(svr4_create_solib_event_breakpoints): Add info parameter,
pass it down to svr4_create_probe_breakpoints.
(enable_break): Pass info down to
svr4_create_solib_event_breakpoints.
(svr4_solib_create_inferior_hook): Pass current_program_space to
get_svr4_info.
(svr4_clear_solib): Likewise.
Fix "nosharedlibrary + continue + shared lib event" crash On systems that use the probes-based solib interface, GDB misbehaves if you run the "nosharelibrary" command, continue execution, and then the program hits the shared library event breakpoint. On my system it aborts like this: (gdb) nosharedlibrary (gdb) c Continuing. pure virtual method called terminate called without an active exception Aborted (core dumped) Though it's really undefined behavior territory, caused by deferencing a dangling solib event probe pointer. I've observed this by running "nosharedlibrary" when stopped at the entry point, but it should happen at any other point, if the program does a dlopen/dlclose after. The fix is to discard an objfile's probes from the svr4 probes table when an objfile is about to be released. New test included, works with both native and gdbserver testing. Valgrind log: (gdb) starti (gdb) nosharedlibrary (gdb) c Continuing. ==24895== Invalid read of size 8 ==24895== at 0x89E5FB: solib_event_probe_action(probe_and_action*) (solib-svr4.c:1735) ==24895== by 0x89E95A: svr4_handle_solib_event() (solib-svr4.c:1872) ==24895== by 0x8A7198: handle_solib_event() (solib.c:1274) ==24895== by 0x4E3407: bpstat_stop_status(address_space const*, unsigned long, thread_info*, target_waitstatus const*, bpstats*) (breakpoint.c:5407) ==24895== by 0x721F41: handle_signal_stop(execution_control_state*) (infrun.c:5685) ==24895== by 0x720B11: handle_inferior_event(execution_control_state*) (infrun.c:5129) ==24895== by 0x71DD93: fetch_inferior_event(void*) (infrun.c:3748) ==24895== by 0x7059C3: inferior_event_handler(inferior_event_type, void*) (inf-loop.c:43) ==24895== by 0x874DF0: remote_async_serial_handler(serial*, void*) (remote.c:14039) ==24895== by 0x894101: run_async_handler_and_reschedule(serial*) (ser-base.c:137) ==24895== by 0x8941E6: fd_event(int, void*) (ser-base.c:188) ==24895== by 0x67AFEF: handle_file_event(file_handler*, int) (event-loop.c:732) ==24895== Address 0x18b63860 is 0 bytes inside a block of size 136 free'd ==24895== at 0x4C2E616: operator delete(void*, unsigned long) (vg_replace_malloc.c:585) ==24895== by 0x8C6A12: stap_probe::~stap_probe() (stap-probe.c:124) ==24895== by 0x66F7DB: probe_key_free(bfd*, void*) (elfread.c:1382) ==24895== by 0x69B705: bfdregistry_callback_adaptor(void (*)(registry_container*, void*), registry_container*, void*) (gdb_bfd.c:131) ==24895== by 0x855A57: registry_clear_data(registry_data_registry*, void (*)(void (*)(registry_container*, void*), registry_container*, void*), registry_container*, registry_fields*) (registry.c:79) ==24895== by 0x855B01: registry_container_free_data(registry_data_registry*, void (*)(void (*)(registry_container*, void*), registry_container*, void*), registry_container*, registry_fields*) (registry.c:92) ==24895== by 0x69B783: bfd_free_data(bfd*) (gdb_bfd.c:131) ==24895== by 0x69C4BA: gdb_bfd_unref(bfd*) (gdb_bfd.c:609) ==24895== by 0x7CC33F: objfile::~objfile() (objfiles.c:651) ==24895== by 0x7CD559: objfile_purge_solibs() (objfiles.c:1021) ==24895== by 0x8A7132: no_shared_libraries(char const*, int) (solib.c:1252) ==24895== by 0x548E3D: do_const_cfunc(cmd_list_element*, char const*, int) (cli-decode.c:106) ==24895== Block was alloc'd at ==24895== at 0x4C2D42A: operator new(unsigned long) (vg_replace_malloc.c:334) ==24895== by 0x8C527C: handle_stap_probe(objfile*, sdt_note*, std::vector<probe*, std::allocator<probe*> >*, unsigned long) (stap-probe.c:1561) ==24895== by 0x8C5535: stap_static_probe_ops::get_probes(std::vector<probe*, std::allocator<probe*> >*, objfile*) const (stap-probe.c:1656) ==24895== by 0x66F71B: elf_get_probes(objfile*) (elfread.c:1365) ==24895== by 0x7EDD85: find_probes_in_objfile(objfile*, char const*, char const*) (probe.c:227) ==24895== by 0x4DF382: create_longjmp_master_breakpoint() (breakpoint.c:3275) ==24895== by 0x4F6562: breakpoint_re_set() (breakpoint.c:13828) ==24895== by 0x8A66AA: solib_add(char const*, int, int) (solib.c:1010) ==24895== by 0x89F7C6: enable_break(svr4_info*, int) (solib-svr4.c:2360) ==24895== by 0x8A104C: svr4_solib_create_inferior_hook(int) (solib-svr4.c:2992) ==24895== by 0x8A70B9: solib_create_inferior_hook(int) (solib.c:1215) ==24895== by 0x70C073: post_create_inferior(target_ops*, int) (infcmd.c:467) ==24895== pure virtual method called terminate called without an active exception ==24895== ==24895== Process terminating with default action of signal 6 (SIGABRT): dumping core ==24895== at 0x7CF3750: raise (raise.c:51) ==24895== by 0x7CF4D30: abort (abort.c:79) ==24895== by 0xB008F4: __gnu_cxx::__verbose_terminate_handler() (in build/gdb/gdb) ==24895== by 0xAFF845: __cxxabiv1::__terminate(void (*)()) (in build/gdb/gdb) ==24895== by 0xAFF890: std::terminate() (in build/gdb/gdb) ==24895== by 0xAFF95E: __cxa_pure_virtual (in build/gdb/gdb) ==24895== by 0x89E610: solib_event_probe_action(probe_and_action*) (solib-svr4.c:1735) ==24895== by 0x89E95A: svr4_handle_solib_event() (solib-svr4.c:1872) ==24895== by 0x8A7198: handle_solib_event() (solib.c:1274) ==24895== by 0x4E3407: bpstat_stop_status(address_space const*, unsigned long, thread_info*, target_waitstatus const*, bpstats*) (breakpoint.c:5407) ==24895== by 0x721F41: handle_signal_stop(execution_control_state*) (infrun.c:5685) ==24895== by 0x720B11: handle_inferior_event(execution_control_state*) (infrun.c:5129) ==24895== Note, this little bit in the patch is just a cleanup that I noticed: - lookup.prob = prob; lookup.address = address; That line isn't necessary because hashing/comparison only looks at the address. gdb/ChangeLog: 2019-04-22 Pedro Alves <palves@redhat.com> * solib-svr4.c (svr4_free_objfile_observer): New. (probe_and_action::objfile): New field. (probes_table_htab_remove_objfile_probes) (probes_table_remove_objfile_probes): New functions. (register_solib_event_probe): Add 'objfile' parameter. Store it in the new probe_and_action. Don't store the probe in 'lookup'. (svr4_create_probe_breakpoints): Pass objfile to register_solib_event_probe. (_initialize_svr4_solib): Register a free_objfile observer. gdb/testsuite/ChangeLog: 2019-04-22 Pedro Alves <palves@redhat.com> * gdb.base/solib-probes-nosharedlibrary.c, gdb.base/solib-probes-nosharedlibrary.exp: New files.
2019-04-22 15:20:59 +02:00
2019-04-22 Pedro Alves <palves@redhat.com>
* solib-svr4.c (svr4_free_objfile_observer): New.
(probe_and_action::objfile): New field.
(probes_table_htab_remove_objfile_probes)
(probes_table_remove_objfile_probes): New functions.
(register_solib_event_probe): Add 'objfile' parameter. Store it
in the new probe_and_action. Don't store the probe in 'lookup'.
(svr4_create_probe_breakpoints): Pass objfile to
register_solib_event_probe.
(_initialize_svr4_solib): Register a free_objfile observer.
2019-04-19 Tom Tromey <tom@tromey.com>
* common/queue.h: Remove.
2019-04-19 Tom Tromey <tom@tromey.com>
* event-loop.c: Don't include "common/queue.h".
2019-04-19 Tom Tromey <tom@tromey.com>
* remote.c (remote_target): Use delete.
* remote-notif.h: Include <list>, not "common/queue.h".
(notif_client_p): Remove typedef.
(remote_notif_state): Add constructor, destructor, initializer.
<notif_queue>: Now a std::list.
(remote_notif_state_xfree): Don't declare.
* remote-notif.c (remote_notif_process, handle_notification)
(remote_notif_state_allocate): Update.
(~remote_notif_state): Rename from remote_notif_state_xfree.
2019-04-19 Tom Tromey <tom@tromey.com>
* symfile.c (reread_symbols): Update.
* objfiles.c (objfile_register_static_link)
(objfile_lookup_static_link): Update
(~objfile) Don't delete static_links.
* objfiles.h (struct objfile) <static_links>: Now an htab_up.
2019-04-19 Tom Tromey <tom@tromey.com>
* type-stack.h (struct type_stack) <insert>: Constify string.
* type-stack.c (type_stack::insert): Constify string.
* gdbtypes.h (lookup_template_type): Update.
(address_space_name_to_int): Update.
* gdbtypes.c (address_space_name_to_int): Make space_identifier
const.
(lookup_template_type): Make name const.
* c-exp.y: Update rules.
(lex_one_token, classify_name, classify_inner_name)
(c_print_token): Update.
* p-exp.y: Update rules.
(yylex): Update.
* f-exp.y: Update rules.
(yylex): Update.
* d-exp.y: Update rules.
(lex_one_token, classify_name, classify_inner_name): Update.
* parse.c (write_dollar_variable, copy_name): Return std::string.
* parser-defs.h (copy_name): Change return type.
* m2-exp.y: Update rules.
(yylex): Update.
* go-exp.y (lex_one_token): Update.
Update rules.
(classify_unsafe_function, classify_packaged_name)
(classify_name, yylex): Update.
2019-04-19 Sergei Trofimovich <siarheit@google.com>
* configure.ac: add --enable-source-highlight switch.
* configure: Regenerate.
* top.c (print_gdb_version): plumb --enable-source-highlight
status to "show configuration".
2019-04-19 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_is_variant_part, ada_to_fixed_type_1):
Check ADA_TYPE_P.
(empty_record, ada_template_to_fixed_record_type_1)
(template_to_static_fixed_type)
(to_record_with_fixed_variant_part): Use INIT_NONE_SPECIFIC.
* cp-abi.c (value_rtti_type): Check HAVE_CPLUS_STRUCT.
* gdbtypes.h (INIT_NONE_SPECIFIC, ADA_TYPE_P): New
macros.
2019-04-19 Ilya Yu. Malakhov <malakhov@mcst.ru>
PR symtab/24423:
* source.c (print_source_lines_base): Advance "iter" when a
control character is seen.
2019-04-19 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* inferior.h (struct infcall_suspend_state_deleter):
Catch exception in destructor to avoid crash.
2019-04-19 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-cmds.c (_initialize_cli_cmds): Move "shell" "!" alias
close to the add_com "shell".
2019-04-18 Tom Tromey <tromey@adacore.com>
* process-stratum-target.h (class process_stratum_target)
<stratum>: Add "final".
2019-04-17 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (dwarf2_init_complex_target_type): Check "tt"
against nullptr before use.
2019-04-17 Alan Hayward <alan.hayward@arm.com>
* nat/linux-waitpid.c (linux_debug): Call debug_vprintf.
2019-04-17 Jim Wilson <jimw@sifive.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* riscv-tdep.c (riscv_breakpoint_kind_from_pc): Hanndle case where
code read might fail, assume 4-byte breakpoint in that case.
Fix AMD64 return value ABI in expression evaluation The AMD64 System V ABI specifies that when a function has a return type classified as MEMORY, the caller provides space for the value and passes the address to this space as the first argument to the function (before even the "this" pointer). The classification of MEMORY is applied to struct that are sufficiently large, or ones with unaligned fields. The expression evaluator uses call_function_by_hand to call functions, and the hand-built frame has to push arguments in a way that matches the ABI of the called function. call_function_by_hand supports ABI-based struct returns, based on the value of gdbarch_return_value, however on AMD64 the implementation of the classifier incorrectly assumed that all non-POD types (implemented as "all types with a base class") should be classified as MEMORY and use the struct return. This ABI mismatch resulted in issues when calling a function that returns a class of size <16 bytes which has a base class, including issues such as the "this" pointer being incorrect (as it was passed as the second argument rather than the first). This is now fixed by checking for field alignment rather than POD-ness, and a testsuite is added to test expression evaluation for AMD64. gdb/ChangeLog: * amd64-tdep.c (amd64_classify_aggregate): Use cp_pass_by_reference rather than a hand-rolled POD check when checking for forced MEMORY classification. gdb/testsuite/ChangeLog: * gdb.arch/amd64-eval.cc: New file. * gdb.arch/amd64-eval.exp: New file.
2019-04-15 17:56:43 +02:00
2019-04-15 Leszek Swirski <leszeks@google.com>
* amd64-tdep.c (amd64_classify_aggregate): Use cp_pass_by_reference
rather than a hand-rolled POD check when checking for forced MEMORY
classification.
2019-04-15 Alan Hayward <alan.hayward@arm.com>
* aarch64-linux-nat.c (store_sveregs_to_thread): Set vector length.
* nat/aarch64-sve-linux-ptrace.c (aarch64_sve_set_vq): New
function.
(aarch64_sve_regs_copy_to_reg_buf): Remove VG checks.
(aarch64_sve_regs_copy_from_reg_buf): Likewise.
* nat/aarch64-sve-linux-ptrace.h (aarch64_sve_set_vq): New
declaration.
2019-04-15 Alan Hayward <alan.hayward@arm.com>
* aarch64-linux-nat.c
(aarch64_linux_nat_target::thread_architecture): Add override.
* aarch64-tdep.c (aarch64_gdbarch_init): Ensure different tdesc for
each VQ.
2019-04-15 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aarch64_gdbarch_init): Move gdbarch lookup.
2019-04-13 Andrew Burgess <andrew.burgess@embecosm.com>
* dwarf2read.c (dwarf2_init_complex_target_type): Handle complex
target types of size 96-bits, add some additional comments, and
check that the builtin type we found was the correct size.
2019-04-12 Eli Zaretskii <eliz@gnu.org>
* utils.c (prompt_for_continue): Don't restore the styling at the
end, as applied_style has the wrong value. This fixes styling in
long lists of file names that are interrupted by the "Continue?"
prompt.
gdb: Remove LANG_MAGIC The language_defn structure has an la_magic field, this used to be used as a basic check that the language_defn structure had the expected layout - at least the end of the structure was where we expected it to be. This feature only really makes sense if we imagine GDB dynamically loading language support from dynamic libraries, where a version mismatch might cause problems. However, in current GDB language support is statically built into GDB, and since this commit: commit 47e77640be31fc1a4eb3718f594ed5fd0faff065 Date: Thu Jul 20 18:28:01 2017 +0100 Make language_def O(1) the existing (if pointless) check of the la_magic field was removed. There now appears to be no use of the la_magic field, and I propose that we delete it. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_defn): Remove use of LANG_MAGIC. * c-lang.c (c_language_defn): Likewise. (cplus_language_defn): Likewise. (asm_language_defn): Likewise. (minimal_language_defn): Likewise. * d-lang.c (d_language_defn): Likewise. * f-lang.c (f_language_defn): Likewise. * go-lang.c (go_language_defn): Likewise. * language.c (unknown_language_defn): Likewise. (auto_language_defn): Likewise. * language.h (struct language_defn): Remove la_magic field. (LANG_MAGIC): Delete. * m2-lang.c (m2_language_defn): Remove use of LANG_MAGIC. * objc-lang.c (objc_language_defn): Likewise. * opencl-lang.c (opencl_language_defn): Likewise. * p-lang.c (pascal_language_defn): Likewise. * rust-lang.c (rust_language_defn): Likewise.
2019-04-12 00:51:48 +02:00
2019-04-12 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_language_defn): Remove use of LANG_MAGIC.
* c-lang.c (c_language_defn): Likewise.
(cplus_language_defn): Likewise.
(asm_language_defn): Likewise.
(minimal_language_defn): Likewise.
* d-lang.c (d_language_defn): Likewise.
* f-lang.c (f_language_defn): Likewise.
* go-lang.c (go_language_defn): Likewise.
* language.c (unknown_language_defn): Likewise.
(auto_language_defn): Likewise.
* language.h (struct language_defn): Remove la_magic field.
(LANG_MAGIC): Delete.
* m2-lang.c (m2_language_defn): Remove use of LANG_MAGIC.
* objc-lang.c (objc_language_defn): Likewise.
* opencl-lang.c (opencl_language_defn): Likewise.
* p-lang.c (pascal_language_defn): Likewise.
* rust-lang.c (rust_language_defn): Likewise.
2019-04-11 Andrew Burgess <andrew.burgess@embecosm.com>
* riscv-tdep.c (riscv_type_align): New function.
(riscv_type_alignment): Delete.
(riscv_arg_location): Use 'type_align'.
(riscv_gdbarch_init): Register riscv_type_align gdbarch function.
2019-04-11 Andrew Burgess <andrew.burgess@embecosm.com>
* gdbtypes.c (type_align): A struct with no non-static fields also
has alignment of 1.
gdb/riscv: Handle empty C++ structs during argument passing This commit resolves a large number of failures in the test script gdb.base/infcall-nested-structs.exp which were caused by GDB (for RISC-V) incorrectly handling empty C++ structures when preparing arguments for a dummy call, or collecting a return value. The issue is further complicated in that there was a bug in GCC, such that in some cases GCC would generate incorrect code when passing a small structure that contained empty sub-structures. This was fixed in GCC trunk on 5-March-2019, so in order to see the best results with this patch you'll need a recent version of GCC. Anything that used to work should continue to work after this patch, regardless of GCC version being used. The fix in this commit is that GDB now pays more attention to the offset of fields within a structure when preparing arguments as in C++ an empty structure has a non-zero size, this is an example: struct s1 { struct s2 { } empty; int f; }; We previously assumed that 'f' was at offset 0 inside type 's1', however this is not the case in C++ as 's2' has size 1, and with alignment 'f' is likely at some even bigger offset inside 's1'. gdb/ChangeLog: * riscv-tdep.c (riscv_call_arg_complex_float): Fix offset of first component to 0. (riscv_struct_info::riscv_struct_info): Initialise m_offsets member. (riscv_struct_info::analyse): New implementation using new analyse_inner member function. (riscv_struct_info::field_offset): New member function. (riscv_struct_info::m_offsets): New member variable. (riscv_struct_info::analyse_inner): New private member function, takes the old implementation of riscv_struct_info::analyse but extended to track field offsets. (riscv_call_arg_struct): Update the struct folding special cases to handle cases where empty C++ structs, which are non-zero length, are found. (riscv_arg_location): Initialise the length of each location, a non-zero length now indicates the location is in use. (riscv_push_dummy_call): Allow for the first location having a non-zero offset when setting up arguments. (riscv_return_value): Likewise, but for return values.
2019-04-05 14:50:19 +02:00
2019-04-11 Andrew Burgess <andrew.burgess@embecosm.com>
* riscv-tdep.c (riscv_call_arg_complex_float): Fix offset of first
component to 0.
(riscv_struct_info::riscv_struct_info): Initialise m_offsets
member.
(riscv_struct_info::analyse): New implementation using new
analyse_inner member function.
(riscv_struct_info::field_offset): New member function.
(riscv_struct_info::m_offsets): New member variable.
(riscv_struct_info::analyse_inner): New private member function,
takes the old implementation of riscv_struct_info::analyse but
extended to track field offsets.
(riscv_call_arg_struct): Update the struct folding special cases
to handle cases where empty C++ structs, which are non-zero
length, are found.
(riscv_arg_location): Initialise the length of each location, a
non-zero length now indicates the location is in use.
(riscv_push_dummy_call): Allow for the first location having a
non-zero offset when setting up arguments.
(riscv_return_value): Likewise, but for return values.
2019-04-11 Tom Tromey <tromey@adacore.com>
* utils.c (internal_vproblem): Make "msg" const.
2019-04-11 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aarch64_analyze_prologue_test): Reset saved regs.
* trad-frame.c (trad_frame_reset_saved_regs): New function.
(trad_frame_alloc_saved_regs): Call trad_frame_reset_saved_regs.
* trad-frame.h (trad_frame_reset_saved_regs): New declaration.
Fix amd64->i386 linux syscall restart problem This commit fixes some failures in gdb.base/interrupt.exp when debugging a 32-bit i386 linux inferior from an amd64 host. When running the following test... make check RUNTESTFLAGS="--target_board unix/-m32 interrupt.exp" ... without this commit, I see the following output: FAIL: gdb.base/interrupt.exp: continue (the program exited) FAIL: gdb.base/interrupt.exp: echo data FAIL: gdb.base/interrupt.exp: Send Control-C, second time FAIL: gdb.base/interrupt.exp: signal SIGINT (the program is no longer running) ERROR: Undefined command "". ERROR: GDB process no longer exists === gdb Summary === When the test is run with this commit in place, we see 12 passes instead. This is the desired behavior. Analysis: On Linux, when a syscall is interrupted by a signal, the syscall may return -ERESTARTSYS when a signal occurs. Doing so indicates that the syscall is restartable. Then, depending on settings associated with the signal handler, and after the signal handler is called, the kernel can then either return -EINTR or can cause the syscall to be restarted. In this discussion, we are concerned with the latter case. On i386, the kernel returns this status via the EAX register. When debugging a 32-bit (i386) process from a 64-bit (amd64) GDB, the debugger fetches 64-bit registers even though the process being debugged is 32-bit. Since we're debugging a 32-bit target, only 32 bits are being saved in the register cache. Now, ideally, GDB would save all 64-bits in the regcache and then would be able to restore those same values when it comes time to continue the target. I've looked into doing this, but it's not easy and I don't see many benefits to doing so. One benefit, however, would be that EAX would appear as a negative value for doing syscall restarts. At the moment, GDB is setting the high 32 bits of RAX (and other registers too) to 0. So, when GDB restores EAX just prior to a syscall restart, the high 32 bits of RAX are zeroed, thus making it look like a positive value. For this particular purpose, we need to sign extend EAX so that RAX will appear as a negative value when EAX is set to -ERESTARTSYS. This in turn will cause the signal handling code in the kernel to recognize -ERESTARTSYS which will in turn cause the syscall to be restarted. This commit is based on work by Jan Kratochvil from 2009: https://sourceware.org/ml/gdb-patches/2009-11/msg00592.html Jan's patch had the sign extension code in amd64-nat.c. Several other native targets make use of this code, so it seemed better to move the sign extension code to a linux specific file. I also added similar code to gdbserver. Another approach is to fix the problem in the kernel. Hui Zhu tried to get a fix into the kernel back in 2014, but it was not accepted. Discussion regarding this approach may be found here: https://lore.kernel.org/patchwork/patch/457841/ Even if a fix were to be put into the kernel, we'd still need some kind of fix in GDB in order to support older kernels. Finally, I'll note that Fedora has been carrying a similar patch for at least nine years. Other distributions, including RHEL and CentOS have picked up this change and have been using it too. gdb/ChangeLog: * amd64-linux-nat.c (amd64_linux_collect_native_gregset): New function. (fill_gregset): Call amd64_linux_collect_native_gregset instead of amd64_collect_native_gregset. (amd64_linux_nat_target::store_registers): Likewise. gdb/gdbserver/ChangeLog: * linux-x86-low.c (x86_fill_gregset): Sign extend EAX value when using a 64-bit gdbserver.
2019-03-16 20:40:01 +01:00
2019-04-10 Kevin Buettner <kevinb@redhat.com>
* amd64-linux-nat.c (amd64_linux_collect_native_gregset): New
function.
(fill_gregset): Call amd64_linux_collect_native_gregset instead
of amd64_collect_native_gregset.
(amd64_linux_nat_target::store_registers): Likewise.
2019-04-10 Tom Tromey <tom@tromey.com>
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_in_objfile_from_linkage_name): Use the iterator.
* objfiles.h (class separate_debug_iterator): New.
(class separate_debug_range): New.
(struct objfile) <separate_debug_objfiles>: New method.
(objfile_separate_debug_iterate): Don't declare.
* objfiles.c (separate_debug_iterator::operator++): Rename from
objfile_separate_debug_iterate.
(objfile_relocate, objfile_rebase, objfile_has_symbols): Use the
iterator.
* minsyms.c (lookup_minimal_symbol_by_pc_section): Use the
iterator.
2019-04-10 Tom Tromey <tom@tromey.com>
* symfile.c (reread_symbols): Remove old comment.
* objfiles.c (free_all_objfiles): Fix a typo.
2019-04-10 Tom Tromey <tom@tromey.com>
* ia64-tdep.c (ia64_get_dyn_info_list): Use foreach.
* minsyms.c (lookup_minimal_symbol): Use foreach.
(lookup_minimal_symbol_text, lookup_minimal_symbol_by_pc_name)
(lookup_minimal_symbol_solib_trampoline): Likewise.
* symfile.c (reread_symbols): Use foreach.
2019-04-09 Ivan Begert <ivanbegert@gmail.com>
Tom Tromey <tromey@adacore.com>
PR rust/24414:
* rust-exp.y (rust_parser::lex_number): Use strtoulst.
(rust_lex_int_test): Change "value" to be LONGEST.
(rust_lex_tests): Add test for long integer literal.
2019-04-09 Tom Tromey <tromey@adacore.com>
* remote.c (remote_target::remote_add_inferior): Change fake_pid_p
to bool.
(extended_remote_target::attach): Update.
(remote_target::remote_notice_new_inferior): Update.
(remote_target::add_current_inferior_and_thread): Update.
* inferior.c (exit_inferior_1): Use "false".
* corelow.c (add_to_thread_list): Make fake_pid_p bool.
2019-04-09 Simon Marchi <simon.marchi@efficios.com>
2019-04-09 18:35:29 +02:00
* infcmd.c (run_command_1): Pass -qualified to tbreak when using
the "start" command.
2019-04-08 Kevin Buettner <kevinb@redhat.com>
* python/py-inferior.c (infpy_thread_from_thread_handle):
Adjust comments to reflect renaming of thread_from_thread_handle
to thread_from_handle. Adjust keywords. Fix type error message.
(inferior_object_methods): Add thread_from_handle. Retain
thread_from_thread_handle, but mark it as deprecated.
2019-04-08 Kevin Buettner <kevinb@redhat.com>
* gdbthread.h (find_thread_by_handle): Revise declaration.
* thread.c (find_thread_by_handle): Likewise. Adjust
implementation too.
* python/py-inferior.c (infpy_thread_from_thread_handle): Add
support for buffer objects as handles.
2019-04-08 Kevin Buettner <kevinb@redhat.com>
* python/py-infthread.c (thpy_thread_handle): New function.
(thread_object_methods): Register thpy_thread_handle.
2019-04-08 Kevin Buettner <kevinb@redhat.com>
* gdbthread.h (thread_to_thread_handle): Declare.
* thread.c (gdbtypes.h): Include.
(thread_to_thread_handle): New function.
* target.h (struct target_ops): Add thread_info_to_thread_handle.
(target_thread_info_to_thread_handle): Declare.
* target.c (target_thread_info_to_thread_handle): New function.
* target-debug.h (target_debug_print_gdb_byte_vector): Define.
* target-delegates.c: Regenerate.
* linux-thread-db.c (class thread_db_target): Add method
thread_info_to_thread_handle.
(thread_db_target::thread_info_to_thread_handle): Define.
* remote.c (class remote_target): Add new method
thread_info_to_thread_handle.
(remote_target::thread_info_to_thread_handle): Define.
Some gdb_exception{,error,quit} tweaks - Explicitly include <string> for std::string. - Use std::make_shared to construct gdb_exception::message instead of operator new, avoiding one heap allocation (2 instead of 3). Add 'const char *fmt, va_list ap' parameters to gdb_exception{,error,quit}'s ctors, and do the std::make_shared in the gdb_exception ctor. - gdb_exception_error's constructor does not need to have an 'enum return_reason' parameter, since it is always RETURN_ERROR, by definition. - Similarly, gdb_exception_quit's contructor does not need to have 'enum return_reason'/'enum errors' parameters. - In the gdb_exception_{quit,_error} ctors that take a gdb_exception as argument, assert that they're being passed a gdb_exception object of the right 'reason'. gdb/ChangeLog: 2019-04-08 Pedro Alves <palves@redhat.com> * common/common-exceptions.c (throw_exception): Don't create named object to throw; throw directly. (throw_it): Likewise. Don't initialize gdb_exception::message here, with new; pass FMT and AP to the ctor instead. * common/common-exceptions.h: Include <string>. (gdb_exception::gdb_exception(enum return_reason, enum errors, const char *, va_list)): New ctor. Use std::make_shared. (gdb_exception_error::gdb_exception_error(enum return_reason, enum errors)): Delete. (gdb_exception_error::gdb_exception_error(enum errors, const char *, va_list)): New. (gdb_exception_error::gdb_exception_error(const gdb_exception &)): Add assertion. (gdb_exception_quit::gdb_exception_quit(enum return_reason, enum errors)): Delete. (gdb_exception_quit::gdb_exception_quit(const char *, va_list)): New. (gdb_exception_quit::gdb_exception_quit(const gdb_exception &)): Add assertion.
2019-04-08 14:03:54 +02:00
2019-04-08 Pedro Alves <palves@redhat.com>
* common/common-exceptions.c (throw_exception): Don't create
named object to throw; throw directly.
(throw_it): Likewise. Don't initialize gdb_exception::message
here, with new; pass FMT and AP to the ctor instead.
* common/common-exceptions.h: Include <string>.
(gdb_exception::gdb_exception(enum return_reason, enum errors,
const char *, va_list)): New ctor. Use std::make_shared.
(gdb_exception_error::gdb_exception_error(enum return_reason, enum
errors)): Delete.
(gdb_exception_error::gdb_exception_error(enum errors, const char
*, va_list)): New.
(gdb_exception_error::gdb_exception_error(const gdb_exception &)):
Add assertion.
(gdb_exception_quit::gdb_exception_quit(enum return_reason, enum
errors)): Delete.
(gdb_exception_quit::gdb_exception_quit(const char *, va_list)): New.
(gdb_exception_quit::gdb_exception_quit(const gdb_exception &)):
Add assertion.
Replace throw_exception with throw in some cases This replaces throw_exception with "throw;" when possible. This was written by script. The rule that is followed is that uses of the form: catch (... &name) { ... throw_exception (name); } ... can be rewritten. This should always be safe, because exceptions are caught by const reference, and therefore can't be modified in the body of the catch. gdb/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * valops.c (value_rtti_indirect_type): Replace throw_exception with throw. * tracefile-tfile.c (tfile_target_open): Replace throw_exception with throw. * thread.c (thr_try_catch_cmd): Replace throw_exception with throw. * target.c (target_translate_tls_address): Replace throw_exception with throw. * stack.c (frame_apply_command_count): Replace throw_exception with throw. * solib-spu.c (append_ocl_sos): Replace throw_exception with throw. * s390-tdep.c (s390_frame_unwind_cache): Replace throw_exception with throw. * rs6000-tdep.c (rs6000_frame_cache) (rs6000_epilogue_frame_cache): Replace throw_exception with throw. * remote.c: Replace throw_exception with throw. * record-full.c (record_full_message, record_full_wait_1) (record_full_restore): Replace throw_exception with throw. * record-btrace.c: (get_thread_current_frame_id, record_btrace_start_replaying) (cmd_record_btrace_bts_start, cmd_record_btrace_pt_start) (cmd_record_btrace_start): Replace throw_exception with throw. * parse.c (parse_exp_in_context_1): Replace throw_exception with throw. * linux-nat.c (detach_one_lwp, linux_resume_one_lwp) (resume_stopped_resumed_lwps): Replace throw_exception with throw. * linespec.c: (find_linespec_symbols): Replace throw_exception with throw. * infrun.c (displaced_step_prepare, resume): Replace throw_exception with throw. * infcmd.c (post_create_inferior): Replace throw_exception with throw. * inf-loop.c (inferior_event_handler): Replace throw_exception with throw. * i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache) (i386_sigtramp_frame_cache): Replace throw_exception with throw. * frame.c (frame_unwind_pc, get_prev_frame_if_no_cycle) (get_prev_frame_always, get_frame_pc_if_available) (get_frame_address_in_block_if_available, get_frame_language): Replace throw_exception with throw. * frame-unwind.c (frame_unwind_try_unwinder): Replace throw_exception with throw. * eval.c (fetch_subexp_value, evaluate_var_value) (evaluate_funcall, evaluate_subexp_standard): Replace throw_exception with throw. * dwarf2loc.c (call_site_find_chain) (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval): Replace throw_exception with throw. * dwarf2-frame.c (dwarf2_frame_cache): Replace throw_exception with throw. * darwin-nat.c (darwin_attach_pid): Replace throw_exception with throw. * cp-abi.c (baseclass_offset): Replace throw_exception with throw. * completer.c (complete_line_internal): Replace throw_exception with throw. * compile/compile-object-run.c (compile_object_run): Replace throw_exception with throw. * cli/cli-script.c (process_next_line): Replace throw_exception with throw. * btrace.c (btrace_compute_ftrace_pt, btrace_compute_ftrace) (btrace_enable, btrace_maint_update_pt_packets): Replace throw_exception with throw. * breakpoint.c (create_breakpoint, save_breakpoints): Replace throw_exception with throw. * break-catch-throw.c (re_set_exception_catchpoint): Replace throw_exception with throw. * amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache) (amd64_epilogue_frame_cache): Replace throw_exception with throw. * aarch64-tdep.c (aarch64_make_prologue_cache) (aarch64_make_stub_cache): Replace throw_exception with throw. gdb/gdbserver/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * linux-low.c (linux_detach_one_lwp): Replace throw_exception with throw. (linux_resume_one_lwp): Likewise.
2019-01-28 18:45:45 +01:00
2019-04-08 Tom Tromey <tom@tromey.com>
* valops.c (value_rtti_indirect_type): Replace throw_exception
with throw.
* tracefile-tfile.c (tfile_target_open): Replace throw_exception
with throw.
* thread.c (thr_try_catch_cmd): Replace throw_exception with
throw.
* target.c (target_translate_tls_address): Replace throw_exception
with throw.
* stack.c (frame_apply_command_count): Replace throw_exception
with throw.
* solib-spu.c (append_ocl_sos): Replace throw_exception with
throw.
* s390-tdep.c (s390_frame_unwind_cache): Replace throw_exception
with throw.
* rs6000-tdep.c (rs6000_frame_cache)
(rs6000_epilogue_frame_cache): Replace throw_exception with throw.
* remote.c: Replace throw_exception with throw.
* record-full.c (record_full_message, record_full_wait_1)
(record_full_restore): Replace throw_exception with throw.
* record-btrace.c:
(get_thread_current_frame_id, record_btrace_start_replaying)
(cmd_record_btrace_bts_start, cmd_record_btrace_pt_start)
(cmd_record_btrace_start): Replace throw_exception with throw.
* parse.c (parse_exp_in_context_1): Replace throw_exception with
throw.
* linux-nat.c (detach_one_lwp, linux_resume_one_lwp)
(resume_stopped_resumed_lwps): Replace throw_exception with throw.
* linespec.c:
(find_linespec_symbols): Replace throw_exception with throw.
* infrun.c (displaced_step_prepare, resume): Replace
throw_exception with throw.
* infcmd.c (post_create_inferior): Replace throw_exception with
throw.
* inf-loop.c (inferior_event_handler): Replace throw_exception
with throw.
* i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache)
(i386_sigtramp_frame_cache): Replace throw_exception with throw.
* frame.c (frame_unwind_pc, get_prev_frame_if_no_cycle)
(get_prev_frame_always, get_frame_pc_if_available)
(get_frame_address_in_block_if_available, get_frame_language):
Replace throw_exception with throw.
* frame-unwind.c (frame_unwind_try_unwinder): Replace
throw_exception with throw.
* eval.c (fetch_subexp_value, evaluate_var_value)
(evaluate_funcall, evaluate_subexp_standard): Replace
throw_exception with throw.
* dwarf2loc.c (call_site_find_chain)
(dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval):
Replace throw_exception with throw.
* dwarf2-frame.c (dwarf2_frame_cache): Replace throw_exception
with throw.
* darwin-nat.c (darwin_attach_pid): Replace throw_exception with
throw.
* cp-abi.c (baseclass_offset): Replace throw_exception with throw.
* completer.c (complete_line_internal): Replace throw_exception
with throw.
* compile/compile-object-run.c (compile_object_run): Replace
throw_exception with throw.
* cli/cli-script.c (process_next_line): Replace throw_exception
with throw.
* btrace.c (btrace_compute_ftrace_pt, btrace_compute_ftrace)
(btrace_enable, btrace_maint_update_pt_packets): Replace
throw_exception with throw.
* breakpoint.c (create_breakpoint, save_breakpoints): Replace
throw_exception with throw.
* break-catch-throw.c (re_set_exception_catchpoint): Replace
throw_exception with throw.
* amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache)
(amd64_epilogue_frame_cache): Replace throw_exception with throw.
* aarch64-tdep.c (aarch64_make_prologue_cache)
(aarch64_make_stub_cache): Replace throw_exception with throw.
2019-04-08 Tom Tromey <tom@tromey.com>
* common/common-exceptions.c (throw_exception): Rename from
throw_exception_cxx. Remove old copy. Make argument const.
(throw_it): Create and throw exception objects directly.
* common/common-exceptions.h (throw_exception): Make argument
const.
(struct gdb_exception_error): Add constructor.
(struct gdb_exception_quit): Add constructor.
2019-04-08 Tom Tromey <tom@tromey.com>
* common/common-exceptions.h (exception_rethrow): Don't declare.
(TRY_SJLJ): Update comment.
(TRY, CATCH, END_CATCH): Remove.
* common/common-exceptions.c (exception_rethrow): Remove.
Rename gdb exception types This renames the gdb exception types. The old types were only needed due to the macros in common-exception.h that are now gone. The intermediate layer of gdb_exception_RETURN_MASK_ALL did not seem needed, so this patch removes it entirely. gdb/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * common/common-exceptions.h (gdb_exception_RETURN_MASK_ALL): Remove. (gdb_exception_error): Rename from gdb_exception_RETURN_MASK_ERROR. (gdb_exception_quit): Rename from gdb_exception_RETURN_MASK_QUIT. (gdb_quit_bad_alloc): Update. * aarch64-tdep.c: Update. * ada-lang.c: Update. * ada-typeprint.c: Update. * ada-valprint.c: Update. * amd64-tdep.c: Update. * arch-utils.c: Update. * break-catch-throw.c: Update. * breakpoint.c: Update. * btrace.c: Update. * c-varobj.c: Update. * cli/cli-cmds.c: Update. * cli/cli-interp.c: Update. * cli/cli-script.c: Update. * common/common-exceptions.c: Update. * common/new-op.c: Update. * common/selftest.c: Update. * compile/compile-c-symbols.c: Update. * compile/compile-cplus-symbols.c: Update. * compile/compile-object-load.c: Update. * compile/compile-object-run.c: Update. * completer.c: Update. * corelow.c: Update. * cp-abi.c: Update. * cp-support.c: Update. * cp-valprint.c: Update. * darwin-nat.c: Update. * disasm-selftests.c: Update. * dtrace-probe.c: Update. * dwarf-index-cache.c: Update. * dwarf-index-write.c: Update. * dwarf2-frame-tailcall.c: Update. * dwarf2-frame.c: Update. * dwarf2loc.c: Update. * dwarf2read.c: Update. * eval.c: Update. * event-loop.c: Update. * event-top.c: Update. * exec.c: Update. * f-valprint.c: Update. * fbsd-tdep.c: Update. * frame-unwind.c: Update. * frame.c: Update. * gdbtypes.c: Update. * gnu-v3-abi.c: Update. * guile/guile-internal.h: Update. * guile/scm-block.c: Update. * guile/scm-breakpoint.c: Update. * guile/scm-cmd.c: Update. * guile/scm-disasm.c: Update. * guile/scm-frame.c: Update. * guile/scm-lazy-string.c: Update. * guile/scm-math.c: Update. * guile/scm-param.c: Update. * guile/scm-ports.c: Update. * guile/scm-pretty-print.c: Update. * guile/scm-symbol.c: Update. * guile/scm-symtab.c: Update. * guile/scm-type.c: Update. * guile/scm-value.c: Update. * i386-linux-tdep.c: Update. * i386-tdep.c: Update. * inf-loop.c: Update. * infcall.c: Update. * infcmd.c: Update. * infrun.c: Update. * jit.c: Update. * language.c: Update. * linespec.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-tdep.c: Update. * linux-thread-db.c: Update. * main.c: Update. * mi/mi-cmd-break.c: Update. * mi/mi-cmd-stack.c: Update. * mi/mi-interp.c: Update. * mi/mi-main.c: Update. * objc-lang.c: Update. * p-valprint.c: Update. * parse.c: Update. * ppc-linux-tdep.c: Update. * printcmd.c: Update. * python/py-arch.c: Update. * python/py-breakpoint.c: Update. * python/py-cmd.c: Update. * python/py-finishbreakpoint.c: Update. * python/py-frame.c: Update. * python/py-framefilter.c: Update. * python/py-gdb-readline.c: Update. * python/py-inferior.c: Update. * python/py-infthread.c: Update. * python/py-lazy-string.c: Update. * python/py-linetable.c: Update. * python/py-objfile.c: Update. * python/py-param.c: Update. * python/py-prettyprint.c: Update. * python/py-progspace.c: Update. * python/py-record-btrace.c: Update. * python/py-record.c: Update. * python/py-symbol.c: Update. * python/py-type.c: Update. * python/py-unwind.c: Update. * python/py-utils.c: Update. * python/py-value.c: Update. * python/python.c: Update. * record-btrace.c: Update. * record-full.c: Update. * remote-fileio.c: Update. * remote.c: Update. * riscv-tdep.c: Update. * rs6000-aix-tdep.c: Update. * rs6000-tdep.c: Update. * rust-exp.y: Update. * rust-lang.c: Update. * s390-tdep.c: Update. * selftest-arch.c: Update. * solib-dsbt.c: Update. * solib-frv.c: Update. * solib-spu.c: Update. * solib-svr4.c: Update. * solib.c: Update. * sparc64-linux-tdep.c: Update. * stack.c: Update. * symfile-mem.c: Update. * symmisc.c: Update. * target.c: Update. * thread.c: Update. * top.c: Update. * tracefile-tfile.c: Update. * tui/tui.c: Update. * typeprint.c: Update. * unittests/cli-utils-selftests.c: Update. * unittests/parse-connection-spec-selftests.c: Update. * valops.c: Update. * valprint.c: Update. * value.c: Update. * varobj.c: Update. * windows-nat.c: Update. * x86-linux-nat.c: Update. * xml-support.c: Update. gdb/gdbserver/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * gdbreplay.c: Update. * linux-low.c: Update. * server.c: Update.
2019-04-03 23:59:07 +02:00
2019-04-08 Tom Tromey <tom@tromey.com>
* common/common-exceptions.h (gdb_exception_RETURN_MASK_ALL):
Remove.
(gdb_exception_error): Rename from
gdb_exception_RETURN_MASK_ERROR.
(gdb_exception_quit): Rename from gdb_exception_RETURN_MASK_QUIT.
(gdb_quit_bad_alloc): Update.
* aarch64-tdep.c: Update.
* ada-lang.c: Update.
* ada-typeprint.c: Update.
* ada-valprint.c: Update.
* amd64-tdep.c: Update.
* arch-utils.c: Update.
* break-catch-throw.c: Update.
* breakpoint.c: Update.
* btrace.c: Update.
* c-varobj.c: Update.
* cli/cli-cmds.c: Update.
* cli/cli-interp.c: Update.
* cli/cli-script.c: Update.
* common/common-exceptions.c: Update.
* common/new-op.c: Update.
* common/selftest.c: Update.
* compile/compile-c-symbols.c: Update.
* compile/compile-cplus-symbols.c: Update.
* compile/compile-object-load.c: Update.
* compile/compile-object-run.c: Update.
* completer.c: Update.
* corelow.c: Update.
* cp-abi.c: Update.
* cp-support.c: Update.
* cp-valprint.c: Update.
* darwin-nat.c: Update.
* disasm-selftests.c: Update.
* dtrace-probe.c: Update.
* dwarf-index-cache.c: Update.
* dwarf-index-write.c: Update.
* dwarf2-frame-tailcall.c: Update.
* dwarf2-frame.c: Update.
* dwarf2loc.c: Update.
* dwarf2read.c: Update.
* eval.c: Update.
* event-loop.c: Update.
* event-top.c: Update.
* exec.c: Update.
* f-valprint.c: Update.
* fbsd-tdep.c: Update.
* frame-unwind.c: Update.
* frame.c: Update.
* gdbtypes.c: Update.
* gnu-v3-abi.c: Update.
* guile/guile-internal.h: Update.
* guile/scm-block.c: Update.
* guile/scm-breakpoint.c: Update.
* guile/scm-cmd.c: Update.
* guile/scm-disasm.c: Update.
* guile/scm-frame.c: Update.
* guile/scm-lazy-string.c: Update.
* guile/scm-math.c: Update.
* guile/scm-param.c: Update.
* guile/scm-ports.c: Update.
* guile/scm-pretty-print.c: Update.
* guile/scm-symbol.c: Update.
* guile/scm-symtab.c: Update.
* guile/scm-type.c: Update.
* guile/scm-value.c: Update.
* i386-linux-tdep.c: Update.
* i386-tdep.c: Update.
* inf-loop.c: Update.
* infcall.c: Update.
* infcmd.c: Update.
* infrun.c: Update.
* jit.c: Update.
* language.c: Update.
* linespec.c: Update.
* linux-fork.c: Update.
* linux-nat.c: Update.
* linux-tdep.c: Update.
* linux-thread-db.c: Update.
* main.c: Update.
* mi/mi-cmd-break.c: Update.
* mi/mi-cmd-stack.c: Update.
* mi/mi-interp.c: Update.
* mi/mi-main.c: Update.
* objc-lang.c: Update.
* p-valprint.c: Update.
* parse.c: Update.
* ppc-linux-tdep.c: Update.
* printcmd.c: Update.
* python/py-arch.c: Update.
* python/py-breakpoint.c: Update.
* python/py-cmd.c: Update.
* python/py-finishbreakpoint.c: Update.
* python/py-frame.c: Update.
* python/py-framefilter.c: Update.
* python/py-gdb-readline.c: Update.
* python/py-inferior.c: Update.
* python/py-infthread.c: Update.
* python/py-lazy-string.c: Update.
* python/py-linetable.c: Update.
* python/py-objfile.c: Update.
* python/py-param.c: Update.
* python/py-prettyprint.c: Update.
* python/py-progspace.c: Update.
* python/py-record-btrace.c: Update.
* python/py-record.c: Update.
* python/py-symbol.c: Update.
* python/py-type.c: Update.
* python/py-unwind.c: Update.
* python/py-utils.c: Update.
* python/py-value.c: Update.
* python/python.c: Update.
* record-btrace.c: Update.
* record-full.c: Update.
* remote-fileio.c: Update.
* remote.c: Update.
* riscv-tdep.c: Update.
* rs6000-aix-tdep.c: Update.
* rs6000-tdep.c: Update.
* rust-exp.y: Update.
* rust-lang.c: Update.
* s390-tdep.c: Update.
* selftest-arch.c: Update.
* solib-dsbt.c: Update.
* solib-frv.c: Update.
* solib-spu.c: Update.
* solib-svr4.c: Update.
* solib.c: Update.
* sparc64-linux-tdep.c: Update.
* stack.c: Update.
* symfile-mem.c: Update.
* symmisc.c: Update.
* target.c: Update.
* thread.c: Update.
* top.c: Update.
* tracefile-tfile.c: Update.
* tui/tui.c: Update.
* typeprint.c: Update.
* unittests/cli-utils-selftests.c: Update.
* unittests/parse-connection-spec-selftests.c: Update.
* valops.c: Update.
* valprint.c: Update.
* value.c: Update.
* varobj.c: Update.
* windows-nat.c: Update.
* x86-linux-nat.c: Update.
* xml-support.c: Update.
Rewrite TRY/CATCH This rewrites gdb's TRY/CATCH to plain C++ try/catch. The patch was largely written by script, though one change (to a comment in common-exceptions.h) was reverted by hand. gdb/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * xml-support.c: Use C++ exception handling. * x86-linux-nat.c: Use C++ exception handling. * windows-nat.c: Use C++ exception handling. * varobj.c: Use C++ exception handling. * value.c: Use C++ exception handling. * valprint.c: Use C++ exception handling. * valops.c: Use C++ exception handling. * unittests/parse-connection-spec-selftests.c: Use C++ exception handling. * unittests/cli-utils-selftests.c: Use C++ exception handling. * typeprint.c: Use C++ exception handling. * tui/tui.c: Use C++ exception handling. * tracefile-tfile.c: Use C++ exception handling. * top.c: Use C++ exception handling. * thread.c: Use C++ exception handling. * target.c: Use C++ exception handling. * symmisc.c: Use C++ exception handling. * symfile-mem.c: Use C++ exception handling. * stack.c: Use C++ exception handling. * sparc64-linux-tdep.c: Use C++ exception handling. * solib.c: Use C++ exception handling. * solib-svr4.c: Use C++ exception handling. * solib-spu.c: Use C++ exception handling. * solib-frv.c: Use C++ exception handling. * solib-dsbt.c: Use C++ exception handling. * selftest-arch.c: Use C++ exception handling. * s390-tdep.c: Use C++ exception handling. * rust-lang.c: Use C++ exception handling. * rust-exp.y: Use C++ exception handling. * rs6000-tdep.c: Use C++ exception handling. * rs6000-aix-tdep.c: Use C++ exception handling. * riscv-tdep.c: Use C++ exception handling. * remote.c: Use C++ exception handling. * remote-fileio.c: Use C++ exception handling. * record-full.c: Use C++ exception handling. * record-btrace.c: Use C++ exception handling. * python/python.c: Use C++ exception handling. * python/py-value.c: Use C++ exception handling. * python/py-utils.c: Use C++ exception handling. * python/py-unwind.c: Use C++ exception handling. * python/py-type.c: Use C++ exception handling. * python/py-symbol.c: Use C++ exception handling. * python/py-record.c: Use C++ exception handling. * python/py-record-btrace.c: Use C++ exception handling. * python/py-progspace.c: Use C++ exception handling. * python/py-prettyprint.c: Use C++ exception handling. * python/py-param.c: Use C++ exception handling. * python/py-objfile.c: Use C++ exception handling. * python/py-linetable.c: Use C++ exception handling. * python/py-lazy-string.c: Use C++ exception handling. * python/py-infthread.c: Use C++ exception handling. * python/py-inferior.c: Use C++ exception handling. * python/py-gdb-readline.c: Use C++ exception handling. * python/py-framefilter.c: Use C++ exception handling. * python/py-frame.c: Use C++ exception handling. * python/py-finishbreakpoint.c: Use C++ exception handling. * python/py-cmd.c: Use C++ exception handling. * python/py-breakpoint.c: Use C++ exception handling. * python/py-arch.c: Use C++ exception handling. * printcmd.c: Use C++ exception handling. * ppc-linux-tdep.c: Use C++ exception handling. * parse.c: Use C++ exception handling. * p-valprint.c: Use C++ exception handling. * objc-lang.c: Use C++ exception handling. * mi/mi-main.c: Use C++ exception handling. * mi/mi-interp.c: Use C++ exception handling. * mi/mi-cmd-stack.c: Use C++ exception handling. * mi/mi-cmd-break.c: Use C++ exception handling. * main.c: Use C++ exception handling. * linux-thread-db.c: Use C++ exception handling. * linux-tdep.c: Use C++ exception handling. * linux-nat.c: Use C++ exception handling. * linux-fork.c: Use C++ exception handling. * linespec.c: Use C++ exception handling. * language.c: Use C++ exception handling. * jit.c: Use C++ exception handling. * infrun.c: Use C++ exception handling. * infcmd.c: Use C++ exception handling. * infcall.c: Use C++ exception handling. * inf-loop.c: Use C++ exception handling. * i386-tdep.c: Use C++ exception handling. * i386-linux-tdep.c: Use C++ exception handling. * guile/scm-value.c: Use C++ exception handling. * guile/scm-type.c: Use C++ exception handling. * guile/scm-symtab.c: Use C++ exception handling. * guile/scm-symbol.c: Use C++ exception handling. * guile/scm-pretty-print.c: Use C++ exception handling. * guile/scm-ports.c: Use C++ exception handling. * guile/scm-param.c: Use C++ exception handling. * guile/scm-math.c: Use C++ exception handling. * guile/scm-lazy-string.c: Use C++ exception handling. * guile/scm-frame.c: Use C++ exception handling. * guile/scm-disasm.c: Use C++ exception handling. * guile/scm-cmd.c: Use C++ exception handling. * guile/scm-breakpoint.c: Use C++ exception handling. * guile/scm-block.c: Use C++ exception handling. * guile/guile-internal.h: Use C++ exception handling. * gnu-v3-abi.c: Use C++ exception handling. * gdbtypes.c: Use C++ exception handling. * frame.c: Use C++ exception handling. * frame-unwind.c: Use C++ exception handling. * fbsd-tdep.c: Use C++ exception handling. * f-valprint.c: Use C++ exception handling. * exec.c: Use C++ exception handling. * event-top.c: Use C++ exception handling. * event-loop.c: Use C++ exception handling. * eval.c: Use C++ exception handling. * dwarf2read.c: Use C++ exception handling. * dwarf2loc.c: Use C++ exception handling. * dwarf2-frame.c: Use C++ exception handling. * dwarf2-frame-tailcall.c: Use C++ exception handling. * dwarf-index-write.c: Use C++ exception handling. * dwarf-index-cache.c: Use C++ exception handling. * dtrace-probe.c: Use C++ exception handling. * disasm-selftests.c: Use C++ exception handling. * darwin-nat.c: Use C++ exception handling. * cp-valprint.c: Use C++ exception handling. * cp-support.c: Use C++ exception handling. * cp-abi.c: Use C++ exception handling. * corelow.c: Use C++ exception handling. * completer.c: Use C++ exception handling. * compile/compile-object-run.c: Use C++ exception handling. * compile/compile-object-load.c: Use C++ exception handling. * compile/compile-cplus-symbols.c: Use C++ exception handling. * compile/compile-c-symbols.c: Use C++ exception handling. * common/selftest.c: Use C++ exception handling. * common/new-op.c: Use C++ exception handling. * cli/cli-script.c: Use C++ exception handling. * cli/cli-interp.c: Use C++ exception handling. * cli/cli-cmds.c: Use C++ exception handling. * c-varobj.c: Use C++ exception handling. * btrace.c: Use C++ exception handling. * breakpoint.c: Use C++ exception handling. * break-catch-throw.c: Use C++ exception handling. * arch-utils.c: Use C++ exception handling. * amd64-tdep.c: Use C++ exception handling. * ada-valprint.c: Use C++ exception handling. * ada-typeprint.c: Use C++ exception handling. * ada-lang.c: Use C++ exception handling. * aarch64-tdep.c: Use C++ exception handling. gdb/gdbserver/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * server.c: Use C++ exception handling. * linux-low.c: Use C++ exception handling. * gdbreplay.c: Use C++ exception handling.
2019-04-04 00:02:42 +02:00
2019-04-08 Tom Tromey <tom@tromey.com>
* xml-support.c: Use C++ exception handling.
* x86-linux-nat.c: Use C++ exception handling.
* windows-nat.c: Use C++ exception handling.
* varobj.c: Use C++ exception handling.
* value.c: Use C++ exception handling.
* valprint.c: Use C++ exception handling.
* valops.c: Use C++ exception handling.
* unittests/parse-connection-spec-selftests.c: Use C++ exception
handling.
* unittests/cli-utils-selftests.c: Use C++ exception handling.
* typeprint.c: Use C++ exception handling.
* tui/tui.c: Use C++ exception handling.
* tracefile-tfile.c: Use C++ exception handling.
* top.c: Use C++ exception handling.
* thread.c: Use C++ exception handling.
* target.c: Use C++ exception handling.
* symmisc.c: Use C++ exception handling.
* symfile-mem.c: Use C++ exception handling.
* stack.c: Use C++ exception handling.
* sparc64-linux-tdep.c: Use C++ exception handling.
* solib.c: Use C++ exception handling.
* solib-svr4.c: Use C++ exception handling.
* solib-spu.c: Use C++ exception handling.
* solib-frv.c: Use C++ exception handling.
* solib-dsbt.c: Use C++ exception handling.
* selftest-arch.c: Use C++ exception handling.
* s390-tdep.c: Use C++ exception handling.
* rust-lang.c: Use C++ exception handling.
* rust-exp.y: Use C++ exception handling.
* rs6000-tdep.c: Use C++ exception handling.
* rs6000-aix-tdep.c: Use C++ exception handling.
* riscv-tdep.c: Use C++ exception handling.
* remote.c: Use C++ exception handling.
* remote-fileio.c: Use C++ exception handling.
* record-full.c: Use C++ exception handling.
* record-btrace.c: Use C++ exception handling.
* python/python.c: Use C++ exception handling.
* python/py-value.c: Use C++ exception handling.
* python/py-utils.c: Use C++ exception handling.
* python/py-unwind.c: Use C++ exception handling.
* python/py-type.c: Use C++ exception handling.
* python/py-symbol.c: Use C++ exception handling.
* python/py-record.c: Use C++ exception handling.
* python/py-record-btrace.c: Use C++ exception handling.
* python/py-progspace.c: Use C++ exception handling.
* python/py-prettyprint.c: Use C++ exception handling.
* python/py-param.c: Use C++ exception handling.
* python/py-objfile.c: Use C++ exception handling.
* python/py-linetable.c: Use C++ exception handling.
* python/py-lazy-string.c: Use C++ exception handling.
* python/py-infthread.c: Use C++ exception handling.
* python/py-inferior.c: Use C++ exception handling.
* python/py-gdb-readline.c: Use C++ exception handling.
* python/py-framefilter.c: Use C++ exception handling.
* python/py-frame.c: Use C++ exception handling.
* python/py-finishbreakpoint.c: Use C++ exception handling.
* python/py-cmd.c: Use C++ exception handling.
* python/py-breakpoint.c: Use C++ exception handling.
* python/py-arch.c: Use C++ exception handling.
* printcmd.c: Use C++ exception handling.
* ppc-linux-tdep.c: Use C++ exception handling.
* parse.c: Use C++ exception handling.
* p-valprint.c: Use C++ exception handling.
* objc-lang.c: Use C++ exception handling.
* mi/mi-main.c: Use C++ exception handling.
* mi/mi-interp.c: Use C++ exception handling.
* mi/mi-cmd-stack.c: Use C++ exception handling.
* mi/mi-cmd-break.c: Use C++ exception handling.
* main.c: Use C++ exception handling.
* linux-thread-db.c: Use C++ exception handling.
* linux-tdep.c: Use C++ exception handling.
* linux-nat.c: Use C++ exception handling.
* linux-fork.c: Use C++ exception handling.
* linespec.c: Use C++ exception handling.
* language.c: Use C++ exception handling.
* jit.c: Use C++ exception handling.
* infrun.c: Use C++ exception handling.
* infcmd.c: Use C++ exception handling.
* infcall.c: Use C++ exception handling.
* inf-loop.c: Use C++ exception handling.
* i386-tdep.c: Use C++ exception handling.
* i386-linux-tdep.c: Use C++ exception handling.
* guile/scm-value.c: Use C++ exception handling.
* guile/scm-type.c: Use C++ exception handling.
* guile/scm-symtab.c: Use C++ exception handling.
* guile/scm-symbol.c: Use C++ exception handling.
* guile/scm-pretty-print.c: Use C++ exception handling.
* guile/scm-ports.c: Use C++ exception handling.
* guile/scm-param.c: Use C++ exception handling.
* guile/scm-math.c: Use C++ exception handling.
* guile/scm-lazy-string.c: Use C++ exception handling.
* guile/scm-frame.c: Use C++ exception handling.
* guile/scm-disasm.c: Use C++ exception handling.
* guile/scm-cmd.c: Use C++ exception handling.
* guile/scm-breakpoint.c: Use C++ exception handling.
* guile/scm-block.c: Use C++ exception handling.
* guile/guile-internal.h: Use C++ exception handling.
* gnu-v3-abi.c: Use C++ exception handling.
* gdbtypes.c: Use C++ exception handling.
* frame.c: Use C++ exception handling.
* frame-unwind.c: Use C++ exception handling.
* fbsd-tdep.c: Use C++ exception handling.
* f-valprint.c: Use C++ exception handling.
* exec.c: Use C++ exception handling.
* event-top.c: Use C++ exception handling.
* event-loop.c: Use C++ exception handling.
* eval.c: Use C++ exception handling.
* dwarf2read.c: Use C++ exception handling.
* dwarf2loc.c: Use C++ exception handling.
* dwarf2-frame.c: Use C++ exception handling.
* dwarf2-frame-tailcall.c: Use C++ exception handling.
* dwarf-index-write.c: Use C++ exception handling.
* dwarf-index-cache.c: Use C++ exception handling.
* dtrace-probe.c: Use C++ exception handling.
* disasm-selftests.c: Use C++ exception handling.
* darwin-nat.c: Use C++ exception handling.
* cp-valprint.c: Use C++ exception handling.
* cp-support.c: Use C++ exception handling.
* cp-abi.c: Use C++ exception handling.
* corelow.c: Use C++ exception handling.
* completer.c: Use C++ exception handling.
* compile/compile-object-run.c: Use C++ exception handling.
* compile/compile-object-load.c: Use C++ exception handling.
* compile/compile-cplus-symbols.c: Use C++ exception handling.
* compile/compile-c-symbols.c: Use C++ exception handling.
* common/selftest.c: Use C++ exception handling.
* common/new-op.c: Use C++ exception handling.
* cli/cli-script.c: Use C++ exception handling.
* cli/cli-interp.c: Use C++ exception handling.
* cli/cli-cmds.c: Use C++ exception handling.
* c-varobj.c: Use C++ exception handling.
* btrace.c: Use C++ exception handling.
* breakpoint.c: Use C++ exception handling.
* break-catch-throw.c: Use C++ exception handling.
* arch-utils.c: Use C++ exception handling.
* amd64-tdep.c: Use C++ exception handling.
* ada-valprint.c: Use C++ exception handling.
* ada-typeprint.c: Use C++ exception handling.
* ada-lang.c: Use C++ exception handling.
* aarch64-tdep.c: Use C++ exception handling.
Make exceptions use std::string and be self-managing This changes the exception's "message" member to be a shared_ptr wrapping a std::string. This allows removing the stack of exception messages, because now exceptions will self-destruct when needed. This also adds a noexcept copy constructor and operator= to gdb_exception, plus a "what" method. gdb/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * xml-support.c (gdb_xml_parser::parse): Update. * x86-linux-nat.c (x86_linux_nat_target::enable_btrace): Update. * value.c (show_convenience): Update. * unittests/cli-utils-selftests.c (test_number_or_range_parser) (test_parse_flags_qcs): Update. * thread.c (thr_try_catch_cmd): Update. * target.c (target_translate_tls_address): Update. * stack.c (print_frame_arg, read_frame_local, read_frame_arg) (info_frame_command_core, frame_apply_command_count): Update. * rust-exp.y (rust_lex_exception_test): Update. * riscv-tdep.c (riscv_print_one_register_info): Update. * remote.c (remote_target::enable_btrace): Update. * record-btrace.c (record_btrace_enable_warn): Update. * python/py-utils.c (gdbpy_convert_exception): Update. * printcmd.c (do_one_display, print_variable_and_value): Update. * mi/mi-main.c (mi_print_exception): Update. * mi/mi-interp.c (mi_cmd_interpreter_exec): Use SCOPE_EXIT. * mi/mi-cmd-stack.c (list_arg_or_local): Update. * linux-nat.c (linux_nat_target::attach): Update. * linux-fork.c (class scoped_switch_fork_info): Update. * infrun.c (displaced_step_prepare): Update. * infcall.c (call_function_by_hand_dummy): Update. * guile/scm-exception.c (gdbscm_scm_from_gdb_exception): Update. * gnu-v3-abi.c (print_one_vtable): Update. * frame.c (get_prev_frame_always): Update. * f-valprint.c (info_common_command_for_block): Update. * exec.c (try_open_exec_file): Update. * exceptions.c (print_exception, exception_print) (exception_fprintf, exception_print_same): Update. * dwarf2-frame.c (dwarf2_build_frame_info): Update. * dwarf-index-cache.c (index_cache::store) (index_cache::lookup_gdb_index): Update. * darwin-nat.c (maybe_cache_shell): Update. * cp-valprint.c (cp_print_value_fields): Update. * compile/compile-cplus-symbols.c (gcc_cplus_convert_symbol) (gcc_cplus_symbol_address): Update. * compile/compile-c-symbols.c (gcc_convert_symbol) (gcc_symbol_address, generate_c_for_for_one_variable): Update. * common/selftest.c: Update. * common/common-exceptions.h (struct gdb_exception) <message>: Now a std::string. (exception_try_scope_entry, exception_try_scope_exit): Don't declare. (struct exception_try_scope): Remove. (TRY): Don't use exception_try_scope. (struct gdb_exception): Add constructor, operator=. <what>: New method. (struct gdb_exception_RETURN_MASK_ALL) (struct gdb_exception_RETURN_MASK_ERROR) (struct gdb_exception_RETURN_MASK_QUIT): Add constructor. (struct gdb_quit_bad_alloc): Update. * common/common-exceptions.c (exception_none): Change initializer. (struct catcher) <state, exception>: Initialize inline. <prev>: Remove member. (current_catcher): Remove. (catchers): New global. (exceptions_state_mc_init): Simplify. (catcher_pop): Remove. (exceptions_state_mc, exceptions_state_mc_catch): Update. (try_scope_depth, exception_try_scope_entry) (exception_try_scope_exit): Remove. (throw_exception_sjlj): Update. (exception_messages, exception_messages_size): Remove. (throw_it): Simplify. (gdb_exception_sliced_copy): Remove. (throw_exception_cxx): Update. * cli/cli-script.c (script_from_file): Update. * breakpoint.c (insert_bp_location, update_breakpoint_locations): Update. * ada-valprint.c (ada_val_print): Update. * ada-lang.c (ada_to_fixed_type_1, ada_exception_name_addr) (create_excep_cond_exprs): Update. gdb/gdbserver/ChangeLog 2019-04-08 Tom Tromey <tom@tromey.com> * server.c (handle_btrace_general_set, handle_qxfer_btrace) (handle_qxfer_btrace_conf, detach_or_kill_for_exit_cleanup) (captured_main, main): Update. * gdbreplay.c (main): Update.
2019-01-28 18:11:10 +01:00
2019-04-08 Tom Tromey <tom@tromey.com>
* xml-support.c (gdb_xml_parser::parse): Update.
* x86-linux-nat.c (x86_linux_nat_target::enable_btrace): Update.
* value.c (show_convenience): Update.
* unittests/cli-utils-selftests.c (test_number_or_range_parser)
(test_parse_flags_qcs): Update.
* thread.c (thr_try_catch_cmd): Update.
* target.c (target_translate_tls_address): Update.
* stack.c (print_frame_arg, read_frame_local, read_frame_arg)
(info_frame_command_core, frame_apply_command_count): Update.
* rust-exp.y (rust_lex_exception_test): Update.
* riscv-tdep.c (riscv_print_one_register_info): Update.
* remote.c (remote_target::enable_btrace): Update.
* record-btrace.c (record_btrace_enable_warn): Update.
* python/py-utils.c (gdbpy_convert_exception): Update.
* printcmd.c (do_one_display, print_variable_and_value): Update.
* mi/mi-main.c (mi_print_exception): Update.
* mi/mi-interp.c (mi_cmd_interpreter_exec): Use SCOPE_EXIT.
* mi/mi-cmd-stack.c (list_arg_or_local): Update.
* linux-nat.c (linux_nat_target::attach): Update.
* linux-fork.c (class scoped_switch_fork_info): Update.
* infrun.c (displaced_step_prepare): Update.
* infcall.c (call_function_by_hand_dummy): Update.
* guile/scm-exception.c (gdbscm_scm_from_gdb_exception): Update.
* gnu-v3-abi.c (print_one_vtable): Update.
* frame.c (get_prev_frame_always): Update.
* f-valprint.c (info_common_command_for_block): Update.
* exec.c (try_open_exec_file): Update.
* exceptions.c (print_exception, exception_print)
(exception_fprintf, exception_print_same): Update.
* dwarf2-frame.c (dwarf2_build_frame_info): Update.
* dwarf-index-cache.c (index_cache::store)
(index_cache::lookup_gdb_index): Update.
* darwin-nat.c (maybe_cache_shell): Update.
* cp-valprint.c (cp_print_value_fields): Update.
* compile/compile-cplus-symbols.c (gcc_cplus_convert_symbol)
(gcc_cplus_symbol_address): Update.
* compile/compile-c-symbols.c (gcc_convert_symbol)
(gcc_symbol_address, generate_c_for_for_one_variable): Update.
* common/selftest.c: Update.
* common/common-exceptions.h (struct gdb_exception) <message>: Now
a std::string.
(exception_try_scope_entry, exception_try_scope_exit): Don't
declare.
(struct exception_try_scope): Remove.
(TRY): Don't use exception_try_scope.
(struct gdb_exception): Add constructor, operator=.
<what>: New method.
(struct gdb_exception_RETURN_MASK_ALL)
(struct gdb_exception_RETURN_MASK_ERROR)
(struct gdb_exception_RETURN_MASK_QUIT): Add constructor.
(struct gdb_quit_bad_alloc): Update.
* common/common-exceptions.c (exception_none): Change
initializer.
(struct catcher) <state, exception>: Initialize inline.
<prev>: Remove member.
(current_catcher): Remove.
(catchers): New global.
(exceptions_state_mc_init): Simplify.
(catcher_pop): Remove.
(exceptions_state_mc, exceptions_state_mc_catch): Update.
(try_scope_depth, exception_try_scope_entry)
(exception_try_scope_exit): Remove.
(throw_exception_sjlj): Update.
(exception_messages, exception_messages_size): Remove.
(throw_it): Simplify.
(gdb_exception_sliced_copy): Remove.
(throw_exception_cxx): Update.
* cli/cli-script.c (script_from_file): Update.
* breakpoint.c (insert_bp_location, update_breakpoint_locations):
Update.
* ada-valprint.c (ada_val_print): Update.
* ada-lang.c (ada_to_fixed_type_1, ada_exception_name_addr)
(create_excep_cond_exprs): Update.
2019-04-08 Tom Tromey <tom@tromey.com>
* common/common-exceptions.h (GDB_XCPT_SJMP, GDB_XCPT_TRY)
(GDB_XCPT_RAW_TRY, GDB_XCPT): Remove.
(TRY, CATCH, END_CATCH): Remove some definitions.
* common/common-exceptions.c: Don't use GDB_XCPT.
(catcher_list_size): Remove.
(throw_exception, throw_it): Simplify.
Revert the header-sorting patch Andreas Schwab and John Baldwin pointed out some bugs in the header sorting patch; and I noticed that the output was not correct when limited to a subset of files (a bug in my script). So, I'm reverting the patch. I may try again after fixing the issues pointed out. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> Revert the header-sorting patch. * ft32-tdep.c: Revert. * frv-tdep.c: Revert. * frv-linux-tdep.c: Revert. * frame.c: Revert. * frame-unwind.c: Revert. * frame-base.c: Revert. * fork-child.c: Revert. * findvar.c: Revert. * findcmd.c: Revert. * filesystem.c: Revert. * filename-seen-cache.h: Revert. * filename-seen-cache.c: Revert. * fbsd-tdep.c: Revert. * fbsd-nat.h: Revert. * fbsd-nat.c: Revert. * f-valprint.c: Revert. * f-typeprint.c: Revert. * f-lang.c: Revert. * extension.h: Revert. * extension.c: Revert. * extension-priv.h: Revert. * expprint.c: Revert. * exec.h: Revert. * exec.c: Revert. * exceptions.c: Revert. * event-top.c: Revert. * event-loop.c: Revert. * eval.c: Revert. * elfread.c: Revert. * dwarf2read.h: Revert. * dwarf2read.c: Revert. * dwarf2loc.c: Revert. * dwarf2expr.h: Revert. * dwarf2expr.c: Revert. * dwarf2-frame.c: Revert. * dwarf2-frame-tailcall.c: Revert. * dwarf-index-write.h: Revert. * dwarf-index-write.c: Revert. * dwarf-index-common.c: Revert. * dwarf-index-cache.h: Revert. * dwarf-index-cache.c: Revert. * dummy-frame.c: Revert. * dtrace-probe.c: Revert. * disasm.h: Revert. * disasm.c: Revert. * disasm-selftests.c: Revert. * dictionary.c: Revert. * dicos-tdep.c: Revert. * demangle.c: Revert. * dcache.h: Revert. * dcache.c: Revert. * darwin-nat.h: Revert. * darwin-nat.c: Revert. * darwin-nat-info.c: Revert. * d-valprint.c: Revert. * d-namespace.c: Revert. * d-lang.c: Revert. * ctf.c: Revert. * csky-tdep.c: Revert. * csky-linux-tdep.c: Revert. * cris-tdep.c: Revert. * cris-linux-tdep.c: Revert. * cp-valprint.c: Revert. * cp-support.c: Revert. * cp-namespace.c: Revert. * cp-abi.c: Revert. * corelow.c: Revert. * corefile.c: Revert. * continuations.c: Revert. * completer.h: Revert. * completer.c: Revert. * complaints.c: Revert. * coffread.c: Revert. * coff-pe-read.c: Revert. * cli-out.h: Revert. * cli-out.c: Revert. * charset.c: Revert. * c-varobj.c: Revert. * c-valprint.c: Revert. * c-typeprint.c: Revert. * c-lang.c: Revert. * buildsym.c: Revert. * buildsym-legacy.c: Revert. * build-id.h: Revert. * build-id.c: Revert. * btrace.c: Revert. * bsd-uthread.c: Revert. * breakpoint.h: Revert. * breakpoint.c: Revert. * break-catch-throw.c: Revert. * break-catch-syscall.c: Revert. * break-catch-sig.c: Revert. * blockframe.c: Revert. * block.c: Revert. * bfin-tdep.c: Revert. * bfin-linux-tdep.c: Revert. * bfd-target.c: Revert. * bcache.c: Revert. * ax-general.c: Revert. * ax-gdb.h: Revert. * ax-gdb.c: Revert. * avr-tdep.c: Revert. * auxv.c: Revert. * auto-load.c: Revert. * arm-wince-tdep.c: Revert. * arm-tdep.c: Revert. * arm-symbian-tdep.c: Revert. * arm-pikeos-tdep.c: Revert. * arm-obsd-tdep.c: Revert. * arm-nbsd-tdep.c: Revert. * arm-nbsd-nat.c: Revert. * arm-linux-tdep.c: Revert. * arm-linux-nat.c: Revert. * arm-fbsd-tdep.c: Revert. * arm-fbsd-nat.c: Revert. * arm-bsd-tdep.c: Revert. * arch-utils.c: Revert. * arc-tdep.c: Revert. * arc-newlib-tdep.c: Revert. * annotate.h: Revert. * annotate.c: Revert. * amd64-windows-tdep.c: Revert. * amd64-windows-nat.c: Revert. * amd64-tdep.c: Revert. * amd64-sol2-tdep.c: Revert. * amd64-obsd-tdep.c: Revert. * amd64-obsd-nat.c: Revert. * amd64-nbsd-tdep.c: Revert. * amd64-nbsd-nat.c: Revert. * amd64-nat.c: Revert. * amd64-linux-tdep.c: Revert. * amd64-linux-nat.c: Revert. * amd64-fbsd-tdep.c: Revert. * amd64-fbsd-nat.c: Revert. * amd64-dicos-tdep.c: Revert. * amd64-darwin-tdep.c: Revert. * amd64-bsd-nat.c: Revert. * alpha-tdep.c: Revert. * alpha-obsd-tdep.c: Revert. * alpha-nbsd-tdep.c: Revert. * alpha-mdebug-tdep.c: Revert. * alpha-linux-tdep.c: Revert. * alpha-linux-nat.c: Revert. * alpha-bsd-tdep.c: Revert. * alpha-bsd-nat.c: Revert. * aix-thread.c: Revert. * agent.c: Revert. * addrmap.c: Revert. * ada-varobj.c: Revert. * ada-valprint.c: Revert. * ada-typeprint.c: Revert. * ada-tasks.c: Revert. * ada-lang.c: Revert. * aarch64-tdep.c: Revert. * aarch64-ravenscar-thread.c: Revert. * aarch64-newlib-tdep.c: Revert. * aarch64-linux-tdep.c: Revert. * aarch64-linux-nat.c: Revert. * aarch64-fbsd-tdep.c: Revert. * aarch64-fbsd-nat.c: Revert. * aarch32-linux-nat.c: Revert.
2019-04-06 21:38:10 +02:00
2019-04-05 Tom Tromey <tom@tromey.com>
Revert the header-sorting patch.
* ft32-tdep.c: Revert.
* frv-tdep.c: Revert.
* frv-linux-tdep.c: Revert.
* frame.c: Revert.
* frame-unwind.c: Revert.
* frame-base.c: Revert.
* fork-child.c: Revert.
* findvar.c: Revert.
* findcmd.c: Revert.
* filesystem.c: Revert.
* filename-seen-cache.h: Revert.
* filename-seen-cache.c: Revert.
* fbsd-tdep.c: Revert.
* fbsd-nat.h: Revert.
* fbsd-nat.c: Revert.
* f-valprint.c: Revert.
* f-typeprint.c: Revert.
* f-lang.c: Revert.
* extension.h: Revert.
* extension.c: Revert.
* extension-priv.h: Revert.
* expprint.c: Revert.
* exec.h: Revert.
* exec.c: Revert.
* exceptions.c: Revert.
* event-top.c: Revert.
* event-loop.c: Revert.
* eval.c: Revert.
* elfread.c: Revert.
* dwarf2read.h: Revert.
* dwarf2read.c: Revert.
* dwarf2loc.c: Revert.
* dwarf2expr.h: Revert.
* dwarf2expr.c: Revert.
* dwarf2-frame.c: Revert.
* dwarf2-frame-tailcall.c: Revert.
* dwarf-index-write.h: Revert.
* dwarf-index-write.c: Revert.
* dwarf-index-common.c: Revert.
* dwarf-index-cache.h: Revert.
* dwarf-index-cache.c: Revert.
* dummy-frame.c: Revert.
* dtrace-probe.c: Revert.
* disasm.h: Revert.
* disasm.c: Revert.
* disasm-selftests.c: Revert.
* dictionary.c: Revert.
* dicos-tdep.c: Revert.
* demangle.c: Revert.
* dcache.h: Revert.
* dcache.c: Revert.
* darwin-nat.h: Revert.
* darwin-nat.c: Revert.
* darwin-nat-info.c: Revert.
* d-valprint.c: Revert.
* d-namespace.c: Revert.
* d-lang.c: Revert.
* ctf.c: Revert.
* csky-tdep.c: Revert.
* csky-linux-tdep.c: Revert.
* cris-tdep.c: Revert.
* cris-linux-tdep.c: Revert.
* cp-valprint.c: Revert.
* cp-support.c: Revert.
* cp-namespace.c: Revert.
* cp-abi.c: Revert.
* corelow.c: Revert.
* corefile.c: Revert.
* continuations.c: Revert.
* completer.h: Revert.
* completer.c: Revert.
* complaints.c: Revert.
* coffread.c: Revert.
* coff-pe-read.c: Revert.
* cli-out.h: Revert.
* cli-out.c: Revert.
* charset.c: Revert.
* c-varobj.c: Revert.
* c-valprint.c: Revert.
* c-typeprint.c: Revert.
* c-lang.c: Revert.
* buildsym.c: Revert.
* buildsym-legacy.c: Revert.
* build-id.h: Revert.
* build-id.c: Revert.
* btrace.c: Revert.
* bsd-uthread.c: Revert.
* breakpoint.h: Revert.
* breakpoint.c: Revert.
* break-catch-throw.c: Revert.
* break-catch-syscall.c: Revert.
* break-catch-sig.c: Revert.
* blockframe.c: Revert.
* block.c: Revert.
* bfin-tdep.c: Revert.
* bfin-linux-tdep.c: Revert.
* bfd-target.c: Revert.
* bcache.c: Revert.
* ax-general.c: Revert.
* ax-gdb.h: Revert.
* ax-gdb.c: Revert.
* avr-tdep.c: Revert.
* auxv.c: Revert.
* auto-load.c: Revert.
* arm-wince-tdep.c: Revert.
* arm-tdep.c: Revert.
* arm-symbian-tdep.c: Revert.
* arm-pikeos-tdep.c: Revert.
* arm-obsd-tdep.c: Revert.
* arm-nbsd-tdep.c: Revert.
* arm-nbsd-nat.c: Revert.
* arm-linux-tdep.c: Revert.
* arm-linux-nat.c: Revert.
* arm-fbsd-tdep.c: Revert.
* arm-fbsd-nat.c: Revert.
* arm-bsd-tdep.c: Revert.
* arch-utils.c: Revert.
* arc-tdep.c: Revert.
* arc-newlib-tdep.c: Revert.
* annotate.h: Revert.
* annotate.c: Revert.
* amd64-windows-tdep.c: Revert.
* amd64-windows-nat.c: Revert.
* amd64-tdep.c: Revert.
* amd64-sol2-tdep.c: Revert.
* amd64-obsd-tdep.c: Revert.
* amd64-obsd-nat.c: Revert.
* amd64-nbsd-tdep.c: Revert.
* amd64-nbsd-nat.c: Revert.
* amd64-nat.c: Revert.
* amd64-linux-tdep.c: Revert.
* amd64-linux-nat.c: Revert.
* amd64-fbsd-tdep.c: Revert.
* amd64-fbsd-nat.c: Revert.
* amd64-dicos-tdep.c: Revert.
* amd64-darwin-tdep.c: Revert.
* amd64-bsd-nat.c: Revert.
* alpha-tdep.c: Revert.
* alpha-obsd-tdep.c: Revert.
* alpha-nbsd-tdep.c: Revert.
* alpha-mdebug-tdep.c: Revert.
* alpha-linux-tdep.c: Revert.
* alpha-linux-nat.c: Revert.
* alpha-bsd-tdep.c: Revert.
* alpha-bsd-nat.c: Revert.
* aix-thread.c: Revert.
* agent.c: Revert.
* addrmap.c: Revert.
* ada-varobj.c: Revert.
* ada-valprint.c: Revert.
* ada-typeprint.c: Revert.
* ada-tasks.c: Revert.
* ada-lang.c: Revert.
* aarch64-tdep.c: Revert.
* aarch64-ravenscar-thread.c: Revert.
* aarch64-newlib-tdep.c: Revert.
* aarch64-linux-tdep.c: Revert.
* aarch64-linux-nat.c: Revert.
* aarch64-fbsd-tdep.c: Revert.
* aarch64-fbsd-nat.c: Revert.
* aarch32-linux-nat.c: Revert.
Sort includes for files gdb/[a-f]*.[chyl]. This patch sorts the include files for the files [a-f]*.[chyl]. The patch was written by a script. Tested by the buildbot. I will follow up with patches to sort the remaining files, by sorting a subset, testing them, and then checking them in. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> * ft32-tdep.c: Sort headers. * frv-tdep.c: Sort headers. * frv-linux-tdep.c: Sort headers. * frame.c: Sort headers. * frame-unwind.c: Sort headers. * frame-base.c: Sort headers. * fork-child.c: Sort headers. * findvar.c: Sort headers. * findcmd.c: Sort headers. * filesystem.c: Sort headers. * filename-seen-cache.h: Sort headers. * filename-seen-cache.c: Sort headers. * fbsd-tdep.c: Sort headers. * fbsd-nat.h: Sort headers. * fbsd-nat.c: Sort headers. * f-valprint.c: Sort headers. * f-typeprint.c: Sort headers. * f-lang.c: Sort headers. * extension.h: Sort headers. * extension.c: Sort headers. * extension-priv.h: Sort headers. * expprint.c: Sort headers. * exec.h: Sort headers. * exec.c: Sort headers. * exceptions.c: Sort headers. * event-top.c: Sort headers. * event-loop.c: Sort headers. * eval.c: Sort headers. * elfread.c: Sort headers. * dwarf2read.h: Sort headers. * dwarf2read.c: Sort headers. * dwarf2loc.c: Sort headers. * dwarf2expr.h: Sort headers. * dwarf2expr.c: Sort headers. * dwarf2-frame.c: Sort headers. * dwarf2-frame-tailcall.c: Sort headers. * dwarf-index-write.h: Sort headers. * dwarf-index-write.c: Sort headers. * dwarf-index-common.c: Sort headers. * dwarf-index-cache.h: Sort headers. * dwarf-index-cache.c: Sort headers. * dummy-frame.c: Sort headers. * dtrace-probe.c: Sort headers. * disasm.h: Sort headers. * disasm.c: Sort headers. * disasm-selftests.c: Sort headers. * dictionary.c: Sort headers. * dicos-tdep.c: Sort headers. * demangle.c: Sort headers. * dcache.h: Sort headers. * dcache.c: Sort headers. * darwin-nat.h: Sort headers. * darwin-nat.c: Sort headers. * darwin-nat-info.c: Sort headers. * d-valprint.c: Sort headers. * d-namespace.c: Sort headers. * d-lang.c: Sort headers. * ctf.c: Sort headers. * csky-tdep.c: Sort headers. * csky-linux-tdep.c: Sort headers. * cris-tdep.c: Sort headers. * cris-linux-tdep.c: Sort headers. * cp-valprint.c: Sort headers. * cp-support.c: Sort headers. * cp-namespace.c: Sort headers. * cp-abi.c: Sort headers. * corelow.c: Sort headers. * corefile.c: Sort headers. * continuations.c: Sort headers. * completer.h: Sort headers. * completer.c: Sort headers. * complaints.c: Sort headers. * coffread.c: Sort headers. * coff-pe-read.c: Sort headers. * cli-out.h: Sort headers. * cli-out.c: Sort headers. * charset.c: Sort headers. * c-varobj.c: Sort headers. * c-valprint.c: Sort headers. * c-typeprint.c: Sort headers. * c-lang.c: Sort headers. * buildsym.c: Sort headers. * buildsym-legacy.c: Sort headers. * build-id.h: Sort headers. * build-id.c: Sort headers. * btrace.c: Sort headers. * bsd-uthread.c: Sort headers. * breakpoint.h: Sort headers. * breakpoint.c: Sort headers. * break-catch-throw.c: Sort headers. * break-catch-syscall.c: Sort headers. * break-catch-sig.c: Sort headers. * blockframe.c: Sort headers. * block.c: Sort headers. * bfin-tdep.c: Sort headers. * bfin-linux-tdep.c: Sort headers. * bfd-target.c: Sort headers. * bcache.c: Sort headers. * ax-general.c: Sort headers. * ax-gdb.h: Sort headers. * ax-gdb.c: Sort headers. * avr-tdep.c: Sort headers. * auxv.c: Sort headers. * auto-load.c: Sort headers. * arm-wince-tdep.c: Sort headers. * arm-tdep.c: Sort headers. * arm-symbian-tdep.c: Sort headers. * arm-pikeos-tdep.c: Sort headers. * arm-obsd-tdep.c: Sort headers. * arm-nbsd-tdep.c: Sort headers. * arm-nbsd-nat.c: Sort headers. * arm-linux-tdep.c: Sort headers. * arm-linux-nat.c: Sort headers. * arm-fbsd-tdep.c: Sort headers. * arm-fbsd-nat.c: Sort headers. * arm-bsd-tdep.c: Sort headers. * arch-utils.c: Sort headers. * arc-tdep.c: Sort headers. * arc-newlib-tdep.c: Sort headers. * annotate.h: Sort headers. * annotate.c: Sort headers. * amd64-windows-tdep.c: Sort headers. * amd64-windows-nat.c: Sort headers. * amd64-tdep.c: Sort headers. * amd64-sol2-tdep.c: Sort headers. * amd64-obsd-tdep.c: Sort headers. * amd64-obsd-nat.c: Sort headers. * amd64-nbsd-tdep.c: Sort headers. * amd64-nbsd-nat.c: Sort headers. * amd64-nat.c: Sort headers. * amd64-linux-tdep.c: Sort headers. * amd64-linux-nat.c: Sort headers. * amd64-fbsd-tdep.c: Sort headers. * amd64-fbsd-nat.c: Sort headers. * amd64-dicos-tdep.c: Sort headers. * amd64-darwin-tdep.c: Sort headers. * amd64-bsd-nat.c: Sort headers. * alpha-tdep.c: Sort headers. * alpha-obsd-tdep.c: Sort headers. * alpha-nbsd-tdep.c: Sort headers. * alpha-mdebug-tdep.c: Sort headers. * alpha-linux-tdep.c: Sort headers. * alpha-linux-nat.c: Sort headers. * alpha-bsd-tdep.c: Sort headers. * alpha-bsd-nat.c: Sort headers. * aix-thread.c: Sort headers. * agent.c: Sort headers. * addrmap.c: Sort headers. * ada-varobj.c: Sort headers. * ada-valprint.c: Sort headers. * ada-typeprint.c: Sort headers. * ada-tasks.c: Sort headers. * ada-lang.c: Sort headers. * aarch64-tdep.c: Sort headers. * aarch64-ravenscar-thread.c: Sort headers. * aarch64-newlib-tdep.c: Sort headers. * aarch64-linux-tdep.c: Sort headers. * aarch64-linux-nat.c: Sort headers. * aarch64-fbsd-tdep.c: Sort headers. * aarch64-fbsd-nat.c: Sort headers. * aarch32-linux-nat.c: Sort headers.
2019-04-03 04:04:24 +02:00
2019-04-05 Tom Tromey <tom@tromey.com>
* ft32-tdep.c: Sort headers.
* frv-tdep.c: Sort headers.
* frv-linux-tdep.c: Sort headers.
* frame.c: Sort headers.
* frame-unwind.c: Sort headers.
* frame-base.c: Sort headers.
* fork-child.c: Sort headers.
* findvar.c: Sort headers.
* findcmd.c: Sort headers.
* filesystem.c: Sort headers.
* filename-seen-cache.h: Sort headers.
* filename-seen-cache.c: Sort headers.
* fbsd-tdep.c: Sort headers.
* fbsd-nat.h: Sort headers.
* fbsd-nat.c: Sort headers.
* f-valprint.c: Sort headers.
* f-typeprint.c: Sort headers.
* f-lang.c: Sort headers.
* extension.h: Sort headers.
* extension.c: Sort headers.
* extension-priv.h: Sort headers.
* expprint.c: Sort headers.
* exec.h: Sort headers.
* exec.c: Sort headers.
* exceptions.c: Sort headers.
* event-top.c: Sort headers.
* event-loop.c: Sort headers.
* eval.c: Sort headers.
* elfread.c: Sort headers.
* dwarf2read.h: Sort headers.
* dwarf2read.c: Sort headers.
* dwarf2loc.c: Sort headers.
* dwarf2expr.h: Sort headers.
* dwarf2expr.c: Sort headers.
* dwarf2-frame.c: Sort headers.
* dwarf2-frame-tailcall.c: Sort headers.
* dwarf-index-write.h: Sort headers.
* dwarf-index-write.c: Sort headers.
* dwarf-index-common.c: Sort headers.
* dwarf-index-cache.h: Sort headers.
* dwarf-index-cache.c: Sort headers.
* dummy-frame.c: Sort headers.
* dtrace-probe.c: Sort headers.
* disasm.h: Sort headers.
* disasm.c: Sort headers.
* disasm-selftests.c: Sort headers.
* dictionary.c: Sort headers.
* dicos-tdep.c: Sort headers.
* demangle.c: Sort headers.
* dcache.h: Sort headers.
* dcache.c: Sort headers.
* darwin-nat.h: Sort headers.
* darwin-nat.c: Sort headers.
* darwin-nat-info.c: Sort headers.
* d-valprint.c: Sort headers.
* d-namespace.c: Sort headers.
* d-lang.c: Sort headers.
* ctf.c: Sort headers.
* csky-tdep.c: Sort headers.
* csky-linux-tdep.c: Sort headers.
* cris-tdep.c: Sort headers.
* cris-linux-tdep.c: Sort headers.
* cp-valprint.c: Sort headers.
* cp-support.c: Sort headers.
* cp-namespace.c: Sort headers.
* cp-abi.c: Sort headers.
* corelow.c: Sort headers.
* corefile.c: Sort headers.
* continuations.c: Sort headers.
* completer.h: Sort headers.
* completer.c: Sort headers.
* complaints.c: Sort headers.
* coffread.c: Sort headers.
* coff-pe-read.c: Sort headers.
* cli-out.h: Sort headers.
* cli-out.c: Sort headers.
* charset.c: Sort headers.
* c-varobj.c: Sort headers.
* c-valprint.c: Sort headers.
* c-typeprint.c: Sort headers.
* c-lang.c: Sort headers.
* buildsym.c: Sort headers.
* buildsym-legacy.c: Sort headers.
* build-id.h: Sort headers.
* build-id.c: Sort headers.
* btrace.c: Sort headers.
* bsd-uthread.c: Sort headers.
* breakpoint.h: Sort headers.
* breakpoint.c: Sort headers.
* break-catch-throw.c: Sort headers.
* break-catch-syscall.c: Sort headers.
* break-catch-sig.c: Sort headers.
* blockframe.c: Sort headers.
* block.c: Sort headers.
* bfin-tdep.c: Sort headers.
* bfin-linux-tdep.c: Sort headers.
* bfd-target.c: Sort headers.
* bcache.c: Sort headers.
* ax-general.c: Sort headers.
* ax-gdb.h: Sort headers.
* ax-gdb.c: Sort headers.
* avr-tdep.c: Sort headers.
* auxv.c: Sort headers.
* auto-load.c: Sort headers.
* arm-wince-tdep.c: Sort headers.
* arm-tdep.c: Sort headers.
* arm-symbian-tdep.c: Sort headers.
* arm-pikeos-tdep.c: Sort headers.
* arm-obsd-tdep.c: Sort headers.
* arm-nbsd-tdep.c: Sort headers.
* arm-nbsd-nat.c: Sort headers.
* arm-linux-tdep.c: Sort headers.
* arm-linux-nat.c: Sort headers.
* arm-fbsd-tdep.c: Sort headers.
* arm-fbsd-nat.c: Sort headers.
* arm-bsd-tdep.c: Sort headers.
* arch-utils.c: Sort headers.
* arc-tdep.c: Sort headers.
* arc-newlib-tdep.c: Sort headers.
* annotate.h: Sort headers.
* annotate.c: Sort headers.
* amd64-windows-tdep.c: Sort headers.
* amd64-windows-nat.c: Sort headers.
* amd64-tdep.c: Sort headers.
* amd64-sol2-tdep.c: Sort headers.
* amd64-obsd-tdep.c: Sort headers.
* amd64-obsd-nat.c: Sort headers.
* amd64-nbsd-tdep.c: Sort headers.
* amd64-nbsd-nat.c: Sort headers.
* amd64-nat.c: Sort headers.
* amd64-linux-tdep.c: Sort headers.
* amd64-linux-nat.c: Sort headers.
* amd64-fbsd-tdep.c: Sort headers.
* amd64-fbsd-nat.c: Sort headers.
* amd64-dicos-tdep.c: Sort headers.
* amd64-darwin-tdep.c: Sort headers.
* amd64-bsd-nat.c: Sort headers.
* alpha-tdep.c: Sort headers.
* alpha-obsd-tdep.c: Sort headers.
* alpha-nbsd-tdep.c: Sort headers.
* alpha-mdebug-tdep.c: Sort headers.
* alpha-linux-tdep.c: Sort headers.
* alpha-linux-nat.c: Sort headers.
* alpha-bsd-tdep.c: Sort headers.
* alpha-bsd-nat.c: Sort headers.
* aix-thread.c: Sort headers.
* agent.c: Sort headers.
* addrmap.c: Sort headers.
* ada-varobj.c: Sort headers.
* ada-valprint.c: Sort headers.
* ada-typeprint.c: Sort headers.
* ada-tasks.c: Sort headers.
* ada-lang.c: Sort headers.
* aarch64-tdep.c: Sort headers.
* aarch64-ravenscar-thread.c: Sort headers.
* aarch64-newlib-tdep.c: Sort headers.
* aarch64-linux-tdep.c: Sort headers.
* aarch64-linux-nat.c: Sort headers.
* aarch64-fbsd-tdep.c: Sort headers.
* aarch64-fbsd-nat.c: Sort headers.
* aarch32-linux-nat.c: Sort headers.
Move innermost_block_tracker global to parse_state This changes the parsing API so that callers that are interested in tracking the innermost block must instantiate an innermost_block_tracker and pass it in. Then, a pointer to this object is stored in the parser_state. 2019-04-04 Tom Tromey <tom@tromey.com> * varobj.c (varobj_create): Update. * rust-exp.y (struct rust_parser) <update_innermost_block, lookup_symbol>: New methods. (rust_parser::update_innermost_block, rust_parser::lookup_symbol): Rename. (rust_parser::rust_lookup_type) (rust_parser::convert_ast_to_expression, rust_lex_tests): Update. * printcmd.c (display_command, do_one_display): Update. * parser-defs.h (struct parser_state) <parser_state>: Add "tracker" parameter. (block_tracker): New member. (class innermost_block_tracker) <innermost_block_tracker>: Add "types" parameter. <reset>: Remove method. (innermost_block): Don't declare. (null_post_parser): Update. * parse.c (innermost_block): Remove global. (write_dollar_variable): Update. (parse_exp_1, parse_exp_in_context): Add "tracker" parameter. Remove "tracker_types" parameter. (parse_expression): Add "tracker" parameter. (parse_expression_for_completion): Update. (null_post_parser): Add "tracker" parameter. * p-exp.y: Update rules. * m2-exp.y: Update rules. * language.h (struct language_defn) <la_post_parser>: Add "tracker" parameter. * go-exp.y: Update rules. * f-exp.y: Update rules. * expression.h (parse_expression, parse_exp_1): Add "tracker" parameter. * d-exp.y: Update rules. * c-exp.y: Update rules. * breakpoint.c (set_breakpoint_condition): Create an innermost_block_tracker. (watch_command_1): Likewise. * ada-lang.c (resolve): Add "tracker" parameter. (resolve_subexp): Likewise. * ada-exp.y (write_var_from_sym): Update.
2019-04-01 01:20:24 +02:00
2019-04-04 Tom Tromey <tom@tromey.com>
* varobj.c (varobj_create): Update.
* rust-exp.y (struct rust_parser) <update_innermost_block,
lookup_symbol>: New methods.
(rust_parser::update_innermost_block, rust_parser::lookup_symbol):
Rename.
(rust_parser::rust_lookup_type)
(rust_parser::convert_ast_to_expression, rust_lex_tests): Update.
* printcmd.c (display_command, do_one_display): Update.
* parser-defs.h (struct parser_state) <parser_state>: Add
"tracker" parameter.
(block_tracker): New member.
(class innermost_block_tracker) <innermost_block_tracker>: Add
"types" parameter.
<reset>: Remove method.
(innermost_block): Don't declare.
(null_post_parser): Update.
* parse.c (innermost_block): Remove global.
(write_dollar_variable): Update.
(parse_exp_1, parse_exp_in_context): Add "tracker" parameter.
Remove "tracker_types" parameter.
(parse_expression): Add "tracker" parameter.
(parse_expression_for_completion): Update.
(null_post_parser): Add "tracker" parameter.
* p-exp.y: Update rules.
* m2-exp.y: Update rules.
* language.h (struct language_defn) <la_post_parser>: Add
"tracker" parameter.
* go-exp.y: Update rules.
* f-exp.y: Update rules.
* expression.h (parse_expression, parse_exp_1): Add "tracker"
parameter.
* d-exp.y: Update rules.
* c-exp.y: Update rules.
* breakpoint.c (set_breakpoint_condition): Create an
innermost_block_tracker.
(watch_command_1): Likewise.
* ada-lang.c (resolve): Add "tracker" parameter.
(resolve_subexp): Likewise.
* ada-exp.y (write_var_from_sym): Update.
2019-04-04 Tom Tromey <tom@tromey.com>
* type-stack.h: New file.
* type-stack.c: New file.
* parser-defs.h (enum type_pieces, union type_stack_elt): Move to
type-stack.h.
(insert_into_type_stack, insert_type, push_type, push_type_int)
(insert_type_address_space, pop_type, pop_type_int)
(pop_typelist, pop_type_stack, append_type_stack)
(push_type_stack, get_type_stack, push_typelist)
(follow_type_instance_flags, follow_types): Don't declare.
* parse.c (type_stack): Remove global.
(parse_exp_in_context): Update.
(insert_into_type_stack, insert_type, push_type, push_type_int)
(insert_type_address_space, pop_type, pop_type_int)
(pop_typelist, pop_type_stack, append_type_stack)
(push_type_stack, get_type_stack, push_typelist)
(follow_type_instance_flags, follow_types): Remove (moved to
type-stack.c).
* f-exp.y (type_stack): New global.
Update rules.
(push_kind_type, f_parse): Update.
* d-exp.y (type_stack): New global.
Update rules.
(d_parse): Update.
* c-exp.y (struct c_parse_state) <type_stack>: New member.
Update rules.
* Makefile.in (COMMON_SFILES): Add type-stack.c.
(HFILES_NO_SRCDIR): Add type-stack.h.
Move completion parsing to parser_state This moves the globals and functions related to parsing for completion to parser_state. A new structure is introduced in order to return completion results from the parse back to parse_expression_for_completion. gdb/ChangeLog 2019-04-04 Tom Tromey <tom@tromey.com> * rust-exp.y (rust_parser::lex_identifier, rustyylex) (rust_parser::convert_ast_to_expression, rust_parse) (rust_lex_test_completion, rust_lex_tests): Update. * parser-defs.h (struct expr_completion_state): New. (struct parser_state) <parser_state>: Add completion parameter. <mark_struct_expression, mark_completion_tag>: New methods. <parse_completion, m_completion_state>: New members. (prefixify_expression, null_post_parser): Update. (mark_struct_expression, mark_completion_tag): Don't declare. * parse.c (parse_completion, expout_last_struct) (expout_tag_completion_type, expout_completion_name): Remove globals. (parser_state::mark_struct_expression) (parser_state::mark_completion_tag): Now methods. (prefixify_expression): Add last_struct parameter. (prefixify_subexp): Likewise. (parse_exp_1): Update. (parse_exp_in_context): Add cstate parameter. Update. (parse_expression_for_completion): Create an expr_completion_state. (null_post_parser): Add "completion" parameter. * p-exp.y: Update rules. (yylex): Update. * language.h (struct language_defn) <la_post_parser>: Add "completing" parameter. * go-exp.y: Update rules. (lex_one_token): Update. * expression.h (parse_completion): Don't declare. * d-exp.y: Update rules. (lex_one_token): Update rules. * c-exp.y: Update rules. (lex_one_token): Update. * ada-lang.c (resolve): Add "parse_completion" parameter. (resolve_subexp): Likewise. (ada_resolve_function): Likewise.
2019-03-25 05:50:14 +01:00
2019-04-04 Tom Tromey <tom@tromey.com>
* rust-exp.y (rust_parser::lex_identifier, rustyylex)
(rust_parser::convert_ast_to_expression, rust_parse)
(rust_lex_test_completion, rust_lex_tests): Update.
* parser-defs.h (struct expr_completion_state): New.
(struct parser_state) <parser_state>: Add completion parameter.
<mark_struct_expression, mark_completion_tag>: New methods.
<parse_completion, m_completion_state>: New members.
(prefixify_expression, null_post_parser): Update.
(mark_struct_expression, mark_completion_tag): Don't declare.
* parse.c (parse_completion, expout_last_struct)
(expout_tag_completion_type, expout_completion_name): Remove
globals.
(parser_state::mark_struct_expression)
(parser_state::mark_completion_tag): Now methods.
(prefixify_expression): Add last_struct parameter.
(prefixify_subexp): Likewise.
(parse_exp_1): Update.
(parse_exp_in_context): Add cstate parameter. Update.
(parse_expression_for_completion): Create an
expr_completion_state.
(null_post_parser): Add "completion" parameter.
* p-exp.y: Update rules.
(yylex): Update.
* language.h (struct language_defn) <la_post_parser>: Add
"completing" parameter.
* go-exp.y: Update rules.
(lex_one_token): Update.
* expression.h (parse_completion): Don't declare.
* d-exp.y: Update rules.
(lex_one_token): Update rules.
* c-exp.y: Update rules.
(lex_one_token): Update.
* ada-lang.c (resolve): Add "parse_completion" parameter.
(resolve_subexp): Likewise.
(ada_resolve_function): Likewise.
2019-04-04 Tom Tromey <tom@tromey.com>
* parser-defs.h (struct parser_state) <start_arglist,
end_arglist>: New methods.
<arglist_len, m_funcall_chain>: New members.
(arglist_len, start_arglist, end_arglist): Don't declare.
* parse.c (arglist_len, funcall_chain): Remove global.
(start_arglist, end_arglist): Remove functions.
(parse_exp_in_context): Update.
* p-exp.y: Update rules.
* m2-exp.y: Update rules.
* go-exp.y: Update rules.
* f-exp.y: Update rules.
* d-exp.y: Update rules.
* c-exp.y: Update rules.
2019-04-04 Tom Tromey <tom@tromey.com>
* rust-exp.y (struct rust_parser) <lex_hex, lex_escape,
lex_operator, push_back>: New methods.
Update all rules.
(rust_parser::lex_hex, lex_escape): Rename and update.
(rust_parser::lex_string, rust_parser::lex_identifier): Update.
(rust_parser::lex_operator): Rename and update.
(rust_parser::lex_number, rustyylex, rustyyerror)
(rust_lex_test_init, rust_lex_test_sequence)
(rust_lex_test_push_back, rust_lex_tests): Update.
* parser-defs.h (struct parser_state) <parser_state>: Add "input"
parameter.
<lexptr, prev_lexptr>: New members.
(lexptr, prev_lexptr): Don't declare.
* parse.c (lexptr, prev_lexptr): Remove globals.
(parse_exp_in_context): Update.
* p-exp.y (yylex, yyerror): Update.
* m2-exp.y (parse_number, yylex, yyerror): Update.
* go-exp.y (lex_one_token, yyerror): Update.
* f-exp.y (match_string_literal, yylex, yyerror): Update.
* d-exp.y (lex_one_token, yyerror): Update.
* c-exp.y (scan_macro_expansion, finished_macro_expansion)
(lex_one_token, yyerror): Update.
* ada-lex.l (YY_INPUT): Update.
(rewind_to_char): Update.
* ada-exp.y (yyerror): Update.
2019-04-04 Tom Tromey <tom@tromey.com>
* rust-exp.y (rustyylex, rust_lex_tests): Update.
* parser-defs.h (struct parser_state) <parser_state>: Add new
parameter.
<comma_terminates>: New member.
(comma_terminates): Don't declare global.
* parse.c (comma_terminates): Remove global.
(parse_exp_in_context): Update.
* p-exp.y (yylex): Update.
* m2-exp.y (yylex): Update.
* go-exp.y (lex_one_token): Update.
* f-exp.y (yylex): Update.
* d-exp.y (lex_one_token): Update.
* c-exp.y (lex_one_token): Update.
* ada-lex.l: Update.
2019-04-04 Tom Tromey <tom@tromey.com>
* rust-exp.y (struct rust_parser) <paren_depth>: New member.
(rustyylex, rust_lex_test_init, rust_lex_test_one)
(rust_lex_test_sequence, rust_lex_test_push_back): Update.
* parser-defs.h (paren_depth): Don't declare.
* parse.c (paren_depth): Remove global.
(parse_exp_in_context): Update.
* p-exp.y (paren_depth): New global.
(pascal_parse): Initialize it.
* m2-exp.y (paren_depth): New global.
(m2_parse): Initialize it.
* go-exp.y (paren_depth): New global.
(go_parse): Initialize it.
* f-exp.y (paren_depth): New global.
(f_parse): Initialize it.
* d-exp.y (paren_depth): New global.
(d_parse): Initialize it.
* c-exp.y (paren_depth): New global.
(c_parse): Initialize it.
* ada-lex.l (paren_depth): New global.
(lexer_init): Initialize it.
2019-04-04 Tom Tromey <tom@tromey.com>
* rust-exp.y (rust_parser::crate_name, rust_parser::super_name)
(rust_parser::convert_ast_to_type)
(rust_parser::convert_ast_to_expression, rust_lex_tests): Update.
* parser-defs.h (struct parser_state) <parser_state>: Add
parameters. Initialize new members.
<expression_context_block, expression_context_pc>: New members.
* parse.c (expression_context_block, expression_context_pc):
Remove globals.
(parse_exp_in_context): Update.
* p-exp.y: Update all rules.
(yylex): Update.
* m2-exp.y: Update all rules.
(yylex): Update.
* go-exp.y (yylex): Update.
* f-exp.y (yylex): Update.
* d-exp.y: Update all rules.
(yylex): Update.
* c-exp.y: Update all rules.
(lex_one_token, classify_name, yylex, c_parse): Update.
* ada-exp.y (write_var_or_type, write_name_assoc): Update.
2019-04-04 Tom Tromey <tom@tromey.com>
* gdbarch.h, gdbarch.c: Rebuild.
* gdbarch.sh (dtrace_parse_probe_argument): Change type.
* stap-probe.h:
(struct stap_parse_info): Replace "parser_state" with
"expr_builder".
* parser-defs.h (struct expr_builder): Rename from "parser_state".
(parser_state): New class.
* parse.c (expr_builder): Rename.
(expr_builder::release): Rename.
(write_exp_elt, write_exp_elt_opcode, write_exp_elt_sym)
(write_exp_elt_msym, write_exp_elt_block, write_exp_elt_objfile)
(write_exp_elt_longcst, write_exp_elt_floatcst)
(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)
(insert_type_address_space, increase_expout_size): Replace
"parser_state" with "expr_builder".
* dtrace-probe.c: Replace "parser_state" with "expr_builder".
* amd64-linux-tdep.c (amd64_dtrace_parse_probe_argument): Replace
"parser_state" with "expr_builder".
2019-04-04 Tom Tromey <tom@tromey.com>
* rust-exp.y: Replace "parse_language" with method call.
* p-exp.y:
(yylex): Replace "parse_language" with method call.
* m2-exp.y:
(yylex): Replace "parse_language" with method call.
* go-exp.y (classify_name): Replace "parse_language" with method
call.
* f-exp.y (yylex): Replace "parse_language" with method call.
* d-exp.y (lex_one_token): Replace "parse_language" with method
call.
* c-exp.y:
(lex_one_token, classify_name, yylex): Replace "parse_language"
with method call.
* ada-exp.y (find_primitive_type, type_char)
(type_system_address): Replace "parse_language" with method call.
2019-04-04 Tom Tromey <tom@tromey.com>
* rust-exp.y: Replace "parse_gdbarch" with method call.
* parse.c (write_dollar_variable, insert_type_address_space):
Replace "parse_gdbarch" with method call.
* p-exp.y (parse_type, yylex): Replace "parse_gdbarch" with method
call.
* objc-lang.c (end_msglist): Replace "parse_gdbarch" with method
call.
* m2-exp.y (parse_type, parse_m2_type, yylex): Replace
"parse_gdbarch" with method call.
* go-exp.y (parse_type, classify_name): Replace "parse_gdbarch"
with method call.
* f-exp.y (parse_type, parse_f_type, yylex): Replace
"parse_gdbarch" with method call.
* d-exp.y (parse_type, parse_d_type, lex_one_token): Replace
"parse_gdbarch" with method call.
* c-exp.y (parse_type, parse_number, classify_name): Replace
"parse_gdbarch" with method call.
* ada-lex.l: Replace "parse_gdbarch" with method call.
* ada-exp.y (parse_type, find_primitive_type, type_char)
(type_system_address): Replace "parse_gdbarch" with method call.
2019-04-04 Tom Tromey <tom@tromey.com>
* dtrace-probe.c (dtrace_probe::build_arg_exprs): Update.
* stap-probe.c (stap_parse_argument): Update.
* stap-probe.h (struct stap_parse_info) <stap_parse_info>: Remove
initial_size parameter.
* rust-exp.y (rust_lex_tests): Update.
* parse.c (parser_state): Update.
(parse_exp_in_context): Update.
* parser-defs.h (struct parser_state) <parser_state>: Remove
"initial_size" parameter.
2019-04-04 Tom Tromey <tom@tromey.com>
* parser-defs.h (increase_expout_size): Don't declare.
* parse.c (increase_expout_size): Now static.
2019-04-04 Thomas Schwinge <thomas@codesourcery.com>
* gnu-nat.c (gnu_nat_target::wait): Fix
target_waitstatus_to_string call.
2019-04-01 Andrew Burgess <andrew.burgess@embecosm.com>
* eval.c (evaluate_subexp_standard): Handle internal functions
during Fortran function call handling.
gdb: Add $_cimag and $_creal internal functions Add two new internal functions $_cimag and $_creal that extract the imaginary and real parts of a complex value. These internal functions can take a complex value of any type 'float complex', 'double complex', or 'long double complex' and return a suitable floating point value 'float', 'double', or 'long double'. So we can now do this: (gdb) p z1 $1 = 1.5 + 4.5 * I (gdb) p $_cimag (z1) $4 = 4.5 (gdb) p $_creal (z1) $4 = 1.5 The components of a complex value are not strictly named types in DWARF, as the complex type is itself the base type. However, once we are able to extract the components it makes sense to be able to ask what the type of these components is and get a sensible answer back, rather than the error we would currently get. Currently GDB says: (gdb) ptype z1 type = complex double (gdb) p $_cimag (z1) $4 = 4.5 (gdb) ptype $ type = <invalid type code 9> With the changes in dwarf2read.c, GDB now says: (gdb) ptype z1 type = complex double (gdb) p $_cimag (z1) $4 = 4.5 (gdb) ptype $ type = double Which seems to make more sense. gdb/ChangeLog: * NEWS: Mention new internal functions. * dwarf2read.c (dwarf2_init_complex_target_type): New function. (read_base_type): Use dwarf2_init_complex_target_type. * value.c (creal_internal_fn): New function. (cimag_internal_fn): New function. (_initialize_values): Register new internal functions. gdb/doc/ChangeLog: * gdb.texinfo (Convenience Funs): Document '$_creal' and '$_cimag'. gdb/testsuite/ChangeLog: * gdb.base/complex-parts.c: New file. * gdb.base/complex-parts.exp: New file.
2019-03-14 14:58:58 +01:00
2019-04-01 Andrew Burgess <andrew.burgess@embecosm.com>
* NEWS: Mention new internal functions.
* dwarf2read.c (dwarf2_init_complex_target_type): New function.
(read_base_type): Use dwarf2_init_complex_target_type.
* value.c (creal_internal_fn): New function.
(cimag_internal_fn): New function.
(_initialize_values): Register new internal functions.
Fix internal error and improve 'set debug infrun 1'/target wait kind trace The test gdb.threads/watchthreads-reorder.exp verifies that the 'set debug infrun 1' debug output does not crash GDB. Under high load, the test can still cause a GDB internal error (see details below). This patch fixes this crash, and improves/factorises some wait kind traces. Tested on debian/amd64 + run one test with 'set debug infrun 1'. Changes compared to the first version: * Handles the suggestions of Kevin to trace the relevant elements of the wait status (this is done by calling target_waitstatus_to_string). * Some other changes to factorise wait status tracing. Note that using target_waitstatus_to_string instead of the 'locally printed' status kind strings means that debug trace that was using strings such as: "EXITED" or "TARGET_WAITKIND_EXITED" will now use what is printed by target_waitstatus_to_string e.g. "exited". gdb/ChangeLog 2019-04-01 Philippe Waroquiers <philippe.waroquiers@skynet.be> * infrun.c (stop_all_threads): If debug_infrun, always trace the wait status after wait_one, using target_waitstatus_to_string and target_pid_to_str. (handle_inferior_event): Replace various trace of wait status kind by a single trace. * gdb/gnu-nat.c (gnu_nat_target::wait): Replace local wait status kind image by target_waitstatus_to_string. * target/waitstatus.c (target_waitstatus_to_string): Fix obsolete comment. (top-gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 #1 0x00007f3d54a0642a in __GI_abort () at abort.c:89 #2 0x0000555c24c60e66 in dump_core () at ../../fixleaks/gdb/utils.c:201 #3 0x0000555c24c63d49 in internal_vproblem(internal_problem *, const char *, int, const char *, typedef __va_list_tag __va_list_tag *) (problem=problem@entry=0x555c25338d40 <internal_error_problem>, file=<optimized out>, line=287, fmt=<optimized out>, ap=<optimized out>) at ../../fixleaks/gdb/utils.c:411 #4 0x0000555c24c63eab in internal_verror (file=<optimized out>, line=<optimized out>, fmt=<optimized out>, ap=<optimized out>) at ../../fixleaks/gdb/utils.c:436 #5 0x0000555c249e8c22 in internal_error (file=file@entry=0x555c24e0f2ad "../../fixleaks/gdb/inferior.c", line=line@entry=287, fmt=<optimized out>) at ../../fixleaks/gdb/common/errors.c:55 #6 0x0000555c247d3f5c in find_inferior_pid (pid=<optimized out>) at ../../fixleaks/gdb/inferior.c:287 #7 0x0000555c24ad2248 in find_inferior_pid (pid=<optimized out>) at ../../fixleaks/gdb/inferior.c:302 #8 find_inferior_ptid (ptid=...) at ../../fixleaks/gdb/inferior.c:301 #9 0x0000555c24c35f25 in find_thread_ptid (ptid=...) at ../../fixleaks/gdb/thread.c:522 #10 0x0000555c24b0ab4d in thread_db_target::pid_to_str[abi:cxx11](ptid_t) ( this=0x555c2532e3e0 <the_thread_db_target>, ptid=...) at ../../fixleaks/gdb/linux-thread-db.c:1637 #11 0x0000555c24c2f420 in target_pid_to_str[abi:cxx11](ptid_t) (ptid=...) at ../../fixleaks/gdb/target.c:2083 #12 0x0000555c24ad9cab in stop_all_threads () at ../../fixleaks/gdb/infrun.c:4373 #13 0x0000555c24ada00f in stop_waiting (ecs=<optimized out>) at ../../fixleaks/gdb/infrun.c:7464 #14 0x0000555c24adc401 in process_event_stop_test (ecs=ecs@entry=0x7ffc9402d9d0) at ../../fixleaks/gdb/infrun.c:6181 ... (top-gdb) fr 12 #12 0x0000555c24ad9cab in stop_all_threads () at ../../fixleaks/gdb/infrun.c:4373 (top-gdb) p event_ptid $5 = {m_pid = 25419, m_lwp = 25427, m_tid = 0} (top-gdb) p ptid $6 = {m_pid = 0, m_lwp = 0, m_tid = 0} (top-gdb) p ws $7 = {kind = TARGET_WAITKIND_THREAD_EXITED, value = {integer = 0, sig = GDB_SIGNAL_0, related_pid = {m_pid = 0, m_lwp = 0, m_tid = 0}, execd_pathname = 0x0, syscall_number = 0}} (top-gdb) The gdb.log corresponding to the above crash is: (gdb) PASS: gdb.threads/watchthreads-reorder.exp: reorder1: set debug infrun 1 continue Continuing. infrun: clear_proceed_status_thread (Thread 0x7ffff7fcfb40 (LWP 25419)) infrun: clear_proceed_status_thread (Thread 0x7ffff7310700 (LWP 25427)) infrun: clear_proceed_status_thread (Thread 0x7ffff6b0f700 (LWP 25428)) infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT) infrun: proceed: resuming Thread 0x7ffff7fcfb40 (LWP 25419) infrun: resume (step=0, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0x7ffff7fcfb40 (LWP 25419)] at 0x7ffff7344317 infrun: infrun_async(1) infrun: prepare_to_wait infrun: proceed: resuming Thread 0x7ffff7310700 (LWP 25427) infrun: resume (step=0, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0x7ffff7310700 (LWP 25427)] at 0x5555555553d7 infrun: prepare_to_wait infrun: proceed: resuming Thread 0x7ffff6b0f700 (LWP 25428) infrun: resume (step=0, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0x7ffff6b0f700 (LWP 25428)] at 0x5555555554c8 infrun: prepare_to_wait infrun: target_wait (-1.0.0, status) = infrun: -1.0.0 [process -1], infrun: status->kind = ignore infrun: TARGET_WAITKIND_IGNORE infrun: prepare_to_wait Joining the threads. [Thread 0x7ffff6b0f700 (LWP 25428) exited] infrun: target_wait (-1.0.0, status) = infrun: -1.0.0 [process -1], infrun: status->kind = ignore infrun: TARGET_WAITKIND_IGNORE infrun: prepare_to_wait infrun: target_wait (-1.0.0, status) = infrun: 25419.25419.0 [Thread 0x7ffff7fcfb40 (LWP 25419)], infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x555555555e50 infrun: context switch infrun: Switching context from Thread 0x7ffff6b0f700 (LWP 25428) to Thread 0x7ffff7fcfb40 (LWP 25419) infrun: BPSTAT_WHAT_STOP_NOISY infrun: stop_waiting infrun: stop_all_threads infrun: stop_all_threads, pass=0, iterations=0 infrun: Thread 0x7ffff7fcfb40 (LWP 25419) not executing infrun: Thread 0x7ffff7310700 (LWP 25427) executing, need stop [Thread 0x7ffff7310700 (LWP 25427) exited] infrun: target_wait (-1.0.0, status) = infrun: 25419.25427.0 [LWP 25427], infrun: status->kind = thread exited, status = 0 infrun: infrun_async(0) ../../fixleaks/gdb/inferior.c:287: internal-error: inferior* find_inferior_pid(int): Assertion `pid != 0' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) FAIL: gdb.threads/watchthreads-reorder.exp: reorder1: continue to breakpoint: break-at-exit (GDB internal error) Resyncing due to internal error. n infrun: infrun_async(1) This is a bug, please report it. For instructions, see: <http://www.gnu.org/software/gdb/bugs/>. infrun: infrun_async(0) ../../fixleaks/gdb/inferior.c:287: internal-error: inferior* find_inferior_pid(int): Assertion `pid != 0' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) y
2019-03-24 15:14:55 +01:00
2019-04-01 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* infrun.c (stop_all_threads): If debug_infrun, always
trace the wait status after wait_one, using
target_waitstatus_to_string and target_pid_to_str.
(handle_inferior_event): Replace various trace of
wait status kind by a single trace.
* gdb/gnu-nat.c (gnu_nat_target::wait): Replace local
wait status kind image by target_waitstatus_to_string.
* target/waitstatus.c (target_waitstatus_to_string): Fix
obsolete comment.
2019-04-01 Tom Tromey <tromey@adacore.com>
PR symtab/23331:
* dwarf2read.c (partial_die_info::read): Handle DW_AT_ranges.
2019-04-01 Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com>
* top.c (quit_force): Call 'finalize_values'.
* value.c (finalize_values): New function.
* value.h (finalize_values): Declare.
2019-03-30 Eli Zaretskii <eliz@gnu.org>
* NEWS: Announce $_gdb_major and $_gdb_minor.
* top.c (init_gdb_version_vars): New function.
(gdb_init): Call init_gdb_version_vars.
2019-03-29 Tom Tromey <tromey@adacore.com>
* printcmd.c (_initialize_printcmd): Add usage lines. Update some
help text. Remove dead code.
Allow really large fortran array bounds: fortran type/value printers This is the fortran part of the patch, including tests, which are essentially unchanged from Siddhesh's original 2012 submission: https://sourceware.org/ml/gdb-patches/2012-08/msg00562.html There is, however, one large departure. In the above thread, Jan pointed out problems with GCC debuginfo for -m32 builds (filed usptream as gcc/54934). After investigating the issue, I am dropping the hand-tweaked assembler source file to workaround this case. While I would normally do something to accommodate this, in this case, given the ubiquity of 64-bit systems today (where the tests pass) and the apparent lack of urgency on the compiler side (by users), I don't think the additional complexity and maintenance costs are worth it. It will be very routinely tested on 64-bit systems. [For example, at Red Hat, we always test -m64 and -m32 configurations for all GDB releases.] gdb/ChangeLog: From Siddhesh Poyarekar: * f-lang.h (f77_get_upperbound): Return LONGEST. (f77_get_lowerbound): Likewise. * f-typeprint.c (f_type_print_varspec_suffix): Expand UPPER_BOUND and LOWER_BOUND to LONGEST. Use plongest to format print them. (f_type_print_base): Expand UPPER_BOUND to LONGEST. Use plongest to format print it. * f-valprint.c (f77_get_lowerbound): Return LONGEST. (f77_get_upperbound): Likewise. (f77_get_dynamic_length_of_aggregate): Expand UPPER_BOUND, LOWER_BOUND to LONGEST. (f77_create_arrayprint_offset_tbl): Likewise. gdb/testsuite/ChangeLog: * gdb.fortran/array-bounds.exp: New file. * gdb.fortran/array-bounds.f90: New file.
2019-03-29 18:15:38 +01:00
2019-03-29 Keith Seitz <keiths@redhat.com>
From Siddhesh Poyarekar:
* f-lang.h (f77_get_upperbound): Return LONGEST.
(f77_get_lowerbound): Likewise.
* f-typeprint.c (f_type_print_varspec_suffix): Expand
UPPER_BOUND and LOWER_BOUND to LONGEST. Use plongest to format
print them.
(f_type_print_base): Expand UPPER_BOUND to LONGEST. Use
plongest to format print it.
* f-valprint.c (f77_get_lowerbound): Return LONGEST.
(f77_get_upperbound): Likewise.
(f77_get_dynamic_length_of_aggregate): Expand UPPER_BOUND,
LOWER_BOUND to LONGEST.
(f77_create_arrayprint_offset_tbl): Likewise.
Allow really large fortran array bounds: TYPE_LENGTH to ULONGEST This series is revisit of Siddhesh Poyarekar's patch from back in 2012. The last status on the patch is in the following gdb-patches thread: https://sourceware.org/ml/gdb-patches/2012-08/msg00562.html It appears that Tom approved the patch, but Jan had some issues with a compiler error that made the test fail on -m32 test runs. He wrote up a hand-tweaked .S file to deal with it. Siddesh said he would update tests. Then nothing. Siddesh and Jan have both moved on since. The patch originally required a large precursor patch to work. I have whittled this down to/rewritten the bare minimum, and this first patch is the result, changing the type of TYPE_LENGTH to ULONGEST from unsigned int. The majority of the changes involve changing printf format strings to use %s and pulongest instead of %d. gdb/ChangeLog: * ada-lang.c (ada_template_to_fixed_record_type_1): Use %s/pulongest for TYPE_LENGTH instead of %d in format strings. * ada-typerint.c (ada_print_type): Likewise. * amd64-windows-tdep.c (amd64_windows_store_arg_in_reg): Likewise. * compile/compile-c-support.c (generate_register_struct): Likewise. * gdbtypes.c (recursive_dump_type): Likewise. * gdbtypes.h (struct type) <length>: Change type to ULONGEST. * m2-typeprint.c (m2_array): Use %s/pulongest for TYPE_LENGTH instead of %d in format strings. * riscv-tdep.c (riscv_type_alignment): Cast second argument to std::min to ULONGEST. * symmisc.c (print_symbol): Use %s/pulongest for TYPE_LENGTH instead of %d in format strings. * tracepoint.c (info_scope_command): Likewise. * typeprint.c (print_offset_data::update) (print_offset_data::finish): Likewise. * xtensa-tdep.c (xtensa_store_return_value) (xtensa_push_dummy_call): Likewise.
2019-03-29 18:15:38 +01:00
2019-03-29 Keith Seitz <keiths@redhat.com>
* ada-lang.c (ada_template_to_fixed_record_type_1): Use
%s/pulongest for TYPE_LENGTH instead of %d in format
strings.
* ada-typerint.c (ada_print_type): Likewise.
* amd64-windows-tdep.c (amd64_windows_store_arg_in_reg): Likewise.
* compile/compile-c-support.c (generate_register_struct): Likewise.
* gdbtypes.c (recursive_dump_type): Likewise.
* gdbtypes.h (struct type) <length>: Change type to ULONGEST.
* m2-typeprint.c (m2_array): Use %s/pulongest for TYPE_LENGTH
instead of %d in format strings.
* riscv-tdep.c (riscv_type_alignment): Cast second argument
to std::min to ULONGEST.
* symmisc.c (print_symbol): Use %s/pulongest for TYPE_LENGTH
instead of %d in format strings.
* tracepoint.c (info_scope_command): Likewise.
* typeprint.c (print_offset_data::update)
(print_offset_data::finish): Likewise.
* xtensa-tdep.c (xtensa_store_return_value)
(xtensa_push_dummy_call): Likewise.
2019-03-28 Jon Turney <jon.turney@dronecode.org.uk>
* windows-nat.c (display_selector): Fixed format specifications
for 64-bit Cygwin.
Fix GDB being suspended SIGTTOU when running gdb.multi/multi-arch-exec.exp When running under valgrind, multi-arch-exec.exp blocks forever. Some (painful) investigation shows this is due to valgrind slowing down GDB, and GDB has to output some messages at a different time, when GDB does not have the terminal for output. To reproduce the problem, you need to slow down GDB. It can be reproduced by: cd gdb/testsuite/outputs/gdb.multi/multi-arch-exec/ ../../../../gdb -ex 'set debug lin-lwp 1' -ex 'break all_started' -ex 'run' ./2-multi-arch-exec The above stops at a breakpoint. Do continue. GDB is then suspended because of SIGTTOU. The stacktrace that leads to the hanging GDB is: (top-gdb) bt at ../../binutils-gdb/gdb/exceptions.c:130 .... Alternatively, the same happens when doing strace -o s.out ../../../../gdb -ex 'break all_started' -ex 'run' ./2-multi-arch-exec And of course, valgrind is also sufficiently slowing down GDB to reproduce this :). Fix this by calling target_terminal::ours_for_output (); at the beginning of follow_exec. Note that all this terminal handling is not very clear to me: * Some code takes the terminal, and then takes care to give it back to the inferior if the terminal was belonging to the inferior. (e.g. annotate_breakpoints_invalid). * some code takes the terminal, but does not give it back (e.g. update_inserted_breakpoint_locations). * some code takes it, and unconditionally gives it back (e.g. handle_jit_event) * here and there, we also find gdb::optional<target_terminal::scoped_restore_terminal_state> term_state; before a (sometimes optional) call to ours_for_output. And such calls to ours_for_output is sometimes protected by: if (target_supports_terminal_ours ()) (e.g. exceptions.c: print_flush). but most of the code calls it without checking if the target supports it. * some code is outputting some errors, but only takes the terminal after. E.g. infcmd.c: prepare_one_step gdb/ChangeLog 2019-03-28 Philippe Waroquiers <philippe.waroquiers@skynet.be> * infrun.c (follow_exec): Call target_terminal::ours_for_output.
2019-02-05 23:47:53 +01:00
2019-03-28 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* infrun.c (follow_exec): Call target_terminal::ours_for_output.
Fix stepping past unwritable kernel helper on nios2-linux-gnu. This patch fixes a problem on nios2-linux-gnu with stepping past the kernel helper __kuser_cmpxchg, which was exposed by the testcase gdb.threads/watchpoint-fork.exp. The kernel maps this function into user space on an unwritable page. In this testcase, the cmpxchg helper is invoked indirectly from the setbuf call in the test program. Since this target lacks hardware breakpoint/watchpoint support, GDB tries to single-step through the program by setting software breakpoints, and was just giving an error when it reached the function on the unwritable page. The solution here is to always step over the call instead of stepping into it; cmpxchg is supposed to be an atomic operation so this behavior seems reasonable. The hook in nios2_get_next_pc is somewhat generic, but at present cmpxchg is the only helper provided by the Linux kernel that is invoked by an ordinary function call. (Signal return trampolines also go through the unwritable page but not by a function call.) Fixing this issue also revealed that the testcase needs a much larger timeout factor when software single-stepping is used. That has also been fixed in this patch. gdb/ChangeLog 2019-03-28 Sandra Loosemore <sandra@codesourcery.com> * nios2-tdep.h (struct gdbarch_tdep): Add is_kernel_helper. * nios2-tdep.c (nios2_get_next_pc): Skip over kernel helpers. * nios2-linux-tdep.c (nios2_linux_is_kernel_helper): New. (nios2_linux_init_abi): Install it. gdb/testsuite/ChangeLog 2019-03-28 Sandra Loosemore <sandra@codesourcery.com> * gdb.threads/watchpoint-fork.exp (test): Use large timeout factor when no hardware watchpoint support.
2019-03-28 17:29:22 +01:00
2019-03-28 Sandra Loosemore <sandra@codesourcery.com>
* nios2-tdep.h (struct gdbarch_tdep): Add is_kernel_helper.
* nios2-tdep.c (nios2_get_next_pc): Skip over kernel helpers.
* nios2-linux-tdep.c (nios2_linux_is_kernel_helper): New.
(nios2_linux_init_abi): Install it.
2019-03-28 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aarch64_vnv_type): Use vector types.
2019-03-28 Alan Hayward <alan.hayward@arm.com>
* features/aarch64-sve.c (create_feature_aarch64_sve): Add q view.
Fix buffer overflow regression due to minsym malloc-ed instead of obstack-ed. Valgrind detects the following error in a bunch of tests, e.g. in gdb.base/foll-fork.exp. ==15155== VALGRIND_GDB_ERROR_BEGIN ==15155== Invalid read of size 8 ==15155== at 0x55BE04: minimal_symbol_upper_bound(bound_minimal_symbol) (minsyms.c:1504) ==15155== by 0x3B2E9C: find_pc_partial_function(unsigned long, char const**, unsigned long*, unsigned long*, block const**) (blockframe.c:340) ==15155== by 0x3B3135: find_function_entry_range_from_pc(unsigned long, char const**, unsigned long*, unsigned long*) (blockframe.c:385) ==15155== by 0x4F5597: fill_in_stop_func(gdbarch*, execution_control_state*) [clone .part.16] (infrun.c:4124) ==15155== by 0x4FBE01: fill_in_stop_func (infrun.c:7636) ==15155== by 0x4FBE01: process_event_stop_test(execution_control_state*) (infrun.c:6279) ... ==15155== Address 0x715bec8 is 0 bytes after a block of size 2,952 alloc'd ==15155== at 0x4C2E2B3: realloc (vg_replace_malloc.c:836) ==15155== by 0x405F2C: xrealloc (common-utils.c:62) ==15155== by 0x55BA4E: xresizevec<minimal_symbol> (poison.h:170) ==15155== by 0x55BA4E: minimal_symbol_reader::install() (minsyms.c:1399) ==15155== by 0x4981C7: elf_read_minimal_symbols (elfread.c:1165) ... This seems to be a regression created by: commit 042d75e42c5572f333e0e06dabd3c5c4afab486c Author: Tom Tromey <tom@tromey.com> AuthorDate: Sat Mar 2 12:29:48 2019 -0700 Commit: Tom Tromey <tom@tromey.com> CommitDate: Fri Mar 15 16:02:10 2019 -0600 Allocate minimal symbols with malloc Before this commit, the array of 'struct minimal_symbol' contained a last element that was a "null symbol". The comment in minimal_symbol_reader::install was: /* We also terminate the minimal symbol table with a "null symbol", which is *not* included in the size of the table. This makes it easier to find the end of the table when we are handed a pointer to some symbol in the middle of it. Zero out the fields in the "null symbol" allocated at the end of the array. Note that the symbol count does *not* include this null symbol, which is why it is indexed by mcount and not mcount-1. */ memset (&msymbols[mcount], 0, sizeof (struct minimal_symbol)); However, minimal_symbol_upper_bound was still based on the assumption that the array of minsym is terminated by a minsym with a null symbol: it is looping with: for (i = 1; MSYMBOL_LINKAGE_NAME (msymbol + i) != NULL; i++) Replace this NULL comparison by a logic that calculates how many msymbol are following the msymbols from which we are starting from. (Re-)tested on debian/amd64, natively and under valgrind. gdb/ChangeLog 2019-03-24 Philippe Waroquiers <philippe.waroquiers@skynet.be> Tom Tromey <tromey@adacore.com> * minsyms.c (minimal_symbol_upper_bound): Fix buffer overflow.
2019-03-27 16:38:34 +01:00
2019-03-24 Philippe Waroquiers <philippe.waroquiers@skynet.be>
Tom Tromey <tromey@adacore.com>
* minsyms.c (minimal_symbol_upper_bound): Fix buffer overflow.
2019-03-26 Joel Brobecker <brobecker@adacore.com>
* gdb-gdb.py.in (StructMainTypePrettyPrinter.bound_img): New method.
(StructMainTypePrettyPrinter.bounds_img): Use new "bound_img"
method to compute the bounds of range types. Also print "[evaluated]"
if the bounds' values come from a dynamic evaluation.
2019-03-26 Andrew Burgess <andrew.burgess@embecosm.com>
* cp-valprint.c (cp_print_value_fields): Don't print trailing
whitespace when pretty printing is on.
2019-03-26 Alan Hayward <alan.hayward@arm.com>
* ppc-linux-nat.c: Add include.
2019-03-26 Alan Hayward <alan.hayward@arm.com>
* NEWS: Mention AArch64 Pointer Authentication.
2019-03-26 Alan Hayward <alan.hayward@arm.com>
* arm-linux-nat.c: Add include.
Fix use-after-free in source_cache::get_source_lines Commit ab42892fb7d2 ("Fix vertical scrolling of TUI source window") introduced a use-after-free in source_cache::get_source_lines. At the beginning of the method, we get the fullname of the symtab: const char *fullname = symtab_to_fullname (s); fullname points to the string owned by the symtab (s.fullname). When we later do scoped_fd desc = open_source_file (s); s.fullname gets reallocated (even though the string contents may not change). The fullname local variable now points to freed memory. To avoid it, refresh the value of fullname after calling open_source_file. Here is the ASan report: $ ./gdb -nx --data-directory=data-directory ./a.out (gdb) start Temporary breakpoint 1 at 0x1130: file test.cpp, line 12. Starting program: /home/simark/build/binutils-gdb/gdb/a.out Temporary breakpoint 1, main () at test.cpp:12 ================================================================= ==26068==ERROR: AddressSanitizer: heap-use-after-free on address 0x6210003d4100 at pc 0x7fed89a34681 bp 0x7ffd8d185d80 sp 0x7ffd8d185528 READ of size 2 at 0x6210003d4100 thread T0 #0 0x7fed89a34680 in __interceptor_strlen /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:301 #1 0x55b6edf6c2f7 in std::char_traits<char>::length(char const*) /usr/include/c++/8.2.1/bits/char_traits.h:320 #2 0x55b6edf6c9b2 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) /usr/include/c++/8.2.1/bits/basic_string.h:516 #3 0x55b6ef09121b in source_cache::get_source_lines(symtab*, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) /home/simark/src/binutils-gdb/gdb/source-cache.c:214 #4 0x55b6ef0a15cb in print_source_lines_base /home/simark/src/binutils-gdb/gdb/source.c:1340 #5 0x55b6ef0a2045 in print_source_lines(symtab*, int, int, enum_flags<print_source_lines_flag>) /home/simark/src/binutils-gdb/gdb/source.c:1415 #6 0x55b6ef112c87 in print_frame_info(frame_info*, int, print_what, int, int) /home/simark/src/binutils-gdb/gdb/stack.c:914 #7 0x55b6ef10e90d in print_stack_frame(frame_info*, int, print_what, int) /home/simark/src/binutils-gdb/gdb/stack.c:180 #8 0x55b6ee9592f8 in print_stop_location /home/simark/src/binutils-gdb/gdb/infrun.c:7853 #9 0x55b6ee95948f in print_stop_event(ui_out*) /home/simark/src/binutils-gdb/gdb/infrun.c:7870 #10 0x55b6ef34b962 in tui_on_normal_stop /home/simark/src/binutils-gdb/gdb/tui/tui-interp.c:98 #11 0x55b6ee01a14d in std::_Function_handler<void (bpstats*, int), void (*)(bpstats*, int)>::_M_invoke(std::_Any_data const&, bpstats*&&, int&&) /usr/include/c++/8.2.1/bits/std_function.h:297 #12 0x55b6ee965415 in std::function<void (bpstats*, int)>::operator()(bpstats*, int) const /usr/include/c++/8.2.1/bits/std_function.h:687 #13 0x55b6ee962f1b in gdb::observers::observable<bpstats*, int>::notify(bpstats*, int) const /home/simark/src/binutils-gdb/gdb/common/observable.h:106 #14 0x55b6ee95a6e7 in normal_stop() /home/simark/src/binutils-gdb/gdb/infrun.c:8142 #15 0x55b6ee93f236 in fetch_inferior_event(void*) /home/simark/src/binutils-gdb/gdb/infrun.c:3782 #16 0x55b6ee8f2641 in inferior_event_handler(inferior_event_type, void*) /home/simark/src/binutils-gdb/gdb/inf-loop.c:43 #17 0x55b6eea2a1f0 in handle_target_event /home/simark/src/binutils-gdb/gdb/linux-nat.c:4358 #18 0x55b6ee7045f1 in handle_file_event /home/simark/src/binutils-gdb/gdb/event-loop.c:733 #19 0x55b6ee704e89 in gdb_wait_for_event /home/simark/src/binutils-gdb/gdb/event-loop.c:859 #20 0x55b6ee7027b5 in gdb_do_one_event() /home/simark/src/binutils-gdb/gdb/event-loop.c:322 #21 0x55b6ee702907 in start_event_loop() /home/simark/src/binutils-gdb/gdb/event-loop.c:371 #22 0x55b6eeadfc16 in captured_command_loop /home/simark/src/binutils-gdb/gdb/main.c:331 #23 0x55b6eeae2ef9 in captured_main /home/simark/src/binutils-gdb/gdb/main.c:1174 #24 0x55b6eeae30c2 in gdb_main(captured_main_args*) /home/simark/src/binutils-gdb/gdb/main.c:1190 #25 0x55b6edf4fa89 in main /home/simark/src/binutils-gdb/gdb/gdb.c:32 #26 0x7fed88ad8222 in __libc_start_main (/usr/lib/libc.so.6+0x24222) #27 0x55b6edf4f86d in _start (/home/simark/build/binutils-gdb/gdb/gdb+0x197186d) 0x6210003d4100 is located 0 bytes inside of 4096-byte region [0x6210003d4100,0x6210003d5100) freed by thread T0 here: #0 0x7fed89a8ac19 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:66 #1 0x55b6edfe12df in xfree<char> /home/simark/src/binutils-gdb/gdb/common/common-utils.h:60 #2 0x55b6edfea675 in gdb::xfree_deleter<char>::operator()(char*) const /home/simark/src/binutils-gdb/gdb/common/gdb_unique_ptr.h:34 #3 0x55b6edfe532c in std::unique_ptr<char, gdb::xfree_deleter<char> >::reset(char*) /usr/include/c++/8.2.1/bits/unique_ptr.h:382 #4 0x55b6edfe7329 in std::unique_ptr<char, gdb::xfree_deleter<char> >::operator=(std::unique_ptr<char, gdb::xfree_deleter<char> >&&) /usr/include/c++/8.2.1/bits/unique_ptr.h:289 #5 0x55b6ef09ec2b in find_and_open_source(char const*, char const*, std::unique_ptr<char, gdb::xfree_deleter<char> >*) /home/simark/src/binutils-gdb/gdb/source.c:990 #6 0x55b6ef09f56a in open_source_file(symtab*) /home/simark/src/binutils-gdb/gdb/source.c:1069 #7 0x55b6ef090f78 in source_cache::get_source_lines(symtab*, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) /home/simark/src/binutils-gdb/gdb/source-cache.c:205 #8 0x55b6ef0a15cb in print_source_lines_base /home/simark/src/binutils-gdb/gdb/source.c:1340 #9 0x55b6ef0a2045 in print_source_lines(symtab*, int, int, enum_flags<print_source_lines_flag>) /home/simark/src/binutils-gdb/gdb/source.c:1415 #10 0x55b6ef112c87 in print_frame_info(frame_info*, int, print_what, int, int) /home/simark/src/binutils-gdb/gdb/stack.c:914 #11 0x55b6ef10e90d in print_stack_frame(frame_info*, int, print_what, int) /home/simark/src/binutils-gdb/gdb/stack.c:180 #12 0x55b6ee9592f8 in print_stop_location /home/simark/src/binutils-gdb/gdb/infrun.c:7853 #13 0x55b6ee95948f in print_stop_event(ui_out*) /home/simark/src/binutils-gdb/gdb/infrun.c:7870 #14 0x55b6ef34b962 in tui_on_normal_stop /home/simark/src/binutils-gdb/gdb/tui/tui-interp.c:98 #15 0x55b6ee01a14d in std::_Function_handler<void (bpstats*, int), void (*)(bpstats*, int)>::_M_invoke(std::_Any_data const&, bpstats*&&, int&&) /usr/include/c++/8.2.1/bits/std_function.h:297 #16 0x55b6ee965415 in std::function<void (bpstats*, int)>::operator()(bpstats*, int) const /usr/include/c++/8.2.1/bits/std_function.h:687 #17 0x55b6ee962f1b in gdb::observers::observable<bpstats*, int>::notify(bpstats*, int) const /home/simark/src/binutils-gdb/gdb/common/observable.h:106 #18 0x55b6ee95a6e7 in normal_stop() /home/simark/src/binutils-gdb/gdb/infrun.c:8142 #19 0x55b6ee93f236 in fetch_inferior_event(void*) /home/simark/src/binutils-gdb/gdb/infrun.c:3782 #20 0x55b6ee8f2641 in inferior_event_handler(inferior_event_type, void*) /home/simark/src/binutils-gdb/gdb/inf-loop.c:43 #21 0x55b6eea2a1f0 in handle_target_event /home/simark/src/binutils-gdb/gdb/linux-nat.c:4358 #22 0x55b6ee7045f1 in handle_file_event /home/simark/src/binutils-gdb/gdb/event-loop.c:733 #23 0x55b6ee704e89 in gdb_wait_for_event /home/simark/src/binutils-gdb/gdb/event-loop.c:859 #24 0x55b6ee7027b5 in gdb_do_one_event() /home/simark/src/binutils-gdb/gdb/event-loop.c:322 #25 0x55b6ee702907 in start_event_loop() /home/simark/src/binutils-gdb/gdb/event-loop.c:371 #26 0x55b6eeadfc16 in captured_command_loop /home/simark/src/binutils-gdb/gdb/main.c:331 #27 0x55b6eeae2ef9 in captured_main /home/simark/src/binutils-gdb/gdb/main.c:1174 #28 0x55b6eeae30c2 in gdb_main(captured_main_args*) /home/simark/src/binutils-gdb/gdb/main.c:1190 #29 0x55b6edf4fa89 in main /home/simark/src/binutils-gdb/gdb/gdb.c:32 previously allocated by thread T0 here: #0 0x7fed89a8b019 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:86 #1 0x7fed88af983f in realpath@@GLIBC_2.3 (/usr/lib/libc.so.6+0x4583f) #2 0x7fed899dbbbc in __interceptor_canonicalize_file_name /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:3297 #3 0x55b6ee376a03 in gdb_realpath(char const*) /home/simark/src/binutils-gdb/gdb/common/pathstuff.c:72 #4 0x55b6ef09ec12 in find_and_open_source(char const*, char const*, std::unique_ptr<char, gdb::xfree_deleter<char> >*) /home/simark/src/binutils-gdb/gdb/source.c:990 #5 0x55b6ef09f56a in open_source_file(symtab*) /home/simark/src/binutils-gdb/gdb/source.c:1069 #6 0x55b6ef0a0f12 in print_source_lines_base /home/simark/src/binutils-gdb/gdb/source.c:1270 #7 0x55b6ef0a2045 in print_source_lines(symtab*, int, int, enum_flags<print_source_lines_flag>) /home/simark/src/binutils-gdb/gdb/source.c:1415 #8 0x55b6ef112c87 in print_frame_info(frame_info*, int, print_what, int, int) /home/simark/src/binutils-gdb/gdb/stack.c:914 #9 0x55b6ef10e90d in print_stack_frame(frame_info*, int, print_what, int) /home/simark/src/binutils-gdb/gdb/stack.c:180 #10 0x55b6ee9592f8 in print_stop_location /home/simark/src/binutils-gdb/gdb/infrun.c:7853 #11 0x55b6ee95948f in print_stop_event(ui_out*) /home/simark/src/binutils-gdb/gdb/infrun.c:7870 #12 0x55b6ef34b962 in tui_on_normal_stop /home/simark/src/binutils-gdb/gdb/tui/tui-interp.c:98 #13 0x55b6ee01a14d in std::_Function_handler<void (bpstats*, int), void (*)(bpstats*, int)>::_M_invoke(std::_Any_data const&, bpstats*&&, int&&) /usr/include/c++/8.2.1/bits/std_function.h:297 #14 0x55b6ee965415 in std::function<void (bpstats*, int)>::operator()(bpstats*, int) const /usr/include/c++/8.2.1/bits/std_function.h:687 #15 0x55b6ee962f1b in gdb::observers::observable<bpstats*, int>::notify(bpstats*, int) const /home/simark/src/binutils-gdb/gdb/common/observable.h:106 #16 0x55b6ee95a6e7 in normal_stop() /home/simark/src/binutils-gdb/gdb/infrun.c:8142 #17 0x55b6ee93f236 in fetch_inferior_event(void*) /home/simark/src/binutils-gdb/gdb/infrun.c:3782 #18 0x55b6ee8f2641 in inferior_event_handler(inferior_event_type, void*) /home/simark/src/binutils-gdb/gdb/inf-loop.c:43 #19 0x55b6eea2a1f0 in handle_target_event /home/simark/src/binutils-gdb/gdb/linux-nat.c:4358 #20 0x55b6ee7045f1 in handle_file_event /home/simark/src/binutils-gdb/gdb/event-loop.c:733 #21 0x55b6ee704e89 in gdb_wait_for_event /home/simark/src/binutils-gdb/gdb/event-loop.c:859 #22 0x55b6ee7027b5 in gdb_do_one_event() /home/simark/src/binutils-gdb/gdb/event-loop.c:322 #23 0x55b6ee702907 in start_event_loop() /home/simark/src/binutils-gdb/gdb/event-loop.c:371 #24 0x55b6eeadfc16 in captured_command_loop /home/simark/src/binutils-gdb/gdb/main.c:331 #25 0x55b6eeae2ef9 in captured_main /home/simark/src/binutils-gdb/gdb/main.c:1174 #26 0x55b6eeae30c2 in gdb_main(captured_main_args*) /home/simark/src/binutils-gdb/gdb/main.c:1190 #27 0x55b6edf4fa89 in main /home/simark/src/binutils-gdb/gdb/gdb.c:32 #28 0x7fed88ad8222 in __libc_start_main (/usr/lib/libc.so.6+0x24222) gdb/ChangeLog: * source-cache.c (source_cache::get_source_lines): Re-read fullname after calling open_source_file.
2019-03-26 01:29:18 +01:00
2019-03-25 Simon Marchi <simon.marchi@polymtl.ca>
* source-cache.c (source_cache::get_source_lines): Re-read
fullname after calling open_source_file.
2019-03-25 John Baldwin <jhb@FreeBSD.org>
* NEWS: Mention TLS support for FreeBSD.
2019-03-25 Tom Tromey <tromey@adacore.com>
* minsyms.c (BUNCH_SIZE): Update comment.
(~minimal_symbol_reader): Remove old comment.
(compact_minimal_symbols): Update comment.
(minimal_symbol_reader::install): Remove old comment. Update
other comments.
2019-03-25 Alan Hayward <alan.hayward@arm.com>
* s390-linux-nat.c: Add include.
2019-03-25 Alan Hayward <alan.hayward@arm.com>
* aarch64-linux-nat.c (aarch64_linux_nat_target::read_description):
Call linux_get_hwcap.
* aarch64-linux-tdep.c (aarch64_linux_core_read_description):
Likewise.
(aarch64_linux_get_hwcap): Remove function.
* aarch64-linux-tdep.h (aarch64_linux_get_hwcap): Remove
declaration.
* arm-linux-nat.c (arm_linux_nat_target::read_description):Call
linux_get_hwcap.
* arm-linux-tdep.c (arm_linux_core_read_description): Likewise.
* linux-tdep.c (linux_get_hwcap): Add function.
(linux_get_hwcap2): Likewise.
* linux-tdep.h (linux_get_hwcap): Add declaration.
(linux_get_hwcap2): Likewise.
* ppc-linux-nat.c (ppc_linux_get_hwcap): Remove function.
(ppc_linux_get_hwcap2): Likewise.
(ppc_linux_nat_target::region_ok_for_hw_watchpoint): Call
linux_get_hwcap.
(ppc_linux_nat_target::insert_watchpoint): Likewise.
(ppc_linux_nat_target::watchpoint_addr_within_range): Likewise.
(ppc_linux_nat_target::read_description): Likewise.
* ppc-linux-tdep.c (ppc_linux_core_read_description): Likewise.
* s390-linux-nat.c: Likewise.
* s390-linux-tdep.c (s390_core_read_description): Likewise.
Remove null_block_symbol This removes null_block_symbol. It seemed simpler to me to change initializations and returns to use value initialization rather than null_block_symbol. This also fixes up a few spots where initialization was done piecemeal. gdb/ChangeLog 2019-03-24 Tom Tromey <tom@tromey.com> * ada-lang.c (standard_lookup): Simplify initialization. (ada_lookup_symbol_nonlocal): Simplify return. * solib-spu.c (spu_lookup_lib_symbol): Simplify return. * solib-darwin.c (darwin_lookup_lib_symbol): Simplify return. * solib-svr4.c (elf_lookup_lib_symbol): Simplify return. * rust-lang.c (rust_lookup_symbol_nonlocal): Simplify initialization. * solib.c (solib_global_lookup): Simplify. * symtab.c (null_block_symbol): Remove. (symbol_cache_lookup): Simplify returns. (lookup_language_this): Simplify returns. (lookup_symbol_aux): Simplify return. (lookup_local_symbol): Simplify returns. (lookup_global_symbol_from_objfile): Simplify return. (lookup_symbol_in_objfile_symtabs) (lookup_symbol_in_objfile_from_linkage_name): Simplify return. (lookup_symbol_via_quick_fns, lookup_symbol_in_static_block) (lookup_static_symbol, lookup_global_symbol): Simplify return. * cp-namespace.c (cp_lookup_bare_symbol) (cp_search_static_and_baseclasses, cp_lookup_symbol_via_imports) (cp_lookup_symbol_via_all_imports, cp_lookup_nested_symbol_1) (cp_lookup_nested_symbol): Don't use null_block_symbol. (cp_lookup_symbol_via_imports): Simplify initialization. (find_symbol_in_baseclass): Likewise. * symtab.h (null_block_symbol): Remove. * d-namespace.c (d_lookup_symbol): Don't use null_block_symbol. (d_lookup_nested_symbol, d_lookup_symbol_imports) (d_lookup_symbol_module): Likewise. (find_symbol_in_baseclass): Simplify initialization.
2019-03-22 23:53:12 +01:00
2019-03-24 Tom Tromey <tom@tromey.com>
* ada-lang.c (standard_lookup): Simplify initialization.
(ada_lookup_symbol_nonlocal): Simplify return.
* solib-spu.c (spu_lookup_lib_symbol): Simplify return.
* solib-darwin.c (darwin_lookup_lib_symbol): Simplify return.
* solib-svr4.c (elf_lookup_lib_symbol): Simplify return.
* rust-lang.c (rust_lookup_symbol_nonlocal): Simplify
initialization.
* solib.c (solib_global_lookup): Simplify.
* symtab.c (null_block_symbol): Remove.
(symbol_cache_lookup): Simplify returns.
(lookup_language_this): Simplify returns.
(lookup_symbol_aux): Simplify return.
(lookup_local_symbol): Simplify returns.
(lookup_global_symbol_from_objfile): Simplify return.
(lookup_symbol_in_objfile_symtabs)
(lookup_symbol_in_objfile_from_linkage_name): Simplify return.
(lookup_symbol_via_quick_fns, lookup_symbol_in_static_block)
(lookup_static_symbol, lookup_global_symbol): Simplify return.
* cp-namespace.c (cp_lookup_bare_symbol)
(cp_search_static_and_baseclasses, cp_lookup_symbol_via_imports)
(cp_lookup_symbol_via_all_imports, cp_lookup_nested_symbol_1)
(cp_lookup_nested_symbol): Don't use null_block_symbol.
(cp_lookup_symbol_via_imports): Simplify initialization.
(find_symbol_in_baseclass): Likewise.
* symtab.h (null_block_symbol): Remove.
* d-namespace.c (d_lookup_symbol): Don't use null_block_symbol.
(d_lookup_nested_symbol, d_lookup_symbol_imports)
(d_lookup_symbol_module): Likewise.
(find_symbol_in_baseclass): Simplify initialization.
2019-03-24 Tom Tromey <tom@tromey.com>
* expression.h: Don't include symtab.h.
(struct block): Forward declare.
More block constification I noticed that there are still many places referring to non-const blocks. This constifies all the remaining ones that I found that could be constified. In a few spots, this search found unused variables or fields. I removed these. I've also removed some unnecessary casts to "struct block *". gdb/ChangeLog 2019-03-24 Tom Tromey <tom@tromey.com> * c-exp.y (typebase): Remove casts. * gdbtypes.c (lookup_unsigned_typename, ) (lookup_signed_typename): Remove cast. * eval.c (parse_to_comma_and_eval): Remove cast. * parse.c (write_dollar_variable): Remove cast. * block.h (struct block) <superblock>: Now const. * symfile-debug.c (debug_qf_map_matching_symbols): Update. * psymtab.c (psym_map_matching_symbols): Make "block" const. (map_block): Make "block" const. * symfile.h (struct quick_symbol_functions) <map_matching_symbols>: Constify block argument to "callback". * symtab.c (basic_lookup_transparent_type_quick): Make "block" const. (find_pc_sect_compunit_symtab): Make "b" const. (find_symbol_at_address): Likewise. (search_symbols): Likewise. * dwarf2read.c (dw2_lookup_symbol): Make "block" const. (dw2_debug_names_lookup_symbol): Likewise. (dw2_map_matching_symbols): Update. * p-valprint.c (pascal_val_print): Remove "block". * ada-lang.c (ada_add_global_exceptions): Make "b" const. (aux_add_nonlocal_symbols): Make "block" const. (resolve_subexp): Remove cast. * linespec.c (iterate_over_all_matching_symtabs): Make "block" const. (iterate_over_file_blocks): Likewise. * f-exp.y (%union) <bval>: Remove. * coffread.c (patch_opaque_types): Make "b" const. * spu-tdep.c (spu_catch_start): Make "block" const. * c-valprint.c (print_unpacked_pointer): Remove "block". * symmisc.c (dump_symtab_1): Make "b" const. (block_depth): Make "block" const. * d-exp.y (%union) <bval>: Remove. * cp-support.h (cp_lookup_rtti_type): Update. * cp-support.c (cp_lookup_rtti_type): Make "block" const. * psymtab.c (psym_lookup_symbol): Make "block" const. (maintenance_check_psymtabs): Make "b" const. * python/py-framefilter.c (extract_sym): Make "sym_block" const. (enumerate_locals, enumerate_args): Update. * python/py-symtab.c (stpy_global_block): Make "block" const. (stpy_static_block): Likewise. * inline-frame.c (block_starting_point_at): Make "new_block" const. * block.c (find_block_in_blockvector): Make return type const. (blockvector_for_pc_sect): Make "b" const. (find_block_in_blockvector): Make "b" const.
2019-03-22 22:54:10 +01:00
2019-03-24 Tom Tromey <tom@tromey.com>
* c-exp.y (typebase): Remove casts.
* gdbtypes.c (lookup_unsigned_typename, )
(lookup_signed_typename): Remove cast.
* eval.c (parse_to_comma_and_eval): Remove cast.
* parse.c (write_dollar_variable): Remove cast.
* block.h (struct block) <superblock>: Now const.
* symfile-debug.c (debug_qf_map_matching_symbols): Update.
* psymtab.c (psym_map_matching_symbols): Make "block" const.
(map_block): Make "block" const.
* symfile.h (struct quick_symbol_functions)
<map_matching_symbols>: Constify block argument to "callback".
* symtab.c (basic_lookup_transparent_type_quick): Make "block"
const.
(find_pc_sect_compunit_symtab): Make "b" const.
(find_symbol_at_address): Likewise.
(search_symbols): Likewise.
* dwarf2read.c (dw2_lookup_symbol): Make "block" const.
(dw2_debug_names_lookup_symbol): Likewise.
(dw2_map_matching_symbols): Update.
* p-valprint.c (pascal_val_print): Remove "block".
* ada-lang.c (ada_add_global_exceptions): Make "b" const.
(aux_add_nonlocal_symbols): Make "block" const.
(resolve_subexp): Remove cast.
* linespec.c (iterate_over_all_matching_symtabs): Make "block"
const.
(iterate_over_file_blocks): Likewise.
* f-exp.y (%union) <bval>: Remove.
* coffread.c (patch_opaque_types): Make "b" const.
* spu-tdep.c (spu_catch_start): Make "block" const.
* c-valprint.c (print_unpacked_pointer): Remove "block".
* symmisc.c (dump_symtab_1): Make "b" const.
(block_depth): Make "block" const.
* d-exp.y (%union) <bval>: Remove.
* cp-support.h (cp_lookup_rtti_type): Update.
* cp-support.c (cp_lookup_rtti_type): Make "block" const.
* psymtab.c (psym_lookup_symbol): Make "block" const.
(maintenance_check_psymtabs): Make "b" const.
* python/py-framefilter.c (extract_sym): Make "sym_block" const.
(enumerate_locals, enumerate_args): Update.
* python/py-symtab.c (stpy_global_block): Make "block" const.
(stpy_static_block): Likewise.
* inline-frame.c (block_starting_point_at): Make "new_block"
const.
* block.c (find_block_in_blockvector): Make return type const.
(blockvector_for_pc_sect): Make "b" const.
(find_block_in_blockvector): Make "b" const.
Have parser reset the innermost block tracker I ran across a comment in symfile.c today: /* Clear globals which might have pointed into a removed objfile. FIXME: It's not clear which of these are supposed to persist between expressions and which ought to be reset each time. */ It seems to me that this can be clarified: the parser entry points ought to reset the innermost block tracker (and the expression context block), and these should not be considered valid for code to use at arbitrary times -- only immediately after an expression has been parsed. This patch implements this idea. This could be further improved by removing the parser globals and changing the parser functions to return this information, but I have not done this. Tested by the buildbot. gdb/ChangeLog 2019-03-23 Tom Tromey <tom@tromey.com> * varobj.c (varobj_create): Update. * symfile.c (clear_symtab_users): Don't reset innermost_block. * printcmd.c (display_command, do_one_display): Don't reset innermost_block. * parser-defs.h (enum innermost_block_tracker_type): Move to expression.h. (innermost_block): Update comment. * parse.c (parse_exp_1): Add tracker_types parameter. (parse_exp_in_context): Rename from parse_exp_in_context_1. Add tracker_types parameter. Reset innermost_block. (parse_exp_in_context): Remove. (parse_expression_for_completion): Update. * objfiles.c (~objfile): Don't reset expression_context_block or innermost_block. * expression.h (enum innermost_block_tracker_type): Move from parser-defs.h. (parse_exp_1): Add tracker_types parameter. * breakpoint.c (set_breakpoint_condition, watch_command_1): Don't reset innermost_block.
2019-03-23 17:11:51 +01:00
2019-03-23 Tom Tromey <tom@tromey.com>
* varobj.c (varobj_create): Update.
* symfile.c (clear_symtab_users): Don't reset innermost_block.
* printcmd.c (display_command, do_one_display): Don't reset
innermost_block.
* parser-defs.h (enum innermost_block_tracker_type): Move to
expression.h.
(innermost_block): Update comment.
* parse.c (parse_exp_1): Add tracker_types parameter.
(parse_exp_in_context): Rename from parse_exp_in_context_1. Add
tracker_types parameter. Reset innermost_block.
(parse_exp_in_context): Remove.
(parse_expression_for_completion): Update.
* objfiles.c (~objfile): Don't reset expression_context_block or
innermost_block.
* expression.h (enum innermost_block_tracker_type): Move from
parser-defs.h.
(parse_exp_1): Add tracker_types parameter.
* breakpoint.c (set_breakpoint_condition, watch_command_1): Don't
reset innermost_block.
2019-03-23 Tom Tromey <tom@tromey.com>
* objfiles.h: Include bcache.h.
2019-03-23 Tom Tromey <tom@tromey.com>
* linespec.c (get_current_search_block): Use
scoped_restore_current_language.
* symmisc.c (dump_symtab): Use scoped_restore_current_language.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* aarch64-linux-tdep.c
(aarch64_linux_iterate_over_regset_sections): Check for pauth
section.
* aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_PAUTH): New define.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* aarch64-tdep.c (aarch64_analyze_prologue): Check for pauth
instructions.
(aarch64_analyze_prologue_test): Add PACIASP test.
(aarch64_prologue_prev_register): Unmask PC value.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* aarch64-tdep.c (aarch64_frame_unmask_address): New function.
(aarch64_dwarf2_prev_register): Unmask PC value.
(aarch64_dwarf2_frame_init_reg): Init pauth registers.
(aarch64_execute_dwarf_cfa_vendor_op): Check for
DW_CFA_AARCH64_negate_ra_state.
(aarch64_gdbarch_init): Add aarch64_execute_dwarf_cfa_vendor_op.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* aarch64-tdep.c (aarch64_dwarf_reg_to_regnum): Check for pauth
registers.
(aarch64_pseudo_register_name): Likewise.
(aarch64_pseudo_register_type): Likewise.
(aarch64_pseudo_register_reggroup_p): Likewise.
(aarch64_gdbarch_init): Add pauth registers.
* aarch64-tdep.h (AARCH64_DWARF_PAUTH_RA_STATE): New define.
(AARCH64_DWARF_PAUTH_DMASK): Likewise.
(AARCH64_DWARF_PAUTH_CMASK): Likewise.
(struct gdbarch_tdep): Add regnum for ra_state.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* arch/aarch64.h (AARCH64_PAUTH_REGS_SIZE): New define.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* aarch64-linux-nat.c (fetch_pauth_masks_from_thread): New
function.
(aarch64_linux_nat_target::fetch_registers): Read pauth registers.
* aarch64-tdep.c (aarch64_cannot_store_register): New function.
(aarch64_gdbarch_init): Add puth registers.
* aarch64-tdep.h (struct gdbarch_tdep): Add pauth features.
* arch/aarch64.h (AARCH64_PAUTH_DMASK_REGNUM): New define.
(AARCH64_PAUTH_CMASK_REGNUM): Likewise.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* aarch64-linux-nat.c
(aarch64_linux_nat_target::read_description): Read PACA hwcap.
* aarch64-linux-tdep.c
(aarch64_linux_core_read_description): Likewise.
(aarch64_linux_get_hwcap): New function.
* aarch64-linux-tdep.h (AARCH64_HWCAP_PACA): New define.
(aarch64_linux_get_hwcap): New declaration.
2019-03-22 Alan Hayward <alan.hayward@arm.com>
Jiong Wang <jiong.wang@arm.com>
* aarch64-linux-nat.c
(aarch64_linux_nat_target::read_description): Add pauth param.
* aarch64-linux-tdep.c
(aarch64_linux_core_read_description): Likewise.
* aarch64-tdep.c (struct target_desc): Add in pauth.
(aarch64_read_description): Add pauth param.
(aarch64_gdbarch_init): Likewise.
* aarch64-tdep.h (aarch64_read_description): Likewise.
* arch/aarch64.c (aarch64_create_target_description): Likewise.
* arch/aarch64.h (aarch64_create_target_description): Likewise.
* features/Makefile: Add new files.
* features/aarch64-pauth.c: New file.
* features/aarch64-pauth.xml: New file.
2019-03-20 Tom Tromey <tromey@adacore.com>
* infrun.c (handle_inferior_event): Rename from
handle_inferior_event_1. Create a scoped_value_mark.
(handle_inferior_event): Remove.
2019-03-19 Tom Tromey <tromey@adacore.com>
* mi/mi-interp.c (mi_on_normal_stop_1): Only show displays once.
* infrun.h (print_stop_event): Add "displays" parameter.
* infrun.c (print_stop_event): Add "displays" parameter.
2019-03-19 Pedro Alves <palves@redhat.com>
* tui/tui-out.c (tui_ui_out::do_field_string): Simplify.
(tui_ui_out::do_text): Add comments. Reset M_LINE to 0 instead of
to -1. Fix TABs vs spaces.
(tui_ui_out::tui_ui_out): Don't initialize fields here.
* tui/tui-out.h (tui_ui_out) Add intro comments.
<m_line, m_start_of_line>: In-class initialize, and add describing
comment.
2019-03-18 Alan Hayward <alan.hayward@arm.com>
* arm-linux-nat.c (arm_linux_insert_hw_breakpoint1): Fix
variable names.
(arm_linux_remove_hw_breakpoint1): Use a gdb::function_view.
2019-03-18 Pedro Alves <palves@redhat.com>
Eli Zaretskii <eliz@gnu.org>
* tui/tui-out.c (tui_ui_out::tui_ui_out): Fix initialization of
m_line and m_start_of_line.
2019-03-18 Eli Zaretskii <eliz@gnu.org>
* tui/tui-io.c (gdb_wgetch): Don't echo CR.
(tui_getc): When gdb_wgetch returns a CR, behave the same as when
it returns a newline. This fixes a regression in TU mode, whereby
the next line is output on the same screen line as the user input.
2019-03-18 Tom Tromey <tromey@adacore.com>
* minsyms.c (minimal_symbol_reader::install): Remove call to
obstack_blank.
2019-03-18 Pedro Alves <palves@redhat.com>
* tui/tui-io.c (reverse_mode_p, reverse_save_bg, reverse_save_fg):
New globals.
(apply_style): New, factored out from ...
(apply_ansi_escape): ... this. Handle reverse video mode.
(tui_set_reverse_mode): New function.
* tui/tui-io.h (tui_set_reverse_mode): New declaration.
* tui/tui-winsource.c (tui_show_source_line): Use
tui_set_reverse_mode instead of setting A_STANDOUT.
* ui-style.h (struct ui_file_style) <set_reverse, set_fg, set_bg>:
New setter methods.
2019-03-18 Hannes Domani <ssbssa@yahoo.de>
* tui/tui-source.c (copy_source_line): Fix handling of 'column'.
Handle tabs.
2019-03-18 Tom Tromey <tromey@adacore.com>
* ada-lang.c (empty_array): Add "high" parameter.
(ada_evaluate_subexp): Update.
2019-03-17 Sergei Trofimovich <siarheit@google.com>
* unittests/string_view-selftests.c: Define
_initialize_string_view_selftests unconditionally.
2019-03-17 Vladimir Martyanov <vilgeforce@gmail.com>
PR gdb/24350
* windows-nat.c (windows_make_so): Remove unused text_vma variable.
2019-03-17 Vladimir Martyanov <vilgeforce@gmail.com>
PR gdb/24351
* windows-nat.c (display_selector): Fix format specifiers.
2019-03-17 Eli Zaretskii <eliz@gnu.org>
* tui/tui-winsource.c (tui_set_is_exec_point_at): Call
tui_refill_source_window instead of tui_refresh_win, to update the
current execution line. This fixes redisplay of the current line
when stepping through the code with "next" or "step".
2019-03-16 Eli Zaretskii <eliz@gnu.org>
* source-cache.c (source_cache::get_source_lines): Call
find_source_lines to initialize s->nlines. This fixes vertical
scrolling of TUI source window when the DOWN arrow is pressed.
2019-03-16 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* auto-load.c (_initialize_auto_load): Fix 'This options has'.
linux-thread-db.c (_initialize_thread_db): Likewise.
2019-03-16 Eli Zaretskii <eliz@gnu.org>
* tui/tui-winsource.c (tui_show_source_line): Revert "Use
wclrtoeol in tui_show_source_line". This reverts changes made in
commit 4a3045920bbe4e50a0f4920b0fdc4e88ef23015c.
2019-03-15 Tom Tromey <tom@tromey.com>
* symtab.h (struct minimal_symbol): Derive from
general_symbol_info.
(MSYMBOL_VALUE, MSYMBOL_VALUE_RAW_ADDRESS)
(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_DEMANGLED_NAME)
(MSYMBOL_SEARCH_NAME): Update.
(MSYMBOL_SET_LANGUAGE, MSYMBOL_SET_NAMES): Remove.
* solib.c (gdb_bfd_lookup_symbol_from_symtab): Don't use memset.
* minsyms.c (minimal_symbol_reader::record_full): Update.
2019-03-15 Tom Tromey <tom@tromey.com>
* minsyms.c (minimal_symbol_reader::install): Use memcpy.
2019-03-15 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage) <msymbols>: Now a
unique_xmalloc_ptr.
(objfile::msymbols_range::begin, objfile::msymbols_range::end):
Update.
* minsyms.c (lookup_minimal_symbol_by_pc_section)
(build_minimal_symbol_hash_tables)
(minimal_symbol_reader::install): Update.
2019-03-15 Tom Tromey <tom@tromey.com>
* symtab.c (create_demangled_names_hash): Update.
(symbol_set_names): Update.
* objfiles.h (struct objfile_per_bfd_storage)
<demangled_names_hash>: Now an htab_up.
* objfiles.c (objfile_per_bfd_storage): Simplify.
2019-03-15 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage): Declare
destructor.
* objfiles.c (objfile_per_bfd_storage::~objfile_per_bfd_storage):
New.
(get_objfile_bfd_data): Use new. Don't initialize
language_of_main.
(free_objfile_per_bfd_storage): Remove.
(objfile_bfd_data_free, objfile::~objfile): Use delete.
2019-03-15 Tom Tromey <tom@tromey.com>
* symfile.c (reread_symbols): Update.
* objfiles.c (objfile::objfile): Update.
* minsyms.h (terminate_minimal_symbol_table): Don't declare.
* minsyms.c (lookup_minimal_symbol_by_pc_section): Update
comment.
(minimal_symbol_reader::install): Update.
(terminate_minimal_symbol_table): Remove.
* jit.c (jit_object_close_impl): Update.
2019-03-15 Tom Tromey <tom@tromey.com>
* minsyms.c (minimal_symbol_reader::record_full): Remove some
initializations.
2019-03-15 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage)
<demangled_hash_languages>: Now a bitset.
* minsyms.c (add_minsym_to_demangled_hash_table): Update.
(lookup_minimal_symbol): Update.
2019-03-15 Tom Tromey <tom@tromey.com>
* minsyms.h (class minimal_symbol_reader) <record_with_info>:
Don't return the symbol.
* coffread.c (record_minimal_symbol): Use record_full.
2019-03-14 Eli Zaretskii <eliz@gnu.org>
The MS-Windows port of ncurses fails to switch to a color pair if
one or both of the colors are the implicit default colors. This
change records the default colors when TUI is initialized, and
then specifies them explicitly when a color pair uses the default
colors. This allows color styling in TUI mode on MS-Windows.
* tui/tui-io.c [__MINGW32__]: Include windows.h. Declare
ncurses_norm_attr.
(tui_initialize_io) [__MINGW32__]: Record the default terminal
colors in ncurses_norm_attr.
(apply_ansi_escape) [__MINGW32__]: If a color in a color pair is
"none", replace it with the default color recorded in
ncurses_norm_attr.
2019-03-14 Tom Tromey <tromey@adacore.com>
* source-cache.h (class source_cache) <get_source_lines>: Return
std::string.
* source-cache.c (source_cache::extract_lines): Handle case where
first_pos==npos. Return std::string.
(source_cache::get_source_lines): Update.
2019-03-14 Tom Tromey <tromey@adacore.com>
* NEWS: Add item for "style sources" commands.
* source-cache.c (source_cache::get_source_lines): Check
source_styling.
* cli/cli-style.c (source_styling): New global.
(_initialize_cli_style): Add "style sources" commands.
(show_style_sources): New function.
* cli/cli-style.h (source_styling): Declare.
2019-03-14 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@adacore.com>
* tui/tui-winsource.h (tui_refill_source_window): Declare.
* tui/tui-winsource.c (tui_refill_source_window): New function,
from...
(tui_horizontal_source_scroll): ... here. Move some logic.
* cli/cli-style.c (set_style_enabled): Notify new observable.
* tui/tui-hooks.c (tui_redisplay_source): New function.
(tui_attach_detach_observers): Attach or detach
tui_redisplay_source.
* observable.h (source_styling_changed): New observable.
* observable.c: Define source_styling_changed observable.
Change pid_to_str to return std::string Currently the target pid_to_str method returns a const char *, so many implementations have a static buffer that they update. This patch changes these methods to return a std::string instead. I think this is cleaner and avoids possible gotchas when calling pid_to_str on different ptids in a single statement. (Though no such calls exist currently.) This also updates various helper functions, and the gdbarch pid_to_str methods. I also made a best effort to fix all the callers, but I can't build some of the *-nat.c files. Tested by the buildbot. gdb/ChangeLog 2019-03-13 Tom Tromey <tromey@adacore.com> * i386-gnu-nat.c (i386_gnu_nat_target::fetch_registers) (i386_gnu_nat_target::store_registers): Update. * target-debug.h (target_debug_print_std_string): New macro. * x86-linux-nat.c (x86_linux_nat_target::enable_btrace): Update. * windows-tdep.c (display_one_tib): Update. * tui/tui-stack.c (tui_make_status_line): Update. * top.c (print_inferior_quit_action): Update. * thread.c (thr_try_catch_cmd): Update. (add_thread_with_info): Update. (thread_target_id_str): Update. (thr_try_catch_cmd): Update. (thread_command): Update. (thread_find_command): Update. * record-btrace.c (record_btrace_target::info_record) (record_btrace_resume_thread, record_btrace_target::resume) (record_btrace_cancel_resume, record_btrace_step_thread) (record_btrace_target::wait, record_btrace_target::wait) (record_btrace_target::wait, record_btrace_target::stop): Update. * progspace.c (print_program_space): Update. * process-stratum-target.c (process_stratum_target::thread_address_space): Update. * linux-fork.c (linux_fork_mourn_inferior) (detach_checkpoint_command, info_checkpoints_command) (linux_fork_context): Update. (linux_fork_detach): Update. (class scoped_switch_fork_info): Update. (delete_checkpoint_command): Update. * infrun.c (follow_fork_inferior): Update. (follow_fork_inferior): Update. (proceed_after_vfork_done): Update. (handle_vfork_child_exec_or_exit): Update. (follow_exec): Update. (displaced_step_prepare_throw): Update. (displaced_step_restore): Update. (start_step_over): Update. (resume_1): Update. (clear_proceed_status_thread): Update. (proceed): Update. (print_target_wait_results): Update. (do_target_wait): Update. (context_switch): Update. (stop_all_threads): Update. (restart_threads): Update. (finish_step_over): Update. (handle_signal_stop): Update. (switch_back_to_stepped_thread): Update. (keep_going_pass_signal): Update. (print_exited_reason): Update. (normal_stop): Update. * inferior.c (inferior_pid_to_str): Change return type. (print_selected_inferior): Update. (add_inferior): Update. (detach_inferior): Update. * dummy-frame.c (fprint_dummy_frames): Update. * dcache.c (dcache_info_1): Update. * btrace.c (btrace_enable, btrace_disable, btrace_teardown) (btrace_fetch, btrace_clear): Update. * linux-tdep.c (linux_core_pid_to_str): Change return type. * i386-cygwin-tdep.c (i386_windows_core_pid_to_str): Change return type. * fbsd-tdep.c (fbsd_core_pid_to_str): Change return type. * sol2-tdep.h (sol2_core_pid_to_str): Change return type. * sol2-tdep.c (sol2_core_pid_to_str): Change return type. * gdbarch.c, gdbarch.h: Rebuild. * gdbarch.sh (core_pid_to_str): Change return type. * windows-nat.c (struct windows_nat_target) <pid_to_str>: Change return type. (windows_nat_target::pid_to_str): Change return type. (windows_delete_thread): Update. (windows_nat_target::attach): Update. (windows_nat_target::files_info): Update. * target-delegates.c: Rebuild. * sol-thread.c (class sol_thread_target) <pid_to_str>: Change return type. (sol_thread_target::pid_to_str): Change return type. * remote.c (class remote_target) <pid_to_str>: Change return type. (remote_target::pid_to_str): Change return type. (extended_remote_target::attach, remote_target::remote_stop_ns) (remote_target::remote_notif_remove_queued_reply) (remote_target::push_stop_reply, remote_target::disable_btrace): Update. (extended_remote_target::attach): Update. * remote-sim.c (struct gdbsim_target) <pid_to_str>: Change return type. (gdbsim_target::pid_to_str): Change return type. * ravenscar-thread.c (struct ravenscar_thread_target) <pid_to_str>: Change return type. (ravenscar_thread_target::pid_to_str): Change return type. * procfs.c (class procfs_target) <pid_to_str>: Change return type. (procfs_target::pid_to_str): Change return type. (procfs_target::attach): Update. (procfs_target::detach): Update. (procfs_target::fetch_registers): Update. (procfs_target::store_registers): Update. (procfs_target::wait): Update. (procfs_target::files_info): Update. * obsd-nat.c (obsd_nat_target::pid_to_str): Change return type. * nto-procfs.c (struct nto_procfs_target) <pid_to_str>: Change return type. (nto_procfs_target::pid_to_str): Change return type. (nto_procfs_target::files_info, nto_procfs_target::attach): Update. * linux-thread-db.c (class thread_db_target) <pid_to_str>: Change return type. * linux-nat.c (linux_nat_target::pid_to_str): Change return type. (exit_lwp): Update. (attach_proc_task_lwp_callback, get_detach_signal) (detach_one_lwp, resume_lwp, linux_nat_target::resume) (linux_nat_target::resume, wait_lwp, stop_callback) (maybe_clear_ignore_sigint, stop_wait_callback, status_callback) (save_stop_reason, select_event_lwp, linux_nat_filter_event) (linux_nat_wait_1, resume_stopped_resumed_lwps) (linux_nat_target::wait, linux_nat_stop_lwp): Update. * inf-ptrace.c (inf_ptrace_target::pid_to_str): Change return type. (inf_ptrace_target::attach): Update. (inf_ptrace_target::files_info): Update. * go32-nat.c (struct go32_nat_target) <pid_to_str>: Change return type. (go32_nat_target::pid_to_str): Change return type. * gnu-nat.c (gnu_nat_target::pid_to_str): Change return type. (gnu_nat_target::wait): Update. (gnu_nat_target::wait): Update. (gnu_nat_target::resume): Update. * fbsd-nat.c (fbsd_nat_target::pid_to_str): Change return type. (fbsd_nat_target::wait): Update. * darwin-nat.c (darwin_nat_target::pid_to_str): Change return type. (darwin_nat_target::attach): Update. * corelow.c (class core_target) <pid_to_str>: Change return type. (core_target::pid_to_str): Change return type. * target.c (normal_pid_to_str): Change return type. (default_pid_to_str): Likewise. (target_pid_to_str): Change return type. (target_translate_tls_address): Update. (target_announce_detach): Update. * bsd-uthread.c (struct bsd_uthread_target) <pid_to_str>: Change return type. (bsd_uthread_target::pid_to_str): Change return type. * bsd-kvm.c (class bsd_kvm_target) <pid_to_str>: Change return type. (bsd_kvm_target::pid_to_str): Change return type. * aix-thread.c (class aix_thread_target) <pid_to_str>: Change return type. (aix_thread_target::pid_to_str): Change return type. * target.h (struct target_ops) <pid_to_str>: Change return type. (target_pid_to_str, normal_pid_to_str): Likewise. * obsd-nat.h (class obsd_nat_target) <pid_to_str>: Change return type. * linux-nat.h (class linux_nat_target) <pid_to_str>: Change return type. * inf-ptrace.h (struct inf_ptrace_target) <pid_to_str>: Change return type. * gnu-nat.h (struct gnu_nat_target) <pid_to_str>: Change return type. * fbsd-nat.h (class fbsd_nat_target) <pid_to_str>: Change return type. * darwin-nat.h (class darwin_nat_target) <pid_to_str>: Change return type.
2019-02-28 17:09:55 +01:00
2019-03-13 Tom Tromey <tromey@adacore.com>
* i386-gnu-nat.c (i386_gnu_nat_target::fetch_registers)
(i386_gnu_nat_target::store_registers): Update.
* target-debug.h (target_debug_print_std_string): New macro.
* x86-linux-nat.c (x86_linux_nat_target::enable_btrace): Update.
* windows-tdep.c (display_one_tib): Update.
* tui/tui-stack.c (tui_make_status_line): Update.
* top.c (print_inferior_quit_action): Update.
* thread.c (thr_try_catch_cmd): Update.
(add_thread_with_info): Update.
(thread_target_id_str): Update.
(thr_try_catch_cmd): Update.
(thread_command): Update.
(thread_find_command): Update.
* record-btrace.c (record_btrace_target::info_record)
(record_btrace_resume_thread, record_btrace_target::resume)
(record_btrace_cancel_resume, record_btrace_step_thread)
(record_btrace_target::wait, record_btrace_target::wait)
(record_btrace_target::wait, record_btrace_target::stop): Update.
* progspace.c (print_program_space): Update.
* process-stratum-target.c
(process_stratum_target::thread_address_space): Update.
* linux-fork.c (linux_fork_mourn_inferior)
(detach_checkpoint_command, info_checkpoints_command)
(linux_fork_context): Update.
(linux_fork_detach): Update.
(class scoped_switch_fork_info): Update.
(delete_checkpoint_command): Update.
* infrun.c (follow_fork_inferior): Update.
(follow_fork_inferior): Update.
(proceed_after_vfork_done): Update.
(handle_vfork_child_exec_or_exit): Update.
(follow_exec): Update.
(displaced_step_prepare_throw): Update.
(displaced_step_restore): Update.
(start_step_over): Update.
(resume_1): Update.
(clear_proceed_status_thread): Update.
(proceed): Update.
(print_target_wait_results): Update.
(do_target_wait): Update.
(context_switch): Update.
(stop_all_threads): Update.
(restart_threads): Update.
(finish_step_over): Update.
(handle_signal_stop): Update.
(switch_back_to_stepped_thread): Update.
(keep_going_pass_signal): Update.
(print_exited_reason): Update.
(normal_stop): Update.
* inferior.c (inferior_pid_to_str): Change return type.
(print_selected_inferior): Update.
(add_inferior): Update.
(detach_inferior): Update.
* dummy-frame.c (fprint_dummy_frames): Update.
* dcache.c (dcache_info_1): Update.
* btrace.c (btrace_enable, btrace_disable, btrace_teardown)
(btrace_fetch, btrace_clear): Update.
* linux-tdep.c (linux_core_pid_to_str): Change return type.
* i386-cygwin-tdep.c (i386_windows_core_pid_to_str): Change return
type.
* fbsd-tdep.c (fbsd_core_pid_to_str): Change return type.
* sol2-tdep.h (sol2_core_pid_to_str): Change return type.
* sol2-tdep.c (sol2_core_pid_to_str): Change return type.
* gdbarch.c, gdbarch.h: Rebuild.
* gdbarch.sh (core_pid_to_str): Change return type.
* windows-nat.c (struct windows_nat_target) <pid_to_str>: Change
return type.
(windows_nat_target::pid_to_str): Change return type.
(windows_delete_thread): Update.
(windows_nat_target::attach): Update.
(windows_nat_target::files_info): Update.
* target-delegates.c: Rebuild.
* sol-thread.c (class sol_thread_target) <pid_to_str>: Change
return type.
(sol_thread_target::pid_to_str): Change return type.
* remote.c (class remote_target) <pid_to_str>: Change return
type.
(remote_target::pid_to_str): Change return type.
(extended_remote_target::attach, remote_target::remote_stop_ns)
(remote_target::remote_notif_remove_queued_reply)
(remote_target::push_stop_reply, remote_target::disable_btrace):
Update.
(extended_remote_target::attach): Update.
* remote-sim.c (struct gdbsim_target) <pid_to_str>: Change return
type.
(gdbsim_target::pid_to_str): Change return type.
* ravenscar-thread.c (struct ravenscar_thread_target)
<pid_to_str>: Change return type.
(ravenscar_thread_target::pid_to_str): Change return type.
* procfs.c (class procfs_target) <pid_to_str>: Change return
type.
(procfs_target::pid_to_str): Change return type.
(procfs_target::attach): Update.
(procfs_target::detach): Update.
(procfs_target::fetch_registers): Update.
(procfs_target::store_registers): Update.
(procfs_target::wait): Update.
(procfs_target::files_info): Update.
* obsd-nat.c (obsd_nat_target::pid_to_str): Change return type.
* nto-procfs.c (struct nto_procfs_target) <pid_to_str>: Change
return type.
(nto_procfs_target::pid_to_str): Change return type.
(nto_procfs_target::files_info, nto_procfs_target::attach): Update.
* linux-thread-db.c (class thread_db_target) <pid_to_str>: Change
return type.
* linux-nat.c (linux_nat_target::pid_to_str): Change return type.
(exit_lwp): Update.
(attach_proc_task_lwp_callback, get_detach_signal)
(detach_one_lwp, resume_lwp, linux_nat_target::resume)
(linux_nat_target::resume, wait_lwp, stop_callback)
(maybe_clear_ignore_sigint, stop_wait_callback, status_callback)
(save_stop_reason, select_event_lwp, linux_nat_filter_event)
(linux_nat_wait_1, resume_stopped_resumed_lwps)
(linux_nat_target::wait, linux_nat_stop_lwp): Update.
* inf-ptrace.c (inf_ptrace_target::pid_to_str): Change return
type.
(inf_ptrace_target::attach): Update.
(inf_ptrace_target::files_info): Update.
* go32-nat.c (struct go32_nat_target) <pid_to_str>: Change return
type.
(go32_nat_target::pid_to_str): Change return type.
* gnu-nat.c (gnu_nat_target::pid_to_str): Change return type.
(gnu_nat_target::wait): Update.
(gnu_nat_target::wait): Update.
(gnu_nat_target::resume): Update.
* fbsd-nat.c (fbsd_nat_target::pid_to_str): Change return type.
(fbsd_nat_target::wait): Update.
* darwin-nat.c (darwin_nat_target::pid_to_str): Change return
type.
(darwin_nat_target::attach): Update.
* corelow.c (class core_target) <pid_to_str>: Change return type.
(core_target::pid_to_str): Change return type.
* target.c (normal_pid_to_str): Change return type.
(default_pid_to_str): Likewise.
(target_pid_to_str): Change return type.
(target_translate_tls_address): Update.
(target_announce_detach): Update.
* bsd-uthread.c (struct bsd_uthread_target) <pid_to_str>: Change
return type.
(bsd_uthread_target::pid_to_str): Change return type.
* bsd-kvm.c (class bsd_kvm_target) <pid_to_str>: Change return
type.
(bsd_kvm_target::pid_to_str): Change return type.
* aix-thread.c (class aix_thread_target) <pid_to_str>: Change
return type.
(aix_thread_target::pid_to_str): Change return type.
* target.h (struct target_ops) <pid_to_str>: Change return type.
(target_pid_to_str, normal_pid_to_str): Likewise.
* obsd-nat.h (class obsd_nat_target) <pid_to_str>: Change return
type.
* linux-nat.h (class linux_nat_target) <pid_to_str>: Change return
type.
* inf-ptrace.h (struct inf_ptrace_target) <pid_to_str>: Change
return type.
* gnu-nat.h (struct gnu_nat_target) <pid_to_str>: Change return
type.
* fbsd-nat.h (class fbsd_nat_target) <pid_to_str>: Change return
type.
* darwin-nat.h (class darwin_nat_target) <pid_to_str>: Change
return type.
Fix MI output for multi-location breakpoints New in v2: - Addressed comments about doc, updated the MI version table - New doc for the Breakpoint information format - New -fix-multi-location-breakpoint-output command, with associated doc, test and NEWS updated accordingly - Fixed the output, the locations list is now actually in the tuple representing the breakpoint. Various MI commands or events related to breakpoints output invalid MI records when printing information about a multi-location breakpoint. For example: -break-insert allo ^done,bkpt={...,addr="<MULTIPLE>",...},{number="1.1",...},{number="1.2",...} The problem is that according to the syntax [1], the top-level elements are of type "result" and should be of the form "variable=value". This patch changes the output to wrap the locations in a list: ^done,bkpt={...,addr="<MULTIPLE>",locations=[{number="1.1",...},{number="1.2",...}]} The events =breakpoint-created, =breakpoint-modified, as well as the -break-info command also suffer from this (and maybe others I didn't find). Since this is a breaking change for MI, we have to deal somehow with backwards compatibility. The approach taken by this patch is to bump the MI version, use the new syntax in MI3 while retaining the old syntax in MI2. Frontends are expected to use a precise MI version (-i=mi2), so if they do that they should be unaffected. The patch also adds the command -fix-multi-location-breakpoint-output, which front ends can use to enable this behavior with MI <= 2. [1] https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Output-Syntax.html#GDB_002fMI-Output-Syntax gdb/ChangeLog: * NEWS: Mention that the new default MI version is 3. Mention changes to the output of commands and events that deal with multi-location breakpoints. * breakpoint.c: Include "mi/mi-out.h". (print_one_breakpoint): Change output syntax if using MI version >= 3. * mi/mi-main.h (mi_cmd_fix_multi_location_breakpoint_output): New. (mi_multi_location_breakpoint_output_fixed): New. * mi/mi-main.c (fix_multi_location_breakpoint_output): New. (mi_cmd_fix_multi_location_breakpoint_output): New. (mi_multi_location_breakpoint_output_fixed): New. * mi/mi-cmds.c (mi_cmds): Register command -fix-multi-location-breakpoint-output. * mi/mi-out.c (mi_out_new): Instantiate version 3 when using interpreter "mi". gdb/testsuite/ChangeLog: * mi-breakpoint-location-ena-dis.exp: Rename to ... * mi-breakpoint-multiple-locations.exp: ... this. (make_breakpoints_pattern): New proc. (do_test): Add mi_version parameter, test -break-insert, -break-info and =breakpoint-created. gdb/doc/ChangeLog: * gdb.texinfo (Mode Options): Mention mi3. (Interpreters): Likewise. (GDB/MI Development and Front Ends): Add entry for MI 3 in version table. Document -fix-multi-location-breakpoint-output. (GDB/MI Breakpoint Information): Document format of breakpoint location output.
2019-03-13 20:13:03 +01:00
2019-03-13 Simon Marchi <simon.marchi@ericsson.com>
* NEWS: Mention that the new default MI version is 3. Mention
changes to the output of commands and events that deal with
multi-location breakpoints.
* breakpoint.c: Include "mi/mi-out.h".
(print_one_breakpoint): Change output syntax if using MI version
>= 3.
* mi/mi-main.h (mi_cmd_fix_multi_location_breakpoint_output):
New.
(mi_multi_location_breakpoint_output_fixed): New.
* mi/mi-main.c (fix_multi_location_breakpoint_output): New.
(mi_cmd_fix_multi_location_breakpoint_output): New.
(mi_multi_location_breakpoint_output_fixed): New.
* mi/mi-cmds.c (mi_cmds): Register command
-fix-multi-location-breakpoint-output.
* mi/mi-out.c (mi_out_new): Instantiate version 3 when using
interpreter "mi".
2019-03-13 Simon Marchi <simon.marchi@polymtl.ca>
* mi/mi-out.h (mi_out_new): Change parameter to const char *.
* mi/mi-out.c (mi_out_new): Change parameter to const char *,
instantiate mi_ui_out based on interpreter name.
* mi/mi-interp.c (mi_interp::init): Use the new mi_out_new.
* mi/mi-main.c (mi_load_progress): Likewise.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* NEWS: Combine separate "New targets" sections for 8.3.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* ppc-fbsd-tdep.c (ppcfbsd_get_thread_local_address): New.
(ppcfbsd_init_abi): Install gdbarch
"fetch_tls_load_module_address" and "get_thread_local_address"
methods.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* riscv-fbsd-tdep.c (riscv_fbsd_get_thread_local_address): New.
(riscv_fbsd_init_abi): Install gdbarch
"fetch_tls_load_module_address" and "get_thread_local_address"
methods.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* i386-fbsd-tdep.c (i386fbsd_get_thread_local_address): New.
(i386fbsd_init_abi): Install gdbarch
"fetch_tls_load_module_address" and "get_thread_local_address"
methods.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* amd64-fbsd-tdep.c (amd64fbsd_get_thread_local_address): New.
(amd64fbsd_init_abi): Install gdbarch
"fetch_tls_load_module_address" and "get_thread_local_address"
methods.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* fbsd-tdep.c (fbsd_pspace_data_handle): New variable.
(struct fbsd_pspace_data): New type.
(get_fbsd_pspace_data, fbsd_pspace_data_cleanup)
(fbsd_read_integer_by_name, fbsd_fetch_rtld_offsets)
(fbsd_get_tls_index, fbsd_get_thread_local_address): New function.
(_initialize_fbsd_tdep): Initialize 'fbsd_pspace_data_handle'.
* fbsd-tdep.c (fbsd_get_thread_local_address): New prototype.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* gdbtypes.c (lookup_struct_elt): New function.
(lookup_struct_elt_type): Reimplement via lookup_struct_elt.
* gdbtypes.h (struct struct_elt): New type.
(lookup_struct_elt): New prototype.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* gdbtypes.c (lookup_struct_elt_type): Update comment and
remove disabled code block.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* gdbarch.sh (get_thread_local_address): New method.
* gdbarch.h, gdbarch.c: Regenerate.
* target.c (target_translate_tls_address): Use
gdbarch_get_thread_local_address if present instead of
target::get_thread_local_address.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* target.h (target::get_thread_local_address): Update comment.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* solib-svr4.c (svr4_fetch_objfile_link_map): Look for
objfile->separate_debug_objfile_backlink if not NULL.
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Use
tdep->fsbase_regnum instead of constants for fs_base and gs_base.
(amd64bsd_store_inferior_registers): Likewise.
* amd64-fbsd-nat.c (amd64_fbsd_nat_target::read_description):
Enable segment base registers.
* i386-bsd-nat.c (i386bsd_fetch_inferior_registers): Use
PT_GETFSBASE and PT_GETGSBASE.
(i386bsd_store_inferior_registers): Use PT_SETFSBASE and
PT_SETGSBASE.
* i386-fbsd-nat.c (i386_fbsd_nat_target::read_description): Enable
segment base registers.
* i386-fbsd-tdep.c (i386fbsd_core_read_description): Likewise.
Support the fs_base and gs_base registers on i386. As on amd64, these registers hold the base address of the fs and gs segments, respectively. For i386 these two registers are 32 bits. gdb/ChangeLog: * amd64-fbsd-nat.c (amd64_fbsd_nat_target::read_description): Update calls to i386_target_description to add 'segments' parameter. * amd64-tdep.c (amd64_init_abi): Set tdep->fsbase_regnum. Don't add segment base registers. * arch/i386.c (i386_create_target_description): Add 'segments' parameter to enable segment base registers. * arch/i386.h (i386_create_target_description): Likewise. * features/i386/32bit-segments.xml: New file. * features/i386/32bit-segments.c: Generate. * i386-fbsd-nat.c (i386_fbsd_nat_target::read_description): Update call to i386_target_description to add 'segments' parameter. * i386-fbsd-tdep.c (i386fbsd_core_read_description): Likewise. * i386-go32-tdep.c (i386_go32_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_read_description): Likewise. * i386-tdep.c (i386_validate_tdesc_p): Add segment base registers if feature is present. (i386_gdbarch_init): Pass I386_NUM_REGS to set_gdbarch_num_regs. Add 'segments' parameter to call to i386_target_description. (i386_target_description): Add 'segments' parameter to enable segment base registers. (_initialize_i386_tdep) [GDB_SELF_TEST]: Add 'segments' parameter to call to i386_target_description. * i386-tdep.h (struct gdbarch_tdep): Add 'fsbase_regnum'. (enum i386_regnum): Add I386_FSBASE_REGNUM and I386_GSBASE_REGNUM. Define I386_NUM_REGS. (i386_target_description): Add 'segments' parameter to enable segment base registers. gdb/gdbserver/ChangeLog: * linux-x86-tdesc.c (i386_linux_read_description): Update call to i386_create_target_description for 'segments' parameter. * lynx-i386-low.c (lynx_i386_arch_setup): Likewise. * nto-x86-low.c (nto_x86_arch_setup): Likewise. * win32-i386-low.c (i386_arch_setup): Likewise.
2019-03-12 21:39:02 +01:00
2019-03-12 John Baldwin <jhb@FreeBSD.org>
* amd64-fbsd-nat.c (amd64_fbsd_nat_target::read_description):
Update calls to i386_target_description to add 'segments'
parameter.
* amd64-tdep.c (amd64_init_abi): Set tdep->fsbase_regnum. Don't
add segment base registers.
* arch/i386.c (i386_create_target_description): Add 'segments'
parameter to enable segment base registers.
* arch/i386.h (i386_create_target_description): Likewise.
* features/i386/32bit-segments.xml: New file.
* features/i386/32bit-segments.c: Generate.
* i386-fbsd-nat.c (i386_fbsd_nat_target::read_description): Update
call to i386_target_description to add 'segments' parameter.
* i386-fbsd-tdep.c (i386fbsd_core_read_description): Likewise.
* i386-go32-tdep.c (i386_go32_init_abi): Likewise.
* i386-linux-tdep.c (i386_linux_read_description): Likewise.
* i386-tdep.c (i386_validate_tdesc_p): Add segment base registers
if feature is present.
(i386_gdbarch_init): Pass I386_NUM_REGS to set_gdbarch_num_regs.
Add 'segments' parameter to call to i386_target_description.
(i386_target_description): Add 'segments' parameter to enable
segment base registers.
(_initialize_i386_tdep) [GDB_SELF_TEST]: Add 'segments' parameter
to call to i386_target_description.
* i386-tdep.h (struct gdbarch_tdep): Add 'fsbase_regnum'.
(enum i386_regnum): Add I386_FSBASE_REGNUM and I386_GSBASE_REGNUM.
Define I386_NUM_REGS.
(i386_target_description): Add 'segments' parameter to enable
segment base registers.
2019-03-12 Eli Zaretskii <eliz@gnu.org>
PR/24325
* source-cache.c: #undef open and close, to avoid unresolved
externals during linking.
2019-03-12 Tom Tromey <tromey@adacore.com>
* remote.c (magic_null_ptid, not_sent_ptid, any_thread_ptid): Now
const. Add initializers.
(_initialize_remote): Don't initialize ptid globals.
2019-03-12 Pedro Alves <palves@redhat.com>
* yy-remap.h [TEST_CPNAMES] (YYFPRINTF): Don't define.
2019-03-12 Pedro Alves <palves@redhat.com>
* cp-name-parser.y (main): Remove unused 'len' variable.
2019-03-12 Tom Tromey <tromey@adacore.com>
* common/ptid.c (null_ptid, minus_one_ptid): Now const.
* common/ptid.h (null_ptid, minus_one_ptid): Now const.
Change iterate_over_lwps to take a gdb::function_view This changes iterate_over_lwps to use a gdb::function_view. This was needed in order to make null_ptid and minus_one_ptid 'const'. gdb/ChangeLog 2019-03-12 Tom Tromey <tromey@adacore.com> * linux-nat.c (iterate_over_lwps): Update. (stop_callback): Remove parameter. (stop_wait_callback, detach_callback, resume_set_callback) (select_singlestep_lwp_callback, set_ignore_sigint) (status_callback, resumed_callback, resume_clear_callback) (kill_callback, kill_wait_callback, linux_nat_stop_lwp): Remove data parameter. (linux_nat_target::detach, linux_nat_target::resume) (linux_stop_and_wait_all_lwps, select_event_lwp) (linux_nat_filter_event, linux_nat_wait_1) (linux_nat_target::kill, linux_nat_target::stop) (linux_nat_target::stop): Update. (linux_nat_resume_callback): Change type. (resume_stopped_resumed_lwps, count_events_callback) (select_event_lwp_callback): Likewise. (linux_stop_lwp, linux_nat_stop_lwp): Update. * arm-linux-nat.c (struct update_registers_data): Remove. (update_registers_callback): Change type. (arm_linux_insert_hw_breakpoint1): Update. * nat/x86-linux-dregs.c (update_debug_registers_callback): Remove parameter. (x86_linux_dr_set_addr): Update. (x86_linux_dr_set_control): Update. * nat/linux-nat.h (iterate_over_lwps_ftype): Remove parameter. (iterate_over_lwps): Use gdb::function_view. * nat/aarch64-linux-hw-point.c (struct aarch64_dr_update_callback_param): Remove. (debug_reg_change_callback): Change type. (aarch64_notify_debug_reg_change): Update. * s390-linux-nat.c (s390_refresh_per_info): Update. gdb/gdbserver/ChangeLog 2019-03-12 Tom Tromey <tromey@adacore.com> * linux-low.c (iterate_over_lwps): Update.
2019-03-04 20:05:03 +01:00
2019-03-12 Tom Tromey <tromey@adacore.com>
* linux-nat.c (iterate_over_lwps): Update.
(stop_callback): Remove parameter.
(stop_wait_callback, detach_callback, resume_set_callback)
(select_singlestep_lwp_callback, set_ignore_sigint)
(status_callback, resumed_callback, resume_clear_callback)
(kill_callback, kill_wait_callback, linux_nat_stop_lwp): Remove
data parameter.
(linux_nat_target::detach, linux_nat_target::resume)
(linux_stop_and_wait_all_lwps, select_event_lwp)
(linux_nat_filter_event, linux_nat_wait_1)
(linux_nat_target::kill, linux_nat_target::stop)
(linux_nat_target::stop): Update.
(linux_nat_resume_callback): Change type.
(resume_stopped_resumed_lwps, count_events_callback)
(select_event_lwp_callback): Likewise.
(linux_stop_lwp, linux_nat_stop_lwp): Update.
* arm-linux-nat.c (struct update_registers_data): Remove.
(update_registers_callback): Change type.
(arm_linux_insert_hw_breakpoint1): Update.
* nat/x86-linux-dregs.c (update_debug_registers_callback): Remove
parameter.
(x86_linux_dr_set_addr): Update.
(x86_linux_dr_set_control): Update.
* nat/linux-nat.h (iterate_over_lwps_ftype): Remove parameter.
(iterate_over_lwps): Use gdb::function_view.
* nat/aarch64-linux-hw-point.c (struct
aarch64_dr_update_callback_param): Remove.
(debug_reg_change_callback): Change type.
(aarch64_notify_debug_reg_change): Update.
* s390-linux-nat.c (s390_refresh_per_info): Update.
2019-03-11 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (dwarf2_find_containing_comp_unit): Remove
redundant assignment to "this_cu".
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type): Remove unnecessary cases from switch.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_set): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_struct): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_complex): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_float): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_bool): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_range): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_char): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_enum): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_int): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_func): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_array): New function extracted
from...
(rank_one_type): ... this.
2019-03-08 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (rank_one_type_parm_ptr): New function extracted
from...
(rank_one_type): ... this.
2019-02-27 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* inferior.c (initialize_inferiors): Ensure 'help set/show print
inferior-events' shows the example events.
2019-03-08 Eli Zaretskii <eliz@gnu.org>
Support styling on native MS-Windows console
PR/24315
* utils.c (can_emit_style_escape) [_WIN32]: Don't disable styling
on MS-Windows if $TERM is not defined.
* cli/cli-style.c: Set cli_styling to 1 in the MinGW build.
* posix-hdep.c (gdb_console_fputs):
* mingw-hdep.c (rgb_to_16colors, gdb_console_fputs): New
functions.
* ui-file.h (gdb_console_fputs): Add prototype.
* ui-file.c (stdio_file::puts): Call gdb_console_fputs, and fall
back to fputs only if the former returns zero.
C++-ify bcache This somewhat C++-ifies bcache. It replaces bcache_xmalloc and bcache_xfree with constructors; changes some functions into methods; and changes various structures to include a bcache directly (as opposed to a pointer to a bcache). Tested by the buildbot. gdb/ChangeLog 2019-03-07 Tom Tromey <tom@tromey.com> * symmisc.c (print_symbol_bcache_statistics): Update. (print_objfile_statistics): Update. * symfile.c (allocate_symtab): Update. * stabsread.c: Don't include bcache.h. * psymtab.h (struct psymbol_bcache): Don't declare. (class psymtab_storage) <psymbol_cache>: Now a bcache. (psymbol_bcache_init, psymbol_bcache_free) (psymbol_bcache_get_bcache): Don't declare. * psymtab.c (struct psymbol_bcache): Remove. (psymtab_storage::psymtab_storage): Update. (psymtab_storage::~psymtab_storage): Update. (psymbol_bcache_init, psymbol_bcache_free) (psymbol_bcache_get_bcache, psymbol_bcache_full): Remove. (add_psymbol_to_bcache): Update. (allocate_psymtab): Update. * objfiles.h (struct objfile_per_bfd_storage) <filename_cache, macro_cache>: No longer pointers. * objfiles.c (get_objfile_bfd_data): Don't call bcache_xmalloc. (free_objfile_per_bfd_storage): Don't call bcache_xfree. * macrotab.c (macro_bcache): Update. * macroexp.c: Don't include bcache.h. * gdbtypes.c (check_types_worklist): Update. (types_deeply_equal): Remove TRY/CATCH. Update. * elfread.c (elf_symtab_read): Update. * dwarf2read.c: Don't include bcache.h. * buildsym.c (buildsym_compunit::get_macro_table): Update. * bcache.h (bcache, bcache_full, bcache_xffree, bcache_xmalloc) (print_bcache_statistics, bcache_memory_used): Don't declare. (struct bcache): Move from bcache.c. Add constructor, destructor, methods. Rename all data members. * bcache.c (struct bcache): Move to bcache.h. (bcache::expand_hash_table): Rename from expand_hash_table. (bcache): Remove. (bcache::insert): Rename from bcache_full. (bcache::compare): Rename from bcache_compare. (bcache_xmalloc): Remove. (bcache::~bcache): Rename from bcache_xfree. (bcache::print_statistics): Rename from print_bcache_statistics. (bcache::memory_used): Rename from bcache_memory_used.
2019-03-07 12:20:19 +01:00
2019-03-07 Tom Tromey <tom@tromey.com>
* symmisc.c (print_symbol_bcache_statistics): Update.
(print_objfile_statistics): Update.
* symfile.c (allocate_symtab): Update.
* stabsread.c: Don't include bcache.h.
* psymtab.h (struct psymbol_bcache): Don't declare.
(class psymtab_storage) <psymbol_cache>: Now a bcache.
(psymbol_bcache_init, psymbol_bcache_free)
(psymbol_bcache_get_bcache): Don't declare.
* psymtab.c (struct psymbol_bcache): Remove.
(psymtab_storage::psymtab_storage): Update.
(psymtab_storage::~psymtab_storage): Update.
(psymbol_bcache_init, psymbol_bcache_free)
(psymbol_bcache_get_bcache, psymbol_bcache_full): Remove.
(add_psymbol_to_bcache): Update.
(allocate_psymtab): Update.
* objfiles.h (struct objfile_per_bfd_storage) <filename_cache,
macro_cache>: No longer pointers.
* objfiles.c (get_objfile_bfd_data): Don't call bcache_xmalloc.
(free_objfile_per_bfd_storage): Don't call bcache_xfree.
* macrotab.c (macro_bcache): Update.
* macroexp.c: Don't include bcache.h.
* gdbtypes.c (check_types_worklist): Update.
(types_deeply_equal): Remove TRY/CATCH. Update.
* elfread.c (elf_symtab_read): Update.
* dwarf2read.c: Don't include bcache.h.
* buildsym.c (buildsym_compunit::get_macro_table): Update.
* bcache.h (bcache, bcache_full, bcache_xffree, bcache_xmalloc)
(print_bcache_statistics, bcache_memory_used): Don't declare.
(struct bcache): Move from bcache.c. Add constructor, destructor,
methods. Rename all data members.
* bcache.c (struct bcache): Move to bcache.h.
(bcache::expand_hash_table): Rename from expand_hash_table.
(bcache): Remove.
(bcache::insert): Rename from bcache_full.
(bcache::compare): Rename from bcache_compare.
(bcache_xmalloc): Remove.
(bcache::~bcache): Rename from bcache_xfree.
(bcache::print_statistics): Rename from print_bcache_statistics.
(bcache::memory_used): Rename from bcache_memory_used.
2019-03-07 Pedro Alves <palves@redhat.com>
* infrun.c (normal_stop): Also check for
TARGET_WAITKIND_NO_RESUMED before referring to inferior_thread().
2019-03-07 Andrew Burgess <andrew.burgess@embecosm.com>
* f-lang.c (value_from_host_double): Moved to...
* value.c (value_from_host_double): ...here.
* value.h (value_from_host_double): Declare.
* guile/scm-math.c (vlscm_convert_typed_number): Use
value_from_host_double.
(vlscm_convert_number): Likewise.
* guile/scm-value.c (gdbscm_value_to_real): Likewise.
* python/py-value.c (convert_value_from_python): Likewise.
2019-03-06 Tom Tromey <tom@tromey.com>
* gcore.c (write_gcore_file): Use SCOPE_EXIT.
2019-03-06 Tom Tromey <tom@tromey.com>
* utils.h (free_current_contents): Don't declare.
* utils.c (free_current_contents): Remove.
2019-03-06 Tom Tromey <tom@tromey.com>
* top.c (quit_force): Update.
* main.c (captured_command_loop): Update.
* common/new-op.c (operator new): Update.
* common/common-exceptions.c (struct catcher)
<save_cleanup_chain>: Remove member.
(exceptions_state_mc_init): Update.
(exception_try_scope_entry): Return nullptr.
(exception_try_scope_exit, exception_rethrow)
(throw_exception_sjlj, throw_exception_cxx): Update.
* common/cleanups.h (make_cleanup, make_cleanup_dtor)
(all_cleanups, do_cleanups, discard_cleanups)
(discard_final_cleanups, save_cleanups, save_final_cleanups)
(restore_cleanups, restore_final_cleanups): Don't declare.
(do_final_cleanups): Remove parameter.
* common/cleanups.c (cleanup_chain, make_cleanup)
(make_cleanup_dtor, all_cleanups, do_cleanups)
(discard_my_cleanups, discard_cleanups)
(discard_final_cleanups, save_my_cleanups, save_cleanups)
(save_final_cleanups, restore_my_cleanups, restore_cleanups)
(null_cleanup): Remove.
(do_final_cleanups): Remove parameter.
2019-03-06 Tom Tromey <tom@tromey.com>
* remote.c (remote_target::remote_parse_stop_reply): Use
unique_xmalloc_ptr.
2019-03-06 Tom Tromey <tom@tromey.com>
* stabsread.c (struct stabs_field_info): Rename from field_info.
<list, fnlist>: Add initializers.
<obstack>: New member.
(read_member_functions, read_struct_fields, read_baseclasses):
Allocate on obstack. Don't use cleanups.
(read_one_struct_field, read_member_functions, read_struct_fields)
(read_baseclasses, read_tilde_fields, attach_fn_fields_to_type)
(attach_fields_to_type, read_cpp_abbrev, read_member_functions)
(read_struct_type): Update.
2019-03-06 Tom Tromey <tom@tromey.com>
* nat/linux-namespaces.c (linux_mntns_access_fs): Use SCOPE_EXIT.
* common/filestuff.h (make_cleanup_close): Don't declare.
* common/filestuff.c (do_close_cleanup, make_cleanup_close):
Remove.
2019-03-06 Tom Tromey <tom@tromey.com>
* solib-aix.c: Use make_scope_exit.
2019-03-06 Tom Tromey <tom@tromey.com>
* solib-svr4.c (svr4_parse_libraries, svr4_current_sos_direct):
Use make_scope_exit.
2019-03-06 Tom Tromey <tom@tromey.com>
* solib-svr4.c (disable_probes_interface): Remove parameter.
(svr4_handle_solib_event): Use make_scope_exit.
2019-03-06 Tom Tromey <tom@tromey.com>
* remote.c (struct stop_reply_deleter): Remove.
(stop_reply_up): Update.
(struct stop_reply): Derive from notif_event. Don't typedef.
<regcache>: Now a std::vector.
(stop_reply_xfree): Remove.
(stop_reply::~stop_reply): Rename from stop_reply_dtr.
(remote_notif_stop_alloc_reply): Return a unique_ptr. Use new.
(remote_target::discard_pending_stop_replies): Use delete.
(remote_target::remote_parse_stop_reply): Update.
(remote_target::process_stop_reply): Update.
* remote-notif.h (struct notif_event): Add virtual destructor.
Remove "dtr" member.
(struct notif_client) <alloc_event>: Return a unique_ptr.
(notif_event_xfree): Don't declare.
(notif_event_up): New typedef.
* remote-notif.c (remote_notif_ack, remote_notif_parse): Update.
(notif_event_xfree, do_notif_event_xfree): Remove.
(remote_notif_state_xfree): Update.
2019-03-06 Tom Tromey <tom@tromey.com>
* infrun.c (displaced_step_clear_cleanup): Now a
forward_scope_exit type.
(displaced_step_prepare_throw): Update.
(displaced_step_fixup): Update.
2019-03-06 Tom Tromey <tom@tromey.com>
* inferior.h (class inferior): Update comment.
* gdbthread.h (class thread_info): Update comment.
2019-03-06 Joel Brobecker <brobecker@adacore.com>
Tom Tromey <tom@tromey.com>
* stabsread.h (struct stab_section_list): Remove.
(coffstab_build_psymtabs): Update.
* dbxread.c (symbuf_sections): Now a std::vector.
(sect_idx): New global.
(fill_symbuf): Update.
(coffstab_build_psymtabs): Change type of stabsects parameter.
Update.
* coffread.c (struct coff_symfile_info) <stabsects>: Now a
std::vector.
(linetab, linetab_offset, linetab_size, stringtab): Move earlier.
(coff_locate_sections): Update.
(coff_symfile_read): Remove cleanups. Update.
(init_stringtab): Add storage parameter.
(free_stringtab, free_stringtab_cleanup): Remove.
(init_lineno): Add storage parameter.
(free_linetab, free_linetab_cleanup): Remove.
2019-03-06 Pedro Alves <palves@redhat.com>
* linux-fork.c (fork_info::clobber_regs): Delete.
(fork_load_infrun_state): Remove reference to 'clobber_regs'.
(fork_save_infrun_state): Remove 'clobber_regs' parameter. Update
comment. Adjust.
(scoped_switch_fork_info::scoped_switch_fork_info)
(checkpoint_command, linux_fork_context): Adjust
fork_save_infrun_state calls.
2019-03-06 Pedro Alves <palves@redhat.com>
* linux-fork.c (inf_has_multiple_thread_cb): Delete.
(inf_has_multiple_threads): Return 'bool' and rewrite using
inferior_info::threads().
2019-03-06 Pedro Alves <palves@redhat.com>
* linux-fork.c: Include <list>.
(fork_list): Now a std::list instance.
(fork_info): Add ctor, dtor, and in-class initialize all fields.
(forks_exist_p, find_last_fork): Adjust.
(new_fork): Delete.
(one_fork_p): New.
(add_fork): Adjust.
(free_fork): Delete, folded into fork_info::~fork_info().
(delete_fork, find_fork_ptid, find_fork_id, find_fork_pid):
Adjust.
(init_fork_list): Delete.
(linux_fork_killall, linux_fork_mourn_inferior)
(linux_fork_detach, info_checkpoints_command): Adjust.
(_initialize_linux_fork): No longer call init_fork_list.
2019-03-06 Pedro Alves <palves@redhat.com>
* linux-fork.c (new_fork): New, split out of ...
(add_fork): ... this. Return void. Move "first fork" special
case from here, to ...
(checkpoint_command): ... here.
* linux-linux.h (add_fork): Return void.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* f-exp.y (direct_abs_decl): Handle TYPE*SIZE type names.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
David Lecomber <david.lecomber@arm.com>
* f-exp.y: New token, UNOP_INTRINSIC.
(exp): New pattern using UNOP_INTRINSIC token.
(f77_keywords): Add 'abs' keyword.
* f-lang.c: Add 'target-float.h' and 'math.h' includes.
(value_from_host_double): New function.
(evaluate_subexp_f): Support UNOP_ABS.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* f-lang.c (build_fortran_types): Use TYPE_CODE_CHAR for character
types.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* f-exp.y (convert_to_kind_type): Handle integer (kind=8).
* f-lang.c (build_fortran_types): Setup builtin_integer_s8.
* f-lang.h (struct builtin_f_type): Add builtin_integer_s8 field.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* f-exp.y (convert_to_kind_type): Handle more type kinds.
gdb/fortran: Add Fortran 'kind' intrinsic and keyword The 'kind' keyword has two uses in Fortran, it is the name of a builtin intrinsic function, and it is also a keyword used to create a type of a specific kind. This commit adds support for using kind as an intrinsic function, and also adds some initial support for using kind to create types of a specific kind. This commit only allows the creation of the type 'character(kind=1)', however, it will be easy enough to extend this in future to support more type kinds. The kind of any expression can be queried using the kind intrinsic function. At the moment the kind returned corresponds to the size of the type, this matches how gfortran handles kinds. However, the correspondence between kind and type size depends on the compiler and/or the specific target, so this might not be correct for everyone. If we want to support different compilers/targets in future the code to compute the kind from a type will need to be updated. gdb/ChangeLog: * expprint.c (dump_subexp_body_standard): Support UNOP_KIND. * f-exp.y: Define 'KIND' token. (exp): New pattern for KIND expressions. (ptype): Handle types with a kind extension. (direct_abs_decl): Extend to spot kind extensions. (f77_keywords): Add 'kind' to the list. (push_kind_type): New function. (convert_to_kind_type): New function. * f-lang.c (evaluate_subexp_f): Support UNOP_KIND. * parse.c (operator_length_standard): Likewise. * parser-defs.h (enum type_pieces): Add tp_kind. * std-operator.def: Add UNOP_KIND. gdb/testsuite/ChangeLog: * gdb.fortran/intrinsics.exp: New file. * gdb.fortran/intrinsics.f90: New file. * gdb.fortran/type-kinds.exp: New file.
2019-01-16 17:42:10 +01:00
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
* expprint.c (dump_subexp_body_standard): Support UNOP_KIND.
* f-exp.y: Define 'KIND' token.
(exp): New pattern for KIND expressions.
(ptype): Handle types with a kind extension.
(direct_abs_decl): Extend to spot kind extensions.
(f77_keywords): Add 'kind' to the list.
(push_kind_type): New function.
(convert_to_kind_type): New function.
* f-lang.c (evaluate_subexp_f): Support UNOP_KIND.
* parse.c (operator_length_standard): Likewise.
* parser-defs.h (enum type_pieces): Add tp_kind.
* std-operator.def: Add UNOP_KIND.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* f-exp.y (f_parse): Set yydebug.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* f-lang.c (evaluate_subexp_f): New function.
(exp_descriptor_f): New global.
(f_language_defn): Use exp_descriptor_f instead of
exp_descriptor_standard.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* f-exp.y (struct token): Add comments.
(dot_ops): Remove uppercase versions and the end marker.
(f77_keywords): Likewise.
(yylex): Use ARRAY_SIZE to iterate over dot_ops, assert all
entries in the dot_ops array are case insensitive, and use
strncasecmp to compare strings. Also some whitespace cleanup in
this area. Similar for the f77_keywords array, except entries in
this list might be case sensitive.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
* f-exp.y (struct f77_boolean_val): Add comments.
(boolean_values): Remove uppercase versions, and end marker.
(yylex): Use ARRAY_SIZE for iterating over boolean_values array,
and use strncasecmp to achieve case insensitivity. Additionally,
perform whitespace cleanup around this code.
2019-03-06 Tom Tromey <tromey@adacore.com>
* remote-sim.c (gdbsim_target_open): Use result of
gdb_argv::release.
Fortran function calls with arguments Prior to this patch, calling functions on the inferior with arguments and then using these arguments within a function resulted in an invalid memory access. This is because Fortran arguments are typically passed as pointers to values. It is possible to call Fortran functions, but memory must be allocated in the inferior, so a pointer can be passed to the function, and the language must be set to C to enable C-style casting. This is cumbersome and not a pleasant debug experience. This patch implements the GNU Fortran argument passing conventions with caveats. Firstly, it does not handle the VALUE attribute as there is insufficient DWARF information to determine when this is the case. Secondly, functions with optional parameters can only be called with all parameters present. Both these cases are marked as KFAILS in the test. Since the GNU Fortran argument passing convention has been implemented, there is no guarantee that this patch will work correctly, in all cases, with other compilers. Despite these limitations, this patch improves the ease with which functions can be called in many cases, without taking away the existing approach of calling with the language set to C. Regression tested on x86_64, aarch64 and POWER9 with GCC 7.3.0. Regression tested with Ada on x86_64. Regression tested with native-extended-gdbserver target board. gdb/ChangeLog: * eval.c (evaluate_subexp_standard): Call Fortran argument wrapping logic. * f-lang.c (struct value): A value which can be passed into a Fortran function call. (fortran_argument_convert): Wrap Fortran arguments in a pointer where appropriate. (struct type): Value ready for a Fortran function call. (fortran_preserve_arg_pointer): Undo check_typedef, the pointer is needed. * f-lang.h (fortran_argument_convert): Declaration. (fortran_preserve_arg_pointer): Declaration. * infcall.c (value_arg_coerce): Call Fortran argument logic. gdb/testsuite/ChangeLog: * gdb.fortran/function-calls.exp: New file. * gdb.fortran/function-calls.f90: New test.
2019-03-06 09:23:00 +01:00
2019-03-06 Richard Bunt <richard.bunt@arm.com>
Dirk Schubert <dirk.schubert@arm.com>
Chris January <chris.january@arm.com>
* eval.c (evaluate_subexp_standard): Call Fortran argument
wrapping logic.
* f-lang.c (struct value): A value which can be passed into a
Fortran function call.
(fortran_argument_convert): Wrap Fortran arguments in a pointer
where appropriate.
(struct type): Value ready for a Fortran function call.
(fortran_preserve_arg_pointer): Undo check_typedef, the pointer
is needed.
* f-lang.h (fortran_argument_convert): Declaration.
(fortran_preserve_arg_pointer): Declaration.
* infcall.c (value_arg_coerce): Call Fortran argument logic.
2019-03-05 Tom Tromey <tromey@adacore.com>
* python/py-prettyprint.c (print_string_repr): Remove #if.
* python/py-utils.c (unicode_to_encoded_string): Remove #if.
2019-03-05 Tom Tromey <tromey@adacore.com>
* target.c (the_dummy_target): Move later. Change type to
"dummy_target".
(initialize_targets): Don't initialize the_dummy_target.
2019-03-05 Tom Tromey <tromey@adacore.com>
* gdb_bfd.c (gdb_bfd_fdopenr): Remove.
* gdb_bfd.h (gdb_bfd_fdopenr): Don't declare.
Remove excess calls to gdb_flush A customer noticed some mildly odd MI output, where CLI output was split into multiple MI strings at unusual boundaries, like this: ~"$1 = (b => true" ~", p => 0x407260" This is technically correct according to the MI spec, but still unusual, in that there's no particular reason for the string to be split where it is. I tracked this down to a call to gdb_flush in generic_val_print. Then, I went through all calls to gdb_flush and removed the ones I thought were superfluous. In particular: * Any call in the value-printing code; * Likewise the type-printing code (just a single call); and * Any call that immediately followed a printf that obviously ended with a newline, my belief being that gdb's standard output streams are line buffered (by inheriting the behavior from stdio) Regression tested on x86-64 Fedora 29. I didn't add a new test case. I tend to think we don't necessarily want to specify this behavior in the tests. Let me know what you think of this. gdb/ChangeLog 2019-03-05 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat_target::attach) (windows_nat_target::detach): Don't call gdb_flush. * valprint.c (generic_val_print, val_print, val_print_string): Don't call gdb_flush. * utils.c (defaulted_query): Don't call gdb_flush. * typeprint.c (print_type_scalar): Don't call gdb_flush. * target.c (target_announce_detach): Don't call gdb_flush. * sparc64-tdep.c (adi_print_versions): Don't call gdb_flush. * remote.c (extended_remote_target::attach): Don't call gdb_flush. * procfs.c (procfs_target::detach): Don't call gdb_flush. * printcmd.c (do_examine): Don't call gdb_flush. (info_display_command): Don't call gdb_flush. * p-valprint.c (pascal_val_print): Don't call gdb_flush. * nto-procfs.c (nto_procfs_target::attach): Don't call gdb_flush. * memattr.c (info_mem_command): Don't call gdb_flush. * mdebugread.c (mdebug_build_psymtabs): Don't call gdb_flush. * m2-valprint.c (m2_val_print): Don't call gdb_flush. * infrun.c (follow_exec, handle_command): Don't call gdb_flush. * inf-ptrace.c (inf_ptrace_target::attach): Don't call gdb_flush. * hppa-tdep.c (unwind_command): Don't call gdb_flush. * gnu-nat.c (gnu_nat_target::attach): Don't call gdb_flush. (gnu_nat_target::detach): Don't call gdb_flush. * f-valprint.c (f_val_print): Don't call gdb_flush. * darwin-nat.c (darwin_nat_target::attach): Don't call gdb_flush. * cli/cli-script.c (read_command_lines): Don't call gdb_flush. * cli/cli-cmds.c (shell_escape, print_disassembly): Don't call gdb_flush. * c-valprint.c (c_val_print): Don't call gdb_flush. * ada-valprint.c (ada_print_scalar): Don't call gdb_flush.
2019-02-19 21:36:17 +01:00
2019-03-05 Tom Tromey <tromey@adacore.com>
* windows-nat.c (windows_nat_target::attach)
(windows_nat_target::detach): Don't call gdb_flush.
* valprint.c (generic_val_print, val_print, val_print_string):
Don't call gdb_flush.
* utils.c (defaulted_query): Don't call gdb_flush.
* typeprint.c (print_type_scalar): Don't call gdb_flush.
* target.c (target_announce_detach): Don't call gdb_flush.
* sparc64-tdep.c (adi_print_versions): Don't call gdb_flush.
* remote.c (extended_remote_target::attach): Don't call
gdb_flush.
* procfs.c (procfs_target::detach): Don't call gdb_flush.
* printcmd.c (do_examine): Don't call gdb_flush.
(info_display_command): Don't call gdb_flush.
* p-valprint.c (pascal_val_print): Don't call gdb_flush.
* nto-procfs.c (nto_procfs_target::attach): Don't call gdb_flush.
* memattr.c (info_mem_command): Don't call gdb_flush.
* mdebugread.c (mdebug_build_psymtabs): Don't call gdb_flush.
* m2-valprint.c (m2_val_print): Don't call gdb_flush.
* infrun.c (follow_exec, handle_command): Don't call gdb_flush.
* inf-ptrace.c (inf_ptrace_target::attach): Don't call gdb_flush.
* hppa-tdep.c (unwind_command): Don't call gdb_flush.
* gnu-nat.c (gnu_nat_target::attach): Don't call gdb_flush.
(gnu_nat_target::detach): Don't call gdb_flush.
* f-valprint.c (f_val_print): Don't call gdb_flush.
* darwin-nat.c (darwin_nat_target::attach): Don't call gdb_flush.
* cli/cli-script.c (read_command_lines): Don't call gdb_flush.
* cli/cli-cmds.c (shell_escape, print_disassembly): Don't call
gdb_flush.
* c-valprint.c (c_val_print): Don't call gdb_flush.
* ada-valprint.c (ada_print_scalar): Don't call gdb_flush.
2019-03-05 Tom Tromey <tromey@adacore.com>
* varobj.c (update_dynamic_varobj_children): Update.
(install_default_visualizer): Use reset, not release.
* value.c (set_internalvar): Update.
* dwarf2loc.c (value_of_dwarf_reg_entry): Update.
* common/gdb_ref_ptr.h (class ref_ptr) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
2019-03-05 Tom Tromey <tromey@adacore.com>
* remote.c (class scoped_remote_fd) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
2019-03-05 Tom Tromey <tromey@adacore.com>
* macroexp.c (struct macro_buffer) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
2019-03-05 Tom Tromey <tromey@adacore.com>
* nat/linux-btrace.c (linux_enable_bts, linux_enable_pt): Update.
* common/scoped_mmap.h (class scoped_mmap) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
2019-03-05 Tom Tromey <tromey@adacore.com>
* common/scoped_fd.h (class scoped_fd) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
2019-03-05 Tom Tromey <tromey@adacore.com>
* parser-defs.h (struct parser_state) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
2019-03-05 Tom Tromey <tromey@adacore.com>
* utils.h (class gdb_argv) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
* common/common-defs.h (ATTRIBUTE_UNUSED_RESULT): Define.
2019-03-02 Eli Zaretskii <eliz@gnu.org>
* xml-syscall.c (xml_list_syscalls_by_group): Drop 'struct' from
for-loop range, to avoid compiler warnings.
* tui/tui.c (tui_enable) [__MINGW32__]: Don't declare 'cap', to
avoid compiler warnings about unused variables.
* NEWS: Mention end of support for native debugging on MS-Windows
before XP.
PR gdb/24292
* common/netstuff.c:
* gdbserver/gdbreplay.c
* gdbserver/remote-utils.c:
* ser-tcp.c:
* unittests/parse-connection-spec-selftests.c [USE_WIN32API]:
Include ws2tcpip.h instead of wsiapi.h and winsock2.h. Redefine
_WIN32_WINNT to 0x0501 if defined to a smaller value, as
'getaddrinfo' and 'freeaddrinfo' were not available before
Windows XP, and mingw.org's MinGW headers by default define
_WIN32_WINNT to 0x500.
2019-03-01 Gary Benson <gbenson@redhat.com>
* coffread.c (coff_start_symtab): Remove unnecessary xstrdup.
2019-02-28 Brian Vandenberg <phantall@gmail.com>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR gdb/8527
* procfs.c (proc_wait_for_stop): Wrap write of PCWSTOP in
set_sigint_trap, clear_sigint_trap.
Fix regcache leak, and avoid possible regcache access after detach. Valgrind reports leaks like the below in various tests, e.g. gdb.threads/attach-slow-waitpid.exp, gdb.ada/task_switch_in_core.exp, ... Fix the leak by clearing the regcache when detaching from an inferior. Note that these leaks are 'created' when GDB exits, when the regcache::current_regcache is destroyed : the elements of the forward_list are pointers, and the 'pointed to' memory is not deleted by the forward_list destructor. Nevertheless, fixing this leak is good as it makes a bunch of tests 'leak clean'. Also, it seems strange to keep a register cache for a process from which GDB detached : it is not clear if this cache is still valid after detach. And effectively, when clearing only the regcache, (and not the frame cache), then the frame cache was still 'pointing' at this regcache and was used when switching to the child process in the test gdb.threads/watchpoint-fork.exp, which seems strange. So, we solve the leak and avoid possible accesses to the regcache and frame cache of the detached inferior, by clearing both the regcache and the frame cache. Tested on debian/amd64, natively, under Valgrind, and with make check RUNTESTFLAGS="--target_board=native-gdbserver". ==27679== VALGRIND_GDB_ERROR_BEGIN ==27679== 1,123 (72 direct, 1,051 indirect) bytes in 1 blocks are definitely lost in loss record 2,942 of 3,400 ==27679== at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344) ==27679== by 0x5CDF71: get_thread_arch_aspace_regcache(ptid_t, gdbarch*, address_space*) (regcache.c:330) ==27679== by 0x5CE12A: get_thread_regcache (regcache.c:366) ==27679== by 0x5CE12A: get_current_regcache() (regcache.c:372) ==27679== by 0x4FF63D: post_create_inferior(target_ops*, int) (infcmd.c:452) ==27679== by 0x43AF62: core_target_open(char const*, int) (corelow.c:458) ==27679== by 0x408B68: cmd_func(cmd_list_element*, char const*, int) (cli-decode.c:1892) ... gdb/ChangeLog 2019-02-27 Philippe Waroquiers <philippe.waroquiers@skynet.be> * target.c (target_detach): Clear the regcache and the frame cache.
2019-02-16 14:11:38 +01:00
2019-02-27 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* target.c (target_detach): Clear the regcache and the
frame cache.
2019-02-27 Pedro Alves <palves@redhat.com>
* utils.c (set_screen_size): When we cap the height/width sizes,
tweak the corresponding command variable to show "unlimited":
2019-02-27 Saagar Jha <saagar@saagarjha.com>
Pedro Alves <palves@redhat.com>
* utils.c (set_screen_size): Reduce "infinite" rows and columns
before calling rl_set_screen_size.
Remove Python 2.4 and 2.5 support This removes all the remainings spots I could find that work around issues in Python 2.4 and 2.5. I don't have a good way to test that Python 2.6 still works. Tested by the buildbot. gdb/ChangeLog 2019-02-27 Tom Tromey <tromey@adacore.com> * config.in, configure: Rebuild. * configure.ac (HAVE_LIBPYTHON2_4, HAVE_LIBPYTHON2_5): Never define. * python/py-value.c: Remove Python 2.4 workaround. * python/py-utils.c (gdb_pymodule_addobject): Remove Python 2.4 workaround. * python/py-type.c (convert_field, gdbpy_initialize_types): Remove Python 2.4 workaround. * python/python-internal.h: Remove Python 2.4 comment. (Py_ssize_t): Don't define. (PyVarObject_HEAD_INIT, Py_TYPE): Don't define. (gdb_Py_DECREF): Remove Python 2.4 workaround. (gdb_PyObject_GetAttrString, PyObject_GetAttrString): Remove. (gdb_PyObject_HasAttrString, PyObject_HasAttrString): Remove. * python/python.c (do_start_initialization): Remove Python 2.4 workaround. * python/py-prettyprint.c (class dummy_python_frame): Remove. (print_children): Remove Python 2.4 workaround. * python/py-inferior.c (buffer_procs): Remove Python 2.4 workaround. (CHARBUFFERPROC_NAME): Remove. * python/py-breakpoint.c (gdbpy_initialize_breakpoints): Remove Python 2.4 workaround. gdb/testsuite/ChangeLog 2019-02-27 Tom Tromey <tromey@adacore.com> * lib/gdb.exp (skip_python_tests_prompt): Don't check for Python 2.4. * gdb.python/py-finish-breakpoint.exp: Remove Python 2.4 workaround. gdb/ChangeLog 2019-02-27 Tom Tromey <tromey@adacore.com> * config.in, configure: Rebuild. * configure.ac (HAVE_LIBPYTHON2_4, HAVE_LIBPYTHON2_5): Never define. * python/py-value.c: Remove Python 2.4 workaround. * python/py-utils.c (gdb_pymodule_addobject): Remove Python 2.4 workaround. * python/py-type.c (convert_field, gdbpy_initialize_types): Remove Python 2.4 workaround. * python/python-internal.h: Remove Python 2.4 comment. (Py_ssize_t): Don't define. (PyVarObject_HEAD_INIT, Py_TYPE): Don't define. (gdb_Py_DECREF): Remove Python 2.4 workaround. (gdb_PyObject_GetAttrString, PyObject_GetAttrString): Remove. (gdb_PyObject_HasAttrString, PyObject_HasAttrString): Remove. * python/python.c (do_start_initialization): Remove Python 2.4 workaround. * python/py-prettyprint.c (class dummy_python_frame): Remove. (print_children): Remove Python 2.4 workaround. * python/py-inferior.c (buffer_procs): Remove Python 2.4 workaround. (CHARBUFFERPROC_NAME): Remove. * python/py-breakpoint.c (gdbpy_initialize_breakpoints): Remove Python 2.4 workaround.
2019-02-26 19:58:47 +01:00
2019-02-27 Tom Tromey <tromey@adacore.com>
* configure.ac (HAVE_LIBPYTHON2_4, HAVE_LIBPYTHON2_5): Never
define.
* python/py-value.c: Remove Python 2.4 workaround.
* python/py-utils.c (gdb_pymodule_addobject): Remove Python 2.4
workaround.
* python/py-type.c (convert_field, gdbpy_initialize_types): Remove
Python 2.4 workaround.
* python/python-internal.h: Remove Python 2.4 comment.
(Py_ssize_t): Don't define.
(PyVarObject_HEAD_INIT, Py_TYPE): Don't define.
(gdb_Py_DECREF): Remove Python 2.4 workaround.
(gdb_PyObject_GetAttrString, PyObject_GetAttrString): Remove.
(gdb_PyObject_HasAttrString, PyObject_HasAttrString): Remove.
* python/python.c (do_start_initialization): Remove Python 2.4
workaround.
* python/py-prettyprint.c (class dummy_python_frame): Remove.
(print_children): Remove Python 2.4 workaround.
* python/py-inferior.c (buffer_procs): Remove Python 2.4
workaround.
(CHARBUFFERPROC_NAME): Remove.
* python/py-breakpoint.c (gdbpy_initialize_breakpoints): Remove
Python 2.4 workaround.
2019-02-27 Kevin Buettner <kevinb@redhat.com>
Fix regcache leak, and avoid possible regcache access after detach. Valgrind reports leaks like the below in various tests, e.g. gdb.threads/attach-slow-waitpid.exp, gdb.ada/task_switch_in_core.exp, ... Fix the leak by clearing the regcache when detaching from an inferior. Note that these leaks are 'created' when GDB exits, when the regcache::current_regcache is destroyed : the elements of the forward_list are pointers, and the 'pointed to' memory is not deleted by the forward_list destructor. Nevertheless, fixing this leak is good as it makes a bunch of tests 'leak clean'. Also, it seems strange to keep a register cache for a process from which GDB detached : it is not clear if this cache is still valid after detach. And effectively, when clearing only the regcache, (and not the frame cache), then the frame cache was still 'pointing' at this regcache and was used when switching to the child process in the test gdb.threads/watchpoint-fork.exp, which seems strange. So, we solve the leak and avoid possible accesses to the regcache and frame cache of the detached inferior, by clearing both the regcache and the frame cache. Tested on debian/amd64, natively, under Valgrind, and with make check RUNTESTFLAGS="--target_board=native-gdbserver". ==27679== VALGRIND_GDB_ERROR_BEGIN ==27679== 1,123 (72 direct, 1,051 indirect) bytes in 1 blocks are definitely lost in loss record 2,942 of 3,400 ==27679== at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344) ==27679== by 0x5CDF71: get_thread_arch_aspace_regcache(ptid_t, gdbarch*, address_space*) (regcache.c:330) ==27679== by 0x5CE12A: get_thread_regcache (regcache.c:366) ==27679== by 0x5CE12A: get_current_regcache() (regcache.c:372) ==27679== by 0x4FF63D: post_create_inferior(target_ops*, int) (infcmd.c:452) ==27679== by 0x43AF62: core_target_open(char const*, int) (corelow.c:458) ==27679== by 0x408B68: cmd_func(cmd_list_element*, char const*, int) (cli-decode.c:1892) ... gdb/ChangeLog 2019-02-27 Philippe Waroquiers <philippe.waroquiers@skynet.be> * target.c (target_detach): Clear the regcache and the frame cache.
2019-02-16 14:11:38 +01:00
* NEWS: Note minimum Python version.
Use Python 2.[67] / 3.X / PEP 3118 buffer protocol This patch removes the non-IS_PY3K code in infpy_write_memory() and infpy_search_memory(). In both cases, the remaining code from these ifdefs is related to use of the PEP 3118 buffer protocol. (Deleted code is either due to simplification or related to use of the old buffer protocol.) PEP 3118 is sometimes referred to as the "new" buffer protocol, though it's not that new anymore. The link below describes new features in Python 2.6. In particular, it says that the buffer protocol described by PEP 3118 is in Python 2.6. It also says (at the top of the page) that Python 2.6 was released on Oct 1, 2008. https://docs.python.org/3/whatsnew/2.6.html#pep-3118-revised-buffer-protocol The last security release for the Python 2.6 series was 2.6.9. It was released on Oct 29, 2013. According to this document... https://www.python.org/download/releases/2.6.9/ ...support for the 2.6 series has ended: With the 2.6.9 release, and five years after its first release, the Python 2.6 series is now officially retired. All official maintenance for Python 2.6, including security patches, has ended. For ongoing maintenance releases, please see the Python 2.7 series. As noted earlier, Python 2.6, Python 2.7, and Python 3.X all have support for the PEP 3118 buffer protocol. Python releases prior to 2.6 use an older buffer protocol. Since Python 2.6 has been retired for a good while now, it seems reasonable to me to remove code using the older buffer protocol from GDB. I have also simplified some of the code via use of the Py_buffer unique_ptr specialization which I introduced in the two argument gdb.Value constructor patch series. Therefore, there is a dependency on patch #1 from that series. I have tested against both Python 2.7.15 and 3.7.2. I see no regressions among the non-racy tests. I've also verified that PyBuffer_Release is being called when the affected functions exit while running the tests in gdb.python/py-inferior.exp by hand. I've also tried running valgrind on GDB while running this test, but I'm puzzled by the results that I'm seeing - I'm seeing no additional leaks when I comment out the Py_buffer_up lines that I introduced. That said, I'm not seeing any leaks that obviously originate from either infpy_write_memory() or infpy_search_memory(). gdb/ChangeLog: * python/py-inferior.c (infpy_write_memory): Remove non-IS_PY3K code from these functions. Remove corresponding ifdefs. Use Py_buffer_up instead of explicit calls to PyBuffer_Release. Remove gotos and target of gotos. (infpy_search_memory): Likewise.
2019-02-19 21:18:17 +01:00
2019-02-27 Kevin Buettner <kevinb@redhat.com>
* python/py-inferior.c (infpy_write_memory): Remove non-IS_PY3K
code from these functions. Remove corresponding ifdefs. Use
Py_buffer_up instead of explicit calls to PyBuffer_Release.
Remove gotos and target of gotos.
(infpy_search_memory): Likewise.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/hppa-tdep.c (hppa_dummy_id): Delete.
(hppa_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/h8300-tdep.c (h8300_unwind_pc): Delete.
(h8300_unwind_sp): Delete.
(h8300_dummy_id): Delete.
(h8300_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/ft32-tdep.c (ft32_dummy_id): Delete.
(ft32_unwind_pc): Delete.
(ft32_unwind_sp): Delete.
(ft32_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/frv-tdep.c (frv_dummy_id): Delete.
(frv_unwind_pc): Delete.
(frv_unwind_sp): Delete.
(frv_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/riscv-tdep.c (riscv_dummy_id): Delete.
(riscv_unwind_pc): Delete.
(riscv_unwind_sp): Delete.
(riscv_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/csky-tdep.c (csky_dummy_id): Delete.
(csky_unwind_pc): Delete.
(csky_unwind_sp): Delete.
(csky_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/cris-tdep.c (cris_dummy_id): Delete.
(cris_unwind_pc): Delete.
(cris_unwind_sp): Delete.
(cris_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/bfin-tdep.c (bfin_dummy_id): Delete.
(bfin_unwind_pc): Delete.
(bfin_gdbarch_init): Don't register deleted functions with gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/arm-tdep.c (arm_dummy_id): Delete.
(arm_unwind_pc): Delete.
(arm_unwind_sp): Delete.
(arm_gdbarch_init): Don't register deleted functions with gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/arc-tdep.c (arc_dummy_id): Delete.
(arc_unwind_pc): Delete.
(arc_unwind_sp): Delete.
(arc_gdbarch_init): Don't register deleted functions with gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/alpha-tdep.c (alpha_dummy_id): Delete.
(alpha_unwind_pc): Delete.
(alpha_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/aarch64-tdep.c (aarch64_dummy_id): Delete.
(aarch64_unwind_pc): Delete.
(aarch64_unwind_sp): Delete.
(aarch64_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdbtypes.c (type_align): Don't consider static members when
computing structure alignment.
gdb: Restructure type_align and gdbarch_type_align This commit restructures the relationship between the type_align function and the gdbarch_type_align method. The problem being addressed with this commit is this; previously the type_align function was structured so that for "basic" types (int, float, etc) the gdbarch_type_align hook was called, which for "compound" types (arrays, structs, etc) the common type_align code has a fixed method for how to extract a "basic" type and would then call itself on that "basic" type. The problem is that if an architecture wants to modify the alignment rules for a "compound" type then this is not currently possible. In the revised structure, all types pass through the gdbarch_type_align method. If this method returns 0 then this indicates that the architecture has no special rules for this type, and GDB should apply the default rules for alignment. However, the architecture is free to provide an alignment for any type, both "basic" and "compound". After this commit the default alignment rules now all live in the type_align function, the default_type_align only ever returns 0, meaning apply the default rules. I've updated the 3 targets (arc, i386, and nios2) that already override the gdbarch_type_align method to fit the new scheme. Tested on X86-64/GNU Linux with no regressions. gdb/ChangeLog: * arc-tdep.c (arc_type_align): Provide alignment for basic types, return 0 for other types. * arch-utils.c (default_type_align): Always return 0. * gdbarch.h: Regenerate. * gdbarch.sh (type_align): Extend comment. * gdbtypes.c (type_align): Add additional comments, always call gdbarch_type_align before applying the default rules. * i386-tdep.c (i386_type_align): Return 0 as the default rule, generic code will then apply a suitable default. * nios2-tdep.c (nios2_type_align): Provide alignment for basic types, return 0 for other types.
2019-02-22 21:49:04 +01:00
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* arc-tdep.c (arc_type_align): Provide alignment for basic types,
return 0 for other types.
* arch-utils.c (default_type_align): Always return 0.
* gdbarch.h: Regenerate.
* gdbarch.sh (type_align): Extend comment.
* gdbtypes.c (type_align): Add additional comments, always call
gdbarch_type_align before applying the default rules.
* i386-tdep.c (i386_type_align): Return 0 as the default rule,
generic code will then apply a suitable default.
* nios2-tdep.c (nios2_type_align): Provide alignment for basic
types, return 0 for other types.
2019-02-27 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.
2019-02-27 Joel Brobecker <brobecker@adacore.com>
GDB 8.3 branch created (143420fb0d5ae54323ba9953f0818c194635228d):
* version.in: Bump version to 8.3.50.DATE-git.
2019-02-26 Simon Marchi <simon.marchi@efficios.com>
* aix-thread.c (ptid_cmp): Remove unused variable.
(get_signaled_thread): Likewise.
(store_regs_user_thread): Likewise.
(store_regs_kernel_thread): Likewise.
(fetch_regs_kernel_thread): Remove shadowed variable.
gdb/riscv: Use legacy register numbers in default target description When the target description support was added to RISC-V, the register numbers assigned to the fflags, frm, and fcsr control registers in the default target descriptions didn't match the register numbers used by GDB before the target description support was added. What this means is that if a tools exists in the wild that is using hard-coded register number, setup to match GDB's old numbering, then this will have been broken (for fflags, frm, and fcsr) by the move to target descriptions. QEMU is such a tool. There are a couple of solutions that could be used to work around this issue: - The user can create their own xml description file with the register numbers setup to match their old tool, then load this by telling GDB 'set tdesc filename FILENAME'. - Update their old tool to use the newer default numbering scheme, or better yet add proper target description support to their tool. - We could have RISC-V GDB change to maintain the old defaults. This patch changes GDB back to using the old numbering scheme. This change is only visible to remote targets that don't supply their own xml description file and instead rely on GDB's default numbering. Note that even though 32bit-cpu.xml and 64bit-cpu.xml have changed, the corresponding .c file has not, this is because the numbering added to the registers in the xml files is number 0, this doesn't result in any new C code being generated . gdb/ChangeLog: * features/riscv/32bit-cpu.xml: Add register numbers. * features/riscv/32bit-fpu.c: Regenerate. * features/riscv/32bit-fpu.xml: Add register numbers. * features/riscv/64bit-cpu.xml: Add register numbers. * features/riscv/64bit-fpu.c: Regenerate. * features/riscv/64bit-fpu.xml: Add register numbers.
2019-02-23 21:07:47 +01:00
2019-02-26 Andrew Burgess <andrew.burgess@embecosm.com>
* features/riscv/32bit-cpu.xml: Add register numbers.
* features/riscv/32bit-fpu.c: Regenerate.
* features/riscv/32bit-fpu.xml: Add register numbers.
* features/riscv/64bit-cpu.xml: Add register numbers.
* features/riscv/64bit-fpu.c: Regenerate.
* features/riscv/64bit-fpu.xml: Add register numbers.
2019-02-26 Kevin Buettner <kevinb@redhat.com>
* NEWS: Mention two argument form of gdb.Value constructor.
* python/py-value.c (convert_buffer_and_type_to_value): New
function.
(valpy_new): Parse arguments via gdb_PyArg_ParseTupleAndKeywords.
Add support for handling an optional second argument. Call
convert_buffer_and_type_to_value as appropriate.
* python/python-internal.h (Py_buffer_deleter): New struct.
(Py_buffer_up): New typedef.
2019-02-25 John Baldwin <jhb@FreeBSD.org>
* dwarf2read.c (dwarf2_get_dwz_file): Reset dwz_bfd to nullptr
instead of releasing ownership.
Fix crash when loading dwp files When loading dwp files, we create an array of ELF sections indexed by the ELF section index in the dwp file. The size of this array is calculated by section_count, as returned by bfd_count_sections, plus 1 (to account for the null section at index 0). However, when loading the bfd file, strtab/symtab sections are not added to the list, nor do they increment section_count, so section_count is actually smaller than the number of ELF sections. This happens to work when using GNU dwp, which lays out .debug section first, with sections like .shstrtab coming at the end. Other tools, like llvm-dwp, put .strtab first, and gdb crashes when loading those dwp files. For instance, with the current state of gdb, loading a file like this: $ readelf -SW <file.dwp> [ 0] <empty> [ 1] .debug_foo PROGBITS ... [ 2] .strtab STRTAB ... ... results in section_count = 2 (.debug is the only thing placed into bfd->sections, so section_count + 1 == 2), and sectp->this_idx = 1 when mapping over .debug_foo in dwarf2_locate_common_dwp_sections, which passes the assertion that 1 < 2. However, using a dwp file produced by llvm-dwp: $ readelf -SW <file.dwp> [ 0] <empty> [ 1] .strtab STRTAB ... [ 2] .debug_foo PROGBITS ... ... results in section_count = 2 (.debug is the only thing placed into bfd->sections, so section_count + 1 == 2), and sectp->this_idx = 2 when mapping over .debug_foo in dwarf2_locate_common_dwp_sections, which fails the assertion that 2 < 2. The assertion hit is: gdb/dwarf2read.c:13009: internal-error: void dwarf2_locate_common_dwp_sections(bfd*, asection*, void*): Assertion `elf_section_nr < dwp_file->num_sections' failed. This patch changes the calculation of section_count to use elf_numsections, which should return the actual number of ELF sections.
2019-02-25 21:21:01 +01:00
2019-02-25 Jordan Rupprecht <rupprecht@google.com>
* dwarf2read.c (open_and_init_dwp_file): Call
elf_numsections instead of bfd_count_sections to initialize
dwp_file->num_sections.
2019-02-25 Tom Tromey <tromey@adacore.com>
* solib-darwin.c (darwin_get_dyld_bfd): Don't release dyld_bfd.
2019-02-23 Sergio Durigan Junior <sergiodj@redhat.com>
* gcore.in: Add '--readnever' option when invoking GDB.
2019-02-22 Simon Marchi <simon.marchi@polymtl.ca>
* MAINTAINERS: Update my email address.
Look for build-id-based separate debug files under the sysroot When looking for a separate debug file that matches a given build-id, GDB only looks in the host's debug dir (typically /usr/lib/debug). This patch makes it look in the sysroot as well. This is to match the behavior of GDB when using debuglink-based separate debug files, introduced in : 402d2bfec42 ("Look for separate debug files in debug directories under a sysroot.") In the following example, my sysroot is "/tmp/sysroot" and I am trying to load symbols for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so. This is the current behavior: (gdb) file /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Reading symbols from /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so... Looking for separate debug info (build-id) for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Trying /usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... no, unable to compute real path <snip> (No debugging symbols found in /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so) With this patch: (gdb) file /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Reading symbols from /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so... Looking for separate debug info (build-id) for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Trying /usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... no, unable to compute real path Trying /tmp/sysroot/usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... yes! Reading symbols from /tmp/sysroot/usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... In the original code, there is a suspicious "abfd.release ()" in build_id_to_debug_bfd, that I don't understand. If a file with the right name exists but its build-id note doesn't match, we release (leak) our reference, meaning the file will stay open? I removed it in the new code, so that the reference is dropped if we end up not using that file. I tested briefly by corrupting a separate debug file to trigger this code, nothing exploded. gdb/ChangeLog: * build-id.c (build_id_to_debug_bfd_1): New function. (build_id_to_debug_bfd): Look for separate debug file in sysroot.
2019-02-22 21:09:23 +01:00
2019-02-22 Simon Marchi <simon.marchi@polymtl.ca>
* build-id.c (build_id_to_debug_bfd_1): New function.
(build_id_to_debug_bfd): Look for separate debug file in
sysroot.
2019-02-22 Andrew Burgess <andrew.burgess@embecosm.com>
* gdbarch.sh: Update the copyright year range that is placed into
generated files.
2019-02-22 Keith Seitz <keiths@redhat.com>
PR symtab/23853
* linespec.c (create_sals_line_offset): Search for the default
symtab's filename instead of its fullname.
2019-02-21 Alan Hayward <alan.hayward@arm.com>
* NEWS: Update style defaults.
2019-02-21 Alan Hayward <alan.hayward@arm.com>
* main.c (captured_main_1): Disable styling in batch mode.
2019-02-20 Tom Tromey <tom@tromey.com>
* symtab.c (symtab_symbol_info): Fix typos.
2019-02-20 Tom Tromey <tromey@adacore.com>
* findcmd.c (_initialize_mem_search): Use upper case for
metasyntactic variables.
2019-02-20 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aarch64_add_reggroups): New function.
(aarch64_gdbarch_init): Call aarch64_add_reggroups.
Fix error message and use-after-free on errors in nested sourced files Errors that happen in nested sourced files (when a sourced file sources another file) lead to a wrong error message, or use-after-free. For example, if I put this in "a.gdb": command_that_doesnt_exist and this in "b.gdb": source a.gdb and try to "source b.gdb" in GDB, the result may look like this: (gdb) source b.gdb b.gdb:1: Error in sourced command file: _that_doesnt_exist:1: Error in sourced command file: Undefined command: "command_that_doesnt_exist". Try "help". Notice the wrong file name where "a.gdb" should be. The exact result may differ, depending on the feelings of the memory allocator. What happens is: - The "source a.gdb" command is saved by command_line_append_input_line in command_line_input's static buffer. - Since we are sourcing a file, the script_from_file function stores the script name (a.gdb) in the source_file_name global. However, it doesn't do a copy, it just saves a pointer to command_line_input's static buffer. - The "command_that_doesnt_exist" command is saved by command_line_append_input_line in command_line_input's static buffer. Depending on what xrealloc does, source_file_name may now point to freed memory, or at the minimum the data it was pointing to was overwritten. - When the error is handled in script_from_file, we dererence source_file_name to print the name of the file in which the error occured. To fix it, I made source_file_name an std::string, so that keeps a copy of the file name instead of pointing to a buffer with a too small lifetime. With this patch, the expected filename is printed, and no use-after-free occurs: (gdb) source b.gdb b.gdb:1: Error in sourced command file: a.gdb:1: Error in sourced command file: Undefined command: "command_that_doesnt_exist". Try "help". I passed explicit template parameters to make_scoped_restore (<std::string, const std::string &>), so that the second parameter is passed by reference and avoid a copy. It was not as obvious as I first thought to change gdb.base/source.exp to test this, because source commands inside sourced files are interpreted relative to GDB's current working directory, not the directory of the currently sourced file. As a workaround, I moved the snippet that tests errors after the snippet that adds the source directory to the search path. This way, the "source source-error-1.gdb" line in source-error.exp manages to find the file. For reference, here is what ASAN reports when use-after-free occurs: (gdb) source b.gdb ================================================================= ==18498==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c000019847 at pc 0x7f1d3645de8e bp 0x7ffdcb892e50 sp 0x7ffdcb8925c8 READ of size 6 at 0x60c000019847 thread T0 #0 0x7f1d3645de8d in printf_common /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:546 #1 0x7f1d36477175 in __interceptor_vasprintf /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1525 #2 0x5632eaffa277 in xstrvprintf(char const*, __va_list_tag*) /home/simark/src/binutils-gdb/gdb/common/common-utils.c:122 #3 0x5632eaff96d1 in throw_it /home/simark/src/binutils-gdb/gdb/common/common-exceptions.c:351 #4 0x5632eaff98df in throw_verror(errors, char const*, __va_list_tag*) /home/simark/src/binutils-gdb/gdb/common/common-exceptions.c:379 #5 0x5632eaff9a2a in throw_error(errors, char const*, ...) /home/simark/src/binutils-gdb/gdb/common/common-exceptions.c:394 #6 0x5632eafca21a in script_from_file(_IO_FILE*, char const*) /home/simark/src/binutils-gdb/gdb/cli/cli-script.c:1553 #7 0x5632eaf8a500 in source_script_from_stream /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:569 #8 0x5632eaf8a735 in source_script_with_search /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:605 #9 0x5632eaf8ab20 in source_command /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:664 #10 0x5632eafa8b4a in do_const_cfunc /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:106 #11 0x5632eafb0687 in cmd_func(cmd_list_element*, char const*, int) /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:1892 #12 0x5632ebf3dd87 in execute_command(char const*, int) /home/simark/src/binutils-gdb/gdb/top.c:630 #13 0x5632eb3b25d3 in command_handler(char const*) /home/simark/src/binutils-gdb/gdb/event-top.c:583 #14 0x5632ebf3cf09 in read_command_file(_IO_FILE*) /home/simark/src/binutils-gdb/gdb/top.c:425 #15 0x5632eafca054 in script_from_file(_IO_FILE*, char const*) /home/simark/src/binutils-gdb/gdb/cli/cli-script.c:1547 #16 0x5632eaf8a500 in source_script_from_stream /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:569 #17 0x5632eaf8a735 in source_script_with_search /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:605 #18 0x5632eaf8ab20 in source_command /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:664 #19 0x5632eafa8b4a in do_const_cfunc /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:106 #20 0x5632eafb0687 in cmd_func(cmd_list_element*, char const*, int) /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:1892 #21 0x5632ebf3dd87 in execute_command(char const*, int) /home/simark/src/binutils-gdb/gdb/top.c:630 #22 0x5632eb3b25d3 in command_handler(char const*) /home/simark/src/binutils-gdb/gdb/event-top.c:583 #23 0x5632eb3b2f87 in command_line_handler(std::unique_ptr<char, gdb::xfree_deleter<char> >&&) /home/simark/src/binutils-gdb/gdb/event-top.c:770 #24 0x5632eb3b0fe1 in gdb_rl_callback_handler /home/simark/src/binutils-gdb/gdb/event-top.c:213 #25 0x5632ec1c8729 in rl_callback_read_char /home/simark/src/binutils-gdb/readline/callback.c:220 #26 0x5632eb3b0b8f in gdb_rl_callback_read_char_wrapper_noexcept /home/simark/src/binutils-gdb/gdb/event-top.c:175 #27 0x5632eb3b0da1 in gdb_rl_callback_read_char_wrapper /home/simark/src/binutils-gdb/gdb/event-top.c:192 #28 0x5632eb3b2186 in stdin_event_handler(int, void*) /home/simark/src/binutils-gdb/gdb/event-top.c:511 #29 0x5632eb3aa6a9 in handle_file_event /home/simark/src/binutils-gdb/gdb/event-loop.c:733 #30 0x5632eb3aaf41 in gdb_wait_for_event /home/simark/src/binutils-gdb/gdb/event-loop.c:859 #31 0x5632eb3a88ea in gdb_do_one_event() /home/simark/src/binutils-gdb/gdb/event-loop.c:347 #32 0x5632eb3a89bf in start_event_loop() /home/simark/src/binutils-gdb/gdb/event-loop.c:371 #33 0x5632eb76fbfc in captured_command_loop /home/simark/src/binutils-gdb/gdb/main.c:330 #34 0x5632eb772ea8 in captured_main /home/simark/src/binutils-gdb/gdb/main.c:1176 #35 0x5632eb773071 in gdb_main(captured_main_args*) /home/simark/src/binutils-gdb/gdb/main.c:1192 #36 0x5632eabfe7f9 in main /home/simark/src/binutils-gdb/gdb/gdb.c:32 #37 0x7f1d3554f222 in __libc_start_main (/usr/lib/libc.so.6+0x24222) #38 0x5632eabfe5dd in _start (/home/simark/build/binutils-gdb/gdb/gdb+0x195d5dd) 0x60c000019847 is located 7 bytes inside of 128-byte region [0x60c000019840,0x60c0000198c0) freed by thread T0 here: #0 0x7f1d36502491 in __interceptor_realloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:105 #1 0x5632eaff9f47 in xrealloc /home/simark/src/binutils-gdb/gdb/common/common-utils.c:62 #2 0x5632eaff6b44 in buffer_grow(buffer*, char const*, unsigned long) /home/simark/src/binutils-gdb/gdb/common/buffer.c:40 #3 0x5632eb3b271d in command_line_append_input_line /home/simark/src/binutils-gdb/gdb/event-top.c:614 #4 0x5632eb3b28c6 in handle_line_of_input(buffer*, char const*, int, char const*) /home/simark/src/binutils-gdb/gdb/event-top.c:654 #5 0x5632ebf402a6 in command_line_input(char const*, char const*) /home/simark/src/binutils-gdb/gdb/top.c:1252 #6 0x5632ebf3cee9 in read_command_file(_IO_FILE*) /home/simark/src/binutils-gdb/gdb/top.c:422 #7 0x5632eafca054 in script_from_file(_IO_FILE*, char const*) /home/simark/src/binutils-gdb/gdb/cli/cli-script.c:1547 #8 0x5632eaf8a500 in source_script_from_stream /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:569 #9 0x5632eaf8a735 in source_script_with_search /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:605 #10 0x5632eaf8ab20 in source_command /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:664 #11 0x5632eafa8b4a in do_const_cfunc /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:106 #12 0x5632eafb0687 in cmd_func(cmd_list_element*, char const*, int) /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:1892 #13 0x5632ebf3dd87 in execute_command(char const*, int) /home/simark/src/binutils-gdb/gdb/top.c:630 #14 0x5632eb3b25d3 in command_handler(char const*) /home/simark/src/binutils-gdb/gdb/event-top.c:583 #15 0x5632ebf3cf09 in read_command_file(_IO_FILE*) /home/simark/src/binutils-gdb/gdb/top.c:425 #16 0x5632eafca054 in script_from_file(_IO_FILE*, char const*) /home/simark/src/binutils-gdb/gdb/cli/cli-script.c:1547 #17 0x5632eaf8a500 in source_script_from_stream /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:569 #18 0x5632eaf8a735 in source_script_with_search /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:605 #19 0x5632eaf8ab20 in source_command /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:664 #20 0x5632eafa8b4a in do_const_cfunc /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:106 #21 0x5632eafb0687 in cmd_func(cmd_list_element*, char const*, int) /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:1892 #22 0x5632ebf3dd87 in execute_command(char const*, int) /home/simark/src/binutils-gdb/gdb/top.c:630 #23 0x5632eb3b25d3 in command_handler(char const*) /home/simark/src/binutils-gdb/gdb/event-top.c:583 #24 0x5632eb3b2f87 in command_line_handler(std::unique_ptr<char, gdb::xfree_deleter<char> >&&) /home/simark/src/binutils-gdb/gdb/event-top.c:770 #25 0x5632eb3b0fe1 in gdb_rl_callback_handler /home/simark/src/binutils-gdb/gdb/event-top.c:213 #26 0x5632ec1c8729 in rl_callback_read_char /home/simark/src/binutils-gdb/readline/callback.c:220 #27 0x5632eb3b0b8f in gdb_rl_callback_read_char_wrapper_noexcept /home/simark/src/binutils-gdb/gdb/event-top.c:175 #28 0x5632eb3b0da1 in gdb_rl_callback_read_char_wrapper /home/simark/src/binutils-gdb/gdb/event-top.c:192 #29 0x5632eb3b2186 in stdin_event_handler(int, void*) /home/simark/src/binutils-gdb/gdb/event-top.c:511 previously allocated by thread T0 here: #0 0x7f1d36502491 in __interceptor_realloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:105 #1 0x5632eaff9f47 in xrealloc /home/simark/src/binutils-gdb/gdb/common/common-utils.c:62 #2 0x5632eaff6b44 in buffer_grow(buffer*, char const*, unsigned long) /home/simark/src/binutils-gdb/gdb/common/buffer.c:40 #3 0x5632eb3b271d in command_line_append_input_line /home/simark/src/binutils-gdb/gdb/event-top.c:614 #4 0x5632eb3b28c6 in handle_line_of_input(buffer*, char const*, int, char const*) /home/simark/src/binutils-gdb/gdb/event-top.c:654 #5 0x5632ebf402a6 in command_line_input(char const*, char const*) /home/simark/src/binutils-gdb/gdb/top.c:1252 #6 0x5632ebf3cee9 in read_command_file(_IO_FILE*) /home/simark/src/binutils-gdb/gdb/top.c:422 #7 0x5632eafca054 in script_from_file(_IO_FILE*, char const*) /home/simark/src/binutils-gdb/gdb/cli/cli-script.c:1547 #8 0x5632eaf8a500 in source_script_from_stream /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:569 #9 0x5632eaf8a735 in source_script_with_search /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:605 #10 0x5632eaf8ab20 in source_command /home/simark/src/binutils-gdb/gdb/cli/cli-cmds.c:664 #11 0x5632eafa8b4a in do_const_cfunc /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:106 #12 0x5632eafb0687 in cmd_func(cmd_list_element*, char const*, int) /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:1892 #13 0x5632ebf3dd87 in execute_command(char const*, int) /home/simark/src/binutils-gdb/gdb/top.c:630 #14 0x5632eb3b25d3 in command_handler(char const*) /home/simark/src/binutils-gdb/gdb/event-top.c:583 #15 0x5632eb3b2f87 in command_line_handler(std::unique_ptr<char, gdb::xfree_deleter<char> >&&) /home/simark/src/binutils-gdb/gdb/event-top.c:770 #16 0x5632eb3b0fe1 in gdb_rl_callback_handler /home/simark/src/binutils-gdb/gdb/event-top.c:213 #17 0x5632ec1c8729 in rl_callback_read_char /home/simark/src/binutils-gdb/readline/callback.c:220 #18 0x5632eb3b0b8f in gdb_rl_callback_read_char_wrapper_noexcept /home/simark/src/binutils-gdb/gdb/event-top.c:175 #19 0x5632eb3b0da1 in gdb_rl_callback_read_char_wrapper /home/simark/src/binutils-gdb/gdb/event-top.c:192 #20 0x5632eb3b2186 in stdin_event_handler(int, void*) /home/simark/src/binutils-gdb/gdb/event-top.c:511 #21 0x5632eb3aa6a9 in handle_file_event /home/simark/src/binutils-gdb/gdb/event-loop.c:733 #22 0x5632eb3aaf41 in gdb_wait_for_event /home/simark/src/binutils-gdb/gdb/event-loop.c:859 #23 0x5632eb3a88ea in gdb_do_one_event() /home/simark/src/binutils-gdb/gdb/event-loop.c:347 #24 0x5632eb3a89bf in start_event_loop() /home/simark/src/binutils-gdb/gdb/event-loop.c:371 #25 0x5632eb76fbfc in captured_command_loop /home/simark/src/binutils-gdb/gdb/main.c:330 #26 0x5632eb772ea8 in captured_main /home/simark/src/binutils-gdb/gdb/main.c:1176 #27 0x5632eb773071 in gdb_main(captured_main_args*) /home/simark/src/binutils-gdb/gdb/main.c:1192 #28 0x5632eabfe7f9 in main /home/simark/src/binutils-gdb/gdb/gdb.c:32 #29 0x7f1d3554f222 in __libc_start_main (/usr/lib/libc.so.6+0x24222) SUMMARY: AddressSanitizer: heap-use-after-free /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:546 in printf_common gdb/ChangeLog: * top.h (source_file_name): Change to std::string. * top.c (source_file_name): Likewise. (command_line_input): Adjust. * cli/cli-script.c (script_from_file): Adjust. gdb/testsuite/ChangeLog: * gdb.base/source.exp: Move "error in sourced script" code to the end. * gdb.base/source-error.gdb: Move contents to source-error-1.gdb. Add new code to source source-error-1.gdb. * gdb.base/source-error-1.gdb: New file, from previous source-error.gdb.
2019-02-20 03:10:18 +01:00
2019-02-19 Simon Marchi <simon.marchi@polymtl.ca>
* top.h (source_file_name): Change to std::string.
* top.c (source_file_name): Likewise.
(command_line_input): Adjust.
* cli/cli-script.c (script_from_file): Adjust.
2019-02-19 Tom Tromey <tromey@adacore.com>
* ravenscar-thread.c
(ravenscar_thread_target::update_thread_list): Don't call
ada_build_task_list.
* ada-lang.h (ada_build_task_list): Don't declare.
* ada-tasks.c (struct ada_tasks_inferior_data)
<task_list_valid_p>: Now bool.
(read_known_tasks, ada_task_list_changed)
(ada_tasks_invalidate_inferior_data): Update.
(read_known_tasks_array): Return bool.
(read_known_tasks_list): Likewise.
(read_known_tasks): Return void.
(ada_build_task_list): Now static.
2019-02-18 Andrew Burgess <andrew.burgess@embecosm.com>
* gdbtypes.c (type_align): Allow alignment of TYPE_CODE_METHODPTR
and TYPE_CODE_MEMBERPTR to be overridden by the gdbarch.
Fix leaks of 'per program space' and 'per inferior' ada task data. Valgrind reports leaks such as the below. Fix these leaks by changing ada_tasks_pspace_data_handle and ada_tasks_inferior_data_handle to use the 'with_cleanup' register variant. Tested on debian/amd64 natively and under Valgrind. ==26346== 56 bytes in 1 blocks are definitely lost in loss record 631 of 3,249 ==26346== at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344) ==26346== by 0x38F911: get_ada_tasks_inferior_data(inferior*) (ada-tasks.c:281) ==26346== by 0x38FA3F: ada_tasks_invalidate_inferior_data (ada-tasks.c:1362) ==26346== by 0x38FA3F: ada_tasks_new_objfile_observer(objfile*) (ada-tasks.c:1411) ==26346== by 0x60CBC5: operator() (functional:2127) ==26346== by 0x60CBC5: notify (observable.h:106) ==26346== by 0x60CBC5: clear_symtab_users(enum_flags<symfile_add_flag>) (symfile.c:2903) ... ==26346== 104 bytes in 1 blocks are definitely lost in loss record 984 of 3,249 ==26346== at 0x4C2E0BC: calloc (vg_replace_malloc.c:762) ==26346== by 0x4056F0: xcalloc (common-utils.c:84) ==26346== by 0x38F8AE: xcnew<ada_tasks_pspace_data> (poison.h:122) ==26346== by 0x38F8AE: get_ada_tasks_pspace_data(program_space*) (ada-tasks.c:253) ==26346== by 0x38FA77: ada_tasks_invalidate_pspace_data (ada-tasks.c:1354) ==26346== by 0x38FA77: ada_tasks_new_objfile_observer(objfile*) (ada-tasks.c:1394) ==26346== by 0x60CBC5: operator() (functional:2127) ==26346== by 0x60CBC5: notify (observable.h:106) ... gdb/ChangeLog 2019-02-18 Philippe Waroquiers <philippe.waroquiers@skynet.be> * ada-task.c (_initialize_tasks): Use 'with_cleanup' register variant for ada_tasks_pspace_data_handle and ada_tasks_inferior_data_handle. (ada_tasks_pspace_data_cleanup): New function. (ada_tasks_inferior_data_cleanup): New function.
2019-02-17 17:58:17 +01:00
2019-02-18 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* ada-task.c (_initialize_tasks): Use 'with_cleanup' register
variant for ada_tasks_pspace_data_handle and
ada_tasks_inferior_data_handle.
(ada_tasks_pspace_data_cleanup): New function.
(ada_tasks_inferior_data_cleanup): New function.
2019-02-17 Tom Tromey <tom@tromey.com>
* macrotab.h (macro_source_fullname): Return a std::string.
* macrotab.c (macro_include, check_for_redefinition)
(macro_undef, macro_lookup_definition, foreach_macro)
(foreach_macro_in_scope): Update.
(macro_source_fullname): Return a std::string.
* macrocmd.c (show_pp_source_pos): Update.
2019-02-17 Tom Tromey <tom@tromey.com>
* macrocmd.c (show_pp_source_pos): Style the file names.
2019-02-17 Tom Tromey <tom@tromey.com>
PR tui/24197:
* tui/tui-source.c (tui_set_source_content_nil): Rewrite.
Fix pager bugs with style output I believe this fixes all the pager output problems with styling that Philippe pointed out, plus at least one more. The patch is somewhat hard to reason about, so you may wish to give it a try. Even writing the tests was hard. This removes the style caching, because it was difficult to keep the style cache correct in all cases. Since this would cause more style escapes to be emitted, instead it changes fputs_styled to try to avoid unnecessary changes. Another bug was that the wrap buffer was not flushed in the case where wrap_column==0. In the old (pre-patch series) code, characters were directly emitted in this case; so flushing the wrap buffer here restores this behavior. On error the wrap buffer must be emptied. Otherwise, interrupting output can leave characters in the buffer that will be emitted later. As discussed on gdb-patches, this fixes the ada-lang.c problem where filtered and unfiltered printing were mixed. Now user_select_syms uses filtered printing, which is what its callees were already doing. Finally, it was possible for source line highlighting to be garbled (and invalid escape sequences emitted) if the pager was invoked at the wrong spot. To fix this, the patch arranges for source line escapes to always be emitted as a unit. gdb/ChangeLog 2019-02-17 Tom Tromey <tom@tromey.com> * ada-lang.c (user_select_syms): Use filtered printing. * utils.c (wrap_style): New global. (desired_style): Remove. (emit_style_escape): Add stream parameter. (set_output_style, reset_terminal_style, prompt_for_continue): Update. (flush_wrap_buffer): Only flush gdb_stdout. (wrap_here): Set wrap_style. (fputs_maybe_filtered): Clear the wrap buffer on exception. Don't treat escape sequences as a character. Change when wrap buffer is flushed. (fputs_styled): Do not set the output style when the default is requested. * ui-style.h (struct ui_file_style) <is_default>: New method. * source.c (print_source_lines_base): Emit escape sequences in one piece. gdb/testsuite/ChangeLog 2019-02-17 Tom Tromey <tom@tromey.com> * gdb.base/style.exp: Add line-wrapping tests. * gdb.base/page.exp: Add test for quitting during pagination.
2019-02-07 14:23:40 +01:00
2019-02-17 Tom Tromey <tom@tromey.com>
* ada-lang.c (user_select_syms): Use filtered printing.
* utils.c (wrap_style): New global.
(desired_style): Remove.
(emit_style_escape): Add stream parameter.
(set_output_style, reset_terminal_style, prompt_for_continue):
Update.
(flush_wrap_buffer): Only flush gdb_stdout.
(wrap_here): Set wrap_style.
(fputs_maybe_filtered): Clear the wrap buffer on exception. Don't
treat escape sequences as a character. Change when wrap buffer is
flushed.
(fputs_styled): Do not set the output style when the default is
requested.
* ui-style.h (struct ui_file_style) <is_default>: New method.
* source.c (print_source_lines_base): Emit escape sequences in one
piece.
2019-02-17 Joel Brobecker <brobecker@adacore.com>
* gdbtypes.c (type_align): Handle TYPE_CODE_RANGE the same as
integers and enumeration types.
(Ada) fix GDB crash printing packed array Trying to print a packed array sometimes leads to a crash (see attached testcase for an example of when this happens): | (gdb) p bad | [1] 65571 segmentation fault gdb -q foo Variable "bad" is declared in the debug information as an array where the array's type name has an XPnnn suffix: | .uleb128 0xc # (DIE (0x566) DW_TAG_typedef) | .long .LASF200 # DW_AT_name: "pck__t___XP1" | [loc info attributes snipped] | .long 0x550 # DW_AT_type | .byte 0x1 # DW_AT_alignment The signals to GDB that the debugging information follows a GNAT encoding used for packed arrays, and an in order to decode it, we need to find the type whose name is the same minus the "___XPnnn" suffix: "pck__t". For that, we make a call to ada-lang.c::standard_lookup, which is a simple function which essentially does: | /* Return the result of a standard (literal, C-like) lookup of NAME in | given DOMAIN, visible from lexical block BLOCK. */ | | [...] | sym = lookup_symbol_in_language (name, block, domain, language_c, 0); Unfortunately for us, while the intent of this call was to perform an exact-match lookup, in our case, it returns ... type pck__t___XP1 instead! In other words, it finds itself back. The reason why it finds this type is a confluence of two factors: (1) Forcing the lookup into language_c currently does not affect how symbol matching is done anymore, because we look at the symbol's language to determine which kind of matching should be done; (2) The lookup searches the local context (via block) first, beforei doing a more general lookup. And looking at the debug info for the main subprogram, we see that type "pck__t" is not declared there, only in the debug info for pck.ads. In other words, there is no way that we accidently find "pck__t" by random chance. I believe Pedro added a new function called ada_lookup_encoded_symbol for that specific purpose, so I started by replacing the lookup by language above by this. Unfortunately, still no joy. This was because, even though ada_lookup_encoded_symbol puts angle- brackets around the search name to signal that we want a verbatim search, we end up losing that information in the function called to compare a symbol with the search name: | static bool | do_full_match (const char *symbol_search_name, | const lookup_name_info &lookup_name, | completion_match_result *comp_match_res) | { | return full_match (symbol_search_name, ada_lookup_name (lookup_name)); ^^^^^^^^^^^^^^^ | <=> lookup_name.m_ada.m_encoded_name (no angle brackets) The way I fixed this was by introducing a new function called do_exact_match, and then adjust ada_get_symbol_name_matcher to return that function when seeing that we have a verbatim non-wild-match search. As it happens, this fixes an incorrect test in gdb.ada/homony.exp, where we were inserting a breakpoint on a symbol using the angle-brackets notation, and got 2 locations for that breakpoint... (gdb) b <homonym__get_value> Breakpoint 1 at 0x4029fc: <homonym__get_value>. (2 locations) ... each location being in a different function: (gdb) info break Num Type Disp Enb Address What 1 breakpoint keep y <MULTIPLE> 1.1 y 0x00000000004029fc in homonym.get_value at /[...]/homonym.adb:32 1.2 y 0x0000000000402a3a in homonym.get_value at /[...]/homonym.adb:50 (gdb) x /i 0x00000000004029fc 0x4029fc <homonym__get_value+8>: movl $0x1d,-0x4(%rbp) (gdb) x /i 0x0000000000402a3a 0x402a3a <homonym__get_value__2+8>: movl $0x11,-0x4(%rbp) Since we used angle-brackets, we shouldn't be matching the second one, something this patch fixes. gdb/ChangeLog: * ada-lang.c (standard_lookup): Use ada_lookup_encoded_symbol instead of lookup_symbol_in_language (do_exact_match): New function. (ada_get_symbol_name_matcher): Return do_exact_match when doing a verbatim match. gdb/testsuite/ChangeLog: * gdb.ada/big_packed_array: New testcase. * gdb.ada/homonym.exp: Fix incorrect expected output for "break <homonym__get_value>" test. Tested on x86_64-linux.
2019-02-17 14:32:45 +01:00
2019-02-17 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (standard_lookup): Use ada_lookup_encoded_symbol
instead of lookup_symbol_in_language
(do_exact_match): New function.
(ada_get_symbol_name_matcher): Return do_exact_match when
doing a verbatim match.
2019-02-15 Tom Tromey <tromey@adacore.com>
* ravenscar-thread.c (ravenscar_thread_target::resume)
(ravenscar_thread_target::wait): Special case wildcard requests.
2019-02-15 Tom Tromey <tromey@adacore.com>
* ravenscar-thread.c (base_ptid): Remove.
(struct ravenscar_thread_target) <close>: New method.
<m_base_ptid>: New member.
<update_inferior_ptid, active_task, task_is_currently_active,
runtime_initialized>: Declare methods.
<ravenscar_thread_target>: Add constructor.
(ravenscar_thread_target::task_is_currently_active)
(ravenscar_thread_target::update_inferior_ptid)
(ravenscar_runtime_initialized): Rename. Now methods.
(ravenscar_thread_target::resume, ravenscar_thread_target::wait)
(ravenscar_thread_target::update_thread_list): Update.
(ravenscar_thread_target::active_task): Now method.
(ravenscar_thread_target::store_registers)
(ravenscar_thread_target::prepare_to_store)
(ravenscar_thread_target::prepare_to_store)
(ravenscar_thread_target::mourn_inferior): Update.
(ravenscar_inferior_created): Use "new" to create target.
(ravenscar_thread_target::get_ada_task_ptid): Update.
(_initialize_ravenscar): Don't initialize base_ptid.
(ravenscar_ops): Remove global.
2019-02-15 Tom Tromey <tromey@adacore.com>
* target.h (push_target): Declare new overload.
* target.c (push_target): New overload, taking an rvalue reference.
* remote.c (remote_target::open_1): Use push_target overload.
* corelow.c (core_target_open): Use push_target overload.
2019-02-15 Tom Tromey <tromey@adacore.com>
* ravenscar-thread.c (is_ravenscar_task)
(ravenscar_task_is_currently_active): Return bool.
(ravenscar_update_inferior_ptid, get_running_thread_msymbol)
(_initialize_ravenscar): Remove "(void)".
(has_ravenscar_runtime, ravenscar_runtime_initialized): Likewise.
Return bool.
2019-02-15 Tom Tromey <tromey@adacore.com>
* ravenscar-thread.c (ravenscar_runtime_initializer)
(has_ravenscar_runtime, get_running_thread_id)
(ravenscar_thread_target::resume): Fix indentation.
C++-ify ravenscar_arch_ops This turns ravenscar_arch_ops into an abstract base class and updates all the places where it is used. This is an improvement because it avoids any possibility of forgetting to set one of the function pointers. It also makes clear that these functions aren't intended to be changed dynamically. This version of the patch removes the prepare_to_store method, as it is unused, and it is easy enough to add if it is ever needed. gdb/ChangeLog 2019-02-15 Tom Tromey <tromey@adacore.com> * sparc-ravenscar-thread.c (struct sparc_ravenscar_ops): Derive from ravenscar_arch_ops. (sparc_ravenscar_ops::fetch_registers) (sparc_ravenscar_ops::store_registers): Now methods. (sparc_ravenscar_prepare_to_store): Remove. (sparc_ravenscar_ops): Redefine. * ravenscar-thread.h (struct ravenscar_arch_ops): Add virtual methods and destructor. Remove members. * ravenscar-thread.c (ravenscar_thread_target::fetch_registers) (ravenscar_thread_target::store_registers) (ravenscar_thread_target::prepare_to_store): Update. * ppc-ravenscar-thread.c (ppc_ravenscar_generic_prepare_to_store): Remove. (struct ppc_ravenscar_powerpc_ops): Derive from ravenscar_arch_ops. (ppc_ravenscar_powerpc_ops::fetch_registers) (ppc_ravenscar_powerpc_ops::store_registers): Now methods. (ppc_ravenscar_powerpc_ops): Redefine. (struct ppc_ravenscar_e500_ops): Derive from ravenscar_arch_ops. (ppc_ravenscar_e500_ops::fetch_registers) (ppc_ravenscar_e500_ops::store_registers): Now methods. (ppc_ravenscar_e500_ops): Redefine. * aarch64-ravenscar-thread.c (aarch64_ravenscar_generic_prepare_to_store): Remove. (struct aarch64_ravenscar_ops): Derive from ravenscar_arch_ops. (aarch64_ravenscar_fetch_registers) (aarch64_ravenscar_store_registers): Now methods. (aarch64_ravenscar_ops): Redefine.
2019-02-05 11:08:02 +01:00
2019-02-15 Tom Tromey <tromey@adacore.com>
* sparc-ravenscar-thread.c (struct sparc_ravenscar_ops): Derive
from ravenscar_arch_ops.
(sparc_ravenscar_ops::fetch_registers)
(sparc_ravenscar_ops::store_registers): Now methods.
(sparc_ravenscar_prepare_to_store): Remove.
(sparc_ravenscar_ops): Redefine.
* ravenscar-thread.h (struct ravenscar_arch_ops): Add virtual
methods and destructor. Remove members.
* ravenscar-thread.c (ravenscar_thread_target::fetch_registers)
(ravenscar_thread_target::store_registers)
(ravenscar_thread_target::prepare_to_store): Update.
* ppc-ravenscar-thread.c (ppc_ravenscar_generic_prepare_to_store):
Remove.
(struct ppc_ravenscar_powerpc_ops): Derive from
ravenscar_arch_ops.
(ppc_ravenscar_powerpc_ops::fetch_registers)
(ppc_ravenscar_powerpc_ops::store_registers): Now methods.
(ppc_ravenscar_powerpc_ops): Redefine.
(struct ppc_ravenscar_e500_ops): Derive from ravenscar_arch_ops.
(ppc_ravenscar_e500_ops::fetch_registers)
(ppc_ravenscar_e500_ops::store_registers): Now methods.
(ppc_ravenscar_e500_ops): Redefine.
* aarch64-ravenscar-thread.c
(aarch64_ravenscar_generic_prepare_to_store): Remove.
(struct aarch64_ravenscar_ops): Derive from ravenscar_arch_ops.
(aarch64_ravenscar_fetch_registers)
(aarch64_ravenscar_store_registers): Now methods.
(aarch64_ravenscar_ops): Redefine.
2019-02-15 Tom Tromey <tromey@adacore.com>
* ravenscar-thread.c (ravenscar_thread_target::stopped_by_sw_breakpoint)
(ravenscar_thread_target::stopped_by_hw_breakpoint)
(ravenscar_thread_target::stopped_by_watchpoint)
(ravenscar_thread_target::stopped_data_address)
(ravenscar_thread_target::core_of_thread): Use scoped_restore.
2019-02-15 Tom Tromey <tromey@adacore.com>
* ravenscar-thread.c: Fix some typos.
2019-02-15 Philippe Waroquiers <philippe.waroquiers@skynet.be>
Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_exception_sal): Change addr_string to a
std::string.
(create_ada_exception_catchpoint): Update.
C++-ify bp_location Philippe noticed a memory leak coming from ada_catchpoint_location -- it was not freeing the "function_name" member from its base class: ==14141== 114 bytes in 4 blocks are definitely lost in loss record 1,055 of 3,424 ==14141== at 0x4C2BE6D: malloc (vg_replace_malloc.c:309) ==14141== by 0x405107: xmalloc (common-utils.c:44) ==14141== by 0x7563F9: xstrdup (xstrdup.c:34) ==14141== by 0x3B82B3: set_breakpoint_location_function(bp_location*, int) (breakpoint.c:7156) ==14141== by 0x3C112B: add_location_to_breakpoint(breakpoint*, symtab_and_line const*) (breakpoint.c:8609) ==14141== by 0x3C127A: init_raw_breakpoint(breakpoint*, gdbarch*, symtab_and_line, bptype, breakpoint_ops const*) (breakpoint.c:7187) ==14141== by 0x3C1B52: init_ada_exception_breakpoint(breakpoint*, gdbarch*, symtab_and_line, char const*, breakpoint_ops const*, int, int, int) (breakpoint.c:11262) ==14141== by 0x381C2E: create_ada_exception_catchpoint(gdbarch*, ada_exception_catchpoint_kind, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int) (ada-lang.c:13255) This patch fixes the problem by further C++-ifying bp_location. In particular, bp_location_ops is now removed, and the "dtor" function pointer is replaced with an ordinary destructor. gdb/ChangeLog 2019-02-15 Philippe Waroquiers <philippe.waroquiers@skynet.be> Tom Tromey <tromey@adacore.com> * breakpoint.c (~bp_location): Rename from bp_location_dtor. (bp_location_ops): Remove. (base_breakpoint_allocate_location): Update. (free_bp_location): Update. * ada-lang.c (class ada_catchpoint_location) <ada_catchpoint_location>: Remove ops parameter. (ada_catchpoint_location_dtor): Remove. (ada_catchpoint_location_ops): Remove. (allocate_location_exception): Update. * breakpoint.h (struct bp_location_ops): Remove. (class bp_location) <bp_location>: Remove bp_location_ops parameter. <~bp_location>: Add destructor. <ops>: Remove.
2019-02-12 22:28:07 +01:00
2019-02-15 Philippe Waroquiers <philippe.waroquiers@skynet.be>
Tom Tromey <tromey@adacore.com>
* breakpoint.c (~bp_location): Rename from bp_location_dtor.
(bp_location_ops): Remove.
(base_breakpoint_allocate_location): Update.
(free_bp_location): Update.
* ada-lang.c (class ada_catchpoint_location)
<ada_catchpoint_location>: Remove ops parameter.
(ada_catchpoint_location_dtor): Remove.
(ada_catchpoint_location_ops): Remove.
(allocate_location_exception): Update.
* breakpoint.h (struct bp_location_ops): Remove.
(class bp_location) <bp_location>: Remove bp_location_ops
parameter.
<~bp_location>: Add destructor.
<ops>: Remove.
2019-02-14 Thomas Schwinge <thomas@codesourcery.com>
Pedro Alves <palves@redhat.com>
* remote.c (remote_target::remote_parse_stop_reply): Avoid using
'PATH_MAX'.
2019-02-14 David Michael <fedora.dm0@gmail.com>
Samuel Thibault <samuel.thibault@gnu.org>
Thomas Schwinge <thomas@codesourcery.com>
* gnu-nat.c (S_proc_getmsgport_reply, S_proc_task2proc_reply)
(S_proc_pid2proc_reply): Adjust to Hurd "proc" interface changes.
2019-02-14 Thomas Schwinge <thomas@codesourcery.com>
* gnu-nat.c (gnu_write_inferior, parse_int_arg, _parse_bool_arg)
(check_empty): Use "const char *".
* gnu-nat.c (gnu_nat_target::detach): Instead of
'detach_inferior (pid)' call
'detach_inferior (find_inferior_pid (pid))'.
[gdb, hurd] Repair build after "Share fork_inferior et al with gdbserver" changes ..., that is commit 2090129c36c7e582943b7d300968d19b46160d84 causing: [...]/gdb/gnu-nat.c: In function 'void gnu_ptrace_me()': [...]/gdb/gnu-nat.c:2133:5: error: 'trace_start_error_with_name' was not declared in this scope trace_start_error_with_name ("ptrace"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ [...]/gdb/gnu-nat.c:2133:5: note: suggested alternative: 'throw_perror_with_name' trace_start_error_with_name ("ptrace"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ throw_perror_with_name [...]/gdb/gnu-nat.c: In function 'void gnu_create_inferior(target_ops*, const char*, const string&, char**, int)': [...]/gdb/gnu-nat.c:2147:9: error: 'fork_inferior' was not declared in this scope pid = fork_inferior (exec_file, allargs, env, gnu_ptrace_me, ^~~~~~~~~~~~~ [...]/gdb/gnu-nat.c:2147:9: note: suggested alternative: 'exit_inferior' pid = fork_inferior (exec_file, allargs, env, gnu_ptrace_me, ^~~~~~~~~~~~~ exit_inferior [...]/gdb/gnu-nat.c:2174:30: error: 'START_INFERIOR_TRAPS_EXPECTED' was not declared in this scope gdb_startup_inferior (pid, START_INFERIOR_TRAPS_EXPECTED); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/bin/ld: gnu-nat.o: in function `gnu_ptrace_me()': [...]/gdb/gnu-nat.c:2134: undefined reference to `trace_start_error_with_name(char const*)' /usr/bin/ld: gnu-nat.o: in function `gnu_create_inferior(target_ops*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char**, int)': [...]/gdb/gnu-nat.c:2148: undefined reference to `fork_inferior(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char**, void (*)(), void (*)(int), void (*)(), char const*, void (*)(char const*, char* const*, char* const*))' /usr/bin/ld: fork-child.o: in function `gdb_startup_inferior(int, int)': [...]/gdb/fork-child.c:136: undefined reference to `startup_inferior(int, int, target_waitstatus*, ptid_t*)' collect2: error: ld returned 1 exit status gdb/ * configure.nat [gdb_host == i386gnu] (NATDEPFILES): Add 'nat/fork-inferior.o'. * gnu-nat.c: #include "nat/fork-inferior.h".
2018-07-04 13:27:09 +02:00
* configure.nat [gdb_host == i386gnu] (NATDEPFILES): Add
'nat/fork-inferior.o'.
* gnu-nat.c: #include "nat/fork-inferior.h".
[gdb, hurd] Repair build after "Convert struct target_ops to C++" changes ..., that is commit f6ac5f3d63e03a81c4ff3749aba234961cc9090e causing: In file included from [...]/gdb/gnu-nat.c:24:0: [...]/gdb/gnu-nat.h:123:1: error: expected class-name before '{' token { ^ [...]/gdb/gnu-nat.h:128:16: error: 'inferior' has not been declared void detach (inferior *, int) override; ^~~~~~~~ [...]/gdb/gnu-nat.h:132:8: error: use of enum 'target_xfer_status' without previous declaration enum target_xfer_status xfer_partial (enum target_object object, ^~~~~~~~~~~~~~~~~~ [...]/gdb/gnu-nat.h:132:46: error: use of enum 'target_object' without previous declaration enum target_xfer_status xfer_partial (enum target_object object, ^~~~~~~~~~~~~ [...]/gdb/gnu-nat.h:124:8: error: 'void gnu_nat_target::attach(const char*, int)' marked 'override', but does not override void attach (const char *, int) override; ^~~~~~ [...] [...]/gdb/gnu-nat.c: In member function 'virtual void gnu_nat_target::detach(inferior*, int)': [...]/gdb/gnu-nat.c:2286:34: error: 'ops' was not declared in this scope inf_child_maybe_unpush_target (ops); ^~~ [...]/gdb/gnu-nat.c:2286:34: note: suggested alternative: 'open' inf_child_maybe_unpush_target (ops); ^~~ open [...]/gdb/gnu-nat.c:2286:3: error: 'inf_child_maybe_unpush_target' was not declared in this scope inf_child_maybe_unpush_target (ops); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [...]/gdb/gnu-nat.c:2286:3: note: suggested alternative: 'maybe_unpush_target' inf_child_maybe_unpush_target (ops); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ maybe_unpush_target [...]/gdb/i386-gnu-nat.c:200:1: warning: 'void gnu_store_registers(target_ops*, regcache*, int)' defined but not used [-Wunused-function] gnu_store_registers (struct target_ops *ops, ^~~~~~~~~~~~~~~~~~~ [...]/gdb/i386-gnu-nat.c:109:1: warning: 'void gnu_fetch_registers(target_ops*, regcache*, int)' defined but not used [-Wunused-function] gnu_fetch_registers (struct target_ops *ops, ^~~~~~~~~~~~~~~~~~~ [...] /usr/bin/ld: i386-gnu-nat.o:(.data.rel+0x0): undefined reference to `vtable for i386_gnu_nat_target' collect2: error: ld returned 1 exit status gdb/ * gnu-nat.c (gnu_nat_target::detach): Instead of 'inf_child_maybe_unpush_target (ops)' call 'maybe_unpush_target'. * gnu-nat.h: #include "inf-child.h". * i386-gnu-nat.c (gnu_fetch_registers): Rename/move to 'i386_gnu_nat_target::fetch_registers'. (gnu_store_registers): Rename/move to 'i386_gnu_nat_target::store_registers'.
2018-07-20 02:03:25 +02:00
* gnu-nat.c (gnu_nat_target::detach): Instead of
'inf_child_maybe_unpush_target (ops)' call 'maybe_unpush_target'.
* gnu-nat.h: #include "inf-child.h".
* i386-gnu-nat.c (gnu_fetch_registers): Rename/move to
'i386_gnu_nat_target::fetch_registers'.
(gnu_store_registers): Rename/move to
'i386_gnu_nat_target::store_registers'.
* config/i386/nm-i386gnu.h: Don't "#include" any files.
* gnu-nat.h (mach_thread_info): New function.
* gnu-nat.c (thread_takeover_sc_cmd): Use it.
* config/i386/nm-i386gnu.h (gnu_target_pid_to_str): Remove.
2019-02-14 Frederic Konrad <konrad@adacore.com>
* riscv-rdep.c (riscv_type_alignment): Handle TYPE_CODE_RANGE.
2019-02-14 Joel Brobecker <brobecker@adacore.com>
* windows-nat.c (windows_add_thread): Add new parameter
"main_thread_p" with default value set to false. Update
function documentation as well as all callers.
(windows_delete_thread): Likewise.
(fake_create_process): Update call to windows_add_thread.
(get_windows_debug_event) <CREATE_THREAD_DEBUG_EVENT>
<CREATE_PROCESS_DEBUG_EVENT>: Likewise.
<EXIT_THREAD_DEBUG_EVENT, EXIT_PROCESS_DEBUG_EVENT>: Update
call to windows_delete_thread.
2019-02-13 Simon Marchi <simon.marchi@ericsson.com>
* MAINTAINERS: Add Andrew Burgess as global maintainer.
2019-02-12 John Baldwin <jhb@FreeBSD.org>
* symfile.c (find_separate_debug_file): Use canonical path of
sysroot with child_path instead of gdb_sysroot if it is valid.
2019-02-12 John Baldwin <jhb@FreeBSD.org>
* symfile.c (find_separate_debug_file): Use child_path to
determine if an object file is under a sysroot.
2019-02-12 John Baldwin <jhb@FreeBSD.org>
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
unittests/child-path-selftests.c.
* common/pathstuff.c (child_path): New function.
* common/pathstuff.h (child_path): New prototype.
* unittests/child-path-selftests.c: New file.
2019-02-12 John Baldwin <jhb@FreeBSD.org>
* symfile.c (find_separate_debug_file): Look for separate debug
files in debug directories under the sysroot.
2019-02-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* symtab.h (struct minimal_symbol data_p): New const method.
(struct minimal_symbol text_p): Likewise.
* symtab.c (output_source_filename): Use file name style
to print file name.
(print_symbol_info): Likewise.
(print_msymbol_info): Use address style to print addresses.
Use function name style to print executable text symbols.
(expand_symtab_containing_pc): Use data_p.
(find_pc_sect_compunit_symtab): Likewise.
2019-02-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* breakpoint.c (describe_other_breakpoints): Use address style
to print addresses.
(say_where): Likewise.
2019-02-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* ada-typeprint.c (print_func_type): Print function name
style to print function name.
* c-typeprint.c (c_print_type_1): Likewise.
2019-02-11 Alan Hayward <alan.hayward@arm.com>
* aarch64-linux-tdep.c (aarch64_linux_get_syscall_number): Check
for execve.
Fix type_stack leaks in c expression parsing. Valgrind detects a bunch of leaks in several tests, such as: ==22905== 40 (24 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 531 of 3,268 ==22905== at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344) ==22905== by 0x5893AD: get_type_stack() (parse.c:1509) ==22905== by 0x3F4EAD: c_yyparse() (c-exp.y:1223) ==22905== by 0x3F71BC: c_parse(parser_state*) (c-exp.y:3308) ==22905== by 0x588CEA: parse_exp_in_context_1(char const**, unsigned long, block const*, int, int, int*) [clone .constprop.89] (parse.c:1205) ==22905== by 0x588FA1: parse_exp_in_context (parse.c:1108) ==22905== by 0x588FA1: parse_exp_1 (parse.c:1099) ==22905== by 0x588FA1: parse_expression(char const*) (parse.c:1247) ... ==22395== 456 (168 direct, 288 indirect) bytes in 7 blocks are definitely lost in loss record 2,658 of 2,978 ==22395== at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344) ==22395== by 0x5893AD: get_type_stack() (parse.c:1509) ==22395== by 0x3F4ECF: c_yyparse() (c-exp.y:1230) ==22395== by 0x3F71BC: c_parse(parser_state*) (c-exp.y:3308) ==22395== by 0x588CEA: parse_exp_in_context_1(char const**, unsigned long, block const*, int, int, int*) [clone .constprop.89] (parse.c:1205) ==22395== by 0x588FA1: parse_exp_in_context (parse.c:1108) ==22395== by 0x588FA1: parse_exp_1 (parse.c:1099) ==22395== by 0x588FA1: parse_expression(char const*) (parse.c:1247) ==22395== by 0x67BB9D: whatis_exp(char const*, int) (typeprint.c:515) ... ==22395== VALGRIND_GDB_ERROR_BEGIN ==22395== 144 (24 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 1,016 of 2,978 ==22395== at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344) ==22395== by 0x5893AD: get_type_stack() (parse.c:1509) ==22395== by 0x3F4E8A: c_yyparse() (c-exp.y:1217) ==22395== by 0x3F71BC: c_parse(parser_state*) (c-exp.y:3308) ==22395== by 0x588CEA: parse_exp_in_context_1(char const**, unsigned long, block const*, int, int, int*) [clone .constprop.89] (parse.c:1205) ==22395== by 0x588FA1: parse_exp_in_context (parse.c:1108) ==22395== by 0x588FA1: parse_exp_1 (parse.c:1099) ==22395== by 0x588FA1: parse_expression(char const*) (parse.c:1247) ==22395== by 0x67BB9D: whatis_exp(char const*, int) (typeprint.c:515) ... Fix these by storing the allocated type_stack in the cpstate->type_stacks vector. Tested on debian/amd64, natively and under valgrind. gdb/ChangeLog 2019-02-10 Philippe Waroquiers <philippe.waroquiers@skynet.be> * c-exp.y (direct_abs_decl): Use emplace_back to record the type_stack.
2019-02-09 15:02:25 +01:00
2019-02-10 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* c-exp.y (direct_abs_decl): Use emplace_back to record the
type_stack.
(Ada) -var-update crash for variable whose type is a reference to changeable Consider the following variable, which is a string whose value is not known at compile time, because it is the return value from a function call (Get_Name): A : String := Get_Name; If one tries to create a varobj for that variable, everything works as expected: | (gdb) -var-create a * a | ^done,name="a",numchild="19",value="[19] \"Some kind of string\"",type="<ref> array (1 .. 19) of character",thread-id="1",has_more="0" However, try then to request an update, regardless of whether the string has changed or not, and we get a crash: | -var-update a | ~"/[...]/gdb/varobj.c:1379: internal-error: bool install_new_value(varobj*, value*, bool): Assertion `!value_lazy (var->value.get ())' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? (y or n) " When the varobj gets created (-var-create), the expression is evaluated and transformed into a value. The debugging information describes our variables as a reference to an array of characters, so our value has the corresponding type. We then call varobj.c::install_new_value to store that value inside our varobj, and we see that this function pretty starts by determining weither our varobj is changeable, via: | changeable = varobj_value_is_changeable_p (var); (where 'var' is the varobj we are building, and where the function varobj_value_is_changeable_p simply dispatches to the Ada version of this routine: ada_value_is_changeable_p). At this point, the varobj doesn't have a value, yet, but it does have a type which was provided by varobj_create a little bit before install_new_value was called. So ada_value_is_changeable_p uses that to determine whether or not our type is changeable. Since our type is a reference to an array, and that the value of such objects is displayed as if there weren't a reference, it means that our object is changeable -- in other words, if an element of the string changes, then the "value" field of the varobj will change accordingly. But unfortunately, ada_value_is_changeable_p mistakenly returns false, because it is missing the handling of reference types. As a consequence of this, install_new_value doesn't feel it is necessary to fetch the value's contents, as explained by the following comment inside that function: /* The new value might be lazy. If the type is changeable, that is we'll be comparing values of this type, fetch the value now. Otherwise, on the next update the old value will be lazy, which means we've lost that old value. */ This means that a lazy value gets installed inside our varobj as a result of the mistake in ada_value_is_changeable_p. Another important detail is that, after determining whether our varobj is changeable or not, it then purposefully removes the reference layer from our value: /* 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); The consequence of those two facts on shows up only later, when the user requests an update (-var-update). When doing so, GDB evaluates the expression again into a value which is once more a reference to a string, and then calls install_new_value again to install the new value and report any changes. This time around, the call to... | changeable = varobj_value_is_changeable_p (var); ... now gets a varobj which has a value, and one which had the reference layer removed! So, this time, we classify the varobj correctly, and say it is changeable. And because it is changeable, we then go into the section of code in install_new_value which checks for changes, where we need the varobj's value to not be lazy, as explained by the comment we quoted above. That's what the assertion was about. This patch fixes the issues by teaching ada_value_is_changeable_p to ignore reference layers when evaluating a given varobj's type. gdb/ChangeLog: * ada-varobj.c (ada_value_is_changeable_p): Add handling of TYPE_CODE_REF types. gdb/testsuite/ChangeLog: * gdb.ada/mi_ref_changeable: New testcase. Prior to this patch, this testcase reports 2 unresolved tests (due to GDB hitting the internal error). With this patch, all tests in this testcase pass. Tested on x86_64-linux, no regression.
2019-02-10 09:14:53 +01:00
2019-02-10 Joel Brobecker <brobecker@adacore.com>
* ada-varobj.c (ada_value_is_changeable_p): Add handling of
TYPE_CODE_REF types.
2019-02-08 Jim Wilson <jimw@sifive.com>
* riscv-linux-tdep.c (riscv_linux_fregmap): New.
(riscv_linux_fregset): New.
(riscv_linux_iterate_over_regset_sections): Call cb for .reg2 section.
C++-ify struct thread_fsm This C++-ifies struct thread_fsm, replacing the "ops" structure with virtual methods, and changing all the implementations to derive from thread_fsm. gdb/ChangeLog 2019-02-07 Tom Tromey <tom@tromey.com> * thread.c (thread_cancel_execution_command): Update. * thread-fsm.h (struct thread_fsm): Add constructor, destructor, methods. (struct thread_fsm_ops): Remove. (thread_fsm_ctor, thread_fsm_delete, thread_fsm_clean_up) (thread_fsm_should_stop, thread_fsm_return_value) (thread_fsm_set_finished, thread_fsm_finished_p) (thread_fsm_async_reply_reason, thread_fsm_should_notify_stop): Don't declare. * mi/mi-interp.c (mi_on_normal_stop_1): Update. * infrun.c (clear_proceed_status_thread) (clean_up_just_stopped_threads_fsms, fetch_inferior_event) (print_stop_event): Update. * infcmd.c (struct step_command_fsm): Inherit from thread_fsm. Add constructor. (step_command_fsm_ops): Remove. (new_step_command_fsm): Remove. (step_1): Update. (step_command_fsm::should_stop): Rename from step_command_fsm_should_stop. (step_command_fsm::clean_up): Rename from step_command_fsm_clean_up. (step_command_fsm::do_async_reply_reason): Rename from step_command_fsm_async_reply_reason. (struct until_next_fsm): Inherit from thread_fsm. Add constructor. (until_next_fsm_ops): Remove. (new_until_next_fsm): Remove. (until_next_fsm::should_stop): Rename from until_next_fsm_should_stop. (until_next_fsm::clean_up): Rename from until_next_fsm_clean_up. (until_next_fsm::do_async_reply_reason): Rename from until_next_fsm_async_reply_reason. (struct finish_command_fsm): Inherit from thread_fsm. Add constructor. Change type of breakpoint. (finish_command_fsm_ops): Remove. (new_finish_command_fsm): Remove. (finish_command_fsm::should_stop): Rename from finish_command_fsm_should_stop. (finish_command_fsm::clean_up): Rename from finish_command_fsm_clean_up. (finish_command_fsm::return_value): Rename from finish_command_fsm_return_value. (finish_command_fsm::do_async_reply_reason): Rename from finish_command_fsm_async_reply_reason. (finish_command): Update. * infcall.c (struct call_thread_fsm): Inherit from thread_fsm. Add constructor. (call_thread_fsm_ops): Remove. (call_thread_fsm::call_thread_fsm): Rename from new_call_thread_fsm. (call_thread_fsm::should_stop): Rename from call_thread_fsm_should_stop. (call_thread_fsm::should_notify_stop): Rename from call_thread_fsm_should_notify_stop. (run_inferior_call, call_function_by_hand_dummy): Update. * cli/cli-interp.c (should_print_stop_to_console): Update. * breakpoint.c (struct until_break_fsm): Inherit from thread_fsm. Add constructor. Change type of location_breakpoint, caller_breakpoint. (until_break_fsm_ops): Remove. (new_until_break_fsm): Remove. (until_break_fsm::should_stop): Rename from until_break_fsm_should_stop. (until_break_fsm::clean_up): Rename from until_break_fsm_clean_up. (until_break_fsm::do_async_reply_reason): Rename from until_break_fsm_async_reply_reason. (until_break_command): Update. * thread-fsm.c: Remove. * Makefile.in (COMMON_SFILES): Remove thread-fsm.c.
2019-01-02 22:35:57 +01:00
2019-02-07 Tom Tromey <tom@tromey.com>
* thread.c (thread_cancel_execution_command): Update.
* thread-fsm.h (struct thread_fsm): Add constructor, destructor,
methods.
(struct thread_fsm_ops): Remove.
(thread_fsm_ctor, thread_fsm_delete, thread_fsm_clean_up)
(thread_fsm_should_stop, thread_fsm_return_value)
(thread_fsm_set_finished, thread_fsm_finished_p)
(thread_fsm_async_reply_reason, thread_fsm_should_notify_stop):
Don't declare.
* mi/mi-interp.c (mi_on_normal_stop_1): Update.
* infrun.c (clear_proceed_status_thread)
(clean_up_just_stopped_threads_fsms, fetch_inferior_event)
(print_stop_event): Update.
* infcmd.c (struct step_command_fsm): Inherit from thread_fsm.
Add constructor.
(step_command_fsm_ops): Remove.
(new_step_command_fsm): Remove.
(step_1): Update.
(step_command_fsm::should_stop): Rename from
step_command_fsm_should_stop.
(step_command_fsm::clean_up): Rename from
step_command_fsm_clean_up.
(step_command_fsm::do_async_reply_reason): Rename from
step_command_fsm_async_reply_reason.
(struct until_next_fsm): Inherit from thread_fsm. Add
constructor.
(until_next_fsm_ops): Remove.
(new_until_next_fsm): Remove.
(until_next_fsm::should_stop): Rename from
until_next_fsm_should_stop.
(until_next_fsm::clean_up): Rename from until_next_fsm_clean_up.
(until_next_fsm::do_async_reply_reason): Rename from
until_next_fsm_async_reply_reason.
(struct finish_command_fsm): Inherit from thread_fsm. Add
constructor. Change type of breakpoint.
(finish_command_fsm_ops): Remove.
(new_finish_command_fsm): Remove.
(finish_command_fsm::should_stop): Rename from
finish_command_fsm_should_stop.
(finish_command_fsm::clean_up): Rename from
finish_command_fsm_clean_up.
(finish_command_fsm::return_value): Rename from
finish_command_fsm_return_value.
(finish_command_fsm::do_async_reply_reason): Rename from
finish_command_fsm_async_reply_reason.
(finish_command): Update.
* infcall.c (struct call_thread_fsm): Inherit from thread_fsm.
Add constructor.
(call_thread_fsm_ops): Remove.
(call_thread_fsm::call_thread_fsm): Rename from
new_call_thread_fsm.
(call_thread_fsm::should_stop): Rename from
call_thread_fsm_should_stop.
(call_thread_fsm::should_notify_stop): Rename from
call_thread_fsm_should_notify_stop.
(run_inferior_call, call_function_by_hand_dummy): Update.
* cli/cli-interp.c (should_print_stop_to_console): Update.
* breakpoint.c (struct until_break_fsm): Inherit from thread_fsm.
Add constructor. Change type of location_breakpoint,
caller_breakpoint.
(until_break_fsm_ops): Remove.
(new_until_break_fsm): Remove.
(until_break_fsm::should_stop): Rename from
until_break_fsm_should_stop.
(until_break_fsm::clean_up): Rename from
until_break_fsm_clean_up.
(until_break_fsm::do_async_reply_reason): Rename from
until_break_fsm_async_reply_reason.
(until_break_command): Update.
* thread-fsm.c: Remove.
* Makefile.in (COMMON_SFILES): Remove thread-fsm.c.
Normalize include guards in gdb While working on my other scripts to deal with gdb headers, I noticed that some files were missing include guards. I wrote a script to add the missing ones, but found that using the obvious names for the guards ran into clashes -- for example, gdb/nat/linux-nat.h used "LINUX_NAT_H", but this was also the script's choice for gdb/linux-nat.h. So, I changed the script to normalize all include guards in gdb. This patch is the result. As usual the script is available here: https://github.com/tromey/gdb-refactoring-scripts Tested by rebuilding; I also ran it through "Fedora-x86_64-m64" on the buildbot. gdb/ChangeLog 2019-02-07 Tom Tromey <tom@tromey.com> * yy-remap.h: Add include guard. * xtensa-tdep.h: Add include guard. * xcoffread.h: Rename include guard. * varobj-iter.h: Add include guard. * tui/tui.h: Rename include guard. * tui/tui-winsource.h: Rename include guard. * tui/tui-wingeneral.h: Rename include guard. * tui/tui-windata.h: Rename include guard. * tui/tui-win.h: Rename include guard. * tui/tui-stack.h: Rename include guard. * tui/tui-source.h: Rename include guard. * tui/tui-regs.h: Rename include guard. * tui/tui-out.h: Rename include guard. * tui/tui-layout.h: Rename include guard. * tui/tui-io.h: Rename include guard. * tui/tui-hooks.h: Rename include guard. * tui/tui-file.h: Rename include guard. * tui/tui-disasm.h: Rename include guard. * tui/tui-data.h: Rename include guard. * tui/tui-command.h: Rename include guard. * tic6x-tdep.h: Add include guard. * target/waitstatus.h: Rename include guard. * target/wait.h: Rename include guard. * target/target.h: Rename include guard. * target/resume.h: Rename include guard. * target-float.h: Rename include guard. * stabsread.h: Add include guard. * rs6000-tdep.h: Add include guard. * riscv-fbsd-tdep.h: Add include guard. * regformats/regdef.h: Rename include guard. * record.h: Rename include guard. * python/python.h: Rename include guard. * python/python-internal.h: Rename include guard. * python/py-stopevent.h: Rename include guard. * python/py-ref.h: Rename include guard. * python/py-record.h: Rename include guard. * python/py-record-full.h: Rename include guard. * python/py-record-btrace.h: Rename include guard. * python/py-instruction.h: Rename include guard. * python/py-events.h: Rename include guard. * python/py-event.h: Rename include guard. * procfs.h: Add include guard. * proc-utils.h: Add include guard. * p-lang.h: Add include guard. * or1k-tdep.h: Rename include guard. * observable.h: Rename include guard. * nto-tdep.h: Rename include guard. * nat/x86-linux.h: Rename include guard. * nat/x86-linux-dregs.h: Rename include guard. * nat/x86-gcc-cpuid.h: Add include guard. * nat/x86-dregs.h: Rename include guard. * nat/x86-cpuid.h: Rename include guard. * nat/ppc-linux.h: Rename include guard. * nat/mips-linux-watch.h: Rename include guard. * nat/linux-waitpid.h: Rename include guard. * nat/linux-ptrace.h: Rename include guard. * nat/linux-procfs.h: Rename include guard. * nat/linux-osdata.h: Rename include guard. * nat/linux-nat.h: Rename include guard. * nat/linux-namespaces.h: Rename include guard. * nat/linux-btrace.h: Rename include guard. * nat/glibc_thread_db.h: Rename include guard. * nat/gdb_thread_db.h: Rename include guard. * nat/gdb_ptrace.h: Rename include guard. * nat/fork-inferior.h: Rename include guard. * nat/amd64-linux-siginfo.h: Rename include guard. * nat/aarch64-sve-linux-sigcontext.h: Rename include guard. * nat/aarch64-sve-linux-ptrace.h: Rename include guard. * nat/aarch64-linux.h: Rename include guard. * nat/aarch64-linux-hw-point.h: Rename include guard. * mn10300-tdep.h: Add include guard. * mips-linux-tdep.h: Add include guard. * mi/mi-parse.h: Rename include guard. * mi/mi-out.h: Rename include guard. * mi/mi-main.h: Rename include guard. * mi/mi-interp.h: Rename include guard. * mi/mi-getopt.h: Rename include guard. * mi/mi-console.h: Rename include guard. * mi/mi-common.h: Rename include guard. * mi/mi-cmds.h: Rename include guard. * mi/mi-cmd-break.h: Rename include guard. * m2-lang.h: Add include guard. * location.h: Rename include guard. * linux-record.h: Rename include guard. * linux-nat.h: Add include guard. * linux-fork.h: Add include guard. * i386-darwin-tdep.h: Rename include guard. * hppa-linux-offsets.h: Add include guard. * guile/guile.h: Rename include guard. * guile/guile-internal.h: Rename include guard. * gnu-nat.h: Rename include guard. * gdb-stabs.h: Rename include guard. * frv-tdep.h: Add include guard. * f-lang.h: Add include guard. * event-loop.h: Add include guard. * darwin-nat.h: Rename include guard. * cp-abi.h: Rename include guard. * config/sparc/nm-sol2.h: Rename include guard. * config/nm-nto.h: Rename include guard. * config/nm-linux.h: Add include guard. * config/i386/nm-i386gnu.h: Rename include guard. * config/djgpp/nl_types.h: Rename include guard. * config/djgpp/langinfo.h: Rename include guard. * compile/gcc-cp-plugin.h: Add include guard. * compile/gcc-c-plugin.h: Add include guard. * compile/compile.h: Rename include guard. * compile/compile-object-run.h: Rename include guard. * compile/compile-object-load.h: Rename include guard. * compile/compile-internal.h: Rename include guard. * compile/compile-cplus.h: Rename include guard. * compile/compile-c.h: Rename include guard. * common/xml-utils.h: Rename include guard. * common/x86-xstate.h: Rename include guard. * common/version.h: Rename include guard. * common/vec.h: Rename include guard. * common/tdesc.h: Rename include guard. * common/selftest.h: Rename include guard. * common/scoped_restore.h: Rename include guard. * common/scoped_mmap.h: Rename include guard. * common/scoped_fd.h: Rename include guard. * common/safe-iterator.h: Rename include guard. * common/run-time-clock.h: Rename include guard. * common/refcounted-object.h: Rename include guard. * common/queue.h: Rename include guard. * common/ptid.h: Rename include guard. * common/print-utils.h: Rename include guard. * common/preprocessor.h: Rename include guard. * common/pathstuff.h: Rename include guard. * common/observable.h: Rename include guard. * common/netstuff.h: Rename include guard. * common/job-control.h: Rename include guard. * common/host-defs.h: Rename include guard. * common/gdb_wait.h: Rename include guard. * common/gdb_vecs.h: Rename include guard. * common/gdb_unlinker.h: Rename include guard. * common/gdb_unique_ptr.h: Rename include guard. * common/gdb_tilde_expand.h: Rename include guard. * common/gdb_sys_time.h: Rename include guard. * common/gdb_string_view.h: Rename include guard. * common/gdb_splay_tree.h: Rename include guard. * common/gdb_setjmp.h: Rename include guard. * common/gdb_ref_ptr.h: Rename include guard. * common/gdb_optional.h: Rename include guard. * common/gdb_locale.h: Rename include guard. * common/gdb_assert.h: Rename include guard. * common/filtered-iterator.h: Rename include guard. * common/filestuff.h: Rename include guard. * common/fileio.h: Rename include guard. * common/environ.h: Rename include guard. * common/common-utils.h: Rename include guard. * common/common-types.h: Rename include guard. * common/common-regcache.h: Rename include guard. * common/common-inferior.h: Rename include guard. * common/common-gdbthread.h: Rename include guard. * common/common-exceptions.h: Rename include guard. * common/common-defs.h: Rename include guard. * common/common-debug.h: Rename include guard. * common/cleanups.h: Rename include guard. * common/buffer.h: Rename include guard. * common/btrace-common.h: Rename include guard. * common/break-common.h: Rename include guard. * cli/cli-utils.h: Rename include guard. * cli/cli-style.h: Rename include guard. * cli/cli-setshow.h: Rename include guard. * cli/cli-script.h: Rename include guard. * cli/cli-interp.h: Rename include guard. * cli/cli-decode.h: Rename include guard. * cli/cli-cmds.h: Rename include guard. * charset-list.h: Add include guard. * buildsym-legacy.h: Rename include guard. * bfin-tdep.h: Add include guard. * ax.h: Rename include guard. * arm-linux-tdep.h: Add include guard. * arm-fbsd-tdep.h: Add include guard. * arch/xtensa.h: Rename include guard. * arch/tic6x.h: Add include guard. * arch/i386.h: Add include guard. * arch/arm.h: Rename include guard. * arch/arm-linux.h: Rename include guard. * arch/arm-get-next-pcs.h: Rename include guard. * arch/amd64.h: Add include guard. * arch/aarch64-insn.h: Rename include guard. * arch-utils.h: Rename include guard. * annotate.h: Add include guard. * amd64-darwin-tdep.h: Rename include guard. * aarch64-linux-tdep.h: Add include guard. * aarch64-fbsd-tdep.h: Add include guard. * aarch32-linux-nat.h: Add include guard. gdb/gdbserver/ChangeLog 2019-02-07 Tom Tromey <tom@tromey.com> * x86-tdesc.h: Rename include guard. * x86-low.h: Add include guard. * wincecompat.h: Rename include guard. * win32-low.h: Add include guard. * utils.h: Rename include guard. * tracepoint.h: Rename include guard. * tdesc.h: Rename include guard. * target.h: Rename include guard. * server.h: Rename include guard. * remote-utils.h: Rename include guard. * regcache.h: Rename include guard. * nto-low.h: Rename include guard. * notif.h: Add include guard. * mem-break.h: Rename include guard. * lynx-low.h: Add include guard. * linux-x86-tdesc.h: Add include guard. * linux-s390-tdesc.h: Add include guard. * linux-ppc-tdesc-init.h: Add include guard. * linux-low.h: Add include guard. * linux-aarch64-tdesc.h: Add include guard. * linux-aarch32-low.h: Add include guard. * inferiors.h: Rename include guard. * i387-fp.h: Rename include guard. * hostio.h: Rename include guard. * gdbthread.h: Rename include guard. * gdb_proc_service.h: Rename include guard. * event-loop.h: Rename include guard. * dll.h: Rename include guard. * debug.h: Rename include guard. * ax.h: Rename include guard.
2019-01-27 20:51:36 +01:00
2019-02-07 Tom Tromey <tom@tromey.com>
* yy-remap.h: Add include guard.
* xtensa-tdep.h: Add include guard.
* xcoffread.h: Rename include guard.
* varobj-iter.h: Add include guard.
* tui/tui.h: Rename include guard.
* tui/tui-winsource.h: Rename include guard.
* tui/tui-wingeneral.h: Rename include guard.
* tui/tui-windata.h: Rename include guard.
* tui/tui-win.h: Rename include guard.
* tui/tui-stack.h: Rename include guard.
* tui/tui-source.h: Rename include guard.
* tui/tui-regs.h: Rename include guard.
* tui/tui-out.h: Rename include guard.
* tui/tui-layout.h: Rename include guard.
* tui/tui-io.h: Rename include guard.
* tui/tui-hooks.h: Rename include guard.
* tui/tui-file.h: Rename include guard.
* tui/tui-disasm.h: Rename include guard.
* tui/tui-data.h: Rename include guard.
* tui/tui-command.h: Rename include guard.
* tic6x-tdep.h: Add include guard.
* target/waitstatus.h: Rename include guard.
* target/wait.h: Rename include guard.
* target/target.h: Rename include guard.
* target/resume.h: Rename include guard.
* target-float.h: Rename include guard.
* stabsread.h: Add include guard.
* rs6000-tdep.h: Add include guard.
* riscv-fbsd-tdep.h: Add include guard.
* regformats/regdef.h: Rename include guard.
* record.h: Rename include guard.
* python/python.h: Rename include guard.
* python/python-internal.h: Rename include guard.
* python/py-stopevent.h: Rename include guard.
* python/py-ref.h: Rename include guard.
* python/py-record.h: Rename include guard.
* python/py-record-full.h: Rename include guard.
* python/py-record-btrace.h: Rename include guard.
* python/py-instruction.h: Rename include guard.
* python/py-events.h: Rename include guard.
* python/py-event.h: Rename include guard.
* procfs.h: Add include guard.
* proc-utils.h: Add include guard.
* p-lang.h: Add include guard.
* or1k-tdep.h: Rename include guard.
* observable.h: Rename include guard.
* nto-tdep.h: Rename include guard.
* nat/x86-linux.h: Rename include guard.
* nat/x86-linux-dregs.h: Rename include guard.
* nat/x86-gcc-cpuid.h: Add include guard.
* nat/x86-dregs.h: Rename include guard.
* nat/x86-cpuid.h: Rename include guard.
* nat/ppc-linux.h: Rename include guard.
* nat/mips-linux-watch.h: Rename include guard.
* nat/linux-waitpid.h: Rename include guard.
* nat/linux-ptrace.h: Rename include guard.
* nat/linux-procfs.h: Rename include guard.
* nat/linux-osdata.h: Rename include guard.
* nat/linux-nat.h: Rename include guard.
* nat/linux-namespaces.h: Rename include guard.
* nat/linux-btrace.h: Rename include guard.
* nat/glibc_thread_db.h: Rename include guard.
* nat/gdb_thread_db.h: Rename include guard.
* nat/gdb_ptrace.h: Rename include guard.
* nat/fork-inferior.h: Rename include guard.
* nat/amd64-linux-siginfo.h: Rename include guard.
* nat/aarch64-sve-linux-sigcontext.h: Rename include guard.
* nat/aarch64-sve-linux-ptrace.h: Rename include guard.
* nat/aarch64-linux.h: Rename include guard.
* nat/aarch64-linux-hw-point.h: Rename include guard.
* mn10300-tdep.h: Add include guard.
* mips-linux-tdep.h: Add include guard.
* mi/mi-parse.h: Rename include guard.
* mi/mi-out.h: Rename include guard.
* mi/mi-main.h: Rename include guard.
* mi/mi-interp.h: Rename include guard.
* mi/mi-getopt.h: Rename include guard.
* mi/mi-console.h: Rename include guard.
* mi/mi-common.h: Rename include guard.
* mi/mi-cmds.h: Rename include guard.
* mi/mi-cmd-break.h: Rename include guard.
* m2-lang.h: Add include guard.
* location.h: Rename include guard.
* linux-record.h: Rename include guard.
* linux-nat.h: Add include guard.
* linux-fork.h: Add include guard.
* i386-darwin-tdep.h: Rename include guard.
* hppa-linux-offsets.h: Add include guard.
* guile/guile.h: Rename include guard.
* guile/guile-internal.h: Rename include guard.
* gnu-nat.h: Rename include guard.
* gdb-stabs.h: Rename include guard.
* frv-tdep.h: Add include guard.
* f-lang.h: Add include guard.
* event-loop.h: Add include guard.
* darwin-nat.h: Rename include guard.
* cp-abi.h: Rename include guard.
* config/sparc/nm-sol2.h: Rename include guard.
* config/nm-nto.h: Rename include guard.
* config/nm-linux.h: Add include guard.
* config/i386/nm-i386gnu.h: Rename include guard.
* config/djgpp/nl_types.h: Rename include guard.
* config/djgpp/langinfo.h: Rename include guard.
* compile/gcc-cp-plugin.h: Add include guard.
* compile/gcc-c-plugin.h: Add include guard.
* compile/compile.h: Rename include guard.
* compile/compile-object-run.h: Rename include guard.
* compile/compile-object-load.h: Rename include guard.
* compile/compile-internal.h: Rename include guard.
* compile/compile-cplus.h: Rename include guard.
* compile/compile-c.h: Rename include guard.
* common/xml-utils.h: Rename include guard.
* common/x86-xstate.h: Rename include guard.
* common/version.h: Rename include guard.
* common/vec.h: Rename include guard.
* common/tdesc.h: Rename include guard.
* common/selftest.h: Rename include guard.
* common/scoped_restore.h: Rename include guard.
* common/scoped_mmap.h: Rename include guard.
* common/scoped_fd.h: Rename include guard.
* common/safe-iterator.h: Rename include guard.
* common/run-time-clock.h: Rename include guard.
* common/refcounted-object.h: Rename include guard.
* common/queue.h: Rename include guard.
* common/ptid.h: Rename include guard.
* common/print-utils.h: Rename include guard.
* common/preprocessor.h: Rename include guard.
* common/pathstuff.h: Rename include guard.
* common/observable.h: Rename include guard.
* common/netstuff.h: Rename include guard.
* common/job-control.h: Rename include guard.
* common/host-defs.h: Rename include guard.
* common/gdb_wait.h: Rename include guard.
* common/gdb_vecs.h: Rename include guard.
* common/gdb_unlinker.h: Rename include guard.
* common/gdb_unique_ptr.h: Rename include guard.
* common/gdb_tilde_expand.h: Rename include guard.
* common/gdb_sys_time.h: Rename include guard.
* common/gdb_string_view.h: Rename include guard.
* common/gdb_splay_tree.h: Rename include guard.
* common/gdb_setjmp.h: Rename include guard.
* common/gdb_ref_ptr.h: Rename include guard.
* common/gdb_optional.h: Rename include guard.
* common/gdb_locale.h: Rename include guard.
* common/gdb_assert.h: Rename include guard.
* common/filtered-iterator.h: Rename include guard.
* common/filestuff.h: Rename include guard.
* common/fileio.h: Rename include guard.
* common/environ.h: Rename include guard.
* common/common-utils.h: Rename include guard.
* common/common-types.h: Rename include guard.
* common/common-regcache.h: Rename include guard.
* common/common-inferior.h: Rename include guard.
* common/common-gdbthread.h: Rename include guard.
* common/common-exceptions.h: Rename include guard.
* common/common-defs.h: Rename include guard.
* common/common-debug.h: Rename include guard.
* common/cleanups.h: Rename include guard.
* common/buffer.h: Rename include guard.
* common/btrace-common.h: Rename include guard.
* common/break-common.h: Rename include guard.
* cli/cli-utils.h: Rename include guard.
* cli/cli-style.h: Rename include guard.
* cli/cli-setshow.h: Rename include guard.
* cli/cli-script.h: Rename include guard.
* cli/cli-interp.h: Rename include guard.
* cli/cli-decode.h: Rename include guard.
* cli/cli-cmds.h: Rename include guard.
* charset-list.h: Add include guard.
* buildsym-legacy.h: Rename include guard.
* bfin-tdep.h: Add include guard.
* ax.h: Rename include guard.
* arm-linux-tdep.h: Add include guard.
* arm-fbsd-tdep.h: Add include guard.
* arch/xtensa.h: Rename include guard.
* arch/tic6x.h: Add include guard.
* arch/i386.h: Add include guard.
* arch/arm.h: Rename include guard.
* arch/arm-linux.h: Rename include guard.
* arch/arm-get-next-pcs.h: Rename include guard.
* arch/amd64.h: Add include guard.
* arch/aarch64-insn.h: Rename include guard.
* arch-utils.h: Rename include guard.
* annotate.h: Add include guard.
* amd64-darwin-tdep.h: Rename include guard.
* aarch64-linux-tdep.h: Add include guard.
* aarch64-fbsd-tdep.h: Add include guard.
* aarch32-linux-nat.h: Add include guard.
2019-02-06 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* macrotab.c (macro_define_internal): New function that
factorizes macro_define_object_internal and macro_define_function
code.
(macro_define_object_internal): Use macro_define_internal.
(macro_define_function): Likewise.
Fix leak of identifier in macro definition. Valgrind detects leaks like the following (gdb.base/macscp.exp). This patch fixes 1 of the 3 leaks (the last one in the list below). The remaining leaks are better fixed in splay_tree_remove and splay_tree_insert in libiberty. Tested on debian/amd64, natively and under valgrind. ==22285== 64 (48 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 737 of 3,377 ==22285== at 0x4C2BE6D: malloc (vg_replace_malloc.c:309) ==22285== by 0x4049E7: xmalloc (common-utils.c:44) ==22285== by 0x533A20: new_macro_key(macro_table*, char const*, macro_source_file*, int) (macrotab.c:355) ==22285== by 0x53438B: macro_define_function(macro_source_file*, int, char const*, int, char const**, char const*) (macrotab.c:822) ==22285== by 0x52F945: macro_define_command(char const*, int) (macrocmd.c:409) ... ==22285== 128 (96 direct, 32 indirect) bytes in 2 blocks are definitely lost in loss record 1,083 of 3,377 ==22285== at 0x4C2BE6D: malloc (vg_replace_malloc.c:309) ==22285== by 0x4049E7: xmalloc (common-utils.c:44) ==22285== by 0x533A20: new_macro_key(macro_table*, char const*, macro_source_file*, int) (macrotab.c:355) ==22285== by 0x534277: macro_define_object_internal(macro_source_file*, int, char const*, char const*, macro_special_kind) (macrotab.c:776) ==22285== by 0x52F7E0: macro_define_command(char const*, int) (macrocmd.c:414) ... ==22285== 177 bytes in 19 blocks are definitely lost in loss record 1,193 of 3,377 ==22285== at 0x4C2BE6D: malloc (vg_replace_malloc.c:309) ==22285== by 0x4049E7: xmalloc (common-utils.c:44) ==22285== by 0x52F5BD: extract_identifier(char const**, int) (macrocmd.c:316) ==22285== by 0x52F77D: macro_define_command(char const*, int) (macrocmd.c:355) gdb/ChangeLog 2019-02-06 Philippe Waroquiers <philippe.waroquiers@skynet.be> * macrocmd.c (extract_identifier): Return a gdb::unique_xmalloc_ptr<char> instead of a char *, and update callers.
2019-01-26 12:29:00 +01:00
2019-02-06 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* macrocmd.c (extract_identifier): Return
a gdb::unique_xmalloc_ptr<char> instead of a char *, and update
callers.
2019-02-06 John Baldwin <jhb@FreeBSD.org>
* fbsd-nat.c (fbsd_fetch_cmdline): Join arguments with spaces.
2019-02-05 Tom Tromey <tom@tromey.com>
* target.c (target_stack::unpush): Move assertion earlier.
2019-01-30 Tom Tromey <tom@tromey.com>
PR python/23615:
* python/python.c (execute_gdb_command): Use gdbpy_allow_threads.
(gdbpy_parse_and_eval): Likewise.
* python/python-internal.h (gdbpy_allow_threads): New class.
2019-01-28 John Baldwin <jhb@FreeBSD.org>
* aarch64-fbsd-tdep.c (aarch64_fbsd_gregmap)
(aarch64_fbsd_fpregmap): Move earlier.
(AARCH64_MCONTEXT_REG_SIZE, AARCH64_MCONTEXT_FPREG_SIZE): Delete.
(aarch64_fbsd_sigframe_init): Use trad_frame_set_reg_regmap
instead of individual calls to trad_frame_set_reg_addr.
* arm-fbsd-tdep.c (arm_fbsd_gregmap, arm_fbsd_vfpregmap): Move
earlier.
(ARM_MCONTEXT_REG_SIZE, ARM_MCONTEXT_VFP_REG_SIZE): Delete.
(arm_fbsd_sigframe_init): Use trad_frame_set_reg_regmap
instead of individual calls to trad_frame_set_reg_addr.
2019-01-28 Alan Hayward <alan.hayward@arm.com>
* CONTRIBUTE: Replace contribution list with wiki link.
2019-01-25 Tom Tromey <tom@tromey.com>
* Makefile.in (GDB_CFLAGS): Don't add -I for common.
Normalize includes to use common/ This changes all includes to use the form "common/filename.h" rather than just "filename.h". This was written by a script. gdb/ChangeLog 2019-01-25 Tom Tromey <tom@tromey.com> * xtensa-linux-nat.c: Fix common/ includes. * xml-support.h: Fix common/ includes. * xml-support.c: Fix common/ includes. * x86-linux-nat.c: Fix common/ includes. * windows-nat.c: Fix common/ includes. * varobj.h: Fix common/ includes. * varobj.c: Fix common/ includes. * value.c: Fix common/ includes. * valops.c: Fix common/ includes. * utils.c: Fix common/ includes. * unittests/xml-utils-selftests.c: Fix common/ includes. * unittests/utils-selftests.c: Fix common/ includes. * unittests/unpack-selftests.c: Fix common/ includes. * unittests/tracepoint-selftests.c: Fix common/ includes. * unittests/style-selftests.c: Fix common/ includes. * unittests/string_view-selftests.c: Fix common/ includes. * unittests/scoped_restore-selftests.c: Fix common/ includes. * unittests/scoped_mmap-selftests.c: Fix common/ includes. * unittests/scoped_fd-selftests.c: Fix common/ includes. * unittests/rsp-low-selftests.c: Fix common/ includes. * unittests/parse-connection-spec-selftests.c: Fix common/ includes. * unittests/optional-selftests.c: Fix common/ includes. * unittests/offset-type-selftests.c: Fix common/ includes. * unittests/observable-selftests.c: Fix common/ includes. * unittests/mkdir-recursive-selftests.c: Fix common/ includes. * unittests/memrange-selftests.c: Fix common/ includes. * unittests/memory-map-selftests.c: Fix common/ includes. * unittests/lookup_name_info-selftests.c: Fix common/ includes. * unittests/function-view-selftests.c: Fix common/ includes. * unittests/environ-selftests.c: Fix common/ includes. * unittests/copy_bitwise-selftests.c: Fix common/ includes. * unittests/common-utils-selftests.c: Fix common/ includes. * unittests/cli-utils-selftests.c: Fix common/ includes. * unittests/array-view-selftests.c: Fix common/ includes. * ui-file.c: Fix common/ includes. * tui/tui-io.c: Fix common/ includes. * tracepoint.h: Fix common/ includes. * tracepoint.c: Fix common/ includes. * tracefile-tfile.c: Fix common/ includes. * top.h: Fix common/ includes. * top.c: Fix common/ includes. * thread.c: Fix common/ includes. * target/waitstatus.h: Fix common/ includes. * target/waitstatus.c: Fix common/ includes. * target.h: Fix common/ includes. * target.c: Fix common/ includes. * target-memory.c: Fix common/ includes. * target-descriptions.c: Fix common/ includes. * symtab.h: Fix common/ includes. * symfile.c: Fix common/ includes. * stap-probe.c: Fix common/ includes. * spu-linux-nat.c: Fix common/ includes. * sparc-nat.c: Fix common/ includes. * source.c: Fix common/ includes. * solib.c: Fix common/ includes. * solib-target.c: Fix common/ includes. * ser-unix.c: Fix common/ includes. * ser-tcp.c: Fix common/ includes. * ser-pipe.c: Fix common/ includes. * ser-base.c: Fix common/ includes. * selftest-arch.c: Fix common/ includes. * s12z-tdep.c: Fix common/ includes. * rust-exp.y: Fix common/ includes. * rs6000-aix-tdep.c: Fix common/ includes. * riscv-tdep.c: Fix common/ includes. * remote.c: Fix common/ includes. * remote-notif.h: Fix common/ includes. * remote-fileio.h: Fix common/ includes. * remote-fileio.c: Fix common/ includes. * regcache.h: Fix common/ includes. * regcache.c: Fix common/ includes. * record-btrace.c: Fix common/ includes. * python/python.c: Fix common/ includes. * python/py-type.c: Fix common/ includes. * python/py-inferior.c: Fix common/ includes. * progspace.h: Fix common/ includes. * producer.c: Fix common/ includes. * procfs.c: Fix common/ includes. * proc-api.c: Fix common/ includes. * printcmd.c: Fix common/ includes. * ppc-linux-nat.c: Fix common/ includes. * parser-defs.h: Fix common/ includes. * osdata.c: Fix common/ includes. * obsd-nat.c: Fix common/ includes. * nat/x86-linux.c: Fix common/ includes. * nat/x86-linux-dregs.c: Fix common/ includes. * nat/x86-dregs.h: Fix common/ includes. * nat/x86-dregs.c: Fix common/ includes. * nat/ppc-linux.c: Fix common/ includes. * nat/mips-linux-watch.h: Fix common/ includes. * nat/mips-linux-watch.c: Fix common/ includes. * nat/linux-waitpid.c: Fix common/ includes. * nat/linux-ptrace.h: Fix common/ includes. * nat/linux-ptrace.c: Fix common/ includes. * nat/linux-procfs.c: Fix common/ includes. * nat/linux-personality.c: Fix common/ includes. * nat/linux-osdata.c: Fix common/ includes. * nat/linux-namespaces.c: Fix common/ includes. * nat/linux-btrace.h: Fix common/ includes. * nat/linux-btrace.c: Fix common/ includes. * nat/fork-inferior.c: Fix common/ includes. * nat/amd64-linux-siginfo.c: Fix common/ includes. * nat/aarch64-sve-linux-ptrace.c: Fix common/ includes. * nat/aarch64-linux.c: Fix common/ includes. * nat/aarch64-linux-hw-point.h: Fix common/ includes. * nat/aarch64-linux-hw-point.c: Fix common/ includes. * namespace.h: Fix common/ includes. * mips-linux-tdep.c: Fix common/ includes. * minsyms.c: Fix common/ includes. * mi/mi-parse.h: Fix common/ includes. * mi/mi-main.c: Fix common/ includes. * mi/mi-cmd-env.c: Fix common/ includes. * memrange.h: Fix common/ includes. * memattr.c: Fix common/ includes. * maint.h: Fix common/ includes. * maint.c: Fix common/ includes. * main.c: Fix common/ includes. * machoread.c: Fix common/ includes. * location.c: Fix common/ includes. * linux-thread-db.c: Fix common/ includes. * linux-nat.c: Fix common/ includes. * linux-fork.c: Fix common/ includes. * inline-frame.c: Fix common/ includes. * infrun.c: Fix common/ includes. * inflow.c: Fix common/ includes. * inferior.h: Fix common/ includes. * inferior.c: Fix common/ includes. * infcmd.c: Fix common/ includes. * inf-ptrace.c: Fix common/ includes. * inf-child.c: Fix common/ includes. * ia64-linux-nat.c: Fix common/ includes. * i387-tdep.c: Fix common/ includes. * i386-tdep.c: Fix common/ includes. * i386-linux-tdep.c: Fix common/ includes. * i386-linux-nat.c: Fix common/ includes. * i386-go32-tdep.c: Fix common/ includes. * i386-fbsd-tdep.c: Fix common/ includes. * i386-fbsd-nat.c: Fix common/ includes. * guile/scm-type.c: Fix common/ includes. * guile/guile.c: Fix common/ includes. * go32-nat.c: Fix common/ includes. * gnu-nat.c: Fix common/ includes. * gdbthread.h: Fix common/ includes. * gdbarch-selftests.c: Fix common/ includes. * gdb_usleep.c: Fix common/ includes. * gdb_select.h: Fix common/ includes. * gdb_bfd.c: Fix common/ includes. * gcore.c: Fix common/ includes. * fork-child.c: Fix common/ includes. * findvar.c: Fix common/ includes. * fbsd-nat.c: Fix common/ includes. * event-top.c: Fix common/ includes. * event-loop.c: Fix common/ includes. * dwarf2read.c: Fix common/ includes. * dwarf2loc.c: Fix common/ includes. * dwarf2-frame.c: Fix common/ includes. * dwarf-index-cache.c: Fix common/ includes. * dtrace-probe.c: Fix common/ includes. * disasm-selftests.c: Fix common/ includes. * defs.h: Fix common/ includes. * csky-tdep.c: Fix common/ includes. * cp-valprint.c: Fix common/ includes. * cp-support.h: Fix common/ includes. * cp-support.c: Fix common/ includes. * corelow.c: Fix common/ includes. * completer.h: Fix common/ includes. * completer.c: Fix common/ includes. * compile/compile.c: Fix common/ includes. * compile/compile-loc2c.c: Fix common/ includes. * compile/compile-cplus-types.c: Fix common/ includes. * compile/compile-cplus-symbols.c: Fix common/ includes. * command.h: Fix common/ includes. * cli/cli-dump.c: Fix common/ includes. * cli/cli-cmds.c: Fix common/ includes. * charset.c: Fix common/ includes. * build-id.c: Fix common/ includes. * btrace.h: Fix common/ includes. * btrace.c: Fix common/ includes. * breakpoint.h: Fix common/ includes. * breakpoint.c: Fix common/ includes. * ax.h: (enum agent_op): Fix common/ includes. * ax-general.c (struct aop_map): Fix common/ includes. * ax-gdb.c: Fix common/ includes. * auxv.c: Fix common/ includes. * auto-load.c: Fix common/ includes. * arm-tdep.c: Fix common/ includes. * arch/riscv.c: Fix common/ includes. * arch/ppc-linux-common.c: Fix common/ includes. * arch/i386.c: Fix common/ includes. * arch/arm.c: Fix common/ includes. * arch/arm-linux.c: Fix common/ includes. * arch/arm-get-next-pcs.c: Fix common/ includes. * arch/amd64.c: Fix common/ includes. * arch/aarch64.c: Fix common/ includes. * arch/aarch64-insn.c: Fix common/ includes. * arch-utils.c: Fix common/ includes. * amd64-windows-tdep.c: Fix common/ includes. * amd64-tdep.c: Fix common/ includes. * amd64-sol2-tdep.c: Fix common/ includes. * amd64-obsd-tdep.c: Fix common/ includes. * amd64-nbsd-tdep.c: Fix common/ includes. * amd64-linux-tdep.c: Fix common/ includes. * amd64-linux-nat.c: Fix common/ includes. * amd64-fbsd-tdep.c: Fix common/ includes. * amd64-fbsd-nat.c: Fix common/ includes. * amd64-dicos-tdep.c: Fix common/ includes. * amd64-darwin-tdep.c: Fix common/ includes. * agent.c: Fix common/ includes. * ada-lang.h: Fix common/ includes. * ada-lang.c: Fix common/ includes. * aarch64-tdep.c: Fix common/ includes. gdb/gdbserver/ChangeLog 2019-01-25 Tom Tromey <tom@tromey.com> * win32-low.c: Fix common/ includes. * win32-i386-low.c: Fix common/ includes. * tracepoint.c: Fix common/ includes. * thread-db.c: Fix common/ includes. * target.h: Fix common/ includes. * symbol.c: Fix common/ includes. * spu-low.c: Fix common/ includes. * server.h: Fix common/ includes. * server.c: Fix common/ includes. * remote-utils.c: Fix common/ includes. * regcache.h: Fix common/ includes. * regcache.c: Fix common/ includes. * nto-x86-low.c: Fix common/ includes. * notif.h: Fix common/ includes. * mem-break.h: Fix common/ includes. * lynx-low.c: Fix common/ includes. * lynx-i386-low.c: Fix common/ includes. * linux-x86-tdesc-selftest.c: Fix common/ includes. * linux-x86-low.c: Fix common/ includes. * linux-low.c: Fix common/ includes. * inferiors.h: Fix common/ includes. * i387-fp.c: Fix common/ includes. * hostio.c: Fix common/ includes. * hostio-errno.c: Fix common/ includes. * gdbthread.h: Fix common/ includes. * gdbreplay.c: Fix common/ includes. * fork-child.c: Fix common/ includes. * event-loop.c: Fix common/ includes. * ax.c: (enum gdb_agent_op): Fix common/ includes.
2019-01-23 18:21:39 +01:00
2019-01-25 Tom Tromey <tom@tromey.com>
* xtensa-linux-nat.c: Fix common/ includes.
* xml-support.h: Fix common/ includes.
* xml-support.c: Fix common/ includes.
* x86-linux-nat.c: Fix common/ includes.
* windows-nat.c: Fix common/ includes.
* varobj.h: Fix common/ includes.
* varobj.c: Fix common/ includes.
* value.c: Fix common/ includes.
* valops.c: Fix common/ includes.
* utils.c: Fix common/ includes.
* unittests/xml-utils-selftests.c: Fix common/ includes.
* unittests/utils-selftests.c: Fix common/ includes.
* unittests/unpack-selftests.c: Fix common/ includes.
* unittests/tracepoint-selftests.c: Fix common/ includes.
* unittests/style-selftests.c: Fix common/ includes.
* unittests/string_view-selftests.c: Fix common/ includes.
* unittests/scoped_restore-selftests.c: Fix common/ includes.
* unittests/scoped_mmap-selftests.c: Fix common/ includes.
* unittests/scoped_fd-selftests.c: Fix common/ includes.
* unittests/rsp-low-selftests.c: Fix common/ includes.
* unittests/parse-connection-spec-selftests.c: Fix common/
includes.
* unittests/optional-selftests.c: Fix common/ includes.
* unittests/offset-type-selftests.c: Fix common/ includes.
* unittests/observable-selftests.c: Fix common/ includes.
* unittests/mkdir-recursive-selftests.c: Fix common/ includes.
* unittests/memrange-selftests.c: Fix common/ includes.
* unittests/memory-map-selftests.c: Fix common/ includes.
* unittests/lookup_name_info-selftests.c: Fix common/ includes.
* unittests/function-view-selftests.c: Fix common/ includes.
* unittests/environ-selftests.c: Fix common/ includes.
* unittests/copy_bitwise-selftests.c: Fix common/ includes.
* unittests/common-utils-selftests.c: Fix common/ includes.
* unittests/cli-utils-selftests.c: Fix common/ includes.
* unittests/array-view-selftests.c: Fix common/ includes.
* ui-file.c: Fix common/ includes.
* tui/tui-io.c: Fix common/ includes.
* tracepoint.h: Fix common/ includes.
* tracepoint.c: Fix common/ includes.
* tracefile-tfile.c: Fix common/ includes.
* top.h: Fix common/ includes.
* top.c: Fix common/ includes.
* thread.c: Fix common/ includes.
* target/waitstatus.h: Fix common/ includes.
* target/waitstatus.c: Fix common/ includes.
* target.h: Fix common/ includes.
* target.c: Fix common/ includes.
* target-memory.c: Fix common/ includes.
* target-descriptions.c: Fix common/ includes.
* symtab.h: Fix common/ includes.
* symfile.c: Fix common/ includes.
* stap-probe.c: Fix common/ includes.
* spu-linux-nat.c: Fix common/ includes.
* sparc-nat.c: Fix common/ includes.
* source.c: Fix common/ includes.
* solib.c: Fix common/ includes.
* solib-target.c: Fix common/ includes.
* ser-unix.c: Fix common/ includes.
* ser-tcp.c: Fix common/ includes.
* ser-pipe.c: Fix common/ includes.
* ser-base.c: Fix common/ includes.
* selftest-arch.c: Fix common/ includes.
* s12z-tdep.c: Fix common/ includes.
* rust-exp.y: Fix common/ includes.
* rs6000-aix-tdep.c: Fix common/ includes.
* riscv-tdep.c: Fix common/ includes.
* remote.c: Fix common/ includes.
* remote-notif.h: Fix common/ includes.
* remote-fileio.h: Fix common/ includes.
* remote-fileio.c: Fix common/ includes.
* regcache.h: Fix common/ includes.
* regcache.c: Fix common/ includes.
* record-btrace.c: Fix common/ includes.
* python/python.c: Fix common/ includes.
* python/py-type.c: Fix common/ includes.
* python/py-inferior.c: Fix common/ includes.
* progspace.h: Fix common/ includes.
* producer.c: Fix common/ includes.
* procfs.c: Fix common/ includes.
* proc-api.c: Fix common/ includes.
* printcmd.c: Fix common/ includes.
* ppc-linux-nat.c: Fix common/ includes.
* parser-defs.h: Fix common/ includes.
* osdata.c: Fix common/ includes.
* obsd-nat.c: Fix common/ includes.
* nat/x86-linux.c: Fix common/ includes.
* nat/x86-linux-dregs.c: Fix common/ includes.
* nat/x86-dregs.h: Fix common/ includes.
* nat/x86-dregs.c: Fix common/ includes.
* nat/ppc-linux.c: Fix common/ includes.
* nat/mips-linux-watch.h: Fix common/ includes.
* nat/mips-linux-watch.c: Fix common/ includes.
* nat/linux-waitpid.c: Fix common/ includes.
* nat/linux-ptrace.h: Fix common/ includes.
* nat/linux-ptrace.c: Fix common/ includes.
* nat/linux-procfs.c: Fix common/ includes.
* nat/linux-personality.c: Fix common/ includes.
* nat/linux-osdata.c: Fix common/ includes.
* nat/linux-namespaces.c: Fix common/ includes.
* nat/linux-btrace.h: Fix common/ includes.
* nat/linux-btrace.c: Fix common/ includes.
* nat/fork-inferior.c: Fix common/ includes.
* nat/amd64-linux-siginfo.c: Fix common/ includes.
* nat/aarch64-sve-linux-ptrace.c: Fix common/ includes.
* nat/aarch64-linux.c: Fix common/ includes.
* nat/aarch64-linux-hw-point.h: Fix common/ includes.
* nat/aarch64-linux-hw-point.c: Fix common/ includes.
* namespace.h: Fix common/ includes.
* mips-linux-tdep.c: Fix common/ includes.
* minsyms.c: Fix common/ includes.
* mi/mi-parse.h: Fix common/ includes.
* mi/mi-main.c: Fix common/ includes.
* mi/mi-cmd-env.c: Fix common/ includes.
* memrange.h: Fix common/ includes.
* memattr.c: Fix common/ includes.
* maint.h: Fix common/ includes.
* maint.c: Fix common/ includes.
* main.c: Fix common/ includes.
* machoread.c: Fix common/ includes.
* location.c: Fix common/ includes.
* linux-thread-db.c: Fix common/ includes.
* linux-nat.c: Fix common/ includes.
* linux-fork.c: Fix common/ includes.
* inline-frame.c: Fix common/ includes.
* infrun.c: Fix common/ includes.
* inflow.c: Fix common/ includes.
* inferior.h: Fix common/ includes.
* inferior.c: Fix common/ includes.
* infcmd.c: Fix common/ includes.
* inf-ptrace.c: Fix common/ includes.
* inf-child.c: Fix common/ includes.
* ia64-linux-nat.c: Fix common/ includes.
* i387-tdep.c: Fix common/ includes.
* i386-tdep.c: Fix common/ includes.
* i386-linux-tdep.c: Fix common/ includes.
* i386-linux-nat.c: Fix common/ includes.
* i386-go32-tdep.c: Fix common/ includes.
* i386-fbsd-tdep.c: Fix common/ includes.
* i386-fbsd-nat.c: Fix common/ includes.
* guile/scm-type.c: Fix common/ includes.
* guile/guile.c: Fix common/ includes.
* go32-nat.c: Fix common/ includes.
* gnu-nat.c: Fix common/ includes.
* gdbthread.h: Fix common/ includes.
* gdbarch-selftests.c: Fix common/ includes.
* gdb_usleep.c: Fix common/ includes.
* gdb_select.h: Fix common/ includes.
* gdb_bfd.c: Fix common/ includes.
* gcore.c: Fix common/ includes.
* fork-child.c: Fix common/ includes.
* findvar.c: Fix common/ includes.
* fbsd-nat.c: Fix common/ includes.
* event-top.c: Fix common/ includes.
* event-loop.c: Fix common/ includes.
* dwarf2read.c: Fix common/ includes.
* dwarf2loc.c: Fix common/ includes.
* dwarf2-frame.c: Fix common/ includes.
* dwarf-index-cache.c: Fix common/ includes.
* dtrace-probe.c: Fix common/ includes.
* disasm-selftests.c: Fix common/ includes.
* defs.h: Fix common/ includes.
* csky-tdep.c: Fix common/ includes.
* cp-valprint.c: Fix common/ includes.
* cp-support.h: Fix common/ includes.
* cp-support.c: Fix common/ includes.
* corelow.c: Fix common/ includes.
* completer.h: Fix common/ includes.
* completer.c: Fix common/ includes.
* compile/compile.c: Fix common/ includes.
* compile/compile-loc2c.c: Fix common/ includes.
* compile/compile-cplus-types.c: Fix common/ includes.
* compile/compile-cplus-symbols.c: Fix common/ includes.
* command.h: Fix common/ includes.
* cli/cli-dump.c: Fix common/ includes.
* cli/cli-cmds.c: Fix common/ includes.
* charset.c: Fix common/ includes.
* build-id.c: Fix common/ includes.
* btrace.h: Fix common/ includes.
* btrace.c: Fix common/ includes.
* breakpoint.h: Fix common/ includes.
* breakpoint.c: Fix common/ includes.
* ax.h:
(enum agent_op): Fix common/ includes.
* ax-general.c (struct aop_map): Fix common/ includes.
* ax-gdb.c: Fix common/ includes.
* auxv.c: Fix common/ includes.
* auto-load.c: Fix common/ includes.
* arm-tdep.c: Fix common/ includes.
* arch/riscv.c: Fix common/ includes.
* arch/ppc-linux-common.c: Fix common/ includes.
* arch/i386.c: Fix common/ includes.
* arch/arm.c: Fix common/ includes.
* arch/arm-linux.c: Fix common/ includes.
* arch/arm-get-next-pcs.c: Fix common/ includes.
* arch/amd64.c: Fix common/ includes.
* arch/aarch64.c: Fix common/ includes.
* arch/aarch64-insn.c: Fix common/ includes.
* arch-utils.c: Fix common/ includes.
* amd64-windows-tdep.c: Fix common/ includes.
* amd64-tdep.c: Fix common/ includes.
* amd64-sol2-tdep.c: Fix common/ includes.
* amd64-obsd-tdep.c: Fix common/ includes.
* amd64-nbsd-tdep.c: Fix common/ includes.
* amd64-linux-tdep.c: Fix common/ includes.
* amd64-linux-nat.c: Fix common/ includes.
* amd64-fbsd-tdep.c: Fix common/ includes.
* amd64-fbsd-nat.c: Fix common/ includes.
* amd64-dicos-tdep.c: Fix common/ includes.
* amd64-darwin-tdep.c: Fix common/ includes.
* agent.c: Fix common/ includes.
* ada-lang.h: Fix common/ includes.
* ada-lang.c: Fix common/ includes.
* aarch64-tdep.c: Fix common/ includes.
2019-01-25 Tom Tromey <tom@tromey.com>
* common/create-version.sh: Use common/version.h.
target_pass_signals/target_program_signals: Use gdb::array_view This replaces the pointer and length parameters of target_pass_signals and target_program_signals with a gdb::array_view parameter, and fixes the fallout. In infrun.c, the signal_stop, signal_print, signal_program, signal_catch, signal_pass globals are currently pointers to heap-allocated memory. I see no point in that, so I converted them to arrays. This allows simplifying the calls to target_pass_signals/target_program_signals, since we can pass the array directly, which can implicitly convert to gdb::array_view. gdb/ChangeLog: 2019-01-24 Pedro Alves <palves@redhat.com> * infrun.c (signal_stop, signal_print, signal_program) (signal_catch, signal_pass): Now arrays instead of pointers. (update_signals_program_target, do_target_resume) (signal_catch_update, handle_command, _initialize_infrun): Adjust. * linux-nat.c (linux_nat_target::pass_signals) (linux_nat_target::create_inferior, linux_nat_target::attach): Adjust. * linux-nat.h (linux_nat_target::pass_signals): Adjust. * nto-procfs.c (nto_procfs_target::pass_signals): Adjust. * procfs.c (procfs_target::pass_signals): Adjust. * record-full.c (record_full_target::resume): Adjust. * remote.c (remote_target::pass_signals) (remote_target::program_signals): Adjust. * target-debug.h (target_debug_print_signals): Now takes a gdb::array_view as parameter. Adjust. * target.h (target_ops) <pass_signals, program_signals>: Replace pointer and length parameters with gdb::array_view. (target_pass_signals, target_program_signals): Likewise. * target-delegates.c: Regenerate.
2019-01-24 19:25:06 +01:00
2019-01-24 Pedro Alves <palves@redhat.com>
* infrun.c (signal_stop, signal_print, signal_program)
(signal_catch, signal_pass): Now arrays instead of pointers.
(update_signals_program_target, do_target_resume)
(signal_catch_update, handle_command, _initialize_infrun): Adjust.
* linux-nat.c (linux_nat_target::pass_signals)
(linux_nat_target::create_inferior, linux_nat_target::attach):
Adjust.
* linux-nat.h (linux_nat_target::pass_signals): Adjust.
* nto-procfs.c (nto_procfs_target::pass_signals): Adjust.
* procfs.c (procfs_target::pass_signals): Adjust.
* record-full.c (record_full_target::resume): Adjust.
* remote.c (remote_target::pass_signals)
(remote_target::program_signals): Adjust.
* target-debug.h (target_debug_print_signals): Now takes a
gdb::array_view as parameter. Adjust.
* target.h (target_ops) <pass_signals, program_signals>: Replace
pointer and length parameters with gdb::array_view.
(target_pass_signals, target_program_signals): Likewise.
* target-delegates.c: Regenerate.
Fix clang/libc++ build This fixes the following build error with clang/libc++, reported at <https://sourceware.org/ml/gdb-patches/2019-01/msg00537.html>: (...) In file included from breakpoint.c:34: In file included from ./inferior.h:54: ./common/forward-scope-exit.h:98:7: error: no matching constructor for initialization of 'decltype(std::bind(&delete_longjmp_breakpoint, std::declval<int>()))' (aka '__bind<void (*)(int), int>') : m_bind_function (std::bind (function, args...)) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./common/gdb_optional.h:155:19: note: in instantiation of member function 'detail::forward_scope_exit<void (int), &delete_longjmp_breakpoint, void (int)>::forward_scope_exit' requested here new (&m_item) T (std::forward<Args>(args)...); ^ breakpoint.c:11127:18: note: in instantiation of function template specialization 'gdb::optional<detail::forward_scope_exit<void (int), &delete_longjmp_breakpoint, void (int)> >::emplace<int &>' requested here lj_deleter.emplace (thread); ^ /Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:2220:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from '__bind<[...], int &>' to 'const __bind<[...], int>' for 1st argument class __bind ^ (...) I don't really know why I ended up with a copy here. We can just pass the arguments directly to the being-constructed bind. gdb/ChangeLog: 2019-01-24 Pedro Alves <palves@redhat.com> * common/forward-scope-exit.h (forward_scope_exit::forward_scope_exit): Pass arguments to m_bind_function directly, instead of creating a std::bind and copying that.
2019-01-24 19:01:49 +01:00
2019-01-24 Pedro Alves <palves@redhat.com>
* common/forward-scope-exit.h
(forward_scope_exit::forward_scope_exit): Pass arguments to
m_bind_function directly, instead of creating a std::bind and
copying that.
AArch64 AAPCS: Ignore static members Static members in C++ structs are global data and therefore not part of the list of struct members considered for passing in registers. Note the corresponding code in GCC (from which the GDB AAPCS code is based) does not have any static member checks due to the static members not being part of the struct type at that point. Extend gdb.base/infcall-nested-structs.exp to test structs with static members when compiled for C++. XFAIL more cases for x86_64 (see gdb/24104). For completeness, ensure some test cases have both empty structures and static members. Also fixes gdb.dwarf2/dw2-cp-infcall-ref-static.exp. gdb/ChangeLog: * aarch64-tdep.c (aapcs_is_vfp_call_or_return_candidate_1): Check for static members. (pass_in_v_vfp_candidate): Likewise. gdb/testsuite/ChangeLog: * gdb.base/infcall-nested-structs.c (struct struct_static_02_01): New structure. (struct struct_static_02_02): Likewise. (struct struct_static_02_03): Likewise. (struct struct_static_02_04): Likewise. (struct struct_static_04_01): Likewise. (struct struct_static_04_02): Likewise. (struct struct_static_04_03): Likewise. (struct struct_static_04_04): Likewise. (struct struct_static_06_01): Likewise. (struct struct_static_06_02): Likewise. (struct struct_static_06_03): Likewise. (struct struct_static_06_04): Likewise. (cmp_struct_static_02_01): Likewise. (cmp_struct_static_02_02): Likewise. (cmp_struct_static_02_03): Likewise. (cmp_struct_static_02_04): Likewise. (cmp_struct_static_04_01): Likewise. (cmp_struct_static_04_02): Likewise. (cmp_struct_static_04_03): Likewise. (cmp_struct_static_04_04): Likewise. (cmp_struct_static_06_01): Likewise. (cmp_struct_static_06_02): Likewise. (cmp_struct_static_06_03): Likewise. (cmp_struct_static_06_04): Likewise. (call_all): Test new structs. * gdb.base/infcall-nested-structs.exp: Likewise.
2019-01-24 09:17:39 +01:00
2019-01-24 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aapcs_is_vfp_call_or_return_candidate_1): Check
for static members.
(pass_in_v_vfp_candidate): Likewise.
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* regcache.c (class regcache_invalidator): Remove.
(regcache::raw_write): Use make_scope_exit.
2019-01-23 Tom Tromey <tom@tromey.com>
* ui-out.h (class ui_out_emit_type): Update comment.
2019-01-23 Tom Tromey <tom@tromey.com>
* infrun.c (fetch_inferior_event): Update comment.
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* infrun.c (reinstall_readline_callback_handler_cleanup): Remove
parameter.
(fetch_inferior_event): Use SCOPE_EXIT.
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* infrun.c (disable_thread_events): Delete.
(stop_all_threads): Use SCOPE_EXIT.
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* symfile.c: Include forward-scope-exit.h.
(clear_symtab_users_cleanup): Replace forward declaration with
a FORWARD_SCOPE_EXIT.
(syms_from_objfile_1): Use the forward_scope_exit and
gdb::optional instead of cleanup_function.
(reread_symbols): Use the forward_scope_exit instead of
cleanup_function.
(clear_symtab_users_cleanup): Remove function.
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* linux-nat.c: Include scope-exit.h.
(cleanup_target_stop): Remove.
(linux_nat_target::static_tracepoint_markers_by_strid): Use
SCOPE_EXIT.
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* infcall.c (cleanup_delete_std_terminate_breakpoint): Remove.
(call_function_by_hand_dummy): Use SCOPE_EXIT.
2019-01-23 Tom Tromey <tom@tromey.com>
Andrew Burgess <andrew.burgess@embecosm.com>
Pedro Alves <palves@redhat.com>
* infrun.c (fetch_inferior_event): Use scope_exit.
* utils.h (make_bpstat_clear_actions_cleanup): Don't declare.
* top.c (execute_command): Use scope_exit.
* breakpoint.c (bpstat_do_actions): Use scope_exit.
* utils.c (do_bpstat_clear_actions_cleanup)
(make_bpstat_clear_actions_cleanup): Remove.
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* infrun.c: Include "common/scope-exit.h"
(delete_just_stopped_threads_infrun_breakpoints_cleanup): Remove.
(wait_for_inferior): Use SCOPE_EXIT.
(fetch_inferior_event): Use scope_exit.
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* breakpoint.c (create_breakpoint): Remove cleanup.
2019-01-23 Tom Tromey <tom@tromey.com>
Andrew Burgess <andrew.burgess@embecosm.com>
Pedro Alves <palves@redhat.com>
2019-01-23 Pedro Alves <palves@redhat.com>
* gdbarch-selftests.c (struct on_exit): Use SCOPE_EXIT.
2019-01-23 Pedro Alves <palves@redhat.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* gdbthread.h: Include "common/forward-scope-exit.h".
(scoped_finish_thread_state): Redefine custom class in terms of
forward_scope_exit.
2019-01-23 Pedro Alves <palves@redhat.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* common/forward-scope-exit.h: New file.
2019-01-23 Pedro Alves <palves@redhat.com>
Andrew Burgess <andrew.burgess@embecosm.com>
Tom Tromey <tom@tromey.com>
* common/scope-exit.h: New file.
2019-01-23 Pedro Alves <palves@redhat.com>
* common/preprocessor.h (ESC): Rename to ...
(ESC_PARENS): ... this.
* common/valid-expr.h (CHECK_VALID_EXPR_1, CHECK_VALID_EXPR_2)
(CHECK_VALID_EXPR_3, CHECK_VALID_EXPR_4): Adjust.
2019-01-23 Tom Tromey <tom@tromey.com>
* language.h (class scoped_switch_to_sym_language_if_auto):
Initialize m_lang in both cases.
2019-01-23 Alan Hayward <alan.hayward@arm.com>
* nat/aarch64-linux.c (aarch64_linux_new_thread): Replace XNEW
with XCNEW.
2019-01-22 Tom Tromey <tom@tromey.com>
* corelow.c: Do not include sys/file.h.
2019-01-22 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h: Include gdb_curses.h.
2019-01-22 Tom Tromey <tom@tromey.com>
* source-cache.h (class source_cache) <get_source_lines,
get_plain_source_lines, extract_lines>: Rename "lines" parameter.
2019-01-22 Tom Tromey <tom@tromey.com>
* remote-fileio.h (struct remote_target): Declare.
Do not include py-ref.h in most files py-ref.h can really only be included from a specific spot in python-internal.h. The other includes are not useful, and cause compilation errors if the includes are ever sorted. So, remove these includes. Arguably, py-ref.h should simply not be a separate header. gdb/ChangeLog 2019-01-22 Tom Tromey <tom@tromey.com> * python/py-arch.c: Do not include py-ref.h. * python/py-bpevent.c: Do not include py-ref.h. * python/py-cmd.c: Do not include py-ref.h. * python/py-continueevent.c: Do not include py-ref.h. * python/py-event.h: Do not include py-ref.h. * python/py-evtregistry.c: Do not include py-ref.h. * python/py-finishbreakpoint.c: Do not include py-ref.h. * python/py-frame.c: Do not include py-ref.h. * python/py-framefilter.c: Do not include py-ref.h. * python/py-function.c: Do not include py-ref.h. * python/py-infevents.c: Do not include py-ref.h. * python/py-linetable.c: Do not include py-ref.h. * python/py-objfile.c: Do not include py-ref.h. * python/py-param.c: Do not include py-ref.h. * python/py-prettyprint.c: Do not include py-ref.h. * python/py-progspace.c: Do not include py-ref.h. * python/py-symbol.c: Do not include py-ref.h. * python/py-symtab.c: Do not include py-ref.h. * python/py-type.c: Do not include py-ref.h. * python/py-unwind.c: Do not include py-ref.h. * python/py-utils.c: Do not include py-ref.h. * python/py-value.c: Do not include py-ref.h. * python/py-varobj.c: Do not include py-ref.h. * python/py-xmethods.c: Do not include py-ref.h. * python/python.c: Do not include py-ref.h. * varobj.c: Do not include py-ref.h.
2019-01-21 21:49:06 +01:00
2019-01-22 Tom Tromey <tom@tromey.com>
* python/py-arch.c: Do not include py-ref.h.
* python/py-bpevent.c: Do not include py-ref.h.
* python/py-cmd.c: Do not include py-ref.h.
* python/py-continueevent.c: Do not include py-ref.h.
* python/py-event.h: Do not include py-ref.h.
* python/py-evtregistry.c: Do not include py-ref.h.
* python/py-finishbreakpoint.c: Do not include py-ref.h.
* python/py-frame.c: Do not include py-ref.h.
* python/py-framefilter.c: Do not include py-ref.h.
* python/py-function.c: Do not include py-ref.h.
* python/py-infevents.c: Do not include py-ref.h.
* python/py-linetable.c: Do not include py-ref.h.
* python/py-objfile.c: Do not include py-ref.h.
* python/py-param.c: Do not include py-ref.h.
* python/py-prettyprint.c: Do not include py-ref.h.
* python/py-progspace.c: Do not include py-ref.h.
* python/py-symbol.c: Do not include py-ref.h.
* python/py-symtab.c: Do not include py-ref.h.
* python/py-type.c: Do not include py-ref.h.
* python/py-unwind.c: Do not include py-ref.h.
* python/py-utils.c: Do not include py-ref.h.
* python/py-value.c: Do not include py-ref.h.
* python/py-varobj.c: Do not include py-ref.h.
* python/py-xmethods.c: Do not include py-ref.h.
* python/python.c: Do not include py-ref.h.
* varobj.c: Do not include py-ref.h.
2019-01-22 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage): Use "struct"
keyword for bcache.
2019-01-22 Tom Tromey <tom@tromey.com>
* compile/compile-cplus-types.c: Remove a comment by #include.
2019-01-22 Tom Tromey <tom@tromey.com>
* compile/gcc-c-plugin.h: Include compile-internal.h.
2019-01-22 Tom Tromey <tom@tromey.com>
* stabsread.c (EXTERN): Do not define.
(symnum, next_symbol_text_func, processing_gcc_compilation)
(within_function, global_sym_chain, global_stabs)
(previous_stab_code, this_object_header_files)
(n_this_object_header_files)
(n_allocated_this_object_header_files): Define.
* stabsread.h (EXTERN): Never define. Use "extern".
2019-01-22 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* event-top.c (handle_line_of_input): use unique_xmalloc_ptr for
history_value.
2019-01-21 Tom Tromey <tom@tromey.com>
* ui-out.c: Fix includes.
* tui/tui-source.c: Fix includes.
* target.c: Fix includes.
* remote.c: Fix includes.
* regcache.c: Fix includes.
* python/py-block.c: Fix includes.
* printcmd.c: Fix includes.
* or1k-tdep.c: Fix includes.
* mi/mi-main.c: Fix includes.
* m32r-tdep.c: Fix includes.
* csky-tdep.c: Fix includes.
* compile/compile-cplus-types.c: Fix includes.
* cli/cli-interp.c: Fix includes.
2019-01-21 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (aapcs_is_vfp_call_or_return_candidate_1): Check
for padding.
2019-01-16 Tom Tromey <tom@tromey.com>
* objfiles.h (struct minimal_symbol_iterator): Rename. Move
earlier.
(struct objfile) <msymbols_range>: Move from top level.
<msymbols>: New method.
(class objfile_msymbols): Remove.
* symtab.c (default_collect_symbol_completion_matches_break_on):
Update.
* symmisc.c (dump_msymbols): Update.
* stabsread.c (scan_file_globals): Update.
* objc-lang.c (info_selectors_command, info_classes_command)
(find_methods): Update.
* minsyms.c (find_solib_trampoline_target): Update.
* hppa-tdep.c (hppa_lookup_stub_minimal_symbol): Update.
* coffread.c (coff_symfile_read): Update.
* ada-lang.c (ada_lookup_simple_minsym)
(ada_collect_symbol_completion_matches): Update.
2019-01-16 Tom Tromey <tom@tromey.com>
* objfiles.h (class objfile_msymbols) <iterator>: Change argument
type. Remove no-argument constructor.
<iterator::operator++>: Simplify.
<begin>: Update.
<end>: Use minimal_symbol_count.
2019-01-16 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile) <psymtabs>: New method.
(class objfile_psymtabs): Remove.
* psymtab.h (class psymtab_storage) <partial_symtab_range>: New
typedef.
<range>: New method.
(require_partial_symbols): Change return type.
* psymtab.c (require_partial_symbols)
(psym_expand_symtabs_matching): Update.
* mdebugread.c (parse_partial_symbols): Update.
* dbxread.c (dbx_end_psymtab): Update.
2019-01-15 Tom Tromey <tom@tromey.com>
* symtab.c (lookup_objfile_from_block)
(lookup_symbol_in_objfile_symtabs)
(basic_lookup_transparent_type_1, find_pc_sect_compunit_symtab)
(find_line_symtab, info_sources_command)
(default_collect_symbol_completion_matches_break_on)
(make_source_files_completion_list): Update.
* symmisc.c (print_objfile_statistics, dump_objfile)
(maintenance_print_symbols, maintenance_info_symtabs)
(maintenance_check_symtabs, maintenance_info_line_tables):
Update.
* source.c (select_source_symtab)
(forget_cached_source_info_for_objfile): Update.
* objfiles.h (class objfile_compunits): Remove.
(struct objfile) <compunits_range>: New typedef.
(compunits): New method.
* objfiles.c (objfile_relocate1): Update.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update.
* maint.c (count_symtabs_and_blocks): Update.
* linespec.c (iterate_over_all_matching_symtabs): Update.
* cp-support.c (add_symbol_overload_list_qualified): Update.
* coffread.c (coff_symtab_read): Update.
* ada-lang.c (add_nonlocal_symbols)
(ada_collect_symbol_completion_matches)
(ada_add_global_exceptions): Update.
2019-01-15 Tom Tromey <tom@tromey.com>
* progspace.h (program_space) <objfiles_safe_range>: New
typedef.
<objfiles_safe>: New method.
* objfiles.h (class all_objfiles_safe): Remove.
* objfiles.c (free_all_objfiles, objfile_purge_solibs): Update.
* jit.c (jit_inferior_exit_hook): Update.
Change all_objfiles adapter to be a method on program_space This changes the all_objfiles range adapter to be a method on the program space, and fixes up all the users. gdb/ChangeLog 2019-01-17 Tom Tromey <tom@tromey.com> * progspace.h (program_space) <objfiles_range>: New typedef. <objfiles>: New method. <objfiles_head>: Rename from objfiles. (object_files): Update. * guile/scm-progspace.c (gdbscm_progspace_objfiles): Update. * guile/scm-pretty-print.c (ppscm_find_pretty_printer_from_objfiles): Update. * guile/scm-objfile.c (gdbscm_objfiles): Update. * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): Update. * python/py-progspace.c (pspy_get_objfiles): Update. * python/py-prettyprint.c (find_pretty_printer_from_objfiles): Update. * python/py-objfile.c (objfpy_lookup_objfile_by_name) (objfpy_lookup_objfile_by_build_id): Update. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update. * windows-tdep.c (windows_iterate_over_objfiles_in_search_order): Update. * symtab.c (iterate_over_symtabs, matching_obj_sections) (expand_symtab_containing_pc, lookup_objfile_from_block) (lookup_static_symbol, basic_lookup_transparent_type) (find_pc_sect_compunit_symtab, find_symbol_at_address) (find_line_symtab, info_sources_command) (default_collect_symbol_completion_matches_break_on) (make_source_files_completion_list, find_main_name): Update. * symmisc.c (print_symbol_bcache_statistics) (print_objfile_statistics, maintenance_print_symbols) (maintenance_print_msymbols, maintenance_print_objfiles) (maintenance_info_symtabs, maintenance_check_symtabs) (maintenance_expand_symtabs, maintenance_info_line_tables): Update. * symfile.c (remove_symbol_file_command, overlay_invalidate_all) (find_pc_overlay, find_pc_mapped_section, list_overlays_command) (map_overlay_command, unmap_overlay_command) (simple_overlay_update, expand_symtabs_matching) (map_symbol_filenames): Update. * symfile-debug.c (set_debug_symfile): Update. * spu-tdep.c (spu_overlay_update, spu_objfile_from_frame): Update. * source.c (select_source_symtab, forget_cached_source_info): Update. * solib.c (solib_read_symbols): Update. * solib-spu.c (append_ocl_sos): Update. * psymtab.c (maintenance_print_psymbols) (maintenance_info_psymtabs, maintenance_check_psymtabs): Update. * probe.c (parse_probes_in_pspace, find_probe_by_pc): Update. * printcmd.c (info_symbol_command): Update. * ppc-linux-tdep.c (ppc_linux_spe_context_inferior_created): Update. * objfiles.h (class all_objfiles): Remove. * objfiles.c (have_partial_symbols, have_full_symbols) (have_minimal_symbols, qsort_cmp, update_section_map) (shared_objfile_contains_address_p) (default_iterate_over_objfiles_in_search_order): Update. * objc-lang.c (info_selectors_command, info_classes_command) (find_methods): Update. * minsyms.c (find_solib_trampoline_target): Update. * maint.c (maintenance_info_sections) (maintenance_translate_address, count_symtabs_and_blocks): Update. * main.c (captured_main_1): Update. * linux-thread-db.c (try_thread_db_load_from_pdir) (has_libpthread): Update. * linespec.c (iterate_over_all_matching_symtabs) (search_minsyms_for_name): Update. * jit.c (jit_find_objf_with_entry_addr): Update. * hppa-tdep.c (find_unwind_entry) (hppa_lookup_stub_minimal_symbol): Update. * gcore.c (gcore_create_callback, objfile_find_memory_regions): Update. * elfread.c (elf_gnu_ifunc_resolve_by_cache) (elf_gnu_ifunc_resolve_by_got): Update. * dwarf2-frame.c (dwarf2_frame_find_fde): Update. * dwarf-index-write.c (save_gdb_index_command): Update. * cp-support.c (add_symbol_overload_list_qualified): Update. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Update. * blockframe.c (find_pc_partial_function): Update. * ada-lang.c (ada_lookup_simple_minsym, add_nonlocal_symbols) (ada_collect_symbol_completion_matches) (ada_add_global_exceptions): Update.
2019-01-16 00:55:05 +01:00
2019-01-17 Tom Tromey <tom@tromey.com>
* progspace.h (program_space) <objfiles_range>: New typedef.
<objfiles>: New method.
<objfiles_head>: Rename from objfiles.
(object_files): Update.
* guile/scm-progspace.c (gdbscm_progspace_objfiles): Update.
* guile/scm-pretty-print.c
(ppscm_find_pretty_printer_from_objfiles): Update.
* guile/scm-objfile.c (gdbscm_objfiles): Update.
* python/py-xmethods.c (gdbpy_get_matching_xmethod_workers):
Update.
* python/py-progspace.c (pspy_get_objfiles): Update.
* python/py-prettyprint.c (find_pretty_printer_from_objfiles):
Update.
* python/py-objfile.c (objfpy_lookup_objfile_by_name)
(objfpy_lookup_objfile_by_build_id): Update.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update.
* windows-tdep.c (windows_iterate_over_objfiles_in_search_order):
Update.
* symtab.c (iterate_over_symtabs, matching_obj_sections)
(expand_symtab_containing_pc, lookup_objfile_from_block)
(lookup_static_symbol, basic_lookup_transparent_type)
(find_pc_sect_compunit_symtab, find_symbol_at_address)
(find_line_symtab, info_sources_command)
(default_collect_symbol_completion_matches_break_on)
(make_source_files_completion_list, find_main_name): Update.
* symmisc.c (print_symbol_bcache_statistics)
(print_objfile_statistics, maintenance_print_symbols)
(maintenance_print_msymbols, maintenance_print_objfiles)
(maintenance_info_symtabs, maintenance_check_symtabs)
(maintenance_expand_symtabs, maintenance_info_line_tables):
Update.
* symfile.c (remove_symbol_file_command, overlay_invalidate_all)
(find_pc_overlay, find_pc_mapped_section, list_overlays_command)
(map_overlay_command, unmap_overlay_command)
(simple_overlay_update, expand_symtabs_matching)
(map_symbol_filenames): Update.
* symfile-debug.c (set_debug_symfile): Update.
* spu-tdep.c (spu_overlay_update, spu_objfile_from_frame):
Update.
* source.c (select_source_symtab, forget_cached_source_info):
Update.
* solib.c (solib_read_symbols): Update.
* solib-spu.c (append_ocl_sos): Update.
* psymtab.c (maintenance_print_psymbols)
(maintenance_info_psymtabs, maintenance_check_psymtabs): Update.
* probe.c (parse_probes_in_pspace, find_probe_by_pc): Update.
* printcmd.c (info_symbol_command): Update.
* ppc-linux-tdep.c (ppc_linux_spe_context_inferior_created):
Update.
* objfiles.h (class all_objfiles): Remove.
* objfiles.c (have_partial_symbols, have_full_symbols)
(have_minimal_symbols, qsort_cmp, update_section_map)
(shared_objfile_contains_address_p)
(default_iterate_over_objfiles_in_search_order): Update.
* objc-lang.c (info_selectors_command, info_classes_command)
(find_methods): Update.
* minsyms.c (find_solib_trampoline_target): Update.
* maint.c (maintenance_info_sections)
(maintenance_translate_address, count_symtabs_and_blocks):
Update.
* main.c (captured_main_1): Update.
* linux-thread-db.c (try_thread_db_load_from_pdir)
(has_libpthread): Update.
* linespec.c (iterate_over_all_matching_symtabs)
(search_minsyms_for_name): Update.
* jit.c (jit_find_objf_with_entry_addr): Update.
* hppa-tdep.c (find_unwind_entry)
(hppa_lookup_stub_minimal_symbol): Update.
* gcore.c (gcore_create_callback, objfile_find_memory_regions):
Update.
* elfread.c (elf_gnu_ifunc_resolve_by_cache)
(elf_gnu_ifunc_resolve_by_got): Update.
* dwarf2-frame.c (dwarf2_frame_find_fde): Update.
* dwarf-index-write.c (save_gdb_index_command): Update.
* cp-support.c (add_symbol_overload_list_qualified): Update.
* breakpoint.c (create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint): Update.
* blockframe.c (find_pc_partial_function): Update.
* ada-lang.c (ada_lookup_simple_minsym, add_nonlocal_symbols)
(ada_collect_symbol_completion_matches)
(ada_add_global_exceptions): Update.
2019-01-17 Tom Tromey <tom@tromey.com>
* solib-target.c (lm_info_target_p): Remove typedef. Don't
declare VEC.
(solib_target_parse_libraries): Change return type.
(library_list_start_segment, library_list_start_section)
(library_list_end_library, library_list_start_library); Update.
(solib_target_free_library_list): Remove.
(solib_target_parse_libraries): Remove cleanup. Change return
type.
(solib_target_current_sos): Update.
2019-01-17 Tom Tromey <tromey@bapiya>
* valprint.c: Replace "the the" with "the".
* symtab.c: Replace "the the" with "the".
* solib.c: Replace "the the" with "the".
* solib-dsbt.c: Replace "the the" with "the".
* linespec.c: Replace "the the" with "the".
* dwarf2loc.h: Replace "the the" with "the".
* amd64-windows-tdep.c: Replace "the the" with "the".
* aarch64-tdep.c: Replace "the the" with "the".
Introduce dwarf2_cu::get_builder This patch is an attempt to deal with a variety of bugs reported where GDB segfaults attempting to access a dwarf2_cu's builder. In certain circumstances, this builder can be NULL. This is especially common when inheriting DIEs via inlined subroutines in other CUs. The test case demonstrates one such situation reported by users. See gdb/23773, rhbz1638798, and dups for other concrete examples. The approach taken here is to save the ancestor CU into the dwarf2_cu of all CUs with DIEs that are "imported." This can happen whenever follow_die_offset and friends are called. This essentially introduces a chain of CUs that caused the importation of a DIE from a CU. Whenever a builder is requested of a CU that has none, the ancestors are searched for the first one with a builder. A design side effect of this is that the builder can now only be accessed by getter and setter methods because the builder itself is private. The bulk of the patch is relatively mindless text conversion from "cu->builder" to "cu->get_builder ()". I've included one test which was derived from one (of the many) bugs reported on the issue in both sourceware and Fedora bugzillas. gdb/ChangeLog: PR gdb/23773 * dwarf2read.c (dwarf2_cu) <ancestor>: New field. <builder>: Rename to .. <m_builder>: ... this and make private. (dwarf2_cu::get_builder): New method. Change all users of `builder' to use this method. (dwarf2_start_symtab): Move to ... (dwarf2_cu::start_symtab): ... here. Update all callers (setup_type_unit_groups): Move to ... (dwarf2_cu::setup_type_unit_groups): ... here. Update all callers. (dwarf2_cu::reset_builder): New method. (process_full_compunit, process_full_type_unit): Use dwarf2_cu::reset_builder. (follow_die_offset): Record the ancestor CU if it is different from the followed DIE's CU. (follow_die_sig_1): Likewise. gdb/testsuite/ChangeLog: PR gdb/23773 * gdb.dwarf2/inlined_subroutine-inheritance.exp: New file.
2019-01-16 20:38:06 +01:00
2019-01-16 Keith Seitz <keiths@redhat.com>
PR gdb/23773
* dwarf2read.c (dwarf2_cu) <ancestor>: New field.
<builder>: Rename to ..
<m_builder>: ... this and make private.
(dwarf2_cu::get_builder): New method. Change all users of
`builder' to use this method.
(dwarf2_start_symtab): Move to ...
(dwarf2_cu::start_symtab): ... here. Update all callers
(setup_type_unit_groups): Move to ...
(dwarf2_cu::setup_type_unit_groups): ... here. Update all
callers.
(dwarf2_cu::reset_builder): New method.
(process_full_compunit, process_full_type_unit): Use
dwarf2_cu::reset_builder.
(follow_die_offset): Record the ancestor CU if it is different
from the followed DIE's CU.
(follow_die_sig_1): Likewise.
2019-01-15 Tom Tromey <tom@tromey.com>
* remote.c (class remote_state) <buf>: Now a char_vector.
<buf_size>: Remove.
(remote_target::getpkt): Change type of buf. Remove sizeof_buf
parameter.
(remote_target::getpkt_or_notif_sane_1)
(remote_target::getpkt_sane)
(remote_target::getpkt_or_notif_sane): Likewise.
(class remote_target) <putpkt>: New overload.
(remote_target::read_frame): Change type of "buf_p". Remove
sizeof_p parameter.
(packet_ok): New overload.
(packet_check_result): New overload.
Update all uses.
2019-01-14 Tom Tromey <tom@tromey.com>
* remote-notif.c (handle_notification, remote_notif_ack)
(remote_notif_parse): Make "buf" const.
* remote-notif.h (struct notif_client) <parse, ack>: Make "buf"
const.
(remote_notif_parse, remote_notif_ack, handle_notification):
Likewise.
* remote.c (remote_notif_stop_parse): Make "buf" const.
(remote_target::remote_parse_stop_reply): Make "buf" const.
(remote_notif_stop_ack): Make "buf" const.
2019-01-14 Tom Tromey <tom@tromey.com>
* remote.c (remote_console_output): Make parameter const.
2019-01-14 Tom Tromey <tom@tromey.com>
* target-debug.h (target_debug_print_signals): Constify.
* nto-procfs.c (nto_procfs_target::pass_signals): Update.
* procfs.c (procfs_target::pass_signals): Update.
* linux-nat.c (linux_nat_target::pass_signals): Update.
* linux-nat.h (class linux_nat_target) <pass_signals>: Update.
* target-delegates.c: Rebuild.
* remote.c (remote_target::program_signals): Update.
(remote_target::pass_signals): Update.
* target.c (target_pass_signals): Constify argument.
(target_program_signals): Likewise.
* target.h (struct target_ops) <pass_signals, program_signals>:
Constify argument.
(target_pass_signals, target_program_signals): Constify argument.
2019-01-14 Tom Tromey <tom@tromey.com>
PR tui/28819:
* tui/tui-io.c (gdb_wgetch): Print \r when needed.
[PowerPC] Aliases for vector registers This patch defines pseudo-registers "v0" through "v31" as aliases that map to the corresponding raw "vr0" through "vr31" vector registers for Power. The motivation behind this is that although GDB defines these registers as "vrX", the disassembler prints them as "vX", e.g. as the operands in instructions such as "vaddubm v2,v1,v1". This can be confusing to users trying to print out the values of the operands while inspecting the disassembled code. The new aliases are made not to belong to any register group, to avoid duplicated values in "info register vector" and "info register all". The arch-specific rs6000_pseudo_register_reggroup_p function had previously been removed since the other pseudo-registers could have their groups inferred by their type. It restored with this patch to handle the aliases. Membership for the other pseudo-registers is still determined using the default function. A new tests checks that GDB prints the expected values of vector registers after they are filled by the inferior, by using both the raw names and the aliases. Two other existing tests are modified to also test the aliases. gdb/ChangeLog: 2019-01-14 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * ppc-tdep.h (struct gdbarch_tdep) <ppc_v0_alias_regnum>: New field. * rs6000-tdep.c: Include reggroups.h. (IS_V_ALIAS_PSEUDOREG): Define. (rs6000_register_name): Return names for the "vX" aliases. (rs6000_pseudo_register_type): Return type for the "vX" aliases. (rs6000_pseudo_register_reggroup_p): Restore. Handle "vX" aliases. Call default_register_reggroup_p for all other pseudo-registers. (v_alias_pseudo_register_read, v_alias_pseudo_register_write): New functions. (rs6000_pseudo_register_read, rs6000_pseudo_register_write): Handle "vX" aliases. (v_alias_pseudo_register_collect): New function. (rs6000_ax_pseudo_register_collect): Handle "vX" aliases. (rs6000_gdbarch_init): Initialize "vX" aliases as pseudo-registers. Restore registration of rs6000_pseudo_register_reggroup_p with set_tdesc_pseudo_register_reggroup_p. gdb/testsuite/ChangeLog: 2019-01-14 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.arch/vsx-regs.exp: Add tests that use the vector register aliases. * gdb.arch/altivec-regs.exp: Likewise. Fix indentation of two tests. * gdb.arch/powerpc-vector-regs.c: New file. * gdb.arch/powerpc-vector-regs.exp: New file. gdb/doc/ChangeLog: 2019-01-14 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * gdb.texinfo (PowerPC Features): Document the alias pseudo-registers for the org.gnu.gdb.power.altivec feature.
2019-01-14 20:28:53 +01:00
2019-01-14 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* ppc-tdep.h (struct gdbarch_tdep) <ppc_v0_alias_regnum>: New
field.
* rs6000-tdep.c: Include reggroups.h.
(IS_V_ALIAS_PSEUDOREG): Define.
(rs6000_register_name): Return names for the "vX" aliases.
(rs6000_pseudo_register_type): Return type for the "vX" aliases.
(rs6000_pseudo_register_reggroup_p): Restore. Handle "vX"
aliases. Call default_register_reggroup_p for all other
pseudo-registers.
(v_alias_pseudo_register_read, v_alias_pseudo_register_write):
New functions.
(rs6000_pseudo_register_read, rs6000_pseudo_register_write):
Handle "vX" aliases.
(v_alias_pseudo_register_collect): New function.
(rs6000_ax_pseudo_register_collect): Handle "vX" aliases.
(rs6000_gdbarch_init): Initialize "vX" aliases as
pseudo-registers. Restore registration of
rs6000_pseudo_register_reggroup_p with
set_tdesc_pseudo_register_reggroup_p.
2019-01-13 Max Filippov <jcmvbkbc@gmail.com>
* xtensa-linux-tdep.c (xtensa_linux_init_abi): Update
tdep->num_pseudo_regs. Add calls to set_gdbarch_num_regs and
set_gdbarch_num_pseudo_regs.
Implement help/show values for 'set|show style'. Currently, the behaviour is: (gdb) show style (gdb) set style (gdb) show style address (gdb) set style address (gdb) With this patch, the behaviour is: (gdb) show style style address background: The "address" background color is: none style address foreground: The "address" foreground color is: blue style address intensity: The "address" display intensity is: normal enabled: CLI output styling is enabled. style filename background: The "filename" background color is: none style filename foreground: The "filename" foreground color is: green style filename intensity: The "filename" display intensity is: normal style function background: The "function" background color is: none style function foreground: The "function" foreground color is: yellow style function intensity: The "function" display intensity is: normal style variable background: The "variable" background color is: none style variable foreground: The "variable" foreground color is: cyan style variable intensity: The "variable" display intensity is: normal (gdb) set style "set style" must be followed by an appropriate subcommand. List of set style subcommands: set style address -- Address display styling set style enabled -- Set whether CLI styling is enabled set style filename -- Filename display styling set style function -- Function name display styling set style variable -- Variable name display styling Type "help set style" followed by set style subcommand name for full documentation. Type "apropos word" to search for commands related to "word". Command name abbreviations are allowed if unambiguous. (gdb) show style address background: The "filename" background color is: none foreground: The "filename" foreground color is: green intensity: The "filename" display intensity is: normal (gdb) set style address List of set style address subcommands: set style address background -- Set the background color for this property set style address foreground -- Set the foreground color for this property set style address intensity -- Set the display intensity color for this property Type "help set style address" followed by set style address subcommand name for full documentation. Type "apropos word" to search for commands related to "word". Command name abbreviations are allowed if unambiguous. (gdb) gdb/ChangeLog * cli/cli-style.h (class cli_style_option): <add_setshow_commands> Remove arg prefixname, add do_set and do_show. Add member functions set_list and show_list. * cli/cli-style.c (class cli_style_option): Update accordingly. (style_set_list): Move to file scope. (style_show_list): Likewise. (set_style): Call help_list. (show_style): Call cmd_show_list. (_initialize_cli_style): New macro STYLE_ADD_SETSHOW_COMMANDS. Update to use the new macro.
2018-12-31 14:37:09 +01:00
2019-01-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-style.h (class cli_style_option): <add_setshow_commands>
Remove arg prefixname, add do_set and do_show.
Add member functions set_list and show_list.
* cli/cli-style.c (class cli_style_option): Update accordingly.
(style_set_list): Move to file scope.
(style_show_list): Likewise.
(set_style): Call help_list.
(show_style): Call cmd_show_list.
(_initialize_cli_style): New macro STYLE_ADD_SETSHOW_COMMANDS.
Update to use the new macro.
2019-10-12 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (_initialize_ada_language): Expand the help text
for the "catch exception" command.
2019-01-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* symtab.c (matching_obj_sections): Initialize obj,
declare it closer to its usage.
2019-01-10 Tom Tromey <tom@tromey.com>
* thread-iter.h (inf_threads_iterator): Use next_iterator.
(basic_inf_threads_range): Remove.
(inf_threads_range, inf_non_exited_threads_range)
(safe_inf_threads_range): Use next_adapter.
2019-01-10 Keith Seitz <keiths@redhat.com>
PR gdb/23712
PR symtab/23010
* dwarf2read.c (dw2_add_symbol_to_list): Remove.
(fixup_go_packaging, new_symbol): Use add_symbol_to_list.
2019-01-10 Keith Seitz <keiths@redhat.com>
PR gdb/23712
PR symtab/23010
* dictionary.c (pending_to_vector): Remove.
(dict_create_hashed_1, dict_create_linear_1, dict_add_pending_1):
Remove _1 suffix, replacing functions of the same name. Update
all callers.
(dict_create_hashed, dict_create_hashed_expandable)
(dict_create_linear, dict_create_linear_expandable, dict_free)
(dict_add_symbol, dict_add_pending, dict_size, dict_empty):
Make functions static.
2019-01-10 Keith Seitz <keiths@redhat.com>
PR gdb/23712
PR symtab/23010
* dictionary.h (struct dictionary): Replace declaration with
multidictionary.
(dict_create_hashed, dict_create_hashed_expandable)
(dict_create_linear, dict_create_linear_expandable)
(dict_free, dict_add_symbol, dict_add_pending, dict_empty)
(dict_iterator_first, dict_iterator_next, dict_iter_match_first)
(dict_iter_match_next, dict_size): Rename to "mdict_" versions
taking multidictionary argument.
[ALL_DICT_SYMBOLS]: Update for multidictionary.
* block.h (struct block) <dict>: Change to multidictionary
and rename `multidict'.
* block.c, buildsym.c, jit.c, mdebugread.c, objfiles.c,
symmisc.c: Update all dictionary references to multidictionary.
gdb/23712: Introduce multidictionary's gdb/23712 is a new manifestation of the now-infamous (at least to me) symtab/23010 assertion failure (DICT_LANGUAGE == SYMBOL_LANGAUGE). An example of the problem (using test case from symtab/23010): Reading symbols from /home/rdiez/rdiez/arduino/JtagDue/BuildOutput/JtagDue-obj-release/firmware.elf...done. (gdb) p SysTick_Handler dwarf2read.c:9715: internal-error: void dw2_add_symbol_to_list(symbol*, pending**): Assertion `(*listhead) == NULL || (SYMBOL_LANGUAGE ((*listhead)->symbol[0]) == SYMBOL_LANGUAGE (symbol))' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) This assertion was added specifically to catch this condition (of adding symbols of different languages to a single pending list). The problems we're now seeing on systems utilizing DWARF debugging seem to be caused by the use of LTO, which adds a CU with an artificial DIE of language C99 which references DIEs in other CUs of language C++. Thus, we create a dictionary containing symbols of C99 but end up stuffing C++ symbols into it, and the dw2_add_symbol_to_list triggers. The approach taken here to fix this is to introduce multi-language dictionaries to "replace" the standard, single-language dictionaries used today. Note to reviewers: This patch introduces some temporary functions to aide with review. This and other artifacts (such as "See dictionary.h" which appear incorrect) will all be valid at the end of the series. This first patch introduces the new multidictionary and its API (which is, by design, identical to the old dictionary interface). It also mutates dict_create_hashed and dict_create_linear so that they take a std::vector instead of the usual struct pending linked list. This will be needed later on. This patch does /not/ actually enable multidictionary's. That is left for a subsequent patch in the series. I've done exhaustive performance testing with this approach, and I've attempted to minimize the overhead for the (overwhelmingly) most common one-language scenario. On average, a -g3 -O0 GDB (the one we developers use) will see approximately a 4% slowdown when initially reading symbols. [I've tested only GDB and firefox with -readnow.] When using -O2, this difference shrinks to ~0.5%. Since a number of runs with these patches actually run /faster/ than unpatched GDB, I conclude that these tests have at least a 0.5% error margin. On our own gdb.perf test suite, again, results appear to be pretty negligible. Differences to unpatched GDB range from -7.8% (yes, patched version is again faster than unpatched) to 27%. All tests lying outside "negligible," such as the 27% slowdown, involve a total run time of 0.0007 (or less) with smaller numbers of CUs/DSOs (usually 10 or 100). In all cases, the follow-up tests with more CUs/DSOs is never more than 3% difference to the baseline, unpatched GDB. In my opinion, these results are satisfactory. gdb/ChangeLog: PR gdb/23712 PR symtab/23010 * dictionary.c: Include unordered_map. (pending_to_vector): New function. (dict_create_hashed_1, dict_create_linear_1, dict_add_pending_1): Rewrite the non-"_1" functions to take vector instead of linked list. (dict_create_hashed, dict_create_linear, dict_add_pending): Use the "new" _1 versions of the same name. (multidictionary): Define. (std::hash<enum language): New definition. (collate_pending_symbols_by_language, mdict_create_hashed) (mdict_create_hashed_expandable, mdict_create_linear) (mdict_create_linear_expandable, mdict_free) (find_language_dictionary, create_new_language_dictionary) (mdict_add_symbol, mdict_add_pending, mdict_iterator_first) (mdict_iterator_next, mdict_iter_match_first, mdict_iter_match_next) (mdict_size, mdict_empty): New functions. * dictionary.h (mdict_iterator): Define.
2019-01-10 22:57:08 +01:00
2019-01-10 Keith Seitz <keiths@redhat.com>
PR gdb/23712
PR symtab/23010
* dictionary.c: Include unordered_map.
(pending_to_vector): New function.
(dict_create_hashed_1, dict_create_linear_1, dict_add_pending_1):
Rewrite the non-"_1" functions to take vector instead
of linked list.
(dict_create_hashed, dict_create_linear, dict_add_pending): Use the
"new" _1 versions of the same name.
(multidictionary): Define.
(std::hash<enum language): New definition.
(collate_pending_symbols_by_language, mdict_create_hashed)
(mdict_create_hashed_expandable, mdict_create_linear)
(mdict_create_linear_expandable, mdict_free)
(find_language_dictionary, create_new_language_dictionary)
(mdict_add_symbol, mdict_add_pending, mdict_iterator_first)
(mdict_iterator_next, mdict_iter_match_first, mdict_iter_match_next)
(mdict_size, mdict_empty): New functions.
* dictionary.h (mdict_iterator): Define.
Fix tracepoint.c:parse_tracepoint_definition leak (and one more) Coverity points out that gdb/tracepoint.c:parse_tracepoint_definition can leak 'cond' in this line: cond = (char *) xmalloc (2 * xlen + 1); That can leak because we're in a loop and 'cond' may have already been xmalloc'ed into in a previous iteration. That won't normally happen, because we don't expect to see a tracepoint definition with multiple conditions listed, but, it doesn't hurt to be pedantically correct, in case some stub manages to send something odd back to GDB. At first I thought I'd just replace the xmalloc call with: cond = (char *) xrealloc (cond, 2 * xlen + 1); and be done with it. However, my pedantic self realizes that warning() can throw as well (due to pagination + Ctrl-C), so I fixed it using gdb::unique_xmalloc_ptr instead. While doing this, I noticed that these vectors in struct uploaded_tp: std::vector<char *> actions; std::vector<char *> step_actions; hold heap-allocated strings, but nothing is freeing the strings, AFAICS. So I ended up switching all the heap-allocated strings in uploaded_tp to unique pointers. This patch is the result of that. I also wrote an alternative, but similar patch that uses std::string throughout instead of gdb::unique_xmalloc_ptr, but in the end reverted it because the code didn't look that much better, and I kind of dislike replacing pointers with fat std::string's (3 or 4 times the size of a pointer) in structures. gdb/ChangeLog: 2019-01-10 Pedro Alves <palves@redhat.com> * breakpoint.c (read_uploaded_action) (create_tracepoint_from_upload): Adjust to use gdb::unique_xmalloc_ptr. * ctf.c (ctf_write_uploaded_tp): (SET_ARRAY_FIELD): Use emplace_back. (SET_STRING_FIELD): Adjust to use gdb::unique_xmalloc_ptr. * tracefile-tfile.c (tfile_write_uploaded_tp): * tracepoint.c (parse_tracepoint_definition): Adjust to use gdb::unique_xmalloc_ptr. * tracepoint.h (struct uploaded_tp) <cond, actions, step_actions, at_string, cond_string, cmd_strings>: Replace char pointers with gdb::unique_xmalloc_ptr.
2019-01-10 18:52:39 +01:00
2019-01-10 Pedro Alves <palves@redhat.com>
* breakpoint.c (read_uploaded_action)
(create_tracepoint_from_upload): Adjust to use
gdb::unique_xmalloc_ptr.
* ctf.c (ctf_write_uploaded_tp):
(SET_ARRAY_FIELD): Use emplace_back.
(SET_STRING_FIELD): Adjust to use gdb::unique_xmalloc_ptr.
* tracefile-tfile.c (tfile_write_uploaded_tp):
* tracepoint.c (parse_tracepoint_definition): Adjust to use
gdb::unique_xmalloc_ptr.
* tracepoint.h (struct uploaded_tp) <cond, actions, step_actions,
at_string, cond_string, cmd_strings>: Replace char pointers
with gdb::unique_xmalloc_ptr.
2019-01-10 Pedro Alves <palves@redhat.com>
* solib-target.c (library_list_start_library): Don't xstrdup name.
2019-01-10 Pedro Alves <palves@redhat.com>
* mdebugread.c (parse_partial_symbols): Use
gdb::unique_xmalloc_ptr to manage heap-allocated 'stabsstring'.
2019-01-10 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-fork.c (scoped_switch_fork_info)
<~scoped_switch_fork_info>: Fix incorrect variable name.
2019-01-10 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-fork.c (scoped_switch_fork_info)
<scoped_switch_fork_info>: Make explicit.
<~scoped_switch_fork_info>: Wrap core in TRY/CATCH.
2019-01-10 Tom Tromey <tom@tromey.com>
* objfiles.h (objfile::reset_psymtabs): Update.
* objfiles.c (objfile::objfile): Update.
* psymtab.h (psymtab_storage::obstack): Update.
(psymtab_storage::m_obstack): Use gdb::optional.
(class psymtab_storage): Update comment. Remove objfile
parameter.
* psymtab.c (psymtab_storage::psymtab_storage): Update.
2019-01-10 Tom Tromey <tom@tromey.com>
* psymtab.h (psymtab_storage::allocate_psymtab): New method.
<free_psymtabs>: Now private.
* psymtab.c (psymtab_storage::allocate_psymtab): Implement.
(allocate_psymtab): Use new method.
2019-01-10 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_end_psymtab): Use allocate_dependencies.
* psymtab.h (psymtab_storage::allocate_dependencies): New method.
* mdebugread.c (parse_partial_symbols): Use
allocate_dependencies.
* dwarf2read.c (dwarf2_create_include_psymtab): Use
allocate_dependencies.
(process_psymtab_comp_unit_reader)
(build_type_psymtab_dependencies): Likewise.
* dbxread.c (dbx_end_psymtab): Use allocate_dependencies.
2019-01-10 Tom Tromey <tom@tromey.com>
* psymtab.c (add_psymbol_to_bcache): Pass psymtab obstack to
PSYMBOL_SET_LANGUAGE.
(allocate_psymtab): Allocate psymtab on the psymtab obstack.
2019-01-10 Tom Tromey <tom@tromey.com>
* psymtab.h (psymtab_storage::obstack): New method.
<m_obstack>: Rename from obstack; now private.
* psymtab.c (psymtab_storage): Update.
* dwarf2read.c (create_addrmap_from_index)
(create_addrmap_from_aranges, dwarf2_build_psymtabs_hard):
Update.
2019-01-10 Tom Tromey <tom@tromey.com>
* symfile.c (reread_symbols): Call objfile->reset_psymtabs.
* objfiles.h (objfile::reset_psymtabs): New method.
Introduce class psymtab_storage This introduces a new psymtab_storage class, which holds all psymbol-related objects that are independent of the objfile. (This latter contraint explains why psymbol_map was not moved; though this could still be done with some work.) This patch does not yet change where psymtab allocation is done -- that comes later. This just wraps everything in a single object to make further transformations simpler. Note that a shared_ptr is used to link from the objfile to the psymtab_storage object. The end goal here is to allow a given symbol reader to simply attach to the psymtab_storage object to the BFD, then reuse it in later invocations; shared_ptr makes this simple to reason about. gdb/ChangeLog 2019-01-10 Tom Tromey <tom@tromey.com> * symmisc.c (print_symbol_bcache_statistics): Update. (print_objfile_statistics): Update. * symfile.c (reread_symbols): Update. * psymtab.h (class psymtab_storage): New. * psymtab.c (psymtab_storage): New constructor. (~psymtab_storage): New destructor. (require_partial_symbols): Update. (ALL_OBJFILE_PSYMTABS_REQUIRED): Rewrite. (find_pc_sect_psymtab, find_pc_sect_psymbol) (match_partial_symbol, lookup_partial_symbol, dump_psymtab) (psym_dump, recursively_search_psymtabs, psym_has_symbols) (psym_find_compunit_symtab_by_address, sort_pst_symbols) (start_psymtab_common, end_psymtab_common) (add_psymbol_to_bcache, add_psymbol_to_list, init_psymbol_list) (allocate_psymtab): Update. (psymtab_storage::discard_psymtab): Rename from discard_psymtab. Update. (dump_psymtab_addrmap, maintenance_print_psymbols) (maintenance_check_psymtabs): Update. (class objfile_psymtabs): Move to objfiles.h. * psympriv.h (discard_psymtab): Now inline. (psymtab_discarder::psymtab_discarder): Update. (psymtab_discarder::~psymtab_discarder): Update. (ALL_OBJFILE_PSYMTABS): Rewrite. * objfiles.h (struct objfile) <psymtabs, psymtabs_addrmap, free_psymtabs, psymbol_cache, global_psymbols, static_psymbols>: Remove fields. <partial_symtabs>: New field. (class objfile_psymtabs): Move from psymtab.h. Update. * objfiles.c (objfile::objfile): Initialize partial_symtabs, not psymbol_cache. (objfile::~objfile): Don't destroy psymbol_cache. * mdebugread.c (parse_partial_symbols): Update. * dwarf2read.c (create_addrmap_from_index) (create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab) (process_psymtab_comp_unit_reader, dwarf2_build_psymtabs_hard) (add_partial_subprogram, dwarf2_ranges_read): Update. * dwarf-index-write.c (write_address_map) (write_one_signatured_type, recursively_write_psymbols) (class debug_names, class debug_names, write_psymtabs_to_index): Update.
2018-05-11 00:23:51 +02:00
2019-01-10 Tom Tromey <tom@tromey.com>
* symmisc.c (print_symbol_bcache_statistics): Update.
(print_objfile_statistics): Update.
* symfile.c (reread_symbols): Update.
* psymtab.h (class psymtab_storage): New.
* psymtab.c (psymtab_storage): New constructor.
(~psymtab_storage): New destructor.
(require_partial_symbols): Update.
(ALL_OBJFILE_PSYMTABS_REQUIRED): Rewrite.
(find_pc_sect_psymtab, find_pc_sect_psymbol)
(match_partial_symbol, lookup_partial_symbol, dump_psymtab)
(psym_dump, recursively_search_psymtabs, psym_has_symbols)
(psym_find_compunit_symtab_by_address, sort_pst_symbols)
(start_psymtab_common, end_psymtab_common)
(add_psymbol_to_bcache, add_psymbol_to_list, init_psymbol_list)
(allocate_psymtab): Update.
(psymtab_storage::discard_psymtab): Rename from discard_psymtab.
Update.
(dump_psymtab_addrmap, maintenance_print_psymbols)
(maintenance_check_psymtabs): Update.
(class objfile_psymtabs): Move to objfiles.h.
* psympriv.h (discard_psymtab): Now inline.
(psymtab_discarder::psymtab_discarder): Update.
(psymtab_discarder::~psymtab_discarder): Update.
(ALL_OBJFILE_PSYMTABS): Rewrite.
* objfiles.h (struct objfile) <psymtabs, psymtabs_addrmap,
free_psymtabs, psymbol_cache, global_psymbols, static_psymbols>:
Remove fields.
<partial_symtabs>: New field.
(class objfile_psymtabs): Move from psymtab.h. Update.
* objfiles.c (objfile::objfile): Initialize partial_symtabs, not
psymbol_cache.
(objfile::~objfile): Don't destroy psymbol_cache.
* mdebugread.c (parse_partial_symbols): Update.
* dwarf2read.c (create_addrmap_from_index)
(create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab)
(process_psymtab_comp_unit_reader, dwarf2_build_psymtabs_hard)
(add_partial_subprogram, dwarf2_ranges_read): Update.
* dwarf-index-write.c (write_address_map)
(write_one_signatured_type, recursively_write_psymbols)
(class debug_names, class debug_names, write_psymtabs_to_index):
Update.
2019-01-10 Tom Tromey <tom@tromey.com>
* symtab.h (SYMBOL_SET_NAMES): Update.
(symbol_set_names): Update.
(MSYMBOL_SET_NAMES): Update.
* symtab.c (symbol_set_names): Change argument to be an
objfile_per_bfd_storage.
* psymtab.c (add_psymbol_to_bcache): Update.
* psympriv.h (PSYMBOL_SET_NAMES): Take per_bfd argument.
2019-01-10 Tom Tromey <tom@tromey.com>
* symtab.c (create_demangled_names_hash): Change argument to be an
objfile_per_bfd_storage.
(symbol_set_names): Update.
2019-01-10 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_initial_scan): Unconditionally call
init_psymbol_list.
* psymtab.c (init_psymbol_list): Do nothing if already called.
* psympriv.h (init_psymbol_list): Add comment.
* dwarf2read.c (dwarf2_build_psymtabs): Unconditionally call
init_psymbol_list.
* dbxread.c (dbx_symfile_read): Unconditionally call
init_psymbol_list.
2019-01-10 Tom Tromey <tom@tromey.com>
* xcoffread.c (scan_xcoff_symtab): Update.
* psymtab.c (add_psymbol_to_list): Replace "list" parameter with
"where".
* mdebugread.c (parse_partial_symbols)
(handle_psymbol_enumerators): Update.
* dwarf2read.c (add_partial_symbol, load_partial_dies): Update.
* dbxread.c (read_dbx_symtab): Update.
* psympriv.h (psymbol_placement): New enum.
(add_psymbol_to_list): Update.
2019-01-10 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_start_psymtab): Remove global_psymbols and
static_psymbols parameters.
(scan_xcoff_symtab): Update.
* psymtab.c (start_psymtab_common): Remove global_psymbols and
static_psymbols parameters.
* psympriv.h (start_psymtab_common): Update.
* mdebugread.c (parse_partial_symbols): Update.
* dwarf2read.c (create_partial_symtab): Update.
* dbxread.c (read_dbx_symtab): Update.
(start_psymtab): Remove global_psymbols and static_psymbols
parameters.
2019-01-10 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_end_psymtab): Remove some initializations.
* psymtab.c (allocate_psymtab): Add comment.
* psympriv.h (allocate_psymtab): Add comment.
* dwarf2read.c (dwarf2_create_include_psymtab): Remove some
initializations.
* dbxread.c (dbx_end_psymtab): Remove some initializations.
2019-01-10 Tom Tromey <tom@tromey.com>
* symfile.h (mdebug_build_psymtabs, elfmdebug_build_psymtabs):
Don't declare.
* mipsread.c: Include mdebugread.h.
* mdebugread.h (mdebug_build_psymtabs, elfmdebug_build_psymtabs):
Declare.
* elfread.c: Include mdebugread.h.
2019-01-09 Tom Tromey <tom@tromey.com>
* dbxread.c (dbx_end_psymtab): Use objfile_psymtabs.
* mdebugread.c (parse_partial_symbols): Use objfile_psymtabs.
* psymtab.c (ALL_OBJFILE_PSYMTABS_REQUIRED): Remove.
(psym_map_symtabs_matching_filename, find_pc_sect_psymtab)
(psym_lookup_symbol, psym_find_last_source_symtab)
(psym_forget_cached_source_info, psym_print_stats)
(psym_expand_symtabs_for_function, psym_expand_all_symtabs)
(psym_expand_symtabs_with_fullname, psym_map_symbol_filenames)
(psym_map_matching_symbols, psym_expand_symtabs_matching)
(psym_find_compunit_symtab_by_address)
(maintenance_print_psymbols, maintenance_info_psymtabs)
(maintenance_check_psymtabs): Use ranged for.
* psymtab.h (class objfile_psymtabs): New.
(require_partial_symbols): Return objfile_psymtabs.
* psympriv.h (ALL_OBJFILE_PSYMTABS): Remove.
2019-01-09 Tom Tromey <tom@tromey.com>
* symfile.c (overlay_invalidate_all, find_pc_overlay)
(find_pc_mapped_section, list_overlays_command)
(map_overlay_command, unmap_overlay_command)
(simple_overlay_update): Use all_objfiles.
* spu-tdep.c (spu_overlay_update): Use all_objfiles.
* printcmd.c (info_symbol_command): Use all_objfiles.
* objfiles.h (ALL_OBJSECTIONS): Remove.
* maint.c (maintenance_translate_address): Use all_objfiles.
* gcore.c (gcore_create_callback): Use all_objfiles.
(objfile_find_memory_regions): Likewise.
2019-01-09 Tom Tromey <tom@tromey.com>
* symtab.c (find_line_symtab, info_sources_command)
(make_source_files_completion_list): Use objfile_compunits.
* source.c (select_source_symtab): Use objfile_compunits.
* objfiles.h (struct objfile): Update comment.
(ALL_OBJFILES): Remove.
(ALL_FILETABS): Remove.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Use
objfile_compunits.
2019-01-09 Tom Tromey <tom@tromey.com>
* symmisc.c (print_objfile_statistics, dump_objfile)
(maintenance_print_symbols): Use compunit_filetabs.
* source.c (forget_cached_source_info_for_objfile): Use
compunit_filetabs.
* objfiles.h (ALL_OBJFILE_FILETABS): Remove.
(ALL_FILETABS): Use compunit_filetabs.
* objfiles.c (objfile_relocate1): Use compunit_filetabs.
* coffread.c (coff_symtab_read): Use compunit_filetabs.
2019-01-09 Tom Tromey <tom@tromey.com>
* symtab.h (ALL_COMPUNIT_FILETABS): Remove.
(compunit_filetabs): New.
* symtab.c (iterate_over_some_symtabs, find_pc_sect_line): Use
compunit_filetabs.
(info_sources_command, make_source_files_completion_list): Remove
declaration.
* symmisc.c (print_objfile_statistics, dump_objfile)
(maintenance_print_symbols): Remove declaration.
(maintenance_info_symtabs): Use compunit_filetabs.
(maintenance_info_line_tables): Likewise.
* source.c (select_source_symtab): Change local variable name.
(forget_cached_source_info_for_objfile): Remove declaration.
* objfiles.h (ALL_OBJFILE_FILETABS): Use compunit_filetabs.
* objfiles.c (objfile_relocate1): Remove declaration.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Remove
declaration.
* maint.c (count_symtabs_and_blocks): Use compunit_filetabs.
* coffread.c (coff_symtab_read): Remove declaration.
* buildsym.c (buildsym_compunit::end_symtab_with_blockvector): Use
compunit_filetabs.
2019-01-09 Tom Tromey <tom@tromey.com>
* symtab.c (lookup_objfile_from_block)
(find_pc_sect_compunit_symtab, search_symbols)
(default_collect_symbol_completion_matches_break_on): Use
objfile_compunits.
* objfiles.h (ALL_COMPUNITS): Remove.
* maint.c (count_symtabs_and_blocks): Use objfile_compunits.
* cp-support.c (add_symbol_overload_list_qualified): Use
objfile_compunits.
* ada-lang.c (ada_collect_symbol_completion_matches)
(ada_add_global_exceptions): Use objfile_compunits.
2018-11-24 17:00:42 +01:00
2019-01-09 Tom Tromey <tom@tromey.com>
* source.c (select_source_symtab)
(forget_cached_source_info_for_objfile): Remove declaration.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Remove
declaration.
* maint.c (count_symtabs_and_blocks): Remove declaration.
* cp-support.c (add_symbol_overload_list_qualified): Remove
declaration.
* coffread.c (coff_symtab_read): Remove declaration.
* symtab.c (lookup_symbol_in_objfile_symtabs)
(basic_lookup_transparent_type_1): Use objfile_compunits.
(lookup_objfile_from_block, find_pc_sect_compunit_symtab)
(info_sources_command, search_symbols)
(default_collect_symbol_completion_matches_break_on)
(make_source_files_completion_list): Remove declaration.
* ada-lang.c (add_nonlocal_symbols): Use objfile_compunits.
(ada_collect_symbol_completion_matches)
(ada_add_global_exceptions): Remove declaration.
* linespec.c (iterate_over_all_matching_symtabs): Use
objfile_compunits.
* objfiles.h (ALL_OBJFILE_COMPUNITS): Remove.
(class objfile_compunits): New.
(ALL_COMPUNITS): Use objfile_compunits.
* symmisc.c (print_objfile_statistics, maintenance_info_symtabs)
(maintenance_check_symtabs, maintenance_info_line_tables): Use
objfile_compunits.
* objfiles.c (objfile_relocate1): Use objfile_compunits.
2019-01-09 Tom Tromey <tom@tromey.com>
* symtab.c (search_symbols)
(default_collect_symbol_completion_matches_break_on): Use
objfile_msymbols.
* ada-lang.c (ada_lookup_simple_minsym)
(ada_collect_symbol_completion_matches): Use objfile_msymbols.
* minsyms.c (find_solib_trampoline_target): Use objfile_msymbols.
* hppa-tdep.c (hppa_lookup_stub_minimal_symbol): Use
objfile_msymbols.
* coffread.c (coff_symfile_read): Use objfile_msymbols.
* symmisc.c (dump_msymbols): Use objfile_msymbols.
* objc-lang.c (find_methods): Use objfile_msymbols.
(info_selectors_command, info_classes_command): Likewise.
* stabsread.c (scan_file_globals): Use objfile_msymbols.
* objfiles.h (class objfile_msymbols): New.
(ALL_OBJFILE_MSYMBOLS): Remove.
(ALL_MSYMBOLS): Remove.
2019-01-09 Tom Tromey <tom@tromey.com>
* common/next-iterator.h (next_adapter): Add Iterator template
parameter.
* objfiles.h (ALL_OBJFILES_SAFE): Remove.
(class all_objfiles_safe): New.
* jit.c (jit_inferior_exit_hook): Use all_objfiles_safe.
* objfiles.c (put_objfile_before): Update comment.
(add_separate_debug_objfile): Likewise.
(free_all_objfiles): Use all_objfiles_safe.
(objfile_purge_solibs): Likewise.
Remove most uses of ALL_OBJFILES This removes most uses of ALL_OBJFILES, replacing them with ranged for loops. The remaining uses are all in macros, and will be removed in subsequent patches. gdb/ChangeLog 2019-01-09 Tom Tromey <tom@tromey.com> * symtab.c (iterate_over_symtabs, matching_obj_sections) (expand_symtab_containing_pc, lookup_static_symbol) (basic_lookup_transparent_type, find_pc_sect_compunit_symtab) (find_symbol_at_address, find_line_symtab, find_main_name): Use all_objfiles. * probe.c (find_probe_by_pc, collect_probes): Use all_objfiles. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Use all_objfiles. * linux-thread-db.c (try_thread_db_load_from_pdir) (has_libpthread): Use all_objfiles. * ada-lang.c (add_nonlocal_symbols): Use all_objfiles. * linespec.c (iterate_over_all_matching_symtabs) (search_minsyms_for_name): Use all_objfiles. * maint.c (maintenance_info_sections): Use all_objfiles. * main.c (captured_main_1): Use all_objfiles. * spu-tdep.c (spu_objfile_from_frame): Use all_objfiles. * guile/scm-objfile.c (gdbscm_objfiles): Use all_objfiles. * guile/scm-pretty-print.c (ppscm_find_pretty_printer_from_objfiles): Use all_objfiles. * solib-spu.c (append_ocl_sos): Use all_objfiles. * symmisc.c (maintenance_print_symbols): Use all_objfiles. (maintenance_print_msymbols): Use all_objfiles. * source.c (select_source_symtab): Use all_objfiles. * jit.c (jit_find_objf_with_entry_addr): Use all_objfiles. * symfile.c (remove_symbol_file_command) (expand_symtabs_matching, map_symbol_filenames): Use all_objfiles. * ppc-linux-tdep.c (ppc_linux_spe_context_inferior_created): Use all_objfiles. * dwarf2-frame.c (dwarf2_frame_find_fde): Use all_objfiles. * objc-lang.c (find_methods): Use all_objfiles. * objfiles.c (have_partial_symbols, have_full_symbols) (have_minimal_symbols, qsort_cmp) (default_iterate_over_objfiles_in_search_order): Use all_objfiles. * hppa-tdep.c (find_unwind_entry): Use all_objfiles. * psymtab.c (maintenance_print_psymbols): Use all_objfiles. (maintenance_check_psymtabs): Use all_objfiles. (ALL_PSYMTABS): Remove. * compile/compile-object-run.c (do_module_cleanup): Use all_objfiles. * blockframe.c (find_pc_partial_function): Use all_objfiles. * cp-support.c (add_symbol_overload_list_qualified): Use all_objfiles. * windows-tdep.c (windows_iterate_over_objfiles_in_search_order): Use all_objfiles. * dwarf-index-write.c (save_gdb_index_command): Use all_objfiles. * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): Use all_objfiles. * python/py-objfile.c (objfpy_lookup_objfile_by_name) (objfpy_lookup_objfile_by_build_id): Use all_objfiles. * python/py-prettyprint.c (find_pretty_printer_from_objfiles): Uses all_objfiles. * solib.c (solib_read_symbols): Use all_objfiles
2018-11-23 20:20:05 +01:00
2019-01-09 Tom Tromey <tom@tromey.com>
* symtab.c (iterate_over_symtabs, matching_obj_sections)
(expand_symtab_containing_pc, lookup_static_symbol)
(basic_lookup_transparent_type, find_pc_sect_compunit_symtab)
(find_symbol_at_address, find_line_symtab, find_main_name): Use
all_objfiles.
* probe.c (find_probe_by_pc, collect_probes): Use all_objfiles.
* breakpoint.c (create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint): Use all_objfiles.
* linux-thread-db.c (try_thread_db_load_from_pdir)
(has_libpthread): Use all_objfiles.
* ada-lang.c (add_nonlocal_symbols): Use all_objfiles.
* linespec.c (iterate_over_all_matching_symtabs)
(search_minsyms_for_name): Use all_objfiles.
* maint.c (maintenance_info_sections): Use all_objfiles.
* main.c (captured_main_1): Use all_objfiles.
* spu-tdep.c (spu_objfile_from_frame): Use all_objfiles.
* guile/scm-objfile.c (gdbscm_objfiles): Use all_objfiles.
* guile/scm-pretty-print.c
(ppscm_find_pretty_printer_from_objfiles): Use all_objfiles.
* solib-spu.c (append_ocl_sos): Use all_objfiles.
* symmisc.c (maintenance_print_symbols): Use all_objfiles.
(maintenance_print_msymbols): Use all_objfiles.
* source.c (select_source_symtab): Use all_objfiles.
* jit.c (jit_find_objf_with_entry_addr): Use all_objfiles.
* symfile.c (remove_symbol_file_command)
(expand_symtabs_matching, map_symbol_filenames): Use
all_objfiles.
* ppc-linux-tdep.c (ppc_linux_spe_context_inferior_created): Use
all_objfiles.
* dwarf2-frame.c (dwarf2_frame_find_fde): Use all_objfiles.
* objc-lang.c (find_methods): Use all_objfiles.
* objfiles.c (have_partial_symbols, have_full_symbols)
(have_minimal_symbols, qsort_cmp)
(default_iterate_over_objfiles_in_search_order): Use
all_objfiles.
* hppa-tdep.c (find_unwind_entry): Use all_objfiles.
* psymtab.c (maintenance_print_psymbols): Use all_objfiles.
(maintenance_check_psymtabs): Use all_objfiles.
(ALL_PSYMTABS): Remove.
* compile/compile-object-run.c (do_module_cleanup): Use
all_objfiles.
* blockframe.c (find_pc_partial_function): Use all_objfiles.
* cp-support.c (add_symbol_overload_list_qualified): Use
all_objfiles.
* windows-tdep.c (windows_iterate_over_objfiles_in_search_order):
Use all_objfiles.
* dwarf-index-write.c (save_gdb_index_command): Use all_objfiles.
* python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): Use
all_objfiles.
* python/py-objfile.c (objfpy_lookup_objfile_by_name)
(objfpy_lookup_objfile_by_build_id): Use all_objfiles.
* python/py-prettyprint.c (find_pretty_printer_from_objfiles):
Uses all_objfiles.
* solib.c (solib_read_symbols): Use all_objfiles
2019-01-09 Tom Tromey <tom@tromey.com>
* probe.c (parse_probes_in_pspace): Use all_objfiles.
* guile/scm-progspace.c (gdbscm_progspace_objfiles): Use
all_objfiles.
* objfiles.h (ALL_PSPACE_OBJFILES): Remove.
* symmisc.c (print_symbol_bcache_statistics)
(print_objfile_statistics, maintenance_print_objfiles)
(maintenance_info_symtabs, maintenance_check_symtabs)
(maintenance_expand_symtabs, maintenance_info_line_tables): Use
all_objfiles.
* source.c (forget_cached_source_info): Use all_objfiles.
* symfile-debug.c (set_debug_symfile): Use all_objfiles.
* elfread.c (elf_gnu_ifunc_resolve_by_cache)
(elf_gnu_ifunc_resolve_by_got): Use all_objfiles.
* objfiles.c (update_section_map): Use all_objfiles.
(shared_objfile_contains_address_p): Likewise.
* psymtab.c (maintenance_info_psymtabs): Use all_objfiles.
* python/py-progspace.c (pspy_get_objfiles): Use all_objfiles.
2019-01-09 Tom Tromey <tom@tromey.com>
* common/next-iterator.h: New file.
* objfiles.h (class all_objfiles): New.
(struct objfile_iterator): New.
2019-01-09 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Move the description of the changed "frame", "select-frame",
and "info frame" commands to the Changed commands section.
gdb: Remove support for old mangling schemes An upcoming sync with gcc's libiberty [1] will remove support for old mangling schemes (GNU v2, Lucid, ARM, HP and EDG). It will remove the cplus_demangle_opname function, so we need to get rid of its usages in GDB (it's a GNU v2 specific function). I think the changes are mostly relatively obvious, some hacks that were necessary to support overloaded operators with GNU v2 mangling are not needed anymore. The change in stabsread.c is perhaps less obvious. I think we could get rid of more code in that region that is specific to old mangling schemes, but I chose to do only the minimal changes required to remove the cplus_demangle_opname uses. There is also a detailed comment just above that explaining how GNU v2 and v3 mangled symbols are handled, I decided to leave it as-is, since I wasn't sure which part to remove, change or leave there. [1] The commit "Remove support for demangling GCC 2.x era mangling schemes.", specifically. gdb/ChangeLog: * gdbtypes.c (check_stub_method_group): Remove handling of old mangling schemes. * linespec.c (find_methods): Likewise. * stabsread.c (read_member_functions): Likewise. * valops.c (search_struct_method): Likewise. (value_struct_elt_for_reference): Likewise. * NEWS: Mention this change. gdb/testsuite/ChangeLog: * gdb.cp/demangle.exp (test_gnu_style_demangling): Rename to... (test_gnuv3_style_demangling): ... this. (test_lucid_style_demangling): Remove. (test_arm_style_demangling): Remove. (test_hp_style_demangling): Remove. (do_tests): Remove calls to the above. gdb/doc/ChangeLog: * gdb.texinfo (Print Settings): Remove mention of specific demangle-style values, just refer to the in-process help.
2019-01-09 18:57:16 +01:00
2019-01-09 Simon Marchi <simon.marchi@ericsson.com>
* gdbtypes.c (check_stub_method_group): Remove handling of old
mangling schemes.
* linespec.c (find_methods): Likewise.
* stabsread.c (read_member_functions): Likewise.
* valops.c (search_struct_method): Likewise.
(value_struct_elt_for_reference): Likewise.
* NEWS: Mention this change.
gdb: Avoid signed integer overflow when printing source lines When printing source lines with calls to print_source_lines we need to pass a start line number and an end line number. The end line number is calculated by calling get_lines_to_list and adding this value to the start line number. For example this code from list_command: print_source_lines (cursal.symtab, first, first + get_lines_to_list (), 0); The problem is that get_lines_to_list returns a value based on the GDB setting `set listsize LISTSIZE`. By default LISTSIZE is 10, however, its also possible to set LISTSIZE to unlimited, in which case get_lines_to_list will return INT_MAX. As the parameter signature for print_source_lines is: void print_source_lines (struct symtab *, int, int, print_source_lines_flags); and `first` in the above code is an `int`, then when LISTSIZE is `unlimited` the above code will result in signed integer overflow, which is undefined. The solution in this patch is a new class source_lines_range that can be constructed from a single line number and a direction (forward or backward). The range is then constructed from the line number and the value of get_lines_to_list. gdb/ChangeLog: * cli/cli-cmds.c (list_command): Pass a source_lines_range to print_source_lines. * source.c (print_source_lines_base): Update line number check. (print_source_lines): New function. (source_lines_range::source_lines_range): New function. * source.h (class source_lines_range): New class. (print_source_lines): New declaration.
2019-01-07 08:26:35 +01:00
2019-01-09 Andrew Burgess <andrew.burgess@embecosm.com>
* cli/cli-cmds.c (list_command): Pass a source_lines_range to
print_source_lines.
* source.c (print_source_lines_base): Update line number check.
(print_source_lines): New function.
(source_lines_range::source_lines_range): New function.
* source.h (class source_lines_range): New class.
(print_source_lines): New declaration.
2019-01-09 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* linespec.c (linespec_state_destructor): Free self->canonical_names.
2019-01-08 Tom Tromey <tom@tromey.com>
Simon Marchi <simon.marchi@ericsson.com>
PR gdb/24060
* ada-exp.y (DOLLAR_VARIABLE): Rename from SPECIAL_VARIABLE.
* ada-lex.l (DOLLAR_VARIABLE): Likewise.
* c-exp.y (DOLLAR_VARIABLE): Rename from VARIABLE.
* f-exp.y (DOLLAR_VARIABLE): Likewise.
* m2-exp.y (DOLLAR_VARIABLE): Rename from INTERNAL_VAR.
* p-exp.y (DOLLAR_VARIABLE): Rename from VARIABLE.
2019-01-08 Andrew Burgess <andrew.burgess@embecosm.com>
* source.c (select_source_symtab): Move header comment to
declaration in source.h.
(forget_cached_source_info_for_objfile): Likewise.
(forget_cached_source_info): Likewise.
(identify_source_line): Likewise.
* source.h (identify_source_line): Move declaration from symtab.h
and add comment from source.c
(print_source_lines): Likewise.
(forget_cached_source_info_for_objfile): Likewise.
(forget_cached_source_info): Likewise.
(select_source_symtab): Likewise.
(enum print_source_lines_flag): Move definition from symtab.h.
* symtab.h (identify_source_line): Move declaration to source.h.
(print_source_lines): Likewise.
(forget_cached_source_info_for_objfile): Likewise.
(forget_cached_source_info): Likewise.
(select_source_symtab): Likewise.
(enum print_source_lines_flag): Move definition to source.h.
* tui/tui-hooks.c: Add 'source.h' include.
2019-01-08 Andrew Burgess <andrew.burgess@embecosm.com>
* source.c (print_source_lines_base): Handle requests to print
reverse line number sequences, and guard against empty lines
string.
2019-01-08 Andrew Burgess <andrew.burgess@embecosm.com>
* source.c (print_source_lines_base): Fix skip of '\r' if next
character is '\n'.
2019-01-06 Tom Tromey <tom@tromey.com>
* c-exp.y (struct c_parse_state) <macro_original_text,
expansion_obstack>: New member.
(macro_original_text, expansion_obstack): Remove globals.
(scan_macro_expansion, scanning_macro_expansion)
(finished_macro_expansion): Update.
(scan_macro_cleanup): Remove.
(yylex, c_parse): Update.
2019-01-06 Tom Tromey <tom@tromey.com>
* c-exp.y (struct c_parse_state) <strings>: New member.
(operator_stoken): Update.
2019-01-06 Tom Tromey <tom@tromey.com>
* parser-defs.h (type_ptr): Remove typedef. Don't declare VEC.
(union type_stack_elt) <typelist_val>: Now a pointer to
std::vector.
(type_stack_cleanup): Don't declare.
(push_typelist): Update.
* parse.c (pop_typelist): Return a std::vector.
(push_typelist): Take a std::vector.
(follow_types): Update. Do not free args.
(type_stack_cleanup): Remove.
* c-exp.y (struct c_parse_state): New.
(cpstate): New global.
(type_aggregate_p, exp, ptr_operator, parameter_typelist)
(nonempty_typelist): Update.
(func_mod): Create a new vector.
(c_parse): Create a c_parse_state.
(check_parameter_typelist): Do not delete params.
(function_method): Update. Do not delete type_list.
2019-01-06 Tom Tromey <tom@tromey.com>
PR gdb/28155:
* python/py-finishbreakpoint.c (bpfinishpy_init): Use
check_typedef.
* infcmd.c (finish_command_fsm_should_stop): Use check_typedef.
(print_return_value): Likewise.
2019-01-05 Tom Tromey <tom@tromey.com>
* contrib/cleanup_check.py: Remove.
* contrib/gcc-with-excheck: Remove.
* contrib/exsummary.py: Remove.
* contrib/excheck.py: Remove.
GDB crash re-running program on Windows (native) Running any program twice on Windows current results in GDB crashing: $ gdb -q any_program (gdb) run $ gdb dummy -batch -ex run -ex run [New Thread 684960.0xe5878] [New Thread 684960.0xd75ac] [New Thread 684960.0xddac8] [New Thread 684960.0xc1f50] [Thread 684960.0xd75ac exited with code 0] [Thread 684960.0xddac8 exited with code 0] [Thread 684960.0xc1f50 exited with code 0] [Inferior 1 (process 684960) exited normally] (gdb) run Segmentation fault The crash happens while processing the CREATE_PROCESS_DEBUG_EVENT for the second run; in particular, we have in get_windows_debug_event: | case CREATE_PROCESS_DEBUG_EVENT: | [...] | if (main_thread_id) | windows_delete_thread (ptid_t (current_event.dwProcessId, 0, | main_thread_id), | 0); The problem is that main_thread_id is the TID of the main thread from the *previous* inferior, and this code is trying to delete that thread. The problem is that it is constructing a PTID by pairing the TID of the previous inferior with the PID of the new inferior. As a result, when we dig inside windows_delete_thread to see how it would handle that, we see... | delete_thread (find_thread_ptid (ptid)); Since the PTID is bogus, we end up calling delete_thread with a NULL thread_info. It used to be harmless, turning the delete_thread into a nop, but the following change... | commit 080363310650c93ad8e93018bcb6760ba5d32d1c | Date: Thu Nov 22 16:09:14 2018 +0000 | Subject: Per-inferior thread list, thread ranges/iterators, down with ALL_THREADS, etc. ... changed delete_thread to get the list of threads from the inferior, which itself is now accessed via the given thread_info. This is the corresponding diff that shows the change: | - for (tp = thread_list; tp; tpprev = tp, tp = tp->next) | + for (tp = thr->inf->thread_list; tp; tpprev = tp, tp = tp->next) As a result of this, passing a NULL thread_info is no longer an option! Stepping back a bit, the reason behind deleting the thread late could be found in a patch from Dec 2003, which laconically explains: | commit 87a45c96062d658ca83b50aa060a648bf5f5f1ff | Date: Fri Dec 26 00:39:04 2003 +0000 | | * win32-nat.c (get_child_debug_event): Keep main thread id around | even after thread exits since Windows insists on continuing to | report events against it. A look at the gdb-patches archives did not provide any additional clues (https://www.sourceware.org/ml/gdb-patches/2003-12/msg00478.html). It is not clear whether this is still needed or not. This patch assumes that whatever isue there was, the versions of Windows we currently support no longer have it. With that in mind, this commit fixes the issue by deleting the thread when the inferior sends the exit-process event as opposed to deleting it later, while starting a new inferior. This also restores the printing of the thread-exit notification for the main thread, which was missing before. Looking at the transcript of the example shown above, we can see 4 thread creation notifications, and only 3 notifications for thread exits. Now creation and exit notifications are balanced. In the handling of EXIT_THREAD_DEBUG_EVENT, the main_thread_id check is removed because deemed unnecessary: The main thread was introduced by a CREATE_PROCESS_DEBUG_EVENT, and thus the kernel is expected to report its death via EXIT_PROCESS_DEBUG_EVENT. And finally, because the behavior of delete_thread did change (albeit when getting a value we probably never expected to receive), this patch also adds a gdb_assert. The purpose is to provide some immediate information in case there are other callers that mistakenly call delete_thread with a NULL thread info. This can be useful information when direct debugging of GDB isn't an option. gdb/ChangeLog: * thread.c (delete_thread_1): Add gdb_assert that THR is not NULL. Initialize tpprev to NULL instead of assigning it to NULL on the next statement. * windows-nat.c (windows_delete_thread): Remove check for main_thread_id before printing thread exit notifications. (get_windows_debug_event) <EXIT_THREAD_DEBUG_EVENT>: Remove thread ID check against main_thread_id. <CREATE_PROCESS_DEBUG_EVENT>: Remove call to windows_delete_thread. <EXIT_PROCESS_DEBUG_EVENT>: Add call to windows_delete_thread.
2019-01-05 08:55:08 +01:00
2019-01-05 Joel Brobecker <brobecker@adacore.com>
* thread.c (delete_thread_1): Add gdb_assert that THR is not
NULL. Initialize tpprev to NULL instead of assigning it
to NULL on the next statement.
* windows-nat.c (windows_delete_thread): Remove check for
main_thread_id before printing thread exit notifications.
(get_windows_debug_event) <EXIT_THREAD_DEBUG_EVENT>:
Remove thread ID check against main_thread_id.
<CREATE_PROCESS_DEBUG_EVENT>: Remove call to
windows_delete_thread.
<EXIT_PROCESS_DEBUG_EVENT>: Add call to windows_delete_thread.
2019-01-04 Tom Tromey <tom@tromey.com>
* compile/compile.c (_initialize_compile): Use upper case for
metasyntactic variables.
* symmisc.c (_initialize_symmisc): Use upper case for
metasyntactic variables.
* psymtab.c (_initialize_psymtab): Use upper case for
metasyntactic variables.
* demangle.c (demangle_command): Use upper case for metasyntactic
variables.
(_initialize_demangler): Likewise.
* ax-gdb.c (_initialize_ax_gdb): Use upper case for metasyntactic
variables.
2019-01-03 Tom Tromey <tom@tromey.com>
* tui/tui-source.c (tui_set_source_content): Use xstrdup.
2019-01-03 Tom Tromey <tom@tromey.com>
* python/py-symtab.c (salpy_str): Update.
(struct salpy_sal_object) <symtab>: Now a PyObject.
(salpy_dealloc): Update.
(del_objfile_sal): Use gdbpy_ref.
2019-01-03 Tom Tromey <tom@tromey.com>
* python/py-type.c (convert_field): Use new_reference. Return
gdbpy_ref.
(make_fielditem): Return gdbpy_ref.
(typy_fields): Update.
(typy_getitem): Update.
(field_name): Return gdbpy_ref. Use new_reference.
(typy_iterator_iternext): Update.
2019-01-03 Tom Tromey <tom@tromey.com>
* python/py-record.c (gdbpy_stop_recording): Use Py_RETURN_NONE.
2019-01-03 Tom Tromey <tom@tromey.com>
* python/py-value.c (valpy_dealloc): Use Py_XDECREF.
* python/py-type.c (typy_fields_items): Use gdbpy_ref.
* python/py-progspace.c (pspy_set_printers): Use gdbpy_ref.
(pspy_set_frame_filters, pspy_set_frame_unwinders)
(pspy_set_type_printers): Likewise.
* python/py-function.c (fnpy_init): Use gdbpy_ref.
* python/py-cmd.c (cmdpy_init): Use gdbpy_ref.
* python/py-objfile.c (objfpy_set_printers): Use gdbpy_ref.
(objfpy_set_frame_filters, objfpy_set_frame_unwinders)
(objfpy_set_type_printers): Likewise.
2019-01-03 Tom Tromey <tom@tromey.com>
* python/python.c (gdbpy_enter, ~gdbpy_enter): Update.
(gdbpy_print_stack): Use gdbpy_err_fetch.
* python/python-internal.h (class gdbpy_err_fetch): New class.
(class gdbpy_enter) <m_error_type, m_error_value,
m_error_traceback>: Remove.
<m_error>: New member.
(gdbpy_exception_to_string): Don't declare.
* python/py-varobj.c (py_varobj_iter_next): Use gdbpy_err_fetch.
* python/py-value.c (convert_value_from_python): Use
gdbpy_err_fetch.
* python/py-utils.c (gdbpy_err_fetch::to_string): Rename from
gdbpy_exception_to_string.
(gdbpy_handle_exception): Use gdbpy_err_fetch.
* python/py-prettyprint.c (print_stack_unless_memory_error): Use
gdbpy_err_fetch.
2019-01-03 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-nat.c (delete_lwp_cleanup): Delete.
(struct lwp_deleter): New struct.
(lwp_info_up): New typedef.
(linux_nat_target::follow_fork): Delete cleanup, and make use of
lwp_info_up.
2019-01-03 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-fork.c (class scoped_switch_fork_info): New class.
(inferior_call_waitpid): Update to use scoped_switch_fork_info.
2019-01-03 Andrew Burgess <andrew.burgess@embecosm.com>
* valops.c (find_overload_match): Remove use of null_cleanup, and
calls to do_cleanups.
2019-01-03 Andrew Burgess <andrew.burgess@embecosm.com>
* compile/compile-cplus-types.c
(compile_cplus_instance::decl_name): Handle changes to
cp_func_name.
* cp-support.c (cp_func_name): Update header comment, update
return type.
* cp-support.h (cp_func_name): Update return type in declaration.
* valops.c (find_overload_match): Move temp_func local to top
level of function and change its type. Use temp_func to hold and
delete temporary string obtained from cp_func_name.
2019-01-03 Andrew Burgess <andrew.burgess@embecosm.com>
* remote.c (remote_target::remote_check_symbols): Convert `msg` to
gdb::char_vector, remove cleanup, and update uses of `msg`.
2019-01-03 Jim Wilson <jimw@sifive.com>
* riscv-tdep.c (riscv_freg_feature): Drop s0 name from f8.
2019-01-02 Tom Tromey <tom@tromey.com>
* xml-tdesc.c (xml_cache): Hold a target_desc_up.
(tdesc_parse_xml): Remove cleanups.
* target-descriptions.h (make_cleanup_free_target_description):
Don't declare.
(target_desc_deleter): New struct.
(target_desc_up): New typedef.
* target-descriptions.c (target_desc_deleter::operator()): Rename
from free_target_description.
(make_cleanup_free_target_description): Remove.
2019-01-02 Tom Tromey <tom@tromey.com>
* linespec.c (struct linespec_parser): Rename from ls_parser. Add
constructor, destructor.
(linespec_parser): Remove typedef.
(~linespec_parser): Rename from linespec_parser_delete.
(linespec_lex_to_end, linespec_complete_label)
(linespec_complete): Update.
(decode_line_full): Remove cleanups.
(decode_line_1): Update.
2019-01-02 Tom Tromey <tom@tromey.com>
* python/python-internal.h (inferior_to_inferior_object): Change
return type.
* python/py-exitedevent.c (create_exited_event_object): Update.
* python/py-inferior.c (inferior_to_inferior_object): Return
gdbpy_ref.
(python_new_inferior, python_inferior_deleted)
(thread_to_thread_object, delete_thread_object)
(build_inferior_list, gdbpy_selected_inferior): Update.
* python/py-infthread.c (create_thread_object): Update. Also fail
if inferior_to_inferior_object fails.
Place displaced step data directly in inferior structure This patch moves the per-inferior data related to displaced stepping to be directly in the inferior structure, rather than in a container on the side. On notable difference is that previously, we deleted the state on inferior exit, which guaranteed a clean state if re-using the inferior for a new run or attach. We now need to reset the state manually. At the same time, I changed step_saved_copy to be a gdb::byte_vector, so it is automatically freed on destruction (which should plug the leak reported here [1]). [1] https://sourceware.org/ml/gdb-patches/2018-11/msg00202.html gdb/ChangeLog: * inferior.h (class inferior) <displaced_step_state>: New field. * infrun.h (struct displaced_step_state): Move here from infrun.c. Initialize fields, add constructor. <inf>: Remove field. <reset>: New method. * infrun.c (struct displaced_step_inferior_state): Move to infrun.h. (displaced_step_inferior_states): Remove. (get_displaced_stepping_state): Adust. (displaced_step_in_progress_any_inferior): Adjust. (displaced_step_in_progress_thread): Adjust. (displaced_step_in_progress): Adjust. (add_displaced_stepping_state): Remove. (get_displaced_step_closure_by_addr): Adjust. (remove_displaced_stepping_state): Remove. (infrun_inferior_exit): Call displaced_step_state.reset. (use_displaced_stepping): Don't check for NULL. (displaced_step_prepare_throw): Call get_displaced_stepping_state. (displaced_step_fixup): Don't check for NULL. (prepare_for_detach): Don't check for NULL.
2019-01-02 23:31:08 +01:00
2019-01-02 Simon Marchi <simon.marchi@ericsson.com>
* inferior.h (class inferior) <displaced_step_state>: New field.
* infrun.h (struct displaced_step_state): Move here from
infrun.c. Initialize fields, add constructor.
<inf>: Remove field.
<reset>: New method.
* infrun.c (struct displaced_step_inferior_state): Move to
infrun.h.
(displaced_step_inferior_states): Remove.
(get_displaced_stepping_state): Adust.
(displaced_step_in_progress_any_inferior): Adjust.
(displaced_step_in_progress_thread): Adjust.
(displaced_step_in_progress): Adjust.
(add_displaced_stepping_state): Remove.
(get_displaced_step_closure_by_addr): Adjust.
(remove_displaced_stepping_state): Remove.
(infrun_inferior_exit): Call displaced_step_state.reset.
(use_displaced_stepping): Don't check for NULL.
(displaced_step_prepare_throw): Call
get_displaced_stepping_state.
(displaced_step_fixup): Don't check for NULL.
(prepare_for_detach): Don't check for NULL.
2019-01-02 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* infcall.c (call_function_by_hand_dummy): cleanup/destroy sm
in case of call that did not complete.
Fix search of debug files for remote debuggee When using remote debugging server, and when debuggee filename is inferred via qXfer:exec-file:read request, or sysroot starts with "target:", this "target:" prefix of filepaths is not treated correctly during debug file search - it appears in the middle of the looked up paths. In the following example, unpatched GDB can't find separate debug files for neither the executable, nor standard libraries: $ gdb -ex 'set debug separate-debug-file 1' -ex 'set sysroot target:/' -ex 'set debug-file-directory /usr/lib/debug:/home/j/hide' -ex 'target remote :3333' -ex 'break main' -ex 'continue' -ex 'bt' -ex 'info sharedlibrary' -ex 'set confirm off' -ex 'quit' GNU gdb (Gentoo 9999 vanilla) 8.2.50.20181109-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://bugs.gentoo.org/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". Remote debugging using :3333 Reading /home/j/test from remote target... warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead. Reading /home/j/test from remote target... Reading symbols from target:/home/j/test... Looking for separate debug info (debug link) for target:/home/j/test Trying target:/home/j/test.debug Reading /home/j/test.debug from remote target... Trying target:/home/j/.debug/test.debug Reading /home/j/.debug/test.debug from remote target... Trying /usr/lib/debug/target:/home/j/test.debug Trying /home/j/hide/target:/home/j/test.debug (No debugging symbols found in target:/home/j/test) Reading /lib64/ld-linux-x86-64.so.2 from remote target... Reading /lib64/ld-linux-x86-64.so.2 from remote target... Reading symbols from target:/lib64/ld-linux-x86-64.so.2... Looking for separate debug info (debug link) for target:/lib64/ld-linux-x86-64.so.2 Trying target:/lib64/ld-2.27.so.debug Reading /lib64/ld-2.27.so.debug from remote target... Trying target:/lib64/.debug/ld-2.27.so.debug Reading /lib64/.debug/ld-2.27.so.debug from remote target... Trying /usr/lib/debug/target:/lib64/ld-2.27.so.debug Trying /home/j/hide/target:/lib64/ld-2.27.so.debug (No debugging symbols found in target:/lib64/ld-linux-x86-64.so.2) Looking for separate debug info (build-id) for system-supplied DSO at 0x7ffff7ffa000 Trying /usr/lib/debug/.build-id/fd/03d584bc1a90ba28be457635a02662c9f9c1f2.debug Trying /home/j/hide/.build-id/fd/03d584bc1a90ba28be457635a02662c9f9c1f2.debug 0x00007ffff7dd7000 in ?? () from target:/lib64/ld-linux-x86-64.so.2 Breakpoint 1 at 0x4005eb Continuing. Reading /lib64/libpthread.so.0 from remote target... Reading /lib64/libc.so.6 from remote target... Looking for separate debug info (debug link) for target:/lib64/libpthread.so.0 Trying target:/lib64/libpthread-2.27.so.debug Reading /lib64/libpthread-2.27.so.debug from remote target... Trying target:/lib64/.debug/libpthread-2.27.so.debug Reading /lib64/.debug/libpthread-2.27.so.debug from remote target... Trying /usr/lib/debug/target:/lib64/libpthread-2.27.so.debug Trying /home/j/hide/target:/lib64/libpthread-2.27.so.debug Looking for separate debug info (debug link) for target:/lib64/libc.so.6 Trying target:/lib64/libc-2.27.so.debug Reading /lib64/libc-2.27.so.debug from remote target... Trying target:/lib64/.debug/libc-2.27.so.debug Reading /lib64/.debug/libc-2.27.so.debug from remote target... Trying /usr/lib/debug/target:/lib64/libc-2.27.so.debug Trying /home/j/hide/target:/lib64/libc-2.27.so.debug Breakpoint 1, 0x00000000004005eb in main () #0 0x00000000004005eb in main () From To Syms Read Shared Object Library 0x00007ffff7dd6e80 0x00007ffff7df4650 Yes (*) target:/lib64/ld-linux-x86-64.so.2 0x00007ffff7bbbb70 0x00007ffff7bcbfee Yes (*) target:/lib64/libpthread.so.0 0x00007ffff780f200 0x00007ffff7962d7c Yes (*) target:/lib64/libc.so.6 (*): Shared library is missing debugging information. With current fix, the paths used always have target: in the beginning and this helps to find all debug files: $ gdb -ex 'set debug separate-debug-file 1' -ex 'set sysroot target:/' -ex 'set debug-file-directory /usr/lib/debug:/home/j/hide' -ex 'target remote :3333' -ex 'break main' -ex 'continue' -ex 'bt' -ex 'info sharedlibrary' -ex 'set confirm off' -ex 'quit' GNU gdb (Gentoo 9999 vanilla) 8.2.50.20181109-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://bugs.gentoo.org/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". Remote debugging using :3333 Reading /home/j/test from remote target... warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead. Reading /home/j/test from remote target... Reading symbols from target:/home/j/test... Looking for separate debug info (debug link) for target:/home/j/test Trying target:/home/j/test.debug Reading /home/j/test.debug from remote target... Trying target:/home/j/.debug/test.debug Reading /home/j/.debug/test.debug from remote target... Trying target:/usr/lib/debug//home/j/test.debug Reading /usr/lib/debug//home/j/test.debug from remote target... Trying target:/home/j/hide//home/j/test.debug Reading /home/j/hide//home/j/test.debug from remote target... Reading /home/j/hide//home/j/test.debug from remote target... Reading symbols from target:/home/j/hide//home/j/test.debug... Reading /lib64/ld-linux-x86-64.so.2 from remote target... Reading /lib64/ld-linux-x86-64.so.2 from remote target... Reading symbols from target:/lib64/ld-linux-x86-64.so.2... Looking for separate debug info (debug link) for target:/lib64/ld-linux-x86-64.so.2 Trying target:/lib64/ld-2.27.so.debug Reading /lib64/ld-2.27.so.debug from remote target... Trying target:/lib64/.debug/ld-2.27.so.debug Reading /lib64/.debug/ld-2.27.so.debug from remote target... Trying target:/usr/lib/debug//lib64/ld-2.27.so.debug Reading /usr/lib/debug//lib64/ld-2.27.so.debug from remote target... Reading /usr/lib/debug//lib64/ld-2.27.so.debug from remote target... Reading symbols from target:/usr/lib/debug//lib64/ld-2.27.so.debug... Looking for separate debug info (build-id) for system-supplied DSO at 0x7ffff7ffa000 Trying /usr/lib/debug/.build-id/fd/03d584bc1a90ba28be457635a02662c9f9c1f2.debug Trying /home/j/hide/.build-id/fd/03d584bc1a90ba28be457635a02662c9f9c1f2.debug 0x00007ffff7dd7000 in _start () from target:/lib64/ld-linux-x86-64.so.2 Breakpoint 1 at 0x4005ef: file test/test16.c, line 13. Continuing. Reading /lib64/libpthread.so.0 from remote target... Reading /lib64/libc.so.6 from remote target... Looking for separate debug info (debug link) for target:/lib64/libpthread.so.0 Trying target:/lib64/libpthread-2.27.so.debug Reading /lib64/libpthread-2.27.so.debug from remote target... Trying target:/lib64/.debug/libpthread-2.27.so.debug Reading /lib64/.debug/libpthread-2.27.so.debug from remote target... Trying target:/usr/lib/debug//lib64/libpthread-2.27.so.debug Reading /usr/lib/debug//lib64/libpthread-2.27.so.debug from remote target... Reading /usr/lib/debug//lib64/libpthread-2.27.so.debug from remote target... Looking for separate debug info (debug link) for target:/lib64/libc.so.6 Trying target:/lib64/libc-2.27.so.debug Reading /lib64/libc-2.27.so.debug from remote target... Trying target:/lib64/.debug/libc-2.27.so.debug Reading /lib64/.debug/libc-2.27.so.debug from remote target... Trying target:/usr/lib/debug//lib64/libc-2.27.so.debug Reading /usr/lib/debug//lib64/libc-2.27.so.debug from remote target... Reading /usr/lib/debug//lib64/libc-2.27.so.debug from remote target... Breakpoint 1, main () at test/test16.c:13 13 for ( i=0; i<10; ++i) #0 main () at test/test16.c:13 From To Syms Read Shared Object Library 0x00007ffff7dd6e80 0x00007ffff7df4650 Yes target:/lib64/ld-linux-x86-64.so.2 0x00007ffff7bbbb70 0x00007ffff7bcbfee Yes target:/lib64/libpthread.so.0 0x00007ffff780f200 0x00007ffff7962d7c Yes target:/lib64/libc.so.6 gdb/ChangeLog: 2018-11-09 Andrey Utkin <autkin@undo.io> * symfile.c (find_separate_debug_file): Fix search of debug files for remote debuggee. Signed-off-by: Andrey Utkin <autkin@undo.io>
2018-11-09 20:09:40 +01:00
2019-01-02 Andrey Utkin <autkin@undo.io>
* symfile.c (find_separate_debug_file): Fix search of debug files for
remote debuggee.
2019-01-02 Tom Tromey <tom@tromey.com>
* python/py-inferior.c (gdbpy_initialize_inferior): Fix
indentation.
* python/py-frame.c (frapy_older): Remove cast.
(frapy_newer): Likewise.
* python/py-breakpoint.c (local_setattro): Remove cast.
* python/py-arch.c (archpy_name): Remove local variable.
* python/py-type.c (gdbpy_lookup_type): Remove cast.
2019-01-02 Joel Brobecker <brobecker@adacore.com>
* unittests/basic_string_view/element_access/char/empty.cc:
Fix year range in copyright header.
gdb/riscv: Split ISA and ABI features The goal of this commit is to allow RV64 binaries compiled for the 'F' extension to run on a target that supports both the 'F' and 'D' extensions. The 'D' extension depends on the 'F' extension and chapter 9 of the RISC-V ISA manual implies that running a program compiled for 'F' on a 'D' target should be fine. To support this the gdbarch now holds two feature sets, one represents the features that are present on the target, and one represents the features requested in the ELF flags. The existing error checks are relaxed slightly to allow binaries compiled for 32-bit 'F' extension to run on targets with the 64-bit 'D' extension. A new set of functions called riscv_abi_{xlen,flen} are added to compliment the existing riscv_isa_{xlen,flen}, and some callers to the isa functions now call the abi functions when that is appropriate. In riscv_call_arg_struct two asserts are removed, these asserts no longer make sense. The asserts were both like this: gdb_assert (TYPE_LENGTH (ainfo->type) <= (cinfo->flen + cinfo->xlen)); And were made in two cases, when passing structures like these: struct { integer field1; float field2; }; or, struct { float field1; integer field2; }; When running on an RV64 target which only has 32-bit float then the integer field could be 64-bits, while if the float field is 32-bits the overall size of the structure can be 128-bits (with 32-bits of padding). In this case the assertion would fail, however, the code isn't incorrect, so its safe to just remove the assertion. This was tested by running on an RV64IMFDC target using a compiler configured for RV64IMFC, and comparing the results with those obtained when using a compiler configured for RV64IMFDC. The only regressions I see (now) are in gdb.base/store.exp and are related too different code generation choices GCC makes between the two targets. Finally, this commit does not make any attempt to support running binaries compiled for RV32 on an RV64 target, though nothing in here should prevent that being supported in the future. gdb/ChangeLog: * arch/riscv.h (struct riscv_gdbarch_features) <hw_float_abi>: Delete. <operator==>: Update with for removed field. <hash>: Likewise. * riscv-tdep.h (struct gdbarch_tdep) <features>: Renamed to... <isa_features>: ...this. <abi_features>: New field. (riscv_isa_flen): Update comment. (riscv_abi_xlen): New declaration. (riscv_abi_flen): New declaration. * riscv-tdep.c (riscv_isa_xlen): Update to get answer from isa_features. (riscv_abi_xlen): New function. (riscv_isa_flen): Update to get answer from isa_features. (riscv_abi_flen): New function. (riscv_has_fp_abi): Update to get answer from abi_features. (riscv_call_info::riscv_call_info): Use abi xlen and flen, not isa xlen and flen. (riscv_call_info) <xlen, flen>: Update comment. (riscv_call_arg_struct): Remove invalid assertions (riscv_features_from_gdbarch_info): Update now hw_float_abi field is removed. (riscv_gdbarch_init): Gather isa features and abi features separately, ensure both match on the gdbarch when reusing an old gdbarch. Relax an error check to allow 32-bit abi float to run on a target with 64-bit float hardware.
2018-12-13 18:59:12 +01:00
2019-01-01 Andrew Burgess <andrew.burgess@embecosm.com>
* arch/riscv.h (struct riscv_gdbarch_features) <hw_float_abi>:
Delete.
<operator==>: Update with for removed field.
<hash>: Likewise.
* riscv-tdep.h (struct gdbarch_tdep) <features>: Renamed to...
<isa_features>: ...this.
<abi_features>: New field.
(riscv_isa_flen): Update comment.
(riscv_abi_xlen): New declaration.
(riscv_abi_flen): New declaration.
* riscv-tdep.c (riscv_isa_xlen): Update to get answer from
isa_features.
(riscv_abi_xlen): New function.
(riscv_isa_flen): Update to get answer from isa_features.
(riscv_abi_flen): New function.
(riscv_has_fp_abi): Update to get answer from abi_features.
(riscv_call_info::riscv_call_info): Use abi xlen and flen, not isa
xlen and flen.
(riscv_call_info) <xlen, flen>: Update comment.
(riscv_call_arg_struct): Remove invalid assertions
(riscv_features_from_gdbarch_info): Update now hw_float_abi field
is removed.
(riscv_gdbarch_init): Gather isa features and abi features
separately, ensure both match on the gdbarch when reusing an old
gdbarch. Relax an error check to allow 32-bit abi float to run on
a target with 64-bit float hardware.
2019-01-01 15:45:09 +01:00
2019-01-01 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* source.c (search_command_helper): Stop reverse search
when line 1 has been searched.
2019-01-01 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* record-full.c (record_full_base_target::close): Rewrite
record_full_core_buf_list free logic.
2019-01-01 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* break-catch-syscall.c (print_one_catch_syscall): xfree
the last text.
2019-01-01 Joel Brobecker <brobecker@adacore.com>
* top.c (print_gdb_version): Update Copyright year in version
message.
2019-01-01 Joel Brobecker <brobecker@adacore.com>
Update copyright year range in all GDB files.
2019-01-01, 19 Joel Brobecker <brobecker@adacore.com>
Use gdb::unique_xmalloc_ptr<char> in command_line_input to fix a leak Following the change of logic where the input_handler gets a gdb::unique_xmalloc_ptr<char>, a call to readline directly followed by a call to handle_line_of_input is missing a free, and causes the below leak. Use gdb::unique_xmalloc_ptr<char> to solve the leak. ==16291== VALGRIND_GDB_ERROR_BEGIN ==16291== 64 bytes in 1 blocks are definitely lost in loss record 1,815 of 4,111 ==16291== at 0x4C2E2B3: realloc (vg_replace_malloc.c:836) ==16291== by 0x41EB1C: xrealloc (common-utils.c:62) ==16291== by 0x41DBD3: buffer_grow(buffer*, char const*, unsigned long) [clone .part.1] (buffer.c:40) ==16291== by 0x66E8FF: buffer_grow_char (buffer.h:40) ==16291== by 0x66E8FF: gdb_readline_no_editing (top.c:798) ==16291== by 0x66E8FF: command_line_input(char const*, char const*) (top.c:1249) ==16291== by 0x66EBD8: read_command_file(_IO_FILE*) (top.c:421) ==16291== by 0x412C0C: script_from_file(_IO_FILE*, char const*) (cli-script.c:1547) ==16291== by 0x40BE90: source_script_from_stream (cli-cmds.c:569) ==16291== by 0x40BE90: source_script_with_search(char const*, int, int) (cli-cmds.c:606) ==16291== by 0x54D567: catch_command_errors(void (*)(char const*, int), char const*, int) (main.c:379) ==16291== by 0x54EA84: captured_main_1 (main.c:994) ==16291== by 0x54EA84: captured_main (main.c:1167) ==16291== by 0x54EA84: gdb_main(captured_main_args*) (main.c:1193) ==16291== by 0x29DA27: main (gdb.c:32) ==16291== ==16291== VALGRIND_GDB_ERROR_END gdb/ChangeLog 2018-12-31 Philippe Waroquiers <philippe.waroquiers@skynet.be> * top.c (command_line_input): Use unique_xmalloc_ptr to manage memory allocated by readline.
2018-12-30 20:41:49 +01:00
2019-01-01 06:59:27 +01:00
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2018.
Use gdb::unique_xmalloc_ptr<char> in command_line_input to fix a leak Following the change of logic where the input_handler gets a gdb::unique_xmalloc_ptr<char>, a call to readline directly followed by a call to handle_line_of_input is missing a free, and causes the below leak. Use gdb::unique_xmalloc_ptr<char> to solve the leak. ==16291== VALGRIND_GDB_ERROR_BEGIN ==16291== 64 bytes in 1 blocks are definitely lost in loss record 1,815 of 4,111 ==16291== at 0x4C2E2B3: realloc (vg_replace_malloc.c:836) ==16291== by 0x41EB1C: xrealloc (common-utils.c:62) ==16291== by 0x41DBD3: buffer_grow(buffer*, char const*, unsigned long) [clone .part.1] (buffer.c:40) ==16291== by 0x66E8FF: buffer_grow_char (buffer.h:40) ==16291== by 0x66E8FF: gdb_readline_no_editing (top.c:798) ==16291== by 0x66E8FF: command_line_input(char const*, char const*) (top.c:1249) ==16291== by 0x66EBD8: read_command_file(_IO_FILE*) (top.c:421) ==16291== by 0x412C0C: script_from_file(_IO_FILE*, char const*) (cli-script.c:1547) ==16291== by 0x40BE90: source_script_from_stream (cli-cmds.c:569) ==16291== by 0x40BE90: source_script_with_search(char const*, int, int) (cli-cmds.c:606) ==16291== by 0x54D567: catch_command_errors(void (*)(char const*, int), char const*, int) (main.c:379) ==16291== by 0x54EA84: captured_main_1 (main.c:994) ==16291== by 0x54EA84: captured_main (main.c:1167) ==16291== by 0x54EA84: gdb_main(captured_main_args*) (main.c:1193) ==16291== by 0x29DA27: main (gdb.c:32) ==16291== ==16291== VALGRIND_GDB_ERROR_END gdb/ChangeLog 2018-12-31 Philippe Waroquiers <philippe.waroquiers@skynet.be> * top.c (command_line_input): Use unique_xmalloc_ptr to manage memory allocated by readline.
2018-12-30 20:41:49 +01:00
2019-01-01 06:59:27 +01:00
For older changes see ChangeLog-2018.
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:
2019-01-01 06:59:27 +01:00