[Lldb-commits] [PATCH] D46318: lldb-test symbols: Add ability to do name-based lookup

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 3 03:01:21 PDT 2018


JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

A few more nits but otherwise this LGTM.



================
Comment at: tools/lldb-test/lldb-test.cpp:463
 
   DebuggerLifetime->Terminate();
   return 0;
----------------
labath wrote:
> JDevlieghere wrote:
> > If we can wrap this in a RAII object we could have this tool return a non-zero exit code in case of an error. 
> Done. I've made the individual functions return an `int`, and had `main` forward that. The reason I am not having the functions return an `Error` or like is that the functions generally do the same thing over several inputs, and the errors that happen when processing one of the inputs should be printed next to that input and not deferred until the end. So, the functions just accumulate a flag saying whether they encountered any errors and then return that.
Alright, works for me!


================
Comment at: tools/lldb-test/lldb-test.cpp:481
+    return dumpModules(*Dbg);
+ if (opts::SymbolsSubcommand)
+    return opts::symbols::dumpSymbols(*Dbg);
----------------
formatting


================
Comment at: tools/lldb-test/lldb-test.cpp:484
 
-  DebuggerLifetime->Terminate();
-  return 0;
+ errs() << "No command specified.\n";
+ return 1;
----------------
`WithColor:error()`? :-) 


https://reviews.llvm.org/D46318





More information about the lldb-commits mailing list