aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-02-13gdbserver: rename source files to .ccSimon Marchi66-68/+75
For the same reasons outlined in the previous patch, this patch renames gdbserver source files to .cc. I have moved the "-x c++" switch to only those rules that require it. gdbserver/ChangeLog: * Makefile.in: Rename source files from .c to .cc. * %.c: Rename to %.cc. * configure.ac: Rename server.c to server.cc. * configure: Re-generate.
2020-02-13gdbsupport: rename source files to .ccSimon Marchi40-133/+139
This patch renames the .c source files in gdbsupport to .cc. In the gdb directory, there is an argument against renaming the source files, which is that it makes using some git commands more difficult to do archeology. Some commands have some kind of "follow" option that makes git try to follow renames, but it doesn't work in all situations. Given that we have just moved the gdbsupport directory, that argument doesn't hold for source files in that directory. I therefore suggest renaming them to .cc, so that they are automatically recognized as C++ by various tools and editors. The original motivation behind this is that when building gdbsupport with clang, I get: CC agent.o clang: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Werror,-Wdeprecated] In the gdb/ directory, we make clang happy by passing "-x c++". We could do this in gdbsupport too, but I think that renaming the files is a better long-term solution. gdbserver still does its own build of gdbsupport, so a few changes in its Makefile are necessary. gdbsupport/ChangeLog: * Makefile.am: Rename source files from .c to .cc. (CC, CFLAGS): Don't override. (AM_CFLAGS): Rename to ... (AM_CXXFLAGS): ... this. * Makefile.in: Re-generate. * %.c: Rename to %.cc. gdbserver/ChangeLog: * Makefile.in: Rename gdbsupport source files from .c to .cc.
2020-02-13[gdb/testsuite] Remove stale exec in gdb_compile_adaTom de Vries2-0/+6
When running test-case gdb.ada/ptype_tagged_param.exp, I get: ... PASS: gdb.ada/ptype_tagged_param.exp: compilation foo.adb ... However, when I then de-install gnatmake and run again, I get the same result. This is due to a stale exec. After removing the stale exec, I get: ... UNSUPPORTED: gdb.ada/ptype_tagged_param.exp: compilation foo.adb ... Fix this removing the stale exec in gdb_compile_ada before compilation. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-02-13 Tom de Vries <tdevries@suse.de> * lib/ada.exp (gdb_compile_ada): Delete stale exec before compilation.
2020-02-13[gdb/testsuite] Add unsupported tests in catch_ex_std.expTom de Vries2-0/+17
If I de-install gnatbind, I run into: ... FAIL: gdb.ada/catch_ex_std.exp: gnatbind foo ... Fix this by marking the test unsupported instead: ... UNSUPPORTED: gdb.ada/catch_ex_std.exp: gnatbind foo ... Likewise for gnatlink. Tested on x86_64-linux, with and without gnatbind/gnatlink installed. gdb/testsuite/ChangeLog: 2020-02-13 Tom de Vries <tdevries@suse.de> * gdb.ada/catch_ex_std.exp: Indicate unsupported if gnatbind/gnatlink are missing.
2020-02-13plugin: Search bfd-plugins directories only onceH.J. Lu2-39/+50
try_load_plugin is updated to take either plugin name or plugin entry. load_plugin is updated to search bfd-plugins directories first to build a list of plugins and call try_load_plugin with each plugin on the list. When --plugin is used, the plugin list only has one entry. * plugin.c (try_load_plugin): Make plugin_list_iter an argument and use it if it isn't NULL. Remove has_plugin_p argument. Add a build_list_p argument. Don't search plugin_list. Short circuit when building the plugin list. (has_plugin): Renamed to has_plugin_list. (bfd_plugin_set_plugin): Don't set has_plugin. (bfd_plugin_specified_p): Check plugin_list instead. (build_plugin_list): New function. (load_plugin): Call build_plugin_list and use plugin_list.
2020-02-13Adding myself to gdb/MAINTAINERSAlok Kumar Sharma2-0/+5
2020-02-13 Alok Kumar Sharma <AlokKumar.Sharma@amd.com> * MAINTAINERS (Write After Approval): Adding myself. Change-Id: I2e6095a63247902f5fe23d58c2df8f995e41cf58
2020-02-13x86: fix SSE4a dependencies of ".arch .nosse*"Jan Beulich5-5/+27
Since ".arch .sse4a" enables SSE3 and earlier, disabling SSE3 should also disable SSE4a. And as per its name, ".arch .nosse4" should also do so.
2020-02-13[gdb/testsuite] Fix gnatmake_version_at_leastTom de Vries2-1/+8
After de-installing gnatmake, I get: ... Running src/gdb/testsuite/gdb.ada/rename_subscript_param.exp ... ERROR: tcl error sourcing src/gdb/testsuite/gdb.ada/rename_subscript_param.exp. ERROR: couldn't execute "gnatmake": no such file or directory while executing "exec $gnatmake --version" (procedure "gnatmake_version_at_least" line 4) ... Fix this by wrapping the exec call in a catch call. Tested with and withouth gnatmake installed on x86_64-linux. gdb/testsuite/ChangeLog: 2020-02-13 Tom de Vries <tdevries@suse.de> * lib/ada.exp (gnatmake_version_at_least): Wrap exec call in a catch call.
2020-02-12Remove some dead code from event-loop.cTom Tromey2-33/+5
This removes some dead code from event-loop.c. This patch is from my old series to merge the gdb and gdbserver event loops; but since it is just removing dead code, it seemed simple to commit it separately. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * event-loop.c (event_data, gdb_event, event_handler_func): Remove.
2020-02-13Automatic date update in version.inGDB Administrator1-1/+1
2020-02-12Move the frame data to the BFD when possibleTom Tromey2-5/+42
Now that comp_unit and the remaining frame data are all independent of the objfile, it can all be stored on the BFD and shared across inferiors. As with other code doing this same thing, care must be taken to not share the data when the objfile requires relocations. So, two keys are used: one for the BFD and one for the objfile, and gdb_bfd_requires_relocations is used to differentiate between the two cases. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * dwarf2/frame.c (dwarf2_frame_bfd_data): New global. (dwarf2_frame_objfile_data): Add comment. (find_comp_unit, set_comp_unit): New functions. (dwarf2_frame_find_fde): Use find_comp_unit. (dwarf2_build_frame_info): Use set_comp_unit.
2020-02-12Remove the objfile backlink from comp_unitTom Tromey2-13/+23
This removes the objfile backlink from comp_unit. The only remaining uses involved fetching the text offset from the objfile. However, this is already conveniently computed at all the sites that call execute_cfa_program, and so it can simply be passed in. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * dwarf2/frame.c (struct comp_unit) <objfile>: Remove. (comp_unit): Don't initialize objfile. (execute_cfa_program): Add text_offset parameter. (execute_cfa_program_test, dwarf2_fetch_cfa_info) (dwarf2_frame_cache): Update. (dwarf2_build_frame_info): Don't set "objfile" member.
2020-02-12Remove a use of the comp_unit backlinkTom Tromey2-8/+20
The DWARF frame comp_unit object still has a backlink to the objfile. In order to be truly objfile-independent, this must be removed. This patch removes one such use, by passing the gdbarch to decode_frame_entry directly. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * dwarf2/frame.c (decode_frame_entry_1): Add gdbarch parameter. (decode_frame_entry): Likewise. (dwarf2_build_frame_info): Update.
2020-02-12Add per-unit obstackTom Tromey2-2/+10
This adds an auto_obstack to the DWARF frame comp_unit object, and then changes the remaining code here to use the comp_unit obstack rather than the objfile obstack. At this point, all the storage for frame data is self-contained -- that is, it is independent of the objfile. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * dwarf2/frame.c (struct comp_unit) <obstack>: New member. (decode_frame_entry_1): Use the comp_unit obstack.
2020-02-12Store the comp_unit instead of the FDE tableTom Tromey2-25/+34
This changes the DWARF frame code to store the comp_unit on the objfile, rather than storing the FDE table. It also changes the comp_unit to be heap-allocated using "new". This change makes it simpler for a later patch to add a field to the comp_unit, and to have deallaction work properly. This in turn is important for making the frame data be independent of the objfile. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * dwarf2/frame.c (struct comp_unit): Add initializers and constructor. (dwarf2_frame_objfile_data): Store a comp_unit. (dwarf2_frame_find_fde): Update. (dwarf2_build_frame_info): Use "new".
2020-02-12Change fde table to a vectorTom Tromey2-115/+70
This removes struct dwarf2_fde_table, replacing it with a typedef of std::vector. This simplifies the code somewhat. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * dwarf2/frame.c (struct dwarf2_fde_table): Remove. (dwarf2_fde_table): Typedef for std::vector. (dwarf2_frame_objfile_data): Remove the deleter. Now static. (dwarf2_frame_find_fde, add_fde, decode_frame_entry_1) (decode_frame_entry): Update. (dwarf2_build_frame_info): Use "new".
2020-02-12Change booleans to bool in ARM's gdbarch_tdepChristian Biesinger3-18/+27
gdb/ChangeLog: 2020-02-12 Christian Biesinger <cbiesinger@google.com> * arm-tdep.c (arm_gdbarch_init): Update. * arm-tdep.h (struct gdbarch_tdep) <have_fpa_registers, have_wmmx_registers, have_vfp_pseudos, have_neon_pseudos, have_neon, is_m>: Change to bool.
2020-02-12Print more information in arm_dump_tdepChristian Biesinger2-0/+18
I am keeping the (int) casts because a future patch will change the type to bool. gdb/ChangeLog: 2020-02-12 Christian Biesinger <cbiesinger@google.com> * arm-tdep.c (arm_dump_tdep): Print more fields of tdep.
2020-02-12Remove dwarf_expr_batonTom Tromey2-9/+4
The type dwarf_expr_baton is unused and can be removed. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * dwarf2/loc.c (struct dwarf_expr_baton): Remove. Change-Id: Id8342da31398b9b4b08f31be7c3d612e9590bbbf
2020-02-12Fix kill of processes created by win32_create_inferiorHannes Domani2-0/+7
handle_v_kill uses signal_pid because win32 doesn't support multi-process. Without this gdb just refuses to kill the process: (gdb) kill Kill the program being debugged? (y or n) y Sending packet: $vKill;a410#33...Packet received: E01 Packet vKill (kill) is supported Can't kill process gdbserver/ChangeLog: 2020-02-12 Hannes Domani <ssbssa@yahoo.de> * win32-low.c (win32_create_inferior): Set signal_pid.
2020-02-12Cache the Thread Local Base pointer type in the gdbarchHannes Domani2-8/+12
gdb/ChangeLog: 2020-02-12 Hannes Domani <ssbssa@yahoo.de> * windows-tdep.c (struct windows_gdbarch_data): Add tib_ptr_type. (windows_get_tlb_type): Use windows_gdbarch_data->tib_ptr_type.
2020-02-12x86: correct VFPCLASSP{S,D} operand size handlingJan Beulich9-9/+137
With AVX512VL disabled (e.g. when writing code for the Knights family of processors) these insns aren't ambiguous when used with a memory source, and hence should be accepted without suffix or operand size specifier. When AVX512VL is enabled, to be consistent with this as well as other ambiguous operand size handling it would seem better to just warn about the ambiguity in AT&T mode, and still default to 512-bit operands (on the assumption that the code may have been written without AVX512VL in mind yet), but it was requested to leave AT&T syntax mode alone here.
2020-02-12x86: fold two JMP templatesJan Beulich3-16/+8
Now that the AMD64 check in match_template() applies to 64-bit code only, the non-64-bit and the Amd64 template can be folded, as being otherwise compatible with one another. (Oddly enough the same doesn't apply to CALL, due to the suffixes it permits, while JMP doesn't allow for any.)
2020-02-12x86-64: Intel64 adjustments for insns dealing with far pointersJan Beulich15-28/+224
AMD and Intel differ in their handling of far indirect branches as well as LFS/LGS/LSS: AMD CPUs ignore REX.W while Intel ones honors it. (Note how the latter three were hybrids so far, while far branches were fully AMD-like.)
2020-02-12Disable gdbserver on host != target configurationsMaciej W. Rozycki2-2/+16
Correct fallout from commit 919adfe84092 ("Move gdbserver to top level") and revert to not building `gdbserver' in a cross-configuration, that is where host != target, matching the documented behaviour. We have no way to support non-native `gdbserver', and native `gdbserver' is usually of no use with cross-GDB of the chosen host. gdbserver/ChangeLog: 2020-02-12 Maciej W. Rozycki <macro@wdc.com> Pedro Alves <palves@redhat.com> Skip building gdbserver in a cross-configuration. * configure.srv: Set $gdbserver_host depending on whether $target is $host. Use $gdbserver_host instead of $host.
2020-02-12[gdb] Fix -Wstrict-null-sentinel warning (--with-iconv-bin)Tom de Vries1-1/+2
When using configure flag --with-iconv-bin=$(which iconv), we run into: ... gdb/charset.c: In function 'void find_charset_names()': gdb/charset.c:821:75: error: missing sentinel in function call [-Werror=format=] iconv_program = concat (iconv_dir.c_str(), SLASH_STRING, "iconv", NULL); ^ cc1plus: all warnings being treated as errors ... Fix the warning. Build and reg-tested on x86_64-linux. 2020-02-12 Lukas Durfina <ldurfina@tachyum.com> Tom de Vries <tdevries@suse.de> * charset.c (find_charset_names): Cast concat NULL sentinel to char *.
2020-02-12x86: also disallow non-byte/-word registers with byte/word suffixJan Beulich7-71/+62
Along the lines of be4c5e58bd ("x86: Always disallow double word suffix with word general register") also adjust check_{byte,word}_reg(), to make overall behavior consistent again in this regard.
2020-02-12x86/Intel: improve diagnosticsJan Beulich2-4/+11
The diagnostics issued by check_*_reg() are pretty AT&T-centric. Re-use logic already used for SIMD memory operand size checking also for ones where GPRs would alternatively also be allowed. (There's certainly room for further improvement here.)
2020-02-11Update a comment in psymtab.hTom Tromey2-1/+7
This updates a comment in psymtab.h to reflect the current reality. gdb/ChangeLog 2020-02-11 Tom Tromey <tom@tromey.com> * psymtab.h: Update comment. Change-Id: I438bb5929c3ebd1a4c6e9a902490f2ef63014ab3
2020-02-11Don't allow copying of auto_obstackTom Tromey2-0/+7
Add DISABLE_COPY_AND_ASSIGN to struct auto_obstack, to prevent copying it. Copying an auto_obstack would be a bug. 2020-02-11 Tom Tromey <tom@tromey.com> * gdb_obstack.h (struct auto_obstack): Use DISABLE_COPY_AND_ASSIGN. Change-Id: Ic9e5ab20acfcfa61c241fed4d99bbb1caefba3cd
2020-02-11Don't forward-declare struct objfile in dwarf2/frame.hTom Tromey2-1/+4
dwarf2/frame.h forward-declares struct objfile, but there's no need for this. gdb/ChangeLog 2020-02-11 Tom Tromey <tom@tromey.com> * dwarf2/frame.h (struct objfile): Don't forward declare. Change-Id: I4d54d46ac9422eeb64dc5f0b934792e77a875aa5
2020-02-12Automatic date update in version.inGDB Administrator1-1/+1
2020-02-11Plugin: Treat each object as independentH.J. Lu2-38/+45
Since plugin treats each object as independent, we must do a fresh dlopen of plugin for each object. PR binutils/25355 * plugin.c (try_claim): Always clean up for LTO wrapper. (try_load_plugin): Treat each object as independent. Create a copy for plugin name.
2020-02-11Remove use of deprecated_add_core_fns in cris_tdep.cChristian Biesinger2-43/+37
The non-deprecated equivalent is implementing the gdbarch function iterate_over_regset_sections, this patch does that. Tested by generating a core file on cris under qemu and comparing the output of "info registers". This also fixes this warning when loading cris core files: warning: Unexpected size of section `.reg/164' in core file. gdb/ChangeLog: 2020-02-11 Christian Biesinger <cbiesinger@google.com> * cris-tdep.c (cris_supply_gregset): Change signature to match what struct regset expects. (cris_regset): New struct. (fetch_core_registers): Remove. (cris_iterate_over_regset_sections): New function. (_initialize_cris_tdep): Don't call deprecated_add_core_fns. (cris_gdbarch_init): Call set_gdbarch_iterate_over_regset_sections. Change-Id: Ieef895b5a2fdc797d1a913cd1c0c07563edfe8e7
2020-02-11New testcase for PR tui/25126 (staled source cache)Sergio Durigan Junior3-0/+148
I'm dealing with a Fedora GDB bug that is related to PR tui/25126, and I thought I'd write a specific testcase for it because I couldn't find one. The idea is to get the simple reproducer from the bug and tweak the testcase around it. This one was a bit hard because, since we need to modify the source file and recompile it, it involved a bit of TCL-foo to do things. Also for this reason, I'm only enabling the test for native boards. I tested this with an upstream GDB and made sure everything is passing. I also tested with a faulty GDB and made sure the test failed. gdb/testsuite/ChangeLog: 2020-02-11 Sergio Durigan Junior <sergiodj@redhat.com> PR tui/25126 https://bugzilla.redhat.com/show_bug.cgi?id=1784210 * gdb.base/cached-source-file.c: New file. * gdb.base/cached-source-file.exp: New file. Change-Id: Ib1b074342ebe8613c6d1dfde631691ebdf6d81c6
2020-02-11Add a comment for the ARM_F{0..7}_REGNUM registersChristian Biesinger2-0/+6
These are for the obsolete FPA architecture. gdb/ChangeLog: 2020-02-11 Christian Biesinger <cbiesinger@google.com> * arch/arm.h (enum gdb_regnum): Add comment for the FP0..7 registers. Change-Id: I6920616318ee637493d4ca12b91fa2ebcd103d76
2020-02-11Add missing \n in fprintfChristian Biesinger2-1/+5
gdb/ChangeLog: 2020-02-11 Christian Biesinger <cbiesinger@google.com> * arm-tdep.c (arm_dump_tdep): Add \n in fprintf. Change-Id: I0175572436cc7dec29e852c96371f85ea763ba2a
2020-02-11Re-generate gdb/gdbserver/gdbsupport configure scriptsSimon Marchi6-3/+18
In my previous commit, I did a last minute modification of warning.m4, but forgot to re-generate the configure scripts, this commit fixes that. gdb/ChangeLog: * configure: Re-generate. gdbserver/ChangeLog: * configure: Re-generate. gdbsupport/ChangeLog: * configure: Re-generate.
2020-02-11Add -Wstrict-null-sentinel to gdbsupport/warning.m4Simon Marchi7-4/+22
Commit 85f0dd3ce ("[gdb] Fix -Wstrict-null-sentinel warnings") fixed some violations of -Wstrict-null-sentinel. If we want to enforce this warning, I think we should enable it in our warning.m4 file. gdbsupport/ChangeLog: * warning.m4: Add -Wstrict-null-sentinel. * configure: Re-generate. gdbserver/ChangeLog: * configure: Re-generate. gdb/ChangeLog: * configure: Re-generate.
2020-02-11Move gdb/warning.m4 to gdbsupportSimon Marchi8-5/+20
This file is used by gdbsupport, gdbserver and gdb, so I think it belongs in gdbsupport. Move it there and update the references the various acinclude.m4 files. gdbsupport/ChangeLog: * warning.m4: Move here, from gdb/warning.m4. * acinclude.m4: Update warning.m4 path. * Makefile.in: Re-generate. gdbserver/ChangeLog: * acinclude.m4: Update warning.m4 path. gdb/ChangeLog: * acinclude: Update warning.m4 path. * warning.m4: Move to gdbsupport.
2020-02-11gdbsupport: use AM_GDB_WARNINGSSimon Marchi6-1/+215
Since gdbsupport has been given its own build system, it is no longer compiled with the warning flags specified in gdb/warning.m4. This patch makes it use AM_GDB_WARNINGS. gdbsupport/ChangeLog: * acinclude.m4: Include ../gdb/warning.m4. * configure.ac: Use AM_GDB_WARNINGS. * Makefile.am: Set AM_CFLAGS to WARN_CFLAGS and WERROR_CFLAGS. * Makefile.in: Re-generate. * configure: Re-generate.
2020-02-11Remove some ui_file_* functionsTom Tromey14-85/+59
This removes ui_file_isatty, ui_file_read, ui_file_write, ui_file_write_async_safe, ui_file_flush, and ui_file_puts, replacing them with calls to the appropriate method instead. gdb/ChangeLog 2020-02-11 Tom Tromey <tromey@adacore.com> * remote.c (remote_console_output): Update. * printcmd.c (printf_command): Update. * event-loop.c (gdb_wait_for_event): Update. * linux-nat.c (sigchld_handler): Update. * remote-sim.c (gdb_os_write_stdout): Update. (gdb_os_flush_stdout): Update. (gdb_os_flush_stderr): Update. (gdb_os_write_stderr): Update. * exceptions.c (print_exception): Update. * remote-fileio.c (remote_fileio_func_read): Update. (remote_fileio_func_write): Update. * tui/tui.c (tui_enable): Update. * tui/tui-interp.c (tui_interp::init): Update. * utils.c (init_page_info): Update. (putchar_unfiltered, fputc_unfiltered): Update. (gdb_flush): Update. (emit_style_escape): Update. (flush_wrap_buffer, fputs_maybe_filtered): Update. * ui-file.c (ui_file_isatty, ui_file_read, ui_file_write) (ui_file_write_async_safe, ui_file_flush, ui_file_puts): Remove. (stderr_file::write): Update. (stderr_file::puts): Update. * ui-file.h (ui_file_isatty, ui_file_write) (ui_file_write_async_safe, ui_file_read, ui_file_flush) (ui_file_puts): Don't declare. Change-Id: I3ca9b36e9107f6adbc41e014f5078b41d6bcec4d
2020-02-11Fix building the bfd/elf32-msp430.c file on a 32-bit host.Nick Clifton2-20/+34
* elf32-msp430.c (msp430_final_link_relocate): Always use longs for addresses in print statements. (msp430_elf_relax_delete_bytes): Likewise. (msp430_elf_relax_add_words): Likewise. (msp430_elf_relax_section): Likewise.
2020-02-11Clear plugin_data memoryH.J. Lu2-0/+6
Clear plugin_data memory since it may be uninitialized. * plugin.c (add_symbols): Clear plugin_data memory.
2020-02-11x86: drop ShortForm attributeJan Beulich7-10947/+10968
It is very simple to derive from other template properties, and hence there's little point wasting storage for it.
2020-02-11x86: drop stray ShortForm attributesJan Beulich3-12/+18
This attribute is meaningless when there are no operands to encode.
2020-02-11[binutils][gas] Fix build failure with -std=c89Matthew Malcomson2-2/+7
My previous patch introduced the use of a C99 feature. C99 standard is not required for gas, so this feature should be removed. Committed as obvious. gas/ChangeLog: 2020-02-11 Matthew Malcomson <matthew.malcomson@arm.com> * config/tc-arm.c (vcx_handle_register_arguments): Remove `for` loop initial declaration.
2020-02-11[gdb/testsuite] Fix UNRESOLVED in gdb.server/server-kill-python.expTom de Vries2-0/+9
The test-case gdb.server/server-kill-python.exp runs fine by itself: ... Running src/gdb/testsuite/gdb.server/server-kill-python.exp ... === gdb Summary === nr of expected passes 3 ... But if we run f.i. gdb.server/file-transfer.exp before it, we get instead: ... Running src/gdb/testsuite/gdb.server/server-kill-python.exp ... ERROR: GDB process no longer exists === gdb Summary === nr of expected passes 13 nr of unresolved testcases 1 ... We can see the origin of the problem here: ... spawn gdbserver --once localhost:2347 \ build/gdb/testsuite/outputs/gdb.server/file-transfer/file-transfer \ build/gdb/testsuite/outputs/gdb.server/server-kill-python/server-kill-python^M Process build/gdb/testsuite/outputs/gdb.server/file-transfer/file-transfer \ created; pid = 9464^M Listening on port 2347^M ... The spawn of the gdbserver for the server-kill-python test-case gets as executable argument the file-transfer binary. This is caused by proc gdbserver_spawn attempting to load the exec file in $file_last_loaded. This is something that is meant to load the same exec in the gdbserver that was earlier loaded into gdb. In this test-case however, nothing has been loaded into gdb by the test-case, and consequently we load the file that was loaded into gdb in the previous test-case. Fix this by unsetting $file_last_loaded in gdb_init. Build and reg-tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-02-11 Tom de Vries <tdevries@suse.de> PR testsuite/25488 * lib/gdb.exp (gdb_init): Unset $file_last_loaded. Change-Id: Ic385e08cbd34cbf85518720cf5695b4ff6619f4b
2020-02-10Use GCC LTO wrapper to get real symbols from LTO IR objectsH.J. Lu11-23/+554
GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11Ensure *valuep always written by extract_normal returnAlan Modra16-15/+68
* cgen-ibld.in (extract_normal): Set *valuep on all return paths. * bpf-ibld.c, * epiphany-ibld.c, * fr30-ibld.c, * frv-ibld.c, * ip2k-ibld.c, * iq2000-ibld.c, * lm32-ibld.c, * m32c-ibld.c, * m32r-ibld.c, * mep-ibld.c, * mt-ibld.c, * or1k-ibld.c, * xc16x-ibld.c, * xstormy16-ibld.c: Regenerate.