[Lldb-commits] [PATCH] D30234: Reformat inferior's main.cpp in lldb-server test

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 21 16:41:03 PST 2017

jingham added a comment.

It looks like clang-format wasn't run over this file as it was over all the main lldb sources in the infamous universal code reformatting.  That seems odd.

Anyway, it might be better just to do that to this file using the top level .clang-format.  Note that you are making several choices which were not the choices made by clang-format using the .clang-format file that was used to implement this reformatting.  We probably shouldn't revise that decision piecemeal.

Comment at: packages/Python/lldbsuite/test/tools/lldb-server/main.cpp:32-42
+static const char *const RETVAL_PREFIX = "retval:";
+static const char *const SLEEP_PREFIX = "sleep:";
+static const char *const STDERR_PREFIX = "stderr:";
+static const char *const SET_MESSAGE_PREFIX = "set-message:";
+static const char *const PRINT_MESSAGE_COMMAND = "print-message:";
+static const char *const GET_DATA_ADDRESS_PREFIX = "get-data-address-hex:";
+static const char *const GET_STACK_ADDRESS_COMMAND = "get-stack-address-hex:";
This change seems a shame, the original was much easier to read.

Comment at: packages/Python/lldbsuite/test/tools/lldb-server/main.cpp:62
-static void
-print_thread_id ()
-	// Put in the right magic here for your platform to spit out the thread id (tid) that debugserver/lldb-gdbserver would see as a TID.
-	// Otherwise, let the else clause print out the unsupported text so that the unit test knows to skip verifying thread ids.
+static void print_thread_id() {
+// Put in the right magic here for your platform to spit out the thread id (tid)
clang-format moved the initial { for functions into the function definition line universally when it was run over the lldb sources.  If we want to revise that decision, and go back to the initial function curly starting a line, that would be fine by me, but I don't think we should do it piecemeal. 

Ditto for separating the return type & function name onto separate lines.  That was the way we did it originally, but the clang-format style that was chosen for the reformatting undid that.  I much prefer the way you changed it to here, but that's a decision we should make globally, not file by file.


More information about the lldb-commits mailing list