[Lldb-commits] [lldb] r373670 - [process list] make the TRIPLE column wider
Walter Erquinigo via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 3 14:57:01 PDT 2019
Author: wallace
Date: Thu Oct 3 14:57:01 2019
New Revision: 373670
URL: http://llvm.org/viewvc/llvm-project?rev=373670&view=rev
Log:
[process list] make the TRIPLE column wider
Summary:
Now that `process list` works better on the android platform, the arch aarch64-unknown-linux-android appears quite often.
The existing printed width of the TRIPLE column is not long enough, which doesn't look okay.
E.g.
```
1561 1016 aarch64-unknown-linux-android ip6tables-restore
1999 1 aarch64-unknown-linux-android tlc_server
2332 982 com.android.systemui
2378 983 webview_zygote
```
Now, after adding 6 spaces, it looks better
```
PID PARENT USER TRIPLE NAME
====== ====== ========== ============================== ============================
...
1561 1016 aarch64-unknown-linux-android ip6tables-restore
1999 1 aarch64-unknown-linux-android tlc_server
2332 982 com.android.systemui
2378 983 webview_zygote
2448 982 com.sec.location.nsflp2
```
Reviewers: clayborg, labath, xiaobai, aadsm
Reviewed By: labath
Subscribers: srhines, kristof.beyls, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68291
Modified:
lldb/trunk/source/Utility/ProcessInfo.cpp
lldb/trunk/unittests/Utility/ProcessInstanceInfoTest.cpp
Modified: lldb/trunk/source/Utility/ProcessInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/ProcessInfo.cpp?rev=373670&r1=373669&r2=373670&view=diff
==============================================================================
--- lldb/trunk/source/Utility/ProcessInfo.cpp (original)
+++ lldb/trunk/source/Utility/ProcessInfo.cpp Thu Oct 3 14:57:01 2019
@@ -169,13 +169,15 @@ void ProcessInstanceInfo::DumpTableHeade
if (verbose) {
s.Printf("PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE "
- " %s\n",
+ " %s\n",
label);
- s.PutCString("====== ====== ========== ========== ========== ========== "
- "======================== ============================\n");
+ s.PutCString(
+ "====== ====== ========== ========== ========== ========== "
+ "============================== ============================\n");
} else {
- s.Printf("PID PARENT USER TRIPLE %s\n", label);
- s.PutCString("====== ====== ========== ======================== "
+ s.Printf("PID PARENT USER TRIPLE %s\n",
+ label);
+ s.PutCString("====== ====== ========== ============================== "
"============================\n");
}
}
@@ -216,12 +218,12 @@ void ProcessInstanceInfo::DumpAsTableRow
&ProcessInstanceInfo::GetEffectiveGroupID,
&UserIDResolver::GetGroupName);
- s.Printf("%-24s ", arch_strm.GetData());
+ s.Printf("%-30s ", arch_strm.GetData());
} else {
print(&ProcessInstanceInfo::EffectiveUserIDIsValid,
&ProcessInstanceInfo::GetEffectiveUserID,
&UserIDResolver::GetUserName);
- s.Printf("%-24s ", arch_strm.GetData());
+ s.Printf("%-30s ", arch_strm.GetData());
}
if (verbose || show_args) {
Modified: lldb/trunk/unittests/Utility/ProcessInstanceInfoTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/ProcessInstanceInfoTest.cpp?rev=373670&r1=373669&r2=373670&view=diff
==============================================================================
--- lldb/trunk/unittests/Utility/ProcessInstanceInfoTest.cpp (original)
+++ lldb/trunk/unittests/Utility/ProcessInstanceInfoTest.cpp Thu Oct 3 14:57:01 2019
@@ -67,15 +67,15 @@ TEST(ProcessInstanceInfo, DumpTable) {
ProcessInstanceInfo::DumpTableHeader(s, show_args, verbose);
info.DumpAsTableRow(s, resolver, show_args, verbose);
EXPECT_STREQ(
- R"(PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE ARGUMENTS
-====== ====== ========== ========== ========== ========== ======================== ============================
-47 0 user1 group3 2 4 x86_64-pc-linux
+ R"(PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE ARGUMENTS
+====== ====== ========== ========== ========== ========== ============================== ============================
+47 0 user1 group3 2 4 x86_64-pc-linux
)",
s.GetData());
}
TEST(ProcessInstanceInfo, DumpTable_invalidUID) {
- ProcessInstanceInfo info("a.out", ArchSpec("x86_64-pc-linux"), 47);
+ ProcessInstanceInfo info("a.out", ArchSpec("aarch64-unknown-linux-android"), 47);
DummyUserIDResolver resolver;
StreamString s;
@@ -85,9 +85,9 @@ TEST(ProcessInstanceInfo, DumpTable_inva
ProcessInstanceInfo::DumpTableHeader(s, show_args, verbose);
info.DumpAsTableRow(s, resolver, show_args, verbose);
EXPECT_STREQ(
- R"(PID PARENT USER TRIPLE NAME
-====== ====== ========== ======================== ============================
-47 0 x86_64-pc-linux a.out
+ R"(PID PARENT USER TRIPLE NAME
+====== ====== ========== ============================== ============================
+47 0 aarch64-unknown-linux-android a.out
)",
s.GetData());
}
More information about the lldb-commits
mailing list