Commit Graph

65 Commits

Author SHA1 Message Date
Pierre Muller eeb25b8ac9 2002-02-22 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-nat.c (child_create_inferior): Fix create flags setting bug.
2002-02-22 17:04:25 +00:00
Christopher Faylor 6badb179ab * win32-nat.c (register_loaded_dll): Just use raw name when we can't find the
complete path to a loaded DLL.
2002-02-22 01:35:59 +00:00
Christopher Faylor 097f6b0bba * win32-nat.c (register_loaded_dll): Correctly check for invalid handle value. 2002-02-21 06:44:05 +00:00
Christopher Faylor c914e0cc47 * win32-nat.c (register_loaded_dll): Handle case where FindFirstFile fails. 2002-02-21 04:59:36 +00:00
Pierre Muller c1748f97ec 2002-02-18 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-nat.c (display_selector): New function. Displays information
	about the information returned by GetThreadSelectorEntry API function.
	(display_selectors): New function. Displays the infomation of
	the selector given as argument, or of CS, DS ans FS selectors
	if no argument is given.
	( _initialize_inftarg): Add "w32" as info prefix command.
	Add "info w32 selector" as command calling display_selectors.
2002-02-19 08:49:42 +00:00
Christopher Faylor dfe7f3acac * win32-nat.c (get_image_name): New function.
(handle_load_dll): Use get_image_name function.
(get_child_debug_event): Avoid registering debug events until possibly execed
process is started.
(child_create_inferior): Allow invocation via shell so that command line
redirection, etc.  works ok.
(_initialize_inftarg): Add new command: "set shell" to control whether a shell
is used to start a process.
2002-02-16 02:33:24 +00:00
Christopher Faylor b69571f510 * win32-nat.c (cygwin_pid_to_str): Revert 2002-02-08 change xasprintf changes.
(_initialize_check_for_gdb_ini): Ditto.
2002-02-08 23:12:16 +00:00
Martin Hunt f687139811 2002-02-08 Martin M. Hunt <hunt@redhat.com>
* win32-nat.c (cygwin_pid_to_str): Fix typo.
	xaprintf -> xasprintf.
2002-02-08 21:22:10 +00:00
Pierre Muller 4e52d31c52 2002-02-08 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-nat.c: Remove use of printf and sprintf functions.
2002-02-08 19:31:38 +00:00
Pierre Muller 58fa08f090 2002-02-06 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-nat.c (_initialize_check_for_gdb_ini):
	Add typecast to sprintf argument to suppress a warning.
2002-02-06 09:27:29 +00:00
Pierre Muller 7393af7c90 2002-02-05 Pierre Muller <muller@ics.u-strasbg.fr>
win32-nat.c (last_sig): Changed type of variable to target_signal,
	to allow easier handling of pass state.
	(DEBUG_EXCEPTION_SIMPLE): New macro, used in handle_exception,
	that gives exception name and address.
	(handle_exception): Use DEBUG_EXCEPTION_SIMPLE macro
	and set last_sig value to ourstatus->value.sig. Some missing
	exceptions added.
	(child_continue): Correctly report continue_status.
	(get_child_debug_event,do_initial_child_stuff): Set last_sig to
	TARGET_SIGNAL_0 (new default value).
	(child_resume): consider sig argument passed to decide if
	the exception should be passed to debuggee or not.
2002-02-06 09:14:50 +00:00
Pierre Muller 5b421780f1 2002-02-04 Pierre Muller <muller@ics.u-strasbg.fr>
win32-nat.c (handle_exception): Handle Ctrl-Break exception.
2002-02-05 08:04:22 +00:00
Pierre Muller fa4ba8da6c 2002-02-04 Pierre Muller <muller@ics.u-strasbg.fr>
Add support for hardware watchpoints on win32 native.
	* win32-nat.c (CONTEXT_DEBUG_DR macro): Add use of
	CONTEXT_DEBUG_REGISTERS.
	(dr variable): New variable. Static array containing a local copy
	of debug registers.
	(debug_registers_changed): New variable.  Reflects when debug registers
	are changed and need to be written to inferior.
	(debug_registers_used): New variable. Reflects when any debug register
	was set, used when new threads are created.
	(cygwin_set_dr, cygwin_set_dr7, cygwin_get_dr6): New functions used by
	i386-nat code.
	(thread_rec): Set dr array if id is the thread of current_event .
	(child_continue, child_resume): Change the debug registers for all
	threads if debug_registers_changed.
	(child_add_thread): Change the debug registers if debug_registers_used.
	* config/i386/cygwin.mh: Add use of i386-nat.o file.
	Link nm.h to new nm-cygwin.h file.
	+ config/i386/nm-cygwin.h: New file. Contains the macros used for use
	of hardware registers.
