aboutsummaryrefslogtreecommitdiff
path: root/gdb/windows-nat.c
AgeCommit message (Collapse)AuthorFilesLines
2021-04-30Share DLL code between gdb and gdbserverTom Tromey1-168/+4
This moves the new DLL-loading code into nat/windows-nat.c, and changes both gdb and gdbserver to use the shared code. One client-provided callback, handle_load_dll, is changed to allow the code to be shared. This callback was actually never called from nat/windows-nat.c; maybe I had planned to share more here and then didn't finish... I'm not sure. gdb/ChangeLog 2021-04-30 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat::handle_load_dll): Update. (windows_nat_target::get_windows_debug_event): Call dll_loaded_event. (windows_add_all_dlls, windows_add_dll): Move to nat/windows-nat.c. * nat/windows-nat.h (handle_load_dll): Change parameters. (dll_loaded_event, windows_add_all_dlls): Declare. * nat/windows-nat.c (windows_add_dll, windows_add_all_dlls): Move from windows-nat.c. (dll_loaded_event): New function. gdbserver/ChangeLog 2021-04-30 Tom Tromey <tromey@adacore.com> * win32-low.cc (do_initial_child_stuff): Update. (windows_nat::handle_load_dll): Rename from win32_add_one_solib. Change parameter type. (win32_add_dll, win32_add_all_dlls) (windows_nat::handle_load_dll): Remove. (get_child_debug_event): Call dll_loaded_event.
2021-04-30Move function indirection code to nat/windows-natTom Tromey1-201/+11
gdb and gdbserver both look for functions in some Windows DLLs at runtime. This patch moves this code out of gdb and into nat/windows-nat, so it can be shared by both programs. gdb/ChangeLog 2021-04-30 Tom Tromey <tromey@adacore.com> * windows-nat.c: Move code to nat/windows-nat.[ch]. (_initialize_windows_nat): Call initialize_loadable. * nat/windows-nat.h (AdjustTokenPrivileges) (DebugActiveProcessStop, DebugBreakProcess) (DebugSetProcessKillOnExit, EnumProcessModules) (EnumProcessModulesEx, GetModuleInformation) (GetModuleFileNameExA, GetModuleFileNameExW) (LookupPrivilegeValueA, OpenProcessToken, GetConsoleFontSize) (GetCurrentConsoleFont, Wow64SuspendThread) (Wow64GetThreadContext, Wow64SetThreadContext) (Wow64GetThreadSelectorEntry): Move from windows-nat.c. (AdjustTokenPrivileges_ftype) (DebugActiveProcessStop_ftype, DebugBreakProcess_ftype) (DebugSetProcessKillOnExit_ftype, EnumProcessModules_ftype) (EnumProcessModulesEx_ftype, GetModuleInformation_ftype) (GetModuleFileNameExA_ftype, GetModuleFileNameExW_ftype) (LookupPrivilegeValueA_ftype, OpenProcessToken_ftype) (GetConsoleFontSize_ftype) (GetCurrentConsoleFont_ftype, Wow64SuspendThread_ftype) (Wow64GetThreadContext_ftype, Wow64SetThreadContext_ftype) (Wow64GetThreadSelectorEntry_ftype): Likewise. (initialize_loadable): Declare. * nat/windows-nat.c (AdjustTokenPrivileges) (DebugActiveProcessStop, DebugBreakProcess) (DebugSetProcessKillOnExit, EnumProcessModules) (EnumProcessModulesEx, GetModuleInformation, GetModuleFileNameExA) (GetModuleFileNameExW, LookupPrivilegeValueA, OpenProcessToken) (GetCurrentConsoleFont, GetConsoleFontSize, Wow64SuspendThread) (Wow64GetThreadContext, Wow64SetThreadContext) (Wow64GetThreadSelectorEntry): Define. (bad, bad_GetCurrentConsoleFont, bad_GetConsoleFontSize): Move from windows-nat.c. (initialize_loadable): Likewise, and rename.
2021-04-30Use template functions in windows-nat.cTom Tromey1-48/+14
windows-nat.c defines a number of replacement functions that simply return zero. This patch removes these in favor of a couple of template functions. gdb/ChangeLog 2021-04-30 Tom Tromey <tromey@adacore.com> * windows-nat.c (bad_GetModuleFileNameEx): Remove define. (bad_DebugActiveProcessStop, bad_DebugBreakProcess) (bad_DebugSetProcessKillOnExit, bad_EnumProcessModules) (bad_GetModuleFileNameExW, bad_GetModuleFileNameExA) (bad_GetModuleInformation, bad_OpenProcessToken): Remove. (bad): New template functions. (_initialize_loadable): Update.
2021-04-10Fix handling DLL loads at run timeEli Zaretskii1-11/+45
This patch makes handling a DLL load at run time (using LoadLibrary) much more reliable when its file name cannot be obtained using the lpImageName pointer provided by the DLL load debug event. The solution is to enumerate all the DLLs loaded by the inferior, looking for the DLL that's loaded at base address provided by the lpBaseOfDll pointer of the debug event. Correctly resolving the DLL file name is important, because without that GDB doesn't record the DLL in the list of solibs, and then later is unable to show functions in that DLL in the backtraces, which produces corrupted and truncated backtraces. See this thread for the problems that causes: https://sourceware.org/pipermail/gdb-patches/2021-March/177022.html gdb/ChangeLog: 2021-04-10 Eli Zaretskii <eliz@gnu.org> * windows-nat.c (windows_nat::handle_load_dll): Call windows_add_dll if get_image_name failed to glean the name of the DLL by using the lpImageName pointer. (windows_add_all_dlls): Now a thin wrapper around windows_add_dll. (windows_add_dll): Now does what windows_add_all_dlls did before, but also accepts an argument LOAD_ADDR, which, if non-NULL, specifies the address where the DLL was loaded into the inferior, and looks for the single DLL loaded at that address.
2021-03-23gdb: remove target_is_pushed free functionSimon Marchi1-1/+1
Same principle as the previous patches. gdb/ChangeLog: * target.h (target_is_pushed): Remove, update callers to use inferior::target_is_pushed instead. * target.c (target_is_pushed): Remove. Change-Id: I9862e6205acc65672da807cbe4b46cde009e7b9d
2021-03-23gdb: remove push_target free functionsSimon Marchi1-2/+2
Same as the previous patch, but for the push_target functions. The implementation of the move variant is moved to a new overload of inferior::push_target. gdb/ChangeLog: * target.h (push_target): Remove, update callers to use inferior::push_target. * target.c (push_target): Remove. * inferior.h (class inferior) <push_target>: New overload. Change-Id: I5a95496666278b8f3965e5e8aecb76f54a97c185
2021-03-16Fix cygwin build errorChristian Biesinger1-1/+1
With "gcc version 10.2.0 (GCC)" on cygwin, I get this build error: CXX windows-nat.o In file included from ../../gdb/../gdbsupport/common-defs.h:129, from ../../gdb/defs.h:28, from ../../gdb/windows-nat.c:24: ../../gdb/windows-nat.c: In function 'void windows_init_thread_list()': ../../gdb/windows-nat.c:513:17: error: zero-length gnu_printf format string [-Werror=format-zero-length] 513 | DEBUG_EVENTS (""); | ^~ ../../gdb/../gdbsupport/common-debug.h:65:43: note: in definition of macro 'debug_prefixed_printf_cond' 65 | debug_prefixed_printf (module, __func__, fmt, ##__VA_ARGS__); \ | ^~~ ../../gdb/windows-nat.c:513:3: note: in expansion of macro 'DEBUG_EVENTS' 513 | DEBUG_EVENTS (""); | ^~~~~~~~~~~~ cc1plus: all warnings being treated as errors This was introduced in 4ef367bffd73d50002339deba40983530ccb9d15, which removed the function name from this debug message: - DEBUG_EVENTS (("gdb: windows_init_thread_list\n")); + DEBUG_EVENTS (""); DEBUG_EVENTS now always includes the function name, so just add a "called" message to fix the compile error. gdb/ChangeLog: 2021-03-16 Christian Biesinger <cbiesinger@google.com> * windows-nat.c (windows_init_thread_list): Add message to debug log.
2021-01-26Use debug_prefixed_printf_cond in windows-nat.cTom Tromey1-56/+62
This changes windows-nat.c and nat/windows-nat.c to use the new debug_prefixed_printf_cond facility. I tried this out on a Windows build and I think it makes the output look a little nicer. 2021-01-26 Tom Tromey <tromey@adacore.com> * windows-nat.c (DEBUG_EXEC, DEBUG_EVENTS, DEBUG_MEM) (DEBUG_EXCEPT): Use debug_prefixed_printf_cond. (windows_init_thread_list, windows_nat::handle_load_dll) (windows_nat::handle_unload_dll, windows_nat_target::resume) (windows_nat_target::resume) (windows_nat_target::get_windows_debug_event) (windows_nat_target::interrupt, windows_xfer_memory) (windows_nat_target::close): Update. * nat/windows-nat.c (DEBUG_EVENTS): Use debug_prefixed_printf_cond. (matching_pending_stop, fetch_pending_stop) (continue_last_debug_event): Update.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-11-02gdb, gdbserver, gdbsupport: fix leading space vs tabs issuesSimon Marchi1-6/+6
Many spots incorrectly use only spaces for indentation (for example, there are a lot of spots in ada-lang.c). I've always found it awkward when I needed to edit one of these spots: do I keep the original wrong indentation, or do I fix it? What if the lines around it are also wrong, do I fix them too? I probably don't want to fix them in the same patch, to avoid adding noise to my patch. So I propose to fix as much as possible once and for all (hopefully). One typical counter argument for this is that it makes code archeology more difficult, because git-blame will show this commit as the last change for these lines. My counter counter argument is: when git-blaming, you often need to do "blame the file at the parent commit" anyway, to go past some other refactor that touched the line you are interested in, but is not the change you are looking for. So you already need a somewhat efficient way to do this. Using some interactive tool, rather than plain git-blame, makes this trivial. For example, I use "tig blame <file>", where going back past the commit that changed the currently selected line is one keystroke. It looks like Magit in Emacs does it too (though I've never used it). Web viewers of Github and Gitlab do it too. My point is that it won't really make archeology more difficult. The other typical counter argument is that it will cause conflicts with existing patches. That's true... but it's a one time cost, and those are not conflicts that are difficult to resolve. I have also tried "git rebase --ignore-whitespace", it seems to work well. Although that will re-introduce the faulty indentation, so one needs to take care of fixing the indentation in the patch after that (which is easy). gdb/ChangeLog: * aarch64-linux-tdep.c: Fix indentation. * aarch64-ravenscar-thread.c: Fix indentation. * aarch64-tdep.c: Fix indentation. * aarch64-tdep.h: Fix indentation. * ada-lang.c: Fix indentation. * ada-lang.h: Fix indentation. * ada-tasks.c: Fix indentation. * ada-typeprint.c: Fix indentation. * ada-valprint.c: Fix indentation. * ada-varobj.c: Fix indentation. * addrmap.c: Fix indentation. * addrmap.h: Fix indentation. * agent.c: Fix indentation. * aix-thread.c: Fix indentation. * alpha-bsd-nat.c: Fix indentation. * alpha-linux-tdep.c: Fix indentation. * alpha-mdebug-tdep.c: Fix indentation. * alpha-nbsd-tdep.c: Fix indentation. * alpha-obsd-tdep.c: Fix indentation. * alpha-tdep.c: Fix indentation. * amd64-bsd-nat.c: Fix indentation. * amd64-darwin-tdep.c: Fix indentation. * amd64-linux-nat.c: Fix indentation. * amd64-linux-tdep.c: Fix indentation. * amd64-nat.c: Fix indentation. * amd64-obsd-tdep.c: Fix indentation. * amd64-tdep.c: Fix indentation. * amd64-windows-tdep.c: Fix indentation. * annotate.c: Fix indentation. * arc-tdep.c: Fix indentation. * arch-utils.c: Fix indentation. * arch/arm-get-next-pcs.c: Fix indentation. * arch/arm.c: Fix indentation. * arm-linux-nat.c: Fix indentation. * arm-linux-tdep.c: Fix indentation. * arm-nbsd-tdep.c: Fix indentation. * arm-pikeos-tdep.c: Fix indentation. * arm-tdep.c: Fix indentation. * arm-tdep.h: Fix indentation. * arm-wince-tdep.c: Fix indentation. * auto-load.c: Fix indentation. * auxv.c: Fix indentation. * avr-tdep.c: Fix indentation. * ax-gdb.c: Fix indentation. * ax-general.c: Fix indentation. * bfin-linux-tdep.c: Fix indentation. * block.c: Fix indentation. * block.h: Fix indentation. * blockframe.c: Fix indentation. * bpf-tdep.c: Fix indentation. * break-catch-sig.c: Fix indentation. * break-catch-syscall.c: Fix indentation. * break-catch-throw.c: Fix indentation. * breakpoint.c: Fix indentation. * breakpoint.h: Fix indentation. * bsd-uthread.c: Fix indentation. * btrace.c: Fix indentation. * build-id.c: Fix indentation. * buildsym-legacy.h: Fix indentation. * buildsym.c: Fix indentation. * c-typeprint.c: Fix indentation. * c-valprint.c: Fix indentation. * c-varobj.c: Fix indentation. * charset.c: Fix indentation. * cli/cli-cmds.c: Fix indentation. * cli/cli-decode.c: Fix indentation. * cli/cli-decode.h: Fix indentation. * cli/cli-script.c: Fix indentation. * cli/cli-setshow.c: Fix indentation. * coff-pe-read.c: Fix indentation. * coffread.c: Fix indentation. * compile/compile-cplus-types.c: Fix indentation. * compile/compile-object-load.c: Fix indentation. * compile/compile-object-run.c: Fix indentation. * completer.c: Fix indentation. * corefile.c: Fix indentation. * corelow.c: Fix indentation. * cp-abi.h: Fix indentation. * cp-namespace.c: Fix indentation. * cp-support.c: Fix indentation. * cp-valprint.c: Fix indentation. * cris-linux-tdep.c: Fix indentation. * cris-tdep.c: Fix indentation. * darwin-nat-info.c: Fix indentation. * darwin-nat.c: Fix indentation. * darwin-nat.h: Fix indentation. * dbxread.c: Fix indentation. * dcache.c: Fix indentation. * disasm.c: Fix indentation. * dtrace-probe.c: Fix indentation. * dwarf2/abbrev.c: Fix indentation. * dwarf2/attribute.c: Fix indentation. * dwarf2/expr.c: Fix indentation. * dwarf2/frame.c: Fix indentation. * dwarf2/index-cache.c: Fix indentation. * dwarf2/index-write.c: Fix indentation. * dwarf2/line-header.c: Fix indentation. * dwarf2/loc.c: Fix indentation. * dwarf2/macro.c: Fix indentation. * dwarf2/read.c: Fix indentation. * dwarf2/read.h: Fix indentation. * elfread.c: Fix indentation. * eval.c: Fix indentation. * event-top.c: Fix indentation. * exec.c: Fix indentation. * exec.h: Fix indentation. * expprint.c: Fix indentation. * f-lang.c: Fix indentation. * f-typeprint.c: Fix indentation. * f-valprint.c: Fix indentation. * fbsd-nat.c: Fix indentation. * fbsd-tdep.c: Fix indentation. * findvar.c: Fix indentation. * fork-child.c: Fix indentation. * frame-unwind.c: Fix indentation. * frame-unwind.h: Fix indentation. * frame.c: Fix indentation. * frv-linux-tdep.c: Fix indentation. * frv-tdep.c: Fix indentation. * frv-tdep.h: Fix indentation. * ft32-tdep.c: Fix indentation. * gcore.c: Fix indentation. * gdb_bfd.c: Fix indentation. * gdbarch.sh: Fix indentation. * gdbarch.c: Re-generate * gdbarch.h: Re-generate. * gdbcore.h: Fix indentation. * gdbthread.h: Fix indentation. * gdbtypes.c: Fix indentation. * gdbtypes.h: Fix indentation. * glibc-tdep.c: Fix indentation. * gnu-nat.c: Fix indentation. * gnu-nat.h: Fix indentation. * gnu-v2-abi.c: Fix indentation. * gnu-v3-abi.c: Fix indentation. * go32-nat.c: Fix indentation. * guile/guile-internal.h: Fix indentation. * guile/scm-cmd.c: Fix indentation. * guile/scm-frame.c: Fix indentation. * guile/scm-iterator.c: Fix indentation. * guile/scm-math.c: Fix indentation. * guile/scm-ports.c: Fix indentation. * guile/scm-pretty-print.c: Fix indentation. * guile/scm-value.c: Fix indentation. * h8300-tdep.c: Fix indentation. * hppa-linux-nat.c: Fix indentation. * hppa-linux-tdep.c: Fix indentation. * hppa-nbsd-nat.c: Fix indentation. * hppa-nbsd-tdep.c: Fix indentation. * hppa-obsd-nat.c: Fix indentation. * hppa-tdep.c: Fix indentation. * hppa-tdep.h: Fix indentation. * i386-bsd-nat.c: Fix indentation. * i386-darwin-nat.c: Fix indentation. * i386-darwin-tdep.c: Fix indentation. * i386-dicos-tdep.c: Fix indentation. * i386-gnu-nat.c: Fix indentation. * i386-linux-nat.c: Fix indentation. * i386-linux-tdep.c: Fix indentation. * i386-nto-tdep.c: Fix indentation. * i386-obsd-tdep.c: Fix indentation. * i386-sol2-nat.c: Fix indentation. * i386-tdep.c: Fix indentation. * i386-tdep.h: Fix indentation. * i386-windows-tdep.c: Fix indentation. * i387-tdep.c: Fix indentation. * i387-tdep.h: Fix indentation. * ia64-libunwind-tdep.c: Fix indentation. * ia64-libunwind-tdep.h: Fix indentation. * ia64-linux-nat.c: Fix indentation. * ia64-linux-tdep.c: Fix indentation. * ia64-tdep.c: Fix indentation. * ia64-tdep.h: Fix indentation. * ia64-vms-tdep.c: Fix indentation. * infcall.c: Fix indentation. * infcmd.c: Fix indentation. * inferior.c: Fix indentation. * infrun.c: Fix indentation. * iq2000-tdep.c: Fix indentation. * language.c: Fix indentation. * linespec.c: Fix indentation. * linux-fork.c: Fix indentation. * linux-nat.c: Fix indentation. * linux-tdep.c: Fix indentation. * linux-thread-db.c: Fix indentation. * lm32-tdep.c: Fix indentation. * m2-lang.c: Fix indentation. * m2-typeprint.c: Fix indentation. * m2-valprint.c: Fix indentation. * m32c-tdep.c: Fix indentation. * m32r-linux-tdep.c: Fix indentation. * m32r-tdep.c: Fix indentation. * m68hc11-tdep.c: Fix indentation. * m68k-bsd-nat.c: Fix indentation. * m68k-linux-nat.c: Fix indentation. * m68k-linux-tdep.c: Fix indentation. * m68k-tdep.c: Fix indentation. * machoread.c: Fix indentation. * macrocmd.c: Fix indentation. * macroexp.c: Fix indentation. * macroscope.c: Fix indentation. * macrotab.c: Fix indentation. * macrotab.h: Fix indentation. * main.c: Fix indentation. * mdebugread.c: Fix indentation. * mep-tdep.c: Fix indentation. * mi/mi-cmd-catch.c: Fix indentation. * mi/mi-cmd-disas.c: Fix indentation. * mi/mi-cmd-env.c: Fix indentation. * mi/mi-cmd-stack.c: Fix indentation. * mi/mi-cmd-var.c: Fix indentation. * mi/mi-cmds.c: Fix indentation. * mi/mi-main.c: Fix indentation. * mi/mi-parse.c: Fix indentation. * microblaze-tdep.c: Fix indentation. * minidebug.c: Fix indentation. * minsyms.c: Fix indentation. * mips-linux-nat.c: Fix indentation. * mips-linux-tdep.c: Fix indentation. * mips-nbsd-tdep.c: Fix indentation. * mips-tdep.c: Fix indentation. * mn10300-linux-tdep.c: Fix indentation. * mn10300-tdep.c: Fix indentation. * moxie-tdep.c: Fix indentation. * msp430-tdep.c: Fix indentation. * namespace.h: Fix indentation. * nat/fork-inferior.c: Fix indentation. * nat/gdb_ptrace.h: Fix indentation. * nat/linux-namespaces.c: Fix indentation. * nat/linux-osdata.c: Fix indentation. * nat/netbsd-nat.c: Fix indentation. * nat/x86-dregs.c: Fix indentation. * nbsd-nat.c: Fix indentation. * nbsd-tdep.c: Fix indentation. * nios2-linux-tdep.c: Fix indentation. * nios2-tdep.c: Fix indentation. * nto-procfs.c: Fix indentation. * nto-tdep.c: Fix indentation. * objfiles.c: Fix indentation. * objfiles.h: Fix indentation. * opencl-lang.c: Fix indentation. * or1k-tdep.c: Fix indentation. * osabi.c: Fix indentation. * osabi.h: Fix indentation. * osdata.c: Fix indentation. * p-lang.c: Fix indentation. * p-typeprint.c: Fix indentation. * p-valprint.c: Fix indentation. * parse.c: Fix indentation. * ppc-linux-nat.c: Fix indentation. * ppc-linux-tdep.c: Fix indentation. * ppc-nbsd-nat.c: Fix indentation. * ppc-nbsd-tdep.c: Fix indentation. * ppc-obsd-nat.c: Fix indentation. * ppc-ravenscar-thread.c: Fix indentation. * ppc-sysv-tdep.c: Fix indentation. * ppc64-tdep.c: Fix indentation. * printcmd.c: Fix indentation. * proc-api.c: Fix indentation. * producer.c: Fix indentation. * producer.h: Fix indentation. * prologue-value.c: Fix indentation. * prologue-value.h: Fix indentation. * psymtab.c: Fix indentation. * python/py-arch.c: Fix indentation. * python/py-bpevent.c: Fix indentation. * python/py-event.c: Fix indentation. * python/py-event.h: Fix indentation. * python/py-finishbreakpoint.c: Fix indentation. * python/py-frame.c: Fix indentation. * python/py-framefilter.c: Fix indentation. * python/py-inferior.c: Fix indentation. * python/py-infthread.c: Fix indentation. * python/py-objfile.c: Fix indentation. * python/py-prettyprint.c: Fix indentation. * python/py-registers.c: Fix indentation. * python/py-signalevent.c: Fix indentation. * python/py-stopevent.c: Fix indentation. * python/py-stopevent.h: Fix indentation. * python/py-threadevent.c: Fix indentation. * python/py-tui.c: Fix indentation. * python/py-unwind.c: Fix indentation. * python/py-value.c: Fix indentation. * python/py-xmethods.c: Fix indentation. * python/python-internal.h: Fix indentation. * python/python.c: Fix indentation. * ravenscar-thread.c: Fix indentation. * record-btrace.c: Fix indentation. * record-full.c: Fix indentation. * record.c: Fix indentation. * reggroups.c: Fix indentation. * regset.h: Fix indentation. * remote-fileio.c: Fix indentation. * remote.c: Fix indentation. * reverse.c: Fix indentation. * riscv-linux-tdep.c: Fix indentation. * riscv-ravenscar-thread.c: Fix indentation. * riscv-tdep.c: Fix indentation. * rl78-tdep.c: Fix indentation. * rs6000-aix-tdep.c: Fix indentation. * rs6000-lynx178-tdep.c: Fix indentation. * rs6000-nat.c: Fix indentation. * rs6000-tdep.c: Fix indentation. * rust-lang.c: Fix indentation. * rx-tdep.c: Fix indentation. * s12z-tdep.c: Fix indentation. * s390-linux-tdep.c: Fix indentation. * score-tdep.c: Fix indentation. * ser-base.c: Fix indentation. * ser-mingw.c: Fix indentation. * ser-uds.c: Fix indentation. * ser-unix.c: Fix indentation. * serial.c: Fix indentation. * sh-linux-tdep.c: Fix indentation. * sh-nbsd-tdep.c: Fix indentation. * sh-tdep.c: Fix indentation. * skip.c: Fix indentation. * sol-thread.c: Fix indentation. * solib-aix.c: Fix indentation. * solib-darwin.c: Fix indentation. * solib-frv.c: Fix indentation. * solib-svr4.c: Fix indentation. * solib.c: Fix indentation. * source.c: Fix indentation. * sparc-linux-tdep.c: Fix indentation. * sparc-nbsd-tdep.c: Fix indentation. * sparc-obsd-tdep.c: Fix indentation. * sparc-ravenscar-thread.c: Fix indentation. * sparc-tdep.c: Fix indentation. * sparc64-linux-tdep.c: Fix indentation. * sparc64-nbsd-tdep.c: Fix indentation. * sparc64-obsd-tdep.c: Fix indentation. * sparc64-tdep.c: Fix indentation. * stabsread.c: Fix indentation. * stack.c: Fix indentation. * stap-probe.c: Fix indentation. * stubs/ia64vms-stub.c: Fix indentation. * stubs/m32r-stub.c: Fix indentation. * stubs/m68k-stub.c: Fix indentation. * stubs/sh-stub.c: Fix indentation. * stubs/sparc-stub.c: Fix indentation. * symfile-mem.c: Fix indentation. * symfile.c: Fix indentation. * symfile.h: Fix indentation. * symmisc.c: Fix indentation. * symtab.c: Fix indentation. * symtab.h: Fix indentation. * target-float.c: Fix indentation. * target.c: Fix indentation. * target.h: Fix indentation. * tic6x-tdep.c: Fix indentation. * tilegx-linux-tdep.c: Fix indentation. * tilegx-tdep.c: Fix indentation. * top.c: Fix indentation. * tracefile-tfile.c: Fix indentation. * tracepoint.c: Fix indentation. * tui/tui-disasm.c: Fix indentation. * tui/tui-io.c: Fix indentation. * tui/tui-regs.c: Fix indentation. * tui/tui-stack.c: Fix indentation. * tui/tui-win.c: Fix indentation. * tui/tui-winsource.c: Fix indentation. * tui/tui.c: Fix indentation. * typeprint.c: Fix indentation. * ui-out.h: Fix indentation. * unittests/copy_bitwise-selftests.c: Fix indentation. * unittests/memory-map-selftests.c: Fix indentation. * utils.c: Fix indentation. * v850-tdep.c: Fix indentation. * valarith.c: Fix indentation. * valops.c: Fix indentation. * valprint.c: Fix indentation. * valprint.h: Fix indentation. * value.c: Fix indentation. * value.h: Fix indentation. * varobj.c: Fix indentation. * vax-tdep.c: Fix indentation. * windows-nat.c: Fix indentation. * windows-tdep.c: Fix indentation. * xcoffread.c: Fix indentation. * xml-syscall.c: Fix indentation. * xml-tdesc.c: Fix indentation. * xstormy16-tdep.c: Fix indentation. * xtensa-config.c: Fix indentation. * xtensa-linux-nat.c: Fix indentation. * xtensa-linux-tdep.c: Fix indentation. * xtensa-tdep.c: Fix indentation. gdbserver/ChangeLog: * ax.cc: Fix indentation. * dll.cc: Fix indentation. * inferiors.h: Fix indentation. * linux-low.cc: Fix indentation. * linux-nios2-low.cc: Fix indentation. * linux-ppc-ipa.cc: Fix indentation. * linux-ppc-low.cc: Fix indentation. * linux-x86-low.cc: Fix indentation. * linux-xtensa-low.cc: Fix indentation. * regcache.cc: Fix indentation. * server.cc: Fix indentation. * tracepoint.cc: Fix indentation. gdbsupport/ChangeLog: * common-exceptions.h: Fix indentation. * event-loop.cc: Fix indentation. * fileio.cc: Fix indentation. * filestuff.cc: Fix indentation. * gdb-dlfcn.cc: Fix indentation. * gdb_string_view.h: Fix indentation. * job-control.cc: Fix indentation. * signals.cc: Fix indentation. Change-Id: I4bad7ae6be0fbe14168b8ebafb98ffe14964a695
2020-09-24Handle 64bit breakpoints of WOW64 processes as SIGINTHannes Domani1-1/+0
When a WOW64 process triggers a breakpoint exception in 64bit code (which happens when a 64bit gdb calls DebugBreakProcess for a 32bit target), gdb ignores the breakpoint (because Wow64GetThreadContext can only report the pc of 32bit code, and there is not int3 at this location). But if these 64bit breakpoint exceptions are handled as SIGINT, gdb doesn't check for int3, and always stops the target. gdb/ChangeLog: 2020-09-23 Hannes Domani <ssbssa@yahoo.de> * nat/windows-nat.c (handle_exception): Handle 64bit breakpoints in WOW64 processes as SIGINT. * nat/windows-nat.h: Make wow64_process a shared variable. * windows-nat.c: Remove static wow64_process variable. gdbserver/ChangeLog: 2020-09-23 Hannes Domani <ssbssa@yahoo.de> * win32-low.cc: Remove local wow64_process variable. * win32-low.h: Remove local wow64_process variable.
2020-09-18Make target_wait options use enum flagsTom Tromey1-2/+2
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-17Fix ctrl-c when debugging WOW64 processesHannes Domani1-3/+32
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-06-27Make {get,set}_inferior_io_terminal inferior methodsPedro Alves1-8/+8
This converts the get_inferior_io_terminal and set_inferior_io_terminal free functions to inferior methods. Since the related commands are called "tty", "{set,show} inferior-tty", and MI's "-inferior-tty-{set,show}", to make the connection between the commands and the code more obvious, the methods are named set_tty/tty instead of set_io_terminal/io_terminal. gdb/ChangeLog: * fork-child.c (prefork_hook): Adjust. * infcmd.c (set_inferior_io_terminal, get_inferior_io_terminal): Delete. (set_inferior_tty_command, show_inferior_tty_command): Adjust. * inferior.c (inferior::set_tty, inferior::tty): New methods. * inferior.h (set_inferior_io_terminal, get_inferior_io_terminal): Remove declarations. (struct inferior) <set_tty, tty>: New methods. (struct inferior) <terminal>: Rename to ... (struct inferior) <m_terminal>: ... this and make private. * main.c (captured_main_1): Adjust. * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): Adjust. (mi_cmd_inferior_tty_show): Adjust. * nto-procfs.c (nto_procfs_target::create_inferior): Adjust. * windows-nat.c (windows_nat_target::create_inferior): Adjust.
2020-06-18Don't write to inferior_ptid in windows-nat.c, part IIPedro Alves1-47/+50
Writing to inferior_ptid in windows_nat_target::get_windows_debug_event is just incorrect and not necessary. We'll report the event to GDB's core, which then takes care of switching inferior_ptid / current thread. Related (see windows_nat_target::get_windows_debug_event), there's also a "current_windows_thread" global that is just begging to get out of sync with core GDB's current thread. This patch removes it. gdbserver already does not have an equivalent global in win32-low.cc. gdb/ChangeLog: 2020-06-18 Pedro Alves <palves@redhat.com> * nat/windows-nat.c (current_windows_thread): Remove. * nat/windows-nat.h (current_windows_thread): Remove. * windows-nat.c (windows_nat_target::stopped_by_sw_breakpoint): Adjust. (display_selectors): Adjust to fetch the current windows_thread_info based on inferior_ptid. (fake_create_process): No longer write to current_windows_thread. (windows_nat_target::get_windows_debug_event): Don't set inferior_ptid or current_windows_thread. (windows_nat_target::wait): Adjust to not rely on current_windows_thread. (do_initial_windows_stuff): Now a method of windows_nat_target. Switch to the last_ptid thread. (windows_nat_target::attach): Adjust. (windows_nat_target::detach): Use switch_to_no_thread instead of writing to inferior_ptid directly. (windows_nat_target::create_inferior): Adjust.
2020-06-18Don't write to inferior_ptid in windows-nat.c, part IPedro Alves1-6/+0
The inferior_ptid hack in do_initial_win32_stuff, added back in 2008: https://sourceware.org/ml/gdb-patches/2008-10/msg00012.html with: commit 9f9d052e600ed9436f9fd558d62a189c8cc3d43e Author: Pierre Muller <muller@sourceware.org> AuthorDate: Thu Oct 2 14:20:07 2008 +0000 * win32-nat.c (do_initial_win32_stuff): Set inferior_ptid. is no longer needed. Back then, current_inferior looked like this: struct inferior* current_inferior (void) { struct inferior *inf = find_inferior_pid (ptid_get_pid (inferior_ptid)); gdb_assert (inf); return inf; } Nowadays, current_inferior() just returns the global current_inferior_ pointer, which didn't exist back then. gdb/ChangeLog: 2020-06-18 Pedro Alves <palves@redhat.com> * windows-nat.c (do_initial_windows_stuff): No longer set inferior_ptid.
2020-06-15Change target_read_string APITom Tromey1-9/+7
This simplifies the target_read_string API a bit. Note that some code was using safe_strerror on the error codes returned by target_read_string. It seems to me that this is incorrect (if it was ever correct, it must have been quite a long time ago). gdb/ChangeLog 2020-06-15 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat::handle_output_debug_string): Update. (windows_nat::handle_ms_vc_exception): Update. * target.h (target_read_string): Change API. * target.c (target_read_string): Change API. * solib-svr4.c (open_symbol_file_object, svr4_read_so_list): Update. * solib-frv.c (frv_current_sos): Update. * solib-dsbt.c (dsbt_current_sos): Update. * solib-darwin.c (darwin_current_sos): Update. * linux-thread-db.c (inferior_has_bug): Update. * expprint.c (print_subexp_standard): Update. * ada-lang.c (ada_main_name, ada_tag_name_from_tsd) (ada_exception_message_1): Update.
2020-05-19Default gdb_bfd_open's fd parameter to -1Pedro Alves1-1/+1
A following patch will add one more defaulted parameter. gdb/ChangeLog: 2020-05-19 Pedro Alves <palves@redhat.com> * gdb_bfd.h: (gdb_bfd_open): Default to 'fd' parameter to -1. Adjust all callers.
2020-04-24Fix Windows debugging regressionTom Tromey1-1/+9
The updated pending stop series introduced a regression in Windows debugging. When stopped at a software breakpoint, we would adjust the PC each time it was requested -- however, more than a single adjustment is incorrect. This patch introduces a new flag that is used to ensure the adjustment only happens a single time. No similar change is needed in gdbserver, because it adjusts the PC in a different way. I still can't run the gdb test suite on Windows, but I can run the internal AdaCore test suite there; and this fixes the regressions there. gdb/ChangeLog 2020-04-24 Tom Tromey <tromey@adacore.com> * nat/windows-nat.h (struct windows_thread_info) <pc_adjusted>: New member. * windows-nat.c (windows_fetch_one_register): Check pc_adjusted. (windows_nat_target::get_windows_debug_event) (windows_nat_target::wait): Set pc_adjusted.
2020-04-16Fix Cygwin gdb buildTom Tromey1-0/+25
Simon pointed out that the windows-nat sharing series broke the Cygwin build. This patch fixes the problem, by moving the Cygwin-specific code to a new handler function. This approach is taken because this code calls find_pc_partial_function, which isn't available in gdbserver. gdb/ChangeLog 2020-04-16 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat::handle_access_violation): New function. * nat/windows-nat.h (handle_access_violation): Declare. * nat/windows-nat.c (handle_exception): Move Cygwin code to windows-nat.c. Call handle_access_violation. gdbserver/ChangeLog 2020-04-16 Tom Tromey <tromey@adacore.com> * win32-low.cc (windows_nat::handle_access_violation): New function.
2020-04-15Use debug_printf in windows-nat.cTom Tromey1-4/+4
While debugging a bug on Windows, I noticed that windows-nat.c is not sending its debugging output to gdb_stdlog. This is unfortunate because it means that "set logging debugredirect" doesn't work properly. This patch fixes the problem by changing windows-nat.c to use debug_printf. Note that get_windows_debug_event also writes one debugging message unconditionally. It isn't clear to me if this really ought to use DEBUG_EVENTS or not, since it seems like perhaps it is intended to note an unexpected event occurring. So, I didn't change this. I'm checking this in. gdb/ChangeLog 2020-04-15 Tom Tromey <tromey@adacore.com> * windows-nat.c (DEBUG_EXEC, DEBUG_EVENTS, DEBUG_MEM) (DEBUG_EXCEPT): Use debug_printf.
2020-04-15Better handling of realpath() failure in windows_make_so() on CygwinJon Turney1-1/+4
It seems Cygwin's realpath() can fail on certain DLLs (apparently some AV software prevent it working on it's DLLs; See [1], [2]). Warn rather than stopping with an error if that occurs. Based on an original patch from Tim Chick. [1] https://cygwin.com/ml/cygwin/2014-08/msg00401.html [2] https://cygwin.com/ml/cygwin/2015-11/msg00353.html gdb/ChangeLog: 2016-01-20 Jon Turney <jon.turney@dronecode.org.uk> * windows-nat.c (windows_make_so): Warn rather than stopping with an error if realpath() fails.
2020-04-10Fix debugging of WOW64 processesHannes Domani1-5/+8
The new code regarding pending stops only checks for EXCEPTION_BREAKPOINT, but for WOW64 processes STATUS_WX86_BREAKPOINT is necessary as well. Also, ignore_first_breakpoint is used now in nat/windows-nat.c as well, but was not available there. gdb/ChangeLog: 2020-04-10 Hannes Domani <ssbssa@yahoo.de> * nat/windows-nat.c (STATUS_WX86_BREAKPOINT, STATUS_WX86_SINGLE_STEP): Move to... * nat/windows-nat.h (STATUS_WX86_BREAKPOINT, STATUS_WX86_SINGLE_STEP): ... here. * windows-nat.c (windows_nat_target::get_windows_debug_event): Check for STATUS_WX86_BREAKPOINT. (windows_nat_target::wait): Same.
2020-04-08Move wait_for_debug_event to nat/windows-nat.cTom Tromey1-11/+0
This moves the wait_for_debug_event helper function to nat/windows-nat.c, and changes gdbserver to use it. wait_for_debug_event is a wrapper for WaitForDebugEvent that also sets last_wait_event when appropriate. This is needed to properly handle queued stops. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (wait_for_debug_event): Move to nat/windows-nat.c. * nat/windows-nat.h (wait_for_debug_event): Declare. * nat/windows-nat.c (wait_for_debug_event): Move from windows-nat.c. No longer static. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (win32_kill, get_child_debug_event): Use wait_for_debug_event.
2020-04-08Introduce fetch_pending_stopTom Tromey1-20/+9
This introduces a new "fetch_pending_stop" function and changes gdb to use it. This function removes the first matching pending stop from the list of such stops. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (get_windows_debug_event): Use fetch_pending_stop. * nat/windows-nat.h (fetch_pending_stop): Declare. * nat/windows-nat.c (fetch_pending_stop): New function.
2020-04-08Share some inferior-related Windows codeTom Tromey1-25/+3
This adds a couple of functions to nat/windows-nat.c and changes gdb and gdbserver to use them. One function checks the list of pending stops for a match (not yet used by gdbserver, but will be in a subsequent patch); and the other is a wrapper for ContinueDebugEvent that always uses the last "real" stop event. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_continue): Use matching_pending_stop and continue_last_debug_event. * nat/windows-nat.h (matching_pending_stop) (continue_last_debug_event): Declare. * nat/windows-nat.c (DEBUG_EVENTS): New define. (matching_pending_stop, continue_last_debug_event): New functions. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (child_continue): Call continue_last_debug_event.
2020-04-08Share handle_exceptionTom Tromey1-189/+29
Both gdb and gdbserver have a "handle_exception" function, the bulk of which is shared between the two implementations. This patch arranges for the entire thing to be moved into nat/windows-nat.c, with the differences handled by callbacks. This patch introduces one more callback to make this possible. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (MS_VC_EXCEPTION): Move to nat/windows-nat.c. (handle_exception_result): Move to nat/windows-nat.h. (DEBUG_EXCEPTION_SIMPLE): Remove. (windows_nat::handle_ms_vc_exception): New function. (handle_exception): Move to nat/windows-nat.c. (get_windows_debug_event): Update. (STATUS_WX86_BREAKPOINT, STATUS_WX86_SINGLE_STEP): Move to nat/windows-nat.c. * nat/windows-nat.h (handle_ms_vc_exception): Declare. (handle_exception_result): Move from windows-nat.c. (handle_exception): Declare. * nat/windows-nat.c (MS_VC_EXCEPTION, handle_exception) (STATUS_WX86_SINGLE_STEP, STATUS_WX86_BREAKPOINT): Move from windows-nat.c. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (handle_exception): Remove. (windows_nat::handle_ms_vc_exception): New function. (get_child_debug_event): Add "continue_status" parameter. Update. (win32_wait): Update.
2020-04-08Remove some globals from windows-nat.cTom Tromey1-6/+0
windows-nat.c has a few "count" globals that don't seem to be used. Possibly they were used for debugging at some point, but they no longer seem useful to me. Because they get in the way of some code sharing, this patch removes them. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (exception_count, event_count): Remove. (handle_exception, get_windows_debug_event) (do_initial_windows_stuff): Update.
2020-04-08Share handle_load_dll and handle_unload_dll declarationsTom Tromey1-17/+6
This changes nat/windows-nat.h to declare handle_load_dll and handle_unload_dll. The embedding application is required to implement these -- while the actual code was difficult to share due to some other differences between the two programs, sharing the declaration lets a subsequent patch share more code that uses these as callbacks. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat::handle_load_dll) (windows_nat::handle_unload_dll): Rename. No longer static. * nat/windows-nat.h (handle_load_dll, handle_unload_dll): Declare. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (windows_nat::handle_load_dll): Rename from handle_load_dll. No longer static. (windows_nat::handle_unload_dll): Rename from handle_unload_dll. No longer static.
2020-04-08Normalize handle_output_debug_string APITom Tromey1-5/+4
This changes gdbserver's implementation of handle_output_debug_string to have the same calling convention as that of gdb. This allows for sharing some more code in a subsequent patch. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat::handle_output_debug_string): Rename. No longer static. * nat/windows-nat.h (handle_output_debug_string): Declare. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (handle_output_debug_string): Add parameter. Change return type. (win32_kill, get_child_debug_event): Update.
2020-04-08Share some Windows-related globalsTom Tromey1-87/+38
This moves some Windows-related globals into nat/windows-nat.c, sharing them between gdb and gdbserver. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (current_process_handle, current_process_id) (main_thread_id, last_sig, current_event, last_wait_event) (current_windows_thread, desired_stop_thread_id, pending_stops) (struct pending_stop, siginfo_er): Move to nat/windows-nat.c. (display_selectors, fake_create_process) (get_windows_debug_event): Update. * nat/windows-nat.h (current_process_handle, current_process_id) (main_thread_id, last_sig, current_event, last_wait_event) (current_windows_thread, desired_stop_thread_id, pending_stops) (struct pending_stop, siginfo_er): Move from windows-nat.c. * nat/windows-nat.c (current_process_handle, current_process_id) (main_thread_id, last_sig, current_event, last_wait_event) (current_windows_thread, desired_stop_thread_id, pending_stops) (siginfo_er): New globals. Move from windows-nat.c. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (current_process_handle, current_process_id) (main_thread_id, last_sig, current_event, siginfo_er): Move to nat/windows-nat.c.
2020-04-08Share get_image_name between gdb and gdbserverTom Tromey1-51/+1
This moves get_image_name to nat/windows-nat.c so that it can be shared between gdb and gdbserver. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (get_image_name): Move to nat/windows-nat.c. (handle_load_dll): Update. * nat/windows-nat.c (get_image_name): Move from windows-nat.c. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (get_image_name): Remove. (handle_load_dll): Update.
2020-04-08Share thread_rec between gdb and gdbserverTom Tromey1-39/+22
This changes gdb and gdbserver to use the same calling convention for the "thread_rec" helper function. Fully merging these is difficult due to differences in how threads are managed by the enclosing applications; but sharing a declaration makes it possible for future shared code to call this method. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (enum thread_disposition_type): Move to nat/windows-nat.h. (windows_nat::thread_rec): Rename from thread_rec. No longer static. (windows_add_thread, windows_nat_target::fetch_registers) (windows_nat_target::store_registers, handle_exception) (windows_nat_target::resume, get_windows_debug_event) (windows_nat_target::get_tib_address) (windows_nat_target::thread_name) (windows_nat_target::thread_alive): Update. * nat/windows-nat.h (enum thread_disposition_type): Move from windows-nat.c. (thread_rec): Declare. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (windows_nat::thread_rec): Rename from thread_rec. No longer static. Change parameters. (child_add_thread, child_fetch_inferior_registers) (child_store_inferior_registers, win32_resume) (win32_get_tib_address): Update.
2020-04-08Wrap shared windows-nat code in windows_nat namespaceTom Tromey1-0/+2
This wraps the shared windows-nat code in a windows_nat namespace. This helps avoid name clashes. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c: Add "using namespace". * nat/windows-nat.h: Wrap contents in windows_nat namespace. * nat/windows-nat.c: Wrap contents in windows_nat namespace. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.h (struct win32_target_ops): Use qualified names where needed. * win32-i386-low.c: Add "using namespace". * win32-low.c: Add "using namespace". * win32-arm-low.c: Add "using namespace".
2020-04-08Handle pending stops from the Windows kernelTom Tromey1-13/+187
PR gdb/22992 concerns an assertion failure in gdb when debugging a certain inferior: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed. Initially the investigation centered on the discovery that gdb was not suspending other threads when attempting to single-step. This oversight is corrected in this patch: now, when stepping a thread, gdb will call SuspendThread on all other threads. However, the bug persisted even after this change. In particular, WaitForDebugEvent could see a stop for a thread that was ostensibly suspended. Our theory of what is happening here is that there are actually simultaneous breakpoint hits, and the Windows kernel queues the events, causing the second stop to be reported on a suspended thread. In Windows 10 or later gdb could use the DBG_REPLY_LATER flag to ContinueDebugEvent to request that such events be re-reported later. However, relying on that did not seem advisable, so this patch instead arranges to queue such "pending" stops, and then to report them later, once the step has completed. In the PR, Pedro pointed out that it's best in this scenario to implement the stopped_by_sw_breakpoint method, so this patch does this as well. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> PR gdb/22992 * windows-nat.c (current_event): Update comment. (last_wait_event, desired_stop_thread_id): New globals. (struct pending_stop): New. (pending_stops): New global. (windows_nat_target) <stopped_by_sw_breakpoint> <supports_stopped_by_sw_breakpoint>: New methods. (windows_fetch_one_register): Add assertions. Adjust PC. (windows_continue): Handle pending stops. Suspend other threads when stepping. Use last_wait_event (wait_for_debug_event): New function. (get_windows_debug_event): Use wait_for_debug_event. Handle pending stops. Queue spurious stops. (windows_nat_target::wait): Set stopped_at_software_breakpoint. (windows_nat_target::kill): Use wait_for_debug_event. * nat/windows-nat.h (struct windows_thread_info) <stopped_at_software_breakpoint>: New field. * nat/windows-nat.c (windows_thread_info::resume): Clear stopped_at_software_breakpoint.
2020-04-08Change type of argument to windows-nat.c:thread_recTom Tromey1-20/+43
windows-nat.c:thread_rec accepts an integer parameter whose interpretation depends on whether it is less than, equal to, or greater than zero. I found this confusing at times, so this patch replaces it with an enum instead. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (enum thread_disposition_type): New. (thread_rec): Replace "get_context" parameter with "disposition"; change type. (windows_add_thread, windows_nat_target::fetch_registers) (windows_nat_target::store_registers, handle_exception) (windows_nat_target::resume, get_windows_debug_event) (windows_nat_target::get_tib_address) (windows_nat_target::thread_name) (windows_nat_target::thread_alive): Update.
2020-04-08Share Windows thread-suspend and -resume codeTom Tromey1-24/+2
This adds "suspend" and "resume" methods to windows_thread_info, and changes gdb and gdbserver to share this code. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (thread_rec): Use windows_thread_info::suspend. (windows_continue): Use windows_continue::resume. * nat/windows-nat.h (struct windows_thread_info) <suspend, resume>: Declare new methods. * nat/windows-nat.c: New file. * configure.nat (NATDEPFILES): Add nat/windows-nat.o when needed. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (win32_require_context, suspend_one_thread): Use windows_thread_info::suspend. (continue_one_thread): Use windows_thread_info::resume. * configure.srv (srv_tgtobj): Add windows-nat.o when needed.
2020-04-08Use lwp, not tid, for Windows thread idTom Tromey1-27/+27
This changes windows-nat.c to put the Windows thread id into the "lwp" field of ptid_t, not the "tid" field. This is done for two reasons. First, ptid.h has this to say: process_stratum targets that handle threading themselves should prefer using the ptid.lwp field, leaving the ptid.tid field for any thread_stratum target that might want to sit on top. Second, this change brings gdb and gdbserver into sync here, which makes sharing code simpler. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_add_thread, windows_delete_thread) (windows_nat_target::fetch_registers) (windows_nat_target::store_registers, fake_create_process) (windows_nat_target::resume, windows_nat_target::resume) (get_windows_debug_event, windows_nat_target::wait) (windows_nat_target::pid_to_str) (windows_nat_target::get_tib_address) (windows_nat_target::get_ada_task_ptid) (windows_nat_target::thread_name) (windows_nat_target::thread_alive): Use lwp, not tid.
2020-04-08Make windows_thread_info::name a unique_xmalloc_ptrTom Tromey1-3/+2
This changes windows_thread_info::name to be a unique_xmalloc_ptr, removing some manual memory management. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (handle_exception) (windows_nat_target::thread_name): Update. * nat/windows-nat.h (windows_thread_info): Remove destructor. <name>: Now unique_xmalloc_ptr.
2020-04-08Change two windows_thread_info members to "bool"Tom Tromey1-2/+2
This changes a couple of fields of windows_thread_info to have type "bool". It also updates the comment of another field, to clarify the possible values it can hold. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (thread_rec) (windows_nat_target::fetch_registers): Update. * nat/windows-nat.h (struct windows_thread_info) <suspended>: Update comment. <debug_registers_changed, reload_context>: Now bool. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-i386-low.c (update_debug_registers) (i386_prepare_to_resume, i386_thread_added): Update.
2020-04-08Use new and delete for windows_thread_infoTom Tromey1-9/+6
This adds a constructor, destructor, and member initializers to windows_thread_info, and changes gdb and gdbserver to use new and delete. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_add_thread): Use new. (windows_init_thread_list, windows_delete_thread): Use delete. (get_windows_debug_event): Update. * nat/windows-nat.h (struct windows_thread_info): Add constructor, destructor, and initializers. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (child_add_thread): Use new. (delete_thread_info): Use delete.
2020-04-08Share windows_thread_info between gdb and gdbserverTom Tromey1-19/+1
This introduces a new file, nat/windows-nat.h, which holds the definition of windows_thread_info. This is now shared between gdb and gdbserver. Note that the two implementations different slightly. gdb had a couple of fields ("name" and "reload_context") that gdbserver did not; while gdbserver had one field ("base_context") that gdb did not, plus better comments. The new file preserves all the fields, and the comments. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (struct windows_thread_info): Remove. * nat/windows-nat.h: New file. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.h (struct windows_thread_info): Remove.
2020-04-08Rename windows_thread_info::id to "tid"Tom Tromey1-5/+5
This changes the name of a field in windows_thread_info, bringing gdb and gdbserver closer into sync. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (struct windows_thread_info) <tid>: Rename from "id". (thread_rec, windows_add_thread, windows_delete_thread) (windows_continue): Update.
2020-04-08Remove the "next" field from windows_thread_infoTom Tromey1-31/+21
This changes windows_thread_info to remove the "next" field, replacing the linked list of threads with a vector. This is a prerequisite to sharing this structure with gdbserver, which manages threads differently. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (struct windows_thread_info): Remove typedef. (thread_head): Remove. (thread_list): New global. (thread_rec, windows_add_thread, windows_init_thread_list) (windows_delete_thread, windows_continue): Update.
2020-03-27Always fix system DLL paths for 32bit programsHannes Domani1-19/+24
GetModuleFileNameEx might also return the 64bit system directory for 32bit programs even for a 32bit gdb: (gdb) info sharedlibrary From To Syms Read Shared Object Library 0x779d0000 0x77b34d20 Yes (*) C:\Windows\SysWOW64\ntdll.dll 0x76850000 0x7694ad9c Yes (*) C:\Windows\syswow64\kernel32.dll 0x75421000 0x75466a18 Yes (*) C:\Windows\syswow64\KernelBase.dll 0x6fbe1000 0x6fcca1c0 Yes (*) C:\Windows\system32\dbghelp.dll 0x76d31000 0x76ddb2c4 Yes (*) C:\Windows\syswow64\msvcrt.dll So this makes the path conversion for all 32bit programs. gdb/ChangeLog: 2020-03-27 Hannes Domani <ssbssa@yahoo.de> * windows-nat.c (windows_add_all_dlls): Fix system dll paths.
2020-03-25Fix WOW64 process system DLL pathsHannes Domani1-3/+41
GetModuleFileNameEx returns for some DLLs of WOW64 processes the path inside the 64bit system directory instead of the 32bit syswow64 directory. Problem happens e.g. with dbghelp.dll: (gdb) start Temporary breakpoint 1 at 0x415a00: file fiber.cpp, line 430. Starting program: C:\src\tests\fiber.exe warning: `C:\Windows\system32\dbghelp.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386. Temporary breakpoint 1, main () at fiber.cpp:430 430 { (gdb) info sharedlibrary From To Syms Read Shared Object Library 0x77070000 0x771d4d20 Yes (*) C:\Windows\SysWOW64\ntdll.dll 0x74dc0000 0x74ebad9c Yes (*) C:\Windows\syswow64\kernel32.dll 0x75341000 0x75386a18 Yes (*) C:\Windows\syswow64\KernelBase.dll 0x6f6a1000 0x6f7c48fc Yes (*) C:\Windows\system32\dbghelp.dll 0x74d01000 0x74dab2c4 Yes (*) C:\Windows\syswow64\msvcrt.dll (*): Shared library is missing debugging information. This detects this situation and converts the DLL path to the syswow64 equivalent. gdb/ChangeLog: 2020-03-25 Hannes Domani <ssbssa@yahoo.de> * windows-nat.c (windows_add_all_dlls): Fix system dll paths.
2020-03-04Implement debugging of WOW64 processesHannes Domani1-84/+390
For WOW64 processes, the Wow64* variants of SuspendThread, GetThreadContext, SetThreadContext, and GetThreadSelectorEntry have to be used instead. And instead of EnumProcessModules, EnumProcessModulesEx with LIST_MODULES_32BIT is necessary. gdb/ChangeLog: 2020-03-04 Hannes Domani <ssbssa@yahoo.de> * NEWS: Mention support for WOW64 processes. * amd64-windows-nat.c (amd64_mappings): Rename and remove static. (amd64_windows_segment_register_p): Remove static. (_initialize_amd64_windows_nat): Update. * configure.nat <windows> (NATDEPFILES): Add i386-windows-nat.o. * i386-windows-nat.c (context_offset): Update. (i386_mappings): Rename and remove static. (i386_windows_segment_register_p): Remove static. (_initialize_i386_windows_nat): Update. * windows-nat.c (STATUS_WX86_BREAKPOINT): New macro. (STATUS_WX86_SINGLE_STEP): New macro. (EnumProcessModulesEx): New macro. (Wow64SuspendThread): New macro. (Wow64GetThreadContext): New macro. (Wow64SetThreadContext): New macro. (Wow64GetThreadSelectorEntry): New macro. (windows_set_context_register_offsets): Add static. (windows_set_segment_register_p): Likewise. (windows_add_thread): Adapt for WOW64 processes. (windows_fetch_one_register): Likewise. (windows_nat_target::fetch_registers): Likewise. (windows_store_one_register): Likewise. (display_selector): Likewise. (display_selectors): Likewise. (handle_exception): Likewise. (windows_continue): Likewise. (windows_nat_target::resume): Likewise. (windows_add_all_dlls): Likewise. (do_initial_windows_stuff): Likewise. (windows_nat_target::attach): Likewise. (windows_get_exec_module_filename): Likewise. (windows_nat_target::create_inferior): Likewise. (windows_xfer_siginfo): Likewise. (_initialize_loadable): Initialize Wow64SuspendThread, Wow64GetThreadContext, Wow64SetThreadContext, Wow64GetThreadSelectorEntry and EnumProcessModulesEx. * windows-nat.h (windows_set_context_register_offsets): Remove declaration. (windows_set_segment_register_p): Likewise. (i386_windows_segment_register_p): Add declaration. (amd64_windows_segment_register_p): Likewise.
2020-02-09Display ExceptionRecord for $_siginfoHannes Domani1-0/+31
Uses the $_siginfo convenience variable to show the last exception. The type looks like this: (gdb) pt $_siginfo type = struct EXCEPTION_RECORD { DWORD ExceptionCode; DWORD ExceptionFlags; struct EXCEPTION_RECORD *ExceptionRecord; PVOID ExceptionAddress; DWORD NumberParameters; ULONG_PTR ExceptionInformation[15]; } EXCEPTION_RECORD is documented at [1]. Example: Program received signal SIGSEGV, Segmentation fault. main () at crasher.c:4 4 *(int*)0x123 = 0; (gdb) p $_siginfo $1 = { ExceptionCode = 3221225477, ExceptionFlags = 0, ExceptionRecord = 0x0, ExceptionAddress = 0x401632 <main+18>, NumberParameters = 2, ExceptionInformation = {1, 291, 0 <repeats 13 times>} } (gdb) p/x $_siginfo.ExceptionCode $2 = 0xc0000005 (gdb) p/x $_siginfo.ExceptionInformation[1] $3 = 0x123 And 0xc0000005 is the value of EXCEPTION_ACCESS_VIOLATION. [1] https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-exception_record gdb/ChangeLog: 2020-02-09 Hannes Domani <ssbssa@yahoo.de> * NEWS: Mention $_siginfo support for Windows. * windows-nat.c (handle_exception): Set siginfo_er. (windows_nat_target::mourn_inferior): Reset siginfo_er. (windows_xfer_siginfo): New function. (windows_nat_target::xfer_partial): Call windows_xfer_siginfo. * windows-tdep.c (struct windows_gdbarch_data): New struct. (init_windows_gdbarch_data): New function. (get_windows_gdbarch_data): New function. (windows_get_siginfo_type): New function. (windows_init_abi): Register windows_get_siginfo_type. (_initialize_windows_tdep): Register init_windows_gdbarch_data. gdbserver/ChangeLog: 2020-02-09 Hannes Domani <ssbssa@yahoo.de> * win32-low.c (win32_clear_inferiors): Reset siginfo_er. (handle_exception): Set siginfo_er. (win32_xfer_siginfo): New function.
2020-01-23Cache the text section offset of shared librariesHannes Domani1-0/+2
Each time a dll is loaded, update_solib_list is called. This in turn calls deep down xfer_partial -> windows_xfer_shared_libraries, which calls windows_xfer_shared_library for each loaded dll, and pe_text_section_offset reads the dll for the text section offset. Also if the data provided by xfer_partial is bigger than 4K, then all of this is done for each 4K chunk (see target_read_alloc_1). Caching of the text section offset improves the startup time of an application with >300 dynamically loaded plugins from 2m10s to 10s. And the shutdown time improves from 2m to 2s. gdb/ChangeLog: 2020-01-23 Hannes Domani <ssbssa@yahoo.de> * i386-cygwin-tdep.c (core_process_module_section): Update. * windows-nat.c (struct lm_info_windows): Add text_offset. (windows_xfer_shared_libraries): Update. * windows-tdep.c (windows_xfer_shared_library): Add text_offset_cached argument. * windows-tdep.h (windows_xfer_shared_library): Update.
2020-01-13gdb: add back declarations for _initialize functionsSimon Marchi1-3/+6
I'd like to enable the -Wmissing-declarations warning. However, it warns for every _initialize function, for example: CXX dcache.o /home/smarchi/src/binutils-gdb/gdb/dcache.c: In function ‘void _initialize_dcache()’: /home/smarchi/src/binutils-gdb/gdb/dcache.c:688:1: error: no previous declaration for ‘void _initialize_dcache()’ [-Werror=missing-declarations] _initialize_dcache (void) ^~~~~~~~~~~~~~~~~~ The only practical way forward I found is to add back the declarations, which were removed by this commit: commit 481695ed5f6e0a8a9c9c50bfac1cdd2b3151e6c9 Author: John Baldwin <jhb@FreeBSD.org> Date: Sat Sep 9 11:02:37 2017 -0700 Remove unnecessary function prototypes. I don't think it's a big problem to have the declarations for these functions, but if anybody has a better solution for this, I'll be happy to use it. gdb/ChangeLog: * aarch64-fbsd-nat.c (_initialize_aarch64_fbsd_nat): Add declaration. * aarch64-fbsd-tdep.c (_initialize_aarch64_fbsd_tdep): Add declaration. * aarch64-linux-nat.c (_initialize_aarch64_linux_nat): Add declaration. * aarch64-linux-tdep.c (_initialize_aarch64_linux_tdep): Add declaration. * aarch64-newlib-tdep.c (_initialize_aarch64_newlib_tdep): Add declaration. * aarch64-tdep.c (_initialize_aarch64_tdep): Add declaration. * ada-exp.y (_initialize_ada_exp): Add declaration. * ada-lang.c (_initialize_ada_language): Add declaration. * ada-tasks.c (_initialize_tasks): Add declaration. * agent.c (_initialize_agent): Add declaration. * aix-thread.c (_initialize_aix_thread): Add declaration. * alpha-bsd-nat.c (_initialize_alphabsd_nat): Add declaration. * alpha-linux-nat.c (_initialize_alpha_linux_nat): Add declaration. * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add declaration. * alpha-nbsd-tdep.c (_initialize_alphanbsd_tdep): Add declaration. * alpha-obsd-tdep.c (_initialize_alphaobsd_tdep): Add declaration. * alpha-tdep.c (_initialize_alpha_tdep): Add declaration. * amd64-darwin-tdep.c (_initialize_amd64_darwin_tdep): Add declaration. * amd64-dicos-tdep.c (_initialize_amd64_dicos_tdep): Add declaration. * amd64-fbsd-nat.c (_initialize_amd64fbsd_nat): Add declaration. * amd64-fbsd-tdep.c (_initialize_amd64fbsd_tdep): Add declaration. * amd64-linux-nat.c (_initialize_amd64_linux_nat): Add declaration. * amd64-linux-tdep.c (_initialize_amd64_linux_tdep): Add declaration. * amd64-nbsd-nat.c (_initialize_amd64nbsd_nat): Add declaration. * amd64-nbsd-tdep.c (_initialize_amd64nbsd_tdep): Add declaration. * amd64-obsd-nat.c (_initialize_amd64obsd_nat): Add declaration. * amd64-obsd-tdep.c (_initialize_amd64obsd_tdep): Add declaration. * amd64-sol2-tdep.c (_initialize_amd64_sol2_tdep): Add declaration. * amd64-tdep.c (_initialize_amd64_tdep): Add declaration. * amd64-windows-nat.c (_initialize_amd64_windows_nat): Add declaration. * amd64-windows-tdep.c (_initialize_amd64_windows_tdep): Add declaration. * annotate.c (_initialize_annotate): Add declaration. * arc-newlib-tdep.c (_initialize_arc_newlib_tdep): Add declaration. * arc-tdep.c (_initialize_arc_tdep): Add declaration. * arch-utils.c (_initialize_gdbarch_utils): Add declaration. * arm-fbsd-nat.c (_initialize_arm_fbsd_nat): Add declaration. * arm-fbsd-tdep.c (_initialize_arm_fbsd_tdep): Add declaration. * arm-linux-nat.c (_initialize_arm_linux_nat): Add declaration. * arm-linux-tdep.c (_initialize_arm_linux_tdep): Add declaration. * arm-nbsd-nat.c (_initialize_arm_netbsd_nat): Add declaration. * arm-nbsd-tdep.c (_initialize_arm_netbsd_tdep): Add declaration. * arm-obsd-tdep.c (_initialize_armobsd_tdep): Add declaration. * arm-pikeos-tdep.c (_initialize_arm_pikeos_tdep): Add declaration. * arm-symbian-tdep.c (_initialize_arm_symbian_tdep): Add declaration. * arm-tdep.c (_initialize_arm_tdep): Add declaration. * arm-wince-tdep.c (_initialize_arm_wince_tdep): Add declaration. * auto-load.c (_initialize_auto_load): Add declaration. * auxv.c (_initialize_auxv): Add declaration. * avr-tdep.c (_initialize_avr_tdep): Add declaration. * ax-gdb.c (_initialize_ax_gdb): Add declaration. * bfin-linux-tdep.c (_initialize_bfin_linux_tdep): Add declaration. * bfin-tdep.c (_initialize_bfin_tdep): Add declaration. * break-catch-sig.c (_initialize_break_catch_sig): Add declaration. * break-catch-syscall.c (_initialize_break_catch_syscall): Add declaration. * break-catch-throw.c (_initialize_break_catch_throw): Add declaration. * breakpoint.c (_initialize_breakpoint): Add declaration. * bsd-uthread.c (_initialize_bsd_uthread): Add declaration. * btrace.c (_initialize_btrace): Add declaration. * charset.c (_initialize_charset): Add declaration. * cli/cli-cmds.c (_initialize_cli_cmds): Add declaration. * cli/cli-dump.c (_initialize_cli_dump): Add declaration. * cli/cli-interp.c (_initialize_cli_interp): Add declaration. * cli/cli-logging.c (_initialize_cli_logging): Add declaration. * cli/cli-script.c (_initialize_cli_script): Add declaration. * cli/cli-style.c (_initialize_cli_style): Add declaration. * coff-pe-read.c (_initialize_coff_pe_read): Add declaration. * coffread.c (_initialize_coffread): Add declaration. * compile/compile-cplus-types.c (_initialize_compile_cplus_types): Add declaration. * compile/compile.c (_initialize_compile): Add declaration. * complaints.c (_initialize_complaints): Add declaration. * completer.c (_initialize_completer): Add declaration. * copying.c (_initialize_copying): Add declaration. * corefile.c (_initialize_core): Add declaration. * corelow.c (_initialize_corelow): Add declaration. * cp-abi.c (_initialize_cp_abi): Add declaration. * cp-namespace.c (_initialize_cp_namespace): Add declaration. * cp-support.c (_initialize_cp_support): Add declaration. * cp-valprint.c (_initialize_cp_valprint): Add declaration. * cris-linux-tdep.c (_initialize_cris_linux_tdep): Add declaration. * cris-tdep.c (_initialize_cris_tdep): Add declaration. * csky-linux-tdep.c (_initialize_csky_linux_tdep): Add declaration. * csky-tdep.c (_initialize_csky_tdep): Add declaration. * ctfread.c (_initialize_ctfread): Add declaration. * d-lang.c (_initialize_d_language): Add declaration. * darwin-nat-info.c (_initialize_darwin_info_commands): Add declaration. * darwin-nat.c (_initialize_darwin_nat): Add declaration. * dbxread.c (_initialize_dbxread): Add declaration. * dcache.c (_initialize_dcache): Add declaration. * disasm-selftests.c (_initialize_disasm_selftests): Add declaration. * disasm.c (_initialize_disasm): Add declaration. * dtrace-probe.c (_initialize_dtrace_probe): Add declaration. * dummy-frame.c (_initialize_dummy_frame): Add declaration. * dwarf-index-cache.c (_initialize_index_cache): Add declaration. * dwarf-index-write.c (_initialize_dwarf_index_write): Add declaration. * dwarf2-frame-tailcall.c (_initialize_tailcall_frame): Add declaration. * dwarf2-frame.c (_initialize_dwarf2_frame): Add declaration. * dwarf2expr.c (_initialize_dwarf2expr): Add declaration. * dwarf2loc.c (_initialize_dwarf2loc): Add declaration. * dwarf2read.c (_initialize_dwarf2_read): Add declaration. * elfread.c (_initialize_elfread): Add declaration. * exec.c (_initialize_exec): Add declaration. * extension.c (_initialize_extension): Add declaration. * f-lang.c (_initialize_f_language): Add declaration. * f-valprint.c (_initialize_f_valprint): Add declaration. * fbsd-nat.c (_initialize_fbsd_nat): Add declaration. * fbsd-tdep.c (_initialize_fbsd_tdep): Add declaration. * filesystem.c (_initialize_filesystem): Add declaration. * findcmd.c (_initialize_mem_search): Add declaration. * findvar.c (_initialize_findvar): Add declaration. * fork-child.c (_initialize_fork_child): Add declaration. * frame-base.c (_initialize_frame_base): Add declaration. * frame-unwind.c (_initialize_frame_unwind): Add declaration. * frame.c (_initialize_frame): Add declaration. * frv-linux-tdep.c (_initialize_frv_linux_tdep): Add declaration. * frv-tdep.c (_initialize_frv_tdep): Add declaration. * ft32-tdep.c (_initialize_ft32_tdep): Add declaration. * gcore.c (_initialize_gcore): Add declaration. * gdb-demangle.c (_initialize_gdb_demangle): Add declaration. * gdb_bfd.c (_initialize_gdb_bfd): Add declaration. * gdbarch-selftests.c (_initialize_gdbarch_selftests): Add declaration. * gdbarch.c (_initialize_gdbarch): Add declaration. * gdbtypes.c (_initialize_gdbtypes): Add declaration. * gnu-nat.c (_initialize_gnu_nat): Add declaration. * gnu-v2-abi.c (_initialize_gnu_v2_abi): Add declaration. * gnu-v3-abi.c (_initialize_gnu_v3_abi): Add declaration. * go-lang.c (_initialize_go_language): Add declaration. * go32-nat.c (_initialize_go32_nat): Add declaration. * guile/guile.c (_initialize_guile): Add declaration. * h8300-tdep.c (_initialize_h8300_tdep): Add declaration. * hppa-linux-nat.c (_initialize_hppa_linux_nat): Add declaration. * hppa-linux-tdep.c (_initialize_hppa_linux_tdep): Add declaration. * hppa-nbsd-nat.c (_initialize_hppanbsd_nat): Add declaration. * hppa-nbsd-tdep.c (_initialize_hppanbsd_tdep): Add declaration. * hppa-obsd-nat.c (_initialize_hppaobsd_nat): Add declaration. * hppa-obsd-tdep.c (_initialize_hppabsd_tdep): Add declaration. * hppa-tdep.c (_initialize_hppa_tdep): Add declaration. * i386-bsd-nat.c (_initialize_i386bsd_nat): Add declaration. * i386-cygwin-tdep.c (_initialize_i386_cygwin_tdep): Add declaration. * i386-darwin-nat.c (_initialize_i386_darwin_nat): Add declaration. * i386-darwin-tdep.c (_initialize_i386_darwin_tdep): Add declaration. * i386-dicos-tdep.c (_initialize_i386_dicos_tdep): Add declaration. * i386-fbsd-nat.c (_initialize_i386fbsd_nat): Add declaration. * i386-fbsd-tdep.c (_initialize_i386fbsd_tdep): Add declaration. * i386-gnu-nat.c (_initialize_i386gnu_nat): Add declaration. * i386-gnu-tdep.c (_initialize_i386gnu_tdep): Add declaration. * i386-go32-tdep.c (_initialize_i386_go32_tdep): Add declaration. * i386-linux-nat.c (_initialize_i386_linux_nat): Add declaration. * i386-linux-tdep.c (_initialize_i386_linux_tdep): Add declaration. * i386-nbsd-nat.c (_initialize_i386nbsd_nat): Add declaration. * i386-nbsd-tdep.c (_initialize_i386nbsd_tdep): Add declaration. * i386-nto-tdep.c (_initialize_i386nto_tdep): Add declaration. * i386-obsd-nat.c (_initialize_i386obsd_nat): Add declaration. * i386-obsd-tdep.c (_initialize_i386obsd_tdep): Add declaration. * i386-sol2-nat.c (_initialize_amd64_sol2_nat): Add declaration. * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Add declaration. * i386-tdep.c (_initialize_i386_tdep): Add declaration. * i386-windows-nat.c (_initialize_i386_windows_nat): Add declaration. * ia64-libunwind-tdep.c (_initialize_libunwind_frame): Add declaration. * ia64-linux-nat.c (_initialize_ia64_linux_nat): Add declaration. * ia64-linux-tdep.c (_initialize_ia64_linux_tdep): Add declaration. * ia64-tdep.c (_initialize_ia64_tdep): Add declaration. * ia64-vms-tdep.c (_initialize_ia64_vms_tdep): Add declaration. * infcall.c (_initialize_infcall): Add declaration. * infcmd.c (_initialize_infcmd): Add declaration. * inflow.c (_initialize_inflow): Add declaration. * infrun.c (_initialize_infrun): Add declaration. * interps.c (_initialize_interpreter): Add declaration. * iq2000-tdep.c (_initialize_iq2000_tdep): Add declaration. * jit.c (_initialize_jit): Add declaration. * language.c (_initialize_language): Add declaration. * linux-fork.c (_initialize_linux_fork): Add declaration. * linux-nat.c (_initialize_linux_nat): Add declaration. * linux-tdep.c (_initialize_linux_tdep): Add declaration. * linux-thread-db.c (_initialize_thread_db): Add declaration. * lm32-tdep.c (_initialize_lm32_tdep): Add declaration. * m2-lang.c (_initialize_m2_language): Add declaration. * m32c-tdep.c (_initialize_m32c_tdep): Add declaration. * m32r-linux-nat.c (_initialize_m32r_linux_nat): Add declaration. * m32r-linux-tdep.c (_initialize_m32r_linux_tdep): Add declaration. * m32r-tdep.c (_initialize_m32r_tdep): Add declaration. * m68hc11-tdep.c (_initialize_m68hc11_tdep): Add declaration. * m68k-bsd-nat.c (_initialize_m68kbsd_nat): Add declaration. * m68k-bsd-tdep.c (_initialize_m68kbsd_tdep): Add declaration. * m68k-linux-nat.c (_initialize_m68k_linux_nat): Add declaration. * m68k-linux-tdep.c (_initialize_m68k_linux_tdep): Add declaration. * m68k-tdep.c (_initialize_m68k_tdep): Add declaration. * machoread.c (_initialize_machoread): Add declaration. * macrocmd.c (_initialize_macrocmd): Add declaration. * macroscope.c (_initialize_macroscope): Add declaration. * maint-test-options.c (_initialize_maint_test_options): Add declaration. * maint-test-settings.c (_initialize_maint_test_settings): Add declaration. * maint.c (_initialize_maint_cmds): Add declaration. * mdebugread.c (_initialize_mdebugread): Add declaration. * memattr.c (_initialize_mem): Add declaration. * mep-tdep.c (_initialize_mep_tdep): Add declaration. * mi/mi-cmd-env.c (_initialize_mi_cmd_env): Add declaration. * mi/mi-cmds.c (_initialize_mi_cmds): Add declaration. * mi/mi-interp.c (_initialize_mi_interp): Add declaration. * mi/mi-main.c (_initialize_mi_main): Add declaration. * microblaze-linux-tdep.c (_initialize_microblaze_linux_tdep): Add declaration. * microblaze-tdep.c (_initialize_microblaze_tdep): Add declaration. * mips-fbsd-nat.c (_initialize_mips_fbsd_nat): Add declaration. * mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Add declaration. * mips-linux-nat.c (_initialize_mips_linux_nat): Add declaration. * mips-linux-tdep.c (_initialize_mips_linux_tdep): Add declaration. * mips-nbsd-nat.c (_initialize_mipsnbsd_nat): Add declaration. * mips-nbsd-tdep.c (_initialize_mipsnbsd_tdep): Add declaration. * mips-sde-tdep.c (_initialize_mips_sde_tdep): Add declaration. * mips-tdep.c (_initialize_mips_tdep): Add declaration. * mips64-obsd-nat.c (_initialize_mips64obsd_nat): Add declaration. * mips64-obsd-tdep.c (_initialize_mips64obsd_tdep): Add declaration. * mipsread.c (_initialize_mipsread): Add declaration. * mn10300-linux-tdep.c (_initialize_mn10300_linux_tdep): Add declaration. * mn10300-tdep.c (_initialize_mn10300_tdep): Add declaration. * moxie-tdep.c (_initialize_moxie_tdep): Add declaration. * msp430-tdep.c (_initialize_msp430_tdep): Add declaration. * nds32-tdep.c (_initialize_nds32_tdep): Add declaration. * nios2-linux-tdep.c (_initialize_nios2_linux_tdep): Add declaration. * nios2-tdep.c (_initialize_nios2_tdep): Add declaration. * nto-procfs.c (_initialize_procfs): Add declaration. * objc-lang.c (_initialize_objc_language): Add declaration. * observable.c (_initialize_observer): Add declaration. * opencl-lang.c (_initialize_opencl_language): Add declaration. * or1k-linux-tdep.c (_initialize_or1k_linux_tdep): Add declaration. * or1k-tdep.c (_initialize_or1k_tdep): Add declaration. * osabi.c (_initialize_gdb_osabi): Add declaration. * osdata.c (_initialize_osdata): Add declaration. * p-valprint.c (_initialize_pascal_valprint): Add declaration. * parse.c (_initialize_parse): Add declaration. * ppc-fbsd-nat.c (_initialize_ppcfbsd_nat): Add declaration. * ppc-fbsd-tdep.c (_initialize_ppcfbsd_tdep): Add declaration. * ppc-linux-nat.c (_initialize_ppc_linux_nat): Add declaration. * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Add declaration. * ppc-nbsd-nat.c (_initialize_ppcnbsd_nat): Add declaration. * ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Add declaration. * ppc-obsd-nat.c (_initialize_ppcobsd_nat): Add declaration. * ppc-obsd-tdep.c (_initialize_ppcobsd_tdep): Add declaration. * printcmd.c (_initialize_printcmd): Add declaration. * probe.c (_initialize_probe): Add declaration. * proc-api.c (_initialize_proc_api): Add declaration. * proc-events.c (_initialize_proc_events): Add declaration. * proc-service.c (_initialize_proc_service): Add declaration. * procfs.c (_initialize_procfs): Add declaration. * producer.c (_initialize_producer): Add declaration. * psymtab.c (_initialize_psymtab): Add declaration. * python/python.c (_initialize_python): Add declaration. * ravenscar-thread.c (_initialize_ravenscar): Add declaration. * record-btrace.c (_initialize_record_btrace): Add declaration. * record-full.c (_initialize_record_full): Add declaration. * record.c (_initialize_record): Add declaration. * regcache-dump.c (_initialize_regcache_dump): Add declaration. * regcache.c (_initialize_regcache): Add declaration. * reggroups.c (_initialize_reggroup): Add declaration. * remote-notif.c (_initialize_notif): Add declaration. * remote-sim.c (_initialize_remote_sim): Add declaration. * remote.c (_initialize_remote): Add declaration. * reverse.c (_initialize_reverse): Add declaration. * riscv-fbsd-nat.c (_initialize_riscv_fbsd_nat): Add declaration. * riscv-fbsd-tdep.c (_initialize_riscv_fbsd_tdep): Add declaration. * riscv-linux-nat.c (_initialize_riscv_linux_nat): Add declaration. * riscv-linux-tdep.c (_initialize_riscv_linux_tdep): Add declaration. * riscv-tdep.c (_initialize_riscv_tdep): Add declaration. * rl78-tdep.c (_initialize_rl78_tdep): Add declaration. * rs6000-aix-tdep.c (_initialize_rs6000_aix_tdep): Add declaration. * rs6000-lynx178-tdep.c (_initialize_rs6000_lynx178_tdep): Add declaration. * rs6000-nat.c (_initialize_rs6000_nat): Add declaration. * rs6000-tdep.c (_initialize_rs6000_tdep): Add declaration. * run-on-main-thread.c (_initialize_run_on_main_thread): Add declaration. * rust-exp.y (_initialize_rust_exp): Add declaration. * rx-tdep.c (_initialize_rx_tdep): Add declaration. * s12z-tdep.c (_initialize_s12z_tdep): Add declaration. * s390-linux-nat.c (_initialize_s390_nat): Add declaration. * s390-linux-tdep.c (_initialize_s390_linux_tdep): Add declaration. * s390-tdep.c (_initialize_s390_tdep): Add declaration. * score-tdep.c (_initialize_score_tdep): Add declaration. * ser-go32.c (_initialize_ser_dos): Add declaration. * ser-mingw.c (_initialize_ser_windows): Add declaration. * ser-pipe.c (_initialize_ser_pipe): Add declaration. * ser-tcp.c (_initialize_ser_tcp): Add declaration. * ser-uds.c (_initialize_ser_socket): Add declaration. * ser-unix.c (_initialize_ser_hardwire): Add declaration. * serial.c (_initialize_serial): Add declaration. * sh-linux-tdep.c (_initialize_sh_linux_tdep): Add declaration. * sh-nbsd-nat.c (_initialize_shnbsd_nat): Add declaration. * sh-nbsd-tdep.c (_initialize_shnbsd_tdep): Add declaration. * sh-tdep.c (_initialize_sh_tdep): Add declaration. * skip.c (_initialize_step_skip): Add declaration. * sol-thread.c (_initialize_sol_thread): Add declaration. * solib-aix.c (_initialize_solib_aix): Add declaration. * solib-darwin.c (_initialize_darwin_solib): Add declaration. * solib-dsbt.c (_initialize_dsbt_solib): Add declaration. * solib-frv.c (_initialize_frv_solib): Add declaration. * solib-svr4.c (_initialize_svr4_solib): Add declaration. * solib-target.c (_initialize_solib_target): Add declaration. * solib.c (_initialize_solib): Add declaration. * source-cache.c (_initialize_source_cache): Add declaration. * source.c (_initialize_source): Add declaration. * sparc-linux-nat.c (_initialize_sparc_linux_nat): Add declaration. * sparc-linux-tdep.c (_initialize_sparc_linux_tdep): Add declaration. * sparc-nat.c (_initialize_sparc_nat): Add declaration. * sparc-nbsd-nat.c (_initialize_sparcnbsd_nat): Add declaration. * sparc-nbsd-tdep.c (_initialize_sparcnbsd_tdep): Add declaration. * sparc-obsd-tdep.c (_initialize_sparc32obsd_tdep): Add declaration. * sparc-sol2-tdep.c (_initialize_sparc_sol2_tdep): Add declaration. * sparc-tdep.c (_initialize_sparc_tdep): Add declaration. * sparc64-fbsd-nat.c (_initialize_sparc64fbsd_nat): Add declaration. * sparc64-fbsd-tdep.c (_initialize_sparc64fbsd_tdep): Add declaration. * sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Add declaration. * sparc64-linux-tdep.c (_initialize_sparc64_linux_tdep): Add declaration. * sparc64-nat.c (_initialize_sparc64_nat): Add declaration. * sparc64-nbsd-nat.c (_initialize_sparc64nbsd_nat): Add declaration. * sparc64-nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Add declaration. * sparc64-obsd-nat.c (_initialize_sparc64obsd_nat): Add declaration. * sparc64-obsd-tdep.c (_initialize_sparc64obsd_tdep): Add declaration. * sparc64-sol2-tdep.c (_initialize_sparc64_sol2_tdep): Add declaration. * sparc64-tdep.c (_initialize_sparc64_adi_tdep): Add declaration. * stabsread.c (_initialize_stabsread): Add declaration. * stack.c (_initialize_stack): Add declaration. * stap-probe.c (_initialize_stap_probe): Add declaration. * std-regs.c (_initialize_frame_reg): Add declaration. * symfile-debug.c (_initialize_symfile_debug): Add declaration. * symfile-mem.c (_initialize_symfile_mem): Add declaration. * symfile.c (_initialize_symfile): Add declaration. * symmisc.c (_initialize_symmisc): Add declaration. * symtab.c (_initialize_symtab): Add declaration. * target.c (_initialize_target): Add declaration. * target-connection.c (_initialize_target_connection): Add declaration. * target-dcache.c (_initialize_target_dcache): Add declaration. * target-descriptions.c (_initialize_target_descriptions): Add declaration. * thread.c (_initialize_thread): Add declaration. * tic6x-linux-tdep.c (_initialize_tic6x_linux_tdep): Add declaration. * tic6x-tdep.c (_initialize_tic6x_tdep): Add declaration. * tilegx-linux-nat.c (_initialize_tile_linux_nat): Add declaration. * tilegx-linux-tdep.c (_initialize_tilegx_linux_tdep): Add declaration. * tilegx-tdep.c (_initialize_tilegx_tdep): Add declaration. * tracectf.c (_initialize_ctf): Add declaration. * tracefile-tfile.c (_initialize_tracefile_tfile): Add declaration. * tracefile.c (_initialize_tracefile): Add declaration. * tracepoint.c (_initialize_tracepoint): Add declaration. * tui/tui-hooks.c (_initialize_tui_hooks): Add declaration. * tui/tui-interp.c (_initialize_tui_interp): Add declaration. * tui/tui-layout.c (_initialize_tui_layout): Add declaration. * tui/tui-regs.c (_initialize_tui_regs): Add declaration. * tui/tui-stack.c (_initialize_tui_stack): Add declaration. * tui/tui-win.c (_initialize_tui_win): Add declaration. * tui/tui.c (_initialize_tui): Add declaration. * typeprint.c (_initialize_typeprint): Add declaration. * ui-style.c (_initialize_ui_style): Add declaration. * unittests/array-view-selftests.c (_initialize_array_view_selftests): Add declaration. * unittests/child-path-selftests.c (_initialize_child_path_selftests): Add declaration. * unittests/cli-utils-selftests.c (_initialize_cli_utils_selftests): Add declaration. * unittests/common-utils-selftests.c (_initialize_common_utils_selftests): Add declaration. * unittests/copy_bitwise-selftests.c (_initialize_copy_bitwise_utils_selftests): Add declaration. * unittests/environ-selftests.c (_initialize_environ_selftests): Add declaration. * unittests/filtered_iterator-selftests.c (_initialize_filtered_iterator_selftests): Add declaration. * unittests/format_pieces-selftests.c (_initialize_format_pieces_selftests): Add declaration. * unittests/function-view-selftests.c (_initialize_function_view_selftests): Add declaration. * unittests/help-doc-selftests.c (_initialize_help_doc_selftests): Add declaration. * unittests/lookup_name_info-selftests.c (_initialize_lookup_name_info_selftests): Add declaration. * unittests/main-thread-selftests.c (_initialize_main_thread_selftests): Add declaration. * unittests/memory-map-selftests.c (_initialize_memory_map_selftests): Add declaration. * unittests/memrange-selftests.c (_initialize_memrange_selftests): Add declaration. * unittests/mkdir-recursive-selftests.c (_initialize_mkdir_recursive_selftests): Add declaration. * unittests/observable-selftests.c (_initialize_observer_selftest): Add declaration. * unittests/offset-type-selftests.c (_initialize_offset_type_selftests): Add declaration. * unittests/optional-selftests.c (_initialize_optional_selftests): Add declaration. * unittests/parse-connection-spec-selftests.c (_initialize_parse_connection_spec_selftests): Add declaration. * unittests/rsp-low-selftests.c (_initialize_rsp_low_selftests): Add declaration. * unittests/scoped_fd-selftests.c (_initialize_scoped_fd_selftests): Add declaration. * unittests/scoped_mmap-selftests.c (_initialize_scoped_mmap_selftests): Add declaration. * unittests/scoped_restore-selftests.c (_initialize_scoped_restore_selftests): Add declaration. * unittests/string_view-selftests.c (_initialize_string_view_selftests): Add declaration. * unittests/style-selftests.c (_initialize_style_selftest): Add declaration. * unittests/tracepoint-selftests.c (_initialize_tracepoint_selftests): Add declaration. * unittests/tui-selftests.c (_initialize_tui_selftest): Add declaration. * unittests/unpack-selftests.c (_initialize_unpack_selftests): Add declaration. * unittests/utils-selftests.c (_initialize_utils_selftests): Add declaration. * unittests/vec-utils-selftests.c (_initialize_vec_utils_selftests): Add declaration. * unittests/xml-utils-selftests.c (_initialize_xml_utils): Add declaration. * user-regs.c (_initialize_user_regs): Add declaration. * utils.c (_initialize_utils): Add declaration. * v850-tdep.c (_initialize_v850_tdep): Add declaration. * valops.c (_initialize_valops): Add declaration. * valprint.c (_initialize_valprint): Add declaration. * value.c (_initialize_values): Add declaration. * varobj.c (_initialize_varobj): Add declaration. * vax-bsd-nat.c (_initialize_vaxbsd_nat): Add declaration. * vax-nbsd-tdep.c (_initialize_vaxnbsd_tdep): Add declaration. * vax-tdep.c (_initialize_vax_tdep): Add declaration. * windows-nat.c (_initialize_windows_nat): Add declaration. (_initialize_check_for_gdb_ini): Add declaration. (_initialize_loadable): Add declaration. * windows-tdep.c (_initialize_windows_tdep): Add declaration. * x86-bsd-nat.c (_initialize_x86_bsd_nat): Add declaration. * x86-linux-nat.c (_initialize_x86_linux_nat): Add declaration. * xcoffread.c (_initialize_xcoffread): Add declaration. * xml-support.c (_initialize_xml_support): Add declaration. * xstormy16-tdep.c (_initialize_xstormy16_tdep): Add declaration. * xtensa-linux-nat.c (_initialize_xtensa_linux_nat): Add declaration. * xtensa-linux-tdep.c (_initialize_xtensa_linux_tdep): Add declaration. * xtensa-tdep.c (_initialize_xtensa_tdep): Add declaration. Change-Id: I13eec7e0ed2b3c427377a7bdb055cf46da64def9