~ubuntu-branches/debian/sid/valgrind/sid

« back to all changes in this revision

Viewing changes to coregrind/pub_core_ume.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrés Roldán
  • Date: 2008-06-13 02:31:40 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080613023140-rezbg9gtvybimy2q
Tags: 1:3.3.1-2
* debian/rules:
  - Forgot to copy debian-libc6-dbg.supp to /usr/lib/valgrind. 
    (Closes: #486021)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
   This file is part of Valgrind, a dynamic binary instrumentation
8
8
   framework.
9
9
 
10
 
   Copyright (C) 2000-2006 Julian Seward 
 
10
   Copyright (C) 2000-2007 Julian Seward 
11
11
      jseward@acm.org
12
12
 
13
13
   This program is free software; you can redistribute it and/or
33
33
 
34
34
//--------------------------------------------------------------------
35
35
// PURPOSE: This module implements user-mode execve, ie. program loading
36
 
// and exec'ing.  It is shared between stage1 and stage2.
 
36
// and exec'ing.
37
37
//--------------------------------------------------------------------
38
38
 
39
 
#include <elf.h>
40
 
#include <sys/types.h>
41
 
 
42
 
/*------------------------------------------------------------*/
43
 
/*--- General stuff                                        ---*/
44
 
/*------------------------------------------------------------*/
45
 
 
46
 
/* This is only here so it can be shared between stage1 and stage2 */
47
 
 
48
 
/* JRS 9 Aug 05: both of these are apparently unused, except by
49
 
   memcheck/tests/vgtest_ume.c. */
50
 
//zz extern
51
 
//zz void VG_(foreach_map)(int (*fn)(char *start, char *end,
52
 
//zz                            const char *perm, off_t offset,
53
 
//zz                            int maj, int min, int ino, void* extra),
54
 
//zz                       void* extra);
55
 
//zz 
56
 
//zz /* Jump to 'dst', but first set the stack pointer to 'stack'.  Also,
57
 
//zz    clear all the integer registers before entering 'dst'.  It's
58
 
//zz    important that the stack pointer is set to exactly 'stack' and not
59
 
//zz    (eg) stack - apparently_harmless_looking_small_offset.  Basically
60
 
//zz    because the code at 'dst' might be wanting to scan the area above
61
 
//zz    'stack' (viz, the auxv array), and putting spurious words on the
62
 
//zz    stack confuses it.
63
 
//zz 
64
 
//zz    This is only exported so that vgtest_ume.c can use it.
65
 
//zz */
66
 
//zz extern
67
 
//zz __attribute__((noreturn))
68
 
//zz void VG_(jump_and_switch_stacks) ( Addr stack, Addr dst );
69
 
 
70
 
 
71
39
/*------------------------------------------------------------*/
72
40
/*--- Loading ELF files                                    ---*/
73
41
/*------------------------------------------------------------*/
101
69
// the kernel: ie. it's a file, it's readable and executable, and it's in
102
70
// either ELF or "#!" format.  On success, 'out_fd' gets the fd of the file
103
71
// if it's non-NULL.  Otherwise the fd is closed.
104
 
extern SysRes VG_(pre_exec_check)(const HChar* exe_name, Int* out_fd);
 
72
extern SysRes VG_(pre_exec_check)(const HChar* exe_name, Int* out_fd,
 
73
                                  Bool allow_setuid);
105
74
 
106
75
// Does everything short of actually running 'exe': finds the file,
107
76
// checks execute permissions, sets up interpreter if program is a script,