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

Oleksiy Vyalov ovyalov at google.com
Wed Jul 1 10:59:25 PDT 2015


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

================
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();
----------------
File::eOpenOptionCloseOnExec ?

================
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())
+            {
----------------
Could you add a returned error to result.AppendErrorWithFormat ?

================
Comment at: source/Commands/CommandObjectBugreport.cpp:106
@@ +105,3 @@
+
+        CommandInterpreterRunOptions options;
+        options.SetStopOnError(false);
----------------
This block might be generic for all multiword commands and you may put it into CommandObjectMultiwordBugreport

http://reviews.llvm.org/D10868

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






More information about the lldb-commits mailing list