|
From: <sv...@va...> - 2005-06-01 03:48:41
|
Author: njn
Date: 2005-06-01 04:48:33 +0100 (Wed, 01 Jun 2005)
New Revision: 3834
Modified:
trunk/coregrind/amd64/state.c
trunk/coregrind/core.h
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/pub_core_aspacemgr.h
trunk/coregrind/x86/state.c
Log:
Moved VGA_(pointercheck)() into ASpaceMgr.
Modified: trunk/coregrind/amd64/state.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/state.c 2005-06-01 03:09:59 UTC (rev 3833)
+++ trunk/coregrind/amd64/state.c 2005-06-01 03:48:33 UTC (rev 3834)
@@ -112,18 +112,6 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- pointercheck ---*/
-/*------------------------------------------------------------*/
-
-Bool VGA_(setup_pointercheck)(Addr client_base, Addr client_end)
-{
- vg_assert(0 !=3D client_end);
- if (0)=20
- VG_(message)(Vg_DebugMsg, "ignoring --pointercheck (unimplemented)=
");
- return True;
-}
-
-/*------------------------------------------------------------*/
/*--- Debugger-related operations ---*/
/*------------------------------------------------------------*/
=20
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-01 03:09:59 UTC (rev 3833)
+++ trunk/coregrind/core.h 2005-06-01 03:48:33 UTC (rev 3834)
@@ -278,9 +278,6 @@
// handle an arch-specific client request
extern Bool VGA_(client_request)(ThreadId tid, UWord *args);
=20
-// Pointercheck
-extern Bool VGA_(setup_pointercheck) ( Addr client_base, Addr client_end=
);
-
// For attaching the debugger
extern Int VGA_(ptrace_setregs_from_tst) ( Int pid, ThreadArchState* ar=
ch );
=20
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/m_aspacemgr/aspacemgr.c 2005-06-01 03:09:59 UTC (rev =
3833)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-01 03:48:33 UTC (rev =
3834)
@@ -1330,6 +1330,46 @@
VG_(exit)(1);
}
=20
+/*------------------------------------------------------------*/
+/*--- pointercheck ---*/
+/*------------------------------------------------------------*/
+
+Bool VGA_(setup_pointercheck)(Addr client_base, Addr client_end)
+{
+ vg_assert(0 !=3D client_end);
+#if defined(VGP_x86_linux)
+ /* Client address space segment limit descriptor entry */
+ #define POINTERCHECK_SEGIDX 1
+
+ vki_modify_ldt_t ldt =3D {=20
+ POINTERCHECK_SEGIDX, // entry_number
+ client_base, // base_addr
+ (client_end - client_base) / VKI_PAGE_SIZE, // limit
+ 1, // seg_32bit
+ 0, // contents: data, RW, non-expanding
+ 0, // ! read_exec_only
+ 1, // limit_in_pages
+ 0, // ! seg not present
+ 1, // useable
+ };
+ int ret =3D VG_(do_syscall3)(__NR_modify_ldt, 1, (UWord)&ldt, sizeof(=
ldt));
+ if (ret < 0) {
+ VG_(message)(Vg_UserMsg,
+ "Warning: ignoring --pointercheck=3Dyes, "
+ "because modify_ldt failed (errno=3D%d)", -ret);
+ return False;
+ } else {
+ return True;
+ }
+#elif defined(VGP_amd64_linux)
+ if (0)=20
+ VG_(message)(Vg_DebugMsg, "ignoring --pointercheck (unimplemented)=
");
+ return True;
+#else
+# error Unknown architecture
+#endif
+}
+
/*--------------------------------------------------------------------*/
/*--- end aspacemgr.c ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_aspacemgr.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/pub_core_aspacemgr.h 2005-06-01 03:09:59 UTC (rev 383=
3)
+++ trunk/coregrind/pub_core_aspacemgr.h 2005-06-01 03:48:33 UTC (rev 383=
4)
@@ -153,6 +153,9 @@
UInt dev, UInt ino, ULong foff,
const UChar *filename ) );
=20
+// Pointercheck
+extern Bool VGA_(setup_pointercheck) ( Addr client_base, Addr client_end=
);
+
#endif // __PUB_CORE_ASPACEMGR_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/x86/state.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/state.c 2005-06-01 03:09:59 UTC (rev 3833)
+++ trunk/coregrind/x86/state.c 2005-06-01 03:48:33 UTC (rev 3834)
@@ -152,38 +152,6 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- pointercheck ---*/
-/*------------------------------------------------------------*/
-
-/* Client address space segment limit descriptor entry */
-#define POINTERCHECK_SEGIDX 1
-
-Bool VGA_(setup_pointercheck)(Addr client_base, Addr client_end)
-{
- vg_assert(0 !=3D client_end);
- vki_modify_ldt_t ldt =3D {=20
- POINTERCHECK_SEGIDX, // entry_number
- client_base, // base_addr
- (client_end - client_base) / VKI_PAGE_SIZE, // limit
- 1, // seg_32bit
- 0, // contents: data, RW, non-expanding
- 0, // ! read_exec_only
- 1, // limit_in_pages
- 0, // ! seg not present
- 1, // useable
- };
- int ret =3D VG_(do_syscall3)(__NR_modify_ldt, 1, (UWord)&ldt, sizeof(=
ldt));
- if (ret < 0) {
- VG_(message)(Vg_UserMsg,
- "Warning: ignoring --pointercheck=3Dyes, "
- "because modify_ldt failed (errno=3D%d)", -ret);
- return False;
- } else {
- return True;
- }
-}
-
-/*------------------------------------------------------------*/
/*--- Debugger-related operations ---*/
/*------------------------------------------------------------*/
=20
|