aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
AgeCommit message (Collapse)AuthorFilesLines
2000-05-28PARAMS removal.Kevin Buettner1-84/+80
2000-05-262000-05-26 Michael Snyder <msnyder@seadog.cygnus.com>Michael Snyder1-31/+3
* gregset.h: New file. Typedefs for gdb_gregset_t and gdb_fpregset_t, prototypes for supply_gregset and friends. * procfs.c: Include gregset.h. Delete local prototypes for supply_gregset etc., and local typedef gdb_gregset_t etc. * sol-thread.c: Include gregset.h, delete local prototypes, add appropriate casts to gdb_gregset_t. * uw-thread.c, lin-thread.c, core-sol2.c, core-regset.c, sparc-tdep.c, ptx4-nat.c, ppc-linux-nat.c, mipsv4-nat.c, m88k-nat.c, m68klinux-nat.c, m68k-tdep.c, irix5-nat.c, irix4-nat.c, ia64-linux-nat.c, i386v4-nat.c, cxux-nat.c, arm-linux-nat.c, alpha-nat.c: Include gregset.h. * config/nm-linux.h: Define GDB_GREGSET_T, GDB_FPREGET_T. * config/sparc/tm-sun4sol2.h: Ditto.
2000-05-25Replace <sys/dir.h> (and <dirent.h>) with "gdb_dirent.h".Andrew Cagney1-2/+2
2000-05-22Purge procfs.c of make_cleanup_func.Andrew Cagney1-5/+18
2000-05-102000-05-08 Michael Snyder <msnyder@seadog.cygnus.com>Michael Snyder1-34/+35
* gdbarch.sh: Add FP0_REGNUM to list of multi-arched register numbers. * gdbarch.c, gdbarch.h: Regenerate. * core-regset.c: Change FP0_REGNUM to a runtime test. * procfs.c: Ditto. * sun3-nat.c: Ditto. * sparc-tdep.c: Ditto. * i386mach-nat.c: Remove unnecessary ifdef for FP0_REGNUM. * ptx4-nat.c: Ditto. * sol-thread.c (sol_thread_create_inferior): only add the thread to the thread list if it is not already in there. (prototypes for thread_db func ptrs): pretty up formatting.
2000-05-07* procfs.c (PROCFS_TRACE): Delete definition.Andrew Cagney1-1/+0
* proc-utils.h (PROCFS_NOTE, PROC_PRETTYFPRINT_STATUS): Always define.
2000-05-052000-05-05 Michael Snyder <msnyder@seadog.cygnus.com>Michael Snyder1-35/+10
* procfs.c: Cleanup of procfs tracing. Move defines and prototypes to proc-utils.h * proc-utils.h: Define tracing macros. Declare trace functions. * proc-api.c: Make procfs tracing a runtime option. (prepare_to_trace): New function, abstracted out of several places. Open a trace file if one is required. (ioctl_with_trace, write_with_trace, open_with_trace, close_with_trace, wait_with_trace, lseek_with_trace): Report errno if an error occurs in a system call. (write_with_trace): Make 2nd arg void *, to agree with write.
2000-05-052000-05-05 Michael Snyder <msnyder@seadog.cygnus.com>Michael Snyder1-15/+15
* procfs.c (many functions): change int cmd; to long cmd; Solaris /proc API calls this parameter a long, and requires it for 64-bit hosts (where sizeof(long) != sizeof(int)). UnixWare calls it an int, but on existing UnixWare hosts, int and long are the same size. So long it must be. If a future UnixWare version has problems with this, we'll have to use autoconf. * proc-api.c (write_with_trace): use long instead of int.
2000-05-02Multi-arch NPC_REGNUM NNPC_REGNUM.Andrew Cagney1-6/+2
2000-04-272000-04-26 Michael Snyder <msnyder@seadog.cygnus.com>Michael Snyder1-28/+17
* procfs.c (comments): Eliminate "???" in comments, which GCC wants to interpret as a trigraph. (fill_gregset, supply_gregset, fill_fpregset, supply_fpregset): declare. (procfs_wait): Sysargs is a long, change printf format to match. (test-mapping, mapping_test, test_mapping_cmd) Remove (test only).
2000-04-07From 2000-03-27 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:Andrew Cagney1-0/+2
* procfs.c (init_procfs_ops): Set procfs_ops.to_has_memory and procfs_ops.to_has_all_memory to 1.
2000-03-282000-03-28 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>Michael Snyder1-2/+2
* procfs.c (proc_set_watchpoint): Declare addr parameter as CORE_ADDR, to match call from procfs_set_watchpoint.
2000-02-29From Peter Schauer: Fix Solaris/x86 threads by copying linux code.Andrew Cagney1-17/+0
2000-02-16From Rodney Brown: Define MERGEPID when needed.Andrew Cagney1-0/+2
2000-01-25import gdb-2000-01-24 snapshotJason Molenda1-19/+34
2000-01-11import gdb-2000-01-10 snapshotJason Molenda1-47/+65
2000-01-06import gdb-2000-01-05 snapshotJason Molenda1-5048/+4343
1999-12-22import gdb-1999-12-21 snapshotJason Molenda1-0/+3
1999-11-09import gdb-1999-11-08 snapshotJason Molenda1-14/+36
1999-10-05import gdb-1999-10-04 snapshotJason Molenda1-1/+1
1999-09-28import gdb-1999-09-28 snapshotJason Molenda1-8/+16
1999-08-31import gdb-1999-08-30 snapshotJason Molenda1-1/+0
1999-07-07import gdb-1999-07-07 post reformatJason Molenda1-1227/+1356
1999-05-05import gdb-19990504 snapshotStan Shebs1-2/+2
1999-04-26import gdb-19990422 snapshotStan Shebs1-3/+21
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+5764
1999-04-16Initial creation of sourceware repositoryStan Shebs1-5826/+0
1999-01-29Fix for PR 17980:Mark Alexander1-1/+2
* procfs.c (wait_fd): Handle deleted threads correctly.
1999-01-22 * procfs.c (init_procfs_ops): New function, fills in procfs_ops,Stan Shebs1-25/+24
init only nonzero fields, leave to_require_attach and to_require_detach empty, not needed for /proc systems yet. (_initialize_procfs): Call init_procfs_ops.
1999-01-18change initialization of procfs_ops from compile time to run time.David Taylor1-69/+43
1999-01-13Wed Jan 13 14:59:02 1999 Michael Snyder <msnyder@cleaver.cygnus.com>Michael Snyder1-2/+3
* infrun.c (set/show scheduler-locking) New command. Set a mode bit that will control how GDB attempts to control thread scheduling for step, continue, etc. (resume): make use of the schedule-locking mode. * target.h (struct target_ops): new field to_has_thread_control. * sol-thread.c: initialize target_ops to_has_thread_control. * procfs.c: ditto. * target.c: ditto. * m3-nat.c: ditto. * remote.c: ditto. * hpux-thread.c: ditto.
1998-12-31all remaining *.c *.h files from hp merge.David Taylor1-5/+4
1998-12-28hp merge changes -- too numerous to mention here; see ChangeLog andDavid Taylor1-6/+31
ChangeLog-gdbtk for details.
1998-11-24 * procfs.c (procfs_wait): handle syscall events first.Felix Lee1-46/+85
* procfs.c (GDB_GREGSET_TYPE, GDB_FPREGSET_TYPE): new macros. * config/sparc/xm-sun4sol2.h: use them. * core-sol2.c: don't #undef gregset_t and fpregset_t. * sol-thread.c: ditto. * sparc-tdep.c: ditto.
1998-11-18Wed Nov 11 15:47:00 1998 Michael Snyder <msnyder@cleaver.cygnus.com>Michael Snyder1-0/+3
* procfs.c (proc_set_exec_trap): don't set PR_ASYNC or PR_FORK in the child process for UnixWare (causes processes forked by the debuggee to hang).
1998-04-20Mon Apr 20 14:18:45 1998 J. Kean Johnston <jkj@sco.com>Jason Molenda1-10/+177
* procfs.c: Added replacement macros for LWP stuff. Fixed support for UnixWare / SVR4.2MP targets and any targets which use multi-file /proc entries. Fixed support for hardware watchpoints. * solib.c: SCO needs some of the same code as SunOS. Change preprocessor conditionals. * config/i386/i386sco5.mt: New file. * config/i386/tm-i386sco5.h: New file. * config/i386/i386sco5.mh (NATDEPFILES): add i386v-nat.o. * config/i386/nm-i386v42mp.h (TARGET_HAS_HARDWARE_WATCHPOINTS): define. Add other macros for hardware assisted watchpoints. * config/i386/nm-i386sco5.h: Correct attributions. (TARGET_HAS_HARDWARE_WATCHPOINTS): define. * config/i386/nm-linux.h (target_remote_watchpoint): Pass 'type' through to i386_insert_watchpoint. Mon Apr 20 14:12:30 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * infrun.c (wait_for_inferior): Don't add signalled processes as new threads. * procfs.c (wait_fd): Note if LWP has exited. (procfs_wait): use GETPID to get process ID. NOTE: I didn't commit Kean's changes to configure.host/configure.tgt yet because they are kind of bogus and I'm punting back to him to let him figure out what he's trying to do. So configuring for UnixWare may not work just yet.
1998-04-11Fri Apr 10 22:36:28 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)Jason Molenda1-2/+14
Update support for x86 Solaris 2. * config/i386/tm-i386sol2.h, nm-i386sol2.h: New configuration files for x86 Solaris 2. * config/i386/i386sol2.mt, i386sol2.mh: Use them. * config/sparc/tm-sun4sol2.h (PROCFS_GET_CARRY): New macro, extract carry flag from a given regset. (IS_STATIC_TRANSFORM_NAME): New macro, check if a symbol name is a SunPro transformed name. * i386-tdep.c (sunpro_static_transform_name): New function to extract the source name from a SunPro transformed name. * inferior.h (procfs_first_available, procfs_get_pid_fd): Add prototypes. * infrun.c (wait_for_inferior): Handle breakpoint hit in signal handler without intervening stop in sigtramp. * procfs.c (procfs_lwp_creation_handler): Use PROCFS_GET_CARRY instead of direct access to the status register. (procfs_get_pid_fd): New function, returns procfs fd for a given pid. * sol-thread.c (ps_lgetLDT): New function, returns LDT for a given lwpid. (sol_find_new_threads): Handle failed libthread_db initialization gracefully. * stabsread.c (define_symbol): Use IS_STATIC_TRANSFORM_NAME to check for a SunPro transformed symbol name.
1997-07-15Mon Jul 14 18:02:53 1997 Michael Snyder (msnyder@cleaver.cygnus.com)Michael Snyder1-10/+15
* procfs.c (wait_fd): Handle an fd that has "hung up" or otherwise terminated (Solaris threads).
1997-06-17 * procfs.c (proc_set_exec_trap, procfs_init_inferior, procfs_wait,Peter Schauer1-53/+7
unconditionally_kill_inferior): Undo Oct 26 1996 and Apr 26 1997 changes to trace PRFS_STOPTERM and handle PR_DEAD. These changes tried to work around a problem with an early DU 4.0 release, but they trigger subtle timing dependent kernel bugs in older OSF/1 releases.
1997-05-21Wed May 21 16:03:25 1997 Michael Snyder <msnyder@cleaver.cygnus.com>Michael Snyder1-336/+522
* 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-04-26 * corelow.c (get_core_registers): Initialize cf.Peter Schauer1-12/+33
* procfs.c: Minor changes to make pre-ANSI compilers happy. (procfs_notice_signals): Copy traced signal set back to pi->prrun.pr_trace. (unconditionally_kill_inferior): If PR_DEAD is defined, rerun inferior after killing it.
1997-04-14Mon Apr 14 15:54:51 1997 Geoffrey Noer <noer@pizza.cygnus.com>Geoffrey Noer1-1/+1
* procfs.c (notice_signals): fix typo
1997-04-10Thu Apr 10 13:20:53 1997 Geoffrey Noer <noer@cygnus.com>Geoffrey Noer1-179/+1051
* procfs.c: Substantial (but incomplete) changes to support sysv4.2mp procfs as implemented in UnixWare 2.1. The procinfo struct now has substructs like struct flt_ctl instead of just a fltset_t and has a ctl_fd, status_fd, as_fd, and map_fd instead of a single fd. Non-sysv4.2mp procfs models still have the structs and multiple fds, but don't use the entire struct and the four fds all point to the same thing. We use PROCFS_USE_READ_WRITE to decide whether to talk to procfs with reads/writes or use ioctl instead. We use HAVE_MULTIPLE_PROC_FDS to determine whether procfs really has multiple fds or not. PROC_NAME_FMT is split out into CTL_PROC_NAME_FMT, AS_PROC_NAME_FMT, MAP_PROC_NAME_FMT, STATUS_PROC_NAME_FMT. (procfs_notice_signals): now a necessary wrapper around (notice_signals): which are the new guts for noticing signals (open_proc_file): gets a new flag arg used in sysv4.2mp to determine whether or not to attempt to open the ctl_fd. (procfs_read_status): new local function, reads procfs status (procfs_write_pcwstop): new local function, writes a PCWSTOP (procfs_write_pckill): new local function, writes a PCKILL (unconditionally_kill_inferior): remove signo since we now just call procfs_write_pckill(). (procfs_xfer_memory): call lseek with SEEK_SET rather than 0 (proc_iterate_over_mappings): the whole function is ifdefed on UNIXWARE to keep things readable. Expanded the syscall_table to include new potential sysv4.2mp members. Note that all ifdefs of UNIXWARE should be eliminated if possible or renamed to describe what's being selected for a bit better. Sysv4.2mp and IRIX both have SYS_sproc so the IRIX specific code now also checks it's not UNIXWARE. * config/i386/tm-i386v42mp.h: also define HAVE_PSTATUS_T, HAVE_NO_PRRUN_T, PROCFS_USE_READ_WRITE, and UNIXWARE * config/mips/nm-irix4.h: set CTL_PROC_NAME_FMT et al to "/debug/%d" as PROC_NAME_FMT used to be
1996-11-16 From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>Fred Fish1-7/+10
* procfs.c (wait_fd): Handle EINTR error return from poll by restarting the poll. * defs.h (PIDGET): Define a default version that just returns its argument unchanged. * inflow.c (terminal_init_inferior): Eliminate #ifdef of PIDGET and fold both alternatives into common code. (pass_signal): Use PIDGET for pid passed to kill().
1996-10-26 * procfs.c (proc_set_exec_trap): Under Alpha OSF/1-4.0, tracingPeter Schauer1-6/+30
the entry to the exit system call to detect termination of the inferior stopped working. Trace termination of the inferior via PRFS_STOPTERM instead. (procfs_init_inferior): Do not trace entry to exit system call if PIOCSSPCACT is defined. (procfs_wait): Handle PR_DEAD event, which signals the termination of the inferior if PRFS_STOPTERM is set. * mdebugread.c (parse_partial_symbols): Ignore stNil section start address symbols. * sparc-tdep.c (get_saved_register): Get saved PC from the frame info if not in innermost frame.
1996-07-26See gdb ChangeLog entry with header:Fred Fish1-4/+50
Thu Jul 25 19:41:31 1996 Fred Fish <fnf@cygnus.com> for a rather huge set of changes. I was going to put them here, but it made cvs dump core. :-(
1996-05-15 * procfs.c (procfs_thread_alive procfs_stop): Make static.Stu Grossman1-2/+16
* (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-14 * Makefile.in config.in configure configure.inStu Grossman1-2/+2
config/sparc/nm-sun4sol2.h config/sparc/sun4sol2.mh config/sparc/tm-sun4sol2.h: Use autoconf to config Solaris thread and pthread support, since pre-2.5 systems don't come with libthread_db.so.1. * procfs.c (info_proc): Use int instead of id_t. Old versions of Irix don't see to define this.
1996-05-09 * Makefile.in, breakpoint.c, corelow.c, fork-child.c, inflow.c,Stu Grossman1-1/+1
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-06 * fork-child.c (fork_inferior), inferior.h: init_trace_fun nowStu Grossman1-241/+907
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.