This is an archive of the discontinued LLVM Phabricator instance.

[LLDB][MIPS] To handle SI_KERNEL generated for invalid 64 bit address
ClosedPublic

Authored by nitesh.jain on Jul 13 2015, 11:11 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

nitesh.jain retitled this revision from to [LLDB][MIPS] To handle SI_KERENEL generated for invalid 64 bit address.
nitesh.jain updated this object.
nitesh.jain added reviewers: clayborg, ovyalov.
nitesh.jain set the repository for this revision to rL LLVM.
nitesh.jain added a subscriber: lldb-commits.
clayborg edited edge metadata.Jul 15 2015, 10:32 AM

Is "SI_KERNEL" part of posix? I wonder if we need to put a "#ifdef SI_KERNEL" / "#endif" around this case and possibly other cases. If it is part of the POSIX spec, then this is good.

I think SI_KERNEL is not part of the POSIX specification. I will update the file with suggested changes.

Thanks

nitesh.jain edited edge metadata.
clayborg requested changes to this revision.Jul 22 2015, 10:24 AM
clayborg edited edge metadata.

So we are putting non-posix crash reasons into POSIX? Seems wrong to me. Seems like this should be detected in the linux specific code before letting a CrashReason.cpp crash reason if this is linux specific.

This revision now requires changes to proceed.Jul 22 2015, 10:24 AM
nitesh.jain retitled this revision from [LLDB][MIPS] To handle SI_KERENEL generated for invalid 64 bit address to [LLDB][MIPS] To handle SI_KERNEL generated for invalid 64 bit address.
nitesh.jain updated this object.
nitesh.jain edited edge metadata.

This patch handle checking for SI_KERNEL in NativeThreadLinux.cpp.

clayborg accepted this revision.Jul 27 2015, 11:16 AM
clayborg edited edge metadata.

Much better.

This revision is now accepted and ready to land.Jul 27 2015, 11:16 AM
clayborg requested changes to this revision.Jul 27 2015, 11:18 AM
clayborg edited edge metadata.

Fix typo and good to go

source/Plugins/Process/Linux/NativeThreadLinux.cpp
267 ↗(On Diff #30678)

type above: SI_KERENEL, should be SI_KERNEL

This revision now requires changes to proceed.Jul 27 2015, 11:18 AM
ovyalov added inline comments.Jul 27 2015, 7:09 PM
source/Plugins/Process/Linux/NativeThreadLinux.cpp
268 ↗(On Diff #30678)

As an option to make more concise:

const auto reason = (info->si_signo == SIGBUS && info->si_code == SI_KERNEL) ? CrashReason::eInvalidAddress : GetCrashReason(*info);
m_stop_description = GetCrashReasonString(reason, reinterpret_cast<uintptr_t>(info->si_addr));
268 ↗(On Diff #30678)

Please make sure that the change isn't introducing test regressions on Linux.

nitesh.jain edited edge metadata.

Fixed typo and modified file as per suggestion . This patch is tested on linux and working without any failures.

clayborg accepted this revision.Jul 28 2015, 9:03 AM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Jul 28 2015, 9:03 AM
ovyalov accepted this revision.Jul 28 2015, 8:20 PM
ovyalov edited edge metadata.

LGTM

This revision was automatically updated to reflect the committed changes.