[Lldb-commits] [lldb] r125617 - in /lldb/trunk/source/Plugins: Disassembler/llvm/DisassemblerLLVM.cpp Disassembler/llvm/DisassemblerLLVM.h Process/gdb-remote/GDBRemoteCommunication.cpp
Greg Clayton
gclayton at apple.com
Tue Feb 15 16:00:43 PST 2011
Author: gclayton
Date: Tue Feb 15 18:00:43 2011
New Revision: 125617
URL: http://llvm.org/viewvc/llvm-project?rev=125617&view=rev
Log:
Fixed an issue where detection of vCont support wasn't being done correctly.
Fixed how the LLDBDisassembler computes and uses a target triple.
Modified:
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp?rev=125617&r1=125616&r2=125617&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Tue Feb 15 18:00:43 2011
@@ -342,39 +342,33 @@
return 0;
}
-static inline const char *
-TripleForArchSpec (const ArchSpec &arch, char *triple, size_t triple_len)
-{
- const char *arch_name = arch.AsCString();
-
- if (arch_name)
- {
- snprintf(triple, triple_len, "%s-unknown-unknown", arch_name);
- return triple;
- }
- return NULL;
-}
-
static inline EDAssemblySyntax_t
SyntaxForArchSpec (const ArchSpec &arch)
{
- const char *arch_name = arch.AsCString();
-
- if (arch_name != NULL
- && ( (0 == ::strncasecmp (arch_name, "i386", 4))
- || (0 == ::strncasecmp (arch_name, "x86_64", 6))))
+ switch (arch.GetGenericCPUType())
+ {
+ case ArchSpec::eCPU_i386:
+ case ArchSpec::eCPU_x86_64:
return kEDAssemblySyntaxX86ATT;
-
+
+ case ArchSpec::eCPU_arm:
+ case ArchSpec::eCPU_ppc:
+ case ArchSpec::eCPU_ppc64:
+ case ArchSpec::eCPU_sparc:
+ default:
+ break;
+ }
return (EDAssemblySyntax_t)0; // default
}
Disassembler *
DisassemblerLLVM::CreateInstance(const ArchSpec &arch)
{
- char triple[256];
+ std::auto_ptr<DisassemblerLLVM> disasm_ap (new DisassemblerLLVM(arch));
+
+ if (disasm_ap->IsValid())
+ return disasm_ap.release();
- if (TripleForArchSpec (arch, triple, sizeof(triple)))
- return new DisassemblerLLVM(arch);
return NULL;
}
@@ -382,11 +376,11 @@
Disassembler (arch),
m_disassembler (NULL)
{
- char triple[256];
- if (TripleForArchSpec (arch, triple, sizeof(triple)))
+ const std::string &arch_triple = arch.GetTriple().str();
+ if (!arch_triple.empty())
{
- int err = EDGetDisassembler(&m_disassembler, triple, SyntaxForArchSpec (arch));
- assert (err == 0);
+ if (EDGetDisassembler(&m_disassembler, arch_triple.c_str(), SyntaxForArchSpec (arch)))
+ m_disassembler = NULL;
}
}
Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h?rev=125617&r1=125616&r2=125617&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h Tue Feb 15 18:00:43 2011
@@ -102,6 +102,12 @@
EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command);
protected:
+ bool
+ IsValid() const
+ {
+ return m_disassembler != NULL;
+ }
+
EDDisassemblerRef m_disassembler;
};
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=125617&r1=125616&r2=125617&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue Feb 15 18:00:43 2011
@@ -172,6 +172,8 @@
if (m_supports_vCont_c == eLazyBoolCalculate)
{
StringExtractorGDBRemote response;
+ m_supports_vCont_any = eLazyBoolNo;
+ m_supports_vCont_all = eLazyBoolNo;
m_supports_vCont_c = eLazyBoolNo;
m_supports_vCont_C = eLazyBoolNo;
m_supports_vCont_s = eLazyBoolNo;
More information about the lldb-commits
mailing list