binutils-gdb/gdb/ChangeLog

8565 lines
308 KiB
Plaintext
Raw Normal View History

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>
* 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>
* 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