[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
Mon Oct 12 03:25:41 PDT 2015


mohit.bhakkad created this revision.
mohit.bhakkad added a reviewer: clayborg.
mohit.bhakkad added subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
mohit.bhakkad set the repository for this revision to rL LLVM.
Herald added a subscriber: emaste.

Looking at the <signo,description> keymap generated by Reset() in LinuxSignals.cpp, we can see that some signo maps to 
more than one signals.

So for example, if one tries signal handle command on SIGCLD
(lldb) process handle SIGCLD -s 0 -p 1 -n 0
it says
error: Invalid signal name 'SIGCLD'

As a solution for this,I have tried:
1) std::next() for iterating keymap, but It looks like, entries with duplicate signo are not getting 
    added in map, so we get one signo only ones.
2) Just like "short_name" field, add another field "alias", and add all signals with same signo
    in same entry, but looks like for some of such signals default (suppress, stop, notify) values 
   are different, for example signo 16 in LinuxSignals.
3) So I suggest to move signo in description part of keymap, and adding serial_no for each signal as unique key.

Let me know if this approach is correct, and I will provide patches for other functions related to signals.

Repository:
  rL LLVM

http://reviews.llvm.org/D13646

Files:
  include/lldb/Target/UnixSignals.h
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  source/Plugins/Process/Utility/FreeBSDSignals.cpp
  source/Plugins/Process/Utility/LinuxSignals.cpp
  source/Plugins/Process/Utility/MipsLinuxSignals.cpp
  source/Target/UnixSignals.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13646.37088.patch
Type: text/x-patch
Size: 54939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151012/394a26d3/attachment-0001.bin>


More information about the lldb-commits mailing list