[libcxx-commits] [libcxx] [libc++] Fix mi-mode in GDB pretty printers (PR #120951)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Dec 23 06:48:26 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 4b35dd57b88a59b169c3471cbc398113d3bf98e8 125138b6511b136db7244ac85e23fbf3500a83bc --extensions cpp -- libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
index 93be245f0a..ff951d94db 100644
--- a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
+++ b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
@@ -129,9 +129,8 @@ void CompareExpressionPrettyPrintToRegex(
StopForDebugger(&value, &expectation);
}
-template <typename TypeToPrint> void CompareListChildrenToChars(
- TypeToPrint value,
- const char *expectation) {
+template <typename TypeToPrint>
+void CompareListChildrenToChars(TypeToPrint value, const char* expectation) {
MarkAsLive(value);
StopForDebugger(&value, &expectation);
}
@@ -368,26 +367,26 @@ void multimap_test() {
void queue_test() {
std::queue<int> i_am_empty;
- ComparePrettyPrintToChars(i_am_empty,
- "std::queue wrapping: std::deque is empty");
+ ComparePrettyPrintToChars(i_am_empty, "std::queue wrapping: std::deque is empty");
std::queue<int> one_two_three(std::deque<int>{1, 2, 3});
- ComparePrettyPrintToChars(one_two_three,
- "std::queue wrapping: "
- "std::deque with 3 elements = {1, 2, 3}");
+ ComparePrettyPrintToChars(
+ one_two_three,
+ "std::queue wrapping: "
+ "std::deque with 3 elements = {1, 2, 3}");
}
void priority_queue_test() {
std::priority_queue<int> i_am_empty;
- ComparePrettyPrintToChars(i_am_empty,
- "std::priority_queue wrapping: std::vector of length 0, capacity 0");
+ ComparePrettyPrintToChars(i_am_empty, "std::priority_queue wrapping: std::vector of length 0, capacity 0");
std::priority_queue<int> one_two_three;
one_two_three.push(11111);
one_two_three.push(22222);
one_two_three.push(33333);
- ComparePrettyPrintToRegex(one_two_three,
+ ComparePrettyPrintToRegex(
+ one_two_three,
R"(std::priority_queue wrapping: )"
R"(std::vector of length 3, capacity 3 = {33333)");
@@ -417,25 +416,22 @@ void set_test() {
void stack_test() {
std::stack<int> test0;
- ComparePrettyPrintToChars(test0,
- "std::stack wrapping: std::deque is empty");
+ ComparePrettyPrintToChars(test0, "std::stack wrapping: std::deque is empty");
test0.push(5);
test0.push(6);
- ComparePrettyPrintToChars(
- test0, "std::stack wrapping: std::deque with 2 elements = {5, 6}");
+ ComparePrettyPrintToChars(test0, "std::stack wrapping: std::deque with 2 elements = {5, 6}");
std::stack<bool> test1;
test1.push(true);
test1.push(false);
- ComparePrettyPrintToChars(
- test1,
- "std::stack wrapping: std::deque with 2 elements = {true, false}");
+ ComparePrettyPrintToChars(test1, "std::stack wrapping: std::deque with 2 elements = {true, false}");
std::stack<std::string> test2;
test2.push("Hello");
test2.push("World");
- ComparePrettyPrintToChars(test2,
- "std::stack wrapping: std::deque with 2 elements "
- "= {\"Hello\", \"World\"}");
+ ComparePrettyPrintToChars(
+ test2,
+ "std::stack wrapping: std::deque with 2 elements "
+ "= {\"Hello\", \"World\"}");
}
void multiset_test() {
@@ -674,17 +670,17 @@ void mi_mode_test() {
one_two_three_map.insert({1, "one"});
one_two_three_map.insert({2, "two"});
one_two_three_map.insert({3, "three"});
- CompareListChildrenToChars(one_two_three_map,
- R"([{"key": 1, "value": "one"}, {"key": 2, "value": "two"}, {"key": 3, "value": "three"}])");
+ CompareListChildrenToChars(
+ one_two_three_map, R"([{"key": 1, "value": "one"}, {"key": 2, "value": "two"}, {"key": 3, "value": "three"}])");
std::unordered_map<int, std::string> one_two_three_umap;
one_two_three_umap.insert({3, "three"});
one_two_three_umap.insert({2, "two"});
one_two_three_umap.insert({1, "one"});
- CompareListChildrenToChars(one_two_three_umap,
- R"([{"key": 3, "value": "three"}, {"key": 2, "value": "two"}, {"key": 1, "value": "one"}])");
+ CompareListChildrenToChars(
+ one_two_three_umap, R"([{"key": 3, "value": "three"}, {"key": 2, "value": "two"}, {"key": 1, "value": "one"}])");
- std::deque<int> one_two_three_deque {1, 2, 3};
+ std::deque<int> one_two_three_deque{1, 2, 3};
CompareListChildrenToChars(one_two_three_deque, "[1, 2, 3]");
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/120951
More information about the libcxx-commits
mailing list