2002-02-04 11:00:10 +00:00
Andrew Cagney 0a65a603d3 Remove ATTRIBUTE_UNUSED. Update (C). 2002-01-19 03:32:43 +00:00
Pierre Muller c25b74acfa 2002-01-06 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-nat.c: Add i386-tdep.h dependency.
2002-01-08 08:26:42 +00:00
Pierre Muller 441532d7b8 2001-11-30 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-nat.c (mappings): Correct position of XMM registers,
	based on FXSAVE instruction structure.
2001-12-03 08:19:01 +00:00
Christopher Faylor 3bccec6316 fix white space. 2001-11-27 05:16:39 +00:00
Christopher Faylor 97da3b2016 * config/i386/tm-cygwin.h: Define HAVE_SSE_REGS if
HAVE_CONTEXT_EXTENDED_REGISTERS is defined.
* win32-nat.c: Define CONTEXT_DEBUGGER_DR that will also include extended
registers if HAVE_SSE_REGS is defined.
(mappings array): Add offset of extended registers.
(thread_rec): Use new CONTEXT_DEBUGGER_DR macro.
2001-11-27 05:15:58 +00:00
Christopher Faylor d3ff4a77ad * win32-nat.c (struct so_stuff): Add objfile *objfile field needed to be able
to remove the DLL when unloaded.  Remove unused last field.
(handle_unload_dll): New function to handle unloading of DLL.
(solib_symbols_add): Change return type to struct objfile *.
(get_child_debug_event): Call handle_unload_dll function.
2001-11-24 19:00:03 +00:00
Christopher Faylor 2a3d564525 * win32-nat.c (_initialize_check_for_gdb_ini): New function.
* config/i386/xm-cygwin.h: Remove obsolete handling of __CYGWIN32__.
(GDBINIT_FILENAME): Remove.
2001-11-24 18:21:27 +00:00
Fred Fish 990f9fe3aa Approved by kev@cygnus.com
ChangeLog entry:

	2001-11-01  Fred Fish  <fnf@redhat.com>

	* coff-solib.c (coff_solib_add): Add new readsyms arg.
	* irix5-nat.c (solib_add): Ditto.
	* osfsolib.c (solib_add): Ditto.
	* pa64solib.c (pa64_solib_add): Ditto.
	* pa64solib.c (add_to_solist): Ditto.
	* pa64solib.c (read_dld_descriptor): Ditto.
	* solib.c (solib_add): Ditto.
	* somsolib.c (som_solib_add): Ditto.
	* win32-nat.c (child_solib_add): Ditto.
	* xcoffsolib.c (solib_add): Ditto.

	* coff-solib.h (coff_solib_add): Add new readsyms arg to prototype.
	* pa64solib.c (add_to_solist): Ditto.
	* pa64solib.c (read_dld_descriptor): Ditto.
	* pa64solib.h (pa64_solib_add): Ditto.
	* solib.h (solib_add): Ditto.
	* somsolib.h (som_solib_add): Ditto.
	* config/i386/tm-cygwin.h (child_solib_add): Ditto.

	* coff-solib.c (coff_solib_add):  If readsyms is zero don't read
	symbols but do any other needed work for shared libs.
	* irix5-nat.c: Ditto.
	* osfsolib.c (solib_add): Ditto.
	* solib.c (solib_add): Ditto.
	* win32-nat.c (child_solib_add): Ditto.
	* xcoffsolib.c (solib_add): Ditto.

	* irix5-nat.c (sharedlibrary_command): Pass 1 as readsyms to
	solib_add to force reading of shared library symbols.
	* osfsolib.c (sharedlibrary_command;): Ditto.
	* pa64solib.c (pa64_solib_sharedlibrary_command): Ditto.
	* solib.c (sharedlibrary_command): Ditto.
	* somsolib.c (som_solib_sharedlibrary_command): Ditto.
	* xcoffsolib.c (sharedlibrary_command): Ditto.

	* coff-solib.c (coff_solib_create_inferior_hook): Call solib_add
	unconditionally with auto_solib_add.
	* irix5-nat.c (solib_create_inferior_hook): Ditto.
	* osfsolib.c (solib_create_inferior_hook): Ditto.
	* solib.c (solib_create_inferior_hook): Ditto.
	* solib-osf.c (osf_solib_create_inferior_hook): Ditto.
	* solib-svr4.c (enable_break): Ditto.
	* solib-sunos.c (sunos_solib_create_inferior_hook): Ditto.

	* corelow.c (solib_add_stub): Add auto_solib_add to args passed
	via SOLIB_ADD.
	* sol-thread.c (sol_thread_attach): Ditto.
	* config/rs6000/nm-rs6000.h (SOLIB_ADD): Ditto.

	* infcmd.c (attach_command): Remove auto_solib_add decl.
	Call SOLIB_ADD directly with auto_solib_add.
	* infrun.c (handle_inferior_event): Ditto.

	* coff-solib.h (SOLIB_ADD): Add readsyms arg.
	* pa64solib.h (SOLIB_ADD): Ditto.
	* solib.h (SOLIB_ADD): Ditto.
	* somsolib.h (SOLIB_ADD): Ditto.
	* config/i386/tm-cygwin.h (SOLIB_ADD): Ditto.

	* fork-child.c (clone_and_follow_inferior): Remove unused
	auto_solib_add decl.

	* pa64solib.c (pa64_solib_add): Call add_to_solist with readsyms.
	(read_dld_descriptor): Ditto.
	(pa64_solib_add): Call read_dld_descriptor with	readsyms.
	(pa64_solib_in_dynamic_linker): Ditto.

	* corelow.c (symfile.h): Need this for auto_solib_add declaration.
	* sol-thread.c (symfile.h): Ditto.

