File: PlatformCommon.h

package info (click to toggle)
edb-debugger 1.3.0-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,124 kB
  • sloc: cpp: 46,241; xml: 4,998; ansic: 3,088; sh: 52; asm: 33; makefile: 5
file content (99 lines) | stat: -rw-r--r-- 2,941 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
Copyright (C) 2015 - 2015 Evan Teran
                          evan.teran@gmail.com

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef PLATFORM_COMMON_H_20151011_
#define PLATFORM_COMMON_H_20151011_

#include "OSTypes.h"
#include "edb.h"

class QString;

namespace DebuggerCorePlugin {

struct user_stat {
	/* 01 */ int pid;
	/* 02 */ char comm[256];
	/* 03 */ char state;
	/* 04 */ int ppid;
	/* 05 */ int pgrp;
	/* 06 */ int session;
	/* 07 */ int tty_nr;
	/* 08 */ int tpgid;
	/* 09 */ unsigned flags;
	/* 10 */ unsigned long long minflt;
	/* 11 */ unsigned long long cminflt;
	/* 12 */ unsigned long long majflt;
	/* 13 */ unsigned long long cmajflt;
	/* 14 */ unsigned long long utime;
	/* 15 */ unsigned long long stime;
	/* 16 */ long long cutime;
	/* 17 */ long long cstime;
	/* 18 */ long long priority;
	/* 19 */ long long nice;
	/* 20 */ long long num_threads;
	/* 21 */ long long itrealvalue;
	/* 22 */ unsigned long long starttime;
	/* 23 */ unsigned long long vsize;
	/* 24 */ long long rss;
	/* 25 */ unsigned long long rsslim;
	/* 26 */ unsigned long long startcode;
	/* 27 */ unsigned long long endcode;
	/* 28 */ unsigned long long startstack;
	/* 29 */ unsigned long long kstkesp;
	/* 30 */ unsigned long long kstkeip;
	/* 31 */ unsigned long long signal;
	/* 32 */ unsigned long long blocked;
	/* 33 */ unsigned long long sigignore;
	/* 34 */ unsigned long long sigcatch;
	/* 35 */ unsigned long long wchan;
	/* 36 */ unsigned long long nswap;
	/* 37 */ unsigned long long cnswap;
	/* 38 */ int exit_signal;
	/* 39 */ int processor;
	/* 40 */ unsigned rt_priority;
	/* 41 */ unsigned policy;

	// Linux 2.6.18
	/* 42 */ unsigned long long delayacct_blkio_ticks;

	// Linux 2.6.24
	/* 43 */ unsigned long long guest_time;
	/* 44 */ long long cguest_time;

	// Linux 3.3
	/* 45 */ unsigned long long start_data;
	/* 46 */ unsigned long long end_data;
	/* 47 */ unsigned long long start_brk;

	// Linux 3.5
	/* 48 */ unsigned long long arg_start;
	/* 49 */ unsigned long long arg_end;
	/* 50 */ unsigned long long env_start;
	/* 51 */ unsigned long long env_end;
	/* 52 */ int exit_code;
};

int get_user_stat(const char *path, struct user_stat *user_stat);
int get_user_stat(edb::pid_t pid, struct user_stat *user_stat);
int get_user_task_stat(edb::pid_t pid, edb::tid_t tid, struct user_stat *user_stat);
int resume_code(int status);

}

#endif