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
|