Approved by eliz@is.elta.co.il
doc/ChangeLog entry:

	2001-11-01  Fred Fish  <fnf@redhat.com>

	* gdbint.texinfo (SOLIB_ADD): Document additional new
	"readsyms" arg.
2001-11-01 16:17:08 +00:00
Christopher Faylor 3f8ad85b6f * win32-nat.c (register_loaded_dll): Attempt to ensure that the case of the
loaded DLL matches the on-disk case since the debugging API does not seem to
ensure this.  Calculate max name length here.
(handle_load_dll): Move max name length calculation to register_loaded_dll.
2001-10-31 19:05:35 +00:00
Fred Fish c3c057c81f 2001-10-30 Fred Fish <fnf@redhat.com>
* somsolib.c (som_solib_add): A megabyte is 1024*1024 bytes.
	* pa64solib.c (add_to_solist): Ditto.
	* win32-nat.c (_initialize_inftarg): Remove unnecessary
	initialization of auto_solib_add, it defaults to 1.
2001-10-30 17:34:30 +00:00
Corinna Vinschen 02cc9f49ae * win32-nat.c (DebugSetProcessKillOnExit): New static function
pointer to Windows' DebugSetProcessKillOnExit() function.
        (DebugActiveProcessStop): Ditto for DebugActiveProcessStop().
        (has_detach_ability): New function.
        (child_attach): If system has detach ability, enable it.
        (child_detach): If system has detach ability, actually
        detach from process.
        Change tty output to Linux format.
