summaryrefslogtreecommitdiff
path: root/gdbserver/win32-low.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year range in header of all files managed by GDBJoel Brobecker2023-01-011-1/+1
| | | | | | | This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
* gdbsupport: move include/gdb/fileio.h contents to fileio.hSimon Marchi2022-09-211-1/+1
| | | | | | | | | | | | I don't see why include/gdb/fileio.h is placed there. It's not installed by "make install", and it's not included by anything outside of gdb/gdbserver/gdbsupport. Move its content back to gdbsupport/fileio.h. I have omitted the bits inside an `#if 0`, since it's obviously not used, as well as the "limits" constants, which are also unused. Change-Id: I6fbc2ea10fbe4cfcf15f9f76006b31b99c20e5a9
* Use strwinerror in gdb/windows-nat.cTom Tromey2022-08-161-59/+0
| | | | | | | | | | | | When working on windows-nat.c, it's useful to see an error message in addition to the error number given by GetLastError. This patch moves strwinerror from gdbserver to gdbsupport, and then updates windows-nat.c to use it. A couple of minor changes to strwinerror (constify the return type and use the ARRAY_SIZE macro) are also included.
* Use subclasses of windows_process_infoTom Tromey2022-06-071-55/+31
| | | | | | | | | | | | | | | | | | | | | | | | This changes windows_process_info to use virtual methods for its callbacks, and then changes the two clients of this code to subclass this class to implement the methods. I considered using CRTP here, but that would require making the new structures visible to the compilation of of nat/windows-nat.c. This seemed like a bit of a pain, so I didn't do it. This change then lets us change all the per-inferior globals to be members of the new subclass. Note that there can still only be a single inferior -- currently there's a single global of the new type. This is just another step toward possibly implementing multi-inferior for Windows. It's possible this could be cleaned up further... ideally I'd like to move more of the data into the base class. However, because gdb supports Cygwin and gdbserver does not, and because I don't have a way to build or test Cygwin, larger refactorings are difficult.
* Allow ASLR to be disabled on WindowsTom Tromey2022-06-071-0/+1
| | | | | | | | | | | On Windows, it is possible to disable ASLR when creating a process. This patch adds code to do this, and hooks it up to gdb's existing disable-randomization feature. Because the Windows documentation cautions that this isn't available on all versions of Windows, the CreateProcess wrapper function is updated to make the attempt, and then fall back to the current approach if it fails.
* Introduce wrapper for CreateProcessTom Tromey2022-06-071-4/+1
| | | | | | | | This is a small refactoring that introduces a wrapper for the Windows CreateProcess function. This is done to make the next patch a bit simpler.
* Implement pid_to_exec_file for Windows in gdbserverTom Tromey2022-05-131-0/+6
| | | | | | | | | | I noticed that gdbserver did not implement pid_to_exec_file for Windows, while gdb did implement it. This patch moves the code to nat/windows-nat.c, so that it can be shared. This makes the gdbserver implementation trivial.
* Remove windows_process_info::idTom Tromey2022-05-131-6/+5
| | | | | | | | I noticed that windows_process_info::id is only used by gdbserver, and not really necessary. This patch removes it.
* Fix gdbserver build for x86-64 WindowsTom Tromey2022-04-271-18/+23
| | | | | | | | | | | | | I broke the gdbserver build on x86-64 Windows a little while back. Previously, I could not build this configuration, but today I found out that if I configure with: --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 using the Fedora 34 tools, it will in fact build. I'm not certain, but maybe the gnulib update helped with this. This patch fixes the build. I'm checking it in.
* Use GetThreadDescription on WindowsTom Tromey2022-04-141-1/+1
| | | | | | | | | | | | Windows 10 introduced SetThreadDescription and GetThreadDescription, a simpler way to set a thread's name. This changes gdb and gdbserver to use this convention when it is available. This is part of PR win32/29050. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29050
* Implement thread_name for gdbserverTom Tromey2022-04-141-0/+9
| | | | | | | This changes gdbserver to implement thread_name method.
* Share handle_ms_vc_exception with gdbserverTom Tromey2022-04-141-9/+0
| | | | | | | | | | Currently, gdb's native Windows target implements the exception-based approach for setting thread names, but gdbserver does not. This patch moves handle_ms_vc_exception to the shared nat/windows-nat.c code, as preparation for adding this support to gdbserver.
* Remove some globals from nat/windows-nat.cTom Tromey2022-04-041-112/+133
| | | | | | | | | | | | | | | | | | | nat/windows-nat.c has a number of globals that it uses to communicate with its clients (gdb and gdbserver). However, if we ever want the Windows ports to be multi-inferior, globals won't work. This patch takes a step toward that by moving most nat/windows-nat.c globals into a new struct windows_process_info. Many functions are converted to be methods on this object. A couple of globals remain, as they are needed to truly be global due to the way that the Windows debugging APIs work. The clients still have a global for the current process. That is, this patch is a step toward the end goal, but doesn't implement the goal itself.
* Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker2022-01-011-1/+1
| | | | | | | | This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
* gdbserver: replace direct assignments to current_threadTankut Baris Aktemur2021-12-131-3/+3
| | | | | | | | | | Replace the direct assignments to current_thread with switch_to_thread. Use scoped_restore_current_thread when appropriate. There is one instance remaining in linux-low.cc's wait_for_sigstop. This will be handled in a separate patch. Regression-tested on X86-64 Linux using the native-gdbserver and native-extended-gdbserver board files.
* gdb, gdbserver: make target_waitstatus safeSimon Marchi2021-10-211-24/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I stumbled on a bug caused by the fact that a code path read target_waitstatus::value::sig (expecting it to contain a gdb_signal value) while target_waitstatus::kind was TARGET_WAITKIND_FORKED. This meant that the active union field was in fact target_waitstatus::value::related_pid, and contained a ptid. The read signal value was therefore garbage, and that caused GDB to crash soon after. Or, since that GDB was built with ubsan, this nice error message: /home/simark/src/binutils-gdb/gdb/linux-nat.c:1271:12: runtime error: load of value 2686365, which is not a valid value for type 'gdb_signal' Despite being a large-ish change, I think it would be nice to make target_waitstatus safe against that kind of bug. As already done elsewhere (e.g. dynamic_prop), validate that the type of value read from the union matches what is supposed to be the active field. - Make the kind and value of target_waitstatus private. - Make the kind initialized to TARGET_WAITKIND_IGNORE on target_waitstatus construction. This is what most users appear to do explicitly. - Add setters, one for each kind. Each setter takes as a parameter the data associated to that kind, if any. This makes it impossible to forget to attach the associated data. - Add getters, one for each associated data type. Each getter validates that the data type fetched by the user matches the wait status kind. - Change "integer" to "exit_status", "related_pid" to "child_ptid", just because that's more precise terminology. - Fix all users. That last point is semi-mechanical. There are a lot of obvious changes, but some less obvious ones. For example, it's not possible to set the kind at some point and the associated data later, as some users did. But in any case, the intent of the code should not change in this patch. This was tested on x86-64 Linux (unix, native-gdbserver and native-extended-gdbserver boards). It was built-tested on x86-64 FreeBSD, NetBSD, MinGW and macOS. The rest of the changes to native files was done as a best effort. If I forgot any place to update in these files, it should be easy to fix (unless the change happens to reveal an actual bug). Change-Id: I0ae967df1ff6e28de78abbe3ac9b4b2ff4ad03b7
* Fix the Windows buildTom Tromey2021-07-261-3/+3
| | | | | The gdb build was broken on Windows after the patch to change get_inferior_cwd. This patch fixes the build.
* Share DLL code between gdb and gdbserverTom Tromey2021-04-301-162/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use nat/windows-nat function indirection codeTom Tromey2021-04-301-142/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes gdbserver to use the function indirection code that was just moved into nat/windows-nat.[ch]. One additional function is used by gdbserver that was not used by gdb. gdb/ChangeLog 2021-04-30 Tom Tromey <tromey@adacore.com> * nat/windows-nat.h (GenerateConsoleCtrlEvent): New define. (GenerateConsoleCtrlEvent_ftype, GenerateConsoleCtrlEvent): Declare. * nat/windows-nat.c (GenerateConsoleCtrlEvent): Define. (initialize_loadable): Initialize GenerateConsoleCtrlEvent. gdbserver/ChangeLog 2021-04-30 Tom Tromey <tromey@adacore.com> * win32-low.cc (GETPROCADDRESS): Remove. (winapi_DebugActiveProcessStop, winapi_DebugSetProcessKillOnExit) (winapi_DebugBreakProcess, winapi_GenerateConsoleCtrlEvent) (winapi_Wow64SetThreadContext, win32_Wow64GetThreadContext) (win32_Wow64SetThreadContext): Remove. (win32_set_thread_context, do_initial_child_stuff) (win32_process_target::attach, win32_process_target::detach): Update. (winapi_EnumProcessModules, winapi_EnumProcessModulesEx) (winapi_GetModuleInformation, winapi_GetModuleInformationA): Remove. (win32_EnumProcessModules, win32_EnumProcessModulesEx) (win32_GetModuleInformation, win32_GetModuleInformationA): Remove. (load_psapi): Remove. (win32_add_dll, win32_process_target::request_interrupt): Update. (initialize_low): Call initialize_loadable.
* Remove use of _WIN32_WCETom Tromey2021-04-141-2/+0
| | | | | | | | | | This removes the one last use of _WIN32_WCE from gdbserver. gdbserver/ChangeLog 2021-04-14 Tom Tromey <tromey@adacore.com> * win32-low.cc (windows_nat::handle_load_dll): Don't check _WIN32_WCE.
* Remove some unused typedefs from gdbserverTom Tromey2021-04-131-4/+0
| | | | | | | | | | | I noticed that gdbserver/win32-low.cc has a few typedefs that are not used. This patch removes them. gdbserver/ChangeLog 2021-04-13 Tom Tromey <tromey@adacore.com> * win32-low.cc (winapi_CreateToolhelp32Snapshot) (winapi_Module32First, winapi_Module32Next): Remove typedefs.
* gdb, gdbserver: remove WinCE support codeSimon Marchi2021-04-121-171/+5
| | | | | | | | | | | | | | | | | | | | | | | | The support for WinCE was removed with commit 84b300de3666 ("gdbserver: remove support for ARM/WinCE"). There is some leftover code for WinCE support, guarded by the _WIN32_WCE macro, which I didn't know of at the time. I didn't remove the _WIN32_WCE references in the tests, because in theory we still support the WinCE architecture in GDB (when debugging remotely). So someone could run a test with that (although I'd be really surprised). gdb/ChangeLog: * nat/windows-nat.c: Remove all code guarded by _WIN32_WCE. * nat/windows-nat.h: Likewise. gdbserver/ChangeLog: * win32-low.cc: Remove all code guarded by _WIN32_WCE. * win32-low.h: Likewise. Change-Id: I7a871b897e2135dc195b10690bff2a01d9fac05a
* Improve support for loading DLLs at run time in gdbserver.Eli Zaretskii2021-04-111-12/+39
| | | | | | | | | | | | | | | | | | | | | | | | This fixes win32-low.cc in the same way as a recent change in windows-nat.c did for GDB: if the lpImageName member of the load-DLL debug event doesn't allow us to find the file name of the DLL, then loop over all the DLLs mapped into the inferior to find the one loaded at the same base address as given by the lpBaseOfDll member of the debug event. gdbserver/ChangeLog: 2021-04-11 Eli Zaretskii <eliz@gnu.org> * win32-low.cc (win32_add_dll): New function, with body almost identical to what win32_add_all_dlls did. Accepts one argument; if that is non-NULL, returns the file name of the DLL that is loaded at the base address equal to that argument, or NULL if not found. If the argument is NULL, add all the DLLs loaded by the inferior to the list of solibs and return NULL. (win32_add_all_dlls): Now a thin wrapper around win32_add_dll. (windows_nat::handle_load_dll) [!_WIN32_WCE]: If get_image_name failed to glean the file name of the DLL, call win32_add_dll to try harder using the lpBaseOfDll member of the load-DLL event.
* Update copyright year range in all GDB filesJoel Brobecker2021-01-011-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.
* Handle 64bit breakpoints of WOW64 processes as SIGINTHannes Domani2020-09-241-4/+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.
* Make target_wait options use enum flagsTom Tromey2020-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gdbserver: remove support for ARM/WinCESimon Marchi2020-06-121-72/+29
| | | | | | | | | | | | | | This port has been unmaintained for years, remove it. gdbserver/ChangeLog: * Makefile.in (SFILES): Remove win32-arm-low.cc, wincecompat.cc. * configure.srv: Remove mingw32ce cases. * server.h, win32-low.cc: Remove __MINGW32CE__-guarded code. * win32-low.h (to_back_slashes): Remove. * win32-arm-low.cc, wincecompat.cc, wincecompat.h: Remove. Change-Id: Ib75c0b55b0ab7caca38bbeff5f2fa9397a8e7e8d
* Don't close process handle provided by WaitForDebugEventHannes Domani2020-05-271-4/+15
| | | | | | | | | | | | | Only the process handle returned by OpenProcess or CreateProcess needs to be closed, the one provided by WaitForDebugEvent is closed automatically. gdbserver/ChangeLog: 2020-05-27 Hannes Domani <ssbssa@yahoo.de> * win32-low.cc (do_initial_child_stuff): Set open_process_used. (win32_clear_inferiors): Use open_process_used. (get_child_debug_event): Likewise.
* Use construct_inferior_arguments which handles special charsMichael Weghorn2020-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the construct_inferior_arguments function instead of stringify_argv to construct a string from the program arguments in those places where that one is then passed to fork_inferior (linux-low, lyn-low), since construct_inferior_arguments properly takes care of special characters, while stringify_argv does not. Using construct_inferior_arguments seems "natural", since its documentation also mentions that it "does the same shell processing as fork_inferior". Since construct_inferior_args has been extended to do proper quoting for Windows shells in commit 5d60742e2dd3c9b475dce54b56043a358751bbb8 ("Fix quoting of special characters for the MinGW build.", 2012-06-12), use it for the Windows case as well. (I could not test that case myself, though.) Adapt handling of empty args in function 'handle_v_run' in gdbserver/server.cc to just insert an empty string for an empty arg, since that one is now properly handled in 'construct_inferior_arguments' already (and inserting a "''" string in 'handle_v_run' would otherwise cause that one to be treated as a string literally containing two quote characters, which 'construct_inferior_args' would preserve by adding extra escaping). This makes gdbserver properly handle program args containing special characters (like spaces), e.g. (example from PR25893) $ gdbserver localhost:50505 myprogram "hello world" now properly handles "hello world" as a single arg, not two separate ones ("hello", "world"). gdbserver/ChangeLog: PR gdbserver/25893 * linux-low.cc (linux_process_target::create_inferior), lynx-low.cc (lynx_process_target::create_inferior), win32-low.cc (win32_process_target::create_inferior): Use construct_inferior_arguments instead of stringify_argv to get string representation which properly escapes special characters. * server.cc (handle_v_run): Just pass empty program arg as such, since any further processing is now handled via construct_inferior_arguments. Change-Id: Ibf963fcd51415c948840fb463289516b3479b0c3
* Implement debugging of WOW64 processes in gdbserverHannes Domani2020-04-301-25/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdbserver/ChangeLog: 2020-04-30 Hannes Domani <ssbssa@yahoo.de> * configure.srv <x86_64-*-mingw*, x86_64-*-cygwin*> (srv_tgtobj): Add arch/i386.o. * win32-arm-low.cc (arm_num_regs): New function. (struct win32_target_ops): Use arm_num_regs. * win32-i386-low.cc (win32_get_current_dr): Adapt for WOW64 processes. (i386_get_thread_context): Likewise. (i386_prepare_to_resume): Likewise. (i386_thread_added): Likewise. (i386_single_step): Likewise. (i386_fetch_inferior_register): Likewise. (i386_store_inferior_register): Likewise. (i386_arch_setup): Likewise. (i386_win32_num_regs): New function. (struct win32_target_ops): Use i386_win32_num_regs. * win32-low.cc (win32_get_thread_context): Adapt for WOW64 processes. (win32_require_context): Likewise. (child_add_thread): Likewise. (do_initial_child_stuff): Likewise. (continue_one_thread): Likewise. (win32_process_target::resume): Likewise. (load_psapi): Likewise. (win32_add_all_dlls): Likewise. (maybe_adjust_pc): Likewise. (win32_process_target::qxfer_siginfo): Likewise. (initialize_low): Likewise. * win32-low.h (struct win32_target_ops): Change num_regs to callback function.
* Fix Cygwin gdb buildTom Tromey2020-04-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | 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.
* gdbserver: fix format string warning in win32-low.ccSimon Marchi2020-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling on Cygwin, we get: CXX win32-low.o /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc: In function ‘int get_child_debug_event(DWORD*, target_waitstatus*)’: /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1459:17: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Werror=format=] 1459 | OUTMSG2 (("get_windows_debug_event - " | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1460 | "unexpected stop in 0x%x (expecting 0x%x)\n", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1461 | ptid.lwp (), desired_stop_thread_id)); | ~~~~~~~~~~~ | | | long int /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:52:11: note: in definition of macro ‘OUTMSG2’ 52 | printf X; \ | ^ /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1460:26: note: format string is defined here 1460 | "unexpected stop in 0x%x (expecting 0x%x)\n", | ~^ | | | unsigned int | %lx `ptid.lwp ()` is a `long` value, so it indeed needs the `l` size modifier. gdbserver/ChangeLog: * win32-low.cc (get_child_debug_event): Fix format string warning.
* Add pending stop support to gdbserver's Windows portTom Tromey2020-04-081-3/+31
| | | | | | | | | | | | | This changes gdbserver to also handle pending stops, the same way that gdb does. This is PR gdb/22992. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> PR gdb/22992 * win32-low.c (child_continue): Call matching_pending_stop. (get_child_debug_event): Call fetch_pending_stop. Push pending stop when needed.
* Implement stopped_by_sw_breakpoint for Windows gdbserverTom Tromey2020-04-081-12/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | This changes the Windows gdbserver port to implement the stopped_by_sw_breakpoint target method. This is needed to support pending stops. This is a separate patch now, because Pedro suggested splitting it out for simpler bisecting, in the case that it introduces a bug. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.h (win32_process_target::stopped_by_sw_breakpoint) (win32_process_target::supports_stopped_by_sw_breakpoint): Declare. * win32-low.c (win32_supports_z_point_type): Always handle Z_PACKET_SW_BP. (win32_insert_point): Call insert_memory_breakpoint when needed. (win32_remove_point): Call remove_memory_breakpoint when needed. (win32_process_target::stopped_by_sw_breakpoint) (win32_process_target::supports_stopped_by_sw_breakpoint): New methods. (win32_target_ops): Update. (maybe_adjust_pc): New function. (win32_wait): Call maybe_adjust_pc.
* Add read_pc / write_pc support to win32-lowTom Tromey2020-04-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | This changes win32-low.c to implement the read_pc and write_pc methods. A subsequent patch will need these. Note that I have no way to test, or even compile, the win32-arm-low.c change. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.h (win32_process_target::read_pc) (win32_process_target::write_pc): Declare. * win32-low.c (win32_process_target::read_pc) (win32_process_target::write_pc): New methods. * win32-i386-low.c (i386_win32_get_pc, i386_win32_set_pc): New functions. (the_low_target): Update. * win32-arm-low.c (arm_win32_get_pc, arm_win32_set_pc): New functions. (the_low_target): Update.
* Move wait_for_debug_event to nat/windows-nat.cTom Tromey2020-04-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Share some inferior-related Windows codeTom Tromey2020-04-081-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Share handle_exceptionTom Tromey2020-04-081-115/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Share handle_load_dll and handle_unload_dll declarationsTom Tromey2020-04-081-16/+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.
* Normalize handle_output_debug_string APITom Tromey2020-04-081-9/+12
| | | | | | | | | | | | | | | | | | | | 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.
* Share some Windows-related globalsTom Tromey2020-04-081-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Share get_image_name between gdb and gdbserverTom Tromey2020-04-081-50/+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.
* Share thread_rec between gdb and gdbserverTom Tromey2020-04-081-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Wrap shared windows-nat code in windows_nat namespaceTom Tromey2020-04-081-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".
* Call CloseHandle from ~windows_thread_infoTom Tromey2020-04-081-1/+0
| | | | | | | | | | | | | | | | Add a destructor to windows_thread_info that calls CloseHandle. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * nat/windows-nat.h (struct windows_thread_info): Declare destructor. * nat/windows-nat.c (~windows_thread_info): New. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (delete_thread_info): Don't call CloseHandle.
* Share Windows thread-suspend and -resume codeTom Tromey2020-04-081-30/+3
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Use new and delete for windows_thread_infoTom Tromey2020-04-081-5/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* Rename win32_thread_info to windows_thread_infoTom Tromey2020-04-081-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This renames win32_thread_info to windows_thread_info in gdbserver. This renaming helps make it possible to share some code between gdb and gdbserver. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.h (struct windows_thread_info): Rename from win32_thread_info. Remove typedef. (struct win32_target_ops, win32_require_context): Update. * win32-low.c (win32_get_thread_context) (win32_set_thread_context, win32_prepare_to_resume) (win32_require_context, thread_rec, child_add_thread) (delete_thread_info, continue_one_thread) (child_fetch_inferior_registers, child_store_inferior_registers) (win32_resume, suspend_one_thread, win32_get_tib_address): Update. * win32-i386-low.c (update_debug_registers) (win32_get_current_dr, i386_get_thread_context) (i386_prepare_to_resume, i386_thread_added, i386_single_step) (i386_fetch_inferior_register, i386_store_inferior_register): Update. * win32-arm-low.c (arm_get_thread_context) (arm_fetch_inferior_register, arm_store_inferior_register): Update.
* gdbserver: finish turning the target ops vector into a classTankut Baris Aktemur2020-02-201-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that 'process_stratum_target' has a single field left, namely 'pt' of type 'process_target', and that all the requests to a 'process_stratum_target' are forwarded to 'pt', meld the 'process_target' class into 'process_stratum_target'. This essentially means 1. All the references of the form 'the_target->pt' become 'the_target'. 2. All the uses of the name 'process_target' become 'process_stratum_target'. 3. The platform-specific target op vectors (e.g. linux_target_ops) are removed and instances of their "process target" classes are used instead. gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * target.h (struct process_stratum_target): Remove. (class process_target): Rename to ... (class process_stratum_target): ... this. * linux-low.h (class linux_process_target): Derive from 'process_stratum_target'. * linux-low.cc (linux_target_ops): Remove. (initialize_low): Set the_target to the singleton instance of linux_process_target. * lynx-low.h (class lynx_process_target): Derive from 'process_stratum_target'. * lynx-low.cc (lynx_target_ops): Remove. (initialize_low): Set the_target to the singleton instance of lynx_process_target. * nto-low.h (class nto_process_target): Derive from 'process_stratum_target'. * nto-low.cc (nto_target_ops): Remove. (initialize_low): Set the_target to the singleton instance of nto_process_target. * win32-low.h (class win32_process_target): Derive from 'process_stratum_target'. * win32-low.cc (win32_target_ops): Remove. (initialize_low): Set the_target to the singleton instance of win32_process_target. Replace 'the_target->pt' with 'the_target' in the uses below. * hostio.cc (hostio_error) (handle_setfs) (handle_open) (handle_unlink) (handle_readlink) * linux-aarch32-low.cc (arm_breakpoint_at) * linux-aarch64-low.cc (aarch64_breakpoint_at) * linux-arm-low.cc (arm_sigreturn_next_pc) (arm_get_hwcap) (arm_get_syscall_trapinfo) * linux-cris-low.cc (cris_breakpoint_at) * linux-crisv32-low.cc (cris_breakpoint_at) * linux-low.cc (handle_extended_wait) (linux_wait_1) (linux_read_memory) (linux_process_target::breakpoint_kind_from_pc) (linux_get_auxv) * linux-m32r-low.cc (m32r_breakpoint_at) * linux-mips-low.cc (mips_breakpoint_at) * linux-nios2-low.cc (nios2_breakpoint_at) * linux-ppc-low.cc (ppc_breakpoint_at) * linux-s390-low.cc (s390_get_hwcap) * linux-sh-low.cc (sh_breakpoint_at) * linux-sparc-low.cc (sparc_fill_gregset_to_stack) (sparc_store_gregset_from_stack) (sparc_breakpoint_at) * linux-tic6x-low.cc (tic6x_breakpoint_at) * linux-tile-low.cc (tile_breakpoint_at) * linux-x86-low.cc (x86_breakpoint_at) * linux-xtensa-low.cc (xtensa_breakpoint_at) * mem-break.cc (bp_size) (bp_opcode) (insert_memory_breakpoint) (set_raw_breakpoint_at) (delete_raw_breakpoint) (z_type_supported) (uninsert_raw_breakpoint) (reinsert_raw_breakpoint) (validate_inserted_breakpoint) * regcache.cc (regcache_read_pc) (regcache_write_pc) * remote-utils.cc (putpkt_binary_1) (input_interrupt) (getpkt) (prepare_resume_reply) * server.cc (handle_general_set) (handle_detach) (handle_qxfer_auxv) (handle_qxfer_exec_file) (handle_qxfer_libraries_svr4) (handle_qxfer_osdata) (handle_qxfer_siginfo) (handle_qxfer_fdpic) (handle_query) (resume) (handle_v_requests) (queue_stop_reply_callback) (captured_main) * target.cc (prepare_to_access_memory) (done_accessing_memory) (read_inferior_memory) (target_write_memory) (target_stop_and_wait) (target_wait) (target_mourn_inferior) (target_continue_no_signal) (target_continue) (target_supports_multi_process) (kill_inferior) * target.h (target_create_inferior) (target_post_create_inferior) (myattach) (target_supports_fork_events) (target_supports_vfork_events) (target_supports_exec_events) (target_handle_new_gdb_connection) (detach_inferior) (mythread_alive) (fetch_inferior_registers) (store_inferior_registers) (join_inferior) (target_supports_non_stop) (target_async) (target_process_qsupported) (target_supports_catch_syscall) (target_get_ipa_tdesc_idx) (target_supports_tracepoints) (target_supports_fast_tracepoints) (target_get_min_fast_tracepoint_insn_len) (target_thread_stopped) (target_pause_all) (target_unpause_all) (target_stabilize_threads) (target_install_fast_tracepoint_jump_pad) (target_emit_ops) (target_supports_disable_randomization) (target_supports_agent) (target_enable_btrace) (target_disable_btrace) (target_read_btrace) (target_read_btrace_conf) (target_supports_range_stepping) (target_supports_stopped_by_sw_breakpoint) (target_stopped_by_sw_breakpoint) (target_supports_stopped_by_hw_breakpoint) (target_supports_hardware_single_step) (target_stopped_by_hw_breakpoint) (target_breakpoint_kind_from_pc) (target_breakpoint_kind_from_current_state) (target_supports_software_single_step) (target_core_of_thread) (target_thread_name) (target_thread_handle) * win32-low.cc (do_initial_child_stuff) Rename target op default definitions listed below. * target.cc (process_target::post_create_inferior): Rename as ... (process_stratum_target::post_create_inferior): ... this. (process_target::prepare_to_access_memory): Rename as ... (process_stratum_target::prepare_to_access_memory): ... this. (process_target::done_accessing_memory): Rename as ... (process_stratum_target::done_accessing_memory): ... this. (process_target::look_up_symbols): Rename as ... (process_stratum_target::look_up_symbols): ... this. (process_target::supports_read_auxv): Rename as ... (process_stratum_target::supports_read_auxv): ... this. (process_target::read_auxv): Rename as ... (process_stratum_target::read_auxv): ... this. (process_target::supports_z_point_type): Rename as ... (process_stratum_target::supports_z_point_type): ... this. (process_target::insert_point): Rename as ... (process_stratum_target::insert_point): ... this. (process_target::remove_point): Rename as ... (process_stratum_target::remove_point): ... this. (process_target::stopped_by_sw_breakpoint): Rename as ... (process_stratum_target::stopped_by_sw_breakpoint): ... this. (process_target::supports_stopped_by_sw_breakpoint): Rename as ... (process_stratum_target::supports_stopped_by_sw_breakpoint): ... this. (process_target::stopped_by_hw_breakpoint): Rename as ... (process_stratum_target::stopped_by_hw_breakpoint): ... this. (process_target::supports_stopped_by_hw_breakpoint): Rename as ... (process_stratum_target::supports_stopped_by_hw_breakpoint): ... this. (process_target::supports_hardware_single_step): Rename as ... (process_stratum_target::supports_hardware_single_step): ... this. (process_target::stopped_by_watchpoint): Rename as ... (process_stratum_target::stopped_by_watchpoint): ... this. (process_target::stopped_data_address): Rename as ... (process_stratum_target::stopped_data_address): ... this. (process_target::supports_read_offsets): Rename as ... (process_stratum_target::supports_read_offsets): ... this. (process_target::read_offsets): Rename as ... (process_stratum_target::read_offsets): ... this. (process_target::supports_get_tls_address): Rename as ... (process_stratum_target::supports_get_tls_address): ... this. (process_target::get_tls_address): Rename as ... (process_stratum_target::get_tls_address): ... this. (process_target::hostio_last_error): Rename as ... (process_stratum_target::hostio_last_error): ... this. (process_target::supports_qxfer_osdata): Rename as ... (process_stratum_target::supports_qxfer_osdata): ... this. (process_target::qxfer_osdata): Rename as ... (process_stratum_target::qxfer_osdata): ... this. (process_target::supports_qxfer_siginfo): Rename as ... (process_stratum_target::supports_qxfer_siginfo): ... this. (process_target::qxfer_siginfo): Rename as ... (process_stratum_target::qxfer_siginfo): ... this. (process_target::supports_non_stop): Rename as ... (process_stratum_target::supports_non_stop): ... this. (process_target::async): Rename as ... (process_stratum_target::async): ... this. (process_target::start_non_stop): Rename as ... (process_stratum_target::start_non_stop): ... this. (process_target::supports_multi_process): Rename as ... (process_stratum_target::supports_multi_process): ... this. (process_target::supports_fork_events): Rename as ... (process_stratum_target::supports_fork_events): ... this. (process_target::supports_vfork_events): Rename as ... (process_stratum_target::supports_vfork_events): ... this. (process_target::supports_exec_events): Rename as ... (process_stratum_target::supports_exec_events): ... this. (process_target::handle_new_gdb_connection): Rename as ... (process_stratum_target::handle_new_gdb_connection): ... this. (process_target::handle_monitor_command): Rename as ... (process_stratum_target::handle_monitor_command): ... this. (process_target::core_of_thread): Rename as ... (process_stratum_target::core_of_thread): ... this. (process_target::supports_read_loadmap): Rename as ... (process_stratum_target::supports_read_loadmap): ... this. (process_target::read_loadmap): Rename as ... (process_stratum_target::read_loadmap): ... this. (process_target::process_qsupported): Rename as ... (process_stratum_target::process_qsupported): ... this. (process_target::supports_tracepoints): Rename as ... (process_stratum_target::supports_tracepoints): ... this. (process_target::read_pc): Rename as ... (process_stratum_target::read_pc): ... this. (process_target::write_pc): Rename as ... (process_stratum_target::write_pc): ... this. (process_target::supports_thread_stopped): Rename as ... (process_stratum_target::supports_thread_stopped): ... this. (process_target::thread_stopped): Rename as ... (process_stratum_target::thread_stopped): ... this. (process_target::supports_get_tib_address): Rename as ... (process_stratum_target::supports_get_tib_address): ... this. (process_target::get_tib_address): Rename as ... (process_stratum_target::get_tib_address): ... this. (process_target::pause_all): Rename as ... (process_stratum_target::pause_all): ... this. (process_target::unpause_all): Rename as ... (process_stratum_target::unpause_all): ... this. (process_target::stabilize_threads): Rename as ... (process_stratum_target::stabilize_threads): ... this. (process_target::supports_fast_tracepoints): Rename as ... (process_stratum_target::supports_fast_tracepoints): ... this. (process_target::get_min_fast_tracepoint_insn_len): Rename as ... (process_stratum_target::get_min_fast_tracepoint_insn_len): ... this. (process_target::emit_ops): Rename as ... (process_stratum_target::emit_ops): ... this. (process_target::supports_disable_randomization): Rename as ... (process_stratum_target::supports_disable_randomization): ... this. (process_target::supports_qxfer_libraries_svr4): Rename as ... (process_stratum_target::supports_qxfer_libraries_svr4): ... this. (process_target::qxfer_libraries_svr4): Rename as ... (process_stratum_target::qxfer_libraries_svr4): ... this. (process_target::supports_agent): Rename as ... (process_stratum_target::supports_agent): ... this. (process_target::enable_btrace): Rename as ... (process_stratum_target::enable_btrace): ... this. (process_target::disable_btrace): Rename as ... (process_stratum_target::disable_btrace): ... this. (process_target::read_btrace): Rename as ... (process_stratum_target::read_btrace): ... this. (process_target::read_btrace_conf): Rename as ... (process_stratum_target::read_btrace_conf): ... this. (process_target::supports_range_stepping): Rename as ... (process_stratum_target::supports_range_stepping): ... this. (process_target::supports_pid_to_exec_file): Rename as ... (process_stratum_target::supports_pid_to_exec_file): ... this. (process_target::pid_to_exec_file): Rename as ... (process_stratum_target::pid_to_exec_file): ... this. (process_target::supports_multifs): Rename as ... (process_stratum_target::supports_multifs): ... this. (process_target::multifs_open): Rename as ... (process_stratum_target::multifs_open): ... this. (process_target::multifs_unlink): Rename as ... (process_stratum_target::multifs_unlink): ... this. (process_target::multifs_readlink): Rename as ... (process_stratum_target::multifs_readlink): ... this. (process_target::breakpoint_kind_from_pc): Rename as ... (process_stratum_target::breakpoint_kind_from_pc): ... this. (process_target::breakpoint_kind_from_current_state): Rename as ... (process_stratum_target::breakpoint_kind_from_current_state): ... this. (process_target::thread_name): Rename as ... (process_stratum_target::thread_name): ... this. (process_target::thread_handle): Rename as ... (process_stratum_target::thread_handle): ... this. (process_target::supports_software_single_step): Rename as ... (process_stratum_target::supports_software_single_step): ... this. (process_target::supports_catch_syscall): Rename as ... (process_stratum_target::supports_catch_syscall): ... this. (process_target::get_ipa_tdesc_idx): Rename as ... (process_stratum_target::get_ipa_tdesc_idx): ... this.
* gdbserver: turn target op 'get_ipa_tdesc_idx' into a methodTankut Baris Aktemur2020-02-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn process_stratum_target's get_ipa_tdesc_idx op into a method of process_target. * target.h (struct process_stratum_target): Remove the target op. (class process_target): Add the target op. (target_get_ipa_tdesc_idx): Update the macro. * target.cc (process_target::get_ipa_tdesc_idx): Define. Update the derived classes and callers below. * linux-low.cc (linux_target_ops): Update. (linux_get_ipa_tdesc_idx): Turn into ... (linux_process_target::get_ipa_tdesc_idx): ... this. * linux-low.h (class linux_process_target): Update. * lynx-low.cc (lynx_target_ops): Update. * nto-low.cc (nto_target_ops): Update. * win32-low.cc (win32_target_ops): Update.