69 #ifdef NO_STD_CHEADERS 80 #include <include/hpctoolkit-config.h> 90 #define ARG_ERROR(streamArgs) \ 91 { std::ostringstream WeIrDnAmE; \ 92 WeIrDnAmE << streamArgs ; \ 93 printError(std::cerr, WeIrDnAmE.str()); \ 101 "[options] <loadmodule>\n";
104 Load module dump. Dumps selected contents of <loadmodule> to stdout.\n\ 105 <loadmodule> may be either an executable or DSO.\n\ 107 By default instruction types are emitted.\ 110 --long Long dump: include symbol table.\n\ 111 --short Short dump: no instructions.\n\ 112 --decode Decode instructions.\n\ 113 --old Old symbolic dump.\n\ 114 -l <addr>, load-addr <addr>\n\ 115 'Load' DSOs at address <addr> rather than 0x0.\n\ 116 Addresses may be in base 10, 8 (prefix '0') or 16\n\ 117 (prefix '0x'). [NOT FULLY IMPLEMENTED]\n\ 118 -V, --version Print version information.\n\ 119 -h, --help Print this help.\n\ 120 --debug [<n>] Debug: use debug level <n>. {1}\n";
124 #define CLP CmdLineParser 130 { 0 ,
"long", CLP::ARG_NONE, CLP::DUPOPT_CLOB,
NULL, NULL },
131 { 0 ,
"short", CLP::ARG_NONE, CLP::DUPOPT_CLOB,
NULL, NULL },
132 { 0 ,
"decode", CLP::ARG_NONE, CLP::DUPOPT_CLOB,
NULL, NULL },
133 { 0 ,
"old", CLP::ARG_NONE, CLP::DUPOPT_CLOB,
NULL, NULL },
135 {
'l',
"load-addr", CLP::ARG_REQ , CLP::DUPOPT_CLOB,
NULL, NULL },
137 {
'V',
"version", CLP::ARG_NONE, CLP::DUPOPT_CLOB,
NULL, NULL },
138 {
'h',
"help", CLP::ARG_NONE, CLP::DUPOPT_CLOB,
NULL, NULL },
139 { 0 ,
"debug", CLP::ARG_OPT, CLP::DUPOPT_CLOB,
NULL, CLP::isOptArg_long },
196 os <<
getCmd() <<
": " << msg << endl
197 <<
"Try '" <<
getCmd() <<
" --help' for more information." << endl;
241 int numDumpOptions = 0;
253 ARG_ERROR(
"--decode not valid with --short!");
260 if (numDumpOptions > 1) {
261 ARG_ERROR(
"At most one dump option may be given!");
270 long l = strtol(str.c_str(),
NULL, 0 );
271 if (l <= 0 || errno != 0) {
272 ARG_ERROR(
"Invalid address given to -r\n");
281 ARG_ERROR(
"Incorrect number of arguments!");
298 os <<
"Args.cmd= " <<
getCmd() << endl;
299 os <<
"Args.debugLevel= " <<
debugLevel << endl;
300 os <<
"Args.inputFile= " <<
inputFile << endl;
301 os <<
"::trace " <<
::trace << endl;
bool isOpt(const char swShort) const
void printUsage(std::ostream &os) const
const std::string & getOptArg(const char swShort) const
virtual const std::string & what() const
bool isOptArg(const char swShort) const
void parse(const OptArgDesc *optArgDescs, int argc, const char *const argv[])
unsigned int getNumArgs() const
void printVersion(std::ostream &os) const
void parse(int argc, const char *const argv[])
virtual std::string message() const
#define CmdLineParser_OptArgDesc_NULL_MACRO
void printError(std::ostream &os, const char *msg) const
static CmdLineParser::OptArgDesc optArgs[]
const std::string & getArg(unsigned int i) const
const std::string & getCmd() const
void dump(std::ostream &os=std::cerr) const
static long toLong(const std::string &str)