2001-10-26 09:29:31 +00:00
Christopher Faylor 83413c558c * win32-nat.c (handle_load_dll): Avoid strlwr'ing loaded DLLs or cygwin may not
be able to read them in certain situations.
2001-10-20 05:11:41 +00:00
Christopher Faylor 7470a420fc * win32-nat.c (safe_symbol_file_add_stub): Improve logic for avoiding load of
already loaded DLL.
(register_loaded_dll): Convert loaded DLL name to "posix" format or it will
confuse subsequent opening of the filename due to dos paths.
(dll_symbol_command): Pass from_tty parameter to safe_symbol_file_add.
2001-10-16 04:50:21 +00:00
Christopher Faylor fefd0a378f * win32-nat.c (safe_symbol_file_add_stub): Properly initialize linked list
pointer to beginning rather than one beyond beginning.
2001-10-13 01:20:29 +00:00
Christopher Faylor 02e423b9b2 * config/i386/tm-cygwin.h: include tm-i386.h instead of tm-i386v.h. This fixes
errors in "long long" handling for 'finish' and 'return' commands.
* win32-nat.c (safe_symbol_file_add_stub): Avoid adding a shared library if it
has already been loaded.
(safe_symbol_file_add_cleanup): Don't mess with stderr or we won't see any
error messages.
(safe_symbol_file_add): Ditto.
(solib_symbols_add): Make static.  Accept 'from_tty' parameter.  Pass it to
safe_symbol_file_add.
(core_dll_symbols_add): Accomodate extra solib_symbols_add parameter.
(child_solib_add): Ditto.
* win32-nat.c (handle_exception): Don't print "first chance" exceptions.
(get_child_debug_event): Continue from exceptions if !handle_exception.
2001-10-12 04:32:16 +00:00
Christopher Faylor 700b351bda * win32-nat.c (get_child_debug_event): Close file handles created after process
creation and DLL load.
(child_create_inferior): Close unneeded process/thread handle after thread
creation.
2001-10-11 01:55:58 +00:00
Kevin Buettner 39f770628a Phase 1 of the ptid_t changes. 2001-05-04 04:15:33 +00:00
Michael Chastain 559e75c07a 2001-03-17 Michael Chastain <chastain@redhat.com>
* win32-nat.c (child_attach): check args for NULL before passing
	to strtoul.  This fixes PR gdb/43.
2001-03-18 21:35:58 +00:00
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Andrew Cagney 4e052eda91 Create new file regcache.h. Update all uses. 2001-03-01 01:39:22 +00:00
Eli Zaretskii fa58ee1196 * demangle.c (demangling_style_names): New variable.
(_initialize_demangler): Fill demangling_style_names with the
	names of known demangling styles from libiberty_demanglers[].  Use
	add_set_enum_cmd instead of add_set_cmd, to get completion on
	demangling style names.

	* proc-api.c (_initialize_proc_api): Make `procfs-file' use
	file-name completion.

	* remote-rdi.c (_initialize_remote_rdi): Ditto for `rdilogfile'.

	* solib.c (_initialize_solib): Ditto for `solib-search-path' and
	`solib-absolute-prefix'.

	* tracepoint.c (_initialize_tracepoint): Ditto for
	`save-tracepoints'.

	* win32-nat.c (_initialize_inftarg): Ditto for `dll-symbols'.

	* cli/cli-cmds.c (init_cli_cmds): Make `shell' and `make' use
	file-name completion.

	* infcmd.c (_initialize_infcmd): Make the following commands use
	the file-name completer: `tty', `args', `path', `paths', and
	`run'.
2001-02-19 11:47:16 +00:00
Christopher Faylor 56c40d469c Fix spacing. 2001-02-06 05:04:40 +00:00
Christopher Faylor 554cb4863b * win32-nat.c: Change PTR to void * throughout. 2001-02-06 05:01:04 +00:00
Christopher Faylor aea02b6b07 * win32-nat.c (child_xfer_memory): Add missing argument required by 2001-01-23
change.
2001-01-27 19:32:32 +00:00
Christopher Faylor 0613c4019c * win32-nat.c (_initialize_core_win32): Prototype correctly. 2001-01-25 22:35:01 +00:00
Kevin Buettner b8c9b27d1e Replace free() with xfree(). 2000-12-15 01:01:51 +00:00
Christopher Faylor 66ed1d85be * win32-nat.c (dll_code_sections_add): strdup -> xstrdup. 2000-11-28 17:27:38 +00:00
Kevin Buettner b095261a94 Protoization. 2000-11-15 19:58:14 +00:00
Christopher Faylor 8e860359d1 * win32-nat.c (dll_symbol_command): Tack a .dll on the end of a supplied
argument if it is missing an extension.

