mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
reading. Two sets of changes:
* New flags for debugging the readers.
--debug-dump=syms
--debug-dump=line
--debug-dump=frames
These (currently accepted but nonfunctional) are intended to
create output in the style of (that is, identical to)
/usr/bin/readelf --syms
/usr/bin/readelf --debug-dump=line
/usr/bin/readelf --debug-dump=frames
respectively. The plan is that flaws in these readers can then
be easily found by diff-ing the output against that from readelf.
Also, a new flag --trace-symtab-patt=<object filename pattern>
which is used to limit all debuginfo-related debug info to the
set of shared object names matching the given pattern. This
facilitates extracting the debuginfo details of one specific
shared object, which is usually what is required, rather than
having to wade through megabytes of junk from every object in
the process.
* Propagate the avma/svma/image address-naming scheme
(as described at the top of debuginfo.c) through large parts of
readelf.c and readdwarf.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6588
106 lines
4.0 KiB
C
106 lines
4.0 KiB
C
|
|
/*--------------------------------------------------------------------*/
|
|
/*--- Command line options. pub_tool_options.h ---*/
|
|
/*--------------------------------------------------------------------*/
|
|
|
|
/*
|
|
This file is part of Valgrind, a dynamic binary instrumentation
|
|
framework.
|
|
|
|
Copyright (C) 2000-2007 Julian Seward
|
|
jseward@acm.org
|
|
|
|
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
|
|
|
|
#include "libvex.h" // for VexControl
|
|
|
|
|
|
/* Use these for recognising tool command line options -- stops comparing
|
|
once whitespace is reached. */
|
|
#define VG_CLO_STREQ(s1,s2) (0==VG_(strcmp_ws)((s1),(s2)))
|
|
#define VG_CLO_STREQN(nn,s1,s2) (0==VG_(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"=yes")) { (qq_var) = True; } \
|
|
else if (VG_CLO_STREQ(qq_arg, qq_option"=no")) { (qq_var) = False; }
|
|
|
|
#define VG_STR_CLO(qq_arg, qq_option, qq_var) \
|
|
if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=")) { \
|
|
(qq_var) = &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"=")) { \
|
|
(qq_var) = (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"=")) { \
|
|
(qq_var) = (Int)VG_(atoll)( &qq_arg[ VG_(strlen)(qq_option)+1 ] ); \
|
|
if ((qq_var) < (qq_lo)) (qq_var) = (qq_lo); \
|
|
if ((qq_var) > (qq_hi)) (qq_var) = (qq_hi); \
|
|
}
|
|
|
|
/* Bool arg whose value is denoted by the exact presence of the given string. */
|
|
#define VG_XACT_CLO(qq_arg, qq_option, qq_var) \
|
|
if (VG_CLO_STREQ(qq_arg, qq_option)) { \
|
|
(qq_var) = True; \
|
|
} /* else leave it alone */
|
|
|
|
/* Verbosity level: 0 = silent, 1 (default), > 1 = more verbose. */
|
|
extern Int VG_(clo_verbosity);
|
|
|
|
/* Emit all messages as XML? default: NO */
|
|
/* If clo_xml is set, various other options are set in a non-default
|
|
way. See vg_main.c and mc_main.c. */
|
|
extern Bool VG_(clo_xml);
|
|
|
|
/* An arbitrary user-supplied string which is copied into the
|
|
XML output, in between <usercomment> tags. */
|
|
extern HChar* VG_(clo_xml_user_comment);
|
|
|
|
/* Name of an environment variable which, if set, is to be used as
|
|
part of any output file name. See pub_core_options.h for
|
|
details. */
|
|
extern Char* VG_(clo_log_file_qualifier);
|
|
|
|
/* Vex iropt control. Tool-visible so tools can make Vex optimise
|
|
less aggressively if that is needed (callgrind needs this). */
|
|
extern VexControl VG_(clo_vex_control);
|
|
|
|
/* 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. This function prints an error message, then shuts down the
|
|
entire system. */
|
|
extern void VG_(err_bad_option) ( Char* opt );
|
|
|
|
|
|
#endif // __PUB_TOOL_OPTIONS_H
|
|
|
|
/*--------------------------------------------------------------------*/
|
|
/*--- end ---*/
|
|
/*--------------------------------------------------------------------*/
|