|
From: <sv...@va...> - 2005-06-10 23:09:53
|
Author: njn
Date: 2005-06-11 00:09:45 +0100 (Sat, 11 Jun 2005)
New Revision: 3873
Log:
Killed coregrind/$ARCH/core_arch.h. Moved the relevant pieces into core.=
h
for the moment.
Removed:
trunk/coregrind/amd64/core_arch.h
trunk/coregrind/arm/core_arch.h
trunk/coregrind/x86/core_arch.h
Modified:
trunk/coregrind/amd64/Makefile.am
trunk/coregrind/arm/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/x86/Makefile.am
Modified: trunk/coregrind/amd64/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/amd64/Makefile.am 2005-06-10 22:59:56 UTC (rev 3872)
+++ trunk/coregrind/amd64/Makefile.am 2005-06-10 23:09:45 UTC (rev 3873)
@@ -1,9 +1,6 @@
include $(top_srcdir)/Makefile.all.am
include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
=20
-noinst_HEADERS =3D \
- core_arch.h
-
noinst_LIBRARIES =3D libarch.a
=20
EXTRA_DIST =3D \
Deleted: trunk/coregrind/amd64/core_arch.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/amd64/core_arch.h 2005-06-10 22:59:56 UTC (rev 3872)
+++ trunk/coregrind/amd64/core_arch.h 2005-06-10 23:09:45 UTC (rev 3873)
@@ -1,62 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Arch-specific stuff for the core. amd64/core_arch.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Nicholas Nethercote
- nj...@va...
-
- 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, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#ifndef __AMD64_CORE_ARCH_H
-#define __AMD64_CORE_ARCH_H
-
-#include "libvex.h"
-#include "libvex_guest_amd64.h"
-
-/* ---------------------------------------------------------------------
- Basic properties
- ------------------------------------------------------------------ */
-
-#define VGA_ELF_ENDIANNESS ELFDATA2LSB
-#define VGA_ELF_MACHINE EM_X86_64
-#define VGA_ELF_CLASS ELFCLASS64
-
-/* ---------------------------------------------------------------------
- Interesting registers
- ------------------------------------------------------------------ */
-
-// Vex field names
-#define VGA_INSTR_PTR guest_RIP
-#define VGA_STACK_PTR guest_RSP
-#define VGA_FRAME_PTR guest_RBP
-
-#define VGA_CLREQ_ARGS guest_RAX
-#define VGA_CLREQ_RET guest_RDX
-
-#endif // __AMD64_CORE_ARCH_H
-
-/*--------------------------------------------------------------------*/
-/*--- end ---*/
-/*--------------------------------------------------------------------*/
-
Modified: trunk/coregrind/arm/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/arm/Makefile.am 2005-06-10 22:59:56 UTC (rev 3872)
+++ trunk/coregrind/arm/Makefile.am 2005-06-10 23:09:45 UTC (rev 3873)
@@ -1,9 +1,6 @@
include $(top_srcdir)/Makefile.all.am
include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
=20
-noinst_HEADERS =3D \
- core_arch.h
-
noinst_LIBRARIES =3D libarch.a
=20
EXTRA_DIST =3D \
Deleted: trunk/coregrind/arm/core_arch.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/arm/core_arch.h 2005-06-10 22:59:56 UTC (rev 3872)
+++ trunk/coregrind/arm/core_arch.h 2005-06-10 23:09:45 UTC (rev 3873)
@@ -1,66 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Arch-specific stuff for the core. arm/core_arch.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Nicholas Nethercote
- nj...@va...
-
- 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, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#ifndef __ARM_CORE_ARCH_H
-#define __ARM_CORE_ARCH_H
-
-#include "libvex.h"
-#include "libvex_guest_arm.h"
-
-/* ---------------------------------------------------------------------
- Basic properties
- ------------------------------------------------------------------ */
-
-#define VGA_ELF_ENDIANNESS ELFDATA2LSB
-#define VGA_ELF_MACHINE EM_ARM
-#define VGA_ELF_CLASS ELFCLASS32
-
-/* ---------------------------------------------------------------------
- Interesting registers
- ------------------------------------------------------------------ */
-// Vex field names
-// XXX: Not sure, but I think:
-// r11 =3D frame pointer
-// r12 =3D "implicit parameter" (neither caller-save, nor callee-save)
-// r13 =3D stack pointer
-// r14 =3D link register
-// r15 =3D program counter
-#define VGA_INSTR_PTR guest_R15
-#define VGA_STACK_PTR guest_R13
-#define VGA_FRAME_PTR guest_R11
-
-#define VGA_CLREQ_ARGS guest_R0
-#define VGA_CLREQ_RET guest_R0
-
-#endif // __ARM_CORE_ARCH_H
-
-/*--------------------------------------------------------------------*/
-/*--- end ---*/
-/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-06-10 22:59:56 UTC (rev 3872)
+++ trunk/coregrind/core.h 2005-06-10 23:09:45 UTC (rev 3873)
@@ -33,12 +33,53 @@
#define __CORE_H
=20
#include "tool.h" // tool stuff
-#include "core_arch.h" // arch-specific stuff, eg. x86/core_arch.h
=20
+#include "libvex.h"
+#if defined(VGA_x86)
+#include "libvex_guest_x86.h"
+# define VGA_ELF_ENDIANNESS ELFDATA2LSB
+# define VGA_ELF_MACHINE EM_386
+# define VGA_ELF_CLASS ELFCLASS32
+# define VGA_INSTR_PTR guest_EIP
+# define VGA_STACK_PTR guest_ESP
+# define VGA_FRAME_PTR guest_EBP
+# define VGA_CLREQ_ARGS guest_EAX
+# define VGA_CLREQ_RET guest_EDX
+#elif defined(VGA_amd64)
+# define VGA_ELF_ENDIANNESS ELFDATA2LSB
+# define VGA_ELF_MACHINE EM_X86_64
+# define VGA_ELF_CLASS ELFCLASS64
+# define VGA_INSTR_PTR guest_RIP
+# define VGA_STACK_PTR guest_RSP
+# define VGA_FRAME_PTR guest_RBP
+# define VGA_CLREQ_ARGS guest_RAX
+# define VGA_CLREQ_RET guest_RDX
+#elif defined(VGA_arm)
+#define VGA_ELF_ENDIANNESS ELFDATA2LSB
+#define VGA_ELF_MACHINE EM_ARM
+#define VGA_ELF_CLASS ELFCLASS32
+ // XXX: Not sure, but I think:
+ // r11 =3D frame pointer
+ // r12 =3D "implicit parameter" (neither caller-save, nor callee-sa=
ve)
+ // r13 =3D stack pointer
+ // r14 =3D link register
+ // r15 =3D program counter
+# define VGA_INSTR_PTR guest_R15
+# define VGA_STACK_PTR guest_R13
+# define VGA_FRAME_PTR guest_R11
+# define VGA_CLREQ_ARGS guest_R0
+# define VGA_CLREQ_RET guest_R0
+#else
+# error Unknown arch
+#endif
+
+
+
+
#include <setjmp.h> // for jmp_buf
=20
#include "pub_core_mallocfree.h" // for type 'ArenaId'
-#include "pub_core_scheduler.h" // for types 'ThreadState', 'ThreadArc=
hState'
+#include "pub_core_scheduler.h" // for types 'ThreadArchState'
=20
/* ---------------------------------------------------------------------
Global macros.
@@ -158,6 +199,7 @@
// Returns False to indicate we cannot proceed further.
extern Bool VGA_(getArchAndSubArch)( /*OUT*/VexArch*,=20
/*OUT*/VexSubArch* );
+
// Accessors for the ThreadArchState
#define INSTR_PTR(regs) ((regs).vex.VGA_INSTR_PTR)
#define STACK_PTR(regs) ((regs).vex.VGA_STACK_PTR)
Modified: trunk/coregrind/x86/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/x86/Makefile.am 2005-06-10 22:59:56 UTC (rev 3872)
+++ trunk/coregrind/x86/Makefile.am 2005-06-10 23:09:45 UTC (rev 3873)
@@ -1,9 +1,6 @@
include $(top_srcdir)/Makefile.all.am
include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
=20
-noinst_HEADERS =3D \
- core_arch.h
-
noinst_LIBRARIES =3D libarch.a
=20
EXTRA_DIST =3D \
Deleted: trunk/coregrind/x86/core_arch.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/x86/core_arch.h 2005-06-10 22:59:56 UTC (rev 3872)
+++ trunk/coregrind/x86/core_arch.h 2005-06-10 23:09:45 UTC (rev 3873)
@@ -1,68 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Arch-specific stuff for the core. x86/core_arch.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Nicholas Nethercote
- nj...@va...
-
- 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, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#ifndef __X86_CORE_ARCH_H
-#define __X86_CORE_ARCH_H
-
-#include "libvex.h"
-#include "libvex_guest_x86.h"
-
-/* ---------------------------------------------------------------------
- Basic properties
- ------------------------------------------------------------------ */
-
-#define VGA_ELF_ENDIANNESS ELFDATA2LSB
-#define VGA_ELF_MACHINE EM_386
-#define VGA_ELF_CLASS ELFCLASS32
-
-/* ---------------------------------------------------------------------
- Interesting registers
- ------------------------------------------------------------------ */
-
-// Vex field names
-#define VGA_INSTR_PTR guest_EIP
-#define VGA_STACK_PTR guest_ESP
-#define VGA_FRAME_PTR guest_EBP
-
-#define VGA_CLREQ_ARGS guest_EAX
-#define VGA_CLREQ_RET guest_EDX
-
-//extern const Char VG_(helper_wrapper_before)[]; /* in dispatch.S */
-//extern const Char VG_(helper_wrapper_return)[]; /* in dispatch.S */
-
-//extern const Char VG_(helper_undefined_instruction)[];
-//extern const Char VG_(helper_INT)[];
-//extern const Char VG_(helper_breakpoint)[];
-
-#endif // __X86_CORE_ARCH_H
-
-/*--------------------------------------------------------------------*/
-/*--- end ---*/
-/*--------------------------------------------------------------------*/
|