You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(13) |
2
(33) |
3
(25) |
4
(22) |
5
(22) |
6
(21) |
7
(19) |
|
8
(29) |
9
(34) |
10
(29) |
11
(37) |
12
(36) |
13
(28) |
14
(25) |
|
15
(28) |
16
(23) |
17
(36) |
18
(21) |
19
(12) |
20
(14) |
21
(10) |
|
22
(7) |
23
(15) |
24
(41) |
25
(15) |
26
(9) |
27
(7) |
28
(6) |
|
29
(16) |
30
(24) |
31
(22) |
|
|
|
|
|
From: <sv...@va...> - 2005-05-16 23:44:54
|
Author: tom
Date: 2005-05-16 08:31:05 +0100 (Mon, 16 May 2005)
New Revision: 3735
Modified:
trunk/coregrind/vg_mylibc.c
Log:
Use movq to get the frame pointer on amd64.
Modified: trunk/coregrind/vg_mylibc.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/vg_mylibc.c 2005-05-16 03:36:19 UTC (rev 3734)
+++ trunk/coregrind/vg_mylibc.c 2005-05-16 07:31:05 UTC (rev 3735)
@@ -915,7 +915,7 @@
#elif defined(VGP_amd64_linux)
# define GET_REAL_SP_AND_FP(sp, fp) \
asm("movq %%rsp, %0;" \
- "movl %%rbp, %1;" \
+ "movq %%rbp, %1;" \
: "=3Dr" (sp),\
"=3Dr" (fp));
#else
|
Author: njn
Date: 2005-05-17 00:31:24 +0100 (Tue, 17 May 2005)
New Revision: 3751
Added:
trunk/coregrind/m_options.c
trunk/coregrind/pub_core_options.h
trunk/include/pub_tool_options.h
Modified:
trunk/auxprogs/valgrind-listener.c
trunk/cachegrind/cg_main.c
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/linux/core_os.c
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_demangle/demangle.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_execontext.c
trunk/coregrind/m_mallocfree.c
trunk/coregrind/m_replacemalloc/replacemalloc_core.c
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
trunk/coregrind/m_sigframe/sigframe-x86-linux.c
trunk/coregrind/m_stacktrace.c
trunk/coregrind/m_syscalls/priv_syscalls.h
trunk/coregrind/m_translate.c
trunk/coregrind/m_transtab.c
trunk/coregrind/vg_dwarf.c
trunk/coregrind/vg_main.c
trunk/coregrind/vg_messages.c
trunk/coregrind/vg_mylibc.c
trunk/coregrind/vg_redir.c
trunk/coregrind/vg_scheduler.c
trunk/coregrind/vg_signals.c
trunk/coregrind/vg_symtab2.c
trunk/helgrind/hg_main.c
trunk/include/Makefile.am
trunk/include/tool.h
trunk/massif/ms_main.c
trunk/memcheck/mac_shared.h
Log:
Added module m_options for holding all the command-line option stuff.
Perhaps parts of process_cmd_line_option() should go in here, but I've
not done that for now.
Modified: trunk/auxprogs/valgrind-listener.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/auxprogs/valgrind-listener.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/auxprogs/valgrind-listener.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -47,6 +47,7 @@
=20
/* For VG_CLO_DEFAULT_LOGPORT and VG_BUGS_TO. */
#include "core.h"
+#include "pub_core_options.h"
=20
=20
/*---------------------------------------------------------------*/
Modified: trunk/cachegrind/cg_main.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/cachegrind/cg_main.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/cachegrind/cg_main.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -32,6 +32,7 @@
#include "tool.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
+#include "pub_tool_options.h"
#include "pub_tool_tooliface.h"
=20
#include "cg_arch.h"
Modified: trunk/coregrind/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/Makefile.am 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/Makefile.am 2005-05-16 23:31:24 UTC (rev 3751)
@@ -47,6 +47,7 @@
pub_core_execontext.h \
pub_core_hashtable.h \
pub_core_mallocfree.h \
+ pub_core_options.h \
pub_core_replacemalloc.h\
pub_core_sigframe.h \
pub_core_skiplist.h \
@@ -80,6 +81,7 @@
m_execontext.c \
m_hashtable.c \
m_mallocfree.c \
+ m_options.c \
m_skiplist.c \
m_stacktrace.c \
m_tooliface.c \
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-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/core.h 2005-05-16 23:31:24 UTC (rev 3751)
@@ -92,136 +92,10 @@
#define VALGRINDCLO "_VALGRIND_CLO"
=20
=20
-/* ---------------------------------------------------------------------
- Command-line-settable options
- ------------------------------------------------------------------ */
-
-/* Default destination port to be used in logging over a network, if
- none specified. */
-#define VG_CLO_DEFAULT_LOGPORT 1500
-
-/* The max number of suppression files. */
-#define VG_CLO_MAX_SFILES 10
-
/* Application-visible file descriptor limits */
extern Int VG_(fd_soft_limit);
extern Int VG_(fd_hard_limit);
=20
-/* Vex iropt control */
-extern VexControl VG_(clo_vex_control);
-/* Should we stop collecting errors if too many appear? default: YES */
-extern Bool VG_(clo_error_limit);
-/* Enquire about whether to attach to a debugger at errors? default: N=
O */
-extern Bool VG_(clo_db_attach);
-/* The debugger command? default: whatever gdb ./configure found */
-extern Char* VG_(clo_db_command);
-/* Generating a suppression for each error? default: 0 (NO)
- Other values: 1 (yes, but ask user), 2 (yes, don't ask user) */
-extern Int VG_(clo_gen_suppressions);
-/* Sanity-check level: 0 =3D none, 1 (default), > 1 =3D expensive. */
-extern Int VG_(clo_sanity_level);
-/* Automatically attempt to demangle C++ names? default: YES */
-extern Bool VG_(clo_demangle);
-/* Simulate child processes? default: NO */
-extern Bool VG_(clo_trace_children);
-
-/* Where logging output is to be sent to.
-
- With --log-fd (and by default), clo_log_fd holds the file id, and is
- taken from the command line. (fd 2, stderr, is the default.)
- clo_log_name is irrelevant.
-
- With --log-file/--log-file-exactly, clo_log_name holds the log-file
- name, and is taken from the command line. clo_log_fd is then
- made to hold the relevant file id, by opening clo_log_name
- (concatenated with the process ID) for writing.
-
- With --log-socket, clo_log_name holds the hostname:portnumber pair,
- and is taken from the command line. clo_log_fd is then made to hold
- the relevant file handle, by opening a connection to that
- hostname:portnumber pair.=20
-
- Global default is to set log_to =3D=3D VgLogTo_Fd and log_fd =3D=3D 2
- (stderr). */
-extern Int VG_(clo_log_fd);
-extern Char* VG_(clo_log_name);
-
-/* Add timestamps to log messages? default: NO */
-extern Bool VG_(clo_time_stamp);
-
-/* The file descriptor to read for input. default: 0 =3D=3D stdin */
-extern Int VG_(clo_input_fd);
-/* The number of suppression files specified. */
-extern Int VG_(clo_n_suppressions);
-/* The names of the suppression files. */
-extern Char* VG_(clo_suppressions)[VG_CLO_MAX_SFILES];
-
-/* DEBUG: print generated code? default: 00000000 ( =3D=3D NO ) */
-extern Bool VG_(clo_trace_flags);
-/* DEBUG: do bb profiling? default: 00000000 ( =3D=3D NO ) */
-extern Bool VG_(clo_profile_flags);
-/* DEBUG: if tracing codegen, be quiet until after this bb ( 0 ) */
-extern Int VG_(clo_trace_notbelow);
-/* DEBUG: print system calls? default: NO */
-extern Bool VG_(clo_trace_syscalls);
-/* DEBUG: print signal details? default: NO */
-extern Bool VG_(clo_trace_signals);
-/* DEBUG: print symtab details? default: NO */
-extern Bool VG_(clo_trace_symtab);
-/* DEBUG: print call-frame-info details? default: NO */
-extern Bool VG_(clo_trace_cfi);
-/* DEBUG: print redirection details? default: NO */
-extern Bool VG_(clo_trace_redir);
-/* DEBUG: print thread scheduling events? default: NO */
-extern Bool VG_(clo_trace_sched);
-/* DEBUG: print pthreads calls? default: NO */
-extern Bool VG_(clo_trace_pthreads);
-/* Display gory details for the k'th most popular error. default:
- Infinity. */
-extern Int VG_(clo_dump_error);
-/* Number of parents of a backtrace. Default: 8. */
-extern Int VG_(clo_backtrace_size);
-/* Engage miscellaneous weird hacks needed for some progs. */
-extern Char* VG_(clo_weird_hacks);
-
-/* Track open file descriptors? */
-extern Bool VG_(clo_track_fds);
-
-/* Should we run __libc_freeres at exit? Sometimes causes crashes.
- Default: YES. Note this is subservient to VG_(needs).libc_freeres;
- if the latter says False, then the setting of VG_(clo_weird_hacks)
- is ignored. Ie if a tool says no, I don't want this to run, that
- cannot be overridden from the command line. */
-extern Bool VG_(clo_run_libc_freeres);
-/* Generate branch-prediction hints? */
-extern Bool VG_(clo_branchpred);
-/* Continue stack traces below main()? Default: NO */
-extern Bool VG_(clo_show_below_main);
-/* Test each client pointer dereference to check it's within the
- client address space bounds */
-extern Bool VG_(clo_pointercheck);
-/* Model the pthread library */
-extern Bool VG_(clo_model_pthreads);
-
-/* HACK: Use hacked version of clone for Quadrics Elan3 drivers */
-extern Bool VG_(clo_support_elan3);
-
-/* Should we show VEX emulation warnings? Default: NO */
-extern Bool VG_(clo_show_emwarns);
-
-/* How much does the stack pointer have to change before tools
- consider a stack switch to have happened? Default: 2000000 bytes */
-extern Int VG_(clo_max_stackframe);
-
-/* Set up the libc freeres wrapper */
-extern void VGA_(intercept_libc_freeres_wrapper)(Addr);
-
-// Clean up the client by calling before the final reports
-extern void VGA_(final_tidyup)(ThreadId tid);
-
-// Arch-specific client requests
-extern Bool VGA_(client_requests)(ThreadId tid, UWord *args);
-
/* ---------------------------------------------------------------------
Profiling stuff
------------------------------------------------------------------ */
@@ -819,7 +693,16 @@
// Used by leakcheck
extern void VGA_(mark_from_registers)(ThreadId tid, void (*marker)(Addr)=
);
=20
+// Set up the libc freeres wrapper
+extern void VGA_(intercept_libc_freeres_wrapper)(Addr);
=20
+// Clean up the client by calling before the final reports
+extern void VGA_(final_tidyup)(ThreadId tid);
+
+// Arch-specific client requests
+extern Bool VGA_(client_requests)(ThreadId tid, UWord *args);
+
+
// ---------------------------------------------------------------------
// Platform-specific things defined in eg. x86/*.c
// ---------------------------------------------------------------------
Modified: trunk/coregrind/linux/core_os.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/linux/core_os.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/linux/core_os.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -29,6 +29,7 @@
*/
=20
#include "core.h"
+#include "pub_core_options.h"
#include "pub_core_tooliface.h"
=20
void VGA_(os_state_clear)(ThreadState *tst)
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-05-16 23:16:25 UTC (rev =
3750)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-05-16 23:31:24 UTC (rev =
3751)
@@ -32,6 +32,7 @@
=20
#include "core.h"
#include "pub_core_aspacemgr.h"
+#include "pub_core_options.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
#include "pub_core_transtab.h"
Modified: trunk/coregrind/m_demangle/demangle.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_demangle/demangle.c 2005-05-16 23:16:25 UTC (rev 37=
50)
+++ trunk/coregrind/m_demangle/demangle.c 2005-05-16 23:31:24 UTC (rev 37=
51)
@@ -29,6 +29,7 @@
*/
=20
#include "core.h"
+#include "pub_core_options.h"
#include "demangle.h"
=20
void VG_(demangle) ( Char* orig, Char* result, Int result_size )
Modified: trunk/coregrind/m_errormgr.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_errormgr.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/m_errormgr.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -31,6 +31,7 @@
#include "core.h"
#include "pub_core_errormgr.h"
#include "pub_core_execontext.h"
+#include "pub_core_options.h"
#include "pub_core_stacktrace.h"
#include "pub_core_tooliface.h"
#include "pub_core_translate.h"
Modified: trunk/coregrind/m_execontext.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_execontext.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/m_execontext.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_execontext.h"
+#include "pub_core_options.h"
=20
/*------------------------------------------------------------*/
/*--- Low-level ExeContext storage. ---*/
Modified: trunk/coregrind/m_mallocfree.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_mallocfree.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/m_mallocfree.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -32,6 +32,7 @@
=20
#include "core.h"
#include "pub_core_aspacemgr.h"
+#include "pub_core_options.h"
#include "valgrind.h"
=20
//zz#include "memcheck/memcheck.h"
Added: trunk/coregrind/m_options.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
Modified: trunk/coregrind/m_replacemalloc/replacemalloc_core.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_replacemalloc/replacemalloc_core.c 2005-05-16 23:16=
:25 UTC (rev 3750)
+++ trunk/coregrind/m_replacemalloc/replacemalloc_core.c 2005-05-16 23:31=
:24 UTC (rev 3751)
@@ -29,6 +29,7 @@
*/
=20
#include "core.h"
+#include "pub_core_options.h"
#include "pub_core_replacemalloc.h"
=20
/*------------------------------------------------------------*/
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.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_sigframe/sigframe-amd64-linux.c 2005-05-16 23:16:25=
UTC (rev 3750)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2005-05-16 23:31:24=
UTC (rev 3751)
@@ -31,6 +31,7 @@
=20
#include "core.h"
#include "pub_core_aspacemgr.h"
+#include "pub_core_options.h"
#include "pub_core_sigframe.h"
#include "pub_core_tooliface.h"
=20
Modified: trunk/coregrind/m_sigframe/sigframe-x86-linux.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_sigframe/sigframe-x86-linux.c 2005-05-16 23:16:25 U=
TC (rev 3750)
+++ trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2005-05-16 23:31:24 U=
TC (rev 3751)
@@ -31,6 +31,7 @@
=20
#include "core.h"
#include "pub_core_aspacemgr.h" /* find_segment */
+#include "pub_core_options.h"
#include "pub_core_sigframe.h"
#include "pub_core_tooliface.h"
=20
Modified: trunk/coregrind/m_stacktrace.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_stacktrace.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/m_stacktrace.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -29,6 +29,7 @@
*/
=20
#include "core.h"
+#include "pub_core_options.h"
#include "pub_core_stacktrace.h"
=20
/*------------------------------------------------------------*/
Modified: trunk/coregrind/m_syscalls/priv_syscalls.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/m_syscalls/priv_syscalls.h 2005-05-16 23:16:25 UTC (r=
ev 3750)
+++ trunk/coregrind/m_syscalls/priv_syscalls.h 2005-05-16 23:31:24 UTC (r=
ev 3751)
@@ -30,6 +30,8 @@
#ifndef __PRIV_SYSCALLS_H
#define __PRIV_SYSCALLS_H
=20
+#include "pub_core_options.h"
+
// This is ugly, but the alternatives (ie. doing it "properly" with -I o=
ptions
// and directories and more Makefiles) are even worse.
#if defined(VGP_amd64_linux)
Modified: trunk/coregrind/m_translate.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_translate.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/m_translate.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -31,6 +31,7 @@
=20
#include "core.h"
#include "pub_core_aspacemgr.h"
+#include "pub_core_options.h"
#include "pub_core_tooliface.h"
#include "pub_core_translate.h"
#include "pub_core_transtab.h"
Modified: trunk/coregrind/m_transtab.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_transtab.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/m_transtab.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -30,6 +30,7 @@
*/
=20
#include "core.h"
+#include "pub_core_options.h"
#include "pub_core_tooliface.h"
// XXX: this module should not depend on m_translate!
#include "pub_core_translate.h"
Added: trunk/coregrind/pub_core_options.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_options.h 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/pub_core_options.h 2005-05-16 23:31:24 UTC (rev 3751)
@@ -0,0 +1,162 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Command line options. pub_core_options.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ 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 __PUB_CORE_OPTIONS_H
+#define __PUB_CORE_OPTIONS_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module holds the variables for all command line options=
,
+// plus some functions and macros for manipulating them. Almost every
+// other module imports this one, if only for VG_(clo_verbosity).
+//--------------------------------------------------------------------
+
+#include "pub_tool_options.h"
+
+/* Default destination port to be used in logging over a network, if
+ none specified. */
+#define VG_CLO_DEFAULT_LOGPORT 1500
+
+/* The max number of suppression files. */
+#define VG_CLO_MAX_SFILES 10
+
+/* Vex iropt control */
+extern VexControl VG_(clo_vex_control);
+/* Should we stop collecting errors if too many appear? default: YES */
+extern Bool VG_(clo_error_limit);
+/* Enquire about whether to attach to a debugger at errors? default: N=
O */
+extern Bool VG_(clo_db_attach);
+/* The debugger command? default: whatever gdb ./configure found */
+extern Char* VG_(clo_db_command);
+/* Generating a suppression for each error? default: 0 (NO)
+ Other values: 1 (yes, but ask user), 2 (yes, don't ask user) */
+extern Int VG_(clo_gen_suppressions);
+/* Sanity-check level: 0 =3D none, 1 (default), > 1 =3D expensive. */
+extern Int VG_(clo_sanity_level);
+/* Automatically attempt to demangle C++ names? default: YES */
+extern Bool VG_(clo_demangle);
+/* Simulate child processes? default: NO */
+extern Bool VG_(clo_trace_children);
+
+/* Where logging output is to be sent to.
+
+ With --log-fd (and by default), clo_log_fd holds the file id, and is
+ taken from the command line. (fd 2, stderr, is the default.)
+ clo_log_name is irrelevant.
+
+ With --log-file/--log-file-exactly, clo_log_name holds the log-file
+ name, and is taken from the command line. clo_log_fd is then
+ made to hold the relevant file id, by opening clo_log_name
+ (concatenated with the process ID) for writing.
+
+ With --log-socket, clo_log_name holds the hostname:portnumber pair,
+ and is taken from the command line. clo_log_fd is then made to hold
+ the relevant file handle, by opening a connection to that
+ hostname:portnumber pair.=20
+
+ Global default is to set log_to =3D=3D VgLogTo_Fd and log_fd =3D=3D 2
+ (stderr). */
+extern Int VG_(clo_log_fd);
+extern Char* VG_(clo_log_name);
+
+/* Add timestamps to log messages? default: NO */
+extern Bool VG_(clo_time_stamp);
+
+/* The file descriptor to read for input. default: 0 =3D=3D stdin */
+extern Int VG_(clo_input_fd);
+/* The number of suppression files specified. */
+extern Int VG_(clo_n_suppressions);
+/* The names of the suppression files. */
+extern Char* VG_(clo_suppressions)[VG_CLO_MAX_SFILES];
+
+/* DEBUG: print generated code? default: 00000000 ( =3D=3D NO ) */
+extern Bool VG_(clo_trace_flags);
+/* DEBUG: do bb profiling? default: 00000000 ( =3D=3D NO ) */
+extern Bool VG_(clo_profile_flags);
+/* DEBUG: if tracing codegen, be quiet until after this bb ( 0 ) */
+extern Int VG_(clo_trace_notbelow);
+/* DEBUG: print system calls? default: NO */
+extern Bool VG_(clo_trace_syscalls);
+/* DEBUG: print signal details? default: NO */
+extern Bool VG_(clo_trace_signals);
+/* DEBUG: print symtab details? default: NO */
+extern Bool VG_(clo_trace_symtab);
+/* DEBUG: print call-frame-info details? default: NO */
+extern Bool VG_(clo_trace_cfi);
+/* DEBUG: print redirection details? default: NO */
+extern Bool VG_(clo_trace_redir);
+/* DEBUG: print thread scheduling events? default: NO */
+extern Bool VG_(clo_trace_sched);
+/* DEBUG: print pthreads calls? default: NO */
+extern Bool VG_(clo_trace_pthreads);
+/* Display gory details for the k'th most popular error. default:
+ Infinity. */
+extern Int VG_(clo_dump_error);
+/* Number of parents of a backtrace. Default: 8. */
+extern Int VG_(clo_backtrace_size);
+/* Engage miscellaneous weird hacks needed for some progs. */
+extern Char* VG_(clo_weird_hacks);
+
+/* Track open file descriptors? */
+extern Bool VG_(clo_track_fds);
+
+/* Should we run __libc_freeres at exit? Sometimes causes crashes.
+ Default: YES. Note this is subservient to VG_(needs).libc_freeres;
+ if the latter says False, then the setting of VG_(clo_weird_hacks)
+ is ignored. Ie if a tool says no, I don't want this to run, that
+ cannot be overridden from the command line. */
+extern Bool VG_(clo_run_libc_freeres);
+/* Generate branch-prediction hints? */
+extern Bool VG_(clo_branchpred);
+/* Continue stack traces below main()? Default: NO */
+extern Bool VG_(clo_show_below_main);
+/* Test each client pointer dereference to check it's within the
+ client address space bounds */
+extern Bool VG_(clo_pointercheck);
+/* Model the pthread library */
+extern Bool VG_(clo_model_pthreads);
+
+/* HACK: Use hacked version of clone for Quadrics Elan3 drivers */
+extern Bool VG_(clo_support_elan3);
+
+/* Should we show VEX emulation warnings? Default: NO */
+extern Bool VG_(clo_show_emwarns);
+
+/* How much does the stack pointer have to change before tools
+ consider a stack switch to have happened? Default: 2000000 bytes */
+extern Int VG_(clo_max_stackframe);
+
+/* Delay startup to allow GDB to be attached? Default: NO */
+extern Bool VG_(clo_wait_for_gdb);
+
+#endif // __PUB_CORE_OPTIONS_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_dwarf.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/vg_dwarf.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/vg_dwarf.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -30,6 +30,7 @@
#include "core.h"
#include "vg_symtab2.h"
=20
+#include "pub_core_options.h"
=20
/* Structure found in the .debug_line section. */
typedef struct
Modified: trunk/coregrind/vg_main.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/vg_main.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/vg_main.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -36,6 +36,7 @@
#include "pub_core_debuglog.h"
#include "pub_core_errormgr.h"
#include "pub_core_execontext.h"
+#include "pub_core_options.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
#include "pub_core_transtab.h"
@@ -1399,6 +1400,8 @@
/*=3D=3D=3D Command-line: variables, processing, etc =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
+// See pub_{core,tool}_options.h for explanations of all these.
+
/* Define, and set defaults. */
VexControl VG_(clo_vex_control);
Bool VG_(clo_error_limit) =3D True;
@@ -1409,13 +1412,9 @@
Int VG_(clo_verbosity) =3D 1;
Bool VG_(clo_demangle) =3D True;
Bool VG_(clo_trace_children) =3D False;
-
-/* See big comment in core.h for meaning of these two. */
-Int VG_(clo_log_fd) =3D 2;
-Char* VG_(clo_log_name) =3D NULL;
-
+Int VG_(clo_log_fd) =3D 2;
+Char* VG_(clo_log_name) =3D NULL;
Bool VG_(clo_time_stamp) =3D False;
-
Int VG_(clo_input_fd) =3D 0; /* stdin */
Int VG_(clo_n_suppressions) =3D 0;
Char* VG_(clo_suppressions)[VG_CLO_MAX_SFILES];
@@ -1435,17 +1434,16 @@
Char* VG_(clo_weird_hacks) =3D NULL;
Bool VG_(clo_run_libc_freeres) =3D True;
Bool VG_(clo_track_fds) =3D False;
-Bool VG_(clo_show_below_main) =3D False;
+Bool VG_(clo_show_below_main)=3D False;
Bool VG_(clo_pointercheck) =3D True;
Bool VG_(clo_support_elan3) =3D False;
Bool VG_(clo_branchpred) =3D False;
Bool VG_(clo_model_pthreads) =3D False;
Bool VG_(clo_show_emwarns) =3D False;
Int VG_(clo_max_stackframe) =3D 2000000;
+Bool VG_(clo_wait_for_gdb) =3D False;
=20
-static Bool VG_(clo_wait_for_gdb) =3D False;
=20
-
static void usage ( Bool debug_help )
{
Char* usage1 =3D=20
Modified: trunk/coregrind/vg_messages.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/vg_messages.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/vg_messages.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -32,6 +32,8 @@
#include "core.h"
#include "valgrind.h"
=20
+#include "pub_core_options.h"
+
#include <time.h>
#include <sys/time.h>
=20
Modified: trunk/coregrind/vg_mylibc.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/vg_mylibc.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/vg_mylibc.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -33,6 +33,7 @@
#include "core.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */
+#include "pub_core_options.h"
#include "pub_core_stacktrace.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
Modified: trunk/coregrind/vg_redir.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/vg_redir.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/vg_redir.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -34,6 +34,7 @@
=20
#include "pub_core_aspacemgr.h"
#include "pub_core_skiplist.h"
+#include "pub_core_options.h"
#include "pub_core_transtab.h"
=20
/*------------------------------------------------------------*/
Modified: trunk/coregrind/vg_scheduler.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/vg_scheduler.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/vg_scheduler.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -62,6 +62,7 @@
=20
#include "pub_core_dispatch.h"
#include "pub_core_errormgr.h"
+#include "pub_core_options.h"
#include "pub_core_replacemalloc.h"
#include "pub_core_stacktrace.h"
#include "pub_core_syscalls.h"
Modified: trunk/coregrind/vg_signals.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/vg_signals.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/vg_signals.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -83,6 +83,7 @@
=20
#include "pub_core_aspacemgr.h"
#include "pub_core_errormgr.h"
+#include "pub_core_options.h"
#include "pub_core_sigframe.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
Modified: trunk/coregrind/vg_symtab2.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/vg_symtab2.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/coregrind/vg_symtab2.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -35,6 +35,7 @@
=20
#include "pub_core_aspacemgr.h"
#include "pub_core_demangle.h"
+#include "pub_core_options.h"
#include "pub_core_tooliface.h"
=20
#include <elf.h> /* ELF defns */
Modified: trunk/helgrind/hg_main.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/helgrind/hg_main.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/helgrind/hg_main.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -32,6 +32,7 @@
#include "tool.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
+#include "pub_tool_options.h"
#include "pub_tool_replacemalloc.h"
#include "pub_tool_tooliface.h"
=20
Modified: trunk/include/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/include/Makefile.am 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/include/Makefile.am 2005-05-16 23:31:24 UTC (rev 3751)
@@ -12,6 +12,7 @@
pub_tool_execontext.h \
pub_tool_hashtable.h \
pub_tool_mallocfree.h \
+ pub_tool_options.h \
pub_tool_replacemalloc.h \
pub_tool_skiplist.h \
pub_tool_stacktrace.h \
Added: trunk/include/pub_tool_options.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/include/pub_tool_options.h 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/include/pub_tool_options.h 2005-05-16 23:31:24 UTC (rev 3751)
@@ -0,0 +1,78 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Command line options. pub_tool_options.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ 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 __PUB_TOOL_OPTIONS_H
+#define __PUB_TOOL_OPTIONS_H
+
+/* Use these for recognising tool command line options -- stops comparin=
g
+ once whitespace is reached. */
+#define VG_CLO_STREQ(s1,s2) (0=3D=3DVG_(strcmp_ws)((s1),(s2)))
+#define VG_CLO_STREQN(nn,s1,s2) (0=3D=3DVG_(strncmp_ws)((s1),(s2),(nn)))
+
+/* Higher-level command-line option recognisers; use in if/else chains =
*/
+
+#define VG_BOOL_CLO(qq_arg, qq_option, qq_var) \
+ if (VG_CLO_STREQ(qq_arg, qq_option"=3Dyes")) { (qq_var) =3D True=
; } \
+ else if (VG_CLO_STREQ(qq_arg, qq_option"=3Dno")) { (qq_var) =3D Fals=
e; }
+
+#define VG_STR_CLO(qq_arg, qq_option, qq_var) \
+ if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=3D")) =
{ \
+ (qq_var) =3D &qq_arg[ VG_(strlen)(qq_option)+1 ]; \
+ }
+
+#define VG_NUM_CLO(qq_arg, qq_option, qq_var) \
+ if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=3D")) =
{ \
+ (qq_var) =3D (Int)VG_(atoll)( &qq_arg[ VG_(strlen)(qq_option)+1 ] =
); \
+ }
+
+/* Bounded integer arg */
+#define VG_BNUM_CLO(qq_arg, qq_option, qq_var, qq_lo, qq_hi) \
+ if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=3D")) =
{ \
+ (qq_var) =3D (Int)VG_(atoll)( &qq_arg[ VG_(strlen)(qq_option)+1 ] =
); \
+ if ((qq_var) < (qq_lo)) (qq_var) =3D (qq_lo); \
+ if ((qq_var) > (qq_hi)) (qq_var) =3D (qq_hi); \
+ }
+
+/* Verbosity level: 0 =3D silent, 1 (default), > 1 =3D more verbose. */
+extern Int VG_(clo_verbosity);
+
+/* Profile? */
+extern Bool VG_(clo_profile);
+
+/* Call this if a recognised option was bad for some reason.
+ Note: don't use it just because an option was unrecognised -- return =
'False'
+ from VG_(tdict).tool_process_cmd_line_option) to indicate that. */
+extern void VG_(bad_option) ( Char* opt );
+
+#endif // __PUB_TOOL_OPTIONS_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/include/tool.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/include/tool.h 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/include/tool.h 2005-05-16 23:31:24 UTC (rev 3751)
@@ -64,55 +64,10 @@
extern const Char *VG_(libdir);
=20
=20
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Command-line options =
=3D=3D=3D*/
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-
/* Use this for normal null-termination-style string comparison */
#define VG_STREQ(s1,s2) (s1 !=3D NULL && s2 !=3D NULL \
&& VG_(strcmp)((s1),(s2))=3D=3D0)
=20
-/* Use these for recognising tool command line options -- stops comparin=
g
- once whitespace is reached. */
-#define VG_CLO_STREQ(s1,s2) (0=3D=3DVG_(strcmp_ws)((s1),(s2)))
-#define VG_CLO_STREQN(nn,s1,s2) (0=3D=3DVG_(strncmp_ws)((s1),(s2),(nn)))
-
-/* Higher-level command-line option recognisers; use in if/else chains =
*/
-
-#define VG_BOOL_CLO(qq_arg, qq_option, qq_var) \
- if (VG_CLO_STREQ(qq_arg, qq_option"=3Dyes")) { (qq_var) =3D True=
; } \
- else if (VG_CLO_STREQ(qq_arg, qq_option"=3Dno")) { (qq_var) =3D Fals=
e; }
-
-#define VG_STR_CLO(qq_arg, qq_option, qq_var) \
- if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=3D")) =
{ \
- (qq_var) =3D &qq_arg[ VG_(strlen)(qq_option)+1 ]; \
- }
-
-#define VG_NUM_CLO(qq_arg, qq_option, qq_var) \
- if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=3D")) =
{ \
- (qq_var) =3D (Int)VG_(atoll)( &qq_arg[ VG_(strlen)(qq_option)+1 ] =
); \
- }
-
-/* Bounded integer arg */
-#define VG_BNUM_CLO(qq_arg, qq_option, qq_var, qq_lo, qq_hi) \
- if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=3D")) =
{ \
- (qq_var) =3D (Int)VG_(atoll)( &qq_arg[ VG_(strlen)(qq_option)+1 ] =
); \
- if ((qq_var) < (qq_lo)) (qq_var) =3D (qq_lo); \
- if ((qq_var) > (qq_hi)) (qq_var) =3D (qq_hi); \
- }
-
-
-/* Verbosity level: 0 =3D silent, 1 (default), > 1 =3D more verbose. */
-extern Int VG_(clo_verbosity);
-
-/* Profile? */
-extern Bool VG_(clo_profile);
-
-/* Call this if a recognised option was bad for some reason.
- Note: don't use it just because an option was unrecognised -- return =
'False'
- from VG_(tdict).tool_process_cmd_line_option) to indicate that. */
-extern void VG_(bad_option) ( Char* opt );
-
/* Client args */
extern Int VG_(client_argc);
extern Char** VG_(client_argv);
Modified: trunk/massif/ms_main.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/massif/ms_main.c 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/massif/ms_main.c 2005-05-16 23:31:24 UTC (rev 3751)
@@ -37,6 +37,7 @@
#include "tool.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
+#include "pub_tool_options.h"
#include "pub_tool_replacemalloc.h"
#include "pub_tool_stacktrace.h"
#include "pub_tool_tooliface.h"
Modified: trunk/memcheck/mac_shared.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/memcheck/mac_shared.h 2005-05-16 23:16:25 UTC (rev 3750)
+++ trunk/memcheck/mac_shared.h 2005-05-16 23:31:24 UTC (rev 3751)
@@ -39,6 +39,7 @@
#include "tool.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
+#include "pub_tool_options.h"
#include "pub_tool_replacemalloc.h"
#include "pub_tool_tooliface.h"
=20
|
|
From: <sv...@va...> - 2005-05-16 23:17:26
|
Author: tom
Date: 2005-05-17 00:16:25 +0100 (Tue, 17 May 2005)
New Revision: 3750
Modified:
trunk/coregrind/core.h
Log:
Fix test for amd64.
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-05-16 21:39:23 UTC (rev 3749)
+++ trunk/coregrind/core.h 2005-05-16 23:16:25 UTC (rev 3750)
@@ -303,7 +303,7 @@
=20
#if defined(VGA_x86)
typedef VexGuestX86State VexGuestArchState;
-#elif defined(VGA_x86)
+#elif defined(VGA_amd64)
typedef VexGuestAMD64State VexGuestArchState;
#elif defined(VGA_arm)
typedef VexGuestARMState VexGuestArchState;
|
|
From: <sv...@va...> - 2005-05-16 22:45:43
|
Author: njn
Date: 2005-05-16 21:50:52 +0100 (Mon, 16 May 2005)
New Revision: 3746
Modified:
trunk/coregrind/amd64-linux/core_platform.h
trunk/coregrind/core.h
trunk/coregrind/vg_scheduler.c
trunk/coregrind/x86-linux/core_platform.h
Log:
Remove VGP_LONGJMP and VGP_SETJMP, since they're the same on all
platforms.
Modified: trunk/coregrind/amd64-linux/core_platform.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-linux/core_platform.h 2005-05-16 20:40:51 UTC (=
rev 3745)
+++ trunk/coregrind/amd64-linux/core_platform.h 2005-05-16 20:50:52 UTC (=
rev 3746)
@@ -59,13 +59,6 @@
} while (0)
=20
=20
-/* Use libc setjmp/longjmp. longjmp must not restore signal mask
- state, but does need to pass though "val". */
-#include <setjmp.h> /* for jmp_buf */
-
-#define VGP_SETJMP(env) setjmp(env)
-#define VGP_LONGJMP(env, val) longjmp(env, val)
-
#endif // __AMD64_LINUX_CORE_PLATFORM_H
=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-05-16 20:40:51 UTC (rev 3745)
+++ trunk/coregrind/core.h 2005-05-16 20:50:52 UTC (rev 3746)
@@ -45,6 +45,8 @@
#include "pub_core_mallocfree.h" // for type 'ArenaId'
#include "pub_core_stacktrace.h" // for type 'StackTrace'
=20
+#include <setjmp.h> /* for jmp_buf */
+
/* ---------------------------------------------------------------------
Global macros.
------------------------------------------------------------------ */
Modified: trunk/coregrind/vg_scheduler.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/vg_scheduler.c 2005-05-16 20:40:51 UTC (rev 3745)
+++ trunk/coregrind/vg_scheduler.c 2005-05-16 20:50:52 UTC (rev 3746)
@@ -415,7 +415,7 @@
/* Can't continue; must longjmp back to the scheduler and thus
enter the sighandler immediately. */
=20
- VGP_LONGJMP(tst->sched_jmpbuf, True);
+ longjmp(tst->sched_jmpbuf, True);
}
}
=20
@@ -445,11 +445,13 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, NULL);
}
=20
+/* Use libc setjmp/longjmp. longjmp must not restore signal mask
+ state, but does need to pass "val" through. */
#define SCHEDSETJMP(tid, jumped, stmt) \
do { \
ThreadState * volatile _qq_tst =3D VG_(get_ThreadState)(tid); \
\
- (jumped) =3D VGP_SETJMP(_qq_tst->sched_jmpbuf); =
\
+ (jumped) =3D setjmp(_qq_tst->sched_jmpbuf); =
\
if ((jumped) =3D=3D 0) { \
vg_assert(!_qq_tst->sched_jmpbuf_valid); \
_qq_tst->sched_jmpbuf_valid =3D True; \
Modified: trunk/coregrind/x86-linux/core_platform.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-linux/core_platform.h 2005-05-16 20:40:51 UTC (re=
v 3745)
+++ trunk/coregrind/x86-linux/core_platform.h 2005-05-16 20:50:52 UTC (re=
v 3746)
@@ -141,13 +141,6 @@
__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory");
}
=20
-/* Use libc setjmp/longjmp. longjmp must not restore signal mask
- state, but does need to pass though "val". */
-#include <setjmp.h> /* for jmp_buf */
-
-#define VGP_SETJMP(env) setjmp(env)
-#define VGP_LONGJMP(env, val) longjmp(env, val)
-
#endif // __X86_LINUX_CORE_PLATFORM_H
=20
/*--------------------------------------------------------------------*/
|
|
From: Tom H. <th...@cy...> - 2005-05-16 22:41:25
|
Nightly build on audi ( Red Hat 9 ) started at 2005-05-16 03:15:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow fpu_lazy_eflags: valgrind ./fpu_lazy_eflags insn_basic: valgrind ./insn_basic insn_cmov: valgrind ./insn_cmov insn_fpu: valgrind ./insn_fpu insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 206 tests, 1 stderr failure, 0 stdout failures ================= memcheck/tests/scalar (stderr) make: *** [regtest] Error 1 |
|
From: <sv...@va...> - 2005-05-16 22:39:30
|
Author: njn
Date: 2005-05-16 22:39:23 +0100 (Mon, 16 May 2005)
New Revision: 3749
Modified:
trunk/coregrind/amd64/core_arch.h
trunk/coregrind/arm/core_arch.h
trunk/coregrind/m_syscalls/syscalls-amd64-linux.c
trunk/coregrind/m_syscalls/syscalls-x86-linux.c
trunk/coregrind/x86/core_arch.h
Log:
Move VGA_STACK_SIZE_W into m_syscalls, the only place that uses it.
Modified: 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-05-16 21:30:24 UTC (rev 3748)
+++ trunk/coregrind/amd64/core_arch.h 2005-05-16 21:39:23 UTC (rev 3749)
@@ -54,13 +54,6 @@
#define VGA_CLREQ_ARGS guest_RAX
#define VGA_CLREQ_RET guest_RDX
=20
-/* ---------------------------------------------------------------------
- Miscellaneous constants
- ------------------------------------------------------------------ */
-
-// Valgrind's stack size, in words.
-#define VGA_STACK_SIZE_W 16384
-
#endif // __AMD64_CORE_ARCH_H
=20
/*--------------------------------------------------------------------*/
Modified: 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-05-16 21:30:24 UTC (rev 3748)
+++ trunk/coregrind/arm/core_arch.h 2005-05-16 21:39:23 UTC (rev 3749)
@@ -59,10 +59,6 @@
#define VGA_CLREQ_ARGS guest_R0
#define VGA_CLREQ_RET guest_R0
=20
-/* ---------------------------------------------------------------------
- Miscellaneous constants
- ------------------------------------------------------------------ */
-
#endif // __ARM_CORE_ARCH_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syscalls/syscalls-amd64-linux.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_syscalls/syscalls-amd64-linux.c 2005-05-16 21:30:24=
UTC (rev 3748)
+++ trunk/coregrind/m_syscalls/syscalls-amd64-linux.c 2005-05-16 21:39:23=
UTC (rev 3749)
@@ -187,13 +187,16 @@
*/
#define FILL 0xdeadbeefcabafeed
=20
+// Valgrind's stack size, in words.
+#define STACK_SIZE_W 16384
+
static UWord* allocstack(ThreadId tid)
{
ThreadState *tst =3D VG_(get_ThreadState)(tid);
UWord* rsp;
=20
if (tst->os_state.valgrind_stack_base =3D=3D 0) {
- void *stk =3D VG_(mmap)(0, VGA_STACK_SIZE_W * sizeof(UWord) + VKI_=
PAGE_SIZE,
+ void *stk =3D VG_(mmap)(0, STACK_SIZE_W * sizeof(UWord) + VKI_PAGE=
_SIZE,
VKI_PROT_READ|VKI_PROT_WRITE,
VKI_MAP_PRIVATE|VKI_MAP_ANONYMOUS,
SF_VALGRIND,
@@ -202,7 +205,7 @@
if (stk !=3D (void *)-1) {
VG_(mprotect)(stk, VKI_PAGE_SIZE, VKI_PROT_NONE); /* guard page */
tst->os_state.valgrind_stack_base =3D ((Addr)stk) + VKI_PAGE_SIZE;
- tst->os_state.valgrind_stack_szB =3D VGA_STACK_SIZE_W * sizeof(UWord)=
;
+ tst->os_state.valgrind_stack_szB =3D STACK_SIZE_W * sizeof(UWord);
} else=20
return (UWord*)-1;
}
Modified: trunk/coregrind/m_syscalls/syscalls-x86-linux.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_syscalls/syscalls-x86-linux.c 2005-05-16 21:30:24 U=
TC (rev 3748)
+++ trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-05-16 21:39:23 U=
TC (rev 3749)
@@ -47,6 +47,7 @@
Note. Why is this stuff here?
------------------------------------------------------------------ */
=20
+
/* These are addresses within VGA_(client_syscall). See syscall.S for d=
etails. */
extern const Addr VGA_(blksys_setup);
extern const Addr VGA_(blksys_restart);
@@ -185,13 +186,16 @@
*/
#define FILL 0xdeadbeef
=20
+// Valgrind's stack size, in words.
+#define STACK_SIZE_W 16384
+
static UWord* allocstack(ThreadId tid)
{
ThreadState *tst =3D VG_(get_ThreadState)(tid);
UWord *esp;
=20
if (tst->os_state.valgrind_stack_base =3D=3D 0) {
- void *stk =3D VG_(mmap)(0, VGA_STACK_SIZE_W * sizeof(UWord) + VKI_=
PAGE_SIZE,
+ void *stk =3D VG_(mmap)(0, STACK_SIZE_W * sizeof(UWord) + VKI_PAGE=
_SIZE,
VKI_PROT_READ|VKI_PROT_WRITE,
VKI_MAP_PRIVATE|VKI_MAP_ANONYMOUS,
SF_VALGRIND,
@@ -200,7 +204,7 @@
if (stk !=3D (void *)-1) {
VG_(mprotect)(stk, VKI_PAGE_SIZE, VKI_PROT_NONE); /* guard page */
tst->os_state.valgrind_stack_base =3D ((Addr)stk) + VKI_PAGE_SIZE;
- tst->os_state.valgrind_stack_szB =3D VGA_STACK_SIZE_W * sizeof(UWord)=
;
+ tst->os_state.valgrind_stack_szB =3D STACK_SIZE_W * sizeof(UWord);
} else=20
return (UWord*)-1;
}
Modified: 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-05-16 21:30:24 UTC (rev 3748)
+++ trunk/coregrind/x86/core_arch.h 2005-05-16 21:39:23 UTC (rev 3749)
@@ -61,14 +61,6 @@
//extern const Char VG_(helper_INT)[];
//extern const Char VG_(helper_breakpoint)[];
=20
-
-/* ---------------------------------------------------------------------
- Miscellaneous constants
- ------------------------------------------------------------------ */
-
-// Valgrind's stack size, in words.
-#define VGA_STACK_SIZE_W 16384
-
#endif // __X86_CORE_ARCH_H
=20
/*--------------------------------------------------------------------*/
|
|
From: <js...@ac...> - 2005-05-16 22:35:56
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-05-16 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_mmx: valgrind ./insn_mmx insn_mmxext: (skipping, prereq failed: ../../../tests/cputest x86-mmxext) insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 201 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/writev (stderr) corecheck/tests/fdleak_fcntl (stderr) make: *** [regtest] Error 1 |
|
From: <sv...@va...> - 2005-05-16 22:09:25
|
Author: sewardj
Date: 2005-05-16 19:25:09 +0100 (Mon, 16 May 2005)
New Revision: 3743
Modified:
trunk/coregrind/vg_dwarf.c
Log:
CFI reader: handle DW_CFA_GNU_window_save. Why is this sparc-specific
construct turning up in .so's in x86 SuSE 9.3 ? Answers on a postcard
please.
Modified: trunk/coregrind/vg_dwarf.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/vg_dwarf.c 2005-05-16 16:39:57 UTC (rev 3742)
+++ trunk/coregrind/vg_dwarf.c 2005-05-16 18:25:09 UTC (rev 3743)
@@ -915,7 +915,8 @@
DW_CFA_offset_extended_sf =3D 0x11, /* DWARF3 only */
DW_CFA_def_cfa_offset_sf =3D 0x13, /* DWARF3 only */
DW_CFA_lo_user =3D 0x1c,
- DW_CFA_GNU_args_size =3D 0x2e,
+ DW_CFA_GNU_window_save =3D 0x2d, /* GNU extension */
+ DW_CFA_GNU_args_size =3D 0x2e, /* GNU extension */
DW_CFA_hi_user =3D 0x3f
};
=20
@@ -1513,6 +1514,11 @@
ctx->cfa_reg =3D -1; /* indicating we don't know */
break;
=20
+ case DW_CFA_GNU_window_save:
+ /* Ignored. This appears to be sparc-specific; quite why it
+ turns up in SuSE-supplied x86 .so's beats me. */
+ break;
+
default:=20
VG_(message)(Vg_DebugMsg, "DWARF2 CFI reader: unhandled CFI "
"instruction 0:%d", (Int)lo6);=20
@@ -1636,6 +1642,10 @@
VG_(printf)("DW_CFA_expression(r%d, length %d)\n", reg, len);
break;
=20
+ case DW_CFA_GNU_window_save:
+ VG_(printf)("DW_CFA_GNU_window_save\n");
+ break;
+
default:=20
VG_(printf)("0:%d\n", (Int)lo6);=20
break;
|
|
From: <sv...@va...> - 2005-05-16 22:05:09
|
Author: sewardj
Date: 2005-05-16 17:39:57 +0100 (Mon, 16 May 2005)
New Revision: 3742
Modified:
trunk/coregrind/vg_redir.c
Log:
More FC4 jiggery-pokery.
Modified: trunk/coregrind/vg_redir.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/vg_redir.c 2005-05-16 16:39:28 UTC (rev 3741)
+++ trunk/coregrind/vg_redir.c 2005-05-16 16:39:57 UTC (rev 3742)
@@ -462,6 +462,10 @@
add_redirect_sym_to_sym("soname:ld-linux.so.2", "strchr",
"*vgpreload_memcheck.so*", "strchr");
=20
+ /* apparently index is the same thing as strchr */
+ add_redirect_sym_to_sym("soname:ld-linux.so.2", "index",
+ "*vgpreload_memcheck.so*", "strchr");
+
add_redirect_sym_to_sym("soname:libc.so.6", "strchrnul",
"*vgpreload_memcheck.so*", "glibc232_strchrnu=
l");
=20
|
|
From: <sv...@va...> - 2005-05-16 22:05:09
|
Author: sewardj
Date: 2005-05-16 17:39:28 +0100 (Mon, 16 May 2005)
New Revision: 3741
Modified:
trunk/glibc-2.3.supp
Log:
Disable a bunch of suppressions made obsolete by r3740.
Modified: trunk/glibc-2.3.supp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/glibc-2.3.supp 2005-05-16 16:38:45 UTC (rev 3740)
+++ trunk/glibc-2.3.supp 2005-05-16 16:39:28 UTC (rev 3741)
@@ -258,30 +258,30 @@
##----------------------------------------------------------------------=
##
## glibc-2.3.3 on FC2
## Assumes that sysctl returns \0-terminated strings in is_smp_system
-{
- Unterminated strstr string in is_smp_system() (NPTL)
- Memcheck:Cond
- fun:strstr
- fun:__pthread_initialize_minimal
- obj:/lib/tls/libpthread*.so*
- obj:/lib/tls/libpthread*.so*
-}
-{
- Unterminated strstr string in is_smp_system() (LinuxThreads)
- Memcheck:Cond
- fun:strstr
- fun:pthread_initialize
- obj:/lib/i686/libpthread*.so*
- obj:/lib/i686/libpthread*.so*
-}
-{
- Unterminated strstr string in is_smp_system() (LinuxThreads)
- Memcheck:Cond
- fun:strstr
- fun:pthread_initialize
- obj:/lib/libpthread-0.10.so
- obj:/lib/libpthread-0.10.so
-}
+#{
+# Unterminated strstr string in is_smp_system() (NPTL)
+# Memcheck:Cond
+# fun:strstr
+# fun:__pthread_initialize_minimal
+# obj:/lib/tls/libpthread*.so*
+# obj:/lib/tls/libpthread*.so*
+#}
+#{
+# Unterminated strstr string in is_smp_system() (LinuxThreads)
+# Memcheck:Cond
+# fun:strstr
+# fun:pthread_initialize
+# obj:/lib/i686/libpthread*.so*
+# obj:/lib/i686/libpthread*.so*
+#}
+#{
+# Unterminated strstr string in is_smp_system() (LinuxThreads)
+# Memcheck:Cond
+# fun:strstr
+# fun:pthread_initialize
+# obj:/lib/libpthread-0.10.so
+# obj:/lib/libpthread-0.10.so
+#}
=20
## Bug in PRE(sys_clone), really. Some args are not used.
{
@@ -366,33 +366,33 @@
##----------------------------------------------------------------------=
##
## glibc-2.3.4 on FC3
## Assumes that sysctl returns \0-terminated strings in is_smp_system
-{
- Unterminated strstr string in is_smp_system() (NPTL)
- Memcheck:Cond
- fun:strstr
- fun:__pthread_initialize_minimal
- obj:/lib/tls/libpthread-2.3.4.so
- obj:/lib/tls/libpthread-2.3.4.so
-}
-{
- Unterminated strstr string in is_smp_system() (NPTL)
- Memcheck:Cond
- fun:strstr
- fun:__pthread_initialize_minimal
- obj:/lib64/tls/libpthread*.so*
-}
+#{
+# Unterminated strstr string in is_smp_system() (NPTL)
+# Memcheck:Cond
+# fun:strstr
+# fun:__pthread_initialize_minimal
+# obj:/lib/tls/libpthread-2.3.4.so
+# obj:/lib/tls/libpthread-2.3.4.so
+#}
+#{
+# Unterminated strstr string in is_smp_system() (NPTL)
+# Memcheck:Cond
+# fun:strstr
+# fun:__pthread_initialize_minimal
+# obj:/lib64/tls/libpthread*.so*
+#}
=20
##----------------------------------------------------------------------=
##
## glibc-2.3.5 on FC4
## Assumes that sysctl returns \0-terminated strings in is_smp_system
-{
- Unterminated strstr string in is_smp_system() (NPTL)
- Memcheck:Cond
- fun:strstr
- fun:__pthread_initialize_minimal
- obj:*/libpthread-2.3.5.so
- obj:*/libpthread-2.3.5.so
-}
+#{
+# Unterminated strstr string in is_smp_system() (NPTL)
+# Memcheck:Cond
+# fun:strstr
+# fun:__pthread_initialize_minimal
+# obj:*/libpthread-2.3.5.so
+# obj:*/libpthread-2.3.5.so
+#}
=20
=20
##----------------------------------------------------------------------=
##
|
|
From: <sv...@va...> - 2005-05-16 21:55:56
|
Author: sewardj
Date: 2005-05-16 17:38:45 +0100 (Mon, 16 May 2005)
New Revision: 3740
Modified:
trunk/coregrind/m_syscalls/syscalls-linux.c
Log:
Fix for sys_sysctl wrapper, from Ulrich Drepper.
Modified: trunk/coregrind/m_syscalls/syscalls-linux.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_syscalls/syscalls-linux.c 2005-05-16 13:31:23 UTC (=
rev 3739)
+++ trunk/coregrind/m_syscalls/syscalls-linux.c 2005-05-16 16:38:45 UTC (=
rev 3740)
@@ -357,7 +357,7 @@
args =3D (struct __vki_sysctl_args *)ARG1;
if (args->oldlenp !=3D NULL) {
POST_MEM_WRITE((Addr)args->oldlenp, sizeof(*args->oldlenp));
- POST_MEM_WRITE((Addr)args->oldval, *args->oldlenp);
+ POST_MEM_WRITE((Addr)args->oldval, 1 + *args->oldlenp);
}
}
=20
|
|
From: <sv...@va...> - 2005-05-16 19:53:06
|
Author: njn
Date: 2005-05-16 14:31:23 +0100 (Mon, 16 May 2005)
New Revision: 3739
Added:
trunk/include/valgrind.h
Removed:
trunk/include/valgrind.h.in
Modified:
trunk/configure.in
trunk/include/Makefile.am
Log:
No need to generate valgrind.h from valgrind.h.in. We can just use the
compiler symbols rather than our own symbols for the architectures (we
already were, more or less). This simplifies the build, hurrah!
I also inverted the sense of the NVALGRIND ifdefs, to make them easier to
read, and fixed up some comments.
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/configure.in 2005-05-16 11:48:34 UTC (rev 3738)
+++ trunk/configure.in 2005-05-16 13:31:23 UTC (rev 3739)
@@ -382,7 +382,6 @@
tests/Makefile=20
tests/vg_regtest=20
tests/unused/Makefile=20
- include/valgrind.h=20
include/Makefile=20
auxprogs/Makefile
coregrind/Makefile=20
Modified: trunk/include/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/include/Makefile.am 2005-05-16 11:48:34 UTC (rev 3738)
+++ trunk/include/Makefile.am 2005-05-16 13:31:23 UTC (rev 3739)
@@ -1,6 +1,5 @@
=20
EXTRA_DIST =3D \
- valgrind.h.in \
vg_profile.c
=20
incincdir =3D $(includedir)/valgrind
@@ -25,6 +24,3 @@
vki_posixtypes-amd64-linux.h \
vki_posixtypes-arm-linux.h \
vki_posixtypes-x86-linux.h
-
-BUILT_SOURCES =3D valgrind.h
-CLEANFILES =3D valgrind.h
Copied: trunk/include/valgrind.h (from rev 3734, trunk/include/valgrind.h=
.in)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/include/valgrind.h.in 2005-05-16 03:36:19 UTC (rev 3734)
+++ trunk/include/valgrind.h 2005-05-16 13:31:23 UTC (rev 3739)
@@ -0,0 +1,424 @@
+/* -*- c -*-
+ ----------------------------------------------------------------
+
+ Notice that the following BSD-style license applies to this one
+ file (valgrind.h) only. The entire rest of Valgrind is licensed
+ under the terms of the GNU General Public License, version 2. See
+ the COPYING file in the source distribution for details.
+
+ ----------------------------------------------------------------
+
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must=20
+ not claim that you wrote the original software. If you use this=20
+ software in a product, an acknowledgment in the product=20
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote=20
+ products derived from this software without specific prior written=
=20
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ ----------------------------------------------------------------
+
+ Notice that the above BSD-style license applies to this one file
+ (valgrind.h) only. The entire rest of Valgrind is licensed under
+ the terms of the GNU General Public License, version 2. See the
+ COPYING file in the source distribution for details.
+
+ ----------------------------------------------------------------=20
+*/
+
+
+#ifndef __VALGRIND_H
+#define __VALGRIND_H
+
+#include <stdarg.h>
+
+/* If we're not compiling for our target architecture, don't generate
+ any inline asms. Note that in this file we're using the compiler's
+ CPP symbols for identifying architectures, which are different to
+ the ones we use within the rest of Valgrind. */
+#if !defined(__i386__) && !defined(__x86_64__)
+# ifndef NVALGRIND
+# define NVALGRIND 1
+# endif /* NVALGRIND */
+#endif
+
+
+/* This file is for inclusion into client (your!) code.
+
+ You can use these macros to manipulate and query Valgrind's=20
+ execution inside your own programs.
+
+ The resulting executables will still run without Valgrind, just a
+ little bit more slowly than they otherwise would, but otherwise
+ unchanged. When not running on valgrind, each client request
+ consumes very few (eg. < 10) instructions, so the resulting performan=
ce
+ loss is negligible unless you plan to execute client requests
+ millions of times per second. Nevertheless, if that is still a
+ problem, you can compile with the NVALGRIND symbol defined (gcc
+ -DNVALGRIND) so that client requests are not even compiled in. */
+
+#ifdef NVALGRIND
+
+/* Define NVALGRIND to completely remove the Valgrind magic sequence
+ from the compiled code (analogous to NDEBUG's effects on assert()) */
+#define VALGRIND_MAGIC_SEQUENCE( \
+ _zzq_rlval, _zzq_default, _zzq_request, =
\
+ _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4) =
\
+ { \
+ (_zzq_rlval) =3D (_zzq_default); \
+ }
+
+#else /* NVALGRIND */
+
+/* The following defines the magic code sequences which the JITter spots=
and
+ handles magically. Don't look too closely at them; they will rot
+ your brain. We must ensure that the default value gets put in the re=
turn
+ slot, so that everything works when this is executed not under Valgri=
nd.
+ Args are passed in a memory block, and so there's no intrinsic limit =
to
+ the number that could be passed, but it's currently four.
+ =20
+ The macro args are:=20
+ _zzq_rlval result lvalue
+ _zzq_default default value (result returned when running on real =
CPU)
+ _zzq_request request code
+ _zzq_arg1..4 request params
+
+ Nb: we put the assembly code sequences for all architectures in this =
one
+ file. This is because this file must be stand-alone, and we don't wa=
nt
+ to have multiple files.
+*/
+
+#ifdef __x86_64__
+extern int printf (__const char *__restrict __format, ...);
+extern void exit (int __status);
+#define VALGRIND_MAGIC_SEQUENCE( \
+ _zzq_rlval, _zzq_default, _zzq_request, \
+ _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4) \
+ \
+ { volatile unsigned long long _zzq_args[5]; \
+ _zzq_args[0] =3D (volatile unsigned long long)(_zzq_request); \
+ _zzq_args[1] =3D (volatile unsigned long long)(_zzq_arg1); \
+ _zzq_args[2] =3D (volatile unsigned long long)(_zzq_arg2); \
+ _zzq_args[3] =3D (volatile unsigned long long)(_zzq_arg3); \
+ _zzq_args[4] =3D (volatile unsigned long long)(_zzq_arg4); \
+ asm volatile("roll $29, %%eax ; roll $3, %%eax\n\t" \
+ "rorl $27, %%eax ; rorl $5, %%eax\n\t" \
+ "roll $13, %%eax ; roll $19, %%eax" \
+ : "=3Dd" (_zzq_rlval) \
+ : "a" (&_zzq_args[0]), "0" (_zzq_default) \
+ : "cc", "memory" \
+ ); \
+ }
+#endif // __x86_64__
+
+#ifdef __i386__
+#define VALGRIND_MAGIC_SEQUENCE( \
+ _zzq_rlval, _zzq_default, _zzq_request, \
+ _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4) \
+ \
+ { unsigned int _zzq_args[5]; \
+ _zzq_args[0] =3D (unsigned int)(_zzq_request); \
+ _zzq_args[1] =3D (unsigned int)(_zzq_arg1); \
+ _zzq_args[2] =3D (unsigned int)(_zzq_arg2); \
+ _zzq_args[3] =3D (unsigned int)(_zzq_arg3); \
+ _zzq_args[4] =3D (unsigned int)(_zzq_arg4); \
+ asm volatile("roll $29, %%eax ; roll $3, %%eax\n\t" \
+ "rorl $27, %%eax ; rorl $5, %%eax\n\t" \
+ "roll $13, %%eax ; roll $19, %%eax" \
+ : "=3Dd" (_zzq_rlval) \
+ : "a" (&_zzq_args[0]), "0" (_zzq_default) \
+ : "cc", "memory" \
+ ); \
+ }
+#endif // __i386__
+
+#ifdef __arm__
+// XXX: temporary, until MAGIC_SEQUENCE is written properly
+extern int printf (__const char *__restrict __format, ...);
+extern void exit (int __status);
+#define VALGRIND_MAGIC_SEQUENCE( =
\
+ _zzq_rlval, _zzq_default, _zzq_request, =
\
+ _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4) =
\
+ =
\
+ { volatile unsigned int _zzq_args[5]; =
\
+ _zzq_args[0] =3D (volatile unsigned int)(_zzq_request); =
\
+ _zzq_args[1] =3D (volatile unsigned int)(_zzq_arg1); =
\
+ _zzq_args[2] =3D (volatile unsigned int)(_zzq_arg2); =
\
+ _zzq_args[3] =3D (volatile unsigned int)(_zzq_arg3); =
\
+ _zzq_args[4] =3D (volatile unsigned int)(_zzq_arg4); =
\
+ (_zzq_rlval) =3D (_zzq_default);/* temporary only */ \
+ printf("argh: MAGIC_SEQUENCE"); exit(1); \
+ asm volatile(""); =
\
+ }
+// XXX: make sure that the register holding the args and the register ta=
king
+// the return value match what the scheduler is expecting.
+#endif // __arm__
+
+// Insert assembly code for other architectures here...
+
+#endif /* NVALGRIND */
+
+
+/* Some request codes. There are many more of these, but most are not
+ exposed to end-user view. These are the public ones, all of the
+ form 0x1000 + small_number.
+
+ Core ones are in the range 0x00000000--0x0000ffff. The non-public on=
es
+ start at 0x2000.
+*/
+
+// These macros are used by tools -- they must be public, but don't embe=
d them
+// into other programs.
+#define VG_USERREQ_TOOL_BASE(a,b) \
+ ((unsigned int)(((a)&0xff) << 24 | ((b)&0xff) << 16))
+#define VG_IS_TOOL_USERREQ(a, b, v) \
+ (VG_USERREQ_TOOL_BASE(a,b) =3D=3D ((v) & 0xffff0000))
+
+typedef
+ enum { VG_USERREQ__RUNNING_ON_VALGRIND =3D 0x1001,
+ VG_USERREQ__DISCARD_TRANSLATIONS =3D 0x1002,
+
+ /* These allow any function to be called from the
+ simulated CPU but run on the real CPU.
+ Nb: the first arg passed to the function is always the Thre=
adId of
+ the running thread! So CLIENT_CALL0 actually requires a 1 =
arg
+ function, etc. */
+ VG_USERREQ__CLIENT_CALL0 =3D 0x1101,
+ VG_USERREQ__CLIENT_CALL1 =3D 0x1102,
+ VG_USERREQ__CLIENT_CALL2 =3D 0x1103,
+ VG_USERREQ__CLIENT_CALL3 =3D 0x1104,
+
+ /* Can be useful in regression testing suites -- eg. can send
+ Valgrind's output to /dev/null and still count errors. */
+ VG_USERREQ__COUNT_ERRORS =3D 0x1201,
+
+ /* These are useful and can be interpreted by any tool that tr=
acks
+ malloc() et al, by using vg_replace_malloc.c. */
+ VG_USERREQ__MALLOCLIKE_BLOCK =3D 0x1301,
+ VG_USERREQ__FREELIKE_BLOCK =3D 0x1302,
+ /* Memory pool support. */
+ VG_USERREQ__CREATE_MEMPOOL =3D 0x1303,
+ VG_USERREQ__DESTROY_MEMPOOL =3D 0x1304,
+ VG_USERREQ__MEMPOOL_ALLOC =3D 0x1305,
+ VG_USERREQ__MEMPOOL_FREE =3D 0x1306,
+
+ /* Allow printfs to valgrind log. */
+ VG_USERREQ__PRINTF =3D 0x1401,
+ VG_USERREQ__PRINTF_BACKTRACE =3D 0x1402
+ } Vg_ClientRequest;
+
+#ifndef __GNUC__
+#define __extension__
+#endif
+
+/* Returns the number of Valgrinds this code is running under. That is,
+ 0 if running natively, 1 if running under Valgrind, 2 if running unde=
r
+ Valgrind which is running under another Valgrind, etc. */
+#define RUNNING_ON_VALGRIND __extension__ \
+ ({unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0 /* returned if not */, \
+ VG_USERREQ__RUNNING_ON_VALGRIND, \
+ 0, 0, 0, 0); \
+ _qzz_res; \
+ })
+
+
+/* Discard translation of code in the range [_qzz_addr .. _qzz_addr +
+ _qzz_len - 1]. Useful if you are debugging a JITter or some such,
+ since it provides a way to make sure valgrind will retranslate the
+ invalidated area. Returns no value. */
+#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__DISCARD_TRANSLATIONS, \
+ _qzz_addr, _qzz_len, 0, 0); \
+ }
+
+#ifdef NVALGRIND
+
+#define VALGRIND_PRINTF(...)
+#define VALGRIND_PRINTF_BACKTRACE(...)
+
+#else /* NVALGRIND */
+
+int VALGRIND_PRINTF(const char *format, ...)
+ __attribute__((format(__printf__, 1, 2)));
+__attribute__((weak))
+int
+VALGRIND_PRINTF(const char *format, ...)
+{
+ unsigned long _qzz_res;
+ va_list vargs;
+ va_start(vargs, format);
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__PRINTF,
+ (unsigned long)format, (unsigned long)vargs, =
0, 0);
+ va_end(vargs);
+ return (int)_qzz_res;
+}
+
+int VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
+ __attribute__((format(__printf__, 1, 2)));
+__attribute__((weak))
+int
+VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
+{
+ unsigned long _qzz_res;
+ va_list vargs;
+ va_start(vargs, format);
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__PRINTF_BACKTRACE,
+ (unsigned long)format, (unsigned long)vargs, =
0, 0);
+ va_end(vargs);
+ return (int)_qzz_res;
+}
+
+#endif /* NVALGRIND */
+
+/* These requests allow control to move from the simulated CPU to the
+ real CPU, calling an arbitary function */
+#define VALGRIND_NON_SIMD_CALL0(_qyy_fn) \
+ ({unsigned long _qyy_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, \
+ VG_USERREQ__CLIENT_CALL0, \
+ _qyy_fn, \
+ 0, 0, 0); \
+ _qyy_res; \
+ })
+
+#define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1) \
+ ({unsigned long _qyy_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, \
+ VG_USERREQ__CLIENT_CALL1, \
+ _qyy_fn, \
+ _qyy_arg1, 0, 0); \
+ _qyy_res; \
+ })
+
+#define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2) \
+ ({unsigned long _qyy_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, \
+ VG_USERREQ__CLIENT_CALL2, \
+ _qyy_fn, \
+ _qyy_arg1, _qyy_arg2, 0); \
+ _qyy_res; \
+ })
+
+#define VALGRIND_NON_SIMD_CALL3(_qyy_fn, _qyy_arg1, _qyy_arg2, _qyy_arg3=
) \
+ ({unsigned long _qyy_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, \
+ VG_USERREQ__CLIENT_CALL3, \
+ _qyy_fn, \
+ _qyy_arg1, _qyy_arg2, _qyy_arg3); \
+ _qyy_res; \
+ })
+
+
+/* Counts the number of errors that have been recorded by a tool. Nb:
+ the tool must record the errors with VG_(maybe_record_error)() or
+ VG_(unique_error)() for them to be counted. */
+#define VALGRIND_COUNT_ERRORS =
\
+ ({unsigned int _qyy_res; =
\
+ VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, =
\
+ VG_USERREQ__COUNT_ERRORS, =
\
+ 0, 0, 0, 0); =
\
+ _qyy_res; =
\
+ })
+
+/* Mark a block of memory as having been allocated by a malloc()-like
+ function. `addr' is the start of the usable block (ie. after any
+ redzone) `rzB' is redzone size if the allocator can apply redzones;
+ use '0' if not. Adding redzones makes it more likely Valgrind will s=
pot
+ block overruns. `is_zeroed' indicates if the memory is zeroed, as it=
is
+ for calloc(). Put it immediately after the point where a block is
+ allocated.=20
+ =20
+ If you're allocating memory via superblocks, and then handing out sma=
ll
+ chunks of each superblock, if you don't have redzones on your small
+ blocks, it's worth marking the superblock with VALGRIND_MAKE_NOACCESS
+ when it's created, so that block overruns are detected. But if you c=
an
+ put redzones on, it's probably better to not do this, so that message=
s
+ for small overruns are described in terms of the small block rather t=
han
+ the superblock (but if you have a big overrun that skips over a redzo=
ne,
+ you could miss an error this way). See memcheck/tests/custom_alloc.c
+ for an example.
+
+ Nb: block must be freed via a free()-like function specified
+ with VALGRIND_FREELIKE_BLOCK or mismatch errors will occur. */
+#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__MALLOCLIKE_BLOCK, \
+ addr, sizeB, rzB, is_zeroed); \
+ }
+
+/* Mark a block of memory as having been freed by a free()-like function=
.
+ `rzB' is redzone size; it must match that given to
+ VALGRIND_MALLOCLIKE_BLOCK. Memory not freed will be detected by the =
leak
+ checker. Put it immediately after the point where the block is freed=
. */
+#define VALGRIND_FREELIKE_BLOCK(addr, rzB) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__FREELIKE_BLOCK, \
+ addr, rzB, 0, 0); \
+ }
+
+/* Create a memory pool. */
+#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__CREATE_MEMPOOL, \
+ pool, rzB, is_zeroed, 0); \
+ }
+
+/* Destroy a memory pool. */
+#define VALGRIND_DESTROY_MEMPOOL(pool) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__DESTROY_MEMPOOL, \
+ pool, 0, 0, 0); \
+ }
+
+/* Associate a piece of memory with a memory pool. */
+#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__MEMPOOL_ALLOC, \
+ pool, addr, size, 0); \
+ }
+
+/* Disassociate a piece of memory from a memory pool. */
+#define VALGRIND_MEMPOOL_FREE(pool, addr) \
+ {unsigned int _qzz_res; \
+ VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
+ VG_USERREQ__MEMPOOL_FREE, \
+ pool, addr, 0, 0); \
+ }
+
+#endif /* __VALGRIND_H */
Deleted: trunk/include/valgrind.h.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/include/valgrind.h.in 2005-05-16 11:48:34 UTC (rev 3738)
+++ trunk/include/valgrind.h.in 2005-05-16 13:31:23 UTC (rev 3739)
@@ -1,429 +0,0 @@
-/* -*- c -*-
- ----------------------------------------------------------------
-
- Notice that the following BSD-style license applies to this one
- file (valgrind.h) only. The entire rest of Valgrind is licensed
- under the terms of the GNU General Public License, version 2. See
- the COPYING file in the source distribution for details.
-
- ----------------------------------------------------------------
-
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. The origin of this software must not be misrepresented; you must=20
- not claim that you wrote the original software. If you use this=20
- software in a product, an acknowledgment in the product=20
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote=20
- products derived from this software without specific prior written=
=20
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- ----------------------------------------------------------------
-
- Notice that the above BSD-style license applies to this one file
- (valgrind.h) only. The entire rest of Valgrind is licensed under
- the terms of the GNU General Public License, version 2. See the
- COPYING file in the source distribution for details.
-
- ----------------------------------------------------------------=20
-*/
-
-
-#ifndef __VALGRIND_H
-#define __VALGRIND_H
-
-#include <stdarg.h>
-
-#undef __@VG_ARCH@__
-#define __@VG_ARCH@__ 1 // Architecture we're installed on
-
-
-/* If we're not compiling for our target architecture, don't generate
- any inline asms. This would be a bit neater if we used the same
- CPP symbols as the compiler for identifying architectures. */
-#if !defined(__i386__) && !defined(__amd64__)
-# ifndef NVALGRIND
-# define NVALGRIND 1
-# endif /* NVALGRIND */
-#endif
-
-
-/* This file is for inclusion into client (your!) code.
-
- You can use these macros to manipulate and query Valgrind's=20
- execution inside your own programs.
-
- The resulting executables will still run without Valgrind, just a
- little bit more slowly than they otherwise would, but otherwise
- unchanged. When not running on valgrind, each client request
- consumes very few (eg. < 10) instructions, so the resulting performan=
ce
- loss is negligible unless you plan to execute client requests
- millions of times per second. Nevertheless, if that is still a
- problem, you can compile with the NVALGRIND symbol defined (gcc
- -DNVALGRIND) so that client requests are not even compiled in. */
-
-#ifndef NVALGRIND
-
-/* The following defines the magic code sequences which the JITter spots=
and
- handles magically. Don't look too closely at them; they will rot
- your brain. We must ensure that the default value gets put in the re=
turn
- slot, so that everything works when this is executed not under Valgri=
nd.
- Args are passed in a memory block, and so there's no intrinsic limit =
to
- the number that could be passed, but it's currently four.
- =20
- The macro args are:=20
- _zzq_rlval result lvalue
- _zzq_default default value (result returned when running on real =
CPU)
- _zzq_request request code
- _zzq_arg1..4 request params
-
- Nb: we put the assembly code sequences for all architectures in this =
one
- file. This is because this file must be stand-alone, so we can't rel=
y on
- eg. x86/ subdirectories like we do within the rest of Valgrind.
-*/
-
-#ifdef __amd64__
-extern int printf (__const char *__restrict __format, ...);
-extern void exit (int __status);
-#define VALGRIND_MAGIC_SEQUENCE( \
- _zzq_rlval, _zzq_default, _zzq_request, \
- _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4) \
- \
- { volatile unsigned long long _zzq_args[5]; \
- _zzq_args[0] =3D (volatile unsigned long long)(_zzq_request); \
- _zzq_args[1] =3D (volatile unsigned long long)(_zzq_arg1); \
- _zzq_args[2] =3D (volatile unsigned long long)(_zzq_arg2); \
- _zzq_args[3] =3D (volatile unsigned long long)(_zzq_arg3); \
- _zzq_args[4] =3D (volatile unsigned long long)(_zzq_arg4); \
- asm volatile("roll $29, %%eax ; roll $3, %%eax\n\t" \
- "rorl $27, %%eax ; rorl $5, %%eax\n\t" \
- "roll $13, %%eax ; roll $19, %%eax" \
- : "=3Dd" (_zzq_rlval) \
- : "a" (&_zzq_args[0]), "0" (_zzq_default) \
- : "cc", "memory" \
- ); \
- }
-// XXX: make sure that the register holding the args and the register ta=
king
-// the return value match VGA_CLREQ_ARGS and VGA_CLREQ_RET in
-// amd64/core_arch.h!
-#endif // __amd64__
-
-#ifdef __i386__
-#define VALGRIND_MAGIC_SEQUENCE( \
- _zzq_rlval, _zzq_default, _zzq_request, \
- _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4) \
- \
- { unsigned int _zzq_args[5]; \
- _zzq_args[0] =3D (unsigned int)(_zzq_request); \
- _zzq_args[1] =3D (unsigned int)(_zzq_arg1); \
- _zzq_args[2] =3D (unsigned int)(_zzq_arg2); \
- _zzq_args[3] =3D (unsigned int)(_zzq_arg3); \
- _zzq_args[4] =3D (unsigned int)(_zzq_arg4); \
- asm volatile("roll $29, %%eax ; roll $3, %%eax\n\t" \
- "rorl $27, %%eax ; rorl $5, %%eax\n\t" \
- "roll $13, %%eax ; roll $19, %%eax" \
- : "=3Dd" (_zzq_rlval) \
- : "a" (&_zzq_args[0]), "0" (_zzq_default) \
- : "cc", "memory" \
- ); \
- }
-#endif // __i386__
-// Insert assembly code for other architectures here...
-
-#ifdef __arm__
-// XXX: terporary, until MAGIC_SEQUENCE is written properly
-extern int printf (__const char *__restrict __format, ...);
-extern void exit (int __status);
-#define VALGRIND_MAGIC_SEQUENCE( =
\
- _zzq_rlval, _zzq_default, _zzq_request, =
\
- _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4) =
\
- =
\
- { volatile unsigned int _zzq_args[5]; =
\
- _zzq_args[0] =3D (volatile unsigned int)(_zzq_request); =
\
- _zzq_args[1] =3D (volatile unsigned int)(_zzq_arg1); =
\
- _zzq_args[2] =3D (volatile unsigned int)(_zzq_arg2); =
\
- _zzq_args[3] =3D (volatile unsigned int)(_zzq_arg3); =
\
- _zzq_args[4] =3D (volatile unsigned int)(_zzq_arg4); =
\
- (_zzq_rlval) =3D (_zzq_default);/* temporary only */ \
- printf("argh: MAGIC_SEQUENCE"); exit(1); \
- asm volatile(""); =
\
- }
-// XXX: make sure that the register holding the args and the register ta=
king
-// the return value match VGA_CLREQ_ARGS and VGA_CLREQ_RET in
-// arm/core_arch.h!
-#endif // __arm__
-
-#else /* NVALGRIND */
-/* Define NVALGRIND to completely remove the Valgrind magic sequence
- from the compiled code (analogous to NDEBUG's effects on
- assert()) */
-#define VALGRIND_MAGIC_SEQUENCE( \
- _zzq_rlval, _zzq_default, _zzq_request, =
\
- _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4) =
\
- { \
- (_zzq_rlval) =3D (_zzq_default); \
- }
-#endif /* NVALGRIND */
-
-
-/* Some request codes. There are many more of these, but most are not
- exposed to end-user view. These are the public ones, all of the
- form 0x1000 + small_number.
-
- Core ones are in the range 0x00000000--0x0000ffff. The non-public on=
es
- start at 0x2000.
-*/
-
-// These macros are used by tools -- they must be public, but don't embe=
d them
-// into other programs.
-#define VG_USERREQ_TOOL_BASE(a,b) \
- ((unsigned int)(((a)&0xff) << 24 | ((b)&0xff) << 16))
-#define VG_IS_TOOL_USERREQ(a, b, v) \
- (VG_USERREQ_TOOL_BASE(a,b) =3D=3D ((v) & 0xffff0000))
-
-typedef
- enum { VG_USERREQ__RUNNING_ON_VALGRIND =3D 0x1001,
- VG_USERREQ__DISCARD_TRANSLATIONS =3D 0x1002,
-
- /* These allow any function to be called from the
- simulated CPU but run on the real CPU.
- Nb: the first arg passed to the function is always the Thre=
adId of
- the running thread! So CLIENT_CALL0 actually requires a 1 =
arg
- function, etc. */
- VG_USERREQ__CLIENT_CALL0 =3D 0x1101,
- VG_USERREQ__CLIENT_CALL1 =3D 0x1102,
- VG_USERREQ__CLIENT_CALL2 =3D 0x1103,
- VG_USERREQ__CLIENT_CALL3 =3D 0x1104,
-
- /* Can be useful in regression testing suites -- eg. can send
- Valgrind's output to /dev/null and still count errors. */
- VG_USERREQ__COUNT_ERRORS =3D 0x1201,
-
- /* These are useful and can be interpreted by any tool that tr=
acks
- malloc() et al, by using vg_replace_malloc.c. */
- VG_USERREQ__MALLOCLIKE_BLOCK =3D 0x1301,
- VG_USERREQ__FREELIKE_BLOCK =3D 0x1302,
- /* Memory pool support. */
- VG_USERREQ__CREATE_MEMPOOL =3D 0x1303,
- VG_USERREQ__DESTROY_MEMPOOL =3D 0x1304,
- VG_USERREQ__MEMPOOL_ALLOC =3D 0x1305,
- VG_USERREQ__MEMPOOL_FREE =3D 0x1306,
-
- /* Allow printfs to valgrind log. */
- VG_USERREQ__PRINTF =3D 0x1401,
- VG_USERREQ__PRINTF_BACKTRACE =3D 0x1402
- } Vg_ClientRequest;
-
-#ifndef __GNUC__
-#define __extension__
-#endif
-
-/* Returns the number of Valgrinds this code is running under. That is,
- 0 if running natively, 1 if running under Valgrind, 2 if running unde=
r
- Valgrind which is running under another Valgrind, etc. */
-#define RUNNING_ON_VALGRIND __extension__ \
- ({unsigned int _qzz_res; \
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0 /* returned if not */, \
- VG_USERREQ__RUNNING_ON_VALGRIND, \
- 0, 0, 0, 0); \
- _qzz_res; \
- })
-
-
-/* Discard translation of code in the range [_qzz_addr .. _qzz_addr +
- _qzz_len - 1]. Useful if you are debugging a JITter or some such,
- since it provides a way to make sure valgrind will retranslate the
- invalidated area. Returns no value. */
-#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len) \
- {unsigned int _qzz_res; \
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
- VG_USERREQ__DISCARD_TRANSLATIONS, \
- _qzz_addr, _qzz_len, 0, 0); \
- }
-
-#ifndef NVALGRIND
-
-int VALGRIND_PRINTF(const char *format, ...)
- __attribute__((format(__printf__, 1, 2)));
-__attribute__((weak))
-int
-VALGRIND_PRINTF(const char *format, ...)
-{
- unsigned long _qzz_res;
- va_list vargs;
- va_start(vargs, format);
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__PRINTF,
- (unsigned long)format, (unsigned long)vargs, =
0, 0);
- va_end(vargs);
- return (int)_qzz_res;
-}
-
-int VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
- __attribute__((format(__printf__, 1, 2)));
-__attribute__((weak))
-int
-VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
-{
- unsigned long _qzz_res;
- va_list vargs;
- va_start(vargs, format);
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__PRINTF_BACKTRACE,
- (unsigned long)format, (unsigned long)vargs, =
0, 0);
- va_end(vargs);
- return (int)_qzz_res;
-}
-
-#else /* NVALGRIND */
-
-#define VALGRIND_PRINTF(...)
-#define VALGRIND_PRINTF_BACKTRACE(...)
-
-#endif /* NVALGRIND */
-
-/* These requests allow control to move from the simulated CPU to the
- real CPU, calling an arbitary function */
-#define VALGRIND_NON_SIMD_CALL0(_qyy_fn) \
- ({unsigned long _qyy_res; \
- VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, \
- VG_USERREQ__CLIENT_CALL0, \
- _qyy_fn, \
- 0, 0, 0); \
- _qyy_res; \
- })
-
-#define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1) \
- ({unsigned long _qyy_res; \
- VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, \
- VG_USERREQ__CLIENT_CALL1, \
- _qyy_fn, \
- _qyy_arg1, 0, 0); \
- _qyy_res; \
- })
-
-#define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2) \
- ({unsigned long _qyy_res; \
- VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, \
- VG_USERREQ__CLIENT_CALL2, \
- _qyy_fn, \
- _qyy_arg1, _qyy_arg2, 0); \
- _qyy_res; \
- })
-
-#define VALGRIND_NON_SIMD_CALL3(_qyy_fn, _qyy_arg1, _qyy_arg2, _qyy_arg3=
) \
- ({unsigned long _qyy_res; \
- VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, \
- VG_USERREQ__CLIENT_CALL3, \
- _qyy_fn, \
- _qyy_arg1, _qyy_arg2, _qyy_arg3); \
- _qyy_res; \
- })
-
-
-/* Counts the number of errors that have been recorded by a tool. Nb:
- the tool must record the errors with VG_(maybe_record_error)() or
- VG_(unique_error)() for them to be counted. */
-#define VALGRIND_COUNT_ERRORS =
\
- ({unsigned int _qyy_res; =
\
- VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */, =
\
- VG_USERREQ__COUNT_ERRORS, =
\
- 0, 0, 0, 0); =
\
- _qyy_res; =
\
- })
-
-/* Mark a block of memory as having been allocated by a malloc()-like
- function. `addr' is the start of the usable block (ie. after any
- redzone) `rzB' is redzone size if the allocator can apply redzones;
- use '0' if not. Adding redzones makes it more likely Valgrind will s=
pot
- block overruns. `is_zeroed' indicates if the memory is zeroed, as it=
is
- for calloc(). Put it immediately after the point where a block is
- allocated.=20
- =20
- If you're allocating memory via superblocks, and then handing out sma=
ll
- chunks of each superblock, if you don't have redzones on your small
- blocks, it's worth marking the superblock with VALGRIND_MAKE_NOACCESS
- when it's created, so that block overruns are detected. But if you c=
an
- put redzones on, it's probably better to not do this, so that message=
s
- for small overruns are described in terms of the small block rather t=
han
- the superblock (but if you have a big overrun that skips over a redzo=
ne,
- you could miss an error this way). See memcheck/tests/custom_alloc.c
- for an example.
-
- Nb: block must be freed via a free()-like function specified
- with VALGRIND_FREELIKE_BLOCK or mismatch errors will occur. */
-#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed) \
- {unsigned int _qzz_res; \
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
- VG_USERREQ__MALLOCLIKE_BLOCK, \
- addr, sizeB, rzB, is_zeroed); \
- }
-
-/* Mark a block of memory as having been freed by a free()-like function=
.
- `rzB' is redzone size; it must match that given to
- VALGRIND_MALLOCLIKE_BLOCK. Memory not freed will be detected by the =
leak
- checker. Put it immediately after the point where the block is freed=
. */
-#define VALGRIND_FREELIKE_BLOCK(addr, rzB) \
- {unsigned int _qzz_res; \
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
- VG_USERREQ__FREELIKE_BLOCK, \
- addr, rzB, 0, 0); \
- }
-
-/* Create a memory pool. */
-#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed) \
- {unsigned int _qzz_res; \
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
- VG_USERREQ__CREATE_MEMPOOL, \
- pool, rzB, is_zeroed, 0); \
- }
-
-/* Destroy a memory pool. */
-#define VALGRIND_DESTROY_MEMPOOL(pool) \
- {unsigned int _qzz_res; \
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
- VG_USERREQ__DESTROY_MEMPOOL, \
- pool, 0, 0, 0); \
- }
-
-/* Associate a piece of memory with a memory pool. */
-#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size) \
- {unsigned int _qzz_res; \
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
- VG_USERREQ__MEMPOOL_ALLOC, \
- pool, addr, size, 0); \
- }
-
-/* Disassociate a piece of memory from a memory pool. */
-#define VALGRIND_MEMPOOL_FREE(pool, addr) \
- {unsigned int _qzz_res; \
- VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, \
- VG_USERREQ__MEMPOOL_FREE, \
- pool, addr, 0, 0); \
- }
-
-#endif /* __VALGRIND_H */
|
|
From: <sv...@va...> - 2005-05-16 19:34:56
|
Author: njn
Date: 2005-05-16 04:36:19 +0100 (Mon, 16 May 2005)
New Revision: 3734
Added:
trunk/include/vki-arm-linux.h
trunk/include/vki_posixtypes-arm-linux.h
Removed:
trunk/include/arm-linux/
trunk/include/linux/
Modified:
trunk/include/Makefile.am
Log:
Complete restructuring of include/ directory -- I forgot about the ARM
stuff.
Modified: trunk/include/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/include/Makefile.am 2005-05-16 03:25:12 UTC (rev 3733)
+++ trunk/include/Makefile.am 2005-05-16 03:36:19 UTC (rev 3734)
@@ -20,8 +20,10 @@
valgrind.h \
vki-linux.h \
vki-amd64-linux.h \
+ vki-arm-linux.h \
vki-x86-linux.h \
vki_posixtypes-amd64-linux.h \
+ vki_posixtypes-arm-linux.h \
vki_posixtypes-x86-linux.h
=20
BUILT_SOURCES =3D valgrind.h
Copied: trunk/include/vki-arm-linux.h (from rev 3733, trunk/include/arm-l=
inux/vki_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/include/arm-linux/vki_arch.h 2005-05-16 03:25:12 UTC (rev 3733)
+++ trunk/include/vki-arm-linux.h 2005-05-16 03:36:19 UTC (rev 3734)
@@ -0,0 +1,620 @@
+
+/*--------------------------------------------------------------------*/
+/*--- ARM/Linux-specific kernel interface. vki-arm-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ 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 __VKI_ARM_LINUX_H
+#define __VKI_ARM_LINUX_H
+
+// ARM can be big or little endian; we're only supporting little endian=
. =20
+#define VKI_LITTLE_ENDIAN 1
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/types.h
+//----------------------------------------------------------------------
+
+typedef unsigned char __vki_u8;
+
+typedef __signed__ short __vki_s16;
+typedef unsigned short __vki_u16;
+
+typedef unsigned int __vki_u32;
+
+typedef __signed__ long long __vki_s64;
+typedef unsigned long long __vki_u64;
+
+typedef unsigned short vki_u16;
+
+typedef unsigned int vki_u32;
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/page.h
+//----------------------------------------------------------------------
+
+#define VKI_PAGE_SHIFT 12
+#define VKI_PAGE_SIZE (1UL << VKI_PAGE_SHIFT)
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/signal.h
+//----------------------------------------------------------------------
+
+#define _VKI_NSIG 64
+#define _VKI_NSIG_BPW 32
+#define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
+
+typedef unsigned long vki_old_sigset_t; /* at least 32 bits */
+
+typedef struct {
+ unsigned long sig[_VKI_NSIG_WORDS];
+} vki_sigset_t;
+
+#define VKI_SIGHUP 1
+#define VKI_SIGINT 2
+#define VKI_SIGQUIT 3
+#define VKI_SIGILL 4
+#define VKI_SIGTRAP 5
+#define VKI_SIGABRT 6
+//#define VKI_SIGIOT 6
+#define VKI_SIGBUS 7
+#define VKI_SIGFPE 8
+#define VKI_SIGKILL 9
+#define VKI_SIGUSR1 10
+#define VKI_SIGSEGV 11
+#define VKI_SIGUSR2 12
+#define VKI_SIGPIPE 13
+#define VKI_SIGALRM 14
+#define VKI_SIGTERM 15
+#define VKI_SIGSTKFLT 16
+#define VKI_SIGCHLD 17
+#define VKI_SIGCONT 18
+#define VKI_SIGSTOP 19
+#define VKI_SIGTSTP 20
+#define VKI_SIGTTIN 21
+#define VKI_SIGTTOU 22
+#define VKI_SIGURG 23
+#define VKI_SIGXCPU 24
+#define VKI_SIGXFSZ 25
+#define VKI_SIGVTALRM 26
+#define VKI_SIGPROF 27
+#define VKI_SIGWINCH 28
+#define VKI_SIGIO 29
+#define VKI_SIGPWR 30
+#define VKI_SIGSYS 31
+#define VKI_SIGUNUSED 31
+
+/* These should not be considered constants from userland. */
+#define VKI_SIGRTMIN 32
+#define VKI_SIGRTMAX _VKI_NSIG
+
+#define VKI_SIGSWI 32
+
+#define VKI_SA_NOCLDSTOP 0x00000001
+#define VKI_SA_NOCLDWAIT 0x00000002
+#define VKI_SA_SIGINFO 0x00000004
+//#define VKI_SA_THIRTYTWO 0x02000000
+#define VKI_SA_RESTORER 0x04000000
+#define VKI_SA_ONSTACK 0x08000000
+#define VKI_SA_RESTART 0x10000000
+#define VKI_SA_NODEFER 0x40000000
+#define VKI_SA_RESETHAND 0x80000000
+
+#define VKI_SA_NOMASK VKI_SA_NODEFER
+#define VKI_SA_ONESHOT VKI_SA_RESETHAND
+//#define VKI_SA_INTERRUPT 0x20000000 /* dummy -- ignored */
+
+
+#define VKI_SS_ONSTACK 1
+#define VKI_SS_DISABLE 2
+
+#define VKI_MINSIGSTKSZ 2048
+
+#define VKI_SIG_BLOCK 0 /* for blocking signals */
+#define VKI_SIG_UNBLOCK 1 /* for unblocking signals */
+#define VKI_SIG_SETMASK 2 /* for setting the signal mask */
+
+/* Type of a signal handler. */
+typedef void __vki_signalfn_t(int);
+typedef __vki_signalfn_t __user *__vki_sighandler_t;
+
+typedef void __vki_restorefn_t(void);
+typedef __vki_restorefn_t __user *__vki_sigrestore_t;
+
+#define VKI_SIG_DFL ((__vki_sighandler_t)0) /* default signal handling *=
/
+#define VKI_SIG_IGN ((__vki_sighandler_t)1) /* ignore signal */
+
+struct vki_old_sigaction {
+ // [[Nb: a 'k' prefix is added to "sa_handler" because
+ // bits/sigaction.h (which gets dragged in somehow via signal.h)
+ // #defines it as something else. Since that is done for glibc'=
s
+ // purposes, which we don't care about here, we use our own name=
.]]
+ __vki_sighandler_t ksa_handler;
+ vki_old_sigset_t sa_mask;
+ unsigned long sa_flags;
+ __vki_sigrestore_t sa_restorer;
+};
+
+struct vki_sigaction {
+ // [[See comment about extra 'k' above]]
+ __vki_sighandler_t ksa_handler;
+ unsigned long sa_flags;
+ __vki_sigrestore_t sa_restorer;
+ vki_sigset_t sa_mask; /* mask last for extensibility */
+};
+
+typedef struct vki_sigaltstack {
+ void __user *ss_sp;
+ int ss_flags;
+ vki_size_t ss_size;
+} vki_stack_t;
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/sigcontext.h
+//----------------------------------------------------------------------
+
+struct vki_sigcontext {
+ unsigned long trap_no;
+ unsigned long error_code;
+ unsigned long oldmask;
+ unsigned long arm_r0;
+ unsigned long arm_r1;
+ unsigned long arm_r2;
+ unsigned long arm_r3;
+ unsigned long arm_r4;
+ unsigned long arm_r5;
+ unsigned long arm_r6;
+ unsigned long arm_r7;
+ unsigned long arm_r8;
+ unsigned long arm_r9;
+ unsigned long arm_r10;
+ unsigned long arm_fp;
+ unsigned long arm_ip;
+ unsigned long arm_sp;
+ unsigned long arm_lr;
+ unsigned long arm_pc;
+ unsigned long arm_cpsr;
+ unsigned long fault_address;
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/mman.h
+//----------------------------------------------------------------------
+
+#define VKI_PROT_READ 0x1 /* page can be read */
+#define VKI_PROT_WRITE 0x2 /* page can be written */
+#define VKI_PROT_EXEC 0x4 /* page can be executed */
+//#define VKI_PROT_SEM 0x8 /* page may be used for atomic ops */
+//#define VKI_PROT_NONE 0x0 /* page can not be accessed */
+
+#define VKI_MAP_SHARED 0x01 /* Share changes */
+#define VKI_MAP_PRIVATE 0x02 /* Changes are private */
+#define VKI_MAP_TYPE 0x0f /* Mask for type of mapping */
+#define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
+#define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/fcntl.h
+//----------------------------------------------------------------------
+
+#define VKI_O_RDONLY 00
+#define VKI_O_WRONLY 01
+#define VKI_O_CREAT 0100 /* not fcntl */
+#define VKI_O_EXCL 0200 /* not fcntl */
+#define VKI_O_TRUNC 01000 /* not fcntl */
+#define VKI_O_NONBLOCK 04000
+
+#define VKI_F_DUPFD 0 /* dup */
+#define VKI_F_GETFD 1 /* get close_on_exec */
+#define VKI_F_SETFD 2 /* set/clear close_on_exec */
+#define VKI_F_GETFL 3 /* get file->f_flags */
+#define VKI_F_SETFL 4 /* set file->f_flags */
+#define VKI_F_GETLK 5
+#define VKI_F_SETLK 6
+#define VKI_F_SETLKW 7
+
+#define VKI_F_SETOWN 8 /* for sockets. */
+#define VKI_F_GETOWN 9 /* for sockets. */
+#define VKI_F_SETSIG 10 /* for sockets. */
+#define VKI_F_GETSIG 11 /* for sockets. */
+
+#define VKI_F_GETLK64 12 /* using 'struct flock64' */
+#define VKI_F_SETLK64 13
+#define VKI_F_SETLKW64 14
+
+/* for F_[GET|SET]FL */
+#define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+#define VKI_F_LINUX_SPECIFIC_BASE 1024
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/resource.h
+//----------------------------------------------------------------------
+
+#define VKI_RLIMIT_DATA 2 /* max data size */
+#define VKI_RLIMIT_STACK 3 /* max stack size */
+#define VKI_RLIMIT_CORE 4 /* max core file size */
+#define VKI_RLIMIT_NOFILE 7 /* max number of open files */
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/socket.h
+//----------------------------------------------------------------------
+
+#define VKI_SOL_SOCKET 1
+
+#define VKI_SO_TYPE 3
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/sockios.h
+//----------------------------------------------------------------------
+
+#define VKI_SIOCSPGRP 0x8902
+#define VKI_SIOCGPGRP 0x8904
+#define VKI_SIOCGSTAMP 0x8906 /* Get stamp */
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/stat.h
+//----------------------------------------------------------------------
+
+// [[Nb: resolved some #ifdefs by assuming __ARMEB__ is false, ie. that
+// we're not big-endian.]]
+struct vki_stat {
+ unsigned long st_dev;
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned long st_rdev;
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct vki_stat64 {
+ unsigned long long st_dev;
+ unsigned char __pad0[4];
+
+#define STAT64_HAS_BROKEN_ST_INO 1
+ unsigned long __st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+
+ unsigned long st_uid;
+ unsigned long st_gid;
+
+ unsigned long long st_rdev;
+ unsigned char __pad3[4];
+
+ long long st_size;
+ unsigned long st_blksize;
+
+ unsigned long st_blocks; /* Number 512-byte blocks allocated. */
+ unsigned long __pad4; /* Future possible st_blocks hi bits */
+
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+
+ unsigned long long st_ino;
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/statfs.h
+//----------------------------------------------------------------------
+
+// [[Nb: asm-arm/statfs.h just #include asm-generic/statfs.h directly]]
+struct vki_statfs {
+ __vki_u32 f_type;
+ __vki_u32 f_bsize;
+ __vki_u32 f_blocks;
+ __vki_u32 f_bfree;
+ __vki_u32 f_bavail;
+ __vki_u32 f_files;
+ __vki_u32 f_ffree;
+ __vki_kernel_fsid_t f_fsid;
+ __vki_u32 f_namelen;
+ __vki_u32 f_frsize;
+ __vki_u32 f_spare[5];
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/termios.h
+//----------------------------------------------------------------------
+
+struct vki_winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+#define VKI_NCC 8
+struct vki_termio {
+ unsigned short c_iflag; /* input mode flags */
+ unsigned short c_oflag; /* output mode flags */
+ unsigned short c_cflag; /* control mode flags */
+ unsigned short c_lflag; /* local mode flags */
+ unsigned char c_line; /* line discipline */
+ unsigned char c_cc[VKI_NCC]; /* control characters */
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/termbits.h
+//----------------------------------------------------------------------
+
+typedef unsigned char vki_cc_t;
+typedef unsigned int vki_tcflag_t;
+
+#define VKI_NCCS 19
+struct vki_termios {
+ vki_tcflag_t c_iflag; /* input mode flags */
+ vki_tcflag_t c_oflag; /* output mode flags */
+ vki_tcflag_t c_cflag; /* control mode flags */
+ vki_tcflag_t c_lflag; /* local mode flags */
+ vki_cc_t c_line; /* line discipline */
+ vki_cc_t c_cc[VKI_NCCS]; /* control characters */
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/ioctl.h
+//----------------------------------------------------------------------
+
+#define _VKI_IOC_NRBITS 8
+#define _VKI_IOC_TYPEBITS 8
+#define _VKI_IOC_SIZEBITS 14
+#define _VKI_IOC_DIRBITS 2
+
+#define _VKI_IOC_SIZEMASK ((1 << _VKI_IOC_SIZEBITS)-1)
+#define _VKI_IOC_DIRMASK ((1 << _VKI_IOC_DIRBITS)-1)
+
+#define _VKI_IOC_NRSHIFT 0
+#define _VKI_IOC_TYPESHIFT (_VKI_IOC_NRSHIFT+_VKI_IOC_NRBITS)
+#define _VKI_IOC_SIZESHIFT (_VKI_IOC_TYPESHIFT+_VKI_IOC_TYPEBITS)
+#define _VKI_IOC_DIRSHIFT (_VKI_IOC_SIZESHIFT+_VKI_IOC_SIZEBITS)
+
+#define _VKI_IOC_NONE 0U
+#define _VKI_IOC_WRITE 1U
+#define _VKI_IOC_READ 2U
+
+#define _VKI_IOC(dir,type,nr,size) \
+ (((dir) << _VKI_IOC_DIRSHIFT) | \
+ ((type) << _VKI_IOC_TYPESHIFT) | \
+ ((nr) << _VKI_IOC_NRSHIFT) | \
+ ((size) << _VKI_IOC_SIZESHIFT))
+
+/* used to create numbers */
+#define _VKI_IO(type,nr) _VKI_IOC(_VKI_IOC_NONE,(type),(nr),0)
+#define _VKI_IOR(type,nr,size) _VKI_IOC(_VKI_IOC_READ,(type),(nr),sizeof=
(size))
+#define _VKI_IOW(type,nr,size) _VKI_IOC(_VKI_IOC_WRITE,(type),(nr),sizeo=
f(size))
+#define _VKI_IOWR(type,nr,size) _VKI_IOC(_VKI_IOC_READ|_VKI_IOC_WRITE,(t=
ype),(nr),sizeof(size))
+
+/* used to decode ioctl numbers.. */
+#define _VKI_IOC_DIR(nr) (((nr) >> _VKI_IOC_DIRSHIFT) & _VKI_IOC_DIRMASK=
)
+#define _VKI_IOC_SIZE(nr) (((nr) >> _VKI_IOC_SIZESHIFT) & _VKI_IOC_SIZEM=
ASK)
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/ioctls.h
+//----------------------------------------------------------------------
+
+#define VKI_TCGETS 0x5401
+#define VKI_TCSETS 0x5402
+#define VKI_TCSETSW 0x5403
+#define VKI_TCSETSF 0x5404
+#define VKI_TCGETA 0x5405
+#define VKI_TCSETA 0x5406
+#define VKI_TCSETAW 0x5407
+#define VKI_TCSETAF 0x5408
+#define VKI_TCSBRK 0x5409
+#define VKI_TCXONC 0x540A
+#define VKI_TCFLSH 0x540B
+#define VKI_TIOCSCTTY 0x540E
+#define VKI_TIOCGPGRP 0x540F
+#define VKI_TIOCSPGRP 0x5410
+#define VKI_TIOCOUTQ 0x5411
+#define VKI_TIOCGWINSZ 0x5413
+#define VKI_TIOCSWINSZ 0x5414
+#define VKI_TIOCMBIS 0x5416
+#define VKI_TIOCMBIC 0x5417
+#define VKI_TIOCMSET 0x5418
+#define VKI_FIONREAD 0x541B
+#define VKI_TIOCLINUX 0x541C
+#define VKI_FIONBIO 0x5421
+#define VKI_TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
+#define VKI_TIOCGPTN _VKI_IOR('T',0x30, unsigned int) /* Get Pty Number =
(of pty-mux device) */
+#define VKI_TIOCSPTLCK _VKI_IOW('T',0x31, int) /* Lock/unlock Pty */
+
+#define VKI_FIOASYNC 0x5452
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/poll.h
+//----------------------------------------------------------------------
+
+#define VKI_POLLIN 0x0001
+
+struct vki_pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/user.h
+//----------------------------------------------------------------------
+
+// XXX: For x86, had here:
+// struct vki_user_i387_struct
+// struct vki_user_fxsr_struct
+// struct vki_user_regs_struct
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/ptrace.h
+//----------------------------------------------------------------------
+
+struct vki_pt_regs {
+ long uregs[18];
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/elf.h
+//----------------------------------------------------------------------
+
+typedef unsigned long vki_elf_greg_t;
+
+#define VKI_ELF_NGREG (sizeof (struct vki_pt_regs) / sizeof(vki_elf_greg=
_t))
+typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG];
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/ucontext.h
+//----------------------------------------------------------------------
+
+struct vki_ucontext {
+ unsigned long uc_flags;
+ struct vki_ucontext *uc_link;
+ vki_stack_t uc_stack;
+ struct vki_sigcontext uc_mcontext;
+ vki_sigset_t uc_sigmask; /* mask last for extensibility */
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/ipcbuf.h
+//----------------------------------------------------------------------
+
+struct vki_ipc64_perm
+{
+ __vki_kernel_key_t key;
+ __vki_kernel_uid32_t uid;
+ __vki_kernel_gid32_t gid;
+ __vki_kernel_uid32_t cuid;
+ __vki_kernel_gid32_t cgid;
+ __vki_kernel_mode_t mode;
+ unsigned short __pad1;
+ unsigned short seq;
+ unsigned short __pad2;
+ unsigned long __unused1;
+ unsigned long __unused2;
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/sembuf.h
+//----------------------------------------------------------------------
+
+struct vki_semid64_ds {
+ struct vki_ipc64_perm sem_perm; /* permissions .. see ipc.h */
+ __vki_kernel_time_t sem_otime; /* last semop time */
+ unsigned long __unused1;
+ __vki_kernel_time_t sem_ctime; /* last change time */
+ unsigned long __unused2;
+ unsigned long sem_nsems; /* no. of semaphores in array */
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/msgbuf.h
+//----------------------------------------------------------------------
+
+struct vki_msqid64_ds {
+ struct vki_ipc64_perm msg_perm;
+ __vki_kernel_time_t msg_stime; /* last msgsnd time */
+ unsigned long __unused1;
+ __vki_kernel_time_t msg_rtime; /* last msgrcv time */
+ unsigned long __unused2;
+ __vki_kernel_time_t msg_ctime; /* last change time */
+ unsigned long __unused3;
+ unsigned long msg_cbytes; /* current number of bytes on queue */
+ unsigned long msg_qnum; /* number of messages in queue */
+ unsigned long msg_qbytes; /* max number of bytes on queue */
+ __vki_kernel_pid_t msg_lspid; /* pid of last msgsnd */
+ __vki_kernel_pid_t msg_lrpid; /* last receive pid */
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/ipc.h
+//----------------------------------------------------------------------
+
+struct vki_ipc_kludge {
+ struct vki_msgbuf __user *msgp;
+ long msgtyp;
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.9/include/asm-arm/shmbuf.h
+//----------------------------------------------------------------------
+
+struct vki_shmid64_ds {
+ struct vki_ipc64_perm shm_perm; /* operation perms */
+ vki_size_t shm_segsz; /* size of segment (bytes) */
+ __vki_kernel_time_t shm_atime; /* last attach time */
+ unsigned long __unused1;
+ __vki_kernel_time_t shm_dtime; /* last detach time */
+ unsigned long __unused2;
+ __vki_kernel_time_t shm_ctime; /* last change time */
+ unsigned long __unused3;
+ __vki_kernel_pid_t shm_cpid; /* pid of creator */
+ __vki_kernel_pid_t shm_lpid; /* pid of last operator */
+ unsigned long shm_nattch; /* no. of current attaches */
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct vki_shminfo64 {
+ unsigned long shmmax;
+ unsigned long shmmin;
+ unsigned long shmmni;
+ unsigned long shmseg;
+ unsigned long shmall;
+ unsigned long __unused1;
+ unsigned long __unused2;
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+//----------------------------------------------------------------------
+// And that's it!
+//----------------------------------------------------------------------
+
+#endif // __VKI_ARM_LINUX_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Copied: trunk/include/vki_posixtypes-arm-linux.h (from rev 3733, trunk/in=
clude/arm-linux/vki_arch_posixtypes.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/include/arm-linux/vki_arch_posixtypes.h 2005-05-16 03:25:12 UTC=
(rev 3733)
+++ trunk/include/vki_posixtypes-arm-linux.h 2005-05-16 03:36:19 UTC (rev=
3734)
@@ -0,0 +1,68 @@
+
+/*--------------------------------------------------------------------*/
+/*--- ARM/Linux-specific kernel interface: posix types. ---*/
+/*--- vki_posixtypes-arm-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ 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 __VKI_POSIXTYPES_ARM_LINUX_H
+#define __VKI_POSIXTYPES_ARM_LINUX_H
+
+//----------------------------------------------------------------------
+// From linux-2.6.8.1/include/asm-i386/posix_types.h
+//----------------------------------------------------------------------
+
+typedef unsigned short __vki_kernel_mode_t;
+typedef long __vki_kernel_off_t;
+typedef int __vki_kernel_pid_t;
+typedef unsigned short __vki_kernel_ipc_pid_t;
+typedef unsigned short __vki_kernel_uid_t;
+typedef unsigned short __vki_kernel_gid_t;
+typedef unsigned int __vki_kernel_size_t;
+typedef long __vki_kernel_time_t;
+typedef long __vki_kernel_suseconds_t;
+typedef long __vki_kernel_clock_t;
+typedef int __vki_kernel_timer_t;
+typedef int __vki_kernel_clockid_t;
+typedef char * __vki_kernel_caddr_t;
+typedef unsigned int __vki_kernel_uid32_t;
+typedef unsigned int __vki_kernel_gid32_t;
+
+typedef unsigned short __vki_kernel_old_uid_t;
+typedef unsigned short __vki_kernel_old_gid_t;
+
+typedef long long __vki_kernel_loff_t;
+
+typedef struct {
+ int val[2];
+} __vki_kernel_fsid_t;
+
+#endif // __VKI_POSIXTYPES_ARM_LINUX_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2005-05-16 19:34:28
|
Author: sewardj
Date: 2005-05-16 19:30:40 +0100 (Mon, 16 May 2005)
New Revision: 3744
Modified:
trunk/coregrind/vg_main.c
Log:
wibble
Modified: trunk/coregrind/vg_main.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/vg_main.c 2005-05-16 18:25:09 UTC (rev 3743)
+++ trunk/coregrind/vg_main.c 2005-05-16 18:30:40 UTC (rev 3744)
@@ -2001,7 +2001,7 @@
"Using LibVEX rev %s, a library for dynamic binary translation.=
",
LibVEX_Version() );
VG_(message)(Vg_UserMsg,=20
- "Copyright (C) 2004, and GNU GPL'd, by OpenWorks LLP.");
+ "Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.");
VG_(message)(Vg_UserMsg,
"Using valgrind-%s, a dynamic binary instrumentation framework.=
",
VERSION);
|
|
From: <sv...@va...> - 2005-05-16 19:33:44
|
Author: sewardj
Date: 2005-05-16 12:48:34 +0100 (Mon, 16 May 2005)
New Revision: 3738
Modified:
trunk/coregrind/vg_dwarf.c
Log:
CFI reader: partially handle DW_CFA_expression and
DW_CFA_def_cfa_expression in the sense that they are parsed correctly,
but the contained expression is ignored.
Modified: trunk/coregrind/vg_dwarf.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/vg_dwarf.c 2005-05-16 11:47:17 UTC (rev 3737)
+++ trunk/coregrind/vg_dwarf.c 2005-05-16 11:48:34 UTC (rev 3738)
@@ -862,6 +862,10 @@
=20
8 is the return address (EIP) */
=20
+/* Note that we don't support DWARF3 expressions (DW_CFA_expression,
+ DW_CFA_def_cfa_expression). The code just reads over them and
+ ignores them.=20
+*/
=20
/* --------------- Decls --------------- */
=20
@@ -906,6 +910,8 @@
DW_CFA_def_cfa =3D 0x0c,
DW_CFA_def_cfa_register =3D 0x0d,
DW_CFA_def_cfa_offset =3D 0x0e,
+ DW_CFA_def_cfa_expression =3D 0x0f, /* DWARF3 only */
+ DW_CFA_expression =3D 0x10, /* DWARF3 only */
DW_CFA_offset_extended_sf =3D 0x11, /* DWARF3 only */
DW_CFA_def_cfa_offset_sf =3D 0x13, /* DWARF3 only */
DW_CFA_lo_user =3D 0x1c,
@@ -940,7 +946,7 @@
=20
typedef
struct {
- enum { RR_Undef, RR_Same, RR_CFAoff, RR_Reg, RR_Arch } tag;
+ enum { RR_Undef, RR_Same, RR_CFAoff, RR_Reg, RR_Arch, RR_Expr } ta=
g;
=20
/* Note, .coff and .reg are never both in use. Therefore could
merge them into one. */
@@ -961,6 +967,7 @@
case RR_CFAoff: VG_(printf)("c%d ", reg->coff); break;
case RR_Reg: VG_(printf)("r%d ", reg->reg); break;
case RR_Arch: VG_(printf)("a "); break;
+ case RR_Expr: VG_(printf)("e "); break;
default: VG_(core_panic)("ppRegRule");
}
}
@@ -977,7 +984,7 @@
run_CF_instruction. */
/* The LOC entry */
Addr loc;
- /* The CFA entry */
+ /* The CFA entry. If -1, means we don't know (Dwarf3 Expression).=
*/
Int cfa_reg;
Int cfa_offset; /* in bytes */
/* register unwind rules */
@@ -1080,6 +1087,12 @@
initCfiSI(si);
=20
/* How to generate the CFA */
+ if (ctx->cfa_reg =3D=3D -1) {
+ /* it was set by DW_CFA_def_cfa_expression; we don't know what
+ it really is */
+ why =3D 6;
+ goto failed;
+ } else
if (ctx->cfa_reg =3D=3D SP_REG) {
si->cfa_sprel =3D True;
si->cfa_off =3D ctx->cfa_offset;
@@ -1132,7 +1145,7 @@
return True;
=20
failed:
- if (VG_(clo_verbosity) > 1) {
+ if (VG_(clo_verbosity) > 2 || VG_(clo_trace_cfi)) {
VG_(message)(Vg_DebugMsg,
"summarise_context(loc_start =3D %p)"
": cannot summarise(why=3D%d): ", loc_start, why);
@@ -1356,7 +1369,7 @@
UChar* instr,
UnwindContext* restore_ctx )
{
- Int off, reg, reg2, nleb;
+ Int off, reg, reg2, nleb, len;
UInt delta;
Int i =3D 0;
UChar hi2 =3D (instr[i] >> 6) & 3;
@@ -1474,6 +1487,32 @@
i +=3D nleb;
break;
=20
+ case DW_CFA_expression:
+ /* Too difficult to really handle; just skip over it and say
+ that we don't know what do to with the register. */
+ if (VG_(clo_trace_cfi))
+ VG_(printf)("DWARF2 CFI reader: "
+ "ignoring DW_CFA_expression\n");
+ reg =3D read_leb128( &instr[i], &nleb, 0 );
+ i +=3D nleb;
+ len =3D read_leb128( &instr[i], &nleb, 0 );
+ i +=3D nleb;
+ i +=3D len;
+ if (reg < 0 || reg >=3D N_CFI_REGS)=20
+ return 0; /* fail */
+ ctx->reg[reg].tag =3D RR_Expr;
+ break;
+
+ case DW_CFA_def_cfa_expression:
+ if (VG_(clo_trace_cfi))
+ VG_(printf)("DWARF2 CFI reader: "
+ "ignoring DW_CFA_def_cfa_expression\n");
+ len =3D read_leb128( &instr[i], &nleb, 0 );
+ i +=3D nleb;
+ i +=3D len;
+ ctx->cfa_reg =3D -1; /* indicating we don't know */
+ break;
+
default:=20
VG_(message)(Vg_DebugMsg, "DWARF2 CFI reader: unhandled CFI "
"instruction 0:%d", (Int)lo6);=20
@@ -1490,7 +1529,7 @@
static Int show_CF_instruction ( UChar* instr )
{
UInt delta;
- Int off, reg, reg2, nleb;
+ Int off, reg, reg2, nleb, len;
Addr loc;
Int i =3D 0;
UChar hi2 =3D (instr[i] >> 6) & 3;
@@ -1581,6 +1620,22 @@
VG_(printf)("DW_CFA_GNU_args_size(%d)\n", off );=20
break;
=20
+ case DW_CFA_def_cfa_expression:
+ len =3D read_leb128( &instr[i], &nleb, 0 );
+ i +=3D nleb;
+ i +=3D len;
+ VG_(printf)("DW_CFA_def_cfa_expression(length %d)\n", len);
+ break;
+
+ case DW_CFA_expression:
+ reg =3D read_leb128( &instr[i], &nleb, 0 );
+ i +=3D nleb;
+ len =3D read_leb128( &instr[i], &nleb, 0 );
+ i +=3D nleb;
+ i +=3D len;
+ VG_(printf)("DW_CFA_expression(r%d, length %d)\n", reg, len);
+ break;
+
default:=20
VG_(printf)("0:%d\n", (Int)lo6);=20
break;
|
|
From: <sv...@va...> - 2005-05-16 19:33:43
|
Author: sewardj
Date: 2005-05-16 12:47:17 +0100 (Mon, 16 May 2005)
New Revision: 3737
Modified:
trunk/coregrind/m_stacktrace.c
Log:
Fix comment.
Modified: trunk/coregrind/m_stacktrace.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_stacktrace.c 2005-05-16 07:31:57 UTC (rev 3736)
+++ trunk/coregrind/m_stacktrace.c 2005-05-16 11:47:17 UTC (rev 3737)
@@ -120,7 +120,7 @@
we can safely try the old-fashioned method. */
/* This bit is supposed to deal with frames resulting from
functions which begin "pushl% ebp ; movl %esp, %ebp" (x86)
- or "pushl% ebp ; movl %esp, %ebp" (amd64). Unfortunately,
+ or "pushq %rbp ; movq %rsp, %rbp" (amd64). Unfortunately,
since we can't (easily) look at the insns at the start of
the fn, like GDB does, there's no reliable way to tell.
Hence the hack of first trying out CFI, and if that fails,
|
|
From: Tom H. <to...@co...> - 2005-05-16 02:36:08
|
Nightly build on dunsmere ( athlon, Fedora Core 3 ) started at 2005-05-16 03:30:05 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 175 tests, 167 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/badaddrvalue (stderr) memcheck/tests/badfree-2trace (stderr) memcheck/tests/badfree (stderr) memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/badloop (stderr) memcheck/tests/badpoll (stderr) memcheck/tests/badrw (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/clientperm (stderr) memcheck/tests/custom_alloc (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/doublefree (stderr) memcheck/tests/errs1 (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/exitprog (stderr) memcheck/tests/fprw (stderr) memcheck/tests/fwrite (stderr) memcheck/tests/inits (stderr) memcheck/tests/inline (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/malloc1 (stderr) memcheck/tests/malloc2 (stderr) memcheck/tests/malloc3 (stderr) memcheck/tests/manuel1 (stderr) memcheck/tests/manuel2 (stderr) memcheck/tests/manuel3 (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/memalign2 (stderr) memcheck/tests/memalign_test (stderr) memcheck/tests/memcmptest (stderr) memcheck/tests/mempool (stderr) memcheck/tests/mismatches (stderr) memcheck/tests/mmaptest (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/new_nothrow (stderr) memcheck/tests/new_override (stderr) memcheck/tests/null_socket (stderr) memcheck/tests/overlap (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/post-syscall (stderr) memcheck/tests/realloc1 (stderr) memcheck/tests/realloc2 (stderr) memcheck/tests/realloc3 (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/signal2 (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/str_tester (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp2 (stderr) memcheck/tests/suppfree (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/writev (stderr) memcheck/tests/x86/fpeflags (stderr) memcheck/tests/x86/pushfpopf (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_exit_group (stderr) memcheck/tests/x86/scalar_fork (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/scalar_vfork (stderr) memcheck/tests/x86/tronical (stderr) memcheck/tests/zeropage (stderr) cachegrind/tests/chdir (stderr) cachegrind/tests/dlclose (stderr) cachegrind/tests/x86/fpu-28-108 (stderr) corecheck/tests/as_mmap (stderr) corecheck/tests/as_shm (stderr) corecheck/tests/erringfds (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_creat (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_open (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) corecheck/tests/pth_atfork1 (stderr) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) corecheck/tests/pth_cvsimple (stderr) corecheck/tests/pth_empty (stderr) corecheck/tests/pth_exit (stderr) corecheck/tests/pth_exit2 (stderr) corecheck/tests/pth_mutexspeed (stderr) corecheck/tests/pth_once (stderr) corecheck/tests/pth_rwlock (stderr) corecheck/tests/res_search (stderr) corecheck/tests/sigkill (stderr) corecheck/tests/threadederrno (stderr) corecheck/tests/vgprintf (stderr) massif/tests/toobig-allocs (stderr) massif/tests/true_html (stderr) massif/tests/true_text (stderr) lackey/tests/true (stderr) none/tests/args (stderr) none/tests/async-sigs (stderr) none/tests/bitfield1 (stderr) none/tests/blockfault (stderr) none/tests/closeall (stderr) none/tests/coolo_sigaction (stderr) none/tests/coolo_strlen (stderr) none/tests/discard (stderr) none/tests/exec-sigmask (stderr) none/tests/execve (stderr) none/tests/faultstatus (stderr) none/tests/fcntl_setown (stderr) none/tests/floored (stderr) none/tests/fork (stderr) none/tests/fucomip (stderr) none/tests/gxx304 (stderr) none/tests/manythreads (stderr) none/tests/map_unaligned (stderr) none/tests/map_unmap (stderr) none/tests/mq (stderr) none/tests/mremap (stderr) none/tests/munmap_exe (stderr) none/tests/pending (stderr) none/tests/pth_blockedsig (stderr) none/tests/pth_stackalign (stderr) none/tests/rcrl (stderr) none/tests/readline1 (stderr) none/tests/resolv (stderr) none/tests/rlimit_nofile (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/sem (stderr) none/tests/semlimit (stderr) none/tests/sha1_test (stderr) none/tests/shortpush (stderr) none/tests/shorts (stderr) none/tests/sigstackgrowth (stderr) none/tests/smc1 (stderr) none/tests/stackgrowth (stderr) none/tests/syscall-restart1 (stderr) none/tests/syscall-restart2 (stderr) none/tests/system (stderr) none/tests/thread-exits (stderr) none/tests/threaded-fork (stderr) none/tests/tls (stderr) none/tests/x86/badseg (stderr) none/tests/x86/bt_everything (stderr) none/tests/x86/bt_literal (stderr) none/tests/x86/cpuid (stderr) none/tests/x86/fpu_lazy_eflags (stderr) none/tests/x86/getseg (stderr) none/tests/x86/insn_basic (stderr) none/tests/x86/insn_cmov (stderr) none/tests/x86/insn_fpu (stderr) none/tests/x86/insn_mmx (stderr) none/tests/x86/insn_mmxext (stderr) none/tests/x86/insn_sse (stderr) none/tests/x86/int (stderr) none/tests/x86/pushpopseg (stderr) none/tests/x86/seg_override (stderr) none/tests/x86/sigcontext (stderr) none/tests/yield (stderr) |
|
From: Tom H. <th...@cy...> - 2005-05-16 02:31:28
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-05-16 03:25:02 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 174 tests, 3 stderr failures, 1 stdout failure ================= corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-05-16 02:25:53
|
Nightly build on ginetta ( i686, Red Hat 8.0 ) started at 2005-05-16 03:20:02 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 173 tests, 3 stderr failures, 0 stdout failures ================= corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-05-16 02:21:17
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-05-16 03:15:02 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 173 tests, 12 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vgtest_ume (stderr) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: <sv...@va...> - 2005-05-16 00:17:02
|
Author: njn
Date: 2005-05-16 01:16:56 +0100 (Mon, 16 May 2005)
New Revision: 3732
Modified:
trunk/coregrind/amd64/core_arch.h
trunk/coregrind/arm/core_arch.h
trunk/coregrind/m_stacktrace.c
trunk/coregrind/x86/core_arch.h
Log:
Moved the stack-walking macros into m_stacktrace.
Modified: 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-05-16 00:04:02 UTC (rev 3731)
+++ trunk/coregrind/amd64/core_arch.h 2005-05-16 00:16:56 UTC (rev 3732)
@@ -56,11 +56,6 @@
#define VGA_CLREQ_ARGS guest_RAX
#define VGA_CLREQ_RET guest_RDX
=20
-// Stack frame layout and linkage
-#define VGA_FIRST_STACK_FRAME(rbp) (rbp)
-#define VGA_STACK_FRAME_RET(rbp) (((UWord*)rbp)[1])
-#define VGA_STACK_FRAME_NEXT(rbp) (((UWord*)rbp)[0])
-
/* ---------------------------------------------------------------------
Architecture-specific part of a ThreadState
------------------------------------------------------------------ */
Modified: 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-05-16 00:04:02 UTC (rev 3731)
+++ trunk/coregrind/arm/core_arch.h 2005-05-16 00:16:56 UTC (rev 3732)
@@ -62,12 +62,6 @@
#define VGA_CLREQ_ARGS guest_R0
#define VGA_CLREQ_RET guest_R0
=20
-// Stack frame layout and linkage
-// XXX ToDo: ???
-#define VGA_FIRST_STACK_FRAME(ebp) (ebp)
-#define VGA_STACK_FRAME_RET(ebp) (((UInt*)ebp)[1])
-#define VGA_STACK_FRAME_NEXT(ebp) (((UInt*)ebp)[0])
-
// Get stack pointer and frame pointer
#define VGA_GET_REAL_STACK_PTR(esp) do { \
I_die_here; \
Modified: trunk/coregrind/m_stacktrace.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_stacktrace.c 2005-05-16 00:04:02 UTC (rev 3731)
+++ trunk/coregrind/m_stacktrace.c 2005-05-16 00:16:56 UTC (rev 3732)
@@ -35,6 +35,19 @@
/*--- Exported functions. ---*/
/*------------------------------------------------------------*/
=20
+// Stack frame layout and linkage
+#if defined(VGA_x86)
+# define FIRST_STACK_FRAME(ebp) (ebp)
+# define STACK_FRAME_RET(ebp) (((UWord*)ebp)[1])
+# define STACK_FRAME_NEXT(ebp) (((UWord*)ebp)[0])
+#elif defined(VGA_amd64)
+# define FIRST_STACK_FRAME(rbp) (rbp)
+# define STACK_FRAME_RET(rbp) (((UWord*)rbp)[1])
+# define STACK_FRAME_NEXT(rbp) (((UWord*)rbp)[0])
+#else
+# error Unknown platform
+#endif
+
/* Take a snapshot of the client's stack, putting the up to 'n_ips' IPs=20
into 'ips'. In order to be thread-safe, we pass in the thread's IP
and FP. Returns number of IPs put in 'ips'. */
@@ -82,6 +95,10 @@
user-space threads package work. JRS 20021001 */
} else {
=20
+ // XXX: I think this line is needed for PPC to work, but I'm not
+ // certain, so I'm commenting it out for the moment.
+ //fp =3D FIRST_STACK_FRAME(fp)
+
while (True) {
=20
if (i >=3D n_ips)
@@ -110,10 +127,10 @@
then use this as a fallback. */
if (fp_min <=3D fp && fp <=3D fp_max) {
/* fp looks sane, so use it. */
- ip =3D VGA_STACK_FRAME_RET(fp);
+ ip =3D STACK_FRAME_RET(fp);
sp =3D fp + sizeof(Addr) /*saved %ebp/%rbp*/=20
+ sizeof(Addr) /*ra*/;
- fp =3D VGA_STACK_FRAME_NEXT(fp);
+ fp =3D STACK_FRAME_NEXT(fp);
ips[i++] =3D ip;
if (debug)
VG_(printf)(" ipsF[%d]=3D%08p\n", i-1, ips[i-1]);
Modified: 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-05-16 00:04:02 UTC (rev 3731)
+++ trunk/coregrind/x86/core_arch.h 2005-05-16 00:16:56 UTC (rev 3732)
@@ -56,11 +56,6 @@
#define VGA_CLREQ_ARGS guest_EAX
#define VGA_CLREQ_RET guest_EDX
=20
-// Stack frame layout and linkage
-#define VGA_FIRST_STACK_FRAME(ebp) (ebp)
-#define VGA_STACK_FRAME_RET(ebp) (((UInt*)ebp)[1])
-#define VGA_STACK_FRAME_NEXT(ebp) (((UInt*)ebp)[0])
-
//extern const Char VG_(helper_wrapper_before)[]; /* in dispatch.S */
//extern const Char VG_(helper_wrapper_return)[]; /* in dispatch.S */
=20
|
|
From: <sv...@va...> - 2005-05-16 00:04:34
|
Author: njn
Date: 2005-05-16 01:04:02 +0100 (Mon, 16 May 2005)
New Revision: 3731
Modified:
trunk/coregrind/vg_dwarf.c
Log:
Move some decls in vg_dwarf.c closer to the comment explaining them.
Modified: trunk/coregrind/vg_dwarf.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/vg_dwarf.c 2005-05-16 00:01:04 UTC (rev 3730)
+++ trunk/coregrind/vg_dwarf.c 2005-05-16 00:04:02 UTC (rev 3731)
@@ -863,58 +863,6 @@
8 is the return address (EIP) */
=20
=20
-/* ------------ Deal with summary-info records ------------ */
-
-void VG_(ppCfiSI) ( CfiSI* si )
-{
-# define SHOW_HOW(_how, _off) \
- do { \
- if (_how =3D=3D CFIR_UNKNOWN) { \
- VG_(printf)("Unknown"); \
- } else \
- if (_how =3D=3D CFIR_SAME) { \
- VG_(printf)("Same"); \
- } else \
- if (_how =3D=3D CFIR_CFAREL) { \
- VG_(printf)("cfa+%d", _off); \
- } else \
- if (_how =3D=3D CFIR_MEMCFAREL) { \
- VG_(printf)("*(cfa+%d)", _off); \
- } else { \
- VG_(printf)("???"); \
- } \
- } while (0)
-
- VG_(printf)("[%p .. %p]: ", si->base,=20
- si->base + (UWord)si->len - 1);
- VG_(printf)("let cfa=3D%s+%d",=20
- si->cfa_sprel ? "oldSP" : "oldFP", si->cfa_off);
- VG_(printf)(" in RA=3D");
- SHOW_HOW(si->ra_how, si->ra_off);
- VG_(printf)(" SP=3D");
- SHOW_HOW(si->sp_how, si->sp_off);
- VG_(printf)(" FP=3D");
- SHOW_HOW(si->fp_how, si->fp_off);
- VG_(printf)("\n");
-
-# undef SHOW_HOW
-}
-
-static void initCfiSI ( CfiSI* si )
-{
- si->base =3D 0;
- si->len =3D 0;
- si->cfa_sprel =3D False;
- si->ra_how =3D 0;
- si->sp_how =3D 0;
- si->fp_how =3D 0;
- si->cfa_off =3D 0;
- si->ra_off =3D 0;
- si->sp_off =3D 0;
- si->fp_off =3D 0;
-}
-
-
/* --------------- Decls --------------- */
=20
#if defined(VGP_x86_linux)
@@ -1065,6 +1013,58 @@
}
=20
=20
+/* ------------ Deal with summary-info records ------------ */
+
+void VG_(ppCfiSI) ( CfiSI* si )
+{
+# define SHOW_HOW(_how, _off) \
+ do { \
+ if (_how =3D=3D CFIR_UNKNOWN) { \
+ VG_(printf)("Unknown"); \
+ } else \
+ if (_how =3D=3D CFIR_SAME) { \
+ VG_(printf)("Same"); \
+ } else \
+ if (_how =3D=3D CFIR_CFAREL) { \
+ VG_(printf)("cfa+%d", _off); \
+ } else \
+ if (_how =3D=3D CFIR_MEMCFAREL) { \
+ VG_(printf)("*(cfa+%d)", _off); \
+ } else { \
+ VG_(printf)("???"); \
+ } \
+ } while (0)
+
+ VG_(printf)("[%p .. %p]: ", si->base,=20
+ si->base + (UWord)si->len - 1);
+ VG_(printf)("let cfa=3D%s+%d",=20
+ si->cfa_sprel ? "oldSP" : "oldFP", si->cfa_off);
+ VG_(printf)(" in RA=3D");
+ SHOW_HOW(si->ra_how, si->ra_off);
+ VG_(printf)(" SP=3D");
+ SHOW_HOW(si->sp_how, si->sp_off);
+ VG_(printf)(" FP=3D");
+ SHOW_HOW(si->fp_how, si->fp_off);
+ VG_(printf)("\n");
+
+# undef SHOW_HOW
+}
+
+static void initCfiSI ( CfiSI* si )
+{
+ si->base =3D 0;
+ si->len =3D 0;
+ si->cfa_sprel =3D False;
+ si->ra_how =3D 0;
+ si->sp_how =3D 0;
+ si->fp_how =3D 0;
+ si->cfa_off =3D 0;
+ si->ra_off =3D 0;
+ si->sp_off =3D 0;
+ si->fp_off =3D 0;
+}
+
+
/* --------------- Summarisation --------------- */
=20
/* Summarise ctx into si, if possible. Returns True if successful.
|
|
From: <sv...@va...> - 2005-05-16 00:01:07
|
Author: njn
Date: 2005-05-16 01:01:04 +0100 (Mon, 16 May 2005)
New Revision: 3730
Modified:
trunk/coregrind/amd64/core_arch.h
trunk/coregrind/amd64/state.c
trunk/coregrind/arm/core_arch.h
trunk/coregrind/arm/state.c
trunk/coregrind/core.h
trunk/coregrind/vg_symtab2.c
trunk/coregrind/x86/core_arch.h
trunk/coregrind/x86/state.c
Log:
Moved VGA_(reg_addr_from_tst)() and VGA_R_{STACK,FRAME}_PTR into vg_symta=
b2.c.
Also made regaddr() and co. 64-bit clean (I hope I did that correctly).
Modified: 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-05-15 23:36:12 UTC (rev 3729)
+++ trunk/coregrind/amd64/core_arch.h 2005-05-16 00:01:04 UTC (rev 3730)
@@ -56,10 +56,6 @@
#define VGA_CLREQ_ARGS guest_RAX
#define VGA_CLREQ_RET guest_RDX
=20
-// Register numbers, for vg_symtab2.c
-#define VGA_R_STACK_PTR 4
-#define VGA_R_FRAME_PTR 5
-
// Stack frame layout and linkage
#define VGA_FIRST_STACK_FRAME(rbp) (rbp)
#define VGA_STACK_FRAME_RET(rbp) (((UWord*)rbp)[1])
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-05-15 23:36:12 UTC (rev 3729)
+++ trunk/coregrind/amd64/state.c 2005-05-16 00:01:04 UTC (rev 3730)
@@ -112,56 +112,6 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- Symtab stuff ---*/
-/*------------------------------------------------------------*/
-
-#if 0
-/* This is the Intel register encoding -- integer regs. */
-#define R_EAX 0
-#define R_ECX 1
-#define R_EDX 2
-#define R_EBX 3
-#define R_ESP 4
-#define R_EBP 5
-#define R_ESI 6
-#define R_EDI 7
-#define R_E8 8
-#define R_E9 9
-#define R_E10 10
-#define R_E11 11
-#define R_E12 12
-#define R_E13 13
-#define R_E14 14
-#define R_E15 15
-#endif
-
-UInt *VGA_(reg_addr_from_tst)(Int regno, ThreadArchState *arch)
-{
- I_die_here;
-#if 0
- switch (regno) {
- case R_RAX: return &arch->vex.guest_RAX;
- case R_RCX: return &arch->vex.guest_RCX;
- case R_RDX: return &arch->vex.guest_RDX;
- case R_RBX: return &arch->vex.guest_RBX;
- case R_RSP: return &arch->vex.guest_RSP;
- case R_RBP: return &arch->vex.guest_RBP;
- case R_RSI: return &arch->vex.guest_RSI;
- case R_RDI: return &arch->vex.guest_RDI;
- case R_R8 : return &arch->vex.guest_R8 ;
- case R_R9 : return &arch->vex.guest_R9 ;
- case R_R10: return &arch->vex.guest_R10;
- case R_R11: return &arch->vex.guest_R11;
- case R_R12: return &arch->vex.guest_R12;
- case R_R13: return &arch->vex.guest_R13;
- case R_R14: return &arch->vex.guest_R14;
- case R_R15: return &arch->vex.guest_R15;
- default: return NULL;
- }
-#endif
-}
-
-/*------------------------------------------------------------*/
/*--- pointercheck ---*/
/*------------------------------------------------------------*/
=20
Modified: 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-05-15 23:36:12 UTC (rev 3729)
+++ trunk/coregrind/arm/core_arch.h 2005-05-16 00:01:04 UTC (rev 3730)
@@ -62,10 +62,6 @@
#define VGA_CLREQ_ARGS guest_R0
#define VGA_CLREQ_RET guest_R0
=20
-// Register numbers, for vg_symtab2.c
-#define VGA_R_STACK_PTR 13
-#define VGA_R_FRAME_PTR 11
-
// Stack frame layout and linkage
// XXX ToDo: ???
#define VGA_FIRST_STACK_FRAME(ebp) (ebp)
Modified: trunk/coregrind/arm/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/arm/state.c 2005-05-15 23:36:12 UTC (rev 3729)
+++ trunk/coregrind/arm/state.c 2005-05-16 00:01:04 UTC (rev 3730)
@@ -89,28 +89,6 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- Symtab stuff ---*/
-/*------------------------------------------------------------*/
-
-UInt *VGA_(reg_addr_from_tst)(Int regno, ThreadArchState *arch)
-{
- I_die_here;
-#if 0
- switch (regno) {
- case R_EAX: return &arch->vex.guest_EAX;
- case R_ECX: return &arch->vex.guest_ECX;
- case R_EDX: return &arch->vex.guest_EDX;
- case R_EBX: return &arch->vex.guest_EBX;
- case R_ESP: return &arch->vex.guest_ESP;
- case R_EBP: return &arch->vex.guest_EBP;
- case R_ESI: return &arch->vex.guest_ESI;
- case R_EDI: return &arch->vex.guest_EDI;
- default: return NULL;
- }
-#endif
-}
-
-/*------------------------------------------------------------*/
/*--- pointercheck ---*/
/*------------------------------------------------------------*/
=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-05-15 23:36:12 UTC (rev 3729)
+++ trunk/coregrind/core.h 2005-05-16 00:01:04 UTC (rev 3730)
@@ -828,9 +828,6 @@
// handle an arch-specific client request
extern Bool VGA_(client_request)(ThreadId tid, UWord *args);
=20
-// Symtab stuff
-extern UInt* VGA_(reg_addr_from_tst) ( Int regno, ThreadArchState* );
-
// Pointercheck
extern Bool VGA_(setup_pointercheck) ( void );
=20
Modified: trunk/coregrind/vg_symtab2.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/vg_symtab2.c 2005-05-15 23:36:12 UTC (rev 3729)
+++ trunk/coregrind/vg_symtab2.c 2005-05-16 00:01:04 UTC (rev 3730)
@@ -2250,11 +2250,38 @@
=20
#ifndef TEST
=20
+// Note that R_STACK_PTR and R_FRAME_PTR are used again further below,
+// which is why they get a named constant.
+static Addr regaddr_from_tst(Int regno, ThreadArchState *arch)
+{
+#if defined(VGA_x86)
+/* This is the Intel register encoding -- integer regs. */
+# define R_STACK_PTR 4
+# define R_FRAME_PTR 5
+ switch (regno) {
+ case 0: return (Addr) & arch->vex.guest_EAX;
+ case 1: return (Addr) & arch->vex.guest_ECX;
+ case 2: return (Addr) & arch->vex.guest_EDX;
+ case 3: return (Addr) & arch->vex.guest_EBX;
+ case R_STACK_PTR: return (Addr) & arch->vex.guest_ESP;
+ case R_FRAME_PTR: return (Addr) & arch->vex.guest_EBP;
+ case 6: return (Addr) & arch->vex.guest_ESI;
+ case 7: return (Addr) & arch->vex.guest_EDI;
+ default: return 0;
+ }
+#elif defined(VGA_amd64)
+# error AMD64 not done yet
+#else
+# error Unknown platform
+#endif
+}
+
+
/* return a pointer to a register (now for 5 other impossible things
before breakfast) */
-static UInt* regaddr(ThreadId tid, Int regno)
+static Addr regaddr(ThreadId tid, Int regno)
{
- UInt* ret =3D VGA_(reg_addr_from_tst)(regno, &VG_(threads)[tid].arch)=
;
+ Addr ret =3D regaddr_from_tst(regno, &VG_(threads)[tid].arch);
=20
if (ret =3D=3D 0) {
Char buf[100];
@@ -2330,7 +2357,6 @@
if (debug && 0)
VG_(printf)("sym->name=3D%s sym->kind=3D%d offset=3D%d\n", sym->nam=
e, sym->kind, sym->u.offset);
switch(sym->kind) {
- UInt reg;
=20
case SyGlobal:
case SyStatic:
@@ -2341,17 +2367,18 @@
break;
=20
case SyReg:
- v->valuep =3D (Addr)regaddr(tid, sym->u.regno);
+ v->valuep =3D regaddr(tid, sym->u.regno);
break;
=20
case SyEBPrel:
- case SyESPrel:
- reg =3D *regaddr(tid, sym->kind =3D=3D SyESPrel ?=20
- VGA_R_STACK_PTR : VGA_R_FRAME_PTR);
+ case SyESPrel: {
+ Addr reg =3D *(Addr*)regaddr(tid, sym->kind =3D=3D SyESPrel
+ ? R_STACK_PTR : R_FRAME_PTR)=
;
if (debug)
VG_(printf)("reg=3D%p+%d=3D%p\n", reg, sym->u.offset, reg+sym->u=
.offset);
- v->valuep =3D (Addr)(reg + sym->u.offset);
+ v->valuep =3D reg + sym->u.offset;
break;
+ }
=20
case SyType:
VG_(core_panic)("unexpected typedef in scope");
Modified: 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-05-15 23:36:12 UTC (rev 3729)
+++ trunk/coregrind/x86/core_arch.h 2005-05-16 00:01:04 UTC (rev 3730)
@@ -56,10 +56,6 @@
#define VGA_CLREQ_ARGS guest_EAX
#define VGA_CLREQ_RET guest_EDX
=20
-// Register numbers, for vg_symtab2.c
-#define VGA_R_STACK_PTR 4
-#define VGA_R_FRAME_PTR 5
-
// Stack frame layout and linkage
#define VGA_FIRST_STACK_FRAME(ebp) (ebp)
#define VGA_STACK_FRAME_RET(ebp) (((UInt*)ebp)[1])
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-05-15 23:36:12 UTC (rev 3729)
+++ trunk/coregrind/x86/state.c 2005-05-16 00:01:04 UTC (rev 3730)
@@ -162,35 +162,6 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- Symtab stuff ---*/
-/*------------------------------------------------------------*/
-
-/* This is the Intel register encoding -- integer regs. */
-#define R_EAX 0
-#define R_ECX 1
-#define R_EDX 2
-#define R_EBX 3
-#define R_ESP 4
-#define R_EBP 5
-#define R_ESI 6
-#define R_EDI 7
-
-UInt *VGA_(reg_addr_from_tst)(Int regno, ThreadArchState *arch)
-{
- switch (regno) {
- case R_EAX: return &arch->vex.guest_EAX;
- case R_ECX: return &arch->vex.guest_ECX;
- case R_EDX: return &arch->vex.guest_EDX;
- case R_EBX: return &arch->vex.guest_EBX;
- case R_ESP: return &arch->vex.guest_ESP;
- case R_EBP: return &arch->vex.guest_EBP;
- case R_ESI: return &arch->vex.guest_ESI;
- case R_EDI: return &arch->vex.guest_EDI;
- default: return NULL;
- }
-}
-
-/*------------------------------------------------------------*/
/*--- pointercheck ---*/
/*------------------------------------------------------------*/
=20
|