aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-18Make target_wait options use enum flagsTom Tromey45-88/+189
This changes TARGET_WNOHANG to be a member of an enum, rather than a define, and also adds a DEF_ENUM_FLAGS_TYPE for this type. Then, it changes target_wait and the various target wait methods to use this type rather than "int". This didn't catch any bugs, but it seems like a decent cleanup nevertheless. I did not change deprecated_target_wait_hook, since that's only used out-of-tree (by Insight), and there didn't seem to be a need. I can't build some of these targets, so I modified them on a best-effort basis. I don't think this patch should go in before the release branch is made. gdb/ChangeLog 2020-09-18 Tom Tromey <tromey@adacore.com> * windows-nat.c (struct windows_nat_target) <wait>: Update. (windows_nat_target::wait): Update. * target/wait.h (enum target_wait_flag): New. Use DEF_ENUM_FLAGS_TYPE. * target/target.h (target_wait): Change type of options. * target.h (target_options_to_string, default_target_wait): Update. (struct target_ops) <wait>: Change type of options. * target.c (target_wait, default_target_wait, do_option): Change type of "options". (target_options_to_string): Likewise. * target-delegates.c: Rebuild. * target-debug.h (target_debug_print_target_wait_flags): Rename from target_debug_print_options. * sol-thread.c (class sol_thread_target) <wait>: Update. (sol_thread_target::wait): Update. * rs6000-nat.c (class rs6000_nat_target) <wait>: Update. (rs6000_nat_target::wait): Update. * remote.c (class remote_target) <wait, wait_ns, wait_as>: Update. (remote_target::wait_ns, remote_target::wait_as): Change type of "options". (remote_target::wait): Update. * remote-sim.c (struct gdbsim_target) <wait>: Update. (gdbsim_target::wait): Update. * record-full.c (class record_full_base_target) <wait>: Update. (record_full_wait_1): Change type of "options". (record_full_base_target::wait): Update. * record-btrace.c (class record_btrace_target) <wait>: Update. (record_btrace_target::wait): Update. * ravenscar-thread.c (struct ravenscar_thread_target) <wait>: Update. (ravenscar_thread_target::wait): Update. * procfs.c (class procfs_target) <wait>: Update. (procfs_target::wait): Update. * obsd-nat.h (class obsd_nat_target) <wait>: Update. * obsd-nat.c (obsd_nat_target::wait): Update. * nto-procfs.c (struct nto_procfs_target) <wait>: Update. (nto_procfs_target::wait): Update. * nbsd-nat.h (struct nbsd_nat_target) <wait>: Update. * nbsd-nat.c (nbsd_wait): Change type of "options". (nbsd_nat_target::wait): Update. * linux-thread-db.c (class thread_db_target) <wait>: Update. (thread_db_target::wait): Update. * linux-nat.h (class linux_nat_target) <wait>: Update. * linux-nat.c (linux_nat_target::wait): Update. (linux_nat_wait_1): Update. * infrun.c (do_target_wait_1, do_target_wait): Change type of "options". * inf-ptrace.h (struct inf_ptrace_target) <wait>: Update. * inf-ptrace.c (inf_ptrace_target::wait): Update. * go32-nat.c (struct go32_nat_target) <wait>: Update. (go32_nat_target::wait): Update. * gnu-nat.h (struct gnu_nat_target) <wait>: Update. * gnu-nat.c (gnu_nat_target::wait): Update. * fbsd-nat.h (class fbsd_nat_target) <wait>: Update. * fbsd-nat.c (fbsd_nat_target::wait): Update. * darwin-nat.h (class darwin_nat_target) <wait>: Update. * darwin-nat.c (darwin_nat_target::wait): Update. * bsd-uthread.c (struct bsd_uthread_target) <wait>: Update. (bsd_uthread_target::wait): Update. * aix-thread.c (class aix_thread_target) <wait>: Update. (aix_thread_target::wait): Update. gdbserver/ChangeLog 2020-09-18 Tom Tromey <tromey@adacore.com> * netbsd-low.h (class netbsd_process_target) <wait>: Update. * netbsd-low.cc (netbsd_waitpid, netbsd_wait) (netbsd_process_target::wait): Change type of target_options. * win32-low.h (class win32_process_target) <wait>: Update. * win32-low.cc (win32_process_target::wait): Update. * target.h (class process_stratum_target) <wait>: Update. (mywait): Update. * target.cc (mywait, target_wait): Change type of "options". * linux-low.h (class linux_process_target) <wait, wait_1>: Update. * linux-low.cc (linux_process_target::wait) (linux_process_target::wait_1): Update.
2020-09-18gdb: Fix use after free bug in compile_object_runAndrew Burgess2-3/+20
In this commit: commit 6108fd1823f9cf036bbbe528ffcdf2fee489b40a Date: Thu Sep 17 11:47:50 2020 -0600 Use htab_up in type copying A use after free bug was introduced. In compile-object-run.c, in the function compile_object_run, the code used to look like this: htab_t copied_types; /* .... snip .... */ /* OBJFILE may disappear while FUNC_TYPE still will be in use. */ copied_types = create_copied_types_hash (objfile); func_type = copy_type_recursive (objfile, func_type, copied_types); htab_delete (copied_types); /* .... snip .... */ call_function_by_hand_dummy (func_val, NULL, args, do_module_cleanup, data); The copied_types table exists on the obstack of objfile, but is deleted once the call to copy_type_recursive has been completed. After the change the code now looks like this: /* OBJFILE may disappear while FUNC_TYPE still will be in use. */ htab_up copied_types = create_copied_types_hash (objfile); func_type = copy_type_recursive (objfile, func_type, copied_types.get ()); /* .... snip .... */ call_function_by_hand_dummy (func_val, NULL, args, do_module_cleanup, data); The copied_types is now a unique_ptr and deleted automatically when it goes out of scope. The problem however is that objfile, and its included obstack, may be deleted by the call to do_module_cleanup, which is called by call_function_by_hand_dummy. This means that in the new code the objfile, and its obstack, are deleted before copied_types is deleted, and as copied_types is on the objfiles obstack, we are now reading undefined memory. The solution in this commit is to wrap the call to create_copied_types_hash and copy_type_recursive into a new static helper function. The htab_up will then be deleted within the new function's scope, before objfile is deleted. This resolves some non-deterministic test failures I was seeing in gdb.compile/*.exp tests. gdb/ChangeLog: * compile/compile-object-run.c (create_copied_type_recursive): New function. (compile_object_run): Use new function.
2020-09-18bpf: xBPF SDIV, SMOD instructionsDavid Faust13-23/+289
Add gas and opcodes support for two xBPF-exclusive ALU operations: SDIV (signed division) and SMOD (signed modulo), and add tests for them in gas. cpu/ * bpf.cpu (insn-op-code-alu): Add SDIV and SMOD. (define-alu-insn-bin, daib): Take ISAs as an argument. (define-alu-instructions): Update calls to daib pmacro with ISAs; add sdiv and smod. gas/ * testsuite/gas/bpf/alu-xbpf.d: New file. * testsuite/gas/bpf/alu-xbpf.s: Likewise. * testsuite/gas/bpf/alu32-xbpf.d: Likewise. * testsuite/gas/bpf/alu32-xbpf.d: Likewise. * testuiste/gas/bpf/bpf.exp: Run new tests. opcodes/ * bpf-desc.c: Regenerate. * bpf-desc.h: Likewise. * bpf-opc.c: Likewise. * bpf-opc.h: Likewise.
2020-09-18sim/m32r: return register sizes after fetch and storeAndrew Burgess2-2/+24
The m32r simulator currently always returns -1 for the register size after both a fetch and a store. In the fetch case GDB is forgiving of this, but in the store case GDB treats a return value of -1 as an error. This commit updates the m32r simulator to return a valid register size when fetching or storing a register. This fixes any GDB test that writes to a register, which will include any GDB test that makes an inferior call, for example gdb.base/break.exp. sim/m32r/ChangeLog: * m32r.c (m32rbf_register_size): New function. (m32rbf_fetch_register): Use new function. (m32rbf_store_register): Likewise.
2020-09-18Mention x86_64 Cygwin core file support in NEWS.Jon Turney2-0/+6
gdb/ChangeLog: 2020-08-21 Jon Turney <jon.turney@dronecode.org.uk> * NEWS: Mention x86_64 Cygwin core file support.
2020-09-18Add handling for 64-bit module addresses in Cygwin core dumpsJon Turney2-7/+28
Add handling for 64-bit module addresses when processing '.module' fake sections in Cygwin core dumps. gdb/ChangeLog: 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk> * windows-tdep.c (NOTE_INFO_MODULE, NOTE_INFO_MODULE64): Define. (core_process_module_section): Handle NOTE_INFO_MODULE64.
2020-09-18Promote windows_core_xfer_shared_libraries and windows_core_pid_to_strJon Turney5-99/+120
Move windows_core_xfer_shared_libraries() and windows_core_pid_to_str() to windows-tdep, and use in amd64-windows-tdep.c to handle Cygwin x86_64 core dumps. v2: Keep _initialize function at the bottom of the file. gdb/ChangeLog: 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk> * windows-tdep.h: Add prototypes. * i386-windows-tdep.c(windows_core_xfer_shared_libraries): Move. (i386_windows_core_pid_to_str): Move and rename ... * windows-tdep.c (windows_core_xfer_shared_libraries): ... to here (windows_core_pid_to_str): ... and here. * amd64-windows-tdep.c (amd64_windows_init_abi_common): Register here.
2020-09-18Add amd64_windows_gregset_reg_offsetJon Turney2-0/+75
Register a gregset_reg_offset array for Cygwin x86_64 core dump parsing (this causes the generic i386_iterate_over_regset_sections() '.reg' section iterator to get installed by i386_gdbarch_init()). gdb/ChangeLog: 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk> * amd64-windows-tdep.c(amd64_windows_gregset_reg_offset): Add. (amd64_windows_init_abi_common): ... and register.
2020-09-18Add sniffer for Cygwin x86_64 core dumpsJon Turney2-0/+30
Similarly to existing i386_cygwin_core_osabi_sniffer() gdb/ChangeLog: 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk> * amd64-windows-tdep.c (amd64_cygwin_core_osabi_sniffer): New. (_initialize_amd64_windows_tdep): Register amd64_cygwin_core_osabi_sniffer.
2020-09-18Fix "thread find" with multiple inferiors/targets (PR gdb/26631)Pedro Alves4-0/+123
"thread find" with multiple inferiors got broken with the multi-target work: Thread 1 "gdb" hit Breakpoint 1, internal_error (...) at ../../src/gdbsupport/errors.cc:51 51 { (top-gdb) bt #0 internal_error (file=0xffffd4d0 <error: Cannot access memory at address 0xffffd4d0>, line=0, fmt=0x555556330320 "en_US.UTF-8") at ../../src/gdbsupport/errors.cc:51 #1 0x0000555555bca4c7 in target_thread_name (info=0x555556801290) at ../../src/gdb/target.c:2035 #2 0x0000555555beb07a in thread_find_command (arg=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/thread.c:1959 #3 0x000055555572ec49 in do_const_cfunc (c=0x555556786bc0, args=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/cli/cli-decode.c:95 #4 0x0000555555732abd in cmd_func (cmd=0x555556786bc0, args=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/cli/cli-decode.c:2181 #5 0x0000555555bf1245 in execute_command (p=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/top.c:664 #6 0x00005555559cad10 in catch_command_errors (command=0x555555bf0c31 <execute_command(char const*, int)>, arg=0x7fffffffe082 "thread find 1", from_tty=0) at ../../src/gdb/main.c:457 #7 0x00005555559cc33d in captured_main_1 (context=0x7fffffffdb60) at ../../src/gdb/main.c:1218 #8 0x00005555559cc571 in captured_main (data=0x7fffffffdb60) at ../../src/gdb/main.c:1243 #9 0x00005555559cc5e8 in gdb_main (args=0x7fffffffdb60) at ../../src/gdb/main.c:1268 #10 0x0000555555623816 in main (argc=17, argv=0x7fffffffdc78) at ../../src/gdb/gdb.c:32 The problem is that we're not switching to the inferior/target before calling target methods, which trips on an assertion put in place exactly to catch this sort of problem. gdb/testsuite/ChangeLog: PR gdb/26631 * gdb.multi/multi-target-thread-find.exp: New file. gdb/ChangeLog: PR gdb/26631 * thread.c (thread_find_command): Switch inferior before calling target methods.
2020-09-18Split gdb.multi/multi-target.exp into separate testcasesPedro Alves8-546/+670
gdb.multi/multi-target.exp sets up a debug environment with multiple gdbservers, multiple native processes, and multiple cores, which has proved useful for exercising a number of multi-target scenarios. But, as we add more tests to gdb.base/multi-target.exp, it is growing a bit too large (making a bit cumbersome to debug) and too slow to run (if you have glibc debug info). This commit thus splits the multi-target.exp into several testcases, one per use case. The common setup code is moved to a new multi-target.exp.tcl file that is included by all the resulting multi-target testcases. gdb/testsuite/ChangeLog: * gdb.multi/multi-target-continue.exp: New file, factored out from multi-target.exp. * gdb.multi/multi-target-info-inferiors.exp: New file, factored out from multi-target.exp. * gdb.multi/multi-target-interrupt.exp: New file, factored out from multi-target.exp. * gdb.multi/multi-target-no-resumed.exp: New file, factored out from multi-target.exp. * gdb.multi/multi-target-ping-pong-next.exp: New file, factored out from multi-target.exp. * gdb.multi/multi-target.exp.tcl: New file, factored out from multi-target.exp. * gdb.multi/multi-target.exp: Delete.
2020-09-18Ensure that space allocated by assembler directives converts from an octet ↵Nick Clifton2-1/+7
count to a byte count. PR 26556 * read.c (bss_alloc): Convert size parameter from octets to bytes.
2020-09-18gdb/testsuite: Add missing expected resultsAndrew Burgess2-1/+8
The tests in this script are driven from two lists of expected results, one of the lists is missing some data so DejaGNU ends up passing the empty string to gdb_test, which means the test always passes. This commit adds the missing expected results into the script. The tests still pass so there's no change in the results, but we are now actually checking GDB's behaviour. gdb/testsuite/ChangeLog: * gdb.fortran/array-slices.exp: Add missing message data.
2020-09-18Automatic date update in version.inGDB Administrator1-1/+1
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