aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-06-25pipe completer & var_string optionsusers/palves/cli-optionsPedro Alves3-15/+200
2019-06-25Make complete_options save arguments tooPedro Alves1-23/+38
2019-06-22Introduce the "with" commandPedro Alves11-50/+677
( See original discussion and prototype here: https://sourceware.org/ml/gdb-patches/2019-05/msg00570.html ) (gdb) help with Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING. Usage: with SETTING [VALUE] [-- COMMAND] Usage: w SETTING [VALUE] [-- COMMAND] With no COMMAND, repeats the last executed command. SETTING is any setting you can change with the "set" subcommands. E.g.: with language pascal -- print obj with print elements unlimited -- print obj As can be seen above, the "with" command is just like "set", but instead of setting the setting permanently, it sets the setting, runs a command and then restores the setting. (gdb) p g_s $1 = {a = 1, b = 2, c = 3} (gdb) with language ada -- print g_s $2 = (a => 1, b => 2, c => 3) Warning: the current language does not match this frame. (gdb) show language The current source language is "auto; currently c". (gdb) with print elements 100 -- with print object on -- print 1 $3 = 1 You can shorten things a bit though, as long as unambiguous. So this: (gdb) with print elements 100 -- with print object off -- print 1 is the same as: (gdb) w p el 100 -- w p o 0 -- p 1 Note that the patch adds a "w" alias for "with", as "w" is not currently taken: (gdb) w Ambiguous command "w": watch, wh, whatis, where, while, while-stepping, winheight, ws. Let me know if you'd prefer to reserve "w" for one of the other commands above. IMHO, this command will end up being used frequently enough that it deserves the "w" shorthand. A nice feature is that this is fully integrated with TAB-completion: (gdb) with p[TAB] pagination print prompt python (gdb) with print [TAB] address max-depth static-members array max-symbolic-offset symbol array-indexes null-stop symbol-filename asm-demangle object symbol-loading demangle pascal_static-members thread-events elements pretty type entry-values raw union frame-arguments repeats vtbl inferior-events sevenbit-strings (gdb) with print [TAB] (gdb) with print elements unlimited -- thread apply all -[TAB] -ascending -c -q -s (gdb) with print elements unlimited -- print -[TAB] -address -max-depth -repeats -vtbl -array -null-stop -static-members -array-indexes -object -symbol -elements -pretty -union The main advantage of this new command compared to command options, like the new "print -OPT", is that this command works with any setting, and, it works nicely when you want to override a setting while running a user-defined command, like: (gdb) with print pretty -- usercmd The disadvantage is that it isn't as compact or easy to type. I think of command options and this command as complementary. I think that even with this new command, it makes sense to continue developing the command options in the direction of exposing most-oft-used settings as command options. Inspired by Philippe's "/" command proposal, if no command is specified, then the last command is re-invoked, under the overridden setting: (gdb) p g_s $1 = {a = 1, b = 2, c = 3} (gdb) with language ada $2 = (a => 1, b => 2, c => 3) Warning: the current language does not match this frame. Note: "with" requires "--" to separate the setting from the command. It might be possible to do without that, but, I haven't tried it yet, and I think that this can go in without it. We can always downgrade to making "--" optional if we manage to make it work. On to the patch itself, the implementation of the command is simpler than one might expect. A few details: - I factored out a bit from pipe_command into repeat_previous directly, because otherwise I'd need to copy&paste the same code and same error message in the with command. - The parse_cli_var_uinteger / parse_cli_var_zuinteger_unlimited / do_set_command changes are necessary since we can now pass an empty string as argument. - do_show_command was split in two, as a FIXME comment suggests, but for a different reason: we need to get a string version of a "set" command's value, and we already had code for that in do_show_command. That code is now factored out to the new get_setshow_command_value_string function. - There's a new "maint with" command added too: (gdb) help maint with Like "with", but works with "maintenance set" variables. Usage: maintenance with SETTING [VALUE] [-- COMMAND] With no COMMAND, repeats the last executed command. SETTING is any setting you can change with the "maintenance set" subcommands. "with" and "maint with" share 99% of the implementation. This might be useful on its own, but it's also useful for testing, since with this, we can use the "maint set/show test-settings" settings for exercising the "with" machinery with all the command type variants (all enum var_types). This is done in the new gdb/base/with.exp testcase. The documentation bits are originally based on Philippe's docs for the "/" command, hence the attribution in the ChangeLog. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * NEWS (New commands): Mention "with" and "maint with". * cli/cli-cmds.c (with_command_1, with_command_completer_1) (with_command, with_command_completer): New. (pipe_command): Adjust to new repeat_previous interface. (_initialize_cli_cmds): Install the "with" command and its "w" alias. * cli/cli-cmds.h (with_command_1, with_command_completer_1): New declarations. * cli/cli-setshow.c (parse_cli_var_uinteger) (parse_cli_var_zuinteger_unlimited, do_set_command): Handle empty argument strings for all var_types. (get_setshow_command_value_string): New, factored out from ... (do_show_command): ... this. * cli/cli-setshow.h: Include <string>. (get_setshow_command_value_string): Declare. * command.h (repeat_previous): Now returns const char *. Adjust comment. * maint.c: Include "cli/cli-cmds.h". (maintenance_with_cmd, maintenance_with_cmd_completer): New. (_initialize_maint_cmds): Register the "maintenance with" command. * top.c (repeat_previous): Move bits from pipe_command here: Return the saved command line, if any; error out if there's no command to relaunch. gdb/doc/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.texinfo (Command Settings): New node documenting the general concept of settings, how to change them, and the new "with" command. (Maintenance Commands): Document "maint with". gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * gdb.base/with.c: New file. * gdb.base/with.exp: New file.
2019-06-22"maint test-settings set/show" -> "maint set/show test-settings"Pedro Alves4-102/+83
This commit renames "maint test-settings set/show" to "maint set/show test-settings". This helps the following patch, which introduce a "maint with" command what works with all "maint set" settings. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * NEWS (New commands): Mention "maint set/show test-settings" instead of "maint test-settings". * maint-test-settings.c (maintenance_test_settings_list): Delete. (maintenance_test_settings_set_list): Rename to ... (maintenance_set_test_settings_list): ... this. (maintenance_test_settings_show_list): Rename to ... (maintenance_show_test_settings_list): ... this. (maintenance_test_settings_cmd): Delete. (maintenance_test_settings_set_cmd): ... (maintenance_set_test_settings_cmd): ... this. (maintenance_test_settings_show_cmd): ... (maintenance_show_test_settings_cmd): ... this. (maintenance_test_settings_show_value_cmd): (maintenance_show_test_settings_value_cmd): ... this. (_initialize_maint_test_settings): No longer install the "maint test-settings" prefix command. Rename "maint test-settings set" to "maint set test-settings", and "maint test-settings show" to "maint show test-settings". Adjust all subcommands. gdb/doc/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * gdb.texinfo (Maintenance Commands): Document "maint set/show test-settings" instead of "maint test-settings set/show". gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * gdb.base/settings.exp: Replace all references to "maint test-settings set" with references to "maint set test-settings", and all references to "maint test-settings show" with references to "maint show test-settings".
2019-06-22Fix a few comments in maint-test-settings.cPedro Alves1-6/+6
Fix the file's intro comment, and s/test-options/test-settings/. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * maint-test-settings.c: Fix file's intro comment. Replace all references to "test-options" with references to "test-settings", in comments.
2019-06-22Fix defaults of some "maint test-settings" subcommandsPedro Alves2-6/+19
New tests added later for the incoming "with" command exposed a couple invalid-default-value bugs in the "maint test-settings" commands: - var_filename commands don't allow setting the filename to the empty string (unlike var_optional_filename commands), yet, "maint test-settings filename"'s control variable was not initialized, so on startup, "maint test-settings show filename" shows an empty string. - "maint test-settings enum"'s control variable was not initialized, so on startup, "maint test-settings show enum" shows an empty value instead of a valid enum value. Both issues are fixed by initializing the control variables. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * maint-test-settings.c (maintenance_test_settings_xxx) (maintenance_test_settings_yyy, maintenance_test_settings_zzz): New. (maintenance_test_settings_enums): Use them. (maintenance_test_settings_enum): Default to maintenance_test_settings_xxx. (_initialize_maint_test_settings): Initialize MAINTENANCE_TEST_SETTINGS_FILENAME. gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * gdb.base/settings.exp (test-string): Adjust expected out when testing "maint test-settings show filename"
2019-06-18Make "info threads" use the gdb::option frameworkPedro Alves3-12/+90
I had this in my local "print -OPT" branch, but had decided not to include in the original series, because it's not as useful as the others. I'm sending it now, since I had it written anyway. This makes "info threads" use the gdb::option framework to process options. There's only one option today (-gid), and it isn't used much frequently unless you're looking at matching MI output. Still, this was in the neighborhood of "thread apply" so I had converted it. The main advantage is that TAB completion now shows you the available options, and gives you a hint to what the command accepts as operand argument, including showing a metasyntactic variable: (gdb) info threads [TAB] -gid ID (gdb) help info threads Display currently known threads. Usage: info threads [OPTION]... [ID]... Options: -gid Show global thread IDs. If ID is given, it is a space-separated list of IDs of threads to display. Otherwise, all threads are displayed. (gdb) gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * NEWS (Completion improvements): Mention "info threads". * thread.c (struct info_threads_opts, info_threads_option_defs) (make_info_threads_options_def_group): New. (info_threads_command): Use gdb::option::process_options. (info_threads_command_completer): New. (_initialize_thread): Use gdb::option::build_help to build the help text for "info threads". gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.base/options.exp (test-info-threads): New procedure. (top level): Call it.
2019-06-18Automatic date update in version.inGDB Administrator1-1/+1
2019-06-17[gdb] Fix heap-buffer-overflow in child_pathTom de Vries2-1/+7
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-17PR gdb/24364: Don't call dtrace_process_dof with NULL dof.Paul Pluzhnikov2-4/+11
2019-06-17i386: Check vector length for vshufXXX/vinsertXXX/vextractXXXH.J. Lu8-15/+154
Since not all vector lengths are supported by vshufXXX, vinsertXXX and vextractXXX, decode them only with supported vector lengths. gas/ PR binutils/24691 * testsuite/gas/i386/disassem.s: Add test for vshuff32x4 with invalid vector length. * testsuite/gas/i386/x86-64-disassem.s: Likewise. * testsuite/gas/i386/disassem.d: Updated. * testsuite/gas/i386/x86-64-disassem.d: Likewise. opcodes/ PR binutils/24691 * i386-dis-evex.h (evex_table): Update EVEX_W_0F3A23_P_2, EVEX_W_0F3A38_P_2, EVEX_W_0F3A39_P_2, EVEX_W_0F3A3A_P_2, EVEX_W_0F3A3B_P_2 and EVEX_W_0F3A43_P_2. (evex_len_table): Add EVEX_LEN_0F3A23_P_2_W_0, EVEX_LEN_0F3A23_P_2_W_1, EVEX_LEN_0F3A38_P_2_W_0, EVEX_LEN_0F3A38_P_2_W_1, EVEX_LEN_0F3A39_P_2_W_0, EVEX_LEN_0F3A39_P_2_W_1, EVEX_LEN_0F3A3A_P_2_W_0, EVEX_LEN_0F3A3A_P_2_W_1, EVEX_LEN_0F3A3B_P_2_W_0, EVEX_LEN_0F3A3B_P_2_W_1, EVEX_LEN_0F3A43_P_2_W_0 and EVEX_LEN_0F3A43_P_2_W_1. * i386-dis.c (EVEX_LEN_0F3A23_P_2_W_0): New enum. (EVEX_LEN_0F3A23_P_2_W_1): Likewise. (EVEX_LEN_0F3A38_P_2_W_0): Likewise. (EVEX_LEN_0F3A38_P_2_W_1): Likewise. (EVEX_LEN_0F3A39_P_2_W_0): Likewise. (EVEX_LEN_0F3A39_P_2_W_1): Likewise. (EVEX_LEN_0F3A3A_P_2_W_0): Likewise. (EVEX_LEN_0F3A3A_P_2_W_1): Likewise. (EVEX_LEN_0F3A3B_P_2_W_0): Likewise. (EVEX_LEN_0F3A3B_P_2_W_1): Likewise. (EVEX_LEN_0F3A43_P_2_W_0): Likewise. (EVEX_LEN_0F3A43_P_2_W_1): Likewise.
2019-06-17aarch64: remove unnecessary loc_hash_table traversalSzabolcs Nagy2-24/+6
The loc_hash_table should only contain local ifunc symbols. The current code already aborts if there is anything else and for defined ifunc symbols elfNN_aarch64_allocate_dynrelocs is a no-op. bfd/ChangeLog: * elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs): Remove. (elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table traversal with elfNN_aarch64_allocate_local_dynrelocs.
2019-06-17Automatic date update in version.inGDB Administrator1-1/+1
2019-06-16[gdb/contrib] Fix gdb/contrib/gdb-add-index.sh for dwz-m-ed execsTom de Vries2-47/+96
Atm gdb-add-index.exp fails with target board cc-with-dwz-m. Fix this by updating gdb/contrib/gdb-add-index.sh to handle a dwz-m-ed executable. Tested on x86_64-linux. gdb/ChangeLog: 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-16Don't cast a tui_win_info directly to tui_gen_win_infoTom Tromey2-3/+8
I found a few spots that directly cast a tui_win_info to a tui_gen_win_info. However, I think it's a bit better here to take the address of the "generic" member. As far as I know, nothing relies on being able to downcast here, so this gives us the freedom to rearrange the structure. gdb/ChangeLog 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-16Remove more unnecessary casts of NULLTom Tromey4-19/+24
I found a few more spots that unnecessarily cast NULL to a pointer type. My earlier search included a "*" in the cast, but these use a typedef to a pointer type instead. This patch removes these casts. gdb/ChangeLog 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-16gdb: Remove unused signal maskAndrew Burgess2-6/+5
In the following commit: commit 7feb7d068ae65557ede03c36468ebac61b0939ca Date: Mon May 11 12:08:03 2009 +0000 The last useful uses of normal_mask in linux-nat.c were removed, since then this variable has sat around being initialised, but never used. There should be no user visible changes after this commit. gdb/ChangeLog: * linux-nat.c (normal_mask): Delete. (_initialize_linux_nat): Don't initialise normal_mask.
2019-06-16Write index for dwz -m fileSimon Marchi8-150/+280
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-16Replace uses of concat with xstrdupTom Tromey3-2/+7
I noticed a couple of spots using concat that could use xstrdup instead. This patch fixes these. gdb/ChangeLog 2019-06-16 Tom Tromey <tom@tromey.com> * coffread.c (process_coff_symbol): Use xstrdup. * value.c (create_internalvar): Use xstrdup.
2019-06-16Remove unnecessary casts of NULLTom Tromey25-92/+128
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-16gdb/testsuite: Improve detection of bug gdb/24541Andrew Burgess2-0/+9
In bug gdb/24686 a testsuite failure was reported, this failure was actually just another instance of bug gdb/24541, however, due to the non-deterministic nature of bug gdb/24541 the testsuite pattern that was intended to catch this bug failed. This commit adds a second pattern to help detect gdb/24541, which should change the FAIL reported in gdb/24686 into a KFAIL. gdb/testsuite/ChangeLog: PR gdb/24686 * gdb.mi/mi-catch-cpp-exceptions.exp: Add an extra pattern to improve detection of bug gdb/24541.
2019-06-16Remove some NULL checks from the TUITom Tromey2-16/+12
I found a few spots in the TUI that were NULL-checking the result of XNEW. This cannot return NULL, so this patch removes the checks. gdb/ChangeLog 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-06-16Fix some whitespace issues in gdb ChangeLogsSimon Marchi3-19/+19
2019-06-16Make gdb.base/index-cache.exp work with readnow board (PR 24669)Simon Marchi2-20/+37
The gdb.base/index-cache.exp test fails with the readnow board: $ make check TESTS="gdb.base/index-cache.exp" RUNTESTFLAGS="--target_board=readnow" FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was created FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: expected file is there FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: check index-cache stats FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats The problem is similar to what was fixed in 5a56d6a65f84 ("[gdb/testsuite] Fix index-cache.exp with cc-with-{gdb-index,debug-names}") In that commit, gdb.base/index-cache.exp was modified to account for the fact that the index cache is not used when the binary already has an embedded index. The same situation happens when GDB is started with the -readnow flag: it bypasses indices and partial symbols. So this patch updates the test to also expect the index cache not to be used if -readnow is present in $GDBFLAGS, gdb/testsuite/ChangeLog: PR gdb/24669 * gdb.base/index-cache.exp (uses_readnow, expecting_index_cache_use): Define global variable. (test_cache_enabled_miss, test_cache_enabled_hit): Use expecting_index_cache_use.
2019-06-16Automatic date update in version.inGDB Administrator1-1/+1
2019-06-16gdb/fortran: Show the type for non allocated / associated typesAndrew Burgess9-57/+283
Show the type of not-allocated and/or not-associated types. For array types and pointer to array types we are going to print the number of ranks. Consider this Fortran program: program test integer, allocatable :: vla (:) logical l allocate (vla(5:12)) l = allocated (vla) end program test And this GDB session with current HEAD: (gdb) start ... 2 integer, allocatable :: vla (:) (gdb) n 4 allocate (vla(5:12)) (gdb) ptype vla type = <not allocated> (gdb) p vla $1 = <not allocated> (gdb) And the same session with this patch applied: (gdb) start ... 2 integer, allocatable :: vla (:) (gdb) n 4 allocate (vla(5:12)) (gdb) ptype vla type = integer(kind=4), allocatable (:) (gdb) p vla $1 = <not allocated> (gdb) The type of 'vla' is now printed correctly, while the value itself still shows as '<not allocated>'. How GDB prints the type of associated pointers has changed in a similar way. gdb/ChangeLog: * 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/testsuite/ChangeLog: * gdb.fortran/pointers.f90: New file. * gdb.fortran/print_type.exp: New file. * gdb.fortran/vla-ptype.exp: Adapt expected results. * gdb.fortran/vla-type.exp: Likewise. * gdb.fortran/vla-value.exp: Likewise. * gdb.mi/mi-vla-fortran.exp: Likewise.
2019-06-15gdb/mi: New commands to catch C++ exceptionsAndrew Burgess14-37/+580
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-06-15gdb: Don't allow annotations to influence what else GDB printsAndrew Burgess8-45/+52
The annotations should be additional information printed by GDB to be consumed by users (GUIs), but GDB shouldn't reduce what it prints based on whether annotations are on or not. However, this is what happens for annotate_source_line. This commit makes annotate_source_line a void function that simply outputs the annotation information, GDB will then print the contents of the source line to the terminal in the normal way. Some tests needed to be updated after this commit. gdb/ChangeLog: * 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/testsuite/ChangeLog: * gdb.base/annota1.exp: Update expected results. * gdb.cp/annota2.exp: Likewise. * gdb.cp/annota3.exp: Likewise.
2019-06-15gdb: Remove an update of current_source_line and current_source_symtabAndrew Burgess6-43/+62
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-15gdb: New function to open source file and compute line charpos dataAndrew Burgess4-29/+41
Every place that a symtab's line_charpos data is loaded always follows the same pattern, so create a new function to contain this logic and make use of it throughout GDB. There should be no user visible changes after this commit. gdb/ChangeLog: * 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-15gdb: Remove unused parameterAndrew Burgess2-9/+9
The parameter 'fullname' is always passed as NULL to the function get_filename_and_charpos in source.c, so lets remove the parameter. There should be no user visible changes after this commit. gdb/ChangeLog: * source.c (get_filename_and_charpos): Remove fullname parameter. (identify_source_line): Update call to get_filename_and_charpos.
2019-06-15gdb: Remove file path from test nameAndrew Burgess2-1/+6
Having paths in test names makes comparing sum files difficult, rename a test to avoid paths in test names. gdb/testsuite/ChangeLog: * gdb.base/style-logging.exp: Remove path from test name.
2019-06-15Automatic date update in version.inGDB Administrator1-1/+1
2019-06-14Do not emit style escape sequences to log fileTom Tromey7-3/+136
PR gdb/24502 requests that the "set logging" log file not contain style escape sequences emitted by gdb. This seemed like a reasonable request to me, so this patch implements filtering for the log file. This also updates a comment in ui-style.h that I noticed while writing the patch. Tested on x86-64 Fedora 29. gdb/ChangeLog 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. gdb/testsuite/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> PR gdb/24502: * gdb.base/style-logging.exp: New file.
2019-06-14Minor NEWS rearrangementTom Tromey2-4/+8
I noticed that a NEWS item about Python scripting changes appeared between an item about a convenience function and an item about a convenience variable. I think it's better for the latter to be next to each other. gdb/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> * NEWS: Move convenience variable news above Python news.
2019-06-14Move gnulib to top levelTom Tromey333-281/+1420
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-06-14Warn if add-symbol-file does not provide any symbolsTom Tromey5-6/+61
A user suggested that add-symbol-file ought to warn if the file does not in fact provide any symbols. This seemed like a decent idea, so this patch implements this idea. Tested on x86-64 Fedora 29. gdb/ChangeLog 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. gdb/testsuite/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> * gdb.base/symfile-warn.exp: New file. * gdb.base/symfile-warn.c: New file.
2019-06-14Only compute realpath when basenames_may_differ is setTom Tromey4-5/+68
A user noted that, when sources are symlinked, gdb annotations will print the real path, rather than the name of the symlink. It seems to me that it is better to print the name of the file that was actually used in the build, unless there is some reason not to. This patch implements this, with the caveat that it will not work when basenames-may-differ is enabled. The way this mode is currently implemented, returning the symbolic (not real) path is not possible. While I think it would be good to redo the source file name cache and perhaps integrate it with class source_cache, I haven't done so here. Regression tested on x86-64 Fedora 29. gdb/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> * source.c (find_and_open_source): Respect basenames_may_differ. gdb/testsuite/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> * gdb.base/annotate-symlink.exp: New file.
2019-06-14gdb: Use scoped_restore_terminal_state in annotate.cAndrew Burgess2-16/+8
In a couple of places in annotate.c we are manually backing up and restoring the terminal ownership, we could instead make use of scoped_restore_terminal_state. gdb/ChangeLog: * annotate.c (annotate_breakpoints_invalid): Make use of scoped_restore_terminal_state. (annotate_frames_invalid): Likewise.
2019-06-14Allow re-assigning to convenience variablesTom Tromey4-1/+19
In Ada mode, re-assigning an array of a different size to a convenience variable will cause an error: (gdb) set lang ada (gdb) set $v := "abc" (gdb) set $v := "abcd" cannot assign arrays of different length However, this does not really make sense -- instead, it should always be possible to overwrite a convenience variable. This patch fixes this bug. This was reviewed off-list by Joel. I'm checking it in. gdb/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> * ada-lang.c (ada_evaluate_subexp) <case BINOP_ASSIGN>: Always allow assignment to an internalvar. gdb/testsuite/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> * gdb.ada/set_wstr.exp: Add reassignment test.
2019-06-14Recognize _ in attribute namesTom Tromey4-9/+20
Ada attribute names can contain "_", but the lexer currently does not allow this -- even though the "attributes" array lists some attributes spelled this way. This patch fixes the bug and adds test cases for the existing attributes. This was reviewed off-list by Joel. I'm checking it in. gdb/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> * ada-lex.l: Allow "_" in attribute names. gdb/testsuite/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> * gdb.ada/formatted_ref.exp (test_p_x_addr): Check 'unchecked_access and 'unrestricted_access as well.
2019-06-14Remove alloca(0) callsTom Tromey3-11/+6
PR gdb/24653 points out that a gcc snapshot will complain about the calls to alloca(0) in gdb. These calls are only needed when using the C alloca. I'm inclined to think that no current platform needs this, so this patch removes the calls. Let me know what you think. gdb/ChangeLog 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-14Fix gdb.ada/vla.expTom Tromey3-4/+16
PR ada/24539 concerns a test failure in gdb.ada/vla.exp. The problem here is that different versions of Gnat emit the structure's fields in different orders -- with the order currently failing actually being the correct one. Joel pointed out that this can be fixed by simply adding the No_Component_Reordering pragma to the type in question, which is what this patch does. I've reported a Gnat compiler bug internally in hopes of getting the underlying problem fixed. gdb/testsuite/ChangeLog 2019-06-14 Tom Tromey <tromey@adacore.com> PR ada/24539: * gdb.ada/vla.exp: Update tests. * gdb.ada/vla/vla.adb (Record_Type): Use No_Component_Reordering pragma.
2019-06-14Add R_AARCH64_P32_MOVW_PREL_* ELF32 relocsSzabolcs Nagy10-3/+63
These ilp32 relocations were missing for some reason. bfd/ChangeLog: * elfnn-aarch64.c: Enable MOVW_PREL relocs for ELF32. include/ChangeLog: * elf/aarch64.h (R_AARCH64_P32_MOVW_PREL_G0): Define. (R_AARCH64_P32_MOVW_PREL_G0_NC): Define. (R_AARCH64_P32_MOVW_PREL_G1): Define. ld/ChangeLog: * testsuite/ld-aarch64/aarch64-elf.exp: Add emit-relocs-22 and -23. * testsuite/ld-aarch64/emit-relocs-22.d: New test. * testsuite/ld-aarch64/emit-relocs-22.s: New test. * testsuite/ld-aarch64/emit-relocs-23.d: New test. * testsuite/ld-aarch64/emit-relocs-23.s: New test.
2019-06-14Updated French translation for the opcodes subdirectory.Nick Clifton2-78/+86
* po/fr.po; Updated French translation.
2019-06-14Regenerate with approved autotools versionAlan Modra16-80/+64
bfd/ * Makefile.in: Regenerate. * configure: Regenerate. binutils/ * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * doc/Makefile.in: Regenerate. gas/ * Makefile.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. ld/ * Makefile.in: Regenerate. * configure: Regenerate. libctf/ * configure: Regenerate.
2019-06-14Fix alpha testsuite regressionAlan Modra4-4/+11
readelf st_other display improved for alpha. PR 24662 * testsuite/ld-alpha/tlsbin.rd: Update. * testsuite/ld-alpha/tlsbinr.rd: Update. * testsuite/ld-alpha/tlspic.rd: Update.
2019-06-14PowerPC comment fixesAlan Modra2-5/+9
"paddi rt,sym@pcrel" as an abbreviation for "paddi rt,0,sym@pcrel,1" is invalid, so replace with "pla rt,sym@pcrel" which is a valid form of "pla rt,sym@pcrel(0),1". * elf64-ppc.c: Fix comments involving paddi.
2019-06-14Automatic date update in version.inGDB Administrator1-1/+1
2019-06-13Fix "set integer-command unlimited junk"Pedro Alves4-4/+43
With integer commands that support "unlimited", we currently fail to notice junk after "unlimited": (gdb) show print elements Limit on string chars or array elements to print is 200. (gdb) set print elements unlimited foo (gdb) show print elements Limit on string chars or array elements to print is unlimited. This commit fixes that. After, we get: (gdb) set print elements unlimited foo Junk after "unlimited": foo gdb/ChangeLog: 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. gdb/testsuite/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * gdb.base/settings.exp (test-integer): Test junk after "unlimited".