Commit Graph

16 Commits

Author SHA1 Message Date
Pedro Alves e7b5fa67ed * win32-low.c (win32_wait): Don't read from the inferior when it
has already exited.
2007-12-02 23:40:17 +00:00
Pedro Alves aec18585f0 * win32-low.c (create_process): New.
(win32_create_inferior): Use create_process instead of
	CreateProcess.  If create_process failed retry appending an ".exe"
	suffix.  Store the GetLastError result immediatelly after
	create_process calls and use it on the call to error.
2007-09-03 22:17:27 +00:00
Pedro Alves 34d86dddf2 * win32-low.c (handle_load_dll): Don't use toolhelp when waiting. 2007-09-03 22:04:02 +00:00
Joel Brobecker a9762ec78a Switch the license of all .c files to GPLv3.
Switch the license of all .h files to GPLv3.
        Switch the license of all .cc files to GPLv3.
2007-08-23 18:08:50 +00:00
Pedro Alves 6b3d9b8313 * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
typedef.
	(win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
	(load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
	CloseToolhelp32Snapshot.
	(toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
	CloseToolhelp32Snapshot.
2007-07-31 13:58:19 +00:00
Daniel Jacobowitz 255e7678a9 2007-07-17 Pedro Alves <pedro_alves@portugalmail.pt>
Daniel Jacobowitz  <dan@codesourcery.com>

	* config/i386/cygwin.mt (TDEPFILES): Add solib-target.o.
	* coff-pe-read.c (read_pe_exported_syms): Delete verbose
	printf.
	* NEWS: Mention gdbserver DLL support.

	* gdb.base/unload.c (dlopen, dlsym, dlclose, dlerror): Define
	for __WIN32__.
	(SHLIB_NAME): Delete definition.  Always pass dlerror to fprintf.
	* gdb.base/unload.exp: Use shared library test routines.

	* inferiors.c (all_dlls, dlls_changed, get_dll): New.
	(add_thread): Minor cleanups.
	(clear_inferiors): Move lower in the file.  Clear the DLL
	list.
	(free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
	* remote-utils.c (prepare_resume_reply): Check dlls_changed.
	(xml_escape_text): New.
	* server.c (handle_query): Handle qXfer:libraries:read.  Report it
	for qSupported.
	(handle_v_cont): Report errors.
	(gdbserver_version): Update.
	(main): Correct size of own_buf.  Do not report initial DLL events.
	* server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
	(unloaded_dll, xml_escape_text): New.
	* win32-low.c (enum target_waitkind): Update comments.
	(win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
	(winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
	(win32_EnumProcessModules, win32_GetModuleInformation)
	(win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
	(winapi_CreateToolhelp32Snapshot, winapi_Module32First)
	(winapi_Module32Next, win32_CreateToolhelp32Snapshot)
	(win32_Module32First, win32_Module32Next, load_toolhelp)
	(toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
	(get_child_debug_event): Handle DLL events.
	(win32_wait): Likewise.
2007-07-17 12:51:41 +00:00
Pedro Alves 45e2715e39 * win32-low.c (handle_output_debug_string): Ignore event if not
waiting.
2007-07-08 19:37:46 +00:00
Pedro Alves 7390519ea0 * server.h (check_remote_input_interrupt_request): New function.
* remote_utils.c (INVALID_DESCRIPTOR): New define.
	(remote_desc): Initialize with INVALID_DESCRIPTOR.
	(input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
	(check_remote_input_interrupt_request): New function.
	* server.h (check_remote_input_interrupt_request): Declare.

	* win32-low.(winapi_DebugBreakProcess,
	winapi_GenerateConsoleCtrlEvent): New typedefs.
	(get_child_debug_event): Lower Win32 debug event polling from 1 sec
	to 250 ms.
	(win32_wait): Check for remote interrupt request
	with check_remote_input_interrupt_request.
	(win32_request_interrupt): New function.
	(win32_target_op): Set request_interrupt to win32_request_interrupt.
2007-05-10 22:04:50 +00:00
Pedro Alves 34b3492108 * win32-low.c (debug_registers_changed,
debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
	CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
	CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
	(thread_rec): Get context using the low target.
	(child_add_thread): Call thread_added on the low target,
	which does the same thing.
	(regptr): Delete.
	(do_initial_child_stuff): Remove debug registers references.
	Set context using the low target.  Resume threads after
	setting the contexts.
	(child_continue): Remove dead variable.  Remove debug
	registers references.
	(child_fetch_inferior_registers): Go through the low target.
	(do_child_store_inferior_registers): Remove.
	(child_store_inferior_registers): Go through the low target.
	(win32_resume): Remove debug registers references.
	Set context using the low target.
	(handle_exception): Change return type to void.  Don't record
	context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
	first chance exception.
	(get_child_debug_event): Change return type to void.  Remove
	goto loop.  Always return after waiting for debug event.
	(win32_wait): Convert to switch statement.  Handle spurious
	events.

	* win32-i386-low.c (debug_registers_changed,
	debug_registers_used): New.
	(initial_stuff): Rename to ...
	(i386_initial_stuff): ... this.  Clear debug registers
	state variables.
	(store_debug_registers): Delete.
	(i386_get_thread_context): New.
	(load_debug_registers): Delete.
	(i386_set_thread_context): New.
	(i386_thread_added): New.
	(single_step): Rename to ...
	(i386_single_step): ... this.
	(do_fetch_inferior_registers): Rename to ...
	(i386_fetch_inferior_register): ... this.
	(i386_store_inferior_register): New.
	(the_low_target): Adapt to new interface.

	* win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
	(arm_get_thread_context): New.
	(arm_set_thread_context): New.
	(regptr): New.
	(do_fetch_inferior_registers): Rename to ...
	(arm_fetch_inferior_register): ... this.
	(arm_store_inferior_register): New.
	(arm_wince_breakpoint): Reimplement as unsigned long.
	(arm_wince_breakpoint_len): Define.
	(the_low_target): Adapt to new interface.

	* win32-low.h (target_ops): Remove regmap, store_debug_registers and
	load_debug_registers.  Add get_thread_context, set_thread_context,
	thread_added and store_inferior_register.  Rename
	fetch_inferior_registers to fetch_inferior_register.
	(regptr): Remove declaration.
2007-05-10 21:48:56 +00:00
Pedro Alves 444d61395b * target.h (target_ops): Change return type of detach to int.
Add join.
	(join_inferior): New.
	* server.c (main): Don't skip detach support on mingw32.
	If the inferior doesn't support detaching return error.
	Call join_inferior instead of using waitpid.
	* linux-low.c (linux_join): New.
	(linux_target_op): Add linux_join.
	* spu-low.c (spu_join): New.
	(spu_target_ops): Add spu_join.
	* win32-low.c (win32_detach): Adapt to new interface.
	Reopen current_process_handle before detaching.  Issue a child
	resume before detaching.
	(win32_join): New.
	(win32_target_op): Add win32_join.
2007-05-10 21:05:15 +00:00
Pedro Alves 1d5315fee9 * win32-low.c (win32-attach): Fix return value.
* target.h (target_ops): Describe ATTACH return values.
2007-05-10 20:48:41 +00:00
Pedro Alves bf91483160 * win32-low.c (GETPROCADDRESS): Define.
(winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
	(winapi_DebugSetProcessKillOnExit): Likewise.
	(win32_create_inferior): Force usage of ansi CreateProcessA.
	(win32_attach): Use GETPROCADDRESS.
	(win32_detach): Likewise.
2007-05-10 20:39:18 +00:00
Pedro Alves f72f3e600b * win32-low.c (win32_wait): Don't use WSTOPSIG. 2007-05-10 20:25:01 +00:00
Pedro Alves ed50f18f18 * win32-low.c: Commit leftover changes from 2007-03-29. 2007-03-30 20:28:24 +00:00
Pedro Alves 41093d8184 * win32-low.c: Rename typedef thread_info to
win32_thread_info throughout.
2007-03-28 22:12:31 +00:00
Pedro Alves 544afa546f * win32-i386-low.c: Rename to ...
* win32-low.c: ... this.
	* configure.srv: Replace win32-i386-low.o with win32-low.o.
	* Makefile.in: Likewise.
2007-03-28 22:00:15 +00:00