GDB (API)
/home/stan/gdb/src/gdb/proc-utils.h
Go to the documentation of this file.
00001 /* Machine independent support for SVR4 /proc (process file system) for GDB.
00002    Copyright (C) 1999-2013 Free Software Foundation, Inc.
00003 
00004    This file is part of GDB.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 3 of the License, or
00009    (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00018 
00019 /* From proc-why.c */
00020 
00021 /*
00022  * Pretty-print functions for /proc data 
00023  */
00024 
00025 extern void proc_prettyprint_why (unsigned long why, unsigned long what,
00026                                   int verbose);
00027 
00028 extern void proc_prettyprint_syscalls (sysset_t *sysset, int verbose);
00029 
00030 extern void proc_prettyprint_syscall (int num, int verbose);
00031 
00032 extern void proc_prettyprint_signalset (sigset_t *sigset, int verbose);
00033 
00034 extern void proc_prettyprint_signal (int signo, int verbose);
00035 
00036 extern void proc_prettyprint_faultset (fltset_t *fltset, int verbose);
00037 
00038 extern void proc_prettyprint_fault (int faultno, int verbose);
00039 
00040 extern void proc_prettyprint_actionset (struct sigaction *actions,
00041                                         int verbose);
00042 
00043 extern void proc_prettyfprint_signalset (FILE *file, sigset_t *sigset,
00044                                          int verbose);
00045 
00046 extern void proc_prettyfprint_faultset (FILE *file, fltset_t *fltset,
00047                                         int verbose);
00048 
00049 extern void proc_prettyfprint_syscall (FILE *file, int num, int verbose);
00050 
00051 extern void proc_prettyfprint_signal (FILE *file, int signo, int verbose);
00052 
00053 extern void proc_prettyfprint_flags (FILE *file, unsigned long flags,
00054                                      int verbose);
00055 
00056 extern void proc_prettyfprint_why (FILE *file, unsigned long why, 
00057                                    unsigned long what, int verbose);
00058 
00059 extern void proc_prettyfprint_fault (FILE *file, int faultno, int verbose);
00060 
00061 extern void proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset,
00062                                         int verbose);
00063 
00064 extern void proc_prettyfprint_status (long, int, int, int);
00065 
00066 
00067 /* From proc-flags.c */
00068 
00069 /*
00070  * Pretty-print the prstatus flags.
00071  */
00072 
00073 extern void proc_prettyprint_flags (unsigned long flags, int verbose);
00074 
00075 extern void proc_prettyfprint_flags (FILE *file, unsigned long flags,
00076                                      int verbose);
00077 
00078 
00079 /* From proc-api.c */
00080 
00081 /*
00082  * Trace functions for /proc api.
00083  */
00084 
00085 extern  int   write_with_trace (int, void *, size_t, char *, int);
00086 extern  off_t lseek_with_trace (int, off_t,  int,    char *, int);
00087 extern  int   ioctl_with_trace (int, long, void *, char *, int);
00088 extern  pid_t wait_with_trace  (int *, char *, int);
00089 extern  int   open_with_trace  (char *, int, char *, int);
00090 extern  int   close_with_trace (int, char *, int);
00091 extern  void  procfs_note      (char *, char *, int);
00092 
00093 #ifdef PROCFS_TRACE
00094 /*
00095  * Debugging code:
00096  *
00097  * These macros allow me to trace the system calls that we make
00098  * to control the child process.  This is quite handy for comparing
00099  * with the older version of procfs.
00100  */
00101 
00102 #define write(X,Y,Z)   write_with_trace (X, Y, Z, __FILE__, __LINE__)
00103 #define lseek(X,Y,Z)   lseek_with_trace (X, Y, Z, __FILE__, __LINE__)
00104 #define ioctl(X,Y,Z)   ioctl_with_trace (X, Y, Z, __FILE__, __LINE__)
00105 #define open(X,Y)      open_with_trace  (X, Y,    __FILE__, __LINE__)
00106 #define close(X)       close_with_trace (X,       __FILE__, __LINE__)
00107 #define wait(X)        wait_with_trace  (X,       __FILE__, __LINE__)
00108 #endif
00109 #define PROCFS_NOTE(X) procfs_note      (X,       __FILE__, __LINE__)
00110 #define PROC_PRETTYFPRINT_STATUS(X,Y,Z,T) \
00111      proc_prettyfprint_status (X, Y, Z, T)
00112 
00113 /* Define the type (and more importantly the width) of the control
00114    word used to write to the /proc/PID/ctl file.  */
00115 #if defined (PROC_CTL_WORD_TYPE)
00116 typedef PROC_CTL_WORD_TYPE procfs_ctl_t;
00117 #else
00118 typedef long procfs_ctl_t;
00119 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines