[Lldb-commits] [lldb] r211899 - [cmake] When Python is disabled for LLDB, don't try to install the
Author: chandlerc Date: Fri Jun 27 10:04:42 2014 New Revision: 211899 URL: http://llvm.org/viewvc/llvm-project?rev=211899view=rev Log: [cmake] When Python is disabled for LLDB, don't try to install the python bindings. For example, this prevents errors on systems that disable python because the system python isn't available. Without this, we still try to install things and get install errors when that doesn't work. Modified: lldb/trunk/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=211899r1=211898r2=211899view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Fri Jun 27 10:04:42 2014 @@ -315,7 +315,7 @@ set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} #add_subdirectory(include) add_subdirectory(docs) -if (NOT CMAKE_SYSTEM_NAME MATCHES Windows) +if (NOT CMAKE_SYSTEM_NAME MATCHES Windows AND NOT LLDB_DISABLE_PYTHON) add_subdirectory(scripts) endif() add_subdirectory(source) ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Update ObjectFileELF to detect ELF triple based on ELF notes and the ELF header.
Thanks Todd, I'm very happy to see this go in! Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:1101 @@ +1100,3 @@ +uint32_t version_info; +if (data.GetU32 (offset, version_info, 1) == nullptr) +{ Todd Fiala wrote: Ed Maste wrote: Should we validate that the descsz is as expected in here too? E.g. `(note.n_name == LLDB_NT_OWNER_FREEBSD note.n_type == LLDB_NT_FREEBSD_ABI_TAG note.n_descsz == 4)` I could do that. It will fail either way if it's less than the expected size (i.e. if we go down the path of processing a note with an owner of LLDB_NT_OWNER_FREEBSD and a note type of LLDB_NT_FREEBSD_ABI_TAG) since the read will fail. It might be worth putting a warning in the code if the size doesn't match expectations - that way we'd at least be able to track down what was breaking if we found the note but it didn't match size expectations. (i.e. effectively a change in the note definition or a broken code emitter). I was thinking of the other case. if the size recorded in the file is larger than the data. We'd then partially consume the payload and then try to read a subsequent ELF note from the wrong location, no? http://reviews.llvm.org/D4302 ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r211903 - Revert the debugserver part of r211868. While formally a fine change, debugserver
Author: jingham Date: Fri Jun 27 11:02:55 2014 New Revision: 211903 URL: http://llvm.org/viewvc/llvm-project?rev=211903view=rev Log: Revert the debugserver part of r211868. While formally a fine change, debugserver doesn't depend on llvm (it really doesn't even depend on anything in lldb) and this nicety isn't worth adding that dependence. Modified: lldb/trunk/tools/debugserver/source/DNB.cpp lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp lldb/trunk/tools/debugserver/source/TTYState.h Modified: lldb/trunk/tools/debugserver/source/DNB.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=211903r1=211902r2=211903view=diff == --- lldb/trunk/tools/debugserver/source/DNB.cpp (original) +++ lldb/trunk/tools/debugserver/source/DNB.cpp Fri Jun 27 11:02:55 2014 @@ -47,7 +47,6 @@ #include DNBTimer.h #include CFBundle.h -#include llvm/ADT/STLExtras.h typedef std::shared_ptrMachProcess MachProcessSP; typedef std::mapnub_process_t, MachProcessSP ProcessMap; @@ -543,7 +542,7 @@ GetAllInfos (std::vectorstruct kinfo_pr { size_t size = 0; int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL }; -u_int namelen = llvm::array_lengthof(name); +u_int namelen = sizeof(name)/sizeof(int); int err; // Try to find out how many processes are around so we can Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp?rev=211903r1=211902r2=211903view=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp Fri Jun 27 11:02:55 2014 @@ -20,8 +20,6 @@ #include DNBThreadResumeActions.h #include MachProcess.h -#include llvm/ADT/STLExtras.h - MachThreadList::MachThreadList() : m_threads(), m_threads_mutex(PTHREAD_MUTEX_RECURSIVE), @@ -315,7 +313,7 @@ MachThreadList::UpdateThreadList(MachPro int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process-ProcessID() }; struct kinfo_proc processInfo; size_t bufsize = sizeof(processInfo); -if (sysctl(mib, llvm::array_lengthof(mib), processInfo, bufsize, NULL, 0) == 0 bufsize 0) +if (sysctl(mib, (unsigned)(sizeof(mib)/sizeof(int)), processInfo, bufsize, NULL, 0) == 0 bufsize 0) { if (processInfo.kp_proc.p_flag P_LP64) m_is_64_bit = true; Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp?rev=211903r1=211902r2=211903view=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp Fri Jun 27 11:02:55 2014 @@ -23,8 +23,6 @@ #include ARM_GCC_Registers.h #include ARM_DWARF_Registers.h -#include llvm/ADT/STLExtras.h - #include inttypes.h #include sys/sysctl.h @@ -1557,9 +1555,9 @@ DNBArchMachARM::g_exc_registers[] = }; // Number of registers in each register set -const size_t DNBArchMachARM::k_num_gpr_registers = llvm::array_lengthof(g_gpr_registers); -const size_t DNBArchMachARM::k_num_vfp_registers = llvm::array_lengthof(g_vfp_registers); -const size_t DNBArchMachARM::k_num_exc_registers = llvm::array_lengthof(g_exc_registers); +const size_t DNBArchMachARM::k_num_gpr_registers = sizeof(g_gpr_registers)/sizeof(DNBRegisterInfo); +const size_t DNBArchMachARM::k_num_vfp_registers = sizeof(g_vfp_registers)/sizeof(DNBRegisterInfo); +const size_t DNBArchMachARM::k_num_exc_registers = sizeof(g_exc_registers)/sizeof(DNBRegisterInfo); const size_t DNBArchMachARM::k_num_all_registers = k_num_gpr_registers + k_num_vfp_registers + k_num_exc_registers; //-- @@ -1576,7 +1574,7 @@ DNBArchMachARM::g_reg_sets[] = { Exception State Registers, g_exc_registers,k_num_exc_registers } }; // Total number of register sets for this architecture -const size_t DNBArchMachARM::k_num_register_sets = llvm::array_lengthof(g_reg_sets); +const size_t DNBArchMachARM::k_num_register_sets = sizeof(g_reg_sets)/sizeof(DNBRegisterSetInfo); const DNBRegisterSetInfo * Modified:
Re: [Lldb-commits] [lldb] r211868 - lldb: remove adhoc implementation of array_sizeof
Hey, Saleem. I reverted the debugserver part of this change. Debugserver doesn't currently depend on llvm (actually it really doesn't depend on lldb either) and I'd rather not add that dependence unless there's some strong reason. Jim On Jun 26, 2014, at 10:17 PM, Saleem Abdulrasool compn...@compnerd.org wrote: Author: compnerd Date: Fri Jun 27 00:17:41 2014 New Revision: 211868 URL: http://llvm.org/viewvc/llvm-project?rev=211868view=rev Log: lldb: remove adhoc implementation of array_sizeof Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Commands/CommandObjectRegister.cpp lldb/trunk/source/Core/ArchSpec.cpp lldb/trunk/source/Core/Language.cpp lldb/trunk/source/DataFormatters/FormatManager.cpp lldb/trunk/source/Host/common/Host.cpp lldb/trunk/source/Host/common/Terminal.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Interpreter/OptionValueBoolean.cpp lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/source/Utility/SharingPtr.cpp lldb/trunk/tools/debugserver/source/DNB.cpp lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp lldb/trunk/tools/debugserver/source/TTYState.h lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=211868r1=211867r2=211868view=diff == --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Fri Jun 27 00:17:41 2014 @@ -34,6 +34,7 @@ #include lldb/Target/StackFrame.h #include lldb/Target/Target.h #include lldb/Target/Thread.h +#include llvm/ADT/STLExtras.h #include llvm/ADT/StringRef.h using namespace lldb; @@ -71,7 +72,7 @@ CommandObjectExpression::CommandOptions: uint32_t CommandObjectExpression::CommandOptions::GetNumDefinitions () { -return sizeof(g_option_table)/sizeof(OptionDefinition); +return llvm::array_lengthof(g_option_table); } Error Modified: lldb/trunk/source/Commands/CommandObjectRegister.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectRegister.cpp?rev=211868r1=211867r2=211868view=diff == --- lldb/trunk/source/Commands/CommandObjectRegister.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectRegister.cpp Fri Jun 27 00:17:41 2014 @@ -31,6 +31,7 @@ #include lldb/Target/RegisterContext.h #include lldb/Target/SectionLoadList.h #include lldb/Target/Thread.h +#include llvm/ADT/STLExtras.h using namespace lldb; using namespace lldb_private; @@ -360,7 +361,7 @@ CommandObjectRegisterRead::CommandOption uint32_t CommandObjectRegisterRead::CommandOptions::GetNumDefinitions () { -return sizeof(g_option_table)/sizeof(OptionDefinition); +return llvm::array_lengthof(g_option_table); } Modified: lldb/trunk/source/Core/ArchSpec.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=211868r1=211867r2=211868view=diff == --- lldb/trunk/source/Core/ArchSpec.cpp (original) +++ lldb/trunk/source/Core/ArchSpec.cpp Fri Jun 27 00:17:41 2014 @@ -14,6 +14,7 @@ #include string +#include llvm/ADT/STLExtras.h #include llvm/Support/COFF.h #include llvm/Support/ELF.h #include llvm/Support/Host.h
[Lldb-commits] [lldb] r211907 - Fix ObjectFileELF to determine architectures independent of host.
Author: tfiala Date: Fri Jun 27 11:52:49 2014 New Revision: 211907 URL: http://llvm.org/viewvc/llvm-project?rev=211907view=rev Log: Fix ObjectFileELF to determine architectures independent of host. Previously ObjectFileELF was simplifying and assuming the object file it was looking at was the same as the host architecture/triple. This would break attempts to run, say, lldb on MacOSX against lldb-gdbserver on Linux since the MacOSX lldb would say that the linux elf file was really an Apple MacOSX architecture. Chaos would ensue. This change allows the elf file to parse ELF notes for Linux, FreeBSD and NetBSD, and determine the OS appropriately from them. It also initializes the OS type from the ELF header OSABI if it is set (which it is for FreeBSD but not for Linux). Added a test with freebsd and linux images that verify that '(lldb) image list -t -A' prints out the expected architecture for each. Added: lldb/trunk/test/functionalities/object-file/ lldb/trunk/test/functionalities/object-file/TestImageListMultiArchitecture.py lldb/trunk/test/functionalities/object-file/ls-freebsd-10.0-x86_64 (with props) lldb/trunk/test/functionalities/object-file/sleep-ubuntu-14.04-x86_64 (with props) Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=211907r1=211906r2=211907view=diff == --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original) +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Fri Jun 27 11:52:49 2014 @@ -41,6 +41,29 @@ using namespace elf; using namespace llvm::ELF; namespace { + +// ELF note owner definitions +const char *const LLDB_NT_OWNER_FREEBSD = FreeBSD; +const char *const LLDB_NT_OWNER_GNU = GNU; +const char *const LLDB_NT_OWNER_NETBSD = NetBSD; + +// ELF note type definitions +const elf_word LLDB_NT_FREEBSD_ABI_TAG = 0x01; +const elf_word LLDB_NT_FREEBSD_ABI_SIZE = 4; + +const elf_word LLDB_NT_GNU_ABI_TAG = 0x01; +const elf_word LLDB_NT_GNU_ABI_SIZE = 16; + +const elf_word LLDB_NT_GNU_BUILD_ID_TAG = 0x03; + +const elf_word LLDB_NT_NETBSD_ABI_TAG = 0x01; +const elf_word LLDB_NT_NETBSD_ABI_SIZE = 4; + +// GNU ABI note OS constants +const elf_word LLDB_NT_GNU_ABI_OS_LINUX = 0x00; +const elf_word LLDB_NT_GNU_ABI_OS_HURD= 0x01; +const elf_word LLDB_NT_GNU_ABI_OS_SOLARIS = 0x02; + //===--===// /// @class ELFRelocation /// @brief Generic wrapper for ELFRel and ELFRela. @@ -448,6 +471,55 @@ ObjectFileELF::CalculateELFNotesSegments return core_notes_crc; } +static const char* +OSABIAsCString (unsigned char osabi_byte) +{ +#define _MAKE_OSABI_CASE(x) case x: return #x +switch (osabi_byte) +{ +_MAKE_OSABI_CASE(ELFOSABI_NONE); +_MAKE_OSABI_CASE(ELFOSABI_HPUX); +_MAKE_OSABI_CASE(ELFOSABI_NETBSD); +_MAKE_OSABI_CASE(ELFOSABI_GNU); +_MAKE_OSABI_CASE(ELFOSABI_HURD); +_MAKE_OSABI_CASE(ELFOSABI_SOLARIS); +_MAKE_OSABI_CASE(ELFOSABI_AIX); +_MAKE_OSABI_CASE(ELFOSABI_IRIX); +_MAKE_OSABI_CASE(ELFOSABI_FREEBSD); +_MAKE_OSABI_CASE(ELFOSABI_TRU64); +_MAKE_OSABI_CASE(ELFOSABI_MODESTO); +_MAKE_OSABI_CASE(ELFOSABI_OPENBSD); +_MAKE_OSABI_CASE(ELFOSABI_OPENVMS); +_MAKE_OSABI_CASE(ELFOSABI_NSK); +_MAKE_OSABI_CASE(ELFOSABI_AROS); +_MAKE_OSABI_CASE(ELFOSABI_FENIXOS); +_MAKE_OSABI_CASE(ELFOSABI_C6000_ELFABI); +_MAKE_OSABI_CASE(ELFOSABI_C6000_LINUX); +_MAKE_OSABI_CASE(ELFOSABI_ARM); +_MAKE_OSABI_CASE(ELFOSABI_STANDALONE); +default: +return unknown-osabi; +} +#undef _MAKE_OSABI_CASE +} + +static bool +GetOsFromOSABI (unsigned char osabi_byte, llvm::Triple::OSType ostype) +{ +switch (osabi_byte) +{ +case ELFOSABI_AIX: ostype = llvm::Triple::OSType::AIX; break; +case ELFOSABI_FREEBSD: ostype = llvm::Triple::OSType::FreeBSD; break; +case ELFOSABI_GNU: ostype = llvm::Triple::OSType::Linux; break; +case ELFOSABI_NETBSD: ostype = llvm::Triple::OSType::NetBSD; break; +case ELFOSABI_OPENBSD: ostype = llvm::Triple::OSType::OpenBSD; break; +case ELFOSABI_SOLARIS: ostype = llvm::Triple::OSType::Solaris; break; +default: +ostype = llvm::Triple::OSType::UnknownOS; +} +return ostype != llvm::Triple::OSType::UnknownOS; +} + size_t ObjectFileELF::GetModuleSpecifications (const lldb_private::FileSpec file, lldb::DataBufferSP data_sp, @@ -456,6 +528,8 @@ ObjectFileELF::GetModuleSpecifications (
Re: [Lldb-commits] [lldb] r211903 - Revert the debugserver part of r211868. While formally a fine change, debugserver
While formally a fine change, debugserver doesn't depend on llvm (it really doesn't even depend on anything in lldb) and this nicety isn't worth adding that dependence. And it broke the Xcode build. Thanks for fixing, Jim! On Fri, Jun 27, 2014 at 9:02 AM, Jim Ingham jing...@apple.com wrote: Author: jingham Date: Fri Jun 27 11:02:55 2014 New Revision: 211903 URL: http://llvm.org/viewvc/llvm-project?rev=211903view=rev Log: Revert the debugserver part of r211868. While formally a fine change, debugserver doesn't depend on llvm (it really doesn't even depend on anything in lldb) and this nicety isn't worth adding that dependence. Modified: lldb/trunk/tools/debugserver/source/DNB.cpp lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp lldb/trunk/tools/debugserver/source/TTYState.h Modified: lldb/trunk/tools/debugserver/source/DNB.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=211903r1=211902r2=211903view=diff == --- lldb/trunk/tools/debugserver/source/DNB.cpp (original) +++ lldb/trunk/tools/debugserver/source/DNB.cpp Fri Jun 27 11:02:55 2014 @@ -47,7 +47,6 @@ #include DNBTimer.h #include CFBundle.h -#include llvm/ADT/STLExtras.h typedef std::shared_ptrMachProcess MachProcessSP; typedef std::mapnub_process_t, MachProcessSP ProcessMap; @@ -543,7 +542,7 @@ GetAllInfos (std::vectorstruct kinfo_pr { size_t size = 0; int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL }; -u_int namelen = llvm::array_lengthof(name); +u_int namelen = sizeof(name)/sizeof(int); int err; // Try to find out how many processes are around so we can Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp?rev=211903r1=211902r2=211903view=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp Fri Jun 27 11:02:55 2014 @@ -20,8 +20,6 @@ #include DNBThreadResumeActions.h #include MachProcess.h -#include llvm/ADT/STLExtras.h - MachThreadList::MachThreadList() : m_threads(), m_threads_mutex(PTHREAD_MUTEX_RECURSIVE), @@ -315,7 +313,7 @@ MachThreadList::UpdateThreadList(MachPro int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process-ProcessID() }; struct kinfo_proc processInfo; size_t bufsize = sizeof(processInfo); -if (sysctl(mib, llvm::array_lengthof(mib), processInfo, bufsize, NULL, 0) == 0 bufsize 0) +if (sysctl(mib, (unsigned)(sizeof(mib)/sizeof(int)), processInfo, bufsize, NULL, 0) == 0 bufsize 0) { if (processInfo.kp_proc.p_flag P_LP64) m_is_64_bit = true; Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp?rev=211903r1=211902r2=211903view=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp Fri Jun 27 11:02:55 2014 @@ -23,8 +23,6 @@ #include ARM_GCC_Registers.h #include ARM_DWARF_Registers.h -#include llvm/ADT/STLExtras.h - #include inttypes.h #include sys/sysctl.h @@ -1557,9 +1555,9 @@ DNBArchMachARM::g_exc_registers[] = }; // Number of registers in each register set -const size_t DNBArchMachARM::k_num_gpr_registers = llvm::array_lengthof(g_gpr_registers); -const size_t DNBArchMachARM::k_num_vfp_registers = llvm::array_lengthof(g_vfp_registers); -const size_t DNBArchMachARM::k_num_exc_registers = llvm::array_lengthof(g_exc_registers); +const size_t DNBArchMachARM::k_num_gpr_registers = sizeof(g_gpr_registers)/sizeof(DNBRegisterInfo); +const size_t DNBArchMachARM::k_num_vfp_registers = sizeof(g_vfp_registers)/sizeof(DNBRegisterInfo); +const size_t DNBArchMachARM::k_num_exc_registers = sizeof(g_exc_registers)/sizeof(DNBRegisterInfo); const size_t DNBArchMachARM::k_num_all_registers = k_num_gpr_registers + k_num_vfp_registers + k_num_exc_registers; //-- @@ -1576,7 +1574,7 @@ DNBArchMachARM::g_reg_sets[] = { Exception State Registers,
Re: [Lldb-commits] [PATCH] Don't truncate the target triple when initializing clang
I have some cycles to look at this while I’m doing a build. The original patch that brought this in is – Author: spyffe Date: Wed Apr 13 21:01:31 2011 New Revision: 129500 URL: http://llvm.org/viewvc/llvm-project?rev=129500view=rev Log: Updated LLVM to pick up fixes to the ARM instruction tables. Modified: lldb/trunk/llvm.zip lldb/trunk/scripts/build-llvm.pl lldb/trunk/source/Expression/ClangExpressionParser.cpp lldb/trunk/source/Expression/IRDynamicChecks.cpp lldb/trunk/source/Expression/IRForTarget.cpp – At the time, I was working on the ARM/Thumb disassemblers. It may have been that at the time the target triples were in flux. I don’t think there’s a specific use case that depends on this at this time, and if there is one, we can revisit it. Go ahead and take this out. Sean On Jun 26, 2014, at 11:15 AM, Todd Fiala tfi...@google.com wrote: LGTM - here's how I tested: Linux x86_64: (lldb) file /path/to/exe (lldb) b main.cpp:10 (lldb) run ... at breakpoint ... (lldb) expr 5*3 // prints result as expected Same result for MacOSX 10.9.3 with x86_64 MacOS executable. Let's ping the Apple folks and see if there is some kind of simulator/device that make choke on that, though, before you check this in. http://reviews.llvm.org/D4282 ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r211968 - Don't truncate the target triple when initializing clang.
Author: zturner Date: Fri Jun 27 18:19:42 2014 New Revision: 211968 URL: http://llvm.org/viewvc/llvm-project?rev=211968view=rev Log: Don't truncate the target triple when initializing clang. Reviewed by: Sean Callanan Differential Revision: http://reviews.llvm.org/D4282 Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=211968r1=211967r2=211968view=diff == --- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Fri Jun 27 18:19:42 2014 @@ -129,19 +129,6 @@ ClangExpressionParser::ClangExpressionPa if (target_sp target_sp-GetArchitecture().IsValid()) { std::string triple = target_sp-GetArchitecture().GetTriple().str(); - -int dash_count = 0; -for (size_t i = 0; i triple.size(); ++i) -{ -if (triple[i] == '-') -dash_count++; -if (dash_count == 3) -{ -triple.resize(i); -break; -} -} - m_compiler-getTargetOpts().Triple = triple; } else ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Don't truncate the target triple when initializing clang
Closed by commit rL211968 (authored by @zturner). REPOSITORY rL LLVM http://reviews.llvm.org/D4282 Files: lldb/trunk/source/Expression/ClangExpressionParser.cpp Index: lldb/trunk/source/Expression/ClangExpressionParser.cpp === --- lldb/trunk/source/Expression/ClangExpressionParser.cpp +++ lldb/trunk/source/Expression/ClangExpressionParser.cpp @@ -129,19 +129,6 @@ if (target_sp target_sp-GetArchitecture().IsValid()) { std::string triple = target_sp-GetArchitecture().GetTriple().str(); - -int dash_count = 0; -for (size_t i = 0; i triple.size(); ++i) -{ -if (triple[i] == '-') -dash_count++; -if (dash_count == 3) -{ -triple.resize(i); -break; -} -} - m_compiler-getTargetOpts().Triple = triple; } else Index: lldb/trunk/source/Expression/ClangExpressionParser.cpp === --- lldb/trunk/source/Expression/ClangExpressionParser.cpp +++ lldb/trunk/source/Expression/ClangExpressionParser.cpp @@ -129,19 +129,6 @@ if (target_sp target_sp-GetArchitecture().IsValid()) { std::string triple = target_sp-GetArchitecture().GetTriple().str(); - -int dash_count = 0; -for (size_t i = 0; i triple.size(); ++i) -{ -if (triple[i] == '-') -dash_count++; -if (dash_count == 3) -{ -triple.resize(i); -break; -} -} - m_compiler-getTargetOpts().Triple = triple; } else ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits