blob: ec7a347cb3204d99a7ce488c1df1991318276db9 [file] [log] [blame]
sewardj45f4e7c2005-09-27 19:20:21 +00001
2/*--------------------------------------------------------------------*/
3/*--- Misc client state info pub_core_clientstate.h ---*/
4/*--------------------------------------------------------------------*/
5
6/*
7 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
9
10 Copyright (C) 2000-2005 Julian Seward
11 jseward@acm.org
12
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26 02111-1307, USA.
27
28 The GNU General Public License is contained in the file COPYING.
29*/
30
31#ifndef __PUB_CORE_CLIENTSTATE_H
32#define __PUB_CORE_CLIENTSTATE_H
33
34//--------------------------------------------------------------------
35// PURPOSE: This module holds various bits of client state which don't
36// live comfortably anywhere else. Note that the ThreadStates for the
37// client don't live here; they instead live in m_threadstate.h.
38//--------------------------------------------------------------------
39
40#include "pub_tool_clientstate.h"
41
42// Address space globals
43
44extern Addr VG_(client_base); // client address space limits
45extern Addr VG_(client_end);
46
47extern Addr VG_(clstk_base); // client stack range
48extern Addr VG_(clstk_end);
49extern UWord VG_(clstk_id); // client stack id
50
51extern Addr VG_(brk_base); // start of brk
52extern Addr VG_(brk_limit); // current brk
53
54/* A fd which refers to the client executable. */
55extern Int VG_(cl_exec_fd);
56
57/* A fd which refers to the fake /proc/<pid>/cmdline in /tmp. The
58 idea is: make up the /proc/<pid>/cmdline file the client would
59 expect to see if it was running natively. Copy into a file in
60 /tmp. When the client then does an open of /proc/<pid>/cmdline or
61 /proc/self/cmdline, instead give it a file handle to the file in
62 /tmp. The problem of deleting said file when Valgrind exits is
63 neatly sidestepped by unlinking it as soon as it has been created,
64 but holding on to the file handle. That causes the kernel to keep
65 the file contents alive exactly until the process exits. */
66extern Int VG_(cl_cmdline_fd);
67
68// Client's original rlimit data and rlimit stack
69extern struct vki_rlimit VG_(client_rlimit_data);
70extern struct vki_rlimit VG_(client_rlimit_stack);
71
72// Name of the launcher, as extracted from VALGRIND_LAUNCHER at
73// startup.
74extern HChar* VG_(name_of_launcher);
75
76
77#endif // __PUB_CORE_CLIENTSTATE_H
78
79/*--------------------------------------------------------------------*/
80/*--- end ---*/
81/*--------------------------------------------------------------------*/