aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-18gdb.cp/call-c.exp C++ifyPedro Alves2-0/+7
Make the testcase work when built with a C++ compiler. gdb/testsuite/ChangeLog: * gdb.cp/call-c-1.c (foo) [__cplusplus]: Add extern "C".
2020-09-18gdb.python/py-frame-inline.exp and C++Pedro Alves2-1/+6
Make the testcase work when built with a C++ compiler. gdb/testsuite/ChangeLog: * gdb.python/py-frame-inline.exp: Adjust to optionally expect a full prototype.
2020-09-18gdb.python/py-as-string.exp C++ifyPedro Alves2-1/+5
Make the testcase buildable with a C++ compiler. gdb/testsuite/ChangeLog: * gdb.python/py-as-string.c: Add cast.
2020-09-18gdb.base/sizeof.exp C++ifyPedro Alves2-1/+5
Fixes: src/gdb/testsuite/gdb.base/sizeof.c:54:9: error: cannot initialize a variable of type 'char *' with an lvalue of type 'void *' ... when the testcase is built with a C++ compiler. gdb/testsuite/ChangeLog: * gdb.base/sizeof.c (fill): Add cast.
2020-09-18gdb.base/share-env-with-gdbserver.exp C++ifyPedro Alves2-1/+5
gdb/testsuite/ChangeLog: * gdb.base/share-env-with-gdbserver.c (main): Add cast.
2020-09-18gdb.base/{prologue,symbol-alias}.exp C++ifyPedro Alves5-2/+23
Make these testcases work when compiled as C++ programs. These testcases use the alias attribute, which requires passing in the target function's mangled name in C++. To avoid having to figure out how the functions are mangled, explicitly specify a linkage name. This is preferred over 'extern "C"' because that doesn't work with static functions. gdb/testsuite/ChangeLog: * gdb.base/prologue.c [__cplusplus] (marker): Explicitly specify linkage name. * gdb.base/prologue.exp: Use print /d. * gdb.base/symbol-alias.exp: Handle C++ output. * gdb.base/symbol-alias2.c: Handle C++ output. [__cplusplus] (func): Explicitly specify linkage name.
2020-09-18gdb.python/py-nested-maps.exp C++ifyPedro Alves2-22/+31
This adjusts gdb.python/py-nested-maps.c to make it buildable as C++ program. key_t is renamed because of: src/gdb/testsuite/gdb.python/py-nested-maps.c:23:8: error: definition of type 'key_t' conflicts with typedef of the same name struct key_t ^ /usr/include/x86_64-linux-gnu/sys/types.h:121:17: note: 'key_t' declared here typedef __key_t key_t; ^ gdb/testsuite/ChangeLog: * gdb.python/py-nested-maps.c (struct key_t): Rename to... (struct my_key_t): ... this. Adjust all references. (struct value_t): Rename to ... (struct my_value_t): ... this. Adjust all references. (create_map, add_map_element, create_map_map) (add_map_map_element): Add casts.
2020-09-18gdb.python/{py-framefilter-mi,py-framefilter}.c C++ifyPedro Alves3-6/+11
This adjusts: gdb.python/{py-framefilter-mi,py-framefilter}.c to make them buildable as C++ programs. gdb/testsuite/ChangeLog: * gdb.python/py-framefilter-mi.c (funca): Add casts. * gdb.python/py-framefilter.c.c (funca, func2): Add casts.
2020-09-18gdb.mi/var-cmd.c C++ifyPedro Alves2-1/+5
This adjusts gdb.mi/var-cmd.c to make it buildable as a C++ program. gdb/testsuite/ChangeLog: * gdb.mi/var-cmd.c (do_anonymous_type_tests): Add cast.
2020-09-18gdb.base/{exprs,ptype,ptype1,setvar,whatis}.c C++ifyPedro Alves6-11/+20
This adjusts: gdb.base/{exprs,ptype,ptype1,setvar,whatis}.c, to make them buildable as C++ programs. gdb/testsuite/ChangeLog: * gdb.base/exprs.c: Replace 'this' with 'self' throughout. * gdb.base/ptype.c: : Replace 'this' with 'self' throughout. (charfoo, intfoo): Define full prototype. * gdb.base/ptype1.c (charfoo): Define full prototype. * gdb.base/setvar.c: Replace 'this' with 'self' throughout. * gdb.base/whatis.c: Replace 'this' with 'self' throughout.
2020-09-18gdb.base/charset.{c,exp} C++ifyPedro Alves3-7/+19
Adjust gdb.base/charset.{c,exp} so that the testcase works when compiled as a C++ program. wchar_t is built-in in C++, so don't make a phony typedef. The "print /d" is so that we also get "1" instead of "true" in C++ mode. gdb/testsuite/ChangeLog: * gdb.base/charset.c [__cplusplus] (wchar_t, char16_t, char32_t): Don't define. (utf_32_string): Compile for both C and C++. * gdb.base/charset.exp: Use "print /d".
2020-09-18gdb.base/watchpoint.{c,exp}Pedro Alves3-4/+11
Adjust gdb.base/watchpoint.c so that it can be built as a C++ program. Fixes: gdb compile failed, src/gdb/testsuite/gdb.base/watchpoint.c:33:16: error: initializer-string for array of chars is too long [-fpermissive] 33 | char buf[30] = "testtesttesttesttesttesttestte"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gdb/testsuite/gdb.base/watchpoint.c:62:14: error: expected unqualified-id before 'nullptr' 62 | struct foo5 *nullptr; | ^~~~~~~ gdb/testsuite/ChangeLog: * gdb.base/watchpoint.c (buf): Make it 31 bytes. (nullptr): Rename to ... (null_ptr): ... this. * gdb.base/watchpoint.exp: Adjust to rename.
2020-09-18gdb.base/printcmds.c C++-ifyPedro Alves2-3/+8
Adjust gdb.base/printcmds.c to make it buildable as a C++ program. gdb/testsuite/ChangeLog: * gdb.base/printcmds.c (three, flag_enum_without_zero) (three_not_flag): Add casts.
2020-09-18gdb.base/examine-backward.exp C++ify and ClangPedro Alves3-4/+19
Adjust gdb.base/examine-backward.exp to let the testcase build and run as a C++ program, built with either G++ or Clang++. The change to use unsigned char instead of plain char is to avoid narrowing warnings: gdb compile failed, src/gdb/testsuite/gdb.base/examine-backward.c:55:1: error: narrowing conversion of '227' from 'int' to 'char' [-Wnarrowing] 55 | }; | ^ gdb/testsuite/ChangeLog: * gdb.base/examine-backward.c (Barrier, TestStrings): Now unsigned char array. (main): Add references to Barrier, TestStrings, TestStringsH and TestStringsW. * gdb.base/examine-backward.exp: Issue "set print asm-demangle on" and expect a full prototype in C++.
2020-09-18gdb.base/nested-addr.{c,exp} C++ifyPedro Alves3-2/+7
Adjust gdb.base/nested-addr.exp to let the testcase build and run as a C++ program. "print /d" is used so we get "= 1" instead of "= true" in C++ mode. gdb/testsuite/ChangeLog: * gdb.base/nested-addr.c (main): Add cast. * gdb.base/nested-addr.exp: Use "print /d".
2020-09-18gdb.base/break.exp C++ifyPedro Alves2-22/+33
Some adjustments to make gdb.base/break.exp work when compiled as a C++ program. Passes cleanly with Clang++, but not with G++. The latter puts a breakpoint at an unexpected line in one case. It seems like a bug that gcc and g++ behave differently here. gdb/testsuite/ChangeLog: * gdb.base/break.exp (func): New. Use it throughout when expecting a function name.
2020-09-18gdb.base/display.exp C++ifyPedro Alves2-0/+7
This makes the testcase work when compiled with C++ compiler. gdb/testsuite/ChangeLog: * gdb.base/display.exp: Issue "set print asm-demangle on".
2020-09-17gdb.base/find.exp C++ifyPedro Alves3-1/+11
This makes the testcase work when compiled with C++ compiler. We need #include <string.h> for memset. gdb/testsuite/ChangeLog: * gdb.base/find.c: Include <string.h>. (init_bufs): Add cast. * gdb.base/find.exp: Issue "set print asm-demangle on".
2020-09-17Change management of tdesc_arch_dataTom Tromey19-362/+250
While working on something else, I noticed that tdesc_data_cleanup took a void* parameter. Looking more into this, I found that tdesc_use_registers expected a transfer of ownership. I think it's better to express this sort of thing via the type system, when possible. This patch changes tdesc_data_alloc to return a unique pointer, changes tdesc_use_registers to accept an rvalue reference, and then adapts all the users. Note that a deleter structure is introduced to avoid having to move tdesc_arch_data to the header file. 2020-09-17 Tom Tromey <tromey@adacore.com> * tic6x-tdep.c (tic6x_gdbarch_init): Update. * target-descriptions.h (struct tdesc_arch_data_deleter): New. (tdesc_arch_data_up): New typedef. (tdesc_use_registers, tdesc_data_alloc): Update. (tdesc_data_cleanup): Don't declare. * target-descriptions.c (tdesc_data_alloc): Return a tdesc_arch_data_up. (tdesc_arch_data_deleter::operator()): Rename from tdesc_data_cleanup. Change argument type. (tdesc_use_registers): Change early_data to an rvalue reference. (tdesc_use_registers): Don't use delete. * sparc-tdep.c (sparc32_gdbarch_init): Update. * s390-tdep.c (s390_gdbarch_init): Update. * rx-tdep.c (rx_gdbarch_init): Update. * rs6000-tdep.c (rs6000_gdbarch_init): Update. * riscv-tdep.c (riscv_gdbarch_init): Update. * or1k-tdep.c (or1k_gdbarch_init): Update. * nios2-tdep.c (nios2_gdbarch_init): Update. * nds32-tdep.c (nds32_gdbarch_init): Update. * mips-tdep.c (mips_gdbarch_init): Update. * microblaze-tdep.c (microblaze_gdbarch_init): Update. * m68k-tdep.c (m68k_gdbarch_init): Update. * i386-tdep.c (i386_gdbarch_init): Update. * arm-tdep.c (arm_gdbarch_init): Update. * arc-tdep.c (arc_tdesc_init): Update. (arc_gdbarch_init): Update. * aarch64-tdep.c (aarch64_gdbarch_init): Update.
2020-09-17Fix ctrl-c when debugging WOW64 processesHannes Domani2-3/+37
DebugBreakProcess starts a new thread in the target process with the entry point DbgUiRemoteBreakin, where an int3 triggers a breakpoint exception for gdb. But this uses DbgUiRemoteBreakin of the 64bit ntdll.dll even for WOW64 processes. It stops in 64bit code, Wow64GetThreadContext reports a wrong pc without the int3, and gdb lets the target process continue. So this uses DbgUiRemoteBreakin of the 32bit ntdll.dll as the thread entry point for WOW64 processes instead. gdb/ChangeLog: 2020-09-17 Hannes Domani <ssbssa@yahoo.de> * windows-nat.c (ctrl_c_handler): Use 32bit DbgUiRemoteBreakin for WOW64 processes.
2020-09-17Use htab_up in dwarf2/read.cTom Tromey2-11/+13
This changes dwarf2/read.c to use htab_up rather than explicit calls to htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * dwarf2/read.c (compute_compunit_symtab_includes): Use htab_up.
2020-09-17Use htab_up in type copyingTom Tromey7-28/+27
This changes create_copied_types_hash to return an htab_up, then modifies the callers to avoid explicit use of htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * value.c (preserve_values): Update. * python/py-type.c (save_objfile_types): Update. * guile/scm-type.c (save_objfile_types): Update. * gdbtypes.h (create_copied_types_hash): Return htab_up. * gdbtypes.c (create_copied_types_hash): Return htab_up. * compile/compile-object-run.c (compile_object_run): Update.
2020-09-17Use htab_up in typedef_hash_tableTom Tromey3-21/+25
This changes typedef_hash_table to use htab_up rather than explicit calls to htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * typeprint.h (class typedef_hash_table) <~typedef_hash_table>: Remove. <m_table>: Now htab_up. * typeprint.c (typedef_hash_table::recursively_update) (typedef_hash_table::add_template_parameters) (typedef_hash_table::typedef_hash_table): Update. (typedef_hash_table::~typedef_hash_table): Remove. (typedef_hash_table::typedef_hash_table) (typedef_hash_table::find_global_typedef) (typedef_hash_table::find_typedef): Update.
2020-09-17Use htab_up in target-descriptions.cTom Tromey2-9/+11
This changes target-descriptions.c to use htab_up rather than explicit calls to htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * target-descriptions.c (tdesc_use_registers): Use htab_up.
2020-09-17Use htab_up in linespec.cTom Tromey2-21/+19
This changes linespec.c to use htab_up rather than explicit calls to htab_delete. Note that a use still exists in this file, because linespec_state hasn't been converted to have a real destructor. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * linespec.c (class decode_compound_collector) <~decode_compound_collector>: Remove. <m_unique_syms>: Now htab_up. (decode_compound_collector::operator ()): Update. (class symtab_collector) <~symtab_collector>: Remove. <m_symtab_table>: Now htab_up. (symtab_collector::operator ()): Update.
2020-09-17Use htab_up in filename_seen_cacheTom Tromey3-15/+18
This changes filename_seen_cache to use htab_up, rather than explicit calls to htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * filename-seen-cache.c (filename_seen_cache::filename_seen_cache) (filename_seen_cache::clear): Update. (~filename_seen_cache): Remove. (filename_seen_cache::seen): Update. * filename-seen-cache.h (class filename_seen_cache) <m_tab>: Now htab_up. <~filename_seen_cache>: Remove. <traverse>: Update.
2020-09-17Use htab_up in completion_trackerTom Tromey3-18/+27
This changes completion_tracker to use htab_up, rather than explicit calls to htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * completer.c (completion_tracker::discard_completions) (completion_tracker::~completion_tracker) (completion_tracker::maybe_add_completion) (completion_tracker::remove_completion) (completion_tracker::recompute_lowest_common_denominator) (completion_tracker::build_completion_result): Update. * completer.h (class completion_tracker) <have_completions>: Update. <m_entries_hash>: Now htab_up.
2020-09-17Use htab_up in breakpoint.cTom Tromey2-8/+8
This changes breakpoint.c to use htab_up rather than an explicit htab_delete. This simplifies the code somewhat. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * breakpoint.c (ambiguous_names_p): Use htab_up.
2020-09-17Use htab_up in auto-load.cTom Tromey2-25/+26
This changes auto-load.c to use htab_up, rather than manually calling htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * auto-load.c (struct auto_load_pspace_info) <~auto_load_pspace_info, auto_load_pspace_info>: Remove. <loaded_script_files, loaded_script_texts>: Change type to htab_up. (~auto_load_pspace_info) Remove. (init_loaded_scripts_info, maybe_add_script_file) (maybe_add_script_text, auto_load_info_scripts): Update.
2020-09-17Make c-exp.y:name_obstack staticTom Tromey2-1/+5
c-exp.y:name_obstack is not static, but should be. This patch makes the change. Tested by rebuilding. gdb/ChangeLog 2020-09-17 Tom Tromey <tromey@adacore.com> * c-exp.y (name_obstack): Now static.
2020-09-17Skip IFUNC relocations in debug sections ignored by ld.so. Fixes some ld ↵Mikael Pettersson2-1/+25
test failures on sparc-linux-gnu. PR ld/18808 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC relocations in debug sections, change abort to _bfd_error_handler.
2020-09-17gdb/riscv: fix decode of c.sdsp instructionChungyi Chi2-1/+5
The decode of c.sdsp was incorrectly claiming to be a 4-byte store instead of an 8-byte store. gdb/ChangeLog: * riscv-tdep.c (riscv-insn::decode): Fix recorded insn type.
2020-09-17Tidy gas i386.expAlan Modra2-34/+38
Possibly a quirk of my version of tcl, but I see "nm-new --help" being run on non-x86 targets. * testsuite/gas/i386/i386.exp: Return early if not x86.
2020-09-17opcodes/csky: return the default disassembler when there is no bfdAndrew Burgess2-15/+22
The disassembler function should return a valid disassembler function even when there is no BFD present. This is implied (I believe) by the comment in dis-asm.h which says the BFD may be NULL. Further, it makes sense when considering that the disassembler is used in GDB, and GDB may connect to a target and perform debugging even without a BFD being supplied. This commit makes the csky_get_disassembler function return the default disassembler configuration when no bfd is supplied, this is the same default configuration as is used when a BFD is supplied, but the BFD has no attributes section. Before the change configuring GDB with --enable-targets=all and running the tests gdb.base/all-architectures-2.exp results in many errors, but after this change there are no failures. opcodes/ChangeLog: * csky-dis.c (csky_get_disassembler): Don't return NULL when there is no BFD.
2020-09-17Automatic date update in version.inGDB Administrator1-1/+1
2020-09-16gdb: use bool in the solib catchpoint areaSimon Marchi3-33/+43
Use bool instead of int in struct solib_catchpoint and in init_catchpoint & related functions. gdb/ChangeLog: * breakpoint.h (init_catchpoint): Change int parameter to bool. (add_solib_catchpoint): Likewise. * breakpoint.c (struct solib_catchpoint) <is_load>: Change type to bool. (add_solib_catchpoint): Change int parameter/variable to bool. (catch_load_or_unload): Likewise. (init_catchpoint): Likewise. (create_fork_vfork_event_catchpoint): Likewise. (catch_fork_command_1): Likewise. (catch_exec_command_1): Likewise. Change-Id: I1faf4506e9109f3ccdd7229ba766dc7d77aa7aa0
2020-09-16gdb: update instance_flags field name in gdb-gdb.py.inSimon Marchi2-1/+6
Commit 314ad88df63c ("Use type_instance_flags more throughout") changed the name of field type::instance_flags to type::m_instance_flags. It however missed changing it in the gdb-gdb.py.in file, which results in this when trying to use the pretty-printer: (top-gdb) p *val.type Traceback (most recent call last): File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 116, in to_string % TypeFlagsPrinter(self.val['instance_flags'])) File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 76, in __str__ flag_list = [flag.short_name for flag in TYPE_FLAGS File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 77, in <listcomp> if self.val & flag.value] gdb.error: Argument to arithmetic operation not a number or boolean. $7 = This patch fixes it. gdb/ChangeLog: * gdb-gdb.py.in (class StructTypePrettyPrinter) <to_string>: Change instance_flags to m_instance_flags. Change-Id: Ib5e03c08fe41ca11cd71998f2b1c58052879ce95
2020-09-16Match demangled name in "skip"Tom Tromey5-5/+79
PR gdb/26598 notes that, before commit bcfe6157ca28 ("Use the linkage name if it exists"), the "skip" command would match the demangled name of a symbol, but now only matches the linkage name. This patch fixes this regression. I looked at all calls to function_name_is_marked_for_skip, and only one used the linkage name. 2020-09-16 Tom Tromey <tromey@adacore.com> PR gdb/26598: * infrun.c (fill_in_stop_func): Use find_pc_partial_function_sym. gdb/testsuite/ChangeLog 2020-09-16 Tom Tromey <tromey@adacore.com> PR gdb/26598: * gdb.base/skipcxx.exp: New file. * gdb.base/skipcxx.cc: New file.
2020-09-16Assume FreeBSD kernels always report exec events.John Baldwin3-8/+10
FreeBSD kernels have reported exec events via the PL_FLAG_EXEC flag since 8.2 release. The most recent release that did not support this flag is 7.4 released in November of 2011. Note that the FreeBSD native target already assumed that PL_FLAG_SCE and PL_FLAG_SCX were always supported on systems supporting PT_LWPINFO, but those flags were added at the same time as PL_FLAG_EXEC. Building the native target on a system without PL_FLAG_EXEC would have failed to build before this change already as a result. gdb/ChangeLog: * fbsd-nat.c (fbsd_nat_target::wait): Always check for PL_FLAG_EXEC. (fbsd_nat_target::insert_exec_catchpoint) (fbsd_nat_target::remove_exec_catchpoint): Always define. * fbsd-nat.h (fbsd_nat_target::insert_exec_catchpoint) (fbsd_nat_target::remove_exec_catchpoint): Always declare.
2020-09-16Require kinfo_get_file and kinfo_get_vmmap for FreeBSD hosts.John Baldwin9-178/+53
FreeBSD systems have provided these functions in libutil since 7.1 release. The most recent release without support is 6.4 released in November of 2008. This also requires libutil-freebsd on GNU/kFreeBSD systems. I assume that those systems have supported kinfo_get_file and kinfo_get_vmmap over a similar timeframe. gdb/ChangeLog: * configure.ac: Remove check for kinfo_getvmmap(). * configure, config.in: Regenerate. * fbsd-nat.c (fbsd_read_mapping): Remove (fbsd_nat_target::find_memory_regions): Remove the procfs version. (fbsd_nat_target::info_proc): Assume kinfo_getfile() and kinfo_get_vmmap() are always present. gdbsupport/ChangeLog: * common.m4 (GDB_AC_COMMON): Refactor checks for kinfo_getfile(). * configure, config.in: Regenerate.
2020-09-16Assume FreeBSD hosts include support for fetching signal information.John Baldwin2-14/+5
The current layout of siginfo_t and support for fetching it has been included in FreeBSD kernels since 7.0 release. The most recent release without support is 6.4 released in November of 2008. gdb/ChangeLog: * fbsd-nat.c: Always include support for TARGET_OBJECT_SIGNAL_INFO.
2020-09-16Assume KERN_PROC_PATHNAME is present on FreeBSD hosts.John Baldwin2-13/+5
FreeBSD kernels have included this sysctl since 6.0 release. The most recent release without support is 5.5 which was released in May of 2006. Both the sysctl and the /proc/<pid>/exe file call the same function in the kernel to obtain the path (vn_fullpath). If the sysctl fails, the readlink call will also fail, so there is no need to keep the readlink fallback. gdb/ChangeLog: * fbsd-nat.c (fbsd_nat_target::pid_to_exec_file): Always use sysctl and remove procfs fallback.
2020-09-16Assume that PT_LWPINFO is always defined on FreeBSD hosts.John Baldwin3-6/+5
FreeBSD kernels have included support for this since 5.0 release. The most recent release without support is 4.11 which was released in January of 2005. gdb/ChangeLog: * fbsd-nat.c: Assume PT_LWPINFO is always defined. * fbsd-nat.h: Likewise.
2020-09-16[gdb/testsuite] Fix gdb.dlang/watch-loc.exp on ppc64Tom de Vries3-3/+33
On ppc64, we run into: ... /tmp/ccKXURmw.s: Assembler messages:^M /tmp/ccKXURmw.s:99: Error: can't resolve \ `_Dmain_end' {.text section} - `_Dmain' {.opd section}^M compiler exited with status 1 ... The unresolvable entity comes from the .debug_aranges section hardcoded in watch-loc.c: ... " .4byte _Dmain \n" // Address " .4byte _Dmain_end - _Dmain \n" // Length ... where _Dmain is the function label for function _Dmain, and _Dmain_end is a label after function _Dmain: ... int _Dmain (void) { asm ("_Dmain_label: .globl _Dmain_label"); return 0; } asm ("_Dmain_end: .globl _Dmain_end"); ... The problem is that the two labels are not in the same section, because _Dmain ends up in the .opd section, which "contains the official procedure descriptors. A pointer to a function shall reference a procedure descriptor in this section." Fix this by using function_range instead to get the length. Also, fix the address part to not use _Dmain, but instead use the function start as returned by function_range. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-09-16 Tom de Vries <tdevries@suse.de> PR testsuite/26617 * gdb.dlang/watch-loc.c: Only add .debug_aranges if WITH_DEBUG_SECTIONS is defined. (xstr, str): New macro. (.debug_aranges): Use DMAIN_START_0/1/2 and DMAIN_LENGTH to get start and size of _Dmain. * gdb.dlang/watch-loc.exp: Pass DMAIN_START_0/1/2 and DMAIN_LENGTH using additional_flags.
2020-09-16Add -Av9 to AFLAGS_PIC and AFLAGS_PIE in the ld test suite on SPARC.Mikael Pettersson3-1/+9
* testsuite/ld-elf/shared.exp: Add -Av9 to AFLAGS_PIE on sparc. * testsuite/ld-elf/tls.exp: Add -Av9 to AFLAGS_PIC on sparc.
2020-09-16Oops - failed to commit change to verilog.c. Trying again.Nick Clifton1-1/+14
* verilog.c (verilog_write_address): Properly handle 64-bit addresses to avoid truncation of the high part.
2020-09-16gdb/breakpoint: make a copy of the "commands" command's argumentTankut Baris Aktemur6-1/+103
When GDB reads commands from the input, its internal buffer is re-used for each line. This is usually just fine because commands are executed in order; by the time we read the next line, we are already done with the current line. However, a problematic case is breakpoint commands that are input from a script. The header (e.g. commands 1 2) is overwritten with the next line before the breakpoint numbers are processed completely. For example, suppose we have the following script: break main break main commands 1 2 print 100123 end and source this script: (gdb) source script.gdb Breakpoint 1 at 0x1245: file main.cpp, line 27. Breakpoint 2 at 0x1245: file main.cpp, line 27. No breakpoint number 123. Note the "No breakpoint number 123." error message. This happens because GDB first reads "commands 1 2" into its internal buffer buffer -> "commands 1 2" and then starts parsing the breakpoint numbers. After parsing the first token, the "next token" pointer is as below: buffer -> "commands 1 2" next-token -----------^ So, if we continue parsing, we would tokenize "2" correctly. However, before parsing the next number, GDB reads the commands to attach them to breakpoint 1. Reading the commands causes the buffer to be overwritten: buffer -> " print 100123" next-token -----------^ So, the next time we parse the breakpoint number, we read "123". To fix, simply create a copy of the arguments of the header. gdb/ChangeLog: 2020-09-16 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * breakpoint.c (commands_command_1): Make a copy of the 'arg' argument. gdb/testsuite/ChangeLog: 2020-09-16 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.base/bp-cmds-sourced-script.c: New file. * gdb.base/bp-cmds-sourced-script.exp: New test. * gdb.base/bp-cmds-sourced-script.gdb: New file.
2020-09-16elf/x86-64: Adjust relocation for PE/x86-64 inputsH.J. Lu24-18/+328
PE linker calls _bfd_relocate_contents to resolve relocation, instead of bfd_perform_relocation. But ELF linker calls bfd_perform_relocation, not _bfd_relocate_contents. When linking PE/x86-64 inputs to generate ELF output, we need to adjust PE/x86-64 relocations in bfd_perform_relocation. Enable PE/x86-64 in bfd together with PEI/x86-64. Update run_ld_link_tests to handle bzip2 binary inputs. bfd/ PR ld/26583 * config.bfd (targ64_selvecs, targ_selvecs): Add x86_64_pe_vec to x86_64_pei_vec. * reloc.c: Include "coff/internal.h". (bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs. ld/ PR ld/26583 * testsuite/ld-x86-64/pe-x86-64-1.od: New file. * testsuite/ld-x86-64/pe-x86-64-1a.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-1b.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-1c.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-2.od: Likewise. * testsuite/ld-x86-64/pe-x86-64-2a.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-2b.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-2c.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-3.od: Likewise. * testsuite/ld-x86-64/pe-x86-64-3a.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-3b.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-3c.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-3d.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-4.od: Likewise. * testsuite/ld-x86-64/pe-x86-64-4a.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-4b.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-4c.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64-4d.obj.bz2: Likewise. * testsuite/ld-x86-64/pe-x86-64.exp: Likewise. * testsuite/lib/ld-lib.exp (run_ld_link_tests): Handle bz2 binary inputs.
2020-09-16[gdb/testsuite] Detect gdb prompt after monitor exitTom de Vries2-1/+13
With this gdbserver-support.exp patch: ... @@ -451,8 +451,10 @@ proc gdbserver_exit { is_mi } { # We use expect rather than gdb_expect because # we want to suppress printing exception messages, otherwise, # remote_expect, invoked by gdb_expect, prints the exceptions. + set have_prompt 0 expect { -i "$gdb_spawn_id" -re "$gdb_prompt $" { + set have_prompt 1 exp_continue } -i "$server_spawn_id" eof { @@ -463,6 +465,7 @@ proc gdbserver_exit { is_mi } { warning "Timed out waiting for EOF in server after $monitor_exit" } } + gdb_assert {$have_prompt} } } close_gdbserver ... and with this in parallel: ... $ stress -c 5 ... we run into this and similar FAILs: ... FAIL: gdb.multi/multi-target.exp: continue: non-stop=on: $have_prompt ... In more detail: ... (gdb) PASS: gdb.multi/multi-target.exp: continue: non-stop=on: inferior 5 Remote debugging from host ::1, port 40712^M Process build/gdb/testsuite/outputs/gdb.multi/multi-target/multi-target \ created; pid = 11098^M monitor exit^M Killing process(es): 11098^M FAIL: gdb.multi/multi-target.exp: continue: non-stop=on: $have_prompt spawn build/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory \ build/gdb/testsuite/../data-directory^M ... After issuing a "monitor exit" command, we should always get a prompt back, so check for that. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-09-16 Tom de Vries <tdevries@suse.de> * lib/gdbserver-support.exp (gdbserver_exit): Make sure we get the gdb prompt after issuing "monitor exit".
2020-09-16bfd: verilog hex dump backend should handle 64-bit addressesAnatoly Parshintsev1-0/+5
* verilog.c (verilog_write_address): Properly handle 64-bit addresses to avoid truncation of the high part.