summaryrefslogtreecommitdiff
path: root/gdb/common/linux-procfs.c
Commit message (Collapse)AuthorAgeFilesLines
* PR gdb/7912:Tom Tromey2013-04-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (SFILES): Add filestuff.c (COMMON_OBS): Add filestuff.o. (filestuff.o): New target. * auto-load.c (auto_load_objfile_script_1): Use gdb_fopen_cloexec. * auxv.c (procfs_xfer_auxv): Use gdb_open_cloexec. * cli/cli-cmds.c (shell_escape): Call close_most_fds. * cli/cli-dump.c (fopen_with_cleanup): Use gdb_fopen_cloexec. * common/agent.c (gdb_connect_sync_socket): Use gdb_socket_cloexec. * common/filestuff.c: New file. * common/filestuff.h: New file. * common/linux-osdata.c (linux_common_core_of_thread) (command_from_pid, commandline_from_pid, print_source_lines) (linux_xfer_osdata_shm, linux_xfer_osdata_sem) (linux_xfer_osdata_msg, linux_xfer_osdata_modules): Use gdb_fopen_cloexec. * common/linux-procfs.c (linux_proc_get_int) (linux_proc_pid_has_state): Use gdb_fopen_cloexec. * config.in, configure: Rebuild. * configure.ac: Don't check for sys/socket.h. Check for fdwalk, pipe2. * corelow.c (core_open): Use gdb_open_cloexec. * dwarf2read.c (write_psymtabs_to_index): Use gdb_fopen_cloexec. * fork-child.c (fork_inferior): Call close_most_fds. * gdb_bfd.c (gdb_bfd_open): Use gdb_open_cloexec. * inf-child.c (inf_child_fileio_readlink): Use gdb_open_cloexec. * linux-nat.c (linux_nat_thread_name, linux_proc_pending_signals): Use gdb_fopen_cloexec. (linux_proc_xfer_partial, linux_proc_xfer_spu): Use gdb_open_cloexec. (linux_async_pipe): Use gdb_pipe_cloexec. * remote-fileio.c (remote_fileio_func_open): Use gdb_open_cloexec. * remote.c (remote_file_put, remote_file_get): Use gdb_fopen_cloexec. * ser-pipe.c (pipe_open): Use gdb_socketpair_cloexec, close_most_fds. * ser-tcp.c (net_open): Use gdb_socket_cloexec. * ser-unix.c (hardwire_open): Use gdb_open_cloexec. * solib.c (solib_find): Use gdb_open_cloexec. * source.c (openp, find_and_open_source): Use gdb_open_cloexec. * tracepoint.c (tfile_start): Use gdb_fopen_cloexec. (tfile_open): Use gdb_open_cloexec. * tui/tui-io.c (tui_initialize_io): Use gdb_pipe_cloexec. * ui-file.c (gdb_fopen): Use gdb_fopen_cloexec. * xml-support.c (xml_fetch_content_from_file): Use gdb_fopen_cloexec. * main.c (captured_main): Call notice_open_fds. gdbserver * Makefile.in (SFILES): Add filestuff.c. (OBS): Add filestuff.o. (filestuff.o): New target. * config.in, configure: Rebuild. * configure.ac: Check for fdwalk, pipe2.
* Update years in copyright notice for the GDB files.Joel Brobecker2013-01-011-1/+1
| | | | | | | Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
* gdb/Jan Kratochvil2012-03-131-45/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | * common/linux-procfs.c (linux_proc_get_int): New, from linux_proc_get_tgid, change its LWPID type to pid_t, add parameter field. (linux_proc_get_tgid): Only call linux_proc_get_int. (linux_proc_get_tracerpid): New. (linux_proc_pid_has_state): New, from linux_proc_pid_is_zombie. (linux_proc_pid_is_stopped, linux_proc_pid_is_zombie): Only call linux_proc_pid_has_state. * common/linux-procfs.h (linux_proc_get_tracerpid): New declaration. * common/linux-ptrace.c: Include linux-procfs.h and buffer.h. (linux_ptrace_attach_warnings): New. * common/linux-ptrace.h (struct buffer, linux_ptrace_attach_warnings): New declaration. * linux-nat.c: Include exceptions.h, linux-ptrace.h and buffer.h. (linux_nat_attach): New variables ex, buffer, message and message_s. Wrap to_attach by TRY_CATCH and call linux_ptrace_attach_warnings. gdb/gdbserver/ * linux-low.c (linux_attach_lwp_1): New variable buffer. Call linux_ptrace_attach_warnings. gdb/testsuite/ * gdb.base/attach-twice.c: New files. * gdb.base/attach-twice.exp: New files.
* gdb/Jan Kratochvil2012-03-131-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (linux-ptrace.o): New. * common/linux-procfs.c (linux_proc_pid_is_zombie): New, from linux-nat.c. * common/linux-procfs.h (linux_proc_pid_is_zombie): New declaration. * common/linux-ptrace.c: New file. * config/alpha/alpha-linux.mh (NATDEPFILES): Add linux-ptrace.o. * config/arm/linux.mh: Likewise. * config/i386/linux.mh: Likewise. * config/i386/linux64.mh: Likewise. * config/ia64/linux.mh: Likewise. * config/m32r/linux.mh: Likewise. * config/m68k/linux.mh: Likewise. * config/mips/linux.mh: Likewise. * config/pa/linux.mh: Likewise. * config/powerpc/linux.mh: Likewise. * config/powerpc/ppc64-linux.mh: Likewise. * config/powerpc/spu-linux.mh: Likewise. * config/s390/s390.mh: Likewise. * config/sparc/linux.mh: Likewise. * config/sparc/linux64.mh: Likewise. * config/xtensa/linux.mh: Likewise. * linux-nat.c (linux_lwp_is_zombie): Remove, move it to common/linux-procfs.c. (wait_lwp): Rename linux_lwp_is_zombie to linux_proc_pid_is_zombie. gdb/gdbserver/ * Makefile.in (linux-ptrace.o): New. * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*) (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*) (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*) (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux) (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ of these targets. * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
* 2012-02-27 Pedro Alves <palves@redhat.com>Pedro Alves2012-02-271-0/+31
| | | | | | | | | | | | | | | | gdb/gdbserver/ * linux-low.c (pid_is_stopped): Delete, moved to common/. (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped. gdb/ * linux-nat.c (pid_is_stopped): Delete, moved to common/. (linux_nat_post_attach_wait): Adjust to use linux_proc_pid_is_stopped. * common/linux-procfs.h (linux_proc_pid_is_stopped): Declare. * common/linux-procfs.c (linux_proc_pid_is_stopped): New function, based on pid_is_stopped from both linux-nat.c and gdbserver/linux-low.c, and renamed.
* Copyright year update in most files of the GDB Project.Joel Brobecker2012-01-041-1/+1
| | | | | | gdb/ChangeLog: Copyright year update in most files of the GDB Project.
* Move common linux procfs code to common/Luis Machado2011-08-241-0/+55