[Lldb-commits] [PATCH] Add new bugreport command to lldb

Tamas Berghammer tberghammer at google.com
Thu Jul 2 03:03:38 PDT 2015


================
Comment at: source/Commands/CommandObjectBugreport.cpp:72
@@ +71,3 @@
+
+                char command_buffer[256];
+
----------------
ovyalov wrote:
> I'd defined this buffer before the loop to avoid memory allocation per each frame. 
Done

================
Comment at: source/Commands/CommandObjectBugreport.cpp:88
@@ +87,3 @@
+            
+            uint32_t open_options = File::eOpenOptionWrite | File::eOpenOptionCanCreate | File::eOpenOptionAppend;
+            const bool append = m_outfile_options.GetAppend().GetCurrentValue();
----------------
ovyalov wrote:
> File::eOpenOptionCloseOnExec ?
Done (I don't think it matters here but definitely won't harm)

================
Comment at: source/Commands/CommandObjectBugreport.cpp:94
@@ +93,3 @@
+            StreamFileSP outfile_stream = std::make_shared<StreamFile>();
+            if (outfile_stream->GetFile().Open(path, open_options).Success())
+            {
----------------
ovyalov wrote:
> Could you add a returned error to result.AppendErrorWithFormat ?
Done

================
Comment at: source/Commands/CommandObjectBugreport.cpp:106
@@ +105,3 @@
+
+        CommandInterpreterRunOptions options;
+        options.SetStopOnError(false);
----------------
ovyalov wrote:
> This block might be generic for all multiword commands and you may put it into CommandObjectMultiwordBugreport
In command objects "multiword"  refers to the multiple word in the command itself, not to the fact it uses several other commands in the background (see CommandObjectMultiwordTarget). At the moment I am not sure how the other bugreporting commands will look like so don't want to over-engineer it with an additional base class. If we need it anywhere else we can do it when adding the next command using the same pattern.

http://reviews.llvm.org/D10868

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list