* corelow.c: Define O_BINARY if it isn't defined.
(core_open): Open core file in binary mode.
* config/i386/tm-cygwin.h (child_clear_solibs): Rename from child_clear_solib.
* config/i386/cygwin.mh: Add dependency from corelow.o.
* win32-nat.c (register_loaded_dll): New function.  Add dll to the list of
currently loaded dlls.
(handle_load_dll): Use register_loaded_dll.
(child_solib_add): Distinguish between active process and core targets.
(solib_symbols_add): Load symbols from loaded dll.
(core_dll_symbols_add): New function.  Load symbols from dll referenced in
core.
(core_section_load_dll_symbols): New function.
(dll_code_sections_add): New function.
(map_single_dll_code_section): New function.
(fetch_elf_core_registers): New function.
(_initialize_core_win32): New function.
2000-08-27 04:21:35 +00:00
Christopher Faylor 9d3789f7f1 * win32-nat.c: Perform various gcc warning cleanups.
(safe_symbol_file_add_cleanup): Reset stdout to saved stdout, not stderr.
(dll_symbol_command): Pass OBJF_USERLOADED to safe_symbol_file_add.
(get_child_debug_event): Always reset last_sig.  Always reset inferior pid
appropriately.
(do_initial_child_stuff): New function.  Called when attaching or starting a
new inferior process.
(child_attach): Use do_initial_child_stuff.
(child_create_inferior): Ditto.
* config/i386/cygwin.mh (NAT_FILE): Set to modern location.
* config/i386/tm-cygwin.h: Define ATTACH_NO_WAIT.
2000-08-06 23:25:32 +00:00
Kevin Buettner fba45db2fa Protoization. 2000-07-30 01:48:28 +00:00
Christopher Faylor 7c5c87c02d * win32-nat.c (safe_symbol_file_add_args): Store old gdb_stderr and gdb_stdout
here.
(safe_symbol_file_add_stub): Redirect gdb_stdout as well as stderr.
(safe_symbol_file_add_cleanup): Restore gdb_stdout.
(info_dll_command): Use the pager for displaying DLLs since there are often
quite a few.
2000-06-11 02:34:40 +00:00
Kevin Buettner 507f3c78fb Eliminate PARAMS from function pointer declarations. 2000-06-04 00:41:10 +00:00
Christopher Faylor 450005e7c2 * win32-nat.c (safe_symbol_file_add_cleanup): Ensure that gdb_stderr is flushed
before deleting and restoring it.
(safe_symbol_file_add): Ensure that gdb_stderr is flushed before reassigning
it.
(handle_load_dll): Split into two functions so that WFI can handle shared
library events.
(child_solib_loaded_library_pathname): New function.
(child_clear_solibs): New function.  Clears shared library list.
(child_solib_add): New function.  Adds shared library symbols.
(dll_symbol_command): New function.  Handles "dll-symbol" command.
(info_dll_command): New function.  Handles info "sharedlibrary" command.
(handle_exceptions): Eliminate 'ignore_trap' argument.
(get_child_debug_event): Eliminate two arguments.  Return "pid" when
appropriate.  Break out on most events to allow WFI to handle stuff.
(child_wait): Accomodate get_child_debug_event changes.
(child_attach): Clear thread list and list of loaded dlls.
(child_create_inferior): Clear list of loaded dlls.  Use wait_for_inferior in a
loop to look for first "trap".
(child_resume): Avoid accessing a possibly-freed thread pointer.
(_initialize_inftarg): Add "dll-symbols", "sharedlibrary", and "info
dll", and "info sharedlibrary" commands.
* config/i386/tm-cygwin.h: Add some shared library (aka DLL) hooks.
2000-06-04 00:28:17 +00:00
Christopher Faylor 29fe111d82 * win32-nat.c: Fix up gcc warnings throughout.
(handle_load_dll): Change DLL name to lower case.
(handle_exception): Add a second argument indicating whether a breakpoint
should be ignored.  Return a 0 if the breakpoint was ignored.
(get_child_debug_event): Pass argument to handle_exception to control whether a
breakpoint should be ignored.
(child_create_inferior): Use modern cygwin API.  Explicitly clear last_sig.
Pass FIRST_EXCEPTION to get_child_debug_event for detection of first
breakpoint.

* configure.in: Eliminate unneeded WINDRES/DLLTOOL tests left over after last change.
* configure: Regenerate.
2000-06-03 05:04:14 +00:00
Kevin Buettner a14ed312fd PARAMS removal. 2000-05-28 01:12:42 +00:00
Elena Zannoni 0aa9cf965c 2000-04-21 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* win32-nat.c  (handle_load_dll): Don't treat .text as a special
 	section anymore.
	* somread.c (som_symfile_offsets): Ditto.
	* somsolib.c (som_solib_add_solib_objfile): Ditto.
2000-04-21 14:24:45 +00:00