[Lldb-commits] [PATCH] D68314: [process info] Remove assert in DoGetGroupName

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 1 19:15:31 PDT 2019


wallace created this revision.
wallace added reviewers: clayborg, aadsm, xiaobai, labath.
Herald added subscribers: lldb-commits, kristof.beyls, srhines.
Herald added a project: LLDB.

Disabling this assert prevents lldb-server from crashing, which prevents it from finding the user and group names of a given process list.

Before this change, the process list didn't contain names:

  PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                               ARGUMENTS
  ====== ====== ========== ========== ========== ========== ============================== ============================
  27585  982    10098      10098      10098      10098                                     com.LogiaGroup.LogiaDeck
  27623  982    10098      10098      10098      10098                                     com.digitalturbine.ignite.suspend.DataUsageRecorderService
  28024  982    10199      10199      10199      10199                                     com.google.vr.vrcore
  28061  983    10353      10353      10353      10353                                     com.instagram.android:videoplayer
  28121  982    10045      10045      10045      10045                                     com.sec.spp.push
  28325  982    10247      10247      10247      10247                                     com.facebook.orca
  28714  982    10367      10367      10367      10367                                     com.samsung.android.dialer
  29867  3208   2000       2000       2000       2000       aarch64-unknown-linux-android  /system/bin/sh-c /data/local/tmp/lldb-server platform --listen *:5557 --server --log-file /data/local/tmp/logs --log-channels gdb-remote all --log-channels lldb all

After this change, the list looks much better

  PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                               ARGUMENTS
  ====== ====== ========== ========== ========== ========== ============================== ============================
  24459  1      wifi       1010       wifi       1010       aarch64-unknown-linux-android  /vendor/bin/hw/wpa_supplicant-O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 -g at android:wpa_wlan0
  25098  982    u0_a42     10042      u0_a42     10042                                     com.samsung.android.messaging
  25442  982    u0_a65     10065      u0_a65     10065                                     com.samsung.android.mobileservice
  25974  982    u0_a9      10009      u0_a9      10009                                     com.samsung.android.contacts
  26377  982    radio      1001       radio      1001                                      com.samsung.android.incallui
  26390  983    u0_a26     10026      u0_a26     10026                                     com.samsung.android.game.gametools
  26876  983    u0_a306    10306      u0_a306    10306                                     com.tencent.mm:push


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68314

Files:
  lldb/source/Host/posix/HostInfoPosix.cpp


Index: lldb/source/Host/posix/HostInfoPosix.cpp
===================================================================
--- lldb/source/Host/posix/HostInfoPosix.cpp
+++ lldb/source/Host/posix/HostInfoPosix.cpp
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Host/posix/HostInfoPosix.h"
-#include "lldb/Utility/UserIDResolver.h"
 #include "lldb/Utility/Log.h"
+#include "lldb/Utility/UserIDResolver.h"
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Twine.h"
@@ -93,8 +93,6 @@
     if (group_info_ptr)
       return std::string(group_info_ptr->gr_name);
   }
-#else
-  assert(false && "getgrgid_r() not supported on Android");
 #endif
   return llvm::None;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68314.222742.patch
Type: text/x-patch
Size: 732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191002/3226427d/attachment.bin>


More information about the lldb-commits mailing list