[Lldb-commits] [lldb] r189317 - Fix some names in the wake of my Mach-O changes to LLVM.
Charles Davis
cdavis5x at gmail.com
Mon Aug 26 22:04:58 PDT 2013
Author: cdavis
Date: Tue Aug 27 00:04:57 2013
New Revision: 189317
URL: http://llvm.org/viewvc/llvm-project?rev=189317&view=rev
Log:
Fix some names in the wake of my Mach-O changes to LLVM.
Modified:
lldb/trunk/include/lldb/Core/ConnectionMachPort.h
lldb/trunk/include/lldb/Core/Error.h
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/source/Core/ArchSpec.cpp
lldb/trunk/source/Core/ConnectionMachPort.cpp
lldb/trunk/source/Core/Error.cpp
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Host/macosx/Host.mm
lldb/trunk/source/Host/macosx/Symbols.cpp
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/trunk/source/Target/Process.cpp
Modified: lldb/trunk/include/lldb/Core/ConnectionMachPort.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ConnectionMachPort.h?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ConnectionMachPort.h (original)
+++ lldb/trunk/include/lldb/Core/ConnectionMachPort.h Tue Aug 27 00:04:57 2013
@@ -12,7 +12,8 @@
#define liblldb_ConnectionMachPort_h_
// C Includes
-#include <mach/mach.h>
+#include <mach/port.h>
+#include <mach/kern_return.h>
// C++ Includes
#include <string>
Modified: lldb/trunk/include/lldb/Core/Error.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Error.h?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Error.h (original)
+++ lldb/trunk/include/lldb/Core/Error.h Tue Aug 27 00:04:57 2013
@@ -11,11 +11,9 @@
#define __DCError_h__
#if defined(__cplusplus)
-#if defined (__APPLE__)
-#include <mach/mach.h>
-#endif
-#include <stdint.h>
-#include <stdio.h>
+#include "llvm/Support/DataTypes.h"
+
+#include <cstdio>
#include <string>
#include "lldb/lldb-private.h"
Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Tue Aug 27 00:04:57 2013
@@ -14,9 +14,6 @@
// C Includes
#include <limits.h>
-#ifndef LLDB_DISABLE_POSIX
-#include <spawn.h>
-#endif
// C++ Includes
#include <list>
@@ -487,7 +484,7 @@ public:
#ifndef LLDB_DISABLE_POSIX
static bool
- AddPosixSpawnFileAction (posix_spawn_file_actions_t *file_actions,
+ AddPosixSpawnFileAction (void *file_actions,
const FileAction *info,
Log *log,
Error& error);
Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Tue Aug 27 00:04:57 2013
@@ -155,58 +155,58 @@ ArchSpec::AutoComplete (const char *name
#define SUBTYPE_MASK 0x00FFFFFFu
static const ArchDefinitionEntry g_macho_arch_entries[] =
{
- { ArchSpec::eCore_arm_generic , llvm::MachO::CPUTypeARM , CPU_ANY, UINT32_MAX , UINT32_MAX },
- { ArchSpec::eCore_arm_generic , llvm::MachO::CPUTypeARM , 0 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv4 , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv4t , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv6 , llvm::MachO::CPUTypeARM , 6 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv5 , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv5e , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv5t , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_xscale , llvm::MachO::CPUTypeARM , 8 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv7 , llvm::MachO::CPUTypeARM , 9 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv7f , llvm::MachO::CPUTypeARM , 10 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv7s , llvm::MachO::CPUTypeARM , 11 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv7k , llvm::MachO::CPUTypeARM , 12 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv7m , llvm::MachO::CPUTypeARM , 15 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_arm_armv7em , llvm::MachO::CPUTypeARM , 16 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumb , llvm::MachO::CPUTypeARM , 0 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv4t , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv5 , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv5e , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv6 , llvm::MachO::CPUTypeARM , 6 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv7 , llvm::MachO::CPUTypeARM , 9 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv7f , llvm::MachO::CPUTypeARM , 10 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv7s , llvm::MachO::CPUTypeARM , 11 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv7k , llvm::MachO::CPUTypeARM , 12 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv7m , llvm::MachO::CPUTypeARM , 15 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_thumbv7em , llvm::MachO::CPUTypeARM , 16 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_generic , llvm::MachO::CPUTypePowerPC , CPU_ANY, UINT32_MAX , UINT32_MAX },
- { ArchSpec::eCore_ppc_generic , llvm::MachO::CPUTypePowerPC , 0 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc601 , llvm::MachO::CPUTypePowerPC , 1 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc602 , llvm::MachO::CPUTypePowerPC , 2 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc603 , llvm::MachO::CPUTypePowerPC , 3 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc603e , llvm::MachO::CPUTypePowerPC , 4 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc603ev , llvm::MachO::CPUTypePowerPC , 5 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc604 , llvm::MachO::CPUTypePowerPC , 6 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc604e , llvm::MachO::CPUTypePowerPC , 7 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc620 , llvm::MachO::CPUTypePowerPC , 8 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc750 , llvm::MachO::CPUTypePowerPC , 9 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc7400 , llvm::MachO::CPUTypePowerPC , 10 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc7450 , llvm::MachO::CPUTypePowerPC , 11 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc_ppc970 , llvm::MachO::CPUTypePowerPC , 100 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc64_generic , llvm::MachO::CPUTypePowerPC64 , 0 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_ppc64_ppc970_64 , llvm::MachO::CPUTypePowerPC64 , 100 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPUTypeI386 , 3 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_x86_32_i486 , llvm::MachO::CPUTypeI386 , 4 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_x86_32_i486sx , llvm::MachO::CPUTypeI386 , 0x84 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPUTypeI386 , CPU_ANY, UINT32_MAX , UINT32_MAX },
- { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , 3 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , 4 , UINT32_MAX , SUBTYPE_MASK },
- { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , CPU_ANY, UINT32_MAX , UINT32_MAX },
+ { ArchSpec::eCore_arm_generic , llvm::MachO::CPU_TYPE_ARM , CPU_ANY, UINT32_MAX , UINT32_MAX },
+ { ArchSpec::eCore_arm_generic , llvm::MachO::CPU_TYPE_ARM , 0 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv4 , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv4t , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv6 , llvm::MachO::CPU_TYPE_ARM , 6 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv5 , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv5e , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv5t , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_xscale , llvm::MachO::CPU_TYPE_ARM , 8 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv7 , llvm::MachO::CPU_TYPE_ARM , 9 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv7f , llvm::MachO::CPU_TYPE_ARM , 10 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv7s , llvm::MachO::CPU_TYPE_ARM , 11 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv7k , llvm::MachO::CPU_TYPE_ARM , 12 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv7m , llvm::MachO::CPU_TYPE_ARM , 15 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_arm_armv7em , llvm::MachO::CPU_TYPE_ARM , 16 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumb , llvm::MachO::CPU_TYPE_ARM , 0 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv4t , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv5 , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv5e , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv6 , llvm::MachO::CPU_TYPE_ARM , 6 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv7 , llvm::MachO::CPU_TYPE_ARM , 9 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv7f , llvm::MachO::CPU_TYPE_ARM , 10 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv7s , llvm::MachO::CPU_TYPE_ARM , 11 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv7k , llvm::MachO::CPU_TYPE_ARM , 12 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv7m , llvm::MachO::CPU_TYPE_ARM , 15 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_thumbv7em , llvm::MachO::CPU_TYPE_ARM , 16 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_generic , llvm::MachO::CPU_TYPE_POWERPC , CPU_ANY, UINT32_MAX , UINT32_MAX },
+ { ArchSpec::eCore_ppc_generic , llvm::MachO::CPU_TYPE_POWERPC , 0 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc601 , llvm::MachO::CPU_TYPE_POWERPC , 1 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc602 , llvm::MachO::CPU_TYPE_POWERPC , 2 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc603 , llvm::MachO::CPU_TYPE_POWERPC , 3 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc603e , llvm::MachO::CPU_TYPE_POWERPC , 4 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc603ev , llvm::MachO::CPU_TYPE_POWERPC , 5 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc604 , llvm::MachO::CPU_TYPE_POWERPC , 6 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc604e , llvm::MachO::CPU_TYPE_POWERPC , 7 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc620 , llvm::MachO::CPU_TYPE_POWERPC , 8 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc750 , llvm::MachO::CPU_TYPE_POWERPC , 9 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc7400 , llvm::MachO::CPU_TYPE_POWERPC , 10 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc7450 , llvm::MachO::CPU_TYPE_POWERPC , 11 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc_ppc970 , llvm::MachO::CPU_TYPE_POWERPC , 100 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc64_generic , llvm::MachO::CPU_TYPE_POWERPC64 , 0 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_ppc64_ppc970_64 , llvm::MachO::CPU_TYPE_POWERPC64 , 100 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPU_TYPE_I386 , 3 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_x86_32_i486 , llvm::MachO::CPU_TYPE_I386 , 4 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_x86_32_i486sx , llvm::MachO::CPU_TYPE_I386 , 0x84 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPU_TYPE_I386 , CPU_ANY, UINT32_MAX , UINT32_MAX },
+ { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , 3 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , 4 , UINT32_MAX , SUBTYPE_MASK },
+ { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , CPU_ANY, UINT32_MAX , UINT32_MAX },
// Catch any unknown mach architectures so we can always use the object and symbol mach-o files
- { ArchSpec::eCore_uknownMach32 , 0 , 0 , 0xFF000000u, 0x00000000u },
- { ArchSpec::eCore_uknownMach64 , llvm::MachO::CPUArchABI64 , 0 , 0xFF000000u, 0x00000000u }
+ { ArchSpec::eCore_uknownMach32 , 0 , 0 , 0xFF000000u, 0x00000000u },
+ { ArchSpec::eCore_uknownMach64 , llvm::MachO::CPU_ARCH_ABI64 , 0 , 0xFF000000u, 0x00000000u }
};
static const ArchDefinition g_macho_arch_def = {
eArchTypeMachO,
Modified: lldb/trunk/source/Core/ConnectionMachPort.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionMachPort.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Core/ConnectionMachPort.cpp (original)
+++ lldb/trunk/source/Core/ConnectionMachPort.cpp Tue Aug 27 00:04:57 2013
@@ -11,6 +11,7 @@
#include "lldb/Core/ConnectionMachPort.h"
// C Includes
+#include <mach/mach.h>
#include <servers/bootstrap.h>
// C++ Includes
Modified: lldb/trunk/source/Core/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Error.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Core/Error.cpp (original)
+++ lldb/trunk/source/Core/Error.cpp Tue Aug 27 00:04:57 2013
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
// C Includes
-#include <errno.h>
+#include <mach/mach.h>
// C++ Includes
// Other libraries and framework includes
@@ -16,9 +16,8 @@
#include "lldb/Core/Error.h"
#include "lldb/Core/Log.h"
#include "llvm/ADT/SmallVector.h"
+#include <cerrno>
#include <cstdarg>
-#include <cstdlib>
-#include <cstring>
#if defined (__arm__) && defined (__APPLE__)
#include <SpringBoardServices/SpringBoardServer.h>
Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Tue Aug 27 00:04:57 2013
@@ -27,12 +27,9 @@
#endif
#if defined (__APPLE__)
-
-#include <dispatch/dispatch.h>
-#include <libproc.h>
-#include <mach-o/dyld.h>
#include <mach/mach_port.h>
-
+#include <mach/mach_init.h>
+#include <mach-o/dyld.h>
#endif
#if defined (__linux__) || defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
@@ -61,7 +58,6 @@
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Host.h"
-#include "llvm/Support/MachO.h"
#include "llvm/Support/raw_ostream.h"
Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Tue Aug 27 00:04:57 2013
@@ -21,6 +21,8 @@
#include "launcherXPCService/LauncherXPCService.h"
#endif
+#include "llvm/Support/Host.h"
+
#include <asl.h>
#include <crt_externs.h>
#include <execinfo.h>
@@ -55,9 +57,6 @@
#include "cfcpp/CFCReleaser.h"
#include "cfcpp/CFCString.h"
-#include "llvm/Support/Host.h"
-#include "llvm/Support/MachO.h"
-
#include <objc/objc-auto.h>
#include <CoreFoundation/CoreFoundation.h>
@@ -1108,9 +1107,9 @@ GetMacOSXProcessCPUType (ProcessInstance
{
switch (cpu)
{
- case llvm::MachO::CPUTypeI386: sub = llvm::MachO::CPUSubType_I386_ALL; break;
- case llvm::MachO::CPUTypeX86_64: sub = llvm::MachO::CPUSubType_X86_64_ALL; break;
- case llvm::MachO::CPUTypeARM:
+ case CPU_TYPE_I386: sub = CPU_SUBTYPE_I386_ALL; break;
+ case CPU_TYPE_X86_64: sub = CPU_SUBTYPE_X86_64_ALL; break;
+ case CPU_TYPE_ARM:
{
uint32_t cpusubtype = 0;
len = sizeof(cpusubtype);
Modified: lldb/trunk/source/Host/macosx/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Symbols.cpp (original)
+++ lldb/trunk/source/Host/macosx/Symbols.cpp Tue Aug 27 00:04:57 2013
@@ -62,8 +62,8 @@ SkinnyMachOFileContainsArchAndUUID
const uint32_t magic
)
{
- assert(magic == HeaderMagic32 || magic == HeaderMagic32Swapped || magic == HeaderMagic64 || magic == HeaderMagic64Swapped);
- if (magic == HeaderMagic32 || magic == HeaderMagic64)
+ assert(magic == MH_MAGIC || magic == MH_CIGAM || magic == MH_MAGIC_64 || magic == MH_CIGAM_64);
+ if (magic == MH_MAGIC || magic == MH_MAGIC_64)
data.SetByteOrder (lldb::endian::InlHostByteOrder());
else if (lldb::endian::InlHostByteOrder() == eByteOrderBig)
data.SetByteOrder (eByteOrderLittle);
@@ -93,11 +93,11 @@ SkinnyMachOFileContainsArchAndUUID
if (uuid == NULL)
return true;
- if (magic == HeaderMagic64Swapped || magic == HeaderMagic64)
+ if (magic == MH_CIGAM_64 || magic == MH_MAGIC_64)
data_offset += 4; // Skip reserved field for in mach_header_64
// Make sure we have enough data for all the load commands
- if (magic == HeaderMagic64Swapped || magic == HeaderMagic64)
+ if (magic == MH_CIGAM_64 || magic == MH_MAGIC_64)
{
if (data.GetByteSize() < sizeof(struct mach_header_64) + sizeofcmds)
{
@@ -119,7 +119,7 @@ SkinnyMachOFileContainsArchAndUUID
const lldb::offset_t cmd_offset = data_offset; // Save this data_offset in case parsing of the segment goes awry!
uint32_t cmd = data.GetU32(&data_offset);
uint32_t cmd_size = data.GetU32(&data_offset);
- if (cmd == LoadCommandUUID)
+ if (cmd == LC_UUID)
{
lldb_private::UUID file_uuid (data.GetData(&data_offset, 16), 16);
if (file_uuid == *uuid)
@@ -143,7 +143,7 @@ UniversalMachOFileContainsArchAndUUID
const uint32_t magic
)
{
- assert(magic == UniversalMagic || magic == UniversalMagicSwapped);
+ assert(magic == FAT_MAGIC || magic == FAT_CIGAM);
// Universal mach-o files always have their headers encoded as BIG endian
data.SetByteOrder(eByteOrderBig);
@@ -182,10 +182,10 @@ UniversalMachOFileContainsArchAndUUID
switch (arch_magic)
{
- case HeaderMagic32:
- case HeaderMagic32Swapped:
- case HeaderMagic64:
- case HeaderMagic64Swapped:
+ case MH_MAGIC:
+ case MH_CIGAM:
+ case MH_MAGIC_64:
+ case MH_CIGAM_64:
if (SkinnyMachOFileContainsArchAndUUID (file_spec, arch, uuid, file_offset + arch_offset, arch_data, arch_data_offset, arch_magic))
return true;
break;
@@ -216,15 +216,15 @@ FileAtPathContainsArchAndUUID
switch (magic)
{
// 32 bit mach-o file
- case HeaderMagic32:
- case HeaderMagic32Swapped:
- case HeaderMagic64:
- case HeaderMagic64Swapped:
+ case MH_MAGIC:
+ case MH_CIGAM:
+ case MH_MAGIC_64:
+ case MH_CIGAM_64:
return SkinnyMachOFileContainsArchAndUUID (file_spec, arch, uuid, file_offset, data, data_offset, magic);
// fat mach-o file
- case UniversalMagic:
- case UniversalMagicSwapped:
+ case FAT_MAGIC:
+ case FAT_CIGAM:
return UniversalMachOFileContainsArchAndUUID (file_spec, arch, uuid, file_offset, data, data_offset, magic);
default:
Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Tue Aug 27 00:04:57 2013
@@ -394,10 +394,10 @@ DynamicLoaderDarwinKernel::CheckForKerne
Error read_error;
uint64_t result = process->ReadUnsignedIntegerFromMemory (addr, 4, LLDB_INVALID_ADDRESS, read_error);
- if (result != llvm::MachO::HeaderMagic64
- && result != llvm::MachO::HeaderMagic32
- && result != llvm::MachO::HeaderMagic32Swapped
- && result != llvm::MachO::HeaderMagic64Swapped)
+ if (result != llvm::MachO::MH_MAGIC_64
+ && result != llvm::MachO::MH_MAGIC
+ && result != llvm::MachO::MH_CIGAM
+ && result != llvm::MachO::MH_CIGAM_64)
{
return UUID();
}
@@ -407,8 +407,8 @@ DynamicLoaderDarwinKernel::CheckForKerne
if (process->DoReadMemory (addr, &header, sizeof(header), read_error) != sizeof(header))
return UUID();
- if (header.magic == llvm::MachO::HeaderMagic32Swapped ||
- header.magic == llvm::MachO::HeaderMagic64Swapped)
+ if (header.magic == llvm::MachO::MH_CIGAM ||
+ header.magic == llvm::MachO::MH_CIGAM_64)
{
header.magic = llvm::ByteSwap_32(header.magic);
header.cputype = llvm::ByteSwap_32(header.cputype);
@@ -420,8 +420,8 @@ DynamicLoaderDarwinKernel::CheckForKerne
}
// A kernel is an executable which does not have the dynamic link object flag set.
- if (header.filetype == llvm::MachO::HeaderFileTypeExecutable
- && (header.flags & llvm::MachO::HeaderFlagBitIsDynamicLinkObject) == 0)
+ if (header.filetype == llvm::MachO::MH_EXECUTE
+ && (header.flags & llvm::MachO::MH_DYLDLINK) == 0)
{
// Create a full module to get the UUID
ModuleSP memory_module_sp = process->ReadModuleFromMemory (FileSpec ("temp_mach_kernel", false), addr);
@@ -1629,12 +1629,12 @@ DynamicLoaderDarwinKernel::GetByteOrderF
{
switch (magic)
{
- case llvm::MachO::HeaderMagic32:
- case llvm::MachO::HeaderMagic64:
+ case llvm::MachO::MH_MAGIC:
+ case llvm::MachO::MH_MAGIC_64:
return lldb::endian::InlHostByteOrder();
- case llvm::MachO::HeaderMagic32Swapped:
- case llvm::MachO::HeaderMagic64Swapped:
+ case llvm::MachO::MH_CIGAM:
+ case llvm::MachO::MH_CIGAM_64:
if (lldb::endian::InlHostByteOrder() == lldb::eByteOrderBig)
return lldb::eByteOrderLittle;
else
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Aug 27 00:04:57 2013
@@ -290,10 +290,10 @@ DynamicLoaderMacOSXDYLD::LocateDYLD()
uint32_t magic = data.GetU32 (&offset);
switch (magic)
{
- case llvm::MachO::HeaderMagic32:
- case llvm::MachO::HeaderMagic64:
- case llvm::MachO::HeaderMagic32Swapped:
- case llvm::MachO::HeaderMagic64Swapped:
+ case llvm::MachO::MH_MAGIC:
+ case llvm::MachO::MH_MAGIC_64:
+ case llvm::MachO::MH_CIGAM:
+ case llvm::MachO::MH_CIGAM_64:
m_process_image_addr_is_all_images_infos = false;
return ReadDYLDInfoFromMemoryAndSetNotificationCallback(shlib_addr);
@@ -385,7 +385,7 @@ DynamicLoaderMacOSXDYLD::ReadDYLDInfoFro
DataExtractor data; // Load command data
if (ReadMachHeader (addr, &m_dyld.header, &data))
{
- if (m_dyld.header.filetype == llvm::MachO::HeaderFileTypeDynamicLinkEditor)
+ if (m_dyld.header.filetype == llvm::MachO::MH_DYLINKER)
{
m_dyld.address = addr;
ModuleSP dyld_module_sp;
@@ -840,7 +840,7 @@ DynamicLoaderMacOSXDYLD::AddModulesUsing
if (image_module_sp)
{
- if (image_infos[idx].header.filetype == llvm::MachO::HeaderFileTypeDynamicLinkEditor)
+ if (image_infos[idx].header.filetype == llvm::MachO::MH_DYLINKER)
image_module_sp->SetIsDynamicLinkEditor (true);
ObjectFile *objfile = image_module_sp->GetObjectFile ();
@@ -1161,14 +1161,14 @@ DynamicLoaderMacOSXDYLD::ReadMachHeader
data.SetByteOrder(DynamicLoaderMacOSXDYLD::GetByteOrderFromMagic(header->magic));
switch (header->magic)
{
- case llvm::MachO::HeaderMagic32:
- case llvm::MachO::HeaderMagic32Swapped:
+ case llvm::MachO::MH_MAGIC:
+ case llvm::MachO::MH_CIGAM:
data.SetAddressByteSize(4);
load_cmd_addr += sizeof(llvm::MachO::mach_header);
break;
- case llvm::MachO::HeaderMagic64:
- case llvm::MachO::HeaderMagic64Swapped:
+ case llvm::MachO::MH_MAGIC_64:
+ case llvm::MachO::MH_CIGAM_64:
data.SetAddressByteSize(8);
load_cmd_addr += sizeof(llvm::MachO::mach_header_64);
break;
@@ -1231,7 +1231,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadComman
load_cmd.cmdsize = data.GetU32 (&offset);
switch (load_cmd.cmd)
{
- case llvm::MachO::LoadCommandSegment32:
+ case llvm::MachO::LC_SEGMENT:
{
segment.name.SetTrimmedCStringWithLength ((const char *)data.GetData(&offset, 16), 16);
// We are putting 4 uint32_t values 4 uint64_t values so
@@ -1246,7 +1246,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadComman
}
break;
- case llvm::MachO::LoadCommandSegment64:
+ case llvm::MachO::LC_SEGMENT_64:
{
segment.name.SetTrimmedCStringWithLength ((const char *)data.GetData(&offset, 16), 16);
// Extract vmaddr, vmsize, fileoff, and filesize all at once
@@ -1257,7 +1257,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadComman
}
break;
- case llvm::MachO::LoadCommandDynamicLinkerIdent:
+ case llvm::MachO::LC_ID_DYLINKER:
if (lc_id_dylinker)
{
const lldb::offset_t name_offset = load_cmd_offset + data.GetU32 (&offset);
@@ -1266,7 +1266,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadComman
}
break;
- case llvm::MachO::LoadCommandUUID:
+ case llvm::MachO::LC_UUID:
dylib_info.uuid.SetBytes(data.GetData (&offset, 16));
break;
@@ -1324,7 +1324,7 @@ DynamicLoaderMacOSXDYLD::UpdateImageInfo
ParseLoadCommands (data, image_infos[i], NULL);
- if (image_infos[i].header.filetype == llvm::MachO::HeaderFileTypeExecutable)
+ if (image_infos[i].header.filetype == llvm::MachO::MH_EXECUTE)
exe_idx = i;
}
@@ -1809,12 +1809,12 @@ DynamicLoaderMacOSXDYLD::AddrByteSize()
{
switch (m_dyld.header.magic)
{
- case llvm::MachO::HeaderMagic32:
- case llvm::MachO::HeaderMagic32Swapped:
+ case llvm::MachO::MH_MAGIC:
+ case llvm::MachO::MH_CIGAM:
return 4;
- case llvm::MachO::HeaderMagic64:
- case llvm::MachO::HeaderMagic64Swapped:
+ case llvm::MachO::MH_MAGIC_64:
+ case llvm::MachO::MH_CIGAM_64:
return 8;
default:
@@ -1828,12 +1828,12 @@ DynamicLoaderMacOSXDYLD::GetByteOrderFro
{
switch (magic)
{
- case llvm::MachO::HeaderMagic32:
- case llvm::MachO::HeaderMagic64:
+ case llvm::MachO::MH_MAGIC:
+ case llvm::MachO::MH_MAGIC_64:
return lldb::endian::InlHostByteOrder();
- case llvm::MachO::HeaderMagic32Swapped:
- case llvm::MachO::HeaderMagic64Swapped:
+ case llvm::MachO::MH_CIGAM:
+ case llvm::MachO::MH_CIGAM_64:
if (lldb::endian::InlHostByteOrder() == lldb::eByteOrderBig)
return lldb::eByteOrderLittle;
else
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h Tue Aug 27 00:04:57 2013
@@ -228,7 +228,7 @@ protected:
{
if (header.cputype)
{
- if (header.cputype & llvm::MachO::CPUArchABI64)
+ if (header.cputype & llvm::MachO::CPU_ARCH_ABI64)
return 8;
else
return 4;
Modified: lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp Tue Aug 27 00:04:57 2013
@@ -85,7 +85,7 @@ ObjectContainerUniversalMachO::MagicByte
{
lldb::offset_t offset = 0;
uint32_t magic = data.GetU32(&offset);
- return magic == UniversalMagic || magic == UniversalMagicSwapped;
+ return magic == FAT_MAGIC || magic == FAT_CIGAM;
}
ObjectContainerUniversalMachO::ObjectContainerUniversalMachO
@@ -133,7 +133,7 @@ ObjectContainerUniversalMachO::ParseHead
header.magic = data.GetU32(&offset);
fat_archs.clear();
- if (header.magic == UniversalMagic)
+ if (header.magic == FAT_MAGIC)
{
data.SetAddressByteSize(4);
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Aug 27 00:04:57 2013
@@ -402,12 +402,12 @@ MachHeaderSizeFromMagic(uint32_t magic)
{
switch (magic)
{
- case HeaderMagic32:
- case HeaderMagic32Swapped:
+ case MH_MAGIC:
+ case MH_CIGAM:
return sizeof(struct mach_header);
- case HeaderMagic64:
- case HeaderMagic64Swapped:
+ case MH_MAGIC_64:
+ case MH_CIGAM_64:
return sizeof(struct mach_header_64);
break;
@@ -523,7 +523,7 @@ ObjectFileMachO::GetModuleSpecifications
spec.GetArchitecture().SetArchitecture(eArchTypeMachO,
header.cputype,
header.cpusubtype);
- if (header.filetype == HeaderFileTypePreloadedExecutable) // 0x5u MH_PRELOAD
+ if (header.filetype == MH_PRELOAD) // 0x5u
{
// Set OS to "unknown" - this is a standalone binary with no dyld et al
spec.GetArchitecture().GetTriple().setOS (llvm::Triple::UnknownOS);
@@ -637,26 +637,26 @@ ObjectFileMachO::ParseHeader (DataExtrac
bool is_64_bit = false;
switch (header.magic)
{
- case HeaderMagic32:
+ case MH_MAGIC:
data.SetByteOrder (lldb::endian::InlHostByteOrder());
data.SetAddressByteSize(4);
can_parse = true;
break;
- case HeaderMagic64:
+ case MH_MAGIC_64:
data.SetByteOrder (lldb::endian::InlHostByteOrder());
data.SetAddressByteSize(8);
can_parse = true;
is_64_bit = true;
break;
- case HeaderMagic32Swapped:
+ case MH_CIGAM:
data.SetByteOrder(lldb::endian::InlHostByteOrder() == eByteOrderBig ? eByteOrderLittle : eByteOrderBig);
data.SetAddressByteSize(4);
can_parse = true;
break;
- case HeaderMagic64Swapped:
+ case MH_CIGAM_64:
data.SetByteOrder(lldb::endian::InlHostByteOrder() == eByteOrderBig ? eByteOrderLittle : eByteOrderBig);
data.SetAddressByteSize(8);
is_64_bit = true;
@@ -695,25 +695,25 @@ ObjectFileMachO::ParseHeader ()
m_header.magic = m_data.GetU32(&offset);
switch (m_header.magic)
{
- case HeaderMagic32:
+ case MH_MAGIC:
m_data.SetByteOrder (lldb::endian::InlHostByteOrder());
m_data.SetAddressByteSize(4);
can_parse = true;
break;
- case HeaderMagic64:
+ case MH_MAGIC_64:
m_data.SetByteOrder (lldb::endian::InlHostByteOrder());
m_data.SetAddressByteSize(8);
can_parse = true;
break;
- case HeaderMagic32Swapped:
+ case MH_CIGAM:
m_data.SetByteOrder(lldb::endian::InlHostByteOrder() == eByteOrderBig ? eByteOrderLittle : eByteOrderBig);
m_data.SetAddressByteSize(4);
can_parse = true;
break;
- case HeaderMagic64Swapped:
+ case MH_CIGAM_64:
m_data.SetByteOrder(lldb::endian::InlHostByteOrder() == eByteOrderBig ? eByteOrderLittle : eByteOrderBig);
m_data.SetAddressByteSize(8);
can_parse = true;
@@ -776,7 +776,7 @@ ObjectFileMachO::GetByteOrder () const
bool
ObjectFileMachO::IsExecutable() const
{
- return m_header.filetype == HeaderFileTypeExecutable;
+ return m_header.filetype == MH_EXECUTE;
}
uint32_t
@@ -799,12 +799,12 @@ ObjectFileMachO::GetAddressClass (lldb::
SectionSP section_sp (symbol->GetAddress().GetSection());
if (section_sp)
{
- const SectionType section_type = section_sp->GetType();
+ const lldb::SectionType section_type = section_sp->GetType();
switch (section_type)
{
case eSectionTypeInvalid: return eAddressClassUnknown;
case eSectionTypeCode:
- if (m_header.cputype == llvm::MachO::CPUTypeARM)
+ if (m_header.cputype == llvm::MachO::CPU_TYPE_ARM)
{
// For ARM we have a bit in the n_desc field of the symbol
// that tells us ARM/Thumb which is bit 0x0008.
@@ -862,7 +862,7 @@ ObjectFileMachO::GetAddressClass (lldb::
case eSymbolTypeCode:
case eSymbolTypeTrampoline:
case eSymbolTypeResolver:
- if (m_header.cputype == llvm::MachO::CPUTypeARM)
+ if (m_header.cputype == llvm::MachO::CPU_TYPE_ARM)
{
// For ARM we have a bit in the n_desc field of the symbol
// that tells us ARM/Thumb which is bit 0x0008.
@@ -934,7 +934,7 @@ ObjectFileMachO::IsStripped ()
load_command lc;
if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
break;
- if (lc.cmd == LoadCommandDynamicSymtabInfo)
+ if (lc.cmd == LC_DYSYMTAB)
{
m_dysymtab.cmd = lc.cmd;
m_dysymtab.cmdsize = lc.cmdsize;
@@ -960,7 +960,7 @@ ObjectFileMachO::CreateSections (Section
{
m_sections_ap.reset(new SectionList());
- const bool is_dsym = (m_header.filetype == HeaderFileTypeDSYM);
+ const bool is_dsym = (m_header.filetype == MH_DSYM);
lldb::user_id_t segID = 0;
lldb::user_id_t sectID = 0;
lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
@@ -978,7 +978,7 @@ ObjectFileMachO::CreateSections (Section
if (m_data.GetU32(&offset, &encryption_cmd, 2) == NULL)
break;
- if (encryption_cmd.cmd == LoadCommandEncryptionInfo)
+ if (encryption_cmd.cmd == LC_ENCRYPTION_INFO)
{
if (m_data.GetU32(&offset, &encryption_cmd.cryptoff, 3))
{
@@ -1003,7 +1003,7 @@ ObjectFileMachO::CreateSections (Section
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
- if (load_cmd.cmd == LoadCommandSegment32 || load_cmd.cmd == LoadCommandSegment64)
+ if (load_cmd.cmd == LC_SEGMENT || load_cmd.cmd == LC_SEGMENT_64)
{
if (m_data.GetU8(&offset, (uint8_t*)load_cmd.segname, 16))
{
@@ -1039,7 +1039,7 @@ ObjectFileMachO::CreateSections (Section
// was likely invokved from something like ObjectFile::GetSectionList()) -- all we can do
// is null out the SectionList vector and if a process has been set up, dump a message
// to stdout. The most common case here is core file debugging with a truncated file.
- const char *lc_segment_name = load_cmd.cmd == LoadCommandSegment64 ? "LC_SEGMENT_64" : "LC_SEGMENT";
+ const char *lc_segment_name = load_cmd.cmd == LC_SEGMENT_64 ? "LC_SEGMENT_64" : "LC_SEGMENT";
module_sp->ReportError("is a corrupt mach-o file: load command %u %s has a fileoff (0x%" PRIx64 ") that extends beyond the end of the file (0x%" PRIx64 ")",
i,
lc_segment_name,
@@ -1057,12 +1057,12 @@ ObjectFileMachO::CreateSections (Section
// was likely invokved from something like ObjectFile::GetSectionList()) -- all we can do
// is null out the SectionList vector and if a process has been set up, dump a message
// to stdout. The most common case here is core file debugging with a truncated file.
- const char *lc_segment_name = load_cmd.cmd == LoadCommandSegment64 ? "LC_SEGMENT_64" : "LC_SEGMENT";
- module_sp->ReportError("is a corrupt mach-o file: load command %u %s has a fileoff + filesize (0x%" PRIx64 ") that extends beyond the end of the file (0x%" PRIx64 "), the segment will be truncated",
- i,
- lc_segment_name,
- load_cmd.fileoff + load_cmd.filesize,
- m_length);
+ const char *lc_segment_name = load_cmd.cmd == LC_SEGMENT_64 ? "LC_SEGMENT_64" : "LC_SEGMENT";
+ GetModule()->ReportError("is a corrupt mach-o file: load command %u %s has a fileoff + filesize (0x%" PRIx64 ") that extends beyond the end of the file (0x%" PRIx64 "), the segment will be truncated",
+ i,
+ lc_segment_name,
+ load_cmd.fileoff + load_cmd.filesize,
+ m_length);
// Tuncase the length
load_cmd.filesize = m_length - load_cmd.fileoff;
@@ -1071,7 +1071,7 @@ ObjectFileMachO::CreateSections (Section
if (m_data.GetU32(&offset, &load_cmd.maxprot, 4))
{
- const bool segment_is_encrypted = (load_cmd.flags & SegmentCommandFlagBitProtectedVersion1) != 0;
+ const bool segment_is_encrypted = (load_cmd.flags & SG_PROTECTED_VERSION_1) != 0;
// Keep a list of mach segments around in case we need to
// get at data that isn't stored in the abstracted Sections.
@@ -1129,15 +1129,14 @@ ObjectFileMachO::CreateSections (Section
struct section_64 sect64;
::memset (§64, 0, sizeof(sect64));
// Push a section into our mach sections for the section at
- // index zero (NListSectionNoSection) if we don't have any
- // mach sections yet...
+ // index zero (NO_SECT) if we don't have any mach sections yet...
if (m_mach_sections.empty())
m_mach_sections.push_back(sect64);
uint32_t segment_sect_idx;
const lldb::user_id_t first_segment_sectID = sectID + 1;
- const uint32_t num_u32s = load_cmd.cmd == LoadCommandSegment32 ? 7 : 8;
+ const uint32_t num_u32s = load_cmd.cmd == LC_SEGMENT ? 7 : 8;
for (segment_sect_idx=0; segment_sect_idx<load_cmd.nsects; ++segment_sect_idx)
{
if (m_data.GetU8(&offset, (uint8_t*)sect64.sectname, sizeof(sect64.sectname)) == NULL)
@@ -1231,7 +1230,7 @@ ObjectFileMachO::CreateSections (Section
}
assert (segment_sp.get());
- uint32_t mach_sect_type = sect64.flags & SectionFlagMaskSectionType;
+ uint32_t mach_sect_type = sect64.flags & SECTION_TYPE;
static ConstString g_sect_name_objc_data ("__objc_data");
static ConstString g_sect_name_objc_msgrefs ("__objc_msgrefs");
static ConstString g_sect_name_objc_selrefs ("__objc_selrefs");
@@ -1260,7 +1259,7 @@ ObjectFileMachO::CreateSections (Section
static ConstString g_sect_name_DATA ("__DATA");
static ConstString g_sect_name_TEXT ("__TEXT");
- SectionType sect_type = eSectionTypeOther;
+ lldb::SectionType sect_type = eSectionTypeOther;
if (section_name == g_sect_name_dwarf_debug_abbrev)
sect_type = eSectionTypeDWARFDebugAbbrev;
@@ -1314,7 +1313,7 @@ ObjectFileMachO::CreateSections (Section
switch (mach_sect_type)
{
// TODO: categorize sections by other flags for regular sections
- case SectionTypeRegular:
+ case S_REGULAR:
if (segment_sp->GetName() == g_sect_name_TEXT)
sect_type = eSectionTypeCode;
else if (segment_sp->GetName() == g_sect_name_DATA)
@@ -1322,22 +1321,22 @@ ObjectFileMachO::CreateSections (Section
else
sect_type = eSectionTypeOther;
break;
- case SectionTypeZeroFill: sect_type = eSectionTypeZeroFill; break;
- case SectionTypeCStringLiterals: sect_type = eSectionTypeDataCString; break; // section with only literal C strings
- case SectionType4ByteLiterals: sect_type = eSectionTypeData4; break; // section with only 4 byte literals
- case SectionType8ByteLiterals: sect_type = eSectionTypeData8; break; // section with only 8 byte literals
- case SectionTypeLiteralPointers: sect_type = eSectionTypeDataPointers; break; // section with only pointers to literals
- case SectionTypeNonLazySymbolPointers: sect_type = eSectionTypeDataPointers; break; // section with only non-lazy symbol pointers
- case SectionTypeLazySymbolPointers: sect_type = eSectionTypeDataPointers; break; // section with only lazy symbol pointers
- case SectionTypeSymbolStubs: sect_type = eSectionTypeCode; break; // section with only symbol stubs, byte size of stub in the reserved2 field
- case SectionTypeModuleInitFunctionPointers: sect_type = eSectionTypeDataPointers; break; // section with only function pointers for initialization
- case SectionTypeModuleTermFunctionPointers: sect_type = eSectionTypeDataPointers; break; // section with only function pointers for termination
- case SectionTypeCoalesced: sect_type = eSectionTypeOther; break;
- case SectionTypeZeroFillLarge: sect_type = eSectionTypeZeroFill; break;
- case SectionTypeInterposing: sect_type = eSectionTypeCode; break; // section with only pairs of function pointers for interposing
- case SectionType16ByteLiterals: sect_type = eSectionTypeData16; break; // section with only 16 byte literals
- case SectionTypeDTraceObjectFormat: sect_type = eSectionTypeDebug; break;
- case SectionTypeLazyDylibSymbolPointers: sect_type = eSectionTypeDataPointers; break;
+ case S_ZEROFILL: sect_type = eSectionTypeZeroFill; break;
+ case S_CSTRING_LITERALS: sect_type = eSectionTypeDataCString; break; // section with only literal C strings
+ case S_4BYTE_LITERALS: sect_type = eSectionTypeData4; break; // section with only 4 byte literals
+ case S_8BYTE_LITERALS: sect_type = eSectionTypeData8; break; // section with only 8 byte literals
+ case S_LITERAL_POINTERS: sect_type = eSectionTypeDataPointers; break; // section with only pointers to literals
+ case S_NON_LAZY_SYMBOL_POINTERS: sect_type = eSectionTypeDataPointers; break; // section with only non-lazy symbol pointers
+ case S_LAZY_SYMBOL_POINTERS: sect_type = eSectionTypeDataPointers; break; // section with only lazy symbol pointers
+ case S_SYMBOL_STUBS: sect_type = eSectionTypeCode; break; // section with only symbol stubs, byte size of stub in the reserved2 field
+ case S_MOD_INIT_FUNC_POINTERS: sect_type = eSectionTypeDataPointers; break; // section with only function pointers for initialization
+ case S_MOD_TERM_FUNC_POINTERS: sect_type = eSectionTypeDataPointers; break; // section with only function pointers for termination
+ case S_COALESCED: sect_type = eSectionTypeOther; break;
+ case S_GB_ZEROFILL: sect_type = eSectionTypeZeroFill; break;
+ case S_INTERPOSING: sect_type = eSectionTypeCode; break; // section with only pairs of function pointers for interposing
+ case S_16BYTE_LITERALS: sect_type = eSectionTypeData16; break; // section with only 16 byte literals
+ case S_DTRACE_DOF: sect_type = eSectionTypeDebug; break;
+ case S_LAZY_DYLIB_SYMBOL_POINTERS: sect_type = eSectionTypeDataPointers; break;
default: break;
}
}
@@ -1397,7 +1396,7 @@ ObjectFileMachO::CreateSections (Section
}
}
}
- else if (load_cmd.cmd == LoadCommandDynamicSymtabInfo)
+ else if (load_cmd.cmd == LC_DYSYMTAB)
{
m_dysymtab.cmd = load_cmd.cmd;
m_dysymtab.cmdsize = load_cmd.cmdsize;
@@ -1511,7 +1510,7 @@ ObjectFileMachO::ParseSymtab ()
// Watch for the symbol table load command
switch (lc.cmd)
{
- case LoadCommandSymtab:
+ case LC_SYMTAB:
symtab_load_command.cmd = lc.cmd;
symtab_load_command.cmdsize = lc.cmdsize;
// Read in the rest of the symtab load command
@@ -1546,7 +1545,7 @@ ObjectFileMachO::ParseSymtab ()
}
break;
- case LoadCommandFunctionStarts:
+ case LC_FUNCTION_STARTS:
function_starts_load_command.cmd = lc.cmd;
function_starts_load_command.cmdsize = lc.cmdsize;
if (m_data.GetU32(&offset, &function_starts_load_command.dataoff, 2) == NULL) // fill in symoff, nsyms, stroff, strsize fields
@@ -1745,7 +1744,7 @@ ObjectFileMachO::ParseSymtab ()
else
eh_frame_section_sp = section_list->FindSectionByName (g_section_name_eh_frame);
- const bool is_arm = (m_header.cputype == llvm::MachO::CPUTypeARM);
+ const bool is_arm = (m_header.cputype == llvm::MachO::CPU_TYPE_ARM);
// lldb works best if it knows the start addresss of all functions in a module.
// Linker symbols or debug info are normally the best source of information for start addr / size but
@@ -1799,7 +1798,7 @@ ObjectFileMachO::ParseSymtab ()
const size_t function_starts_count = function_starts.GetSize();
- const user_id_t TEXT_eh_frame_sectID = eh_frame_section_sp.get() ? eh_frame_section_sp->GetID() : NListSectionNoSection;
+ const user_id_t TEXT_eh_frame_sectID = eh_frame_section_sp.get() ? eh_frame_section_sp->GetID() : NO_SECT;
lldb::offset_t nlist_data_offset = 0;
@@ -2071,7 +2070,7 @@ ObjectFileMachO::ParseSymtab ()
SectionSP symbol_section;
uint32_t symbol_byte_size = 0;
bool add_nlist = true;
- bool is_debug = ((nlist.n_type & NlistMaskStab) != 0);
+ bool is_debug = ((nlist.n_type & N_STAB) != 0);
bool demangled_is_synthesized = false;
bool is_gsym = false;
@@ -2083,8 +2082,8 @@ ObjectFileMachO::ParseSymtab ()
{
switch (nlist.n_type)
{
- case StabGlobalSymbol:
- // N_GSYM -- global symbol: name,,NO_SECT,type,0
+ case N_GSYM:
+ // global symbol: name,,NO_SECT,type,0
// Sometimes the N_GSYM value contains the address.
// FIXME: In the .o files, we have a GSYM and a debug symbol for all the ObjC data. They
@@ -2109,13 +2108,13 @@ ObjectFileMachO::ParseSymtab ()
}
break;
- case StabFunctionName:
- // N_FNAME -- procedure name (f77 kludge): name,,NO_SECT,0,0
+ case N_FNAME:
+ // procedure name (f77 kludge): name,,NO_SECT,0,0
type = eSymbolTypeCompiler;
break;
- case StabFunction:
- // N_FUN -- procedure: name,,n_sect,linenumber,address
+ case N_FUN:
+ // procedure: name,,n_sect,linenumber,address
if (symbol_name)
{
type = eSymbolTypeCode;
@@ -2144,29 +2143,27 @@ ObjectFileMachO::ParseSymtab ()
}
break;
- case StabStaticSymbol:
- // N_STSYM -- static symbol: name,,n_sect,type,address
+ case N_STSYM:
+ // static symbol: name,,n_sect,type,address
N_STSYM_addr_to_sym_idx[nlist.n_value] = sym_idx;
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
type = eSymbolTypeData;
break;
- case StabLocalCommon:
- // N_LCSYM -- .lcomm symbol: name,,n_sect,type,address
+ case N_LCSYM:
+ // .lcomm symbol: name,,n_sect,type,address
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
type = eSymbolTypeCommonBlock;
break;
- case StabBeginSymbol:
- // N_BNSYM
+ case N_BNSYM:
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
// Skip these if we want minimal symbol tables
add_nlist = false;
break;
- case StabEndSymbol:
- // N_ENSYM
+ case N_ENSYM:
// Set the size of the N_BNSYM to the terminating index of this N_ENSYM
// so that we can always skip the entire symbol if we need to navigate
// more quickly at the source level when parsing STABS
@@ -2175,29 +2172,29 @@ ObjectFileMachO::ParseSymtab ()
break;
- case StabSourceFileOptions:
- // N_OPT - emitted with gcc2_compiled and in gcc source
+ case N_OPT:
+ // emitted with gcc2_compiled and in gcc source
type = eSymbolTypeCompiler;
break;
- case StabRegisterSymbol:
- // N_RSYM - register sym: name,,NO_SECT,type,register
+ case N_RSYM:
+ // register sym: name,,NO_SECT,type,register
type = eSymbolTypeVariable;
break;
- case StabSourceLine:
- // N_SLINE - src line: 0,,n_sect,linenumber,address
+ case N_SLINE:
+ // src line: 0,,n_sect,linenumber,address
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
type = eSymbolTypeLineEntry;
break;
- case StabStructureType:
- // N_SSYM - structure elt: name,,NO_SECT,type,struct_offset
+ case N_SSYM:
+ // structure elt: name,,NO_SECT,type,struct_offset
type = eSymbolTypeVariableType;
break;
- case StabSourceFileName:
- // N_SO - source file name
+ case N_SO:
+ // source file name
type = eSymbolTypeSourceFile;
if (symbol_name == NULL)
{
@@ -2282,29 +2279,29 @@ ObjectFileMachO::ParseSymtab ()
}
break;
- case StabObjectFileName:
- // N_OSO - object file name: name,,0,0,st_mtime
+ case N_OSO:
+ // object file name: name,,0,0,st_mtime
type = eSymbolTypeObjectFile;
break;
- case StabLocalSymbol:
- // N_LSYM - local sym: name,,NO_SECT,type,offset
+ case N_LSYM:
+ // local sym: name,,NO_SECT,type,offset
type = eSymbolTypeLocal;
break;
//----------------------------------------------------------------------
// INCL scopes
//----------------------------------------------------------------------
- case StabBeginIncludeFileName:
- // N_BINCL - include file beginning: name,,NO_SECT,0,sum
+ case N_BINCL:
+ // include file beginning: name,,NO_SECT,0,sum
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
N_INCL_indexes.push_back(sym_idx);
type = eSymbolTypeScopeBegin;
break;
- case StabEndIncludeFile:
- // N_EINCL - include file end: name,,NO_SECT,0,0
+ case N_EINCL:
+ // include file end: name,,NO_SECT,0,0
// Set the size of the N_BINCL to the terminating index of this N_EINCL
// so that we can always skip the entire symbol if we need to navigate
// more quickly at the source level when parsing STABS
@@ -2318,36 +2315,36 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeScopeEnd;
break;
- case StabIncludeFileName:
- // N_SOL - #included file name: name,,n_sect,0,address
+ case N_SOL:
+ // #included file name: name,,n_sect,0,address
type = eSymbolTypeHeaderFile;
// We currently don't use the header files on darwin
add_nlist = false;
break;
- case StabCompilerParameters:
- // N_PARAMS - compiler parameters: name,,NO_SECT,0,0
+ case N_PARAMS:
+ // compiler parameters: name,,NO_SECT,0,0
type = eSymbolTypeCompiler;
break;
- case StabCompilerVersion:
- // N_VERSION - compiler version: name,,NO_SECT,0,0
+ case N_VERSION:
+ // compiler version: name,,NO_SECT,0,0
type = eSymbolTypeCompiler;
break;
- case StabCompilerOptLevel:
- // N_OLEVEL - compiler -O level: name,,NO_SECT,0,0
+ case N_OLEVEL:
+ // compiler -O level: name,,NO_SECT,0,0
type = eSymbolTypeCompiler;
break;
- case StabParameter:
- // N_PSYM - parameter: name,,NO_SECT,type,offset
+ case N_PSYM:
+ // parameter: name,,NO_SECT,type,offset
type = eSymbolTypeVariable;
break;
- case StabAlternateEntry:
- // N_ENTRY - alternate entry: name,,n_sect,linenumber,address
+ case N_ENTRY:
+ // alternate entry: name,,n_sect,linenumber,address
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
type = eSymbolTypeLineEntry;
break;
@@ -2355,8 +2352,8 @@ ObjectFileMachO::ParseSymtab ()
//----------------------------------------------------------------------
// Left and Right Braces
//----------------------------------------------------------------------
- case StabLeftBracket:
- // N_LBRAC - left bracket: 0,,NO_SECT,nesting level,address
+ case N_LBRAC:
+ // left bracket: 0,,NO_SECT,nesting level,address
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
@@ -2364,8 +2361,8 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeScopeBegin;
break;
- case StabRightBracket:
- // N_RBRAC - right bracket: 0,,NO_SECT,nesting level,address
+ case N_RBRAC:
+ // right bracket: 0,,NO_SECT,nesting level,address
// Set the size of the N_LBRAC to the terminating index of this N_RBRAC
// so that we can always skip the entire symbol if we need to navigate
// more quickly at the source level when parsing STABS
@@ -2380,29 +2377,29 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeScopeEnd;
break;
- case StabDeletedIncludeFile:
- // N_EXCL - deleted include file: name,,NO_SECT,0,sum
+ case N_EXCL:
+ // deleted include file: name,,NO_SECT,0,sum
type = eSymbolTypeHeaderFile;
break;
//----------------------------------------------------------------------
// COMM scopes
//----------------------------------------------------------------------
- case StabBeginCommon:
- // N_BCOMM - begin common: name,,NO_SECT,0,0
+ case N_BCOMM:
+ // begin common: name,,NO_SECT,0,0
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
type = eSymbolTypeScopeBegin;
N_COMM_indexes.push_back(sym_idx);
break;
- case StabEndCommonLocal:
- // N_ECOML - end common (local name): 0,,n_sect,0,address
+ case N_ECOML:
+ // end common (local name): 0,,n_sect,0,address
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
// Fall through
- case StabEndCommon:
- // N_ECOMM - end common: name,,n_sect,0,0
+ case N_ECOMM:
+ // end common: name,,n_sect,0,0
// Set the size of the N_BCOMM to the terminating index of this N_ECOMM/N_ECOML
// so that we can always skip the entire symbol if we need to navigate
// more quickly at the source level when parsing STABS
@@ -2416,8 +2413,8 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeScopeEnd;
break;
- case StabLength:
- // N_LENG - second stab entry with length information
+ case N_LENG:
+ // second stab entry with length information
type = eSymbolTypeAdditional;
break;
@@ -2426,23 +2423,23 @@ ObjectFileMachO::ParseSymtab ()
}
else
{
- //uint8_t n_pext = NlistMaskPrivateExternal & nlist.n_type;
- uint8_t n_type = NlistMaskType & nlist.n_type;
- sym[sym_idx].SetExternal((NlistMaskExternal & nlist.n_type) != 0);
+ //uint8_t n_pext = N_PEXT & nlist.n_type;
+ uint8_t n_type = N_TYPE & nlist.n_type;
+ sym[sym_idx].SetExternal((N_EXT & nlist.n_type) != 0);
switch (n_type)
{
- case NListTypeIndirect: // N_INDR - Fall through
- case NListTypePreboundUndefined:// N_PBUD - Fall through
- case NListTypeUndefined: // N_UNDF
+ case N_INDR: // Fall through
+ case N_PBUD: // Fall through
+ case N_UNDF:
type = eSymbolTypeUndefined;
break;
- case NListTypeAbsolute: // N_ABS
+ case N_ABS:
type = eSymbolTypeAbsolute;
break;
- case NListTypeSection: // N_SECT
+ case N_SECT:
{
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
@@ -2459,27 +2456,27 @@ ObjectFileMachO::ParseSymtab ()
}
else
{
- uint32_t section_type = symbol_section->Get() & SectionFlagMaskSectionType;
+ uint32_t section_type = symbol_section->Get() & SECTION_TYPE;
switch (section_type)
{
- case SectionTypeRegular: break; // regular section
- //case SectionTypeZeroFill: type = eSymbolTypeData; break; // zero fill on demand section
- case SectionTypeCStringLiterals: type = eSymbolTypeData; break; // section with only literal C strings
- case SectionType4ByteLiterals: type = eSymbolTypeData; break; // section with only 4 byte literals
- case SectionType8ByteLiterals: type = eSymbolTypeData; break; // section with only 8 byte literals
- case SectionTypeLiteralPointers: type = eSymbolTypeTrampoline; break; // section with only pointers to literals
- case SectionTypeNonLazySymbolPointers: type = eSymbolTypeTrampoline; break; // section with only non-lazy symbol pointers
- case SectionTypeLazySymbolPointers: type = eSymbolTypeTrampoline; break; // section with only lazy symbol pointers
- case SectionTypeSymbolStubs: type = eSymbolTypeTrampoline; break; // section with only symbol stubs, byte size of stub in the reserved2 field
- case SectionTypeModuleInitFunctionPointers: type = eSymbolTypeCode; break; // section with only function pointers for initialization
- case SectionTypeModuleTermFunctionPointers: type = eSymbolTypeCode; break; // section with only function pointers for termination
- //case SectionTypeCoalesced: type = eSymbolType; break; // section contains symbols that are to be coalesced
- //case SectionTypeZeroFillLarge: type = eSymbolTypeData; break; // zero fill on demand section (that can be larger than 4 gigabytes)
- case SectionTypeInterposing: type = eSymbolTypeTrampoline; break; // section with only pairs of function pointers for interposing
- case SectionType16ByteLiterals: type = eSymbolTypeData; break; // section with only 16 byte literals
- case SectionTypeDTraceObjectFormat: type = eSymbolTypeInstrumentation; break;
- case SectionTypeLazyDylibSymbolPointers: type = eSymbolTypeTrampoline; break;
+ case S_REGULAR: break; // regular section
+ //case S_ZEROFILL: type = eSymbolTypeData; break; // zero fill on demand section
+ case S_CSTRING_LITERALS: type = eSymbolTypeData; break; // section with only literal C strings
+ case S_4BYTE_LITERALS: type = eSymbolTypeData; break; // section with only 4 byte literals
+ case S_8BYTE_LITERALS: type = eSymbolTypeData; break; // section with only 8 byte literals
+ case S_LITERAL_POINTERS: type = eSymbolTypeTrampoline; break; // section with only pointers to literals
+ case S_NON_LAZY_SYMBOL_POINTERS: type = eSymbolTypeTrampoline; break; // section with only non-lazy symbol pointers
+ case S_LAZY_SYMBOL_POINTERS: type = eSymbolTypeTrampoline; break; // section with only lazy symbol pointers
+ case S_SYMBOL_STUBS: type = eSymbolTypeTrampoline; break; // section with only symbol stubs, byte size of stub in the reserved2 field
+ case S_MOD_INIT_FUNC_POINTERS: type = eSymbolTypeCode; break; // section with only function pointers for initialization
+ case S_MOD_TERM_FUNC_POINTERS: type = eSymbolTypeCode; break; // section with only function pointers for termination
+ //case S_COALESCED: type = eSymbolType; break; // section contains symbols that are to be coalesced
+ //case S_GB_ZEROFILL: type = eSymbolTypeData; break; // zero fill on demand section (that can be larger than 4 gigabytes)
+ case S_INTERPOSING: type = eSymbolTypeTrampoline; break; // section with only pairs of function pointers for interposing
+ case S_16BYTE_LITERALS: type = eSymbolTypeData; break; // section with only 16 byte literals
+ case S_DTRACE_DOF: type = eSymbolTypeInstrumentation; break;
+ case S_LAZY_DYLIB_SYMBOL_POINTERS: type = eSymbolTypeTrampoline; break;
default: break;
}
@@ -2488,9 +2485,9 @@ ObjectFileMachO::ParseSymtab ()
const char *symbol_sect_name = symbol_section->GetName().AsCString();
if (symbol_section->IsDescendant (text_section_sp.get()))
{
- if (symbol_section->IsClear(SectionAttrUserPureInstructions |
- SectionAttrUserSelfModifyingCode |
- SectionAttrSytemSomeInstructions))
+ if (symbol_section->IsClear(S_ATTR_PURE_INSTRUCTIONS |
+ S_ATTR_SELF_MODIFYING_CODE |
+ S_ATTR_SOME_INSTRUCTIONS))
type = eSymbolTypeData;
else
type = eSymbolTypeCode;
@@ -2814,7 +2811,7 @@ ObjectFileMachO::ParseSymtab ()
lldb::addr_t symbol_byte_size = 0;
bool add_nlist = true;
bool is_gsym = false;
- bool is_debug = ((nlist.n_type & NlistMaskStab) != 0);
+ bool is_debug = ((nlist.n_type & N_STAB) != 0);
bool demangled_is_synthesized = false;
assert (sym_idx < num_syms);
@@ -2825,8 +2822,8 @@ ObjectFileMachO::ParseSymtab ()
{
switch (nlist.n_type)
{
- case StabGlobalSymbol:
- // N_GSYM -- global symbol: name,,NO_SECT,type,0
+ case N_GSYM:
+ // global symbol: name,,NO_SECT,type,0
// Sometimes the N_GSYM value contains the address.
// FIXME: In the .o files, we have a GSYM and a debug symbol for all the ObjC data. They
@@ -2851,13 +2848,13 @@ ObjectFileMachO::ParseSymtab ()
}
break;
- case StabFunctionName:
- // N_FNAME -- procedure name (f77 kludge): name,,NO_SECT,0,0
+ case N_FNAME:
+ // procedure name (f77 kludge): name,,NO_SECT,0,0
type = eSymbolTypeCompiler;
break;
- case StabFunction:
- // N_FUN -- procedure: name,,n_sect,linenumber,address
+ case N_FUN:
+ // procedure: name,,n_sect,linenumber,address
if (symbol_name)
{
type = eSymbolTypeCode;
@@ -2886,29 +2883,27 @@ ObjectFileMachO::ParseSymtab ()
}
break;
- case StabStaticSymbol:
- // N_STSYM -- static symbol: name,,n_sect,type,address
+ case N_STSYM:
+ // static symbol: name,,n_sect,type,address
N_STSYM_addr_to_sym_idx[nlist.n_value] = sym_idx;
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
type = eSymbolTypeData;
break;
- case StabLocalCommon:
- // N_LCSYM -- .lcomm symbol: name,,n_sect,type,address
+ case N_LCSYM:
+ // .lcomm symbol: name,,n_sect,type,address
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
type = eSymbolTypeCommonBlock;
break;
- case StabBeginSymbol:
- // N_BNSYM
+ case N_BNSYM:
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
// Skip these if we want minimal symbol tables
add_nlist = false;
break;
- case StabEndSymbol:
- // N_ENSYM
+ case N_ENSYM:
// Set the size of the N_BNSYM to the terminating index of this N_ENSYM
// so that we can always skip the entire symbol if we need to navigate
// more quickly at the source level when parsing STABS
@@ -2917,29 +2912,29 @@ ObjectFileMachO::ParseSymtab ()
break;
- case StabSourceFileOptions:
- // N_OPT - emitted with gcc2_compiled and in gcc source
+ case N_OPT:
+ // emitted with gcc2_compiled and in gcc source
type = eSymbolTypeCompiler;
break;
- case StabRegisterSymbol:
- // N_RSYM - register sym: name,,NO_SECT,type,register
+ case N_RSYM:
+ // register sym: name,,NO_SECT,type,register
type = eSymbolTypeVariable;
break;
- case StabSourceLine:
- // N_SLINE - src line: 0,,n_sect,linenumber,address
+ case N_SLINE:
+ // src line: 0,,n_sect,linenumber,address
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
type = eSymbolTypeLineEntry;
break;
- case StabStructureType:
- // N_SSYM - structure elt: name,,NO_SECT,type,struct_offset
+ case N_SSYM:
+ // structure elt: name,,NO_SECT,type,struct_offset
type = eSymbolTypeVariableType;
break;
- case StabSourceFileName:
- // N_SO - source file name
+ case N_SO:
+ // source file name
type = eSymbolTypeSourceFile;
if (symbol_name == NULL)
{
@@ -3025,29 +3020,29 @@ ObjectFileMachO::ParseSymtab ()
break;
- case StabObjectFileName:
- // N_OSO - object file name: name,,0,0,st_mtime
+ case N_OSO:
+ // object file name: name,,0,0,st_mtime
type = eSymbolTypeObjectFile;
break;
- case StabLocalSymbol:
- // N_LSYM - local sym: name,,NO_SECT,type,offset
+ case N_LSYM:
+ // local sym: name,,NO_SECT,type,offset
type = eSymbolTypeLocal;
break;
//----------------------------------------------------------------------
// INCL scopes
//----------------------------------------------------------------------
- case StabBeginIncludeFileName:
- // N_BINCL - include file beginning: name,,NO_SECT,0,sum
+ case N_BINCL:
+ // include file beginning: name,,NO_SECT,0,sum
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
N_INCL_indexes.push_back(sym_idx);
type = eSymbolTypeScopeBegin;
break;
- case StabEndIncludeFile:
- // N_EINCL - include file end: name,,NO_SECT,0,0
+ case N_EINCL:
+ // include file end: name,,NO_SECT,0,0
// Set the size of the N_BINCL to the terminating index of this N_EINCL
// so that we can always skip the entire symbol if we need to navigate
// more quickly at the source level when parsing STABS
@@ -3061,36 +3056,36 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeScopeEnd;
break;
- case StabIncludeFileName:
- // N_SOL - #included file name: name,,n_sect,0,address
+ case N_SOL:
+ // #included file name: name,,n_sect,0,address
type = eSymbolTypeHeaderFile;
// We currently don't use the header files on darwin
add_nlist = false;
break;
- case StabCompilerParameters:
- // N_PARAMS - compiler parameters: name,,NO_SECT,0,0
+ case N_PARAMS:
+ // compiler parameters: name,,NO_SECT,0,0
type = eSymbolTypeCompiler;
break;
- case StabCompilerVersion:
- // N_VERSION - compiler version: name,,NO_SECT,0,0
+ case N_VERSION:
+ // compiler version: name,,NO_SECT,0,0
type = eSymbolTypeCompiler;
break;
- case StabCompilerOptLevel:
- // N_OLEVEL - compiler -O level: name,,NO_SECT,0,0
+ case N_OLEVEL:
+ // compiler -O level: name,,NO_SECT,0,0
type = eSymbolTypeCompiler;
break;
- case StabParameter:
- // N_PSYM - parameter: name,,NO_SECT,type,offset
+ case N_PSYM:
+ // parameter: name,,NO_SECT,type,offset
type = eSymbolTypeVariable;
break;
- case StabAlternateEntry:
- // N_ENTRY - alternate entry: name,,n_sect,linenumber,address
+ case N_ENTRY:
+ // alternate entry: name,,n_sect,linenumber,address
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
type = eSymbolTypeLineEntry;
break;
@@ -3098,8 +3093,8 @@ ObjectFileMachO::ParseSymtab ()
//----------------------------------------------------------------------
// Left and Right Braces
//----------------------------------------------------------------------
- case StabLeftBracket:
- // N_LBRAC - left bracket: 0,,NO_SECT,nesting level,address
+ case N_LBRAC:
+ // left bracket: 0,,NO_SECT,nesting level,address
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
@@ -3107,8 +3102,8 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeScopeBegin;
break;
- case StabRightBracket:
- // N_RBRAC - right bracket: 0,,NO_SECT,nesting level,address
+ case N_RBRAC:
+ // right bracket: 0,,NO_SECT,nesting level,address
// Set the size of the N_LBRAC to the terminating index of this N_RBRAC
// so that we can always skip the entire symbol if we need to navigate
// more quickly at the source level when parsing STABS
@@ -3123,29 +3118,29 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeScopeEnd;
break;
- case StabDeletedIncludeFile:
- // N_EXCL - deleted include file: name,,NO_SECT,0,sum
+ case N_EXCL:
+ // deleted include file: name,,NO_SECT,0,sum
type = eSymbolTypeHeaderFile;
break;
//----------------------------------------------------------------------
// COMM scopes
//----------------------------------------------------------------------
- case StabBeginCommon:
- // N_BCOMM - begin common: name,,NO_SECT,0,0
+ case N_BCOMM:
+ // begin common: name,,NO_SECT,0,0
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
type = eSymbolTypeScopeBegin;
N_COMM_indexes.push_back(sym_idx);
break;
- case StabEndCommonLocal:
- // N_ECOML - end common (local name): 0,,n_sect,0,address
+ case N_ECOML:
+ // end common (local name): 0,,n_sect,0,address
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
// Fall through
- case StabEndCommon:
- // N_ECOMM - end common: name,,n_sect,0,0
+ case N_ECOMM:
+ // end common: name,,n_sect,0,0
// Set the size of the N_BCOMM to the terminating index of this N_ECOMM/N_ECOML
// so that we can always skip the entire symbol if we need to navigate
// more quickly at the source level when parsing STABS
@@ -3159,8 +3154,8 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeScopeEnd;
break;
- case StabLength:
- // N_LENG - second stab entry with length information
+ case N_LENG:
+ // second stab entry with length information
type = eSymbolTypeAdditional;
break;
@@ -3169,23 +3164,23 @@ ObjectFileMachO::ParseSymtab ()
}
else
{
- //uint8_t n_pext = NlistMaskPrivateExternal & nlist.n_type;
- uint8_t n_type = NlistMaskType & nlist.n_type;
- sym[sym_idx].SetExternal((NlistMaskExternal & nlist.n_type) != 0);
+ //uint8_t n_pext = N_PEXT & nlist.n_type;
+ uint8_t n_type = N_TYPE & nlist.n_type;
+ sym[sym_idx].SetExternal((N_EXT & nlist.n_type) != 0);
switch (n_type)
{
- case NListTypeIndirect: // N_INDR - Fall through
- case NListTypePreboundUndefined:// N_PBUD - Fall through
- case NListTypeUndefined: // N_UNDF
+ case N_INDR:// Fall through
+ case N_PBUD:// Fall through
+ case N_UNDF:
type = eSymbolTypeUndefined;
break;
- case NListTypeAbsolute: // N_ABS
+ case N_ABS:
type = eSymbolTypeAbsolute;
break;
- case NListTypeSection: // N_SECT
+ case N_SECT:
{
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
@@ -3202,27 +3197,27 @@ ObjectFileMachO::ParseSymtab ()
}
else
{
- uint32_t section_type = symbol_section->Get() & SectionFlagMaskSectionType;
+ uint32_t section_type = symbol_section->Get() & SECTION_TYPE;
switch (section_type)
{
- case SectionTypeRegular: break; // regular section
- //case SectionTypeZeroFill: type = eSymbolTypeData; break; // zero fill on demand section
- case SectionTypeCStringLiterals: type = eSymbolTypeData; break; // section with only literal C strings
- case SectionType4ByteLiterals: type = eSymbolTypeData; break; // section with only 4 byte literals
- case SectionType8ByteLiterals: type = eSymbolTypeData; break; // section with only 8 byte literals
- case SectionTypeLiteralPointers: type = eSymbolTypeTrampoline; break; // section with only pointers to literals
- case SectionTypeNonLazySymbolPointers: type = eSymbolTypeTrampoline; break; // section with only non-lazy symbol pointers
- case SectionTypeLazySymbolPointers: type = eSymbolTypeTrampoline; break; // section with only lazy symbol pointers
- case SectionTypeSymbolStubs: type = eSymbolTypeTrampoline; break; // section with only symbol stubs, byte size of stub in the reserved2 field
- case SectionTypeModuleInitFunctionPointers: type = eSymbolTypeCode; break; // section with only function pointers for initialization
- case SectionTypeModuleTermFunctionPointers: type = eSymbolTypeCode; break; // section with only function pointers for termination
- //case SectionTypeCoalesced: type = eSymbolType; break; // section contains symbols that are to be coalesced
- //case SectionTypeZeroFillLarge: type = eSymbolTypeData; break; // zero fill on demand section (that can be larger than 4 gigabytes)
- case SectionTypeInterposing: type = eSymbolTypeTrampoline; break; // section with only pairs of function pointers for interposing
- case SectionType16ByteLiterals: type = eSymbolTypeData; break; // section with only 16 byte literals
- case SectionTypeDTraceObjectFormat: type = eSymbolTypeInstrumentation; break;
- case SectionTypeLazyDylibSymbolPointers: type = eSymbolTypeTrampoline; break;
+ case S_REGULAR: break; // regular section
+ //case S_ZEROFILL: type = eSymbolTypeData; break; // zero fill on demand section
+ case S_CSTRING_LITERALS: type = eSymbolTypeData; break; // section with only literal C strings
+ case S_4BYTE_LITERALS: type = eSymbolTypeData; break; // section with only 4 byte literals
+ case S_8BYTE_LITERALS: type = eSymbolTypeData; break; // section with only 8 byte literals
+ case S_LITERAL_POINTERS: type = eSymbolTypeTrampoline; break; // section with only pointers to literals
+ case S_NON_LAZY_SYMBOL_POINTERS: type = eSymbolTypeTrampoline; break; // section with only non-lazy symbol pointers
+ case S_LAZY_SYMBOL_POINTERS: type = eSymbolTypeTrampoline; break; // section with only lazy symbol pointers
+ case S_SYMBOL_STUBS: type = eSymbolTypeTrampoline; break; // section with only symbol stubs, byte size of stub in the reserved2 field
+ case S_MOD_INIT_FUNC_POINTERS: type = eSymbolTypeCode; break; // section with only function pointers for initialization
+ case S_MOD_TERM_FUNC_POINTERS: type = eSymbolTypeCode; break; // section with only function pointers for termination
+ //case S_COALESCED: type = eSymbolType; break; // section contains symbols that are to be coalesced
+ //case S_GB_ZEROFILL: type = eSymbolTypeData; break; // zero fill on demand section (that can be larger than 4 gigabytes)
+ case S_INTERPOSING: type = eSymbolTypeTrampoline; break; // section with only pairs of function pointers for interposing
+ case S_16BYTE_LITERALS: type = eSymbolTypeData; break; // section with only 16 byte literals
+ case S_DTRACE_DOF: type = eSymbolTypeInstrumentation; break;
+ case S_LAZY_DYLIB_SYMBOL_POINTERS: type = eSymbolTypeTrampoline; break;
default: break;
}
@@ -3231,9 +3226,9 @@ ObjectFileMachO::ParseSymtab ()
const char *symbol_sect_name = symbol_section->GetName().AsCString();
if (symbol_section->IsDescendant (text_section_sp.get()))
{
- if (symbol_section->IsClear(SectionAttrUserPureInstructions |
- SectionAttrUserSelfModifyingCode |
- SectionAttrSytemSomeInstructions))
+ if (symbol_section->IsClear(S_ATTR_PURE_INSTRUCTIONS |
+ S_ATTR_SELF_MODIFYING_CODE |
+ S_ATTR_SOME_INSTRUCTIONS))
type = eSymbolTypeData;
else
type = eSymbolTypeCode;
@@ -3602,7 +3597,7 @@ ObjectFileMachO::ParseSymtab ()
for (uint32_t sect_idx = 1; sect_idx < m_mach_sections.size(); ++sect_idx)
{
- if ((m_mach_sections[sect_idx].flags & SectionFlagMaskSectionType) == SectionTypeSymbolStubs)
+ if ((m_mach_sections[sect_idx].flags & SECTION_TYPE) == S_SYMBOL_STUBS)
{
uint32_t symbol_stub_byte_size = m_mach_sections[sect_idx].reserved2;
if (symbol_stub_byte_size == 0)
@@ -3622,7 +3617,7 @@ ObjectFileMachO::ParseSymtab ()
if (indirect_symbol_index_data.ValidOffsetForDataOfSize(symbol_stub_offset, 4))
{
const uint32_t stub_sym_id = indirect_symbol_index_data.GetU32 (&symbol_stub_offset);
- if (stub_sym_id & (IndirectSymbolAbsolute | IndirectSymbolLocal))
+ if (stub_sym_id & (INDIRECT_SYMBOL_ABS | INDIRECT_SYMBOL_LOCAL))
continue;
NListIndexToSymbolIndexMap::const_iterator index_pos = m_nlist_idx_to_sym_idx.find (stub_sym_id);
@@ -3710,7 +3705,7 @@ ObjectFileMachO::Dump (Stream *s)
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
s->Printf("%p: ", this);
s->Indent();
- if (m_header.magic == HeaderMagic64 || m_header.magic == HeaderMagic64Swapped)
+ if (m_header.magic == MH_MAGIC_64 || m_header.magic == MH_CIGAM_64)
s->PutCString("ObjectFileMachO64");
else
s->PutCString("ObjectFileMachO32");
@@ -3744,7 +3739,7 @@ ObjectFileMachO::GetUUID (const llvm::Ma
if (data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
- if (load_cmd.cmd == LoadCommandUUID)
+ if (load_cmd.cmd == LC_UUID)
{
const uint8_t *uuid_bytes = data.PeekData(offset, 16);
@@ -3806,12 +3801,12 @@ ObjectFileMachO::GetDependentModules (Fi
switch (load_cmd.cmd)
{
- case LoadCommandDylibLoad:
- case LoadCommandDylibLoadWeak:
- case LoadCommandDylibReexport:
- case LoadCommandDynamicLinkerLoad:
- case LoadCommandFixedVMShlibLoad:
- case LoadCommandDylibLoadUpward:
+ case LC_LOAD_DYLIB:
+ case LC_LOAD_WEAK_DYLIB:
+ case LC_REEXPORT_DYLIB:
+ case LC_LOAD_DYLINKER:
+ case LC_LOADFVMLIB:
+ case LC_LOAD_UPWARD_DYLIB:
{
uint32_t name_offset = cmd_offset + m_data.GetU32(&offset);
const char *path = m_data.PeekCStr(name_offset);
@@ -3881,8 +3876,8 @@ ObjectFileMachO::GetEntryPointAddress ()
switch (load_cmd.cmd)
{
- case LoadCommandUnixThread:
- case LoadCommandThread:
+ case LC_UNIXTHREAD:
+ case LC_THREAD:
{
while (offset < cmd_offset + load_cmd.cmdsize)
{
@@ -3896,7 +3891,7 @@ ObjectFileMachO::GetEntryPointAddress ()
switch (m_header.cputype)
{
- case llvm::MachO::CPUTypeARM:
+ case llvm::MachO::CPU_TYPE_ARM:
if (flavor == 1) // ARM_THREAD_STATE from mach/arm/thread_status.h
{
offset += 60; // This is the offset of pc in the GPR thread state data structure.
@@ -3904,7 +3899,7 @@ ObjectFileMachO::GetEntryPointAddress ()
done = true;
}
break;
- case llvm::MachO::CPUTypeI386:
+ case llvm::MachO::CPU_TYPE_I386:
if (flavor == 1) // x86_THREAD_STATE32 from mach/i386/thread_status.h
{
offset += 40; // This is the offset of eip in the GPR thread state data structure.
@@ -3912,7 +3907,7 @@ ObjectFileMachO::GetEntryPointAddress ()
done = true;
}
break;
- case llvm::MachO::CPUTypeX86_64:
+ case llvm::MachO::CPU_TYPE_X86_64:
if (flavor == 4) // x86_THREAD_STATE64 from mach/i386/thread_status.h
{
offset += 16 * 8; // This is the offset of rip in the GPR thread state data structure.
@@ -3930,7 +3925,7 @@ ObjectFileMachO::GetEntryPointAddress ()
}
}
break;
- case LoadCommandMain:
+ case LC_MAIN:
{
ConstString text_segment_name ("__TEXT");
uint64_t entryoffset = m_data.GetU64(&offset);
@@ -4021,7 +4016,7 @@ ObjectFileMachO::GetNumThreadContexts ()
if (m_data.GetU32(&offset, &thread_cmd, 2) == NULL)
break;
- if (thread_cmd.cmd == LoadCommandThread)
+ if (thread_cmd.cmd == LC_THREAD)
{
file_range.SetRangeBase (offset);
file_range.SetByteSize (thread_cmd.cmdsize - 8);
@@ -4056,15 +4051,15 @@ ObjectFileMachO::GetThreadContextAtIndex
switch (m_header.cputype)
{
- case llvm::MachO::CPUTypeARM:
+ case llvm::MachO::CPU_TYPE_ARM:
reg_ctx_sp.reset (new RegisterContextDarwin_arm_Mach (thread, data));
break;
- case llvm::MachO::CPUTypeI386:
+ case llvm::MachO::CPU_TYPE_I386:
reg_ctx_sp.reset (new RegisterContextDarwin_i386_Mach (thread, data));
break;
- case llvm::MachO::CPUTypeX86_64:
+ case llvm::MachO::CPU_TYPE_X86_64:
reg_ctx_sp.reset (new RegisterContextDarwin_x86_64_Mach (thread, data));
break;
}
@@ -4079,7 +4074,7 @@ ObjectFileMachO::CalculateType()
{
switch (m_header.filetype)
{
- case HeaderFileTypeObject: // 0x1u MH_OBJECT
+ case MH_OBJECT: // 0x1u
if (GetAddressByteSize () == 4)
{
// 32 bit kexts are just object files, but they do have a valid
@@ -4097,16 +4092,16 @@ ObjectFileMachO::CalculateType()
}
return eTypeObjectFile;
- case HeaderFileTypeExecutable: return eTypeExecutable; // 0x2u MH_EXECUTE
- case HeaderFileTypeFixedVMShlib: return eTypeSharedLibrary; // 0x3u MH_FVMLIB
- case HeaderFileTypeCore: return eTypeCoreFile; // 0x4u MH_CORE
- case HeaderFileTypePreloadedExecutable: return eTypeSharedLibrary; // 0x5u MH_PRELOAD
- case HeaderFileTypeDynamicShlib: return eTypeSharedLibrary; // 0x6u MH_DYLIB
- case HeaderFileTypeDynamicLinkEditor: return eTypeDynamicLinker; // 0x7u MH_DYLINKER
- case HeaderFileTypeBundle: return eTypeSharedLibrary; // 0x8u MH_BUNDLE
- case HeaderFileTypeDynamicShlibStub: return eTypeStubLibrary; // 0x9u MH_DYLIB_STUB
- case HeaderFileTypeDSYM: return eTypeDebugInfo; // 0xAu MH_DSYM
- case HeaderFileTypeKextBundle: return eTypeSharedLibrary; // 0xBu MH_KEXT_BUNDLE
+ case MH_EXECUTE: return eTypeExecutable; // 0x2u
+ case MH_FVMLIB: return eTypeSharedLibrary; // 0x3u
+ case MH_CORE: return eTypeCoreFile; // 0x4u
+ case MH_PRELOAD: return eTypeSharedLibrary; // 0x5u
+ case MH_DYLIB: return eTypeSharedLibrary; // 0x6u
+ case MH_DYLINKER: return eTypeDynamicLinker; // 0x7u
+ case MH_BUNDLE: return eTypeSharedLibrary; // 0x8u
+ case MH_DYLIB_STUB: return eTypeStubLibrary; // 0x9u
+ case MH_DSYM: return eTypeDebugInfo; // 0xAu
+ case MH_KEXT_BUNDLE: return eTypeSharedLibrary; // 0xBu
default:
break;
}
@@ -4118,7 +4113,7 @@ ObjectFileMachO::CalculateStrata()
{
switch (m_header.filetype)
{
- case HeaderFileTypeObject: // 0x1u MH_OBJECT
+ case MH_OBJECT: // 0x1u
{
// 32 bit kexts are just object files, but they do have a valid
// UUID load command.
@@ -4136,9 +4131,9 @@ ObjectFileMachO::CalculateStrata()
}
return eStrataUnknown;
- case HeaderFileTypeExecutable: // 0x2u MH_EXECUTE
+ case MH_EXECUTE: // 0x2u
// Check for the MH_DYLDLINK bit in the flags
- if (m_header.flags & HeaderFlagBitIsDynamicLinkObject)
+ if (m_header.flags & MH_DYLDLINK)
{
return eStrataUser;
}
@@ -4154,15 +4149,15 @@ ObjectFileMachO::CalculateStrata()
}
return eStrataRawImage;
- case HeaderFileTypeFixedVMShlib: return eStrataUser; // 0x3u MH_FVMLIB
- case HeaderFileTypeCore: return eStrataUnknown; // 0x4u MH_CORE
- case HeaderFileTypePreloadedExecutable: return eStrataRawImage; // 0x5u MH_PRELOAD
- case HeaderFileTypeDynamicShlib: return eStrataUser; // 0x6u MH_DYLIB
- case HeaderFileTypeDynamicLinkEditor: return eStrataUser; // 0x7u MH_DYLINKER
- case HeaderFileTypeBundle: return eStrataUser; // 0x8u MH_BUNDLE
- case HeaderFileTypeDynamicShlibStub: return eStrataUser; // 0x9u MH_DYLIB_STUB
- case HeaderFileTypeDSYM: return eStrataUnknown; // 0xAu MH_DSYM
- case HeaderFileTypeKextBundle: return eStrataKernel; // 0xBu MH_KEXT_BUNDLE
+ case MH_FVMLIB: return eStrataUser; // 0x3u
+ case MH_CORE: return eStrataUnknown; // 0x4u
+ case MH_PRELOAD: return eStrataRawImage; // 0x5u
+ case MH_DYLIB: return eStrataUser; // 0x6u
+ case MH_DYLINKER: return eStrataUser; // 0x7u
+ case MH_BUNDLE: return eStrataUser; // 0x8u
+ case MH_DYLIB_STUB: return eStrataUser; // 0x9u
+ case MH_DSYM: return eStrataUnknown; // 0xAu
+ case MH_KEXT_BUNDLE: return eStrataKernel; // 0xBu
default:
break;
}
@@ -4188,7 +4183,7 @@ ObjectFileMachO::GetVersion (uint32_t *v
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
- if (load_cmd.cmd == LoadCommandDylibIdent)
+ if (load_cmd.cmd == LC_ID_DYLIB)
{
if (version_cmd == 0)
{
@@ -4203,7 +4198,7 @@ ObjectFileMachO::GetVersion (uint32_t *v
offset = cmd_offset + load_cmd.cmdsize;
}
- if (version_cmd == LoadCommandDylibIdent)
+ if (version_cmd == LC_ID_DYLIB)
{
if (versions != NULL && num_versions > 0)
{
@@ -4237,7 +4232,7 @@ ObjectFileMachO::GetArchitecture (ArchSp
// Files with type MH_PRELOAD are currently used in cases where the image
// debugs at the addresses in the file itself. Below we set the OS to
// unknown to make sure we use the DynamicLoaderStatic()...
- if (m_header.filetype == HeaderFileTypePreloadedExecutable)
+ if (m_header.filetype == MH_PRELOAD)
{
arch.GetTriple().setOS (llvm::Triple::UnknownOS);
}
@@ -4263,10 +4258,10 @@ ObjectFileMachO::GetProcessSharedCacheUU
Error err;
uint32_t version_or_magic = process->ReadUnsignedIntegerFromMemory (all_image_infos, 4, -1, err);
if (version_or_magic != -1
- && version_or_magic != HeaderMagic32
- && version_or_magic != HeaderMagic32Swapped
- && version_or_magic != HeaderMagic64
- && version_or_magic != HeaderMagic64Swapped
+ && version_or_magic != MH_MAGIC
+ && version_or_magic != MH_CIGAM
+ && version_or_magic != MH_MAGIC_64
+ && version_or_magic != MH_CIGAM_64
&& version_or_magic >= 13)
{
addr_t sharedCacheUUID_address = LLDB_INVALID_ADDRESS;
Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp Tue Aug 27 00:04:57 2013
@@ -33,6 +33,8 @@
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
+#define USEC_PER_SEC 1000000
+
// Project includes
#include "ProcessKDP.h"
#include "ProcessKDPLog.h"
Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp Tue Aug 27 00:04:57 2013
@@ -124,13 +124,13 @@ ThreadKDP::CreateRegisterContextForFrame
{
switch (static_cast<ProcessKDP *>(process_sp.get())->GetCommunication().GetCPUType())
{
- case llvm::MachO::CPUTypeARM:
+ case llvm::MachO::CPU_TYPE_ARM:
reg_ctx_sp.reset (new RegisterContextKDP_arm (*this, concrete_frame_idx));
break;
- case llvm::MachO::CPUTypeI386:
+ case llvm::MachO::CPU_TYPE_I386:
reg_ctx_sp.reset (new RegisterContextKDP_i386 (*this, concrete_frame_idx));
break;
- case llvm::MachO::CPUTypeX86_64:
+ case llvm::MachO::CPU_TYPE_X86_64:
reg_ctx_sp.reset (new RegisterContextKDP_x86_64 (*this, concrete_frame_idx));
break;
default:
Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Tue Aug 27 00:04:57 2013
@@ -146,8 +146,8 @@ ProcessMachCore::GetDynamicLoaderAddress
Error error;
if (DoReadMemory (addr, &header, sizeof(header), error) != sizeof(header))
return false;
- if (header.magic == llvm::MachO::HeaderMagic32Swapped ||
- header.magic == llvm::MachO::HeaderMagic64Swapped)
+ if (header.magic == llvm::MachO::MH_CIGAM ||
+ header.magic == llvm::MachO::MH_CIGAM_64)
{
header.magic = llvm::ByteSwap_32(header.magic);
header.cputype = llvm::ByteSwap_32(header.cputype);
@@ -160,8 +160,8 @@ ProcessMachCore::GetDynamicLoaderAddress
// TODO: swap header if needed...
//printf("0x%16.16" PRIx64 ": magic = 0x%8.8x, file_type= %u\n", vaddr, header.magic, header.filetype);
- if (header.magic == llvm::MachO::HeaderMagic32 ||
- header.magic == llvm::MachO::HeaderMagic64)
+ if (header.magic == llvm::MachO::MH_MAGIC ||
+ header.magic == llvm::MachO::MH_MAGIC_64)
{
// Check MH_EXECUTABLE to see if we can find the mach image
// that contains the shared library list. The dynamic loader
@@ -170,18 +170,18 @@ ProcessMachCore::GetDynamicLoaderAddress
// of kexts to load
switch (header.filetype)
{
- case llvm::MachO::HeaderFileTypeDynamicLinkEditor:
+ case llvm::MachO::MH_DYLINKER:
//printf("0x%16.16" PRIx64 ": file_type = MH_DYLINKER\n", vaddr);
// Address of dyld "struct mach_header" in the core file
m_dyld_plugin_name = DynamicLoaderMacOSXDYLD::GetPluginNameStatic();
m_dyld_addr = addr;
return true;
- case llvm::MachO::HeaderFileTypeExecutable:
+ case llvm::MachO::MH_EXECUTE:
//printf("0x%16.16" PRIx64 ": file_type = MH_EXECUTE\n", vaddr);
// Check MH_EXECUTABLE file types to see if the dynamic link object flag
// is NOT set. If it isn't, then we have a mach_kernel.
- if ((header.flags & llvm::MachO::HeaderFlagBitIsDynamicLinkObject) == 0)
+ if ((header.flags & llvm::MachO::MH_DYLDLINK) == 0)
{
m_dyld_plugin_name = DynamicLoaderDarwinKernel::GetPluginNameStatic();
// Address of the mach kernel "struct mach_header" in the core file.
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=189317&r1=189316&r2=189317&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Aug 27 00:04:57 2013
@@ -41,6 +41,10 @@
#include "lldb/Target/ThreadPlan.h"
#include "lldb/Target/ThreadPlanBase.h"
+#ifndef LLDB_DISABLE_POSIX
+#include <spawn.h>
+#endif
+
using namespace lldb;
using namespace lldb_private;
@@ -665,7 +669,7 @@ ProcessLaunchInfo::FileAction::Duplicate
#ifndef LLDB_DISABLE_POSIX
bool
-ProcessLaunchInfo::FileAction::AddPosixSpawnFileAction (posix_spawn_file_actions_t *file_actions,
+ProcessLaunchInfo::FileAction::AddPosixSpawnFileAction (void *_file_actions,
const FileAction *info,
Log *log,
Error& error)
@@ -673,6 +677,8 @@ ProcessLaunchInfo::FileAction::AddPosixS
if (info == NULL)
return false;
+ posix_spawn_file_actions_t *file_actions = reinterpret_cast<posix_spawn_file_actions_t *>(_file_actions);
+
switch (info->m_action)
{
case eFileActionNone:
More information about the lldb-commits
mailing list