This is an archive of the discontinued LLVM Phabricator instance.

[LLDB][MIPS] Getting correct signals for MIPS Host
ClosedPublic

Authored by nitesh.jain on Jun 2 2015, 3:07 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

nitesh.jain updated this revision to Diff 26959.Jun 2 2015, 3:07 AM
nitesh.jain retitled this revision from to [LLDB][MIPS] Getting correct signals for MIPS Host.
nitesh.jain updated this object.
nitesh.jain edited the test plan for this revision. (Show Details)
nitesh.jain added reviewers: clayborg, ovyalov.
nitesh.jain set the repository for this revision to rL LLVM.
nitesh.jain added a subscriber: Unknown Object (MLST).Jun 2 2015, 4:11 AM
clayborg accepted this revision.Jun 2 2015, 9:23 AM
clayborg edited edge metadata.

looks good.

This revision is now accepted and ready to land.Jun 2 2015, 9:23 AM
ovyalov edited edge metadata.Jun 2 2015, 11:24 AM

I'm wondering whether it's possible to consolidate linux signal logic in a single place - now we have 3 sites where we instantiate LinuxSignals and need to check for mips as well:

  1. source/Host/linux/Host.cpp
  2. https://github.com/llvm-mirror/lldb/blob/7ca60062e09b2ddbc68845b4b6c000fedf308351/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp#L834 - btw, it checks only for mips64 or mips64el
  3. https://github.com/llvm-mirror/lldb/blob/f7adf4b988da7bd5e13c99af60b6f030eb1beefe/source/Plugins/Process/elf-core/ProcessElfCore.cpp#L248 - we might want to put mips signals here as well.

As an idea - we can have factory method LinuxSignals::Create(const ArchSpec&) which will encompass decision making about creating LinuxSignals or MipsLinuxSignals. So, then LinuxSignals::Create can be reused on all call sites (to be safe - with protected LinuxSignals constructor to prevent explicit creation).

source/Host/linux/Host.cpp
396 ↗(On Diff #26959)

Please add spaces around =

399 ↗(On Diff #26959)

ditto.

My vote would be to build a Host::GetSignals(), have lldb-server use it, add the signal information to the qHostInfo packet. Then all signal info becomes the responsibility of the lldb-server we connect to which can use the current lldb_private::Host layer to determine the info correctly. The implementation becomes a #define fest for all the different hosts, but at least it is clean.

Greg

labath added a subscriber: labath.Jun 3 2015, 12:30 AM

I agree with Greg. Situation is even more complicated when you take the realtime signals into account. Currently, the numbers for these differ between linux and android *and* they also differ between x86, arm, arm64 (haven't checked mips). Getting these right on the client will be very tricky.

This revision was automatically updated to reflect the committed changes.

For now closing it with a TODO, as there are dependencies on MIPS signals.