File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,23 @@ static void showStats() {
108108 IR::Memory::printAliasStats (*out);
109109}
110110
111+ static void emitCommandLine (ostream *out) {
112+ #ifdef __linux__
113+ ifstream cmd_args;
114+ cmd_args.open (" /proc/self/cmdline" );
115+ if (!cmd_args.is_open ()) {
116+ cerr << " Alive2: Couldn't open /proc/self/cmdline" << endl;
117+ exit (1 );
118+ }
119+ *out << " Command line: " ;
120+ std::string arg;
121+ while (std::getline (cmd_args, arg, ' \0 ' ))
122+ *out << " '" << arg << " ' " ;
123+ #else
124+ *out << " Command line: not available on this platform" ;
125+ #endif
126+ *out << " \n\n " ;
127+ }
111128
112129struct TVLegacyPass final : public llvm::ModulePass {
113130 static char ID;
@@ -267,6 +284,8 @@ struct TVLegacyPass final : public llvm::ModulePass {
267284 has_failure |= errs.isUnsound ();
268285 if (opt_error_fatal && has_failure)
269286 finalize ();
287+ if (errs.isUnsound ())
288+ emitCommandLine (out);
270289 } else {
271290 *out << " Transformation seems to be correct!\n\n " ;
272291 }
You can’t perform that action at this time.
0 commit comments