GDB (API)
/home/stan/gdb/src/gdb/linux-record.h
Go to the documentation of this file.
00001 /* Process record and replay target code for GNU/Linux.
00002 
00003    Copyright (C) 2008-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #ifndef _LINUX_RECORD_H_
00021 #define _LINUX_RECORD_H_
00022 
00023 struct linux_record_tdep
00024 {
00025   /* The size of the type that will be used in a system call.  */
00026   int size_pointer;
00027   int size__old_kernel_stat;
00028   int size_tms;
00029   int size_loff_t;
00030   int size_flock;
00031   int size_oldold_utsname;
00032   int size_ustat;
00033   int size_old_sigaction;
00034   int size_old_sigset_t;
00035   int size_rlimit;
00036   int size_rusage;
00037   int size_timeval;
00038   int size_timezone;
00039   int size_old_gid_t;
00040   int size_old_uid_t;
00041   int size_fd_set;
00042   int size_dirent;
00043   int size_dirent64;
00044   int size_statfs;
00045   int size_statfs64;
00046   int size_sockaddr;
00047   int size_int;
00048   int size_long;
00049   int size_ulong;
00050   int size_msghdr;
00051   int size_itimerval;
00052   int size_stat;
00053   int size_old_utsname;
00054   int size_sysinfo;
00055   int size_msqid_ds;
00056   int size_shmid_ds;
00057   int size_new_utsname;
00058   int size_timex;
00059   int size_mem_dqinfo;
00060   int size_if_dqblk;
00061   int size_fs_quota_stat;
00062   int size_timespec;
00063   int size_pollfd;
00064   int size_NFS_FHSIZE;
00065   int size_knfsd_fh;
00066   int size_TASK_COMM_LEN;
00067   int size_sigaction;
00068   int size_sigset_t;
00069   int size_siginfo_t;
00070   int size_cap_user_data_t;
00071   int size_stack_t;
00072   int size_off_t;
00073   int size_stat64;
00074   int size_gid_t;
00075   int size_uid_t;
00076   int size_PAGE_SIZE;
00077   int size_flock64;
00078   int size_user_desc;
00079   int size_io_event;
00080   int size_iocb;
00081   int size_epoll_event;
00082   int size_itimerspec;
00083   int size_mq_attr;
00084   int size_siginfo;
00085   int size_termios;
00086   int size_termios2;
00087   int size_pid_t;
00088   int size_winsize;
00089   int size_serial_struct;
00090   int size_serial_icounter_struct;
00091   int size_hayes_esp_config;
00092   int size_size_t;
00093   int size_iovec;
00094 
00095   /* The values of the second argument of system call "sys_ioctl".  */
00096   int ioctl_TCGETS;
00097   int ioctl_TCSETS;
00098   int ioctl_TCSETSW;
00099   int ioctl_TCSETSF;
00100   int ioctl_TCGETA;
00101   int ioctl_TCSETA;
00102   int ioctl_TCSETAW;
00103   int ioctl_TCSETAF;
00104   int ioctl_TCSBRK;
00105   int ioctl_TCXONC;
00106   int ioctl_TCFLSH;
00107   int ioctl_TIOCEXCL;
00108   int ioctl_TIOCNXCL;
00109   int ioctl_TIOCSCTTY;
00110   int ioctl_TIOCGPGRP;
00111   int ioctl_TIOCSPGRP;
00112   int ioctl_TIOCOUTQ;
00113   int ioctl_TIOCSTI;
00114   int ioctl_TIOCGWINSZ;
00115   int ioctl_TIOCSWINSZ;
00116   int ioctl_TIOCMGET;
00117   int ioctl_TIOCMBIS;
00118   int ioctl_TIOCMBIC;
00119   int ioctl_TIOCMSET;
00120   int ioctl_TIOCGSOFTCAR;
00121   int ioctl_TIOCSSOFTCAR;
00122   int ioctl_FIONREAD;
00123   int ioctl_TIOCINQ;
00124   int ioctl_TIOCLINUX;
00125   int ioctl_TIOCCONS;
00126   int ioctl_TIOCGSERIAL;
00127   int ioctl_TIOCSSERIAL;
00128   int ioctl_TIOCPKT;
00129   int ioctl_FIONBIO;
00130   int ioctl_TIOCNOTTY;
00131   int ioctl_TIOCSETD;
00132   int ioctl_TIOCGETD;
00133   int ioctl_TCSBRKP;
00134   int ioctl_TIOCTTYGSTRUCT;
00135   int ioctl_TIOCSBRK;
00136   int ioctl_TIOCCBRK;
00137   int ioctl_TIOCGSID;
00138   int ioctl_TCGETS2;
00139   int ioctl_TCSETS2;
00140   int ioctl_TCSETSW2;
00141   int ioctl_TCSETSF2;
00142   int ioctl_TIOCGPTN;
00143   int ioctl_TIOCSPTLCK;
00144   int ioctl_FIONCLEX;
00145   int ioctl_FIOCLEX;
00146   int ioctl_FIOASYNC;
00147   int ioctl_TIOCSERCONFIG;
00148   int ioctl_TIOCSERGWILD;
00149   int ioctl_TIOCSERSWILD;
00150   int ioctl_TIOCGLCKTRMIOS;
00151   int ioctl_TIOCSLCKTRMIOS;
00152   int ioctl_TIOCSERGSTRUCT;
00153   int ioctl_TIOCSERGETLSR;
00154   int ioctl_TIOCSERGETMULTI;
00155   int ioctl_TIOCSERSETMULTI;
00156   int ioctl_TIOCMIWAIT;
00157   int ioctl_TIOCGICOUNT;
00158   int ioctl_TIOCGHAYESESP;
00159   int ioctl_TIOCSHAYESESP;
00160   int ioctl_FIOQSIZE;
00161 
00162   /* The values of the second argument of system call "sys_fcntl"
00163      and "sys_fcntl64".  */
00164   int fcntl_F_GETLK;
00165   int fcntl_F_GETLK64;
00166   int fcntl_F_SETLK64;
00167   int fcntl_F_SETLKW64;
00168 
00169   /* The number of the registers that are used as the arguments of
00170      a system call.  */
00171   int arg1;
00172   int arg2;
00173   int arg3;
00174   int arg4;
00175   int arg5;
00176   int arg6;
00177 };
00178 
00179 /* Enum that defines the gdb-canonical set of Linux syscall identifiers.
00180    Different architectures will have different sets of syscall ids, and
00181    each must provide a mapping from their set to this one.  */
00182 
00183 enum gdb_syscall {
00184   gdb_sys_restart_syscall = 0,
00185   gdb_sys_exit = 1,
00186   gdb_sys_fork = 2,
00187   gdb_sys_read = 3,
00188   gdb_sys_write = 4,
00189   gdb_sys_open = 5,
00190   gdb_sys_close = 6,
00191   gdb_sys_waitpid = 7,
00192   gdb_sys_creat = 8,
00193   gdb_sys_link = 9,
00194   gdb_sys_unlink = 10,
00195   gdb_sys_execve = 11,
00196   gdb_sys_chdir = 12,
00197   gdb_sys_time = 13,
00198   gdb_sys_mknod = 14,
00199   gdb_sys_chmod = 15,
00200   gdb_sys_lchown16 = 16,
00201   gdb_sys_ni_syscall17 = 17,
00202   gdb_sys_stat = 18,
00203   gdb_sys_lseek = 19,
00204   gdb_sys_getpid = 20,
00205   gdb_sys_mount = 21,
00206   gdb_sys_oldumount = 22,
00207   gdb_sys_setuid16 = 23,
00208   gdb_sys_getuid16 = 24,
00209   gdb_sys_stime = 25,
00210   gdb_sys_ptrace = 26,
00211   gdb_sys_alarm = 27,
00212   gdb_sys_fstat = 28,
00213   gdb_sys_pause = 29,
00214   gdb_sys_utime = 30,
00215   gdb_sys_ni_syscall31 = 31,
00216   gdb_sys_ni_syscall32 = 32,
00217   gdb_sys_access = 33,
00218   gdb_sys_nice = 34,
00219   gdb_sys_ni_syscall35 = 35,
00220   gdb_sys_sync = 36,
00221   gdb_sys_kill = 37,
00222   gdb_sys_rename = 38,
00223   gdb_sys_mkdir = 39,
00224   gdb_sys_rmdir = 40,
00225   gdb_sys_dup = 41,
00226   gdb_sys_pipe = 42,
00227   gdb_sys_times = 43,
00228   gdb_sys_ni_syscall44 = 44,
00229   gdb_sys_brk = 45,
00230   gdb_sys_setgid16 = 46,
00231   gdb_sys_getgid16 = 47,
00232   gdb_sys_signal = 48,
00233   gdb_sys_geteuid16 = 49,
00234   gdb_sys_getegid16 = 50,
00235   gdb_sys_acct = 51,
00236   gdb_sys_umount = 52,
00237   gdb_sys_ni_syscall53 = 53,
00238   gdb_sys_ioctl = 54,
00239   gdb_sys_fcntl = 55,
00240   gdb_sys_ni_syscall56 = 56,
00241   gdb_sys_setpgid = 57,
00242   gdb_sys_ni_syscall58 = 58,
00243   gdb_sys_olduname = 59,
00244   gdb_sys_umask = 60,
00245   gdb_sys_chroot = 61,
00246   gdb_sys_ustat = 62,
00247   gdb_sys_dup2 = 63,
00248   gdb_sys_getppid = 64,
00249   gdb_sys_getpgrp = 65,
00250   gdb_sys_setsid = 66,
00251   gdb_sys_sigaction = 67,
00252   gdb_sys_sgetmask = 68,
00253   gdb_sys_ssetmask = 69,
00254   gdb_sys_setreuid16 = 70,
00255   gdb_sys_setregid16 = 71,
00256   gdb_sys_sigsuspend = 72,
00257   gdb_sys_sigpending = 73,
00258   gdb_sys_sethostname = 74,
00259   gdb_sys_setrlimit = 75,
00260   gdb_sys_old_getrlimit = 76,
00261   gdb_sys_getrusage = 77,
00262   gdb_sys_gettimeofday = 78,
00263   gdb_sys_settimeofday = 79,
00264   gdb_sys_getgroups16 = 80,
00265   gdb_sys_setgroups16 = 81,
00266   gdb_old_select = 82,
00267   gdb_sys_symlink = 83,
00268   gdb_sys_lstat = 84,
00269   gdb_sys_readlink = 85,
00270   gdb_sys_uselib = 86,
00271   gdb_sys_swapon = 87,
00272   gdb_sys_reboot = 88,
00273   gdb_old_readdir = 89,
00274   gdb_old_mmap = 90,
00275   gdb_sys_munmap = 91,
00276   gdb_sys_truncate = 92,
00277   gdb_sys_ftruncate = 93,
00278   gdb_sys_fchmod = 94,
00279   gdb_sys_fchown16 = 95,
00280   gdb_sys_getpriority = 96,
00281   gdb_sys_setpriority = 97,
00282   gdb_sys_ni_syscall98 = 98,
00283   gdb_sys_statfs = 99,
00284   gdb_sys_fstatfs = 100,
00285   gdb_sys_ioperm = 101,
00286   gdb_sys_socketcall = 102,
00287   gdb_sys_syslog = 103,
00288   gdb_sys_setitimer = 104,
00289   gdb_sys_getitimer = 105,
00290   gdb_sys_newstat = 106,
00291   gdb_sys_newlstat = 107,
00292   gdb_sys_newfstat = 108,
00293   gdb_sys_uname = 109,
00294   gdb_sys_iopl = 110,
00295   gdb_sys_vhangup = 111,
00296   gdb_sys_ni_syscall112 = 112,
00297   gdb_sys_vm86old = 113,
00298   gdb_sys_wait4 = 114,
00299   gdb_sys_swapoff = 115,
00300   gdb_sys_sysinfo = 116,
00301   gdb_sys_ipc = 117,
00302   gdb_sys_fsync = 118,
00303   gdb_sys_sigreturn = 119,
00304   gdb_sys_clone = 120,
00305   gdb_sys_setdomainname = 121,
00306   gdb_sys_newuname = 122,
00307   gdb_sys_modify_ldt = 123,
00308   gdb_sys_adjtimex = 124,
00309   gdb_sys_mprotect = 125,
00310   gdb_sys_sigprocmask = 126,
00311   gdb_sys_ni_syscall127 = 127,
00312   gdb_sys_init_module = 128,
00313   gdb_sys_delete_module = 129,
00314   gdb_sys_ni_syscall130 = 130,
00315   gdb_sys_quotactl = 131,
00316   gdb_sys_getpgid = 132,
00317   gdb_sys_fchdir = 133,
00318   gdb_sys_bdflush = 134,
00319   gdb_sys_sysfs = 135,
00320   gdb_sys_personality = 136,
00321   gdb_sys_ni_syscall137 = 137,
00322   gdb_sys_setfsuid16 = 138,
00323   gdb_sys_setfsgid16 = 139,
00324   gdb_sys_llseek = 140,
00325   gdb_sys_getdents = 141,
00326   gdb_sys_select = 142,
00327   gdb_sys_flock = 143,
00328   gdb_sys_msync = 144,
00329   gdb_sys_readv = 145,
00330   gdb_sys_writev = 146,
00331   gdb_sys_getsid = 147,
00332   gdb_sys_fdatasync = 148,
00333   gdb_sys_sysctl = 149,
00334   gdb_sys_mlock = 150,
00335   gdb_sys_munlock = 151,
00336   gdb_sys_mlockall = 152,
00337   gdb_sys_munlockall = 153,
00338   gdb_sys_sched_setparam = 154,
00339   gdb_sys_sched_getparam = 155,
00340   gdb_sys_sched_setscheduler = 156,
00341   gdb_sys_sched_getscheduler = 157,
00342   gdb_sys_sched_yield = 158,
00343   gdb_sys_sched_get_priority_max = 159,
00344   gdb_sys_sched_get_priority_min = 160,
00345   gdb_sys_sched_rr_get_interval = 161,
00346   gdb_sys_nanosleep = 162,
00347   gdb_sys_mremap = 163,
00348   gdb_sys_setresuid16 = 164,
00349   gdb_sys_getresuid16 = 165,
00350   gdb_sys_vm86 = 166,
00351   gdb_sys_ni_syscall167 = 167,
00352   gdb_sys_poll = 168,
00353   gdb_sys_nfsservctl = 169,
00354   gdb_sys_setresgid16 = 170,
00355   gdb_sys_getresgid16 = 171,
00356   gdb_sys_prctl = 172,
00357   gdb_sys_rt_sigreturn = 173,
00358   gdb_sys_rt_sigaction = 174,
00359   gdb_sys_rt_sigprocmask = 175,
00360   gdb_sys_rt_sigpending = 176,
00361   gdb_sys_rt_sigtimedwait = 177,
00362   gdb_sys_rt_sigqueueinfo = 178,
00363   gdb_sys_rt_sigsuspend = 179,
00364   gdb_sys_pread64 = 180,
00365   gdb_sys_pwrite64 = 181,
00366   gdb_sys_chown16 = 182,
00367   gdb_sys_getcwd = 183,
00368   gdb_sys_capget = 184,
00369   gdb_sys_capset = 185,
00370   gdb_sys_sigaltstack = 186,
00371   gdb_sys_sendfile = 187,
00372   gdb_sys_ni_syscall188 = 188,
00373   gdb_sys_ni_syscall189 = 189,
00374   gdb_sys_vfork = 190,
00375   gdb_sys_getrlimit = 191,
00376   gdb_sys_mmap2 = 192,
00377   gdb_sys_truncate64 = 193,
00378   gdb_sys_ftruncate64 = 194,
00379   gdb_sys_stat64 = 195,
00380   gdb_sys_lstat64 = 196,
00381   gdb_sys_fstat64 = 197,
00382   gdb_sys_lchown = 198,
00383   gdb_sys_getuid = 199,
00384   gdb_sys_getgid = 200,
00385   gdb_sys_geteuid = 201,
00386   gdb_sys_getegid = 202,
00387   gdb_sys_setreuid = 203,
00388   gdb_sys_setregid = 204,
00389   gdb_sys_getgroups = 205,
00390   gdb_sys_setgroups = 206,
00391   gdb_sys_fchown = 207,
00392   gdb_sys_setresuid = 208,
00393   gdb_sys_getresuid = 209,
00394   gdb_sys_setresgid = 210,
00395   gdb_sys_getresgid = 211,
00396   gdb_sys_chown = 212,
00397   gdb_sys_setuid = 213,
00398   gdb_sys_setgid = 214,
00399   gdb_sys_setfsuid = 215,
00400   gdb_sys_setfsgid = 216,
00401   gdb_sys_pivot_root = 217,
00402   gdb_sys_mincore = 218,
00403   gdb_sys_madvise = 219,
00404   gdb_sys_getdents64 = 220,
00405   gdb_sys_fcntl64 = 221,
00406   gdb_sys_ni_syscall222 = 222,
00407   gdb_sys_ni_syscall223 = 223,
00408   gdb_sys_gettid = 224,
00409   gdb_sys_readahead = 225,
00410   gdb_sys_setxattr = 226,
00411   gdb_sys_lsetxattr = 227,
00412   gdb_sys_fsetxattr = 228,
00413   gdb_sys_getxattr = 229,
00414   gdb_sys_lgetxattr = 230,
00415   gdb_sys_fgetxattr = 231,
00416   gdb_sys_listxattr = 232,
00417   gdb_sys_llistxattr = 233,
00418   gdb_sys_flistxattr = 234,
00419   gdb_sys_removexattr = 235,
00420   gdb_sys_lremovexattr = 236,
00421   gdb_sys_fremovexattr = 237,
00422   gdb_sys_tkill = 238,
00423   gdb_sys_sendfile64 = 239,
00424   gdb_sys_futex = 240,
00425   gdb_sys_sched_setaffinity = 241,
00426   gdb_sys_sched_getaffinity = 242,
00427   gdb_sys_set_thread_area = 243,
00428   gdb_sys_get_thread_area = 244,
00429   gdb_sys_io_setup = 245,
00430   gdb_sys_io_destroy = 246,
00431   gdb_sys_io_getevents = 247,
00432   gdb_sys_io_submit = 248,
00433   gdb_sys_io_cancel = 249,
00434   gdb_sys_fadvise64 = 250,
00435   gdb_sys_ni_syscall251 = 251,
00436   gdb_sys_exit_group = 252,
00437   gdb_sys_lookup_dcookie = 253,
00438   gdb_sys_epoll_create = 254,
00439   gdb_sys_epoll_ctl = 255,
00440   gdb_sys_epoll_wait = 256,
00441   gdb_sys_remap_file_pages = 257,
00442   gdb_sys_set_tid_address = 258,
00443   gdb_sys_timer_create = 259,
00444   gdb_sys_timer_settime = 260,
00445   gdb_sys_timer_gettime = 261,
00446   gdb_sys_timer_getoverrun = 262,
00447   gdb_sys_timer_delete = 263,
00448   gdb_sys_clock_settime = 264,
00449   gdb_sys_clock_gettime = 265,
00450   gdb_sys_clock_getres = 266,
00451   gdb_sys_clock_nanosleep = 267,
00452   gdb_sys_statfs64 = 268,
00453   gdb_sys_fstatfs64 = 269,
00454   gdb_sys_tgkill = 270,
00455   gdb_sys_utimes = 271,
00456   gdb_sys_fadvise64_64 = 272,
00457   gdb_sys_ni_syscall273 = 273,
00458   gdb_sys_mbind = 274,
00459   gdb_sys_get_mempolicy = 275,
00460   gdb_sys_set_mempolicy = 276,
00461   gdb_sys_mq_open = 277,
00462   gdb_sys_mq_unlink = 278,
00463   gdb_sys_mq_timedsend = 279,
00464   gdb_sys_mq_timedreceive = 280,
00465   gdb_sys_mq_notify = 281,
00466   gdb_sys_mq_getsetattr = 282,
00467   gdb_sys_kexec_load = 283,
00468   gdb_sys_waitid = 284,
00469   gdb_sys_ni_syscall285 = 285,
00470   gdb_sys_add_key = 286,
00471   gdb_sys_request_key = 287,
00472   gdb_sys_keyctl = 288,
00473   gdb_sys_ioprio_set = 289,
00474   gdb_sys_ioprio_get = 290,
00475   gdb_sys_inotify_init = 291,
00476   gdb_sys_inotify_add_watch = 292,
00477   gdb_sys_inotify_rm_watch = 293,
00478   gdb_sys_migrate_pages = 294,
00479   gdb_sys_openat = 295,
00480   gdb_sys_mkdirat = 296,
00481   gdb_sys_mknodat = 297,
00482   gdb_sys_fchownat = 298,
00483   gdb_sys_futimesat = 299,
00484   gdb_sys_fstatat64 = 300,
00485   gdb_sys_unlinkat = 301,
00486   gdb_sys_renameat = 302,
00487   gdb_sys_linkat = 303,
00488   gdb_sys_symlinkat = 304,
00489   gdb_sys_readlinkat = 305,
00490   gdb_sys_fchmodat = 306,
00491   gdb_sys_faccessat = 307,
00492   gdb_sys_pselect6 = 308,
00493   gdb_sys_ppoll = 309,
00494   gdb_sys_unshare = 310,
00495   gdb_sys_set_robust_list = 311,
00496   gdb_sys_get_robust_list = 312,
00497   gdb_sys_splice = 313,
00498   gdb_sys_sync_file_range = 314,
00499   gdb_sys_tee = 315,
00500   gdb_sys_vmsplice = 316,
00501   gdb_sys_move_pages = 317,
00502   gdb_sys_getcpu = 318,
00503   gdb_sys_epoll_pwait = 319,
00504   gdb_sys_socket = 500,
00505   gdb_sys_connect = 501,
00506   gdb_sys_accept = 502,
00507   gdb_sys_sendto = 503,
00508   gdb_sys_recvfrom = 504,
00509   gdb_sys_sendmsg = 505,
00510   gdb_sys_recvmsg = 506,
00511   gdb_sys_shutdown = 507,
00512   gdb_sys_bind = 508,
00513   gdb_sys_listen = 509,
00514   gdb_sys_getsockname = 510,
00515   gdb_sys_getpeername = 511,
00516   gdb_sys_socketpair = 512,
00517   gdb_sys_setsockopt = 513,
00518   gdb_sys_getsockopt = 514,
00519   gdb_sys_recv = 515,
00520   gdb_sys_shmget = 520,
00521   gdb_sys_shmat = 521,
00522   gdb_sys_shmctl = 522,
00523   gdb_sys_semget = 523,
00524   gdb_sys_semop = 524,
00525   gdb_sys_semctl = 525,
00526   gdb_sys_shmdt = 527,
00527   gdb_sys_msgget = 528,
00528   gdb_sys_msgsnd = 529,
00529   gdb_sys_msgrcv = 530,
00530   gdb_sys_msgctl = 531,
00531   gdb_sys_semtimedop = 532,
00532   gdb_sys_newfstatat = 540,
00533 };
00534 
00535 /* Record a linux syscall.  */
00536 
00537 extern int record_linux_system_call (enum gdb_syscall num, 
00538                                      struct regcache *regcache,
00539                                      struct linux_record_tdep *tdep);
00540 #endif /* _LINUX_RECORD_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines