2 /*--------------------------------------------------------------------*/
3 /*--- Header included by every core C file. pub_core_basics.h ---*/
4 /*--------------------------------------------------------------------*/
7 This file is part of Valgrind, a dynamic binary instrumentation
10 Copyright (C) 2000-2017 Julian Seward
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.
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.
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
28 The GNU General Public License is contained in the file COPYING.
31 #ifndef __PUB_CORE_BASICS_H
32 #define __PUB_CORE_BASICS_H
34 //--------------------------------------------------------------------
35 // PURPOSE: This header should be imported by every single C file
36 // in the core. It contains the basic types and other things needed
38 //--------------------------------------------------------------------
40 #include "pub_tool_basics.h"
42 /* ---------------------------------------------------------------------
43 A struct to hold starting values for stack unwinding.
44 ------------------------------------------------------------------ */
46 /* This really shouldn't be here. But putting it elsewhere leads to a
47 veritable swamp of new module cycles. */
49 /* To support CFA-based stack unwinding, and stack unwinding in
50 general, we need to be able to get hold of the values of specific
51 registers, in order to start the unwinding process. This is
52 unavoidably arch and platform dependent. Here is a struct which
53 holds the relevant values. All platforms must have a program
54 counter and a stack pointer register, but the other fields (frame
55 pointer? link register? misc other regs?) are ad-hoc. Note, the
56 common fields are 64-bit, so as to make this host-independent. */
60 ULong r_pc
; /* x86:EIP, amd64:RIP, ppc:CIA, arm:R15, mips:pc */
61 ULong r_sp
; /* x86:ESP, amd64:RSP, ppc:R1, arm:R13, mips:sp */
98 UInt r30
; /* Stack frame pointer or subroutine variable */
99 UInt r31
; /* Return address of the last subroutine call */
103 ULong r30
; /* Stack frame pointer or subroutine variable */
104 ULong r31
; /* Return address of the last subroutine call */
112 #endif // __PUB_CORE_BASICS_H
114 /*--------------------------------------------------------------------*/
116 /*--------------------------------------------------------------------*/