[Lldb-commits] [PATCH] D13646: [LLDB] Don't use signo as key in Signals DenseMap, as signo are not unique

Mohit Bhakkad via lldb-commits lldb-commits at lists.llvm.org
Sun Oct 18 21:25:40 PDT 2015

mohit.bhakkad added inline comments.

Comment at: include/lldb/Target/UnixSignals.h:101-102
@@ -100,1 +100,4 @@
+    ConstString
+    GetShortName(ConstString name) const;
clayborg wrote:
> Why are we doing this by name? shouldn't we do this with the signal number? And shouldn't this be named GetSignalAlias()?
Hi @clayborg,

sorry, I didn't write proper description while submitting this patch.

Here alias and short_name are two different things. As eg. for signal SIGCHLD, SIGCLD is an alias and CHLD is the short_name.
For providing alias, I have added a default argument called "alias" in function AddSignal, which will be stored in variable m_alias.

Now for short_name, we have another variable short_name. But for signals with alias, like SIGCHLD, we will have 2 short_names, i.e. CHLD and CLD. But if we observe, we can see that short_name is just signal_name with first 3 letters removed, which can solve our problem. So instead of hardcoding short_names in <key,value> map, we can use this function to get it at run time.




More information about the lldb-commits mailing list