Commit Graph

111 Commits

Author SHA1 Message Date
Frank Ch. Eigler 7cdd6cac82 * Fixes for PR 14571.
Thu Apr  2 12:47:41 1998  Frank Ch. Eigler  <fche@cygnus.com>

	* sol-thread.c (sol_thread_store_registers): Save & restore new
 	value of single updated register to prevent accidental clobbering.
1998-04-02 18:54:04 +00:00
David Taylor 0274a484ce fixes for debugging threaded core files. Previously gdb would find the
kernel threads but would get errors on each of the user threads that wasn't
currently assigned to a kernel thread.  PR's gdb/13803 (and gdb/13618).
1997-12-03 19:30:06 +00:00
David Taylor 022278948f fix for PR 13618 -- gdb incorrectly reports thread information.
If other systems besides nm-sun4sol2 exhibit the problem, they may need
definitions of FIND_NEW_THREADS and a corresponding support function.
1997-10-24 21:04:39 +00:00
Michael Snyder 0f5b751aaf Wed Jul 16 10:38:03 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
* sol-thread.c (sol_thread_[store, fetch]_registers): if
        inferior_pid is an LWP rather than a Solaris thread, let
        procfs handle the request.
        (rw_common, sol_thread_xfer_memory): procfs_xfer_memory will
        only work if inferior_pid points to an LWP (rather than a
        Solaris thread).  Use procfs_first_available to find a good LWP.
        (info_solthreads): added a maintenance command to list all
        known Solaris threads and their attributes.
1997-07-16 19:16:07 +00:00
Michael Snyder 3780c33708 Wed May 21 16:03:25 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
* procfs.c (init_procinfo): new function, abstracts some code
        shared by create_procinfo and do_attach;
        (procfs_set_inferior_syscall_traps): new function, abstracts
        some code needed by procfs_init_inferior, do_attach, and
        procfs_lwp_creation_handler; (procfs_first_available): new
        function, find any LWP that's runnable; (procfs_thread_alive):
        replace stub function with real implementation;
        (procfs_lwp_creation_handler): fix bug starting new child
        threads; (info_proc): bug fixes and enhancements for the
        "INFO PROCESSES" command; (close_procinfo_file): call new
        function "delete_thread" to cleanup GDB's thread database;
        (proc_init_failed): add new argument "kill", to control whether
        process is killed (so this function can be shared by
        create_procinfo and do_attach); (procfs_exit_handler): handle
        exit from an attached process, and cleanup procinfo handles
        when the process exits; (procfs_resume, procfs_wait): cleanup
        after a thread when it exits; (do_attach, do_detach): handle
        attached processes with multiple threads; plus some general
        improvements in the diagnostic output.
        * sol-thread.c (sol_thread_alive): replace stub with real
        implementation; (thread_to_lwp, lwp_to_thread): enhance to
        handle threads that may have exited; (sol_thread_attach): add
        startup setup stuff; (sol_thread_detach): add unpush_target
        call; (sol_thread_mourn_inferior): add unpush_target call;
        (sol_thread_wait, sol_thread_resume): enhance to deal with
        thread exit cleanly; (sol_thread_new_objfile,
        sol_thread_pid_to_str): detect unsuccessful startup and
        don't crash; plus some general cleanup.
        * thread.c (delete_thread): new function, allows targets to
        notify gdb when a thread is no longer valid.
        * infrun.c (wait_for_inferior): don't try to detect a new
        thread on receiving a TARGET_EXITED event.
1997-05-21 23:33:33 +00:00
Stu Grossman 4915acadd4 * Makefile.in (INTERNAL_LDFLAGS): Add in flags from configure.
* configure configure.in:  Only make sol-thread.o for native.
	Also, switch to dlopened libthread_db.so.1.
	* sol-thread.c:  Switch to using dlopen to get the thread_db
	library.
1996-06-11 19:21:42 +00:00
Stu Grossman 9b33e492d6 * procfs.c (procfs_thread_alive procfs_stop): Make static.
* (procfs_pid_to_str):  New routine to print out thread id's in an
	intelligible manner.
	* sol-thread.c (sol_thread_fetch_registers):  Re-order manner in
	which supply_register is called to fix bug with writing writing
	individual regs.
	* config/sparc/tm-sun4sol2.h:  Define default for
	target_pid_to_str in case host lacks libthread_db.
1996-05-15 01:09:57 +00:00
Stu Grossman a50cedad0e * sol-thread.c: More cleanup, add comments.
* (sol_thread_resume):  Prevent people from trying to step
	inactive threads.
	* (sol_thread_wait sol_thread_fetch_registers
	sol_thread_store_registers):  Remove unnecessary check for
	sol_thread_active.  These routines won't get called unless threads
	are active.
1996-05-13 23:22:32 +00:00
Stu Grossman 934741a174 * sol-thread.c: Cleanup. gcc -Wall fixes. Add prototypes.
Print out messages instead of codes for thread_db errors.  Make
	access macros for thread and lwp manipulation.  Make cleanups to
	fixup inferior_pid in case of errors.
1996-05-10 23:05:01 +00:00
Stu Grossman fdfa331511 * Makefile.in, breakpoint.c, corelow.c, fork-child.c, inflow.c,
infrun.c, mac-nat.c, procfs.c, remote.c, sol-thread.c, thread.c,
	win32-nat.c, config/nm-lynx.h:  Rename thread.h to gdbthread.h to
	avoid conflict with Solaris /usr/include/thread.h.
1996-05-09 21:24:20 +00:00
Stu Grossman 8fc2b4170d * fork-child.c (fork_inferior), inferior.h: init_trace_fun now
returns a possibly modified pid.
	* inftarg.c (ptrace_him):  Now returns pid;
	* m3-nat.c (m3_trace_him):  Now returns pid;
	* infcmd.c (run_command):  Minor cleanup.
	* infrun.c (wait_for_inferior):  Add another check for one_stepped
	near where we read the pc to avoid erroneously setting
	random_signal for multi-threaded support.
	* procfs.c:  Add support for Solaris LWPs.  Remove def of
	LOSING_POLL.  Many cleanups...  Several workarounds for Solaris
	lossage.  System call entry and exit are now handled by
	dynamically registered handlers.
	* (syscallname):  Don't barf when handed an unknown syscall
	number.
	* (info_proc_syscalls):  Ditto.
	* sol-thread.c:  New file.  Implements Solaris thread support.
	* symfile.c (symbol_file_add):  Add call to target_new_objfile to
	notify target-dependent code about new symbol tables.
	* (clear_symtab_users):  Call target_new_objfile to notify it of
	the removal of all symbol tables.
	* target.c (push_target):  Make sure that to_close is non-zero
	before calling it.
	* target.h (target_new_objfile):  Provide default.
	* config/alpha/nm-osf2.h:  Define LOSING_POLL because this version
	of OSF can't hack using poll with /proc.
	* config/sparc/nm-sun4sol2.h (target_new_objfile):  Define to be
	sol-thread-new-objfile.
	* config/sparc/sun4sol2.mh:  Add sol-thread.o to NATDEFFILES, and
	add libthread_db.so.1 to NAT_CLIBS.
	* config/sparc/tm-sun4sol2.h:  Define PIDGET, TIDGET, and
	target_pid_to_str.
1996-05-06 21:27:37 +00:00