================
@@ -480,3 +481,111 @@ CompilerType PlatformLinux::GetSiginfoType(const 
llvm::Triple &triple) {
   ast->CompleteTagDeclarationDefinition(siginfo_type);
   return siginfo_type;
 }
+
+static std::string GetDescriptionFromSiginfo(lldb::ValueObjectSP siginfo_sp) {
+  if (!siginfo_sp)
+    return "";
+
+  lldb_private::LinuxSignals linux_signals;
+  int code = 
siginfo_sp->GetChildMemberWithName("si_code")->GetValueAsSigned(0);
+  int signo =
+      siginfo_sp->GetChildMemberWithName("si_signo")->GetValueAsSigned(-1);
+  // si_code = 0 is SI_NOINFO, we just want the description with nothing
----------------
labath wrote:

I don't think it is. The only reference I can find is 
https://github.com/torvalds/linux/blob/94305e83eccb3120c921cd3a015cd74731140bac/arch/sparc/include/uapi/asm/siginfo.h#L14
 and there it's set to 32767.

0 is 
[SI_USER](https://github.com/torvalds/linux/blob/94305e83eccb3120c921cd3a015cd74731140bac/include/uapi/asm-generic/siginfo.h#L174),
 which is used by `kill`, so in theory uid/pid should be set. However, it's 
also used as a default value, so maybe not printing the uid/pid in this case is 
actually correct:
https://github.com/torvalds/linux/blob/94305e83eccb3120c921cd3a015cd74731140bac/kernel/signal.c#L589-L599

https://github.com/llvm/llvm-project/pull/140150
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to