From johnny.chen at apple.com Mon Jan 3 13:55:37 2011
From: johnny.chen at apple.com (Johnny Chen)
Date: Mon, 03 Jan 2011 19:55:37 -0000
Subject: [Lldb-commits] [lldb] r122767 -
/lldb/trunk/test/foundation/TestObjCMethods.py
Message-ID: <20110103195537.ACFE82A6C12C@llvm.org>
Author: johnny
Date: Mon Jan 3 13:55:37 2011
New Revision: 122767
URL: http://llvm.org/viewvc/llvm-project?rev=122767&view=rev
Log:
Updated comment.
Modified:
lldb/trunk/test/foundation/TestObjCMethods.py
Modified: lldb/trunk/test/foundation/TestObjCMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/foundation/TestObjCMethods.py?rev=122767&r1=122766&r2=122767&view=diff
==============================================================================
--- lldb/trunk/test/foundation/TestObjCMethods.py (original)
+++ lldb/trunk/test/foundation/TestObjCMethods.py Mon Jan 3 13:55:37 2011
@@ -191,7 +191,6 @@
self.line)
self.runCmd("process continue")
- # This currently fails.
# rdar://problem/8542091
# test/foundation: expr -o -- my not working?
#
From johnny.chen at apple.com Mon Jan 3 14:40:08 2011
From: johnny.chen at apple.com (Johnny Chen)
Date: Mon, 03 Jan 2011 20:40:08 -0000
Subject: [Lldb-commits] [lldb] r122770 -
/lldb/trunk/test/objc-stepping/TestObjCStepping.py
Message-ID: <20110103204008.2D2752A6C12C@llvm.org>
Author: johnny
Date: Mon Jan 3 14:40:08 2011
New Revision: 122770
URL: http://llvm.org/viewvc/llvm-project?rev=122770&view=rev
Log:
Fix typo of the test method name.
Modified:
lldb/trunk/test/objc-stepping/TestObjCStepping.py
Modified: lldb/trunk/test/objc-stepping/TestObjCStepping.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-stepping/TestObjCStepping.py?rev=122770&r1=122769&r2=122770&view=diff
==============================================================================
--- lldb/trunk/test/objc-stepping/TestObjCStepping.py (original)
+++ lldb/trunk/test/objc-stepping/TestObjCStepping.py Mon Jan 3 14:40:08 2011
@@ -17,7 +17,7 @@
self.objc_stepping()
@python_api_test
- def test_with_dward_and_python_api(self):
+ def test_with_dwarf_and_python_api(self):
"""Test stepping through ObjC method dispatch in various forms."""
self.buildDwarf()
self.objc_stepping()
From gclayton at apple.com Mon Jan 3 19:17:46 2011
From: gclayton at apple.com (Greg Clayton)
Date: Tue, 04 Jan 2011 01:17:46 -0000
Subject: [Lldb-commits] [lldb] r122797 -
/lldb/trunk/lldb.xcodeproj/project.pbxproj
Message-ID: <20110104011746.384C62A6C12C@llvm.org>
Author: gclayton
Date: Mon Jan 3 19:17:46 2011
New Revision: 122797
URL: http://llvm.org/viewvc/llvm-project?rev=122797&view=rev
Log:
Fixed the file ordering (alphabetic) in the Commands folder.
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=122797&r1=122796&r2=122797&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jan 3 19:17:46 2011
@@ -1843,8 +1843,6 @@
26BC7D0D10F1B71D00F91463 /* Commands */ = {
isa = PBXGroup;
children = (
- B296983512C2FB2B002D92C3 /* CommandObjectVersion.h */,
- B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */,
4CA9637A11B6E99A00780E28 /* CommandObjectApropos.h */,
4CA9637911B6E99A00780E28 /* CommandObjectApropos.cpp */,
499F381E11A5B3F300F5CE02 /* CommandObjectArgs.h */,
@@ -1889,6 +1887,8 @@
269416AD119A024800FF2715 /* CommandObjectTarget.cpp */,
26BC7D2D10F1B76300F91463 /* CommandObjectThread.h */,
26BC7E4610F1B84700F91463 /* CommandObjectThread.cpp */,
+ B296983512C2FB2B002D92C3 /* CommandObjectVersion.h */,
+ B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */,
);
name = Commands;
sourceTree = "";
@@ -2363,6 +2363,7 @@
isa = PBXProject;
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
From scallanan at apple.com Mon Jan 3 20:41:41 2011
From: scallanan at apple.com (Sean Callanan)
Date: Tue, 04 Jan 2011 02:41:41 -0000
Subject: [Lldb-commits] [lldb] r122800 -
/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Message-ID: <20110104024141.331E62A6C12C@llvm.org>
Author: spyffe
Date: Mon Jan 3 20:41:41 2011
New Revision: 122800
URL: http://llvm.org/viewvc/llvm-project?rev=122800&view=rev
Log:
Fixed a problem where constant results of expressions
were not being created in the proper way, meaning
results were getting lost.
Modified:
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=122800&r1=122799&r2=122800&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Mon Jan 3 20:41:41 2011
@@ -129,7 +129,6 @@
{
assert (m_parser_vars.get());
-
clang::ASTContext *context(m_parser_vars->m_exe_ctx->target->GetScratchClangASTContext()->getASTContext());
TypeFromUser user_type(ClangASTContext::CopyType(context,
@@ -137,25 +136,32 @@
type.GetOpaqueQualType()),
context);
- DataBufferHeap *heap_data_buf = new DataBufferHeap(ClangASTType::GetClangTypeBitWidth(user_type.GetASTContext(),
- user_type.GetOpaqueQualType()) / 8,
- '\0');
+ if (!m_parser_vars->m_persistent_vars->CreatePersistentVariable (name,
+ user_type,
+ m_parser_vars->m_exe_ctx->process->GetByteOrder(),
+ m_parser_vars->m_exe_ctx->process->GetAddressByteSize()))
+ return lldb::ClangExpressionVariableSP();
+
+ ClangExpressionVariableSP pvar_sp (m_parser_vars->m_persistent_vars->GetVariable(name));
- DataBufferSP data_sp(heap_data_buf);
+ if (!pvar_sp)
+ return lldb::ClangExpressionVariableSP();
+
+ uint8_t *pvar_data = pvar_sp->GetValueBytes();
+ if (pvar_data == NULL)
+ return lldb::ClangExpressionVariableSP();
uint64_t value64 = value.getLimitedValue();
ByteOrder byte_order = m_parser_vars->m_exe_ctx->process->GetByteOrder();
size_t num_val_bytes = sizeof(value64);
- size_t num_data_bytes = heap_data_buf->GetByteSize();
+ size_t num_data_bytes = pvar_sp->GetByteSize();
size_t num_bytes = num_val_bytes;
if (num_bytes > num_data_bytes)
num_bytes = num_data_bytes;
- uint8_t *data_bytes = heap_data_buf->GetBytes();
-
for (off_t byte_idx = 0;
byte_idx < num_bytes;
++byte_idx)
@@ -166,32 +172,23 @@
switch (byte_order)
{
- case eByteOrderBig:
- // High Low
- // Original: |AABBCCDDEEFFGGHH|
- // Target: |EEFFGGHH|
-
- data_bytes[num_data_bytes - (1 + byte_idx)] = cur_byte;
- break;
- case eByteOrderLittle:
- // Target: |HHGGFFEE|
- data_bytes[byte_idx] = cur_byte;
- break;
- default:
- return lldb::ClangExpressionVariableSP();
+ case eByteOrderBig:
+ // High Low
+ // Original: |AABBCCDDEEFFGGHH|
+ // Target: |EEFFGGHH|
+
+ pvar_data[num_data_bytes - (1 + byte_idx)] = cur_byte;
+ break;
+ case eByteOrderLittle:
+ // Target: |HHGGFFEE|
+ pvar_data[byte_idx] = cur_byte;
+ break;
+ default:
+ return lldb::ClangExpressionVariableSP();
}
}
-
- ValueObjectSP valobj_sp(new ValueObjectConstResult(user_type.GetASTContext(),
- user_type.GetOpaqueQualType(),
- name,
- data_sp,
- m_parser_vars->m_exe_ctx->process->GetByteOrder(),
- m_parser_vars->m_exe_ctx->process->GetAddressByteSize()));
-
- ClangExpressionVariableSP var_sp(new ClangExpressionVariable(valobj_sp));
-
- return var_sp;
+
+ return pvar_sp;
}
bool
From wilsons at start.ca Tue Jan 4 14:54:08 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:08 -0500
Subject: [Lldb-commits] [PATCH 0/9] linux: process plugin updates
Message-ID: <1294174457-8635-1-git-send-email-wilsons@start.ca>
This patch series updates the ProcessLinux plugin so that it builds again under
linux.
The ProcessLinux plugin has always been incomplete. This patch series does not
add any new functionality.
A vital component which the Linux platform has always lacked is a DynamicLoader
plugin. Previously we worked around this limitation by simply marking the
sections of the executable we were debugging as loaded. This allowed LLDB to
work with static executables. However, this was simply a hack and does not work
with the current code base. This functionality is therefore removed in patch 4
of this series.
The net result is that there is essentially zero functionality under Linux at
this time.
From wilsons at start.ca Tue Jan 4 14:54:09 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:09 -0500
Subject: [Lldb-commits] [PATCH 1/9] Replace old "CurrentThread" calls with
equivalent "SelectedThread" calls.
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-2-git-send-email-wilsons@start.ca>
---
source/Plugins/Process/Linux/ProcessMonitor.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/source/Plugins/Process/Linux/ProcessMonitor.cpp b/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 22b65e1..0b47fc7 100644
--- a/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -651,7 +651,7 @@ ProcessMonitor::Launch(LaunchArgs *args)
// current.
inferior.reset(new LinuxThread(process, pid));
process.GetThreadList().AddThread(inferior);
- process.GetThreadList().SetCurrentThreadByID(pid);
+ process.GetThreadList().SetSelectedThreadByID(pid);
// Let our process instance know the thread has stopped.
process.SendMessage(ProcessMessage::Trace(pid));
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:54:10 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:10 -0500
Subject: [Lldb-commits] [PATCH 2/9] Host::StopMonitoringChildProcess has
been removed. Provide a substitute.
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-3-git-send-email-wilsons@start.ca>
---
source/Plugins/Process/Linux/ProcessMonitor.cpp | 19 ++++++++++++++++---
source/Plugins/Process/Linux/ProcessMonitor.h | 5 ++++-
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/source/Plugins/Process/Linux/ProcessMonitor.cpp b/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 0b47fc7..e6a7d6f 100644
--- a/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -459,7 +459,7 @@ ProcessMonitor::ProcessMonitor(ProcessLinux *process,
m_operation_thread(LLDB_INVALID_HOST_THREAD),
m_pid(LLDB_INVALID_PROCESS_ID),
m_terminal_fd(-1),
- m_monitor_handle(0),
+ m_monitor_thread(LLDB_INVALID_HOST_THREAD),
m_client_fd(-1),
m_server_fd(-1)
{
@@ -499,7 +499,7 @@ WAIT_AGAIN:
}
// Finally, start monitoring the child process for change in state.
- if (!(m_monitor_handle = Host::StartMonitoringChildProcess(
+ if (!(m_monitor_thread = Host::StartMonitoringChildProcess(
ProcessMonitor::MonitorCallback, this, GetPID(), true)))
{
error.SetErrorToGenericError();
@@ -510,7 +510,7 @@ WAIT_AGAIN:
ProcessMonitor::~ProcessMonitor()
{
- Host::StopMonitoringChildProcess(m_monitor_handle);
+ StopMonitoringChildProcess();
StopOperationThread();
close(m_terminal_fd);
@@ -923,3 +923,16 @@ ProcessMonitor::DupDescriptor(const char *path, int fd, int flags)
return (dup2(fd, target_fd) == -1) ? false : true;
}
+
+void
+ProcessMonitor::StopMonitoringChildProcess()
+{
+ lldb::thread_result_t thread_result;
+
+ if (m_monitor_thread != LLDB_INVALID_HOST_THREAD)
+ {
+ Host::ThreadCancel(m_monitor_thread, NULL);
+ Host::ThreadJoin(m_monitor_thread, &thread_result, NULL);
+ m_monitor_thread = LLDB_INVALID_HOST_THREAD;
+ }
+}
diff --git a/source/Plugins/Process/Linux/ProcessMonitor.h b/source/Plugins/Process/Linux/ProcessMonitor.h
index cd23d98..a4719c0 100644
--- a/source/Plugins/Process/Linux/ProcessMonitor.h
+++ b/source/Plugins/Process/Linux/ProcessMonitor.h
@@ -140,7 +140,7 @@ private:
lldb::pid_t m_pid;
int m_terminal_fd;
- uint32_t m_monitor_handle;
+ uint32_t m_monitor_thread;
lldb_private::Mutex m_server_mutex;
int m_client_fd;
@@ -203,6 +203,9 @@ private:
void
DoOperation(Operation *op);
+
+ /// Stops the child monitor thread.
+ void StopMonitoringChildProcess();
};
#endif // #ifndef liblldb_ProcessMonitor_H_
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:54:11 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:11 -0500
Subject: [Lldb-commits] [PATCH 3/9] Update ProcessLinux method signatures to
be in line with LLDB's current API.
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-4-git-send-email-wilsons@start.ca>
---
source/Plugins/Process/Linux/ProcessLinux.cpp | 3 ++-
source/Plugins/Process/Linux/ProcessLinux.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/source/Plugins/Process/Linux/ProcessLinux.cpp b/source/Plugins/Process/Linux/ProcessLinux.cpp
index ce12ee9..6d7b5cf 100644
--- a/source/Plugins/Process/Linux/ProcessLinux.cpp
+++ b/source/Plugins/Process/Linux/ProcessLinux.cpp
@@ -105,6 +105,7 @@ Error
ProcessLinux::DoLaunch(Module *module,
char const *argv[],
char const *envp[],
+ uint32_t launch_flags,
const char *stdin_path,
const char *stdout_path,
const char *stderr_path)
@@ -155,7 +156,7 @@ ProcessLinux::DoResume()
}
Error
-ProcessLinux::DoHalt()
+ProcessLinux::DoHalt(bool &caused_stop)
{
return Error(1, eErrorTypeGeneric);
}
diff --git a/source/Plugins/Process/Linux/ProcessLinux.h b/source/Plugins/Process/Linux/ProcessLinux.h
index 522cc4b..536dd9b 100644
--- a/source/Plugins/Process/Linux/ProcessLinux.h
+++ b/source/Plugins/Process/Linux/ProcessLinux.h
@@ -66,6 +66,7 @@ public:
DoLaunch(lldb_private::Module *module,
char const *argv[],
char const *envp[],
+ uint32_t launch_flags,
const char *stdin_path,
const char *stdout_path,
const char *stderr_path);
@@ -77,7 +78,7 @@ public:
DoResume();
virtual lldb_private::Error
- DoHalt();
+ DoHalt(bool &caused_stop);
virtual lldb_private::Error
DoDetach();
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:54:12 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:12 -0500
Subject: [Lldb-commits] [PATCH 4/9] Do not load sections manually when
launching a Linux process.
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-5-git-send-email-wilsons@start.ca>
This code was a temporary workaround due to the lack of a dynamic loader plugin
for the Linux platform that has bit rotted over time. Instead of replacing this
hack with another a proper plugin will be developed instead.
---
source/Plugins/Process/Linux/ProcessLinux.cpp | 27 -------------------------
source/Plugins/Process/Linux/ProcessLinux.h | 3 --
2 files changed, 0 insertions(+), 30 deletions(-)
diff --git a/source/Plugins/Process/Linux/ProcessLinux.cpp b/source/Plugins/Process/Linux/ProcessLinux.cpp
index 6d7b5cf..acaff50 100644
--- a/source/Plugins/Process/Linux/ProcessLinux.cpp
+++ b/source/Plugins/Process/Linux/ProcessLinux.cpp
@@ -127,12 +127,6 @@ ProcessLinux::DoLaunch(Module *module,
return error;
}
-void
-ProcessLinux::DidLaunch()
-{
- UpdateLoadedSections();
-}
-
Error
ProcessLinux::DoResume()
{
@@ -404,27 +398,6 @@ ProcessLinux::EnablePluginLogging(Stream *strm, Args &command)
//------------------------------------------------------------------------------
// Utility functions.
-void
-ProcessLinux::UpdateLoadedSections()
-{
- ObjectFile *obj_file = m_module->GetObjectFile();
- SectionList *sections = obj_file->GetSectionList();
-
- // FIXME: SectionList provides iterator types, but no begin/end methods.
- size_t num_sections = sections->GetSize();
- for (unsigned i = 0; i < num_sections; ++i)
- {
- Section *section = sections->GetSectionAtIndex(i).get();
-
- lldb::addr_t new_load_addr = section->GetFileAddress();
- lldb::addr_t old_load_addr = GetSectionLoadAddress(section);
-
- if (old_load_addr == LLDB_INVALID_ADDRESS ||
- old_load_addr != new_load_addr)
- SectionLoaded(section, new_load_addr);
- }
-}
-
bool
ProcessLinux::HasExited()
{
diff --git a/source/Plugins/Process/Linux/ProcessLinux.h b/source/Plugins/Process/Linux/ProcessLinux.h
index 536dd9b..16c2bec 100644
--- a/source/Plugins/Process/Linux/ProcessLinux.h
+++ b/source/Plugins/Process/Linux/ProcessLinux.h
@@ -71,9 +71,6 @@ public:
const char *stdout_path,
const char *stderr_path);
- virtual void
- DidLaunch();
-
virtual lldb_private::Error
DoResume();
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:54:13 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:13 -0500
Subject: [Lldb-commits] [PATCH 5/9] Use default implementation of
Thread::GetStackFrameCount and Thread::GetStackFrameAtIndex.
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-6-git-send-email-wilsons@start.ca>
---
source/Plugins/Process/Linux/LinuxThread.cpp | 21 +--------------------
source/Plugins/Process/Linux/LinuxThread.h | 6 ------
2 files changed, 1 insertions(+), 26 deletions(-)
diff --git a/source/Plugins/Process/Linux/LinuxThread.cpp b/source/Plugins/Process/Linux/LinuxThread.cpp
index 6d4733a..4994d64 100644
--- a/source/Plugins/Process/Linux/LinuxThread.cpp
+++ b/source/Plugins/Process/Linux/LinuxThread.cpp
@@ -13,6 +13,7 @@
// C++ Includes
// Other libraries and framework includes
#include "lldb/Target/Process.h"
+#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "LinuxThread.h"
@@ -60,26 +61,6 @@ LinuxThread::GetInfo()
return NULL;
}
-uint32_t
-LinuxThread::GetStackFrameCount()
-{
- return 0;
-}
-
-lldb::StackFrameSP
-LinuxThread::GetStackFrameAtIndex(uint32_t idx)
-{
- if (idx == 0)
- {
- RegisterContextLinux *regs = GetRegisterContext();
- StackFrame *frame = new StackFrame(
- idx, *this, regs->GetFP(), regs->GetPC());
- return lldb::StackFrameSP(frame);
- }
- else
- return lldb::StackFrameSP();
-}
-
RegisterContextLinux *
LinuxThread::GetRegisterContext()
{
diff --git a/source/Plugins/Process/Linux/LinuxThread.h b/source/Plugins/Process/Linux/LinuxThread.h
index 79ccd0a..5ec0d43 100644
--- a/source/Plugins/Process/Linux/LinuxThread.h
+++ b/source/Plugins/Process/Linux/LinuxThread.h
@@ -38,12 +38,6 @@ public:
const char *
GetInfo();
- uint32_t
- GetStackFrameCount();
-
- lldb::StackFrameSP
- GetStackFrameAtIndex(uint32_t idx);
-
RegisterContextLinux *
GetRegisterContext();
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:54:14 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:14 -0500
Subject: [Lldb-commits] [PATCH 6/9] StopInfo now lives in the lldb_private
namespace. Qualify.
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-7-git-send-email-wilsons@start.ca>
---
source/Plugins/Process/Linux/LinuxThread.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/source/Plugins/Process/Linux/LinuxThread.h b/source/Plugins/Process/Linux/LinuxThread.h
index 5ec0d43..8ef3125 100644
--- a/source/Plugins/Process/Linux/LinuxThread.h
+++ b/source/Plugins/Process/Linux/LinuxThread.h
@@ -51,7 +51,7 @@ public:
CreateRegisterContextForFrame(lldb_private::StackFrame *frame);
bool
- GetRawStopReason(StopInfo *stop_info);
+ GetRawStopReason(lldb_private::StopInfo *stop_info);
//--------------------------------------------------------------------------
// These methods form a specialized interface to linux threads.
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:54:15 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:15 -0500
Subject: [Lldb-commits] [PATCH 7/9] Remove LinuxThread::GetRawStopReason and
implement Thread::GetPrivateStopReason.
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-8-git-send-email-wilsons@start.ca>
---
source/Plugins/Process/Linux/LinuxThread.cpp | 15 ++++++++-------
source/Plugins/Process/Linux/LinuxThread.h | 6 +++---
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/source/Plugins/Process/Linux/LinuxThread.cpp b/source/Plugins/Process/Linux/LinuxThread.cpp
index 4994d64..b5d3b64 100644
--- a/source/Plugins/Process/Linux/LinuxThread.cpp
+++ b/source/Plugins/Process/Linux/LinuxThread.cpp
@@ -85,26 +85,27 @@ LinuxThread::CreateRegisterContextForFrame(lldb_private::StackFrame *frame)
return new RegisterContextLinux_x86_64(*this, frame);
}
-bool
-LinuxThread::GetRawStopReason(StopInfo *stop_info)
+lldb::StopInfoSP
+LinuxThread::GetPrivateStopReason()
{
- stop_info->Clear();
+ lldb::StopInfoSP stop_info;
switch (m_note)
{
default:
- stop_info->SetStopReasonToNone();
break;
case eBreak:
- stop_info->SetStopReasonWithBreakpointSiteID(m_breakpoint->GetID());
+ stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(
+ *this, m_breakpoint->GetID());
break;
case eTrace:
- stop_info->SetStopReasonToTrace();
+ stop_info = StopInfo::CreateStopReasonToTrace(*this);
+ break;
}
- return true;
+ return stop_info;
}
bool
diff --git a/source/Plugins/Process/Linux/LinuxThread.h b/source/Plugins/Process/Linux/LinuxThread.h
index 8ef3125..afa1548 100644
--- a/source/Plugins/Process/Linux/LinuxThread.h
+++ b/source/Plugins/Process/Linux/LinuxThread.h
@@ -50,9 +50,6 @@ public:
RegisterContextLinux *
CreateRegisterContextForFrame(lldb_private::StackFrame *frame);
- bool
- GetRawStopReason(lldb_private::StopInfo *stop_info);
-
//--------------------------------------------------------------------------
// These methods form a specialized interface to linux threads.
//
@@ -78,6 +75,9 @@ private:
Notification m_note;
ProcessMonitor &GetMonitor();
+
+ lldb::StopInfoSP
+ GetPrivateStopReason();
};
#endif // #ifndef liblldb_LinuxThread_H_
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:54:16 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:16 -0500
Subject: [Lldb-commits] [PATCH 8/9] Provide LinuxThread with an
implementation of Thread::GetUnwinder.
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-9-git-send-email-wilsons@start.ca>
---
source/Plugins/Process/Linux/LinuxThread.cpp | 6 ++++++
source/Plugins/Process/Linux/LinuxThread.h | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/source/Plugins/Process/Linux/LinuxThread.cpp b/source/Plugins/Process/Linux/LinuxThread.cpp
index b5d3b64..c4c8bf5 100644
--- a/source/Plugins/Process/Linux/LinuxThread.cpp
+++ b/source/Plugins/Process/Linux/LinuxThread.cpp
@@ -108,6 +108,12 @@ LinuxThread::GetPrivateStopReason()
return stop_info;
}
+Unwind *
+LinuxThread::GetUnwinder()
+{
+ return m_unwinder_ap.get();
+}
+
bool
LinuxThread::WillResume(lldb::StateType resume_state)
{
diff --git a/source/Plugins/Process/Linux/LinuxThread.h b/source/Plugins/Process/Linux/LinuxThread.h
index afa1548..0e7f89d 100644
--- a/source/Plugins/Process/Linux/LinuxThread.h
+++ b/source/Plugins/Process/Linux/LinuxThread.h
@@ -78,6 +78,9 @@ private:
lldb::StopInfoSP
GetPrivateStopReason();
+
+ lldb_private::Unwind *
+ GetUnwinder();
};
#endif // #ifndef liblldb_LinuxThread_H_
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:54:17 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:54:17 -0500
Subject: [Lldb-commits] [PATCH 9/9] Fix typo (presumably carried over from
the MacOSX plugin).
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174457-8635-10-git-send-email-wilsons@start.ca>
---
.../Process/Linux/RegisterContextLinux_x86_64.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp b/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
index 8994e77..4c78a25 100644
--- a/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
+++ b/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
@@ -644,7 +644,7 @@ RegisterContextLinux_x86_64::ConvertRegisterKindToRegisterNumber(uint32_t kind,
}
else if (kind == eRegisterKindLLDB)
{
- return reg;
+ return num;
}
return LLDB_INVALID_REGNUM;
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:55:32 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:55:32 -0500
Subject: [Lldb-commits] [PATCH 0/2] linux: makefile system updates
Message-ID: <1294174534-8666-1-git-send-email-wilsons@start.ca>
This series updates the Makefile based build system.
In particular, it adds the Process/Utility component to the Linux build, adds
some missing/renamed Clang/LLVM components, and quites warnings generated by GCC
when encountering unknown pragmas (in particular the #pragma mark construct).
From wilsons at start.ca Tue Jan 4 14:55:33 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:55:33 -0500
Subject: [Lldb-commits] [PATCH 1/2] Ignore unknown pragmas.
In-Reply-To: <1294174534-8666-1-git-send-email-wilsons@start.ca>
References: <1294174534-8666-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174534-8666-2-git-send-email-wilsons@start.ca>
In particular, we are looking to ignore the "#pragma mark" construct which GCC
warns about on platforms other than Darwin. This cleans up diagnostic output
significantly.
---
Makefile | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 70c4801..abe694b 100644
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,10 @@ endif
# We can revisit this when LLVM/Clang support it.
CXX.Flags += -fno-strict-aliasing
+# Do not warn about pragmas. In particular, we are looking to ignore the
+# "#pragma mark" construct which GCC warns about on platforms other than Darwin.
+EXTRA_OPTIONS += -Wno-unknown-pragmas
+
###
# LLDB Top Level specific stuff.
--
1.7.3.2
From wilsons at start.ca Tue Jan 4 14:55:34 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 4 Jan 2011 15:55:34 -0500
Subject: [Lldb-commits] [PATCH 2/2] Makefile updates.
In-Reply-To: <1294174534-8666-1-git-send-email-wilsons@start.ca>
References: <1294174534-8666-1-git-send-email-wilsons@start.ca>
Message-ID: <1294174534-8666-3-git-send-email-wilsons@start.ca>
Update lib/Makefile to use current LLVM and Clang components and add the
PluginUtility library to the build.
---
lib/Makefile | 8 +++-----
source/Plugins/Makefile | 4 ++--
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/Makefile b/lib/Makefile
index 454e89b..881b23c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -33,11 +33,10 @@ USEDLIBS = lldbAPI.a \
lldbPluginObjectFileELF.a \
lldbPluginSymbolFileDWARF.a \
lldbPluginSymbolFileSymtab.a \
+ lldbPluginUtility.a \
lldbSymbol.a \
lldbTarget.a \
lldbUtility.a \
- plugin_llvmc_Base.a \
- plugin_llvmc_Clang.a \
clangAnalysis.a \
clangAST.a \
clangBasic.a \
@@ -49,14 +48,14 @@ USEDLIBS = lldbAPI.a \
clangRewrite.a \
clangParse.a \
clangSema.a \
- CompilerDriver.a \
+ clangSerialization.a \
EnhancedDisassembly.a \
clangChecker.a
include $(LLDB_LEVEL)/../../Makefile.config
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
- ipo selectiondag jit
+ ipo selectiondag jit mc
ifeq ($(HOST_OS),Darwin)
USEDLIBS += lldbHostMacOSX.a \
@@ -64,7 +63,6 @@ ifeq ($(HOST_OS),Darwin)
lldbPluginObjectContainerUniversalMachO.a \
lldbPluginObjectFileMachO.a \
lldbPluginProcessGDBRemote.a \
- lldbPluginUtility.a \
lldbPluginSymbolVendorMacOSX.a
endif
diff --git a/source/Plugins/Makefile b/source/Plugins/Makefile
index 28c7c1e..14eed8a 100644
--- a/source/Plugins/Makefile
+++ b/source/Plugins/Makefile
@@ -14,11 +14,11 @@ include $(LLDB_LEVEL)/../../Makefile.config
DIRS := ABI/MacOSX-i386 ABI/SysV-x86_64 Disassembler/llvm \
ObjectContainer/BSD-Archive ObjectFile/ELF SymbolFile/DWARF \
- SymbolFile/Symtab
+ SymbolFile/Symtab Process/Utility
ifeq ($(HOST_OS),Darwin)
DIRS += DynamicLoader/MacOSX-DYLD ObjectContainer/Universal-Mach-O \
- ObjectFile/Mach-O Process/gdb-remote Process/Utility \
+ ObjectFile/Mach-O Process/gdb-remote \
SymbolVendor/MacOSX Process/MacOSX-User
endif
--
1.7.3.2
From gclayton at apple.com Tue Jan 4 15:28:37 2011
From: gclayton at apple.com (Greg Clayton)
Date: Tue, 4 Jan 2011 13:28:37 -0800
Subject: [Lldb-commits] [PATCH 0/9] linux: process plugin updates
In-Reply-To: <1294174457-8635-1-git-send-email-wilsons@start.ca>
References: <1294174457-8635-1-git-send-email-wilsons@start.ca>
Message-ID:
These look fine, feel free to commit them when you can.
Greg Clayton
On Jan 4, 2011, at 12:54 PM, Stephen Wilson wrote:
> This patch series updates the ProcessLinux plugin so that it builds again under
> linux.
>
> The ProcessLinux plugin has always been incomplete. This patch series does not
> add any new functionality.
>
> A vital component which the Linux platform has always lacked is a DynamicLoader
> plugin. Previously we worked around this limitation by simply marking the
> sections of the executable we were debugging as loaded. This allowed LLDB to
> work with static executables. However, this was simply a hack and does not work
> with the current code base. This functionality is therefore removed in patch 4
> of this series.
>
> The net result is that there is essentially zero functionality under Linux at
> this time.
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
From wilsons at start.ca Tue Jan 4 15:39:27 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:39:27 -0000
Subject: [Lldb-commits] [lldb] r122834 -
/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
Message-ID: <20110104213927.3F8AB2A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:39:27 2011
New Revision: 122834
URL: http://llvm.org/viewvc/llvm-project?rev=122834&view=rev
Log:
Replace old "CurrentThread" calls with equivalent "SelectedThread" calls.
Modified:
lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=122834&r1=122833&r2=122834&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Tue Jan 4 15:39:27 2011
@@ -651,7 +651,7 @@
// current.
inferior.reset(new LinuxThread(process, pid));
process.GetThreadList().AddThread(inferior);
- process.GetThreadList().SetCurrentThreadByID(pid);
+ process.GetThreadList().SetSelectedThreadByID(pid);
// Let our process instance know the thread has stopped.
process.SendMessage(ProcessMessage::Trace(pid));
From wilsons at start.ca Tue Jan 4 15:40:25 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:40:25 -0000
Subject: [Lldb-commits] [lldb] r122835 - in
/lldb/trunk/source/Plugins/Process/Linux: ProcessMonitor.cpp
ProcessMonitor.h
Message-ID: <20110104214025.809B12A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:40:25 2011
New Revision: 122835
URL: http://llvm.org/viewvc/llvm-project?rev=122835&view=rev
Log:
Host::StopMonitoringChildProcess has been removed. Provide a substitute.
Modified:
lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=122835&r1=122834&r2=122835&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Tue Jan 4 15:40:25 2011
@@ -459,7 +459,7 @@
m_operation_thread(LLDB_INVALID_HOST_THREAD),
m_pid(LLDB_INVALID_PROCESS_ID),
m_terminal_fd(-1),
- m_monitor_handle(0),
+ m_monitor_thread(LLDB_INVALID_HOST_THREAD),
m_client_fd(-1),
m_server_fd(-1)
{
@@ -499,7 +499,7 @@
}
// Finally, start monitoring the child process for change in state.
- if (!(m_monitor_handle = Host::StartMonitoringChildProcess(
+ if (!(m_monitor_thread = Host::StartMonitoringChildProcess(
ProcessMonitor::MonitorCallback, this, GetPID(), true)))
{
error.SetErrorToGenericError();
@@ -510,7 +510,7 @@
ProcessMonitor::~ProcessMonitor()
{
- Host::StopMonitoringChildProcess(m_monitor_handle);
+ StopMonitoringChildProcess();
StopOperationThread();
close(m_terminal_fd);
@@ -923,3 +923,16 @@
return (dup2(fd, target_fd) == -1) ? false : true;
}
+
+void
+ProcessMonitor::StopMonitoringChildProcess()
+{
+ lldb::thread_result_t thread_result;
+
+ if (m_monitor_thread != LLDB_INVALID_HOST_THREAD)
+ {
+ Host::ThreadCancel(m_monitor_thread, NULL);
+ Host::ThreadJoin(m_monitor_thread, &thread_result, NULL);
+ m_monitor_thread = LLDB_INVALID_HOST_THREAD;
+ }
+}
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h?rev=122835&r1=122834&r2=122835&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.h Tue Jan 4 15:40:25 2011
@@ -140,7 +140,7 @@
lldb::pid_t m_pid;
int m_terminal_fd;
- uint32_t m_monitor_handle;
+ uint32_t m_monitor_thread;
lldb_private::Mutex m_server_mutex;
int m_client_fd;
@@ -203,6 +203,9 @@
void
DoOperation(Operation *op);
+
+ /// Stops the child monitor thread.
+ void StopMonitoringChildProcess();
};
#endif // #ifndef liblldb_ProcessMonitor_H_
From wilsons at start.ca Tue Jan 4 15:41:32 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:41:32 -0000
Subject: [Lldb-commits] [lldb] r122836 - in
/lldb/trunk/source/Plugins/Process/Linux: ProcessLinux.cpp ProcessLinux.h
Message-ID: <20110104214132.259CB2A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:41:31 2011
New Revision: 122836
URL: http://llvm.org/viewvc/llvm-project?rev=122836&view=rev
Log:
Update ProcessLinux method signatures to be in line with LLDB's current API.
Modified:
lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp
lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp?rev=122836&r1=122835&r2=122836&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp Tue Jan 4 15:41:31 2011
@@ -105,6 +105,7 @@
ProcessLinux::DoLaunch(Module *module,
char const *argv[],
char const *envp[],
+ uint32_t launch_flags,
const char *stdin_path,
const char *stdout_path,
const char *stderr_path)
@@ -155,7 +156,7 @@
}
Error
-ProcessLinux::DoHalt()
+ProcessLinux::DoHalt(bool &caused_stop)
{
return Error(1, eErrorTypeGeneric);
}
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h?rev=122836&r1=122835&r2=122836&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h Tue Jan 4 15:41:31 2011
@@ -66,6 +66,7 @@
DoLaunch(lldb_private::Module *module,
char const *argv[],
char const *envp[],
+ uint32_t launch_flags,
const char *stdin_path,
const char *stdout_path,
const char *stderr_path);
@@ -77,7 +78,7 @@
DoResume();
virtual lldb_private::Error
- DoHalt();
+ DoHalt(bool &caused_stop);
virtual lldb_private::Error
DoDetach();
From wilsons at start.ca Tue Jan 4 15:42:31 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:42:31 -0000
Subject: [Lldb-commits] [lldb] r122837 - in
/lldb/trunk/source/Plugins/Process/Linux: ProcessLinux.cpp ProcessLinux.h
Message-ID: <20110104214232.0004B2A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:42:31 2011
New Revision: 122837
URL: http://llvm.org/viewvc/llvm-project?rev=122837&view=rev
Log:
Do not load sections manually when launching a Linux process.
This code was a temporary workaround due to the lack of a dynamic loader plugin
for the Linux platform that has bit rotted over time. Instead of replacing this
hack with another a proper plugin will be developed instead.
Modified:
lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp
lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp?rev=122837&r1=122836&r2=122837&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp Tue Jan 4 15:42:31 2011
@@ -127,12 +127,6 @@
return error;
}
-void
-ProcessLinux::DidLaunch()
-{
- UpdateLoadedSections();
-}
-
Error
ProcessLinux::DoResume()
{
@@ -404,27 +398,6 @@
//------------------------------------------------------------------------------
// Utility functions.
-void
-ProcessLinux::UpdateLoadedSections()
-{
- ObjectFile *obj_file = m_module->GetObjectFile();
- SectionList *sections = obj_file->GetSectionList();
-
- // FIXME: SectionList provides iterator types, but no begin/end methods.
- size_t num_sections = sections->GetSize();
- for (unsigned i = 0; i < num_sections; ++i)
- {
- Section *section = sections->GetSectionAtIndex(i).get();
-
- lldb::addr_t new_load_addr = section->GetFileAddress();
- lldb::addr_t old_load_addr = GetSectionLoadAddress(section);
-
- if (old_load_addr == LLDB_INVALID_ADDRESS ||
- old_load_addr != new_load_addr)
- SectionLoaded(section, new_load_addr);
- }
-}
-
bool
ProcessLinux::HasExited()
{
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h?rev=122837&r1=122836&r2=122837&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h Tue Jan 4 15:42:31 2011
@@ -71,9 +71,6 @@
const char *stdout_path,
const char *stderr_path);
- virtual void
- DidLaunch();
-
virtual lldb_private::Error
DoResume();
From wilsons at start.ca Tue Jan 4 15:43:20 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:43:20 -0000
Subject: [Lldb-commits] [lldb] r122838 - in
/lldb/trunk/source/Plugins/Process/Linux: LinuxThread.cpp LinuxThread.h
Message-ID: <20110104214320.1F6512A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:43:19 2011
New Revision: 122838
URL: http://llvm.org/viewvc/llvm-project?rev=122838&view=rev
Log:
Use default implementation of Thread::GetStackFrameCount and Thread::GetStackFrameAtIndex.
Modified:
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp?rev=122838&r1=122837&r2=122838&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp Tue Jan 4 15:43:19 2011
@@ -13,6 +13,7 @@
// C++ Includes
// Other libraries and framework includes
#include "lldb/Target/Process.h"
+#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "LinuxThread.h"
@@ -60,26 +61,6 @@
return NULL;
}
-uint32_t
-LinuxThread::GetStackFrameCount()
-{
- return 0;
-}
-
-lldb::StackFrameSP
-LinuxThread::GetStackFrameAtIndex(uint32_t idx)
-{
- if (idx == 0)
- {
- RegisterContextLinux *regs = GetRegisterContext();
- StackFrame *frame = new StackFrame(
- idx, *this, regs->GetFP(), regs->GetPC());
- return lldb::StackFrameSP(frame);
- }
- else
- return lldb::StackFrameSP();
-}
-
RegisterContextLinux *
LinuxThread::GetRegisterContext()
{
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h?rev=122838&r1=122837&r2=122838&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h Tue Jan 4 15:43:19 2011
@@ -38,12 +38,6 @@
const char *
GetInfo();
- uint32_t
- GetStackFrameCount();
-
- lldb::StackFrameSP
- GetStackFrameAtIndex(uint32_t idx);
-
RegisterContextLinux *
GetRegisterContext();
From wilsons at start.ca Tue Jan 4 15:44:13 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:44:13 -0000
Subject: [Lldb-commits] [lldb] r122839 -
/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
Message-ID: <20110104214413.D3C6D2A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:44:13 2011
New Revision: 122839
URL: http://llvm.org/viewvc/llvm-project?rev=122839&view=rev
Log:
StopInfo now lives in the lldb_private namespace. Qualify.
Modified:
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h?rev=122839&r1=122838&r2=122839&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h Tue Jan 4 15:44:13 2011
@@ -51,7 +51,7 @@
CreateRegisterContextForFrame(lldb_private::StackFrame *frame);
bool
- GetRawStopReason(StopInfo *stop_info);
+ GetRawStopReason(lldb_private::StopInfo *stop_info);
//--------------------------------------------------------------------------
// These methods form a specialized interface to linux threads.
From wilsons at start.ca Tue Jan 4 15:45:02 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:45:02 -0000
Subject: [Lldb-commits] [lldb] r122840 - in
/lldb/trunk/source/Plugins/Process/Linux: LinuxThread.cpp LinuxThread.h
Message-ID: <20110104214502.A97A62A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:45:02 2011
New Revision: 122840
URL: http://llvm.org/viewvc/llvm-project?rev=122840&view=rev
Log:
Remove LinuxThread::GetRawStopReason and implement Thread::GetPrivateStopReason.
Modified:
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp?rev=122840&r1=122839&r2=122840&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp Tue Jan 4 15:45:02 2011
@@ -85,26 +85,27 @@
return new RegisterContextLinux_x86_64(*this, frame);
}
-bool
-LinuxThread::GetRawStopReason(StopInfo *stop_info)
+lldb::StopInfoSP
+LinuxThread::GetPrivateStopReason()
{
- stop_info->Clear();
+ lldb::StopInfoSP stop_info;
switch (m_note)
{
default:
- stop_info->SetStopReasonToNone();
break;
case eBreak:
- stop_info->SetStopReasonWithBreakpointSiteID(m_breakpoint->GetID());
+ stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(
+ *this, m_breakpoint->GetID());
break;
case eTrace:
- stop_info->SetStopReasonToTrace();
+ stop_info = StopInfo::CreateStopReasonToTrace(*this);
+ break;
}
- return true;
+ return stop_info;
}
bool
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h?rev=122840&r1=122839&r2=122840&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h Tue Jan 4 15:45:02 2011
@@ -50,9 +50,6 @@
RegisterContextLinux *
CreateRegisterContextForFrame(lldb_private::StackFrame *frame);
- bool
- GetRawStopReason(lldb_private::StopInfo *stop_info);
-
//--------------------------------------------------------------------------
// These methods form a specialized interface to linux threads.
//
@@ -78,6 +75,9 @@
Notification m_note;
ProcessMonitor &GetMonitor();
+
+ lldb::StopInfoSP
+ GetPrivateStopReason();
};
#endif // #ifndef liblldb_LinuxThread_H_
From wilsons at start.ca Tue Jan 4 15:45:57 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:45:57 -0000
Subject: [Lldb-commits] [lldb] r122841 - in
/lldb/trunk/source/Plugins/Process/Linux: LinuxThread.cpp LinuxThread.h
Message-ID: <20110104214557.A8EC22A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:45:57 2011
New Revision: 122841
URL: http://llvm.org/viewvc/llvm-project?rev=122841&view=rev
Log:
Provide LinuxThread with an implementation of Thread::GetUnwinder.
Modified:
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp?rev=122841&r1=122840&r2=122841&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp Tue Jan 4 15:45:57 2011
@@ -108,6 +108,12 @@
return stop_info;
}
+Unwind *
+LinuxThread::GetUnwinder()
+{
+ return m_unwinder_ap.get();
+}
+
bool
LinuxThread::WillResume(lldb::StateType resume_state)
{
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h?rev=122841&r1=122840&r2=122841&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h Tue Jan 4 15:45:57 2011
@@ -78,6 +78,9 @@
lldb::StopInfoSP
GetPrivateStopReason();
+
+ lldb_private::Unwind *
+ GetUnwinder();
};
#endif // #ifndef liblldb_LinuxThread_H_
From wilsons at start.ca Tue Jan 4 15:46:35 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Tue, 04 Jan 2011 21:46:35 -0000
Subject: [Lldb-commits] [lldb] r122842 -
/lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
Message-ID: <20110104214635.7E4EE2A6C12C@llvm.org>
Author: wilsons
Date: Tue Jan 4 15:46:35 2011
New Revision: 122842
URL: http://llvm.org/viewvc/llvm-project?rev=122842&view=rev
Log:
Fix typo (presumably carried over from the MacOSX plugin).
Modified:
lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
Modified: lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp?rev=122842&r1=122841&r2=122842&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp Tue Jan 4 15:46:35 2011
@@ -644,7 +644,7 @@
}
else if (kind == eRegisterKindLLDB)
{
- return reg;
+ return num;
}
return LLDB_INVALID_REGNUM;
From gclayton at apple.com Wed Jan 5 12:43:15 2011
From: gclayton at apple.com (Greg Clayton)
Date: Wed, 05 Jan 2011 18:43:15 -0000
Subject: [Lldb-commits] [lldb] r122895 - in /lldb/trunk:
include/lldb/API/SBValue.h include/lldb/Core/ValueObject.h
include/lldb/lldb-enumerations.h source/API/SBValue.cpp
source/Core/DataExtractor.cpp source/Symbol/ClangASTType.cpp
Message-ID: <20110105184316.0F0FF2A6C12C@llvm.org>
Author: gclayton
Date: Wed Jan 5 12:43:15 2011
New Revision: 122895
URL: http://llvm.org/viewvc/llvm-project?rev=122895&view=rev
Log:
Added the ability to get an set the desired format for SBValue objects.
Fixed the display of complex numbers in lldb_private::DataExtractor::Dump(...)
and also fixed other edge display cases in lldb_private::ClangASTType::DumpTypeValue(...).
Modified:
lldb/trunk/include/lldb/API/SBValue.h
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/lldb-enumerations.h
lldb/trunk/source/API/SBValue.cpp
lldb/trunk/source/Core/DataExtractor.cpp
lldb/trunk/source/Symbol/ClangASTType.cpp
Modified: lldb/trunk/include/lldb/API/SBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBValue.h?rev=122895&r1=122894&r2=122895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBValue.h (original)
+++ lldb/trunk/include/lldb/API/SBValue.h Wed Jan 5 12:43:15 2011
@@ -48,6 +48,12 @@
bool
IsInScope (const lldb::SBFrame &frame);
+ lldb::Format
+ GetFormat () const;
+
+ void
+ SetFormat (lldb::Format format);
+
const char *
GetValue (const lldb::SBFrame &frame);
Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=122895&r1=122894&r2=122895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Wed Jan 5 12:43:15 2011
@@ -260,6 +260,8 @@
void
SetFormat (lldb::Format format)
{
+ if (format != m_format)
+ m_value_str.clear();
m_format = format;
}
Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=122895&r1=122894&r2=122895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Wed Jan 5 12:43:15 2011
@@ -155,6 +155,7 @@
eFormatHex,
eFormatFloat,
eFormatOctal,
+ eFormatOSType, // OS character codes encoded into an integer 'PICT' 'text' etc...
eFormatUnicode16,
eFormatUnicode32,
eFormatUnsigned,
Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=122895&r1=122894&r2=122895&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Wed Jan 5 12:43:15 2011
@@ -489,3 +489,19 @@
return true;
}
+
+lldb::Format
+SBValue::GetFormat () const
+{
+ if (m_opaque_sp)
+ return m_opaque_sp->GetFormat();
+ return eFormatDefault;
+}
+
+void
+SBValue::SetFormat (lldb::Format format)
+{
+ if (m_opaque_sp)
+ m_opaque_sp->SetFormat(format);
+}
+
Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=122895&r1=122894&r2=122895&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Wed Jan 5 12:43:15 2011
@@ -1210,6 +1210,9 @@
if (item_byte_size != 4 && item_byte_size != 8)
item_byte_size = s->GetAddressByteSize();
}
+
+ if (item_format == eFormatOSType && item_byte_size > 8)
+ item_format = eFormatHex;
for (offset = start_offset, line_start_offset = start_offset, count = 0; ValidOffset(offset) && count < item_count; ++count)
{
@@ -1280,7 +1283,7 @@
if (item_count == 1 && item_format == eFormatChar)
s->PutChar('\'');
- uint8_t ch = GetU8(&offset);
+ uint32_t ch = GetMaxU64(&offset, item_byte_size);
if (isprint(ch))
s->Printf ("%c", ch);
else if (item_format == eFormatChar)
@@ -1296,7 +1299,12 @@
case '\t': s->Printf ("\\t", ch); break;
case '\v': s->Printf ("\\v", ch); break;
case '\0': s->Printf ("\\0", ch); break;
- default: s->Printf ("\\x%2.2x", ch); break;
+ default:
+ if (item_byte_size == 1)
+ s->Printf ("\\x%2.2x", ch);
+ else
+ s->Printf ("\\u%x", ch);
+ break;
}
}
else
@@ -1310,29 +1318,6 @@
}
break;
- case eFormatComplex:
- if (sizeof(float) * 2 == item_byte_size)
- {
- uint32_t a32 = GetU32(&offset);
- uint32_t b32 = GetU32(&offset);
-
- s->Printf ("%g + %gi", a32, b32);
- }
- else if (sizeof(double) * 2 == item_byte_size)
- {
- uint64_t a64 = GetU64(&offset);
- uint64_t b64 = GetU64(&offset);
-
- s->Printf ("%lg + %lgi", a64, b64);
- }
- else if (sizeof(long double) * 2 == item_byte_size && sizeof(long double) <= sizeof(uint64_t))
- {
- uint64_t a64 = GetU64(&offset);
- uint64_t b64 = GetU64(&offset);
- s->Printf ("%Lg + %Lgi", a64, b64);
- }
- break;
-
case eFormatDecimal:
if (item_byte_size <= 8)
s->Printf ("%lld", GetMaxS64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
@@ -1348,6 +1333,40 @@
s->Printf ("0%llo", GetMaxS64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
break;
+ case eFormatOSType:
+ {
+ uint64_t uval64 = GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset);
+ s->PutChar('\'');
+ for (i=0; i 0)
+ ch = (uint8_t)(uval64 >> ((item_byte_size - i - 1) * 8));
+ else
+ ch = (uint8_t)uval64;
+ if (isprint(ch))
+ s->Printf ("%c", ch);
+ else
+ {
+ switch (ch)
+ {
+ case '\e': s->Printf ("\\e", (uint8_t)ch); break;
+ case '\a': s->Printf ("\\a", ch); break;
+ case '\b': s->Printf ("\\b", ch); break;
+ case '\f': s->Printf ("\\f", ch); break;
+ case '\n': s->Printf ("\\n", ch); break;
+ case '\r': s->Printf ("\\r", ch); break;
+ case '\t': s->Printf ("\\t", ch); break;
+ case '\v': s->Printf ("\\v", ch); break;
+ case '\0': s->Printf ("\\0", ch); break;
+ default: s->Printf ("\\x%2.2x", ch); break;
+ }
+ }
+ }
+ s->PutChar('\'');
+ }
+ break;
+
case eFormatEnum:
// Print enum value as a signed integer when we don't get the enum type
s->Printf ("%lld", GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
@@ -1371,6 +1390,34 @@
s->Address(GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset), sizeof (addr_t));
break;
+ case eFormatComplex:
+ if (sizeof(float) * 2 == item_byte_size)
+ {
+ float f32_1 = GetFloat (&offset);
+ float f32_2 = GetFloat (&offset);
+
+ s->Printf ("%g + %gi", f32_1, f32_2);
+ break;
+ }
+ else if (sizeof(double) * 2 == item_byte_size)
+ {
+ double d64_1 = GetDouble (&offset);
+ double d64_2 = GetDouble (&offset);
+
+ s->Printf ("%lg + %lgi", d64_1, d64_2);
+ break;
+ }
+ else if (sizeof(long double) * 2 == item_byte_size)
+ {
+ long double ld64_1 = GetLongDouble (&offset);
+ long double ld64_2 = GetLongDouble (&offset);
+ s->Printf ("%Lg + %Lgi", ld64_1, ld64_2);
+ break;
+ }
+
+ // Fall through to hex for any other sizes
+ item_format = eFormatHex;
+
default:
case eFormatDefault:
case eFormatHex:
Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=122895&r1=122894&r2=122895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Wed Jan 5 12:43:15 2011
@@ -646,9 +646,33 @@
else
{
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
+
switch (type_class)
{
+ case clang::Type::Typedef:
+ {
+ clang::QualType typedef_qual_type = cast(qual_type)->getDecl()->getUnderlyingType();
+ if (format == eFormatDefault)
+ format = ClangASTType::GetFormat(typedef_qual_type.getAsOpaquePtr());
+ std::pair typedef_type_info = ast_context->getTypeInfo(typedef_qual_type);
+ uint64_t typedef_byte_size = typedef_type_info.first / 8;
+
+ return ClangASTType::DumpTypeValue (ast_context, // The clang AST context for this type
+ typedef_qual_type.getAsOpaquePtr(), // The clang type we want to dump
+ s,
+ format, // The format with which to display the element
+ data, // Data buffer containing all bytes for this type
+ byte_offset, // Offset into "data" where to grab value from
+ typedef_byte_size, // Size of this type in bytes
+ bitfield_bit_size, // Size in bits of a bitfield value, if zero don't treat as a bitfield
+ bitfield_bit_offset); // Offset in bits of a bitfield value if bitfield_bit_size != 0
+ }
+ break;
+
case clang::Type::Enum:
+ // If our format is enum or default, show the enumeration value as
+ // its enumeration string value, else just display it as requested.
+ if (format == eFormatEnum || format == eFormatDefault)
{
const clang::EnumType *enum_type = cast(qual_type.getTypePtr());
const clang::EnumDecl *enum_decl = enum_type->getDecl();
@@ -666,43 +690,75 @@
}
// If we have gotten here we didn't get find the enumerator in the
// enum decl, so just print the integer.
-
+
s->Printf("%lli", enum_value);
return true;
}
- break;
-
- case clang::Type::Typedef:
- {
- clang::QualType typedef_qual_type = cast(qual_type)->getDecl()->getUnderlyingType();
- lldb::Format typedef_format = ClangASTType::GetFormat(typedef_qual_type.getAsOpaquePtr());
- std::pair typedef_type_info = ast_context->getTypeInfo(typedef_qual_type);
- uint64_t typedef_byte_size = typedef_type_info.first / 8;
-
- return ClangASTType::DumpTypeValue(
- ast_context, // The clang AST context for this type
- typedef_qual_type.getAsOpaquePtr(), // The clang type we want to dump
- s,
- typedef_format, // The format with which to display the element
- data, // Data buffer containing all bytes for this type
- byte_offset, // Offset into "data" where to grab value from
- typedef_byte_size, // Size of this type in bytes
- bitfield_bit_size, // Size in bits of a bitfield value, if zero don't treat as a bitfield
- bitfield_bit_offset); // Offset in bits of a bitfield value if bitfield_bit_size != 0
- }
- break;
-
+ // format was not enum, just fall through and dump the value as requested....
+
default:
// We are down the a scalar type that we just need to display.
- return data.Dump(s,
- byte_offset,
- format,
- byte_size,
- 1,
- UINT32_MAX,
- LLDB_INVALID_ADDRESS,
- bitfield_bit_size,
- bitfield_bit_offset);
+ {
+ uint32_t item_count = 1;
+ // A few formats, we might need to modify our size and count for depending
+ // on how we are trying to display the value...
+ switch (format)
+ {
+ default:
+ case eFormatBoolean:
+ case eFormatBinary:
+ case eFormatComplex:
+ case eFormatCString: // NULL terminated C strings
+ case eFormatDecimal:
+ case eFormatEnum:
+ case eFormatHex:
+ case eFormatFloat:
+ case eFormatOctal:
+ case eFormatOSType:
+ case eFormatUnsigned:
+ case eFormatPointer:
+ case eFormatVectorOfChar:
+ case eFormatVectorOfSInt8:
+ case eFormatVectorOfUInt8:
+ case eFormatVectorOfSInt16:
+ case eFormatVectorOfUInt16:
+ case eFormatVectorOfSInt32:
+ case eFormatVectorOfUInt32:
+ case eFormatVectorOfSInt64:
+ case eFormatVectorOfUInt64:
+ case eFormatVectorOfFloat32:
+ case eFormatVectorOfFloat64:
+ case eFormatVectorOfUInt128:
+ break;
+
+ case eFormatChar:
+ case eFormatCharPrintable:
+ case eFormatBytes:
+ case eFormatBytesWithASCII:
+ item_count = (byte_size * item_count);
+ byte_size = 1;
+ break;
+
+ case eFormatUnicode16:
+ item_count = (byte_size * item_count) / 2;
+ byte_size = 2;
+ break;
+
+ case eFormatUnicode32:
+ item_count = (byte_size * item_count) / 4;
+ byte_size = 4;
+ break;
+ }
+ return data.Dump (s,
+ byte_offset,
+ format,
+ byte_size,
+ item_count,
+ UINT32_MAX,
+ LLDB_INVALID_ADDRESS,
+ bitfield_bit_size,
+ bitfield_bit_offset);
+ }
break;
}
}
From gclayton at apple.com Wed Jan 5 13:02:52 2011
From: gclayton at apple.com (Greg Clayton)
Date: Wed, 05 Jan 2011 19:02:52 -0000
Subject: [Lldb-commits] [lldb] r122897 - in /lldb/trunk:
lldb.xcodeproj/project.pbxproj resources/LLDB-Info.plist
tools/debugserver/debugserver.xcodeproj/project.pbxproj
Message-ID: <20110105190252.681AE2A6C12C@llvm.org>
Author: gclayton
Date: Wed Jan 5 13:02:52 2011
New Revision: 122897
URL: http://llvm.org/viewvc/llvm-project?rev=122897&view=rev
Log:
Bumped versions in Xcode projects: lldb is now at lldb-38, debugserver is now
at debugserver-124.
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/resources/LLDB-Info.plist
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=122897&r1=122896&r2=122897&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jan 5 13:02:52 2011
@@ -2926,9 +2926,9 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 37;
+ CURRENT_PROJECT_VERSION = 38;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 37;
+ DYLIB_CURRENT_VERSION = 38;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -2978,11 +2978,11 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 37;
+ CURRENT_PROJECT_VERSION = 38;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 37;
+ DYLIB_CURRENT_VERSION = 38;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -3052,7 +3052,7 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 37;
+ CURRENT_PROJECT_VERSION = 38;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -3087,11 +3087,11 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 37;
+ CURRENT_PROJECT_VERSION = 38;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 37;
+ DYLIB_CURRENT_VERSION = 38;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -3140,7 +3140,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = lldb_codesign;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 37;
+ CURRENT_PROJECT_VERSION = 38;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -3178,7 +3178,7 @@
);
CODE_SIGN_IDENTITY = lldb_codesign;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 37;
+ CURRENT_PROJECT_VERSION = 38;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Modified: lldb/trunk/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/resources/LLDB-Info.plist?rev=122897&r1=122896&r2=122897&view=diff
==============================================================================
--- lldb/trunk/resources/LLDB-Info.plist (original)
+++ lldb/trunk/resources/LLDB-Info.plist Wed Jan 5 13:02:52 2011
@@ -17,7 +17,7 @@
CFBundleSignature
????
CFBundleVersion
- 37
+ 38
CFBundleName
${EXECUTABLE_NAME}
Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=122897&r1=122896&r2=122897&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Wed Jan 5 13:02:52 2011
@@ -460,7 +460,7 @@
i386,
);
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 123;
+ CURRENT_PROJECT_VERSION = 124;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
STRIP_INSTALLED_PRODUCT = NO;
@@ -478,7 +478,7 @@
x86_64,
i386,
);
- CURRENT_PROJECT_VERSION = 123;
+ CURRENT_PROJECT_VERSION = 124;
DEAD_CODE_STRIPPING = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -498,7 +498,7 @@
x86_64,
i386,
);
- CURRENT_PROJECT_VERSION = 123;
+ CURRENT_PROJECT_VERSION = 124;
DEAD_CODE_STRIPPING = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -515,7 +515,7 @@
buildSettings = {
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 123;
+ CURRENT_PROJECT_VERSION = 124;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -556,7 +556,7 @@
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 123;
+ CURRENT_PROJECT_VERSION = 124;
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
"$(SDKROOT)/System/Library/PrivateFrameworks",
@@ -597,7 +597,7 @@
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 123;
+ CURRENT_PROJECT_VERSION = 124;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
From johnny.chen at apple.com Wed Jan 5 14:24:11 2011
From: johnny.chen at apple.com (Johnny Chen)
Date: Wed, 05 Jan 2011 20:24:11 -0000
Subject: [Lldb-commits] [lldb] r122901 - /lldb/trunk/test/dotest.py
Message-ID: <20110105202411.94B612A6C12C@llvm.org>
Author: johnny
Date: Wed Jan 5 14:24:11 2011
New Revision: 122901
URL: http://llvm.org/viewvc/llvm-project?rev=122901&view=rev
Log:
Enhance the test framework to be able to emit a counter value in verbose mode
describing the ordinal number of the currently running test case.
Modified:
lldb/trunk/test/dotest.py
Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=122901&r1=122900&r2=122901&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Wed Jan 5 14:24:11 2011
@@ -792,6 +792,18 @@
LLDBTestResult.__singleton__ = self
# Now put this singleton into the lldb module namespace.
lldb.test_result = self
+ # Computes the format string for displaying the counter.
+ global suite
+ counterWidth = len(str(suite.countTestCases()))
+ self.fmt = "%" + str(counterWidth) + "d: "
+ # This counts from 1 .. suite.countTestCases().
+ self.counter = 0
+
+ def startTest(self, test):
+ self.counter += 1
+ if self.showAll:
+ self.stream.write(self.fmt % self.counter)
+ super(LLDBTestResult, self).startTest(test)
def addError(self, test, err):
global sdir_has_content
From johnny.chen at apple.com Wed Jan 5 16:50:11 2011
From: johnny.chen at apple.com (Johnny Chen)
Date: Wed, 05 Jan 2011 22:50:11 -0000
Subject: [Lldb-commits] [lldb] r122922 - /lldb/trunk/test/dotest.py
Message-ID: <20110105225011.558582A6C12C@llvm.org>
Author: johnny
Date: Wed Jan 5 16:50:11 2011
New Revision: 122922
URL: http://llvm.org/viewvc/llvm-project?rev=122922&view=rev
Log:
Properly indent the short description of the test case to make it align with the
previously added ordinal number of the currently running test case.
Modified:
lldb/trunk/test/dotest.py
Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=122922&r1=122921&r2=122922&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Wed Jan 5 16:50:11 2011
@@ -796,9 +796,17 @@
global suite
counterWidth = len(str(suite.countTestCases()))
self.fmt = "%" + str(counterWidth) + "d: "
+ self.indentation = ' ' * (counterWidth + 2)
# This counts from 1 .. suite.countTestCases().
self.counter = 0
+ def getDescription(self, test):
+ doc_first_line = test.shortDescription()
+ if self.descriptions and doc_first_line:
+ return '\n'.join((str(test), self.indentation + doc_first_line))
+ else:
+ return str(test)
+
def startTest(self, test):
self.counter += 1
if self.showAll:
From johnny.chen at apple.com Wed Jan 5 18:03:01 2011
From: johnny.chen at apple.com (Johnny Chen)
Date: Thu, 06 Jan 2011 00:03:01 -0000
Subject: [Lldb-commits] [lldb] r122930 - /lldb/trunk/test/help/TestHelp.py
Message-ID: <20110106000301.448912A6C12C@llvm.org>
Author: johnny
Date: Wed Jan 5 18:03:01 2011
New Revision: 122930
URL: http://llvm.org/viewvc/llvm-project?rev=122930&view=rev
Log:
Modify test_help_version() test case to be more precise in matching the version
number string as found in the resources/LLDB-info.plist file.
Modified:
lldb/trunk/test/help/TestHelp.py
Modified: lldb/trunk/test/help/TestHelp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/help/TestHelp.py?rev=122930&r1=122929&r2=122930&view=diff
==============================================================================
--- lldb/trunk/test/help/TestHelp.py (original)
+++ lldb/trunk/test/help/TestHelp.py Wed Jan 5 18:03:01 2011
@@ -18,12 +18,47 @@
self.expect("help",
startstr = 'The following is a list of built-in, permanent debugger commands')
+ def version_number_string(self):
+ """Helper function to find the version number string of lldb."""
+ plist = os.path.join(os.getcwd(), os.pardir, os.pardir, "resources", "LLDB-info.plist")
+ try:
+ CFBundleVersionSegFound = False
+ with open(plist, 'r') as f:
+ for line in f:
+ if CFBundleVersionSegFound:
+ version_line = line.strip()
+ import re
+ m = re.match("(.*)", version_line)
+ if m:
+ version = m.group(1)
+ return version
+ else:
+ # Unsuccessful, let's juts break out of the for loop.
+ break
+
+ if line.find("CFBundleVersion") != -1:
+ # Found our match. The next line contains our version
+ # string, for example:
+ #
+ # 38
+ CFBundleVersionSegFound = True
+
+ except:
+ # Just fallthrough...
+ print "Unexpected error:", sys.exc_info()[0]
+ pass
+
+ # Use None to signify that we are not able to grok the version number.
+ return None
+
+
def test_help_version(self):
"""Test 'help version' and 'version' commands."""
self.expect("help version",
substrs = ['Show version of LLDB debugger.'])
+ version_str = self.version_number_string()
self.expect("version",
- patterns = ['LLDB-[0-9]+'])
+ patterns = ['LLDB-' + (version_str if version_str else '[0-9]+')])
def test_help_should_not_hang_emacsshell(self):
"""Command 'settings set term-width 0' should not hang the help command."""
From wilsons at start.ca Thu Jan 6 15:57:38 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Thu, 06 Jan 2011 16:57:38 -0500
Subject: [Lldb-commits] [PATCH 0/2] linux: makefile system updates
In-Reply-To: <1294174534-8666-1-git-send-email-wilsons@start.ca> (Stephen
Wilson's message of "Tue, 4 Jan 2011 15:55:32 -0500")
References: <1294174534-8666-1-git-send-email-wilsons@start.ca>
Message-ID:
Hi Greg, *,
Stephen Wilson writes:
> This series updates the Makefile based build system.
>
> In particular, it adds the Process/Utility component to the Linux build, adds
> some missing/renamed Clang/LLVM components, and quites warnings generated by GCC
> when encountering unknown pragmas (in particular the #pragma mark construct).
Are these makefile patches OK to commit (am not sure if your last thumbs
up applied to this series as well)?
Take care,
--
steve
From wilsons at start.ca Thu Jan 6 16:10:24 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Thu, 06 Jan 2011 22:10:24 -0000
Subject: [Lldb-commits] [lldb] r122974 - /lldb/trunk/Makefile
Message-ID: <20110106221024.54A4B2A6C12C@llvm.org>
Author: wilsons
Date: Thu Jan 6 16:10:24 2011
New Revision: 122974
URL: http://llvm.org/viewvc/llvm-project?rev=122974&view=rev
Log:
Ignore unknown pragmas.
In particular, we are looking to ignore the "#pragma mark" construct which GCC
warns about on platforms other than Darwin. This cleans up diagnostic output
significantly.
Modified:
lldb/trunk/Makefile
Modified: lldb/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/Makefile?rev=122974&r1=122973&r2=122974&view=diff
==============================================================================
--- lldb/trunk/Makefile (original)
+++ lldb/trunk/Makefile Thu Jan 6 16:10:24 2011
@@ -53,6 +53,10 @@
# We can revisit this when LLVM/Clang support it.
CXX.Flags += -fno-strict-aliasing
+# Do not warn about pragmas. In particular, we are looking to ignore the
+# "#pragma mark" construct which GCC warns about on platforms other than Darwin.
+EXTRA_OPTIONS += -Wno-unknown-pragmas
+
###
# LLDB Top Level specific stuff.
From wilsons at start.ca Thu Jan 6 16:11:47 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Thu, 06 Jan 2011 22:11:47 -0000
Subject: [Lldb-commits] [lldb] r122975 - in /lldb/trunk: lib/Makefile
source/Plugins/Makefile
Message-ID: <20110106221147.9AF152A6C12C@llvm.org>
Author: wilsons
Date: Thu Jan 6 16:11:47 2011
New Revision: 122975
URL: http://llvm.org/viewvc/llvm-project?rev=122975&view=rev
Log:
Makefile updates.
Update lib/Makefile to use current LLVM and Clang components and add the
PluginUtility library to the build.
Modified:
lldb/trunk/lib/Makefile
lldb/trunk/source/Plugins/Makefile
Modified: lldb/trunk/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=122975&r1=122974&r2=122975&view=diff
==============================================================================
--- lldb/trunk/lib/Makefile (original)
+++ lldb/trunk/lib/Makefile Thu Jan 6 16:11:47 2011
@@ -33,11 +33,10 @@
lldbPluginObjectFileELF.a \
lldbPluginSymbolFileDWARF.a \
lldbPluginSymbolFileSymtab.a \
+ lldbPluginUtility.a \
lldbSymbol.a \
lldbTarget.a \
lldbUtility.a \
- plugin_llvmc_Base.a \
- plugin_llvmc_Clang.a \
clangAnalysis.a \
clangAST.a \
clangBasic.a \
@@ -49,14 +48,14 @@
clangRewrite.a \
clangParse.a \
clangSema.a \
- CompilerDriver.a \
+ clangSerialization.a \
EnhancedDisassembly.a \
clangChecker.a
include $(LLDB_LEVEL)/../../Makefile.config
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
- ipo selectiondag jit
+ ipo selectiondag jit mc
ifeq ($(HOST_OS),Darwin)
USEDLIBS += lldbHostMacOSX.a \
@@ -64,7 +63,6 @@
lldbPluginObjectContainerUniversalMachO.a \
lldbPluginObjectFileMachO.a \
lldbPluginProcessGDBRemote.a \
- lldbPluginUtility.a \
lldbPluginSymbolVendorMacOSX.a
endif
Modified: lldb/trunk/source/Plugins/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Makefile?rev=122975&r1=122974&r2=122975&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Makefile (original)
+++ lldb/trunk/source/Plugins/Makefile Thu Jan 6 16:11:47 2011
@@ -14,11 +14,11 @@
DIRS := ABI/MacOSX-i386 ABI/SysV-x86_64 Disassembler/llvm \
ObjectContainer/BSD-Archive ObjectFile/ELF SymbolFile/DWARF \
- SymbolFile/Symtab
+ SymbolFile/Symtab Process/Utility
ifeq ($(HOST_OS),Darwin)
DIRS += DynamicLoader/MacOSX-DYLD ObjectContainer/Universal-Mach-O \
- ObjectFile/Mach-O Process/gdb-remote Process/Utility \
+ ObjectFile/Mach-O Process/gdb-remote \
SymbolVendor/MacOSX Process/MacOSX-User
endif
From gclayton at apple.com Thu Jan 6 16:15:07 2011
From: gclayton at apple.com (Greg Clayton)
Date: Thu, 06 Jan 2011 22:15:07 -0000
Subject: [Lldb-commits] [lldb] r122976 - in /lldb/trunk: include/lldb/Core/
include/lldb/Target/ source/API/ source/Core/ source/Expression/
source/Plugins/ABI/MacOSX-i386/ source/Plugins/ABI/SysV-x86_64/
source/Plugins/Process/MacOSX-User/source/
source/Plugins/Process/MacOSX-User/source/MacOSX/
source/Plugins/Process/Utility/ source/Plugins/Process/gdb-remote/
source/Symbol/ source/Target/
Message-ID: <20110106221507.6A8F22A6C12C@llvm.org>
Author: gclayton
Date: Thu Jan 6 16:15:06 2011
New Revision: 122976
URL: http://llvm.org/viewvc/llvm-project?rev=122976&view=rev
Log:
Fixed issues with RegisterContext classes and the subclasses. There was
an issue with the way the UnwindLLDB was handing out RegisterContexts: it
was making shared pointers to register contexts and then handing out just
the pointers (which would get put into shared pointers in the thread and
stack frame classes) and cause double free issues. MallocScribble helped to
find these issues after I did some other cleanup. To help avoid any
RegisterContext issue in the future, all code that deals with them now
returns shared pointers to the register contexts so we don't end up with
multiple deletions. Also now that the RegisterContext class doesn't require
a stack frame, we patched a memory leak where a StackFrame object was being
created and leaked.
Made the RegisterContext class not have a pointer to a StackFrame object as
one register context class can be used for N inlined stack frames so there is
not a 1 - 1 mapping. Updates the ExecutionContextScope part of the
RegisterContext class to never return a stack frame to indicate this when it
is asked to recreate the execution context. Now register contexts point to the
concrete frame using a concrete frame index. Concrete frames are all of the
frames that are actually formed on the stack of a thread. These concrete frames
can be turned into one or more user visible frames due to inlining. Each
inlined stack frame has the exact same register context (shared via shared
pointers) as any parent inlined stack frames all the way up to the concrete
frame itself.
So now the stack frames and the register contexts should behave much better.
Modified:
lldb/trunk/include/lldb/Core/ValueObjectRegister.h
lldb/trunk/include/lldb/Target/RegisterContext.h
lldb/trunk/include/lldb/Target/StackFrame.h
lldb/trunk/include/lldb/Target/StackFrameList.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/include/lldb/Target/Unwind.h
lldb/trunk/source/API/SBFrame.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/ValueObjectRegister.cpp
lldb/trunk/source/Expression/DWARFExpression.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/Process/MacOSX-User/source/MacOSX/MachThreadContext.h
lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.h
lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.h
lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.h
lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.h
lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.h
lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.h
lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h
lldb/trunk/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h
lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp
lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h
lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
lldb/trunk/source/Symbol/UnwindPlan.cpp
lldb/trunk/source/Target/ExecutionContext.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/RegisterContext.cpp
lldb/trunk/source/Target/StackFrame.cpp
lldb/trunk/source/Target/StackFrameList.cpp
lldb/trunk/source/Target/Thread.cpp
lldb/trunk/source/Target/ThreadPlan.cpp
lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
lldb/trunk/source/Target/ThreadPlanTracer.cpp
Modified: lldb/trunk/include/lldb/Core/ValueObjectRegister.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectRegister.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectRegister.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectRegister.h Thu Jan 6 16:15:06 2011
@@ -26,7 +26,7 @@
class ValueObjectRegisterContext : public ValueObject
{
public:
- ValueObjectRegisterContext (ValueObject *parent, RegisterContext *reg_ctx);
+ ValueObjectRegisterContext (ValueObject *parent, lldb::RegisterContextSP ®_ctx_sp);
virtual
~ValueObjectRegisterContext();
@@ -59,7 +59,7 @@
CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
protected:
- RegisterContext *m_reg_ctx;
+ lldb::RegisterContextSP m_reg_ctx;
private:
//------------------------------------------------------------------
@@ -71,7 +71,7 @@
class ValueObjectRegisterSet : public ValueObject
{
public:
- ValueObjectRegisterSet (ValueObject *parent, RegisterContext *reg_ctx, uint32_t set_idx);
+ ValueObjectRegisterSet (ValueObject *parent, lldb::RegisterContextSP ®_ctx_sp, uint32_t set_idx);
virtual
~ValueObjectRegisterSet();
@@ -105,7 +105,7 @@
protected:
- RegisterContext *m_reg_ctx;
+ lldb::RegisterContextSP m_reg_ctx;
const lldb::RegisterSet *m_reg_set;
uint32_t m_reg_set_idx;
@@ -119,7 +119,7 @@
class ValueObjectRegister : public ValueObject
{
public:
- ValueObjectRegister (ValueObject *parent, RegisterContext *reg_ctx, uint32_t reg_num);
+ ValueObjectRegister (ValueObject *parent, lldb::RegisterContextSP ®_ctx_sp, uint32_t reg_num);
virtual
~ValueObjectRegister();
@@ -150,7 +150,7 @@
protected:
- RegisterContext *m_reg_ctx;
+ lldb::RegisterContextSP m_reg_ctx;
const lldb::RegisterInfo *m_reg_info;
uint32_t m_reg_num;
ConstString m_type_name;
Modified: lldb/trunk/include/lldb/Target/RegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/RegisterContext.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/RegisterContext.h (original)
+++ lldb/trunk/include/lldb/Target/RegisterContext.h Thu Jan 6 16:15:06 2011
@@ -26,9 +26,7 @@
//------------------------------------------------------------------
// Constructors and Destructors
//------------------------------------------------------------------
- RegisterContext (Thread &thread, StackFrame *frame);
-
- RegisterContext (Thread &thread);
+ RegisterContext (Thread &thread, uint32_t concrete_frame_idx);
virtual
~RegisterContext ();
@@ -147,9 +145,6 @@
bool
ConvertBetweenRegisterKinds (int source_rk, uint32_t source_regnum, int target_rk, uint32_t& target_regnum);
- void
- SetStackFrame (StackFrame *frame);
-
//------------------------------------------------------------------
// lldb::ExecutionContextScope pure virtual functions
//------------------------------------------------------------------
@@ -172,8 +167,8 @@
//------------------------------------------------------------------
// Classes that inherit from RegisterContext can see and modify these
//------------------------------------------------------------------
- Thread &m_thread; // The thread that this register context belongs to.
- StackFrame *m_frame; // The stack frame for this context, or NULL if this is the root context
+ Thread &m_thread; // The thread that this register context belongs to.
+ uint32_t m_concrete_frame_idx; // The concrete frame index for this register context
private:
//------------------------------------------------------------------
// For RegisterContext only
Modified: lldb/trunk/include/lldb/Target/StackFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrame.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrame.h Thu Jan 6 16:15:06 2011
@@ -34,14 +34,14 @@
// Constructors and Destructors
//------------------------------------------------------------------
StackFrame (lldb::user_id_t frame_idx,
- lldb::user_id_t unwind_frame_idx,
+ lldb::user_id_t concrete_frame_idx,
Thread &thread,
lldb::addr_t cfa,
lldb::addr_t pc,
const SymbolContext *sc_ptr);
StackFrame (lldb::user_id_t frame_idx,
- lldb::user_id_t unwind_frame_idx,
+ lldb::user_id_t concrete_frame_idx,
Thread &thread,
const lldb::RegisterContextSP ®_context_sp,
lldb::addr_t cfa,
@@ -49,7 +49,7 @@
const SymbolContext *sc_ptr);
StackFrame (lldb::user_id_t frame_idx,
- lldb::user_id_t unwind_frame_idx,
+ lldb::user_id_t concrete_frame_idx,
Thread &thread,
const lldb::RegisterContextSP ®_context_sp,
lldb::addr_t cfa,
@@ -84,7 +84,7 @@
Block *
GetFrameBlock ();
- RegisterContext *
+ lldb::RegisterContextSP
GetRegisterContext ();
const lldb::RegisterContextSP &
@@ -121,9 +121,9 @@
}
uint32_t
- GetUnwindFrameIndex () const
+ GetConcreteFrameIndex () const
{
- return m_unwind_frame_index;
+ return m_concrete_frame_index;
}
lldb::ValueObjectSP
@@ -173,7 +173,7 @@
//------------------------------------------------------------------
Thread &m_thread;
uint32_t m_frame_index;
- uint32_t m_unwind_frame_index;
+ uint32_t m_concrete_frame_index;
lldb::RegisterContextSP m_reg_context_sp;
StackID m_id;
Address m_frame_code_addr; // The frame code address (might not be the same as the actual PC for inlined frames) as a section/offset address
Modified: lldb/trunk/include/lldb/Target/StackFrameList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrameList.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrameList.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrameList.h Thu Jan 6 16:15:06 2011
@@ -39,6 +39,9 @@
lldb::StackFrameSP
GetFrameAtIndex (uint32_t idx);
+ lldb::StackFrameSP
+ GetFrameWithConcreteFrameIndex (uint32_t unwind_idx);
+
// Mark a stack frame as the current frame
uint32_t
SetSelectedFrame (lldb_private::StackFrame *frame);
Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Thu Jan 6 16:15:06 2011
@@ -278,6 +278,9 @@
virtual lldb::StackFrameSP
GetStackFrameAtIndex (uint32_t idx);
+
+ virtual lldb::StackFrameSP
+ GetFrameWithConcreteFrameIndex (uint32_t unwind_idx);
uint32_t
GetSelectedFrameIndex ();
@@ -291,7 +294,7 @@
void
SetSelectedFrameByIndex (uint32_t frame_idx);
- virtual RegisterContext *
+ virtual lldb::RegisterContextSP
GetRegisterContext () = 0;
virtual bool
@@ -300,7 +303,7 @@
virtual bool
RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint) = 0;
- virtual RegisterContext *
+ virtual lldb::RegisterContextSP
CreateRegisterContextForFrame (StackFrame *frame) = 0;
virtual void
Modified: lldb/trunk/include/lldb/Target/Unwind.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Unwind.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Unwind.h (original)
+++ lldb/trunk/include/lldb/Target/Unwind.h Thu Jan 6 16:15:06 2011
@@ -46,7 +46,7 @@
lldb::addr_t& cfa,
lldb::addr_t& pc) = 0;
- virtual RegisterContext *
+ virtual lldb::RegisterContextSP
CreateRegisterContextForFrame (StackFrame *frame) = 0;
Thread &
Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Thu Jan 6 16:15:06 2011
@@ -426,7 +426,7 @@
case eValueTypeRegister: // stack frame register value
{
- RegisterContext *reg_ctx = m_opaque_sp->GetRegisterContext();
+ RegisterContextSP reg_ctx (m_opaque_sp->GetRegisterContext());
if (reg_ctx)
{
const uint32_t num_regs = reg_ctx->GetRegisterCount();
@@ -446,7 +446,7 @@
case eValueTypeRegisterSet: // A collection of stack frame register values
{
- RegisterContext *reg_ctx = m_opaque_sp->GetRegisterContext();
+ RegisterContextSP reg_ctx (m_opaque_sp->GetRegisterContext());
if (reg_ctx)
{
const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
@@ -640,7 +640,7 @@
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetThread().GetProcess().GetTarget().GetAPIMutex());
- RegisterContext *reg_ctx = m_opaque_sp->GetRegisterContext();
+ RegisterContextSP reg_ctx (m_opaque_sp->GetRegisterContext());
if (reg_ctx)
{
const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Thu Jan 6 16:15:06 2011
@@ -959,7 +959,7 @@
}
else if (::strncmp (var_name_begin, "reg.", strlen ("reg.")) == 0)
{
- reg_ctx = exe_ctx->frame->GetRegisterContext();
+ reg_ctx = exe_ctx->frame->GetRegisterContext().get();
if (reg_ctx)
{
var_name_begin += ::strlen ("reg.");
@@ -1100,7 +1100,7 @@
else
{
if (reg_ctx == NULL)
- reg_ctx = exe_ctx->frame->GetRegisterContext();
+ reg_ctx = exe_ctx->frame->GetRegisterContext().get();
if (reg_ctx)
{
Modified: lldb/trunk/source/Core/ValueObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectRegister.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectRegister.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectRegister.cpp Thu Jan 6 16:15:06 2011
@@ -29,7 +29,7 @@
#pragma mark ValueObjectRegisterContext
-ValueObjectRegisterContext::ValueObjectRegisterContext (ValueObject *parent, RegisterContext *reg_ctx) :
+ValueObjectRegisterContext::ValueObjectRegisterContext (ValueObject *parent, RegisterContextSP ®_ctx) :
ValueObject (parent),
m_reg_ctx (reg_ctx)
{
@@ -81,9 +81,9 @@
if (frame)
m_reg_ctx = frame->GetRegisterContext();
else
- m_reg_ctx = NULL;
+ m_reg_ctx.reset();
- SetValueIsValid (m_reg_ctx != NULL);
+ SetValueIsValid (m_reg_ctx.get() != NULL);
}
ValueObjectSP
@@ -101,7 +101,7 @@
#pragma mark -
#pragma mark ValueObjectRegisterSet
-ValueObjectRegisterSet::ValueObjectRegisterSet (ValueObject *parent, RegisterContext *reg_ctx, uint32_t reg_set_idx) :
+ValueObjectRegisterSet::ValueObjectRegisterSet (ValueObject *parent, lldb::RegisterContextSP ®_ctx, uint32_t reg_set_idx) :
ValueObject (parent),
m_reg_ctx (reg_ctx),
m_reg_set (NULL),
@@ -159,7 +159,7 @@
SetValueDidChange (false);
StackFrame *frame = exe_scope->CalculateStackFrame();
if (frame == NULL)
- m_reg_ctx = NULL;
+ m_reg_ctx.reset();
else
{
m_reg_ctx = frame->GetRegisterContext ();
@@ -167,7 +167,7 @@
{
const RegisterSet *reg_set = m_reg_ctx->GetRegisterSet (m_reg_set_idx);
if (reg_set == NULL)
- m_reg_ctx = NULL;
+ m_reg_ctx.reset();
else if (m_reg_set != reg_set)
{
SetValueDidChange (true);
@@ -204,7 +204,7 @@
#pragma mark -
#pragma mark ValueObjectRegister
-ValueObjectRegister::ValueObjectRegister (ValueObject *parent, RegisterContext *reg_ctx, uint32_t reg_num) :
+ValueObjectRegister::ValueObjectRegister (ValueObject *parent, lldb::RegisterContextSP ®_ctx, uint32_t reg_num) :
ValueObject (parent),
m_reg_ctx (reg_ctx),
m_reg_info (NULL),
@@ -310,7 +310,7 @@
}
else
{
- m_reg_ctx = NULL;
+ m_reg_ctx.reset();
m_reg_info = NULL;
}
Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Thu Jan 6 16:15:06 2011
@@ -846,7 +846,7 @@
std::vector stack;
if (reg_ctx == NULL && exe_ctx && exe_ctx->frame)
- reg_ctx = exe_ctx->frame->GetRegisterContext();
+ reg_ctx = exe_ctx->frame->GetRegisterContext().get();
if (initial_value_ptr)
stack.push_back(*initial_value_ptr);
Modified: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Thu Jan 6 16:15:06 2011
@@ -61,7 +61,7 @@
lldb::addr_t *this_arg,
lldb::addr_t *cmd_arg) const
{
- RegisterContext *reg_ctx = thread.GetRegisterContext();
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
return false;
#define CHAIN_EBP
@@ -154,7 +154,7 @@
lldb::addr_t returnAddress,
ValueList &args) const
{
- RegisterContext *reg_ctx = thread.GetRegisterContext();
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
return false;
Error error;
@@ -422,7 +422,7 @@
// Get the pointer to the first stack argument so we have a place to start
// when reading data
- RegisterContext *reg_ctx = thread.GetRegisterContext();
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
return false;
@@ -498,7 +498,7 @@
// Get the pointer to the first stack argument so we have a place to start
// when reading data
- RegisterContext *reg_ctx = thread.GetRegisterContext();
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
void *value_type = value.GetClangType();
bool is_signed;
Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Thu Jan 6 16:15:06 2011
@@ -76,7 +76,7 @@
cmd_arg,
cmd_arg ? (uint64_t)*cmd_arg : (uint64_t)0);
- RegisterContext *reg_ctx = thread.GetRegisterContext();
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
return false;
@@ -293,7 +293,7 @@
// Extract the register context so we can read arguments from registers
- RegisterContext *reg_ctx = thread.GetRegisterContext();
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
return false;
@@ -382,7 +382,7 @@
void *value_type = value.GetClangType();
bool is_signed;
- RegisterContext *reg_ctx = thread.GetRegisterContext();
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
return false;
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext.h Thu Jan 6 16:15:06 2011
@@ -28,7 +28,7 @@
{
}
- virtual lldb_private::RegisterContext *
+ virtual lldb::RegisterContextSP
CreateRegisterContext (lldb_private::StackFrame *frame) const = 0;
virtual void InitializeInstance() = 0;
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp Thu Jan 6 16:15:06 2011
@@ -71,17 +71,18 @@
{
}
-RegisterContext *
+lldb::RegisterContextSP
MachThreadContext_arm::CreateRegisterContext (StackFrame *frame) const
{
- return new RegisterContextMach_arm(m_thread, frame);
+ lldb::RegisterContextSP reg_ctx_sp (new RegisterContextMach_arm(m_thread, frame->GetConcreteFrameIndex()));
+ return reg_ctx_sp;
}
// Instance init function
void
MachThreadContext_arm::InitializeInstance()
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx != NULL);
const RegisterInfo * reg_info;
reg_info = reg_ctx->GetRegisterInfoByName ("bvr0");
@@ -342,7 +343,7 @@
if (m_bvr0_reg == LLDB_INVALID_REGNUM || m_bcr0_reg == LLDB_INVALID_REGNUM)
return KERN_INVALID_ARGUMENT;
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
uint32_t bvr = 0;
uint32_t bcr = 0;
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.h Thu Jan 6 16:15:06 2011
@@ -31,7 +31,7 @@
virtual
~MachThreadContext_arm();
- virtual lldb_private::RegisterContext *
+ virtual lldb::RegisterContextSP
CreateRegisterContext (lldb_private::StackFrame *frame) const;
virtual void
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp Thu Jan 6 16:15:06 2011
@@ -50,7 +50,7 @@
void
MachThreadContext_i386::InitializeInstance()
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx != NULL);
m_flags_reg = reg_ctx->ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FLAGS);
}
@@ -91,7 +91,7 @@
case EXC_BREAKPOINT:
if (exc.exc_data.size() >= 2 && exc.exc_data[0] == 2)
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx);
lldb::addr_t pc = reg_ctx->GetPC(LLDB_INVALID_ADDRESS);
if (pc != LLDB_INVALID_ADDRESS && pc > 0)
@@ -152,10 +152,11 @@
// return KERN_INVALID_ARGUMENT;
//}
-RegisterContext *
+RegisterContextSP
MachThreadContext_i386::CreateRegisterContext (StackFrame *frame) const
{
- return new RegisterContextMach_i386(m_thread, frame);
+ lldb::RegisterContextSP reg_ctx_sp (new RegisterContextMach_i386(m_thread, frame->GetConcreteFrameIndex()));
+ return reg_ctx_sp;
}
@@ -172,7 +173,7 @@
uint32_t pc;
};
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx);
Frame_i386 frame = { reg_ctx->GetFP(0), reg_ctx->GetPC(LLDB_INVALID_ADDRESS) };
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.h Thu Jan 6 16:15:06 2011
@@ -30,7 +30,7 @@
virtual
~MachThreadContext_i386();
- virtual lldb_private::RegisterContext *
+ virtual lldb::RegisterContextSP
CreateRegisterContext (lldb_private::StackFrame *frame) const;
virtual void InitializeInstance();
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp Thu Jan 6 16:15:06 2011
@@ -49,7 +49,7 @@
void
MachThreadContext_x86_64::InitializeInstance()
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx != NULL);
m_flags_reg = reg_ctx->ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FLAGS);
}
@@ -90,7 +90,7 @@
case EXC_BREAKPOINT:
if (exc.exc_data.size() >= 2 && exc.exc_data[0] == 2)
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx);
lldb::addr_t pc = reg_ctx->GetPC(LLDB_INVALID_ADDRESS);
if (pc != LLDB_INVALID_ADDRESS && pc > 0)
@@ -158,10 +158,11 @@
-RegisterContext *
+RegisterContextSP
MachThreadContext_x86_64::CreateRegisterContext (StackFrame *frame) const
{
- return new RegisterContextMach_x86_64(m_thread, frame);
+ lldb::RegisterContextSP reg_ctx_sp (new RegisterContextMach_x86_64(m_thread, frame->GetConcreteFrameIndex()));
+ return reg_ctx_sp;
}
@@ -185,7 +186,7 @@
uint64_t pc;
};
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx);
Frame_x86_64 frame = { reg_ctx->GetFP(0), reg_ctx->GetPC(LLDB_INVALID_ADDRESS) };
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.h Thu Jan 6 16:15:06 2011
@@ -36,7 +36,7 @@
virtual
~MachThreadContext_x86_64();
- virtual lldb_private::RegisterContext *
+ virtual lldb::RegisterContextSP
CreateRegisterContext (lldb_private::StackFrame *frame) const;
virtual void
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.cpp Thu Jan 6 16:15:06 2011
@@ -157,8 +157,8 @@
};
-RegisterContextMach_arm::RegisterContextMach_arm(Thread &thread, StackFrame *frame) :
- RegisterContext(thread, frame),
+RegisterContextMach_arm::RegisterContextMach_arm(Thread &thread, uint32_t concrete_frame_idx) :
+ RegisterContext(thread, concrete_frame_idx),
gpr(),
fpu(),
exc()
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_arm.h Thu Jan 6 16:15:06 2011
@@ -54,7 +54,7 @@
{
public:
- RegisterContextMach_arm(lldb_private::Thread &thread, lldb_private::StackFrame *frame);
+ RegisterContextMach_arm(lldb_private::Thread &thread, uint32_t concrete_frame_idx);
virtual
~RegisterContextMach_arm();
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.cpp Thu Jan 6 16:15:06 2011
@@ -183,8 +183,8 @@
gdb_mm7 = 48
};
-RegisterContextMach_i386::RegisterContextMach_i386 (Thread &thread, StackFrame *frame) :
- RegisterContext(thread, frame),
+RegisterContextMach_i386::RegisterContextMach_i386 (Thread &thread, uint32_t concrete_frame_idx) :
+ RegisterContext(thread, concrete_frame_idx),
gpr(),
fpu(),
exc()
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_i386.h Thu Jan 6 16:15:06 2011
@@ -22,7 +22,7 @@
public:
RegisterContextMach_i386(lldb_private::Thread &thread,
- lldb_private::StackFrame *frame);
+ uint32_t concrete_frame_idx);
virtual
~RegisterContextMach_i386();
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.cpp Thu Jan 6 16:15:06 2011
@@ -206,8 +206,8 @@
gdb_fpu_mxcsr = 56,
};
-RegisterContextMach_x86_64::RegisterContextMach_x86_64 (Thread &thread, StackFrame *frame) :
- RegisterContext (thread, frame),
+RegisterContextMach_x86_64::RegisterContextMach_x86_64 (Thread &thread, uint32_t concrete_frame_idx) :
+ RegisterContext (thread, concrete_frame_idx),
gpr(),
fpu(),
exc()
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/RegisterContextMach_x86_64.h Thu Jan 6 16:15:06 2011
@@ -21,7 +21,7 @@
{
public:
RegisterContextMach_x86_64 (lldb_private::Thread &thread,
- lldb_private::StackFrame *frame);
+ uint32_t concrete_frame_idx);
virtual
~RegisterContextMach_x86_64();
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp Thu Jan 6 16:15:06 2011
@@ -444,7 +444,7 @@
default: thread_run_state = "???"; break;
}
- RegisterContext *reg_context = GetRegisterContext();
+ RegisterContext *reg_context = GetRegisterContext().get();
log->Printf ("thread[%u] %4.4x (%u): pc: 0x%8.8llx sp: 0x%8.8llx breakID: %d user: %d.%06.6d system: %d.%06.6d cpu: %d policy: %d run_state: %d (%s) flags: %d suspend_count: %d (current %d) sleep_time: %d",
index,
GetID (),
@@ -597,15 +597,15 @@
return true;
}
-RegisterContext *
+RegisterContextSP
ThreadMacOSX::GetRegisterContext ()
{
if (m_reg_context_sp.get() == NULL)
- m_reg_context_sp.reset (CreateRegisterContextForFrame (NULL));
- return m_reg_context_sp.get();
+ m_reg_context_sp = CreateRegisterContextForFrame (NULL);
+ return m_reg_context_sp;
}
-RegisterContext *
+RegisterContextSP
ThreadMacOSX::CreateRegisterContextForFrame (StackFrame *frame)
{
return m_context->CreateRegisterContext (frame);
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.h Thu Jan 6 16:15:06 2011
@@ -39,10 +39,10 @@
virtual const char *
GetName ();
- virtual lldb_private::RegisterContext *
+ virtual lldb::RegisterContextSP
GetRegisterContext ();
- virtual lldb_private::RegisterContext *
+ virtual lldb::RegisterContextSP
CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
virtual bool
Modified: lldb/trunk/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp Thu Jan 6 16:15:06 2011
@@ -56,7 +56,7 @@
return;
- RegisterContext *rctx = thread.GetRegisterContext();
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
const RegisterInfo *ri;
const char *x86_64_regnames[] = { "rbx",
@@ -91,7 +91,7 @@
for (int i = 0; i < namecount; i++)
{
- ri = rctx->GetRegisterInfoByName (names[i]);
+ ri = reg_ctx->GetRegisterInfoByName (names[i]);
if (ri)
m_non_volatile_regs.insert (ri->kinds[eRegisterKindLLDB]);
}
Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Thu Jan 6 16:15:06 2011
@@ -31,19 +31,32 @@
using namespace lldb_private;
-RegisterContextLLDB::RegisterContextLLDB (Thread& thread,
- const RegisterContextSP &next_frame,
- SymbolContext& sym_ctx,
- int frame_number) :
- RegisterContext (thread), m_thread(thread), m_next_frame(next_frame),
- m_sym_ctx(sym_ctx), m_all_registers_available(false), m_registers(),
- m_cfa (LLDB_INVALID_ADDRESS), m_start_pc (), m_current_pc (), m_frame_number (frame_number),
- m_full_unwind_plan(NULL), m_fast_unwind_plan(NULL), m_base_reg_ctx (), m_frame_type (-1),
- m_current_offset (0), m_current_offset_backed_up_one (0), m_sym_ctx_valid (false)
+RegisterContextLLDB::RegisterContextLLDB
+(
+ Thread& thread,
+ const RegisterContextSP &next_frame,
+ SymbolContext& sym_ctx,
+ uint32_t frame_number
+) :
+ RegisterContext (thread, frame_number),
+ m_thread(thread),
+ m_next_frame(next_frame),
+ m_sym_ctx(sym_ctx),
+ m_all_registers_available(false),
+ m_registers(),
+ m_cfa (LLDB_INVALID_ADDRESS),
+ m_start_pc (),
+ m_current_pc (),
+ m_frame_number (frame_number),
+ m_full_unwind_plan(NULL),
+ m_fast_unwind_plan(NULL),
+ m_frame_type (-1),
+ m_current_offset (0),
+ m_current_offset_backed_up_one (0),
+ m_sym_ctx_valid (false)
{
m_sym_ctx.Clear();
m_sym_ctx_valid = false;
- m_base_reg_ctx = m_thread.GetRegisterContext();
if (IsFrameZero ())
{
@@ -81,7 +94,8 @@
RegisterContextLLDB::InitializeZerothFrame()
{
StackFrameSP frame_sp (m_thread.GetStackFrameAtIndex (0));
- if (m_base_reg_ctx == NULL)
+
+ if (m_thread.GetRegisterContext() == NULL)
{
m_frame_type = eNotAValidFrame;
return;
@@ -160,7 +174,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d could not find a valid cfa address",
+ log->Printf("%*sFrame %u could not find a valid cfa address",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
}
m_frame_type = eNotAValidFrame;
@@ -169,7 +183,7 @@
if (log)
{
- log->Printf("%*sThread %d Frame %d initialized frame current pc is 0x%llx cfa is 0x%llx using %s UnwindPlan",
+ log->Printf("%*sThread %d Frame %u initialized frame current pc is 0x%llx cfa is 0x%llx using %s UnwindPlan",
m_frame_number < 100 ? m_frame_number : 100, "", m_thread.GetIndexID(), m_frame_number,
(uint64_t) m_current_pc.GetLoadAddress (&m_thread.GetProcess().GetTarget()), (uint64_t) m_cfa,
m_full_unwind_plan->GetSourceName().GetCString());
@@ -193,7 +207,7 @@
m_frame_type = eNotAValidFrame;
return;
}
- if (m_base_reg_ctx == NULL)
+ if (m_thread.GetRegisterContext() == NULL)
{
m_frame_type = eNotAValidFrame;
return;
@@ -204,7 +218,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d could not get pc value",
+ log->Printf("%*sFrame %u could not get pc value",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
}
m_frame_type = eNotAValidFrame;
@@ -224,7 +238,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d using architectural default unwind method",
+ log->Printf("%*sFrame %u using architectural default unwind method",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
}
ArchSpec arch = m_thread.GetProcess().GetTarget().GetArchitecture ();
@@ -245,7 +259,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d failed to get cfa value",
+ log->Printf("%*sFrame %u failed to get cfa value",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
}
m_frame_type = eNormalFrame;
@@ -258,7 +272,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d could not find a valid cfa address",
+ log->Printf("%*sFrame %u could not find a valid cfa address",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
}
m_frame_type = eNotAValidFrame;
@@ -267,7 +281,7 @@
if (log)
{
- log->Printf("%*sFrame %d initialized frame cfa is 0x%llx",
+ log->Printf("%*sFrame %u initialized frame cfa is 0x%llx",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
(uint64_t) m_cfa);
}
@@ -392,7 +406,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d failed to get cfa reg %d/%d",
+ log->Printf("%*sFrame %u failed to get cfa reg %d/%d",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
row_register_kind, active_row->GetCFARegister());
}
@@ -408,7 +422,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d could not find a valid cfa address",
+ log->Printf("%*sFrame %u could not find a valid cfa address",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
}
m_frame_type = eNotAValidFrame;
@@ -417,7 +431,7 @@
if (log)
{
- log->Printf("%*sFrame %d initialized frame current pc is 0x%llx cfa is 0x%llx",
+ log->Printf("%*sFrame %u initialized frame current pc is 0x%llx cfa is 0x%llx",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
(uint64_t) m_current_pc.GetLoadAddress (&m_thread.GetProcess().GetTarget()), (uint64_t) m_cfa);
}
@@ -478,7 +492,7 @@
const char *has_fast = "";
if (m_fast_unwind_plan)
has_fast = ", and has a fast UnwindPlan";
- log->Printf("%*sFrame %d frame has a fast UnwindPlan",
+ log->Printf("%*sFrame %u frame has a fast UnwindPlan",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
}
m_frame_type = eNormalFrame;
@@ -570,7 +584,7 @@
{
if (log && IsLogVerbose())
{
- log->Printf("%*sFrame %d frame uses %s for full UnwindPlan",
+ log->Printf("%*sFrame %u frame uses %s for full UnwindPlan",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
up->GetSourceName().GetCString());
}
@@ -583,7 +597,7 @@
{
if (log && IsLogVerbose())
{
- log->Printf("%*sFrame %d frame uses %s for full UnwindPlan",
+ log->Printf("%*sFrame %u frame uses %s for full UnwindPlan",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
up->GetSourceName().GetCString());
}
@@ -597,7 +611,7 @@
{
if (log && IsLogVerbose())
{
- log->Printf("%*sFrame %d frame uses %s for full UnwindPlan",
+ log->Printf("%*sFrame %u frame uses %s for full UnwindPlan",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
up->GetSourceName().GetCString());
}
@@ -607,7 +621,7 @@
// If nothing else, use the architectural default UnwindPlan and hope that does the job.
if (log && IsLogVerbose())
{
- log->Printf("%*sFrame %d frame uses %s for full UnwindPlan",
+ log->Printf("%*sFrame %u frame uses %s for full UnwindPlan",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
arch_default_up->GetSourceName().GetCString());
}
@@ -624,31 +638,31 @@
size_t
RegisterContextLLDB::GetRegisterCount ()
{
- return m_base_reg_ctx->GetRegisterCount();
+ return m_thread.GetRegisterContext()->GetRegisterCount();
}
const RegisterInfo *
RegisterContextLLDB::GetRegisterInfoAtIndex (uint32_t reg)
{
- return m_base_reg_ctx->GetRegisterInfoAtIndex (reg);
+ return m_thread.GetRegisterContext()->GetRegisterInfoAtIndex (reg);
}
size_t
RegisterContextLLDB::GetRegisterSetCount ()
{
- return m_base_reg_ctx->GetRegisterSetCount ();
+ return m_thread.GetRegisterContext()->GetRegisterSetCount ();
}
const RegisterSet *
RegisterContextLLDB::GetRegisterSet (uint32_t reg_set)
{
- return m_base_reg_ctx->GetRegisterSet (reg_set);
+ return m_thread.GetRegisterContext()->GetRegisterSet (reg_set);
}
uint32_t
RegisterContextLLDB::ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num)
{
- return m_base_reg_ctx->ConvertRegisterKindToRegisterNumber (kind, num);
+ return m_thread.GetRegisterContext()->ConvertRegisterKindToRegisterNumber (kind, num);
}
bool
@@ -663,7 +677,7 @@
data.SetByteOrder (m_thread.GetProcess().GetByteOrder());
if (IsFrameZero ())
{
- return m_base_reg_ctx->ReadRegisterBytes (regloc.location.register_number, data);
+ return m_thread.GetRegisterContext()->ReadRegisterBytes (regloc.location.register_number, data);
}
else
{
@@ -683,7 +697,7 @@
assert ("Unknown RegisterLocation type.");
}
- const RegisterInfo *reg_info = m_base_reg_ctx->GetRegisterInfoAtIndex (regnum);
+ const RegisterInfo *reg_info = m_thread.GetRegisterContext()->GetRegisterInfoAtIndex (regnum);
DataBufferSP data_sp (new DataBufferHeap (reg_info->byte_size, 0));
data.SetData (data_sp, 0, reg_info->byte_size);
data.SetAddressByteSize (m_thread.GetProcess().GetAddressByteSize());
@@ -743,7 +757,7 @@
{
if (IsFrameZero ())
{
- return m_base_reg_ctx->WriteRegisterBytes (regloc.location.register_number, data, data_offset);
+ return m_thread.GetRegisterContext()->WriteRegisterBytes (regloc.location.register_number, data, data_offset);
}
else
{
@@ -768,7 +782,7 @@
}
Error error;
- const RegisterInfo *reg_info = m_base_reg_ctx->GetRegisterInfoAtIndex (regnum);
+ const RegisterInfo *reg_info = m_thread.GetRegisterContext()->GetRegisterInfoAtIndex (regnum);
if (reg_info->byte_size == 0)
return false;
uint8_t *buf = (uint8_t*) alloca (reg_info->byte_size);
@@ -809,7 +823,7 @@
// Are we looking for the CALLER's stack pointer? The stack pointer is defined to be the same as THIS frame's
// CFA so just return the CFA value. This is true on x86-32/x86-64 at least.
uint32_t sp_regnum;
- if (m_base_reg_ctx->ConvertBetweenRegisterKinds (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP, eRegisterKindLLDB, sp_regnum)
+ if (m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP, eRegisterKindLLDB, sp_regnum)
&& sp_regnum == lldb_regnum)
{
// make sure we won't lose precision copying an addr_t (m_cfa) into a uint64_t (.register_value)
@@ -831,11 +845,11 @@
const UnwindPlan::Row *active_row = m_fast_unwind_plan->GetRowForFunctionOffset (m_current_offset);
unwindplan_registerkind = m_fast_unwind_plan->GetRegisterKind ();
uint32_t row_regnum;
- if (!m_base_reg_ctx->ConvertBetweenRegisterKinds (eRegisterKindLLDB, lldb_regnum, unwindplan_registerkind, row_regnum))
+ if (!m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindLLDB, lldb_regnum, unwindplan_registerkind, row_regnum))
{
if (log)
{
- log->Printf("%*sFrame %d could not convert lldb regnum %d into %d RegisterKind reg numbering scheme",
+ log->Printf("%*sFrame %u could not convert lldb regnum %d into %d RegisterKind reg numbering scheme",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum, (int) unwindplan_registerkind);
}
@@ -845,7 +859,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d supplying caller's saved reg %d's location using FastUnwindPlan",
+ log->Printf("%*sFrame %u supplying caller's saved reg %d's location using FastUnwindPlan",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
}
@@ -865,16 +879,16 @@
const UnwindPlan::Row *active_row = m_full_unwind_plan->GetRowForFunctionOffset (m_current_offset);
unwindplan_registerkind = m_full_unwind_plan->GetRegisterKind ();
uint32_t row_regnum;
- if (!m_base_reg_ctx->ConvertBetweenRegisterKinds (eRegisterKindLLDB, lldb_regnum, unwindplan_registerkind, row_regnum))
+ if (!m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindLLDB, lldb_regnum, unwindplan_registerkind, row_regnum))
{
if (log)
{
if (unwindplan_registerkind == eRegisterKindGeneric)
- log->Printf("%*sFrame %d could not convert lldb regnum %d into eRegisterKindGeneric reg numbering scheme",
+ log->Printf("%*sFrame %u could not convert lldb regnum %d into eRegisterKindGeneric reg numbering scheme",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
else
- log->Printf("%*sFrame %d could not convert lldb regnum %d into %d RegisterKind reg numbering scheme",
+ log->Printf("%*sFrame %u could not convert lldb regnum %d into %d RegisterKind reg numbering scheme",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum, (int) unwindplan_registerkind);
}
@@ -886,7 +900,7 @@
have_unwindplan_regloc = true;
if (log && IsLogVerbose ())
{
- log->Printf("%*sFrame %d supplying caller's saved reg %d's location using %s UnwindPlan",
+ log->Printf("%*sFrame %u supplying caller's saved reg %d's location using %s UnwindPlan",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum, m_full_unwind_plan->GetSourceName().GetCString());
}
@@ -904,7 +918,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d did not supply reg location for %d because it is volatile",
+ log->Printf("%*sFrame %u did not supply reg location for %d because it is volatile",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
}
@@ -927,7 +941,7 @@
}
if (log)
{
- log->Printf("%*sFrame %d could not supply caller's reg %d location",
+ log->Printf("%*sFrame %u could not supply caller's reg %d location",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
}
@@ -942,7 +956,7 @@
m_registers[lldb_regnum] = new_regloc;
if (log)
{
- log->Printf("%*sFrame %d could not supply caller's reg %d location",
+ log->Printf("%*sFrame %u could not supply caller's reg %d location",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
}
@@ -959,7 +973,7 @@
{
if (log)
{
- log->Printf("%*sFrame %d could not supply caller's reg %d location",
+ log->Printf("%*sFrame %u could not supply caller's reg %d location",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
}
@@ -989,11 +1003,11 @@
{
uint32_t unwindplan_regnum = unwindplan_regloc.GetRegisterNumber();
uint32_t row_regnum_in_lldb;
- if (!m_base_reg_ctx->ConvertBetweenRegisterKinds (unwindplan_registerkind, unwindplan_regnum, eRegisterKindLLDB, row_regnum_in_lldb))
+ if (!m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (unwindplan_registerkind, unwindplan_regnum, eRegisterKindLLDB, row_regnum_in_lldb))
{
if (log)
{
- log->Printf("%*sFrame %d could not supply caller's reg %d location",
+ log->Printf("%*sFrame %u could not supply caller's reg %d location",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
}
@@ -1036,7 +1050,7 @@
}
if (log)
{
- log->Printf("%*sFrame %d tried to use IsDWARFExpression or IsAtDWARFExpression for reg %d but failed",
+ log->Printf("%*sFrame %u tried to use IsDWARFExpression or IsAtDWARFExpression for reg %d but failed",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
}
@@ -1045,7 +1059,7 @@
if (log)
{
- log->Printf("%*sFrame %d could not supply caller's reg %d location",
+ log->Printf("%*sFrame %u could not supply caller's reg %d location",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_regnum);
}
@@ -1069,7 +1083,6 @@
// and this RegisterContext is for frame 1 (bar) - if we want to get the pc value for frame 1, we need to ask
// where frame 0 (the "next" frame) saved that and retrieve the value.
-// Assumes m_base_reg_ctx has been set
bool
RegisterContextLLDB::ReadGPRValue (int register_kind, uint32_t regnum, addr_t &value)
{
@@ -1081,7 +1094,7 @@
{
lldb_regnum = regnum;
}
- else if (!m_base_reg_ctx->ConvertBetweenRegisterKinds (register_kind, regnum, eRegisterKindLLDB, lldb_regnum))
+ else if (!m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (register_kind, regnum, eRegisterKindLLDB, lldb_regnum))
{
return false;
}
@@ -1094,7 +1107,7 @@
// if this is frame 0 (currently executing frame), get the requested reg contents from the actual thread registers
if (IsFrameZero ())
{
- if (m_base_reg_ctx->ReadRegisterBytes (lldb_regnum, data))
+ if (m_thread.GetRegisterContext()->ReadRegisterBytes (lldb_regnum, data))
{
data.SetAddressByteSize (m_thread.GetProcess().GetAddressByteSize());
value = data.GetAddress (&offset);
@@ -1131,7 +1144,7 @@
if (log && IsLogVerbose ())
{
- log->Printf("%*sFrame %d looking for register saved location for reg %d",
+ log->Printf("%*sFrame %u looking for register saved location for reg %d",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_reg);
}
@@ -1141,11 +1154,11 @@
{
if (log)
{
- log->Printf("%*sFrame %d passing along to the live register context for reg %d",
+ log->Printf("%*sFrame %u passing along to the live register context for reg %d",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_reg);
}
- return m_base_reg_ctx->ReadRegisterBytes (lldb_reg, data);
+ return m_thread.GetRegisterContext()->ReadRegisterBytes (lldb_reg, data);
}
RegisterLocation regloc;
@@ -1165,7 +1178,7 @@
if (log && IsLogVerbose ())
{
- log->Printf("%*sFrame %d looking for register saved location for reg %d",
+ log->Printf("%*sFrame %u looking for register saved location for reg %d",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_reg);
}
@@ -1175,11 +1188,11 @@
{
if (log)
{
- log->Printf("%*sFrame %d passing along to the live register context for reg %d",
+ log->Printf("%*sFrame %u passing along to the live register context for reg %d",
m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number,
lldb_reg);
}
- return m_base_reg_ctx->WriteRegisterBytes (lldb_reg, data, data_offset);
+ return m_thread.GetRegisterContext()->WriteRegisterBytes (lldb_reg, data, data_offset);
}
RegisterLocation regloc;
Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h Thu Jan 6 16:15:06 2011
@@ -23,7 +23,7 @@
RegisterContextLLDB (lldb_private::Thread &thread,
const lldb::RegisterContextSP& next_frame,
lldb_private::SymbolContext& sym_ctx,
- int frame_number);
+ uint32_t frame_number);
///
// pure virtual functions from the base class that we must implement
@@ -156,8 +156,6 @@
lldb_private::Thread& m_thread;
lldb::RegisterContextSP m_next_frame;
- lldb_private::RegisterContext *m_base_reg_ctx; // RegisterContext of frame 0 (live register values only)
-
///
// The following tell us how to retrieve the CALLER's register values (ie the "previous" frame, aka the frame above)
// i.e. where THIS frame saved them
@@ -186,7 +184,7 @@
lldb_private::SymbolContext& m_sym_ctx;
bool m_sym_ctx_valid; // if ResolveSymbolContextForAddress fails, don't try to use m_sym_ctx
- int m_frame_number; // What stack frame level this frame is - used for debug logging
+ uint32_t m_frame_number; // What stack frame level this frame is - used for debug logging
std::map m_registers; // where to find reg values for this frame
Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp Thu Jan 6 16:15:06 2011
@@ -29,10 +29,10 @@
RegisterContextMacOSXFrameBackchain::RegisterContextMacOSXFrameBackchain
(
Thread &thread,
- StackFrame *frame,
+ uint32_t concrete_frame_idx,
const UnwindMacOSXFrameBackchain::Cursor &cursor
) :
- RegisterContext (thread, frame),
+ RegisterContext (thread, concrete_frame_idx),
m_cursor (cursor),
m_cursor_is_valid (true)
{
Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h Thu Jan 6 16:15:06 2011
@@ -26,7 +26,7 @@
// Constructors and Destructors
//------------------------------------------------------------------
RegisterContextMacOSXFrameBackchain (lldb_private::Thread &thread,
- lldb_private::StackFrame *frame,
+ uint32_t concrete_frame_idx,
const UnwindMacOSXFrameBackchain::Cursor &cursor);
virtual
Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp Thu Jan 6 16:15:06 2011
@@ -197,8 +197,8 @@
if (m_thread && *initialized_flag == 0)
{
- RegisterContext *rctx = m_thread->GetRegisterContext();
- if (rctx)
+ RegisterContext *reg_ctx = m_thread->GetRegisterContext().get();
+ if (reg_ctx)
{
struct regmap_ent *ent;
int count, i;
@@ -214,7 +214,7 @@
}
for (i = 0; i < count; i++, ent++)
{
- const RegisterInfo *ri = rctx->GetRegisterInfoByName (ent->name);
+ const RegisterInfo *ri = reg_ctx->GetRegisterInfoByName (ent->name);
if (ri)
ent->lldb_regno = ri->kinds[eRegisterKindLLDB];
}
Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp Thu Jan 6 16:15:06 2011
@@ -47,26 +47,22 @@
// First, set up the 0th (initial) frame
CursorSP first_cursor_sp(new Cursor ());
RegisterContextSP no_frame;
- RegisterContextLLDB *first_register_ctx = new RegisterContextLLDB(m_thread, no_frame, first_cursor_sp->sctx, 0);
- if (!first_register_ctx->IsValid())
- {
- delete first_register_ctx;
+ std::auto_ptr first_register_ctx_ap (new RegisterContextLLDB(m_thread, no_frame, first_cursor_sp->sctx, 0));
+ if (first_register_ctx_ap.get() == NULL)
return false;
- }
- if (!first_register_ctx->GetCFA (first_cursor_sp->cfa))
- {
- delete first_register_ctx;
+
+ if (!first_register_ctx_ap->IsValid())
return false;
- }
- if (!first_register_ctx->GetPC (first_cursor_sp->start_pc))
- {
- delete first_register_ctx;
+
+ if (!first_register_ctx_ap->GetCFA (first_cursor_sp->cfa))
return false;
- }
- // Reuse the StackFrame provided by the processor native machine context for the first frame
- first_register_ctx->SetStackFrame (m_thread.GetStackFrameAtIndex(0).get());
- RegisterContextSP first_register_ctx_sp(first_register_ctx);
- first_cursor_sp->reg_ctx = first_register_ctx_sp;
+
+ if (!first_register_ctx_ap->GetPC (first_cursor_sp->start_pc))
+ return false;
+
+ // Everything checks out, so release the auto pointer value and let the
+ // cursor own it in its shared pointer
+ first_cursor_sp->reg_ctx.reset(first_register_ctx_ap.release());
m_frames.push_back (first_cursor_sp);
return true;
}
@@ -77,18 +73,21 @@
{
LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND));
CursorSP cursor_sp(new Cursor ());
- RegisterContextLLDB *register_ctx;
// Frame zero is a little different
if (m_frames.size() == 0)
return false;
uint32_t cur_idx = m_frames.size ();
- register_ctx = new RegisterContextLLDB (m_thread, m_frames[cur_idx - 1]->reg_ctx, cursor_sp->sctx, cur_idx);
+ std::auto_ptr register_ctx_ap(new RegisterContextLLDB (m_thread,
+ m_frames[cur_idx - 1]->reg_ctx,
+ cursor_sp->sctx,
+ cur_idx));
+ if (register_ctx_ap.get() == NULL)
+ return false;
- if (!register_ctx->IsValid())
+ if (!register_ctx_ap->IsValid())
{
- delete register_ctx;
if (log)
{
log->Printf("%*sFrame %d invalid RegisterContext for this frame, stopping stack walk",
@@ -96,9 +95,8 @@
}
return false;
}
- if (!register_ctx->GetCFA (cursor_sp->cfa))
+ if (!register_ctx_ap->GetCFA (cursor_sp->cfa))
{
- delete register_ctx;
if (log)
{
log->Printf("%*sFrame %d did not get CFA for this frame, stopping stack walk",
@@ -108,7 +106,6 @@
}
if (cursor_sp->cfa == (addr_t) -1 || cursor_sp->cfa == 1 || cursor_sp->cfa == 0)
{
- delete register_ctx;
if (log)
{
log->Printf("%*sFrame %d did not get a valid CFA for this frame, stopping stack walk",
@@ -116,9 +113,8 @@
}
return false;
}
- if (!register_ctx->GetPC (cursor_sp->start_pc))
+ if (!register_ctx_ap->GetPC (cursor_sp->start_pc))
{
- delete register_ctx;
if (log)
{
log->Printf("%*sFrame %d did not get PC for this frame, stopping stack walk",
@@ -126,9 +122,7 @@
}
return false;
}
- RegisterContextSP register_ctx_sp(register_ctx);
- StackFrame *frame = new StackFrame(cur_idx, cur_idx, m_thread, register_ctx_sp, cursor_sp->cfa, cursor_sp->start_pc, &(cursor_sp->sctx));
- register_ctx->SetStackFrame (frame);
+ RegisterContextSP register_ctx_sp(register_ctx_ap.release());
cursor_sp->reg_ctx = register_ctx_sp;
m_frames.push_back (cursor_sp);
return true;
@@ -155,9 +149,10 @@
return false;
}
-RegisterContext *
+lldb::RegisterContextSP
UnwindLLDB::CreateRegisterContextForFrame (StackFrame *frame)
{
+ lldb::RegisterContextSP reg_ctx_sp;
uint32_t idx = frame->GetFrameIndex ();
if (idx == 0)
@@ -168,13 +163,13 @@
if (m_frames.size() == 0)
{
if (!AddFirstFrame())
- return NULL;
+ return reg_ctx_sp;
}
while (idx >= m_frames.size() && AddOneMoreFrame ())
;
if (idx < m_frames.size ())
- return m_frames[idx]->reg_ctx.get();
- return NULL;
+ reg_ctx_sp = m_frames[idx]->reg_ctx;
+ return reg_ctx_sp;
}
Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h Thu Jan 6 16:15:06 2011
@@ -44,7 +44,7 @@
lldb::addr_t& cfa,
lldb::addr_t& start_pc);
- lldb_private::RegisterContext *
+ lldb::RegisterContextSP
CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
private:
Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp Thu Jan 6 16:15:06 2011
@@ -63,14 +63,15 @@
return false;
}
-RegisterContext *
+lldb::RegisterContextSP
UnwindMacOSXFrameBackchain::CreateRegisterContextForFrame (StackFrame *frame)
{
- uint32_t idx = frame->GetUnwindFrameIndex ();
+ lldb::RegisterContextSP reg_ctx_sp;
+ uint32_t concrete_idx = frame->GetConcreteFrameIndex ();
const uint32_t frame_count = GetFrameCount();
- if (idx < frame_count)
- return new RegisterContextMacOSXFrameBackchain (m_thread, frame, m_cursors[idx]);
- return NULL;
+ if (concrete_idx < frame_count)
+ reg_ctx_sp.reset (new RegisterContextMacOSXFrameBackchain (m_thread, concrete_idx, m_cursors[concrete_idx]));
+ return reg_ctx_sp;
}
size_t
@@ -86,7 +87,7 @@
uint32_t pc;
};
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx);
Cursor cursor;
@@ -174,7 +175,7 @@
uint64_t pc;
};
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx);
Cursor cursor;
Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h Thu Jan 6 16:15:06 2011
@@ -44,7 +44,7 @@
lldb::addr_t& cfa,
lldb::addr_t& pc);
- lldb_private::RegisterContext *
+ lldb::RegisterContextSP
CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
lldb_private::Thread &
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Thu Jan 6 16:15:06 2011
@@ -32,11 +32,11 @@
GDBRemoteRegisterContext::GDBRemoteRegisterContext
(
ThreadGDBRemote &thread,
- StackFrame *frame,
+ uint32_t concrete_frame_idx,
GDBRemoteDynamicRegisterInfo ®_info,
bool read_all_at_once
) :
- RegisterContext (thread, frame),
+ RegisterContext (thread, concrete_frame_idx),
m_reg_info (reg_info),
m_reg_valid (),
m_reg_valid_stop_id (),
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h Thu Jan 6 16:15:06 2011
@@ -178,7 +178,7 @@
// Constructors and Destructors
//------------------------------------------------------------------
GDBRemoteRegisterContext (ThreadGDBRemote &thread,
- lldb_private::StackFrame *frame,
+ uint32_t concrete_frame_idx,
GDBRemoteDynamicRegisterInfo ®_info,
bool read_all_at_once);
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp Thu Jan 6 16:15:06 2011
@@ -173,28 +173,29 @@
{
return true;
}
-RegisterContext *
+lldb::RegisterContextSP
ThreadGDBRemote::GetRegisterContext ()
{
if (m_reg_context_sp.get() == NULL)
- m_reg_context_sp.reset (CreateRegisterContextForFrame (NULL));
- return m_reg_context_sp.get();
+ m_reg_context_sp = CreateRegisterContextForFrame (NULL);
+ return m_reg_context_sp;
}
-RegisterContext *
+lldb::RegisterContextSP
ThreadGDBRemote::CreateRegisterContextForFrame (StackFrame *frame)
{
+ lldb::RegisterContextSP reg_ctx_sp;
const bool read_all_registers_at_once = false;
- uint32_t frame_idx = 0;
+ uint32_t concrete_frame_idx = 0;
if (frame)
- frame_idx = frame->GetFrameIndex ();
+ concrete_frame_idx = frame->GetConcreteFrameIndex ();
- if (frame_idx == 0)
- return new GDBRemoteRegisterContext (*this, frame, GetGDBProcess().m_register_info, read_all_registers_at_once);
+ if (concrete_frame_idx == 0)
+ reg_ctx_sp.reset (new GDBRemoteRegisterContext (*this, concrete_frame_idx, GetGDBProcess().m_register_info, read_all_registers_at_once));
else if (m_unwinder_ap.get())
- return m_unwinder_ap->CreateRegisterContextForFrame (frame);
- return NULL;
+ reg_ctx_sp = m_unwinder_ap->CreateRegisterContextForFrame (frame);
+ return reg_ctx_sp;
}
bool
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h Thu Jan 6 16:15:06 2011
@@ -41,10 +41,10 @@
virtual const char *
GetQueueName ();
- virtual lldb_private::RegisterContext *
+ virtual lldb::RegisterContextSP
GetRegisterContext ();
- virtual lldb_private::RegisterContext *
+ virtual lldb::RegisterContextSP
CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
virtual bool
Modified: lldb/trunk/source/Symbol/UnwindPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/UnwindPlan.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/UnwindPlan.cpp (original)
+++ lldb/trunk/source/Symbol/UnwindPlan.cpp Thu Jan 6 16:15:06 2011
@@ -135,17 +135,16 @@
void
UnwindPlan::Row::Dump (Stream& s, int register_kind, Thread* thread) const
{
- RegisterContext *rctx = NULL;
+ RegisterContext *reg_ctx = NULL;
const RegisterInfo *rinfo = NULL;
int translated_regnum;
if (thread && thread->GetRegisterContext())
- {
- rctx = thread->GetRegisterContext();
- }
+ reg_ctx = thread->GetRegisterContext().get();
+
s.Printf ("offset %ld, CFA reg ", (long) GetOffset());
- if (rctx
- && (translated_regnum = rctx->ConvertRegisterKindToRegisterNumber (register_kind, GetCFARegister())) != -1
- && (rinfo = rctx->GetRegisterInfoAtIndex (translated_regnum)) != NULL
+ if (reg_ctx
+ && (translated_regnum = reg_ctx->ConvertRegisterKindToRegisterNumber (register_kind, GetCFARegister())) != -1
+ && (rinfo = reg_ctx->GetRegisterInfoAtIndex (translated_regnum)) != NULL
&& rinfo->name != NULL
&& rinfo->name[0] != '\0')
{
@@ -160,11 +159,10 @@
{
s.Printf (" [");
bool printed_name = false;
- if (thread && thread->GetRegisterContext())
+ if (reg_ctx)
{
- rctx = thread->GetRegisterContext();
- translated_regnum = rctx->ConvertRegisterKindToRegisterNumber (register_kind, idx->first);
- rinfo = rctx->GetRegisterInfoAtIndex (translated_regnum);
+ translated_regnum = reg_ctx->ConvertRegisterKindToRegisterNumber (register_kind, idx->first);
+ rinfo = reg_ctx->GetRegisterInfoAtIndex (translated_regnum);
if (rinfo && rinfo->name)
{
s.Printf ("%s ", rinfo->name);
Modified: lldb/trunk/source/Target/ExecutionContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ExecutionContext.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/ExecutionContext.cpp (original)
+++ lldb/trunk/source/Target/ExecutionContext.cpp Thu Jan 6 16:15:06 2011
@@ -88,9 +88,9 @@
ExecutionContext::GetRegisterContext () const
{
if (frame)
- return frame->GetRegisterContext();
+ return frame->GetRegisterContext().get();
else if (thread)
- return thread->GetRegisterContext();
+ return thread->GetRegisterContext().get();
return NULL;
}
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Thu Jan 6 16:15:06 2011
@@ -2545,7 +2545,7 @@
}
ts.Printf("<");
- RegisterContext *register_context = thread->GetRegisterContext();
+ RegisterContext *register_context = thread->GetRegisterContext().get();
if (register_context)
ts.Printf("[ip 0x%llx] ", register_context->GetPC());
Modified: lldb/trunk/source/Target/RegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/RegisterContext.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/RegisterContext.cpp (original)
+++ lldb/trunk/source/Target/RegisterContext.cpp Thu Jan 6 16:15:06 2011
@@ -21,18 +21,9 @@
using namespace lldb;
using namespace lldb_private;
-//----------------------------------------------------------------------
-// RegisterContext constructors
-//----------------------------------------------------------------------
-RegisterContext::RegisterContext (Thread &thread, StackFrame *frame) :
- m_thread (thread),
- m_frame (frame)
-{
-}
-
-RegisterContext::RegisterContext (Thread &thread) :
+RegisterContext::RegisterContext (Thread &thread, uint32_t concrete_frame_idx) :
m_thread (thread),
- m_frame (NULL)
+ m_concrete_frame_idx (concrete_frame_idx)
{
}
@@ -86,8 +77,9 @@
bool success = WriteRegisterFromUnsigned (reg, pc);
if (success)
{
- if (m_frame)
- m_frame->ChangePC(pc);
+ StackFrameSP frame_sp(m_thread.GetFrameWithConcreteFrameIndex (m_concrete_frame_idx));
+ if (frame_sp)
+ frame_sp->ChangePC(pc);
else
m_thread.ClearStackFrames ();
}
@@ -207,12 +199,6 @@
return false;
}
-void
-RegisterContext::SetStackFrame (StackFrame *frame)
-{
- m_frame = frame;
-}
-
Target *
RegisterContext::CalculateTarget ()
{
@@ -235,16 +221,16 @@
StackFrame *
RegisterContext::CalculateStackFrame ()
{
- return m_frame;
+ // Register contexts might belong to many frames if we have inlined
+ // functions inside a frame since all inlined functions share the
+ // same registers, so we can't definitively say which frame we come from...
+ return NULL;
}
void
RegisterContext::CalculateExecutionContext (ExecutionContext &exe_ctx)
{
- if (m_frame)
- m_frame->CalculateExecutionContext (exe_ctx);
- else
- m_thread.CalculateExecutionContext (exe_ctx);
+ m_thread.CalculateExecutionContext (exe_ctx);
}
Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Thu Jan 6 16:15:06 2011
@@ -49,7 +49,7 @@
const SymbolContext *sc_ptr
) :
m_frame_index (frame_idx),
- m_unwind_frame_index (unwind_frame_index),
+ m_concrete_frame_index (unwind_frame_index),
m_thread (thread),
m_reg_context_sp (),
m_id (pc, cfa, NULL),
@@ -79,7 +79,7 @@
const SymbolContext *sc_ptr
) :
m_frame_index (frame_idx),
- m_unwind_frame_index (unwind_frame_index),
+ m_concrete_frame_index (unwind_frame_index),
m_thread (thread),
m_reg_context_sp (reg_context_sp),
m_id (pc, cfa, NULL),
@@ -115,7 +115,7 @@
const SymbolContext *sc_ptr
) :
m_frame_index (frame_idx),
- m_unwind_frame_index (unwind_frame_index),
+ m_concrete_frame_index (unwind_frame_index),
m_thread (thread),
m_reg_context_sp (reg_context_sp),
m_id (pc_addr.GetLoadAddress (&thread.GetProcess().GetTarget()), cfa, NULL),
@@ -755,12 +755,12 @@
return m_frame_base_error.Success();
}
-RegisterContext *
+RegisterContextSP
StackFrame::GetRegisterContext ()
{
- if (m_reg_context_sp.get() == NULL)
- m_reg_context_sp.reset (m_thread.CreateRegisterContextForFrame (this));
- return m_reg_context_sp.get();
+ if (!m_reg_context_sp)
+ m_reg_context_sp = m_thread.CreateRegisterContextForFrame (this);
+ return m_reg_context_sp;
}
bool
@@ -916,7 +916,7 @@
m_id.SetPC (curr_frame.m_id.GetPC()); // Update the Stack ID PC value
assert (&m_thread == &curr_frame.m_thread);
m_frame_index = curr_frame.m_frame_index;
- m_unwind_frame_index = curr_frame.m_unwind_frame_index;
+ m_concrete_frame_index = curr_frame.m_concrete_frame_index;
m_reg_context_sp = curr_frame.m_reg_context_sp;
m_frame_code_addr = curr_frame.m_frame_code_addr;
assert (m_sc.target_sp.get() == NULL || curr_frame.m_sc.target_sp.get() == NULL || m_sc.target_sp.get() == curr_frame.m_sc.target_sp.get());
Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Thu Jan 6 16:15:06 2011
@@ -336,6 +336,27 @@
return frame_sp;
}
+StackFrameSP
+StackFrameList::GetFrameWithConcreteFrameIndex (uint32_t unwind_idx)
+{
+ // First try assuming the unwind index is the same as the frame index. The
+ // unwind index is always greater than or equal to the frame index, so it
+ // is a good place to start. If we have inlined frames we might have 5
+ // concrete frames (frame unwind indexes go from 0-4), but we might have 15
+ // frames after we make all the inlined frames. Most of the time the unwind
+ // frame index (or the concrete frame index) is the same as the frame index.
+ uint32_t frame_idx = unwind_idx;
+ StackFrameSP frame_sp (GetFrameAtIndex (frame_idx));
+ while (frame_sp)
+ {
+ if (frame_sp->GetFrameIndex() == unwind_idx)
+ break;
+ frame_sp = GetFrameAtIndex (++frame_idx);
+ }
+ return frame_sp;
+}
+
+
bool
StackFrameList::SetFrameAtIndex (uint32_t idx, StackFrameSP &frame_sp)
{
Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Thu Jan 6 16:15:06 2011
@@ -877,6 +877,13 @@
return GetStackFrameList().GetSelectedFrameIndex();
}
+lldb::StackFrameSP
+Thread::GetFrameWithConcreteFrameIndex (uint32_t unwind_idx)
+{
+ return GetStackFrameList().GetFrameWithConcreteFrameIndex (unwind_idx);
+}
+
+
lldb::StackFrameSP
Thread::GetSelectedFrame ()
Modified: lldb/trunk/source/Target/ThreadPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlan.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlan.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlan.cpp Thu Jan 6 16:15:06 2011
@@ -149,7 +149,7 @@
if (log)
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
addr_t pc = reg_ctx->GetPC();
addr_t sp = reg_ctx->GetSP();
addr_t fp = reg_ctx->GetFP();
Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallFunction.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Thu Jan 6 16:15:06 2011
@@ -95,7 +95,7 @@
if (log)
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
log->PutCString("Function call was set up. Register state was:");
@@ -214,7 +214,7 @@
if (log)
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
log->PutCString("Function completed. Register state was:");
Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTracer.cpp?rev=122976&r1=122975&r2=122976&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTracer.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanTracer.cpp Thu Jan 6 16:15:06 2011
@@ -132,9 +132,10 @@
{
}
-void ThreadPlanAssemblyTracer::TracingStarted ()
+void
+ThreadPlanAssemblyTracer::TracingStarted ()
{
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
if (m_register_values.size() == 0)
{
@@ -145,7 +146,8 @@
}
}
-void ThreadPlanAssemblyTracer::TracingEnded ()
+void
+ThreadPlanAssemblyTracer::TracingEnded ()
{
for (uint32_t reg_index = 0, num_registers = m_register_values.size();
reg_index < num_registers;
@@ -153,51 +155,26 @@
m_register_values[reg_index] = 0;
}
-static const char *Padding(int length)
-{
- const int padding_size = 256;
-
- static char* padding = NULL;
- static int prev_length = 256;
-
- if (!padding) {
- padding = new char[padding_size];
- memset(padding, ' ', padding_size);
- }
-
- if (length > 255)
- length = 255;
-
- if (prev_length < 256)
- padding[prev_length] = ' ';
-
- padding[length] = '\0';
-
- prev_length = length;
-
- return padding;
-}
-
-static void PadOutTo(StreamString &stream, int target)
+static void
+PadOutTo (StreamString &stream, int target)
{
stream.Flush();
int length = stream.GetString().length();
if (length + 1 < target)
- stream.PutCString(Padding(target - (length + 1)));
-
- stream.PutCString(" ");
+ stream.Printf("%*s", target - (length + 1) + 1, "");
}
-void ThreadPlanAssemblyTracer::Log ()
+void
+ThreadPlanAssemblyTracer::Log ()
{
Stream *stream = GetLogStream ();
if (!stream)
return;
- RegisterContext *reg_ctx = m_thread.GetRegisterContext();
+ RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
lldb::addr_t pc = reg_ctx->GetPC();
Address pc_addr;
From gclayton at apple.com Thu Jan 6 16:35:55 2011
From: gclayton at apple.com (Greg Clayton)
Date: Thu, 06 Jan 2011 22:35:55 -0000
Subject: [Lldb-commits] [lldb] r122981 - in
/lldb/trunk/source/Plugins/Process/Linux: LinuxThread.cpp LinuxThread.h
RegisterContextLinux.h RegisterContextLinux_x86_64.cpp
RegisterContextLinux_x86_64.h
Message-ID: <20110106223555.BA9DC2A6C12C@llvm.org>
Author: gclayton
Date: Thu Jan 6 16:35:55 2011
New Revision: 122981
URL: http://llvm.org/viewvc/llvm-project?rev=122981&view=rev
Log:
First try at patching linux for the recent RegisterContext patch. Can someone
try and build this and let me know how it goes?
Modified:
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux.h
lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp?rev=122981&r1=122980&r2=122981&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp Thu Jan 6 16:35:55 2011
@@ -26,21 +26,8 @@
LinuxThread::LinuxThread(Process &process, lldb::tid_t tid)
: Thread(process, tid),
m_frame_ap(0),
- m_register_ap(0),
m_note(eNone)
{
- ArchSpec arch = process.GetTarget().GetArchitecture();
-
- switch (arch.GetGenericCPUType())
- {
- default:
- assert(false && "CPU type not supported!");
- break;
-
- case ArchSpec::eCPU_x86_64:
- m_register_ap.reset(new RegisterContextLinux_x86_64(*this, NULL));
- break;
- }
}
ProcessMonitor &
@@ -61,10 +48,25 @@
return NULL;
}
-RegisterContextLinux *
+lldb::RegisterContextSP
LinuxThread::GetRegisterContext()
{
- return m_register_ap.get();
+ if (!m_reg_context_sp)
+ {
+ ArchSpec arch = process.GetTarget().GetArchitecture();
+
+ switch (arch.GetGenericCPUType())
+ {
+ default:
+ assert(false && "CPU type not supported!");
+ break;
+
+ case ArchSpec::eCPU_x86_64:
+ m_reg_context_sp.reset(new RegisterContextLinux_x86_64(*this, 0));
+ break;
+ }
+ }
+ return m_reg_context_sp
}
bool
@@ -79,10 +81,19 @@
return false;
}
-RegisterContextLinux *
-LinuxThread::CreateRegisterContextForFrame(lldb_private::StackFrame *frame)
+lldb::RegisterContextSP
+LinuxThread::CreateRegisterContextForFrame (lldb_private::StackFrame *frame)
{
- return new RegisterContextLinux_x86_64(*this, frame);
+ lldb::RegisterContextSP reg_ctx_sp;
+ uint32_t concrete_frame_idx = 0;
+ if (frame)
+ concrete_frame_idx = frame->GetConcreteFrameIndex();
+
+ if (concrete_frame_idx == 0)
+ reg_ctx_sp = GetRegisterContext();
+ else
+ reg_ctx_sp.reset (new RegisterContextLinux_x86_64(*this, frame->GetConcreteFrameIndex()));
+ return reg_ctx_sp;
}
lldb::StopInfoSP
@@ -159,14 +170,13 @@
{
bool status;
- status = GetRegisterContext()->UpdateAfterBreakpoint();
+ status = GetRegisterContextLinux()->UpdateAfterBreakpoint();
assert(status && "Breakpoint update failed!");
// With our register state restored, resolve the breakpoint object
// corresponding to our current PC.
lldb::addr_t pc = GetRegisterContext()->GetPC();
- lldb::BreakpointSiteSP bp_site =
- GetProcess().GetBreakpointSiteList().FindByAddress(pc);
+ lldb::BreakpointSiteSP bp_site(GetProcess().GetBreakpointSiteList().FindByAddress(pc));
assert(bp_site && bp_site->ValidForThisThread(this));
m_note = eBreak;
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h?rev=122981&r1=122980&r2=122981&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h Thu Jan 6 16:35:55 2011
@@ -16,9 +16,9 @@
// Other libraries and framework includes
#include "lldb/Target/Thread.h"
-#include "RegisterContextLinux.h"
class ProcessMonitor;
+class RegisterContextLinux;
//------------------------------------------------------------------------------
// @class LinuxThread
@@ -38,17 +38,17 @@
const char *
GetInfo();
- RegisterContextLinux *
+ virtual lldb::RegisterContextSP
GetRegisterContext();
- bool
+ virtual bool
SaveFrameZeroState(RegisterCheckpoint &checkpoint);
- bool
+ virtual bool
RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint);
- RegisterContextLinux *
- CreateRegisterContextForFrame(lldb_private::StackFrame *frame);
+ virtual lldb::RegisterContextSP
+ CreateRegisterContextForFrame (StackFrame *frame);
//--------------------------------------------------------------------------
// These methods form a specialized interface to linux threads.
@@ -60,8 +60,16 @@
void ExitNotify();
private:
+
+ RegisterContextLinux *
+ GetRegisterContextLinux ()
+ {
+ if (!m_reg_context_sp)
+ GetRegisterContext();
+ return (RegisterContextLinux *)m_reg_context_sp.get()
+ }
+
std::auto_ptr m_frame_ap;
- std::auto_ptr m_register_ap;
lldb::BreakpointSiteSP m_breakpoint;
Modified: lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux.h?rev=122981&r1=122980&r2=122981&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux.h Thu Jan 6 16:35:55 2011
@@ -24,8 +24,8 @@
{
public:
RegisterContextLinux(lldb_private::Thread &thread,
- lldb_private::StackFrame *frame)
- : RegisterContext(thread, frame) { }
+ uint32_t concrete_frame_idx)
+ : RegisterContext(thread, concrete_frame_idx) { }
/// Updates the register state of the associated thread after hitting a
/// breakpoint (if that make sense for the architecture). Default
Modified: lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp?rev=122981&r1=122980&r2=122981&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp Thu Jan 6 16:35:55 2011
@@ -402,8 +402,8 @@
}
RegisterContextLinux_x86_64::RegisterContextLinux_x86_64(Thread &thread,
- StackFrame *frame)
- : RegisterContextLinux(thread, frame)
+ uint32_t concrete_frame_idx)
+ : RegisterContextLinux(thread, concrete_frame_idx)
{
}
Modified: lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h?rev=122981&r1=122980&r2=122981&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h Thu Jan 6 16:35:55 2011
@@ -18,8 +18,8 @@
: public RegisterContextLinux
{
public:
- RegisterContextLinux_x86_64(lldb_private::Thread &thread,
- lldb_private::StackFrame *frame);
+ RegisterContextLinux_x86_64 (lldb_private::Thread &thread,
+ uint32_t concrete_frame_idx);
~RegisterContextLinux_x86_64();
From wilsons at start.ca Thu Jan 6 17:19:12 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Thu, 06 Jan 2011 18:19:12 -0500
Subject: [Lldb-commits] [lldb] r122981 - in
/lldb/trunk/source/Plugins/Process/Linux: LinuxThread.cpp
LinuxThread.h RegisterContextLinux.h
RegisterContextLinux_x86_64.cpp RegisterContextLinux_x86_64.h
In-Reply-To: <20110106223555.BA9DC2A6C12C@llvm.org> (Greg Clayton's message of
"Thu, 06 Jan 2011 22:35:55 -0000")
References: <20110106223555.BA9DC2A6C12C@llvm.org>
Message-ID:
Hi Greg,
Greg Clayton writes:
> First try at patching linux for the recent RegisterContext patch. Can someone
> try and build this and let me know how it goes?
I think we need the following as well. Note that I changed a
CalculateProcess() call to GetProcess() as I think that is the standard
access API (as opposed to using the inherited m_process member
directly)?
diff --git a/source/Plugins/Process/Linux/LinuxThread.cpp b/source/Plugins/Process/Linux/LinuxThread.cpp
index 725cc5a..e189064 100644
--- a/source/Plugins/Process/Linux/LinuxThread.cpp
+++ b/source/Plugins/Process/Linux/LinuxThread.cpp
@@ -33,8 +33,8 @@ LinuxThread::LinuxThread(Process &process, lldb::tid_t tid)
ProcessMonitor &
LinuxThread::GetMonitor()
{
- ProcessLinux *process = static_cast(CalculateProcess());
- return process->GetMonitor();
+ ProcessLinux &process = static_cast(GetProcess());
+ return process.GetMonitor();
}
void
@@ -51,6 +51,8 @@ LinuxThread::GetInfo()
lldb::RegisterContextSP
LinuxThread::GetRegisterContext()
{
+ ProcessLinux &process = static_cast(GetProcess());
+
if (!m_reg_context_sp)
{
ArchSpec arch = process.GetTarget().GetArchitecture();
@@ -66,7 +68,7 @@ LinuxThread::GetRegisterContext()
break;
}
}
- return m_reg_context_sp
+ return m_reg_context_sp;
}
bool
diff --git a/source/Plugins/Process/Linux/LinuxThread.h b/source/Plugins/Process/Linux/LinuxThread.h
index a87e5ca..4dcdbb3 100644
--- a/source/Plugins/Process/Linux/LinuxThread.h
+++ b/source/Plugins/Process/Linux/LinuxThread.h
@@ -48,7 +48,7 @@ public:
RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint);
virtual lldb::RegisterContextSP
- CreateRegisterContextForFrame (StackFrame *frame);
+ CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
//--------------------------------------------------------------------------
// These methods form a specialized interface to linux threads.
@@ -66,7 +66,7 @@ private:
{
if (!m_reg_context_sp)
GetRegisterContext();
- return (RegisterContextLinux *)m_reg_context_sp.get()
+ return (RegisterContextLinux *)m_reg_context_sp.get();
}
std::auto_ptr m_frame_ap;
From gclayton at apple.com Thu Jan 6 17:34:44 2011
From: gclayton at apple.com (Greg Clayton)
Date: Thu, 6 Jan 2011 15:34:44 -0800
Subject: [Lldb-commits] [lldb] r122981 - in
/lldb/trunk/source/Plugins/Process/Linux: LinuxThread.cpp
LinuxThread.h RegisterContextLinux.h
RegisterContextLinux_x86_64.cpp RegisterContextLinux_x86_64.h
In-Reply-To:
References: <20110106223555.BA9DC2A6C12C@llvm.org>
Message-ID: <81893D96-DD15-4C62-B2A8-2F74D34664A9@apple.com>
The CalculateProcess is part of the ExecutionContextScope. Anyone who inherits from this class must implement the 5 functions it requires, but basically it allows you to pass one pointer around that knows how to reconstruct any of the target, process, thread, and frame. In the "lldb_private::Thread" case, it knows how to reconstruct an "ExecutionContext" that contains a target, process and thread.
Using GetProcess is fine where you have done so.
The changes look good.
On Jan 6, 2011, at 3:19 PM, Stephen Wilson wrote:
>
> Hi Greg,
>
> Greg Clayton writes:
>> First try at patching linux for the recent RegisterContext patch. Can someone
>> try and build this and let me know how it goes?
>
> I think we need the following as well. Note that I changed a
> CalculateProcess() call to GetProcess() as I think that is the standard
> access API (as opposed to using the inherited m_process member
> directly)?
>
>
>
> diff --git a/source/Plugins/Process/Linux/LinuxThread.cpp b/source/Plugins/Process/Linux/LinuxThread.cpp
> index 725cc5a..e189064 100644
> --- a/source/Plugins/Process/Linux/LinuxThread.cpp
> +++ b/source/Plugins/Process/Linux/LinuxThread.cpp
> @@ -33,8 +33,8 @@ LinuxThread::LinuxThread(Process &process, lldb::tid_t tid)
> ProcessMonitor &
> LinuxThread::GetMonitor()
> {
> - ProcessLinux *process = static_cast(CalculateProcess());
> - return process->GetMonitor();
> + ProcessLinux &process = static_cast(GetProcess());
> + return process.GetMonitor();
> }
>
> void
> @@ -51,6 +51,8 @@ LinuxThread::GetInfo()
> lldb::RegisterContextSP
> LinuxThread::GetRegisterContext()
> {
> + ProcessLinux &process = static_cast(GetProcess());
> +
> if (!m_reg_context_sp)
> {
> ArchSpec arch = process.GetTarget().GetArchitecture();
> @@ -66,7 +68,7 @@ LinuxThread::GetRegisterContext()
> break;
> }
> }
> - return m_reg_context_sp
> + return m_reg_context_sp;
> }
>
> bool
> diff --git a/source/Plugins/Process/Linux/LinuxThread.h b/source/Plugins/Process/Linux/LinuxThread.h
> index a87e5ca..4dcdbb3 100644
> --- a/source/Plugins/Process/Linux/LinuxThread.h
> +++ b/source/Plugins/Process/Linux/LinuxThread.h
> @@ -48,7 +48,7 @@ public:
> RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint);
>
> virtual lldb::RegisterContextSP
> - CreateRegisterContextForFrame (StackFrame *frame);
> + CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
>
> //--------------------------------------------------------------------------
> // These methods form a specialized interface to linux threads.
> @@ -66,7 +66,7 @@ private:
> {
> if (!m_reg_context_sp)
> GetRegisterContext();
> - return (RegisterContextLinux *)m_reg_context_sp.get()
> + return (RegisterContextLinux *)m_reg_context_sp.get();
> }
>
> std::auto_ptr m_frame_ap;
From wilsons at start.ca Thu Jan 6 18:10:43 2011
From: wilsons at start.ca (Stephen Wilson)
Date: Fri, 07 Jan 2011 00:10:43 -0000
Subject: [Lldb-commits] [lldb] r122984 - in
/lldb/trunk/source/Plugins/Process/Linux: LinuxThread.cpp LinuxThread.h
Message-ID: <20110107001043.9BC292A6C12C@llvm.org>
Author: wilsons
Date: Thu Jan 6 18:10:43 2011
New Revision: 122984
URL: http://llvm.org/viewvc/llvm-project?rev=122984&view=rev
Log:
Fix a few small issues in r122981 to ensure compilation on Linux.
Also, call GetProcess instead of CalculateProcess as the latter is morally part
of the ExecutionContextScope API.
Modified:
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp?rev=122984&r1=122983&r2=122984&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp Thu Jan 6 18:10:43 2011
@@ -33,8 +33,8 @@
ProcessMonitor &
LinuxThread::GetMonitor()
{
- ProcessLinux *process = static_cast(CalculateProcess());
- return process->GetMonitor();
+ ProcessLinux &process = static_cast(GetProcess());
+ return process.GetMonitor();
}
void
@@ -51,6 +51,8 @@
lldb::RegisterContextSP
LinuxThread::GetRegisterContext()
{
+ ProcessLinux &process = static_cast(GetProcess());
+
if (!m_reg_context_sp)
{
ArchSpec arch = process.GetTarget().GetArchitecture();
@@ -66,7 +68,7 @@
break;
}
}
- return m_reg_context_sp
+ return m_reg_context_sp;
}
bool
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h?rev=122984&r1=122983&r2=122984&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.h Thu Jan 6 18:10:43 2011
@@ -48,7 +48,7 @@
RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint);
virtual lldb::RegisterContextSP
- CreateRegisterContextForFrame (StackFrame *frame);
+ CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
//--------------------------------------------------------------------------
// These methods form a specialized interface to linux threads.
@@ -66,7 +66,7 @@
{
if (!m_reg_context_sp)
GetRegisterContext();
- return (RegisterContextLinux *)m_reg_context_sp.get()
+ return (RegisterContextLinux *)m_reg_context_sp.get();
}
std::auto_ptr m_frame_ap;
From johnny.chen at apple.com Thu Jan 6 18:17:44 2011
From: johnny.chen at apple.com (Johnny Chen)
Date: Fri, 07 Jan 2011 00:17:44 -0000
Subject: [Lldb-commits] [lldb] r122985 - /lldb/trunk/test/help/TestHelp.py
Message-ID: <20110107001744.2EEB22A6C12C@llvm.org>
Author: johnny
Date: Thu Jan 6 18:17:44 2011
New Revision: 122985
URL: http://llvm.org/viewvc/llvm-project?rev=122985&view=rev
Log:
Print out a more meaningful exception message when/if CFBundleVersion matching failed.
Modified:
lldb/trunk/test/help/TestHelp.py
Modified: lldb/trunk/test/help/TestHelp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/help/TestHelp.py?rev=122985&r1=122984&r2=122985&view=diff
==============================================================================
--- lldb/trunk/test/help/TestHelp.py (original)
+++ lldb/trunk/test/help/TestHelp.py Thu Jan 6 18:17:44 2011
@@ -45,7 +45,8 @@
except:
# Just fallthrough...
- print "Unexpected error:", sys.exc_info()[0]
+ import traceback
+ traceback.print_exc()
pass
# Use None to signify that we are not able to grok the version number.
From gclayton at apple.com Thu Jan 6 19:57:07 2011
From: gclayton at apple.com (Greg Clayton)
Date: Fri, 07 Jan 2011 01:57:07 -0000
Subject: [Lldb-commits] [lldb] r122989 - in /lldb/trunk:
include/lldb/Target/Target.h source/Core/Address.cpp
source/Core/Disassembler.cpp
source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp
source/Target/Target.cpp
Message-ID: <20110107015707.98B622A6C12C@llvm.org>
Author: gclayton
Date: Thu Jan 6 19:57:07 2011
New Revision: 122989
URL: http://llvm.org/viewvc/llvm-project?rev=122989&view=rev
Log:
Added the ability for Target::ReadMemory to prefer to read from the file
cache even when a valid process exists. Previously, Target::ReadMemory would
read from the process if there was a valid one and then fallback to the
object file cache.
Modified:
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/source/Core/Address.cpp
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp
lldb/trunk/source/Target/Target.cpp
Modified: lldb/trunk/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=122989&r1=122988&r2=122989&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Thu Jan 6 19:57:07 2011
@@ -401,12 +401,27 @@
GetTargetTriple (ConstString &target_triple);
size_t
+ ReadMemoryFromFileCache (const Address& addr,
+ void *dst,
+ size_t dst_len,
+ Error &error);
+
+ // Reading memory through the target allows us to skip going to the process
+ // for reading memory if possible and it allows us to try and read from
+ // any constant sections in our object files on disk. If you always want
+ // live program memory, read straight from the process. If you possibly
+ // want to read from const sections in object files, read from the target.
+ // This version of ReadMemory will try and read memory from the process
+ // if the process is alive. The order is:
+ // 1 - if (prefer_file_cache == true) then read from object file cache
+ // 2 - if there is a valid process, try and read from its memory
+ // 3 - if (prefer_file_cache == false) then read from object file cache
+ size_t
ReadMemory (const Address& addr,
+ bool prefer_file_cache,
void *dst,
size_t dst_len,
Error &error);
-
-
SectionLoadList&
GetSectionLoadList()
Modified: lldb/trunk/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Address.cpp?rev=122989&r1=122988&r2=122989&view=diff
==============================================================================
--- lldb/trunk/source/Core/Address.cpp (original)
+++ lldb/trunk/source/Core/Address.cpp Thu Jan 6 19:57:07 2011
@@ -68,7 +68,8 @@
if (target)
{
Error error;
- return target->ReadMemory (address, dst, dst_len, error);
+ bool prefer_file_cache = false;
+ return target->ReadMemory (address, prefer_file_cache, dst, dst_len, error);
}
return 0;
}
Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=122989&r1=122988&r2=122989&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Thu Jan 6 19:57:07 2011
@@ -422,7 +422,8 @@
DataBufferSP data_sp(heap_buffer);
Error error;
- const size_t bytes_read = target->ReadMemory (range.GetBaseAddress(), heap_buffer->GetBytes(), heap_buffer->GetByteSize(), error);
+ bool prefer_file_cache = true;
+ const size_t bytes_read = target->ReadMemory (range.GetBaseAddress(), prefer_file_cache, heap_buffer->GetBytes(), heap_buffer->GetByteSize(), error);
if (bytes_read > 0)
{
Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp?rev=122989&r1=122988&r2=122989&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp Thu Jan 6 19:57:07 2011
@@ -470,7 +470,8 @@
uint8_t onebyte_buf[1];
Error error;
- if (target->ReadMemory (read_addr, onebyte_buf, 1, error) != -1)
+ const bool prefer_file_cache = true;
+ if (target->ReadMemory (read_addr, prefer_file_cache, onebyte_buf, 1, error) != -1)
{
*buf = onebyte_buf[0];
return 0;
@@ -550,6 +551,7 @@
row.SetRegisterInfo (m_lldb_ip_regnum, initial_regloc);
unwind_plan.AppendRow (row);
+ const bool prefer_file_cache = true;
while (m_func_bounds.ContainsFileAddress (m_cur_insn) && non_prologue_insn_count < 10)
{
@@ -562,7 +564,7 @@
// An unrecognized/junk instruction
break;
}
- if (m_target.ReadMemory (m_cur_insn, m_cur_insn_bytes, insn_len, error) == -1)
+ if (m_target.ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, insn_len, error) == -1)
{
// Error reading the instruction out of the file, stop scanning
break;
@@ -672,7 +674,7 @@
Address last_insn (m_func_bounds.GetBaseAddress());
last_insn.SetOffset (last_insn.GetOffset() + m_func_bounds.GetByteSize() - 1);
uint8_t bytebuf[1];
- if (m_target.ReadMemory (last_insn, bytebuf, 1, error) != -1)
+ if (m_target.ReadMemory (last_insn, prefer_file_cache, bytebuf, 1, error) != -1)
{
if (bytebuf[0] == 0xc3) // ret aka retq
{
@@ -723,7 +725,8 @@
uint8_t bytebuf[4];
Error error;
- if (m_target.ReadMemory (func.GetBaseAddress(), bytebuf, sizeof (bytebuf), error) == -1)
+ const bool prefer_file_cache = true;
+ if (m_target.ReadMemory (func.GetBaseAddress(), prefer_file_cache, bytebuf, sizeof (bytebuf), error) == -1)
return false;
uint8_t i386_prologue[] = {0x55, 0x89, 0xe5};
@@ -781,6 +784,7 @@
return false;
}
+ const bool prefer_file_cache = true;
while (m_func_bounds.ContainsFileAddress (m_cur_insn))
{
Error error;
@@ -790,7 +794,7 @@
// An error parsing the instruction, i.e. probably data/garbage - stop scanning
break;
}
- if (m_target.ReadMemory (m_cur_insn, m_cur_insn_bytes, insn_len, error) == -1)
+ if (m_target.ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, insn_len, error) == -1)
{
// Error reading the instruction out of the file, stop scanning
break;
Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=122989&r1=122988&r2=122989&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Thu Jan 6 19:57:07 2011
@@ -589,12 +589,43 @@
}
size_t
-Target::ReadMemory (const Address& addr, void *dst, size_t dst_len, Error &error)
+Target::ReadMemoryFromFileCache (const Address& addr, void *dst, size_t dst_len, Error &error)
{
- error.Clear();
+ const Section *section = addr.GetSection();
+ if (section && section->GetModule())
+ {
+ ObjectFile *objfile = section->GetModule()->GetObjectFile();
+ if (objfile)
+ {
+ size_t bytes_read = section->ReadSectionDataFromObjectFile (objfile,
+ addr.GetOffset(),
+ dst,
+ dst_len);
+ if (bytes_read > 0)
+ return bytes_read;
+ else
+ error.SetErrorStringWithFormat("error reading data from section %s", section->GetName().GetCString());
+ }
+ else
+ {
+ error.SetErrorString("address isn't from a object file");
+ }
+ }
+ else
+ {
+ error.SetErrorString("address doesn't contain a section that points to a section in a object file");
+ }
+ return 0;
+}
+size_t
+Target::ReadMemory (const Address& addr, bool prefer_file_cache, void *dst, size_t dst_len, Error &error)
+{
+ error.Clear();
+
bool process_is_valid = m_process_sp && m_process_sp->IsAlive();
+ size_t bytes_read = 0;
Address resolved_addr(addr);
if (!resolved_addr.IsSectionOffset())
{
@@ -608,6 +639,12 @@
}
}
+ if (prefer_file_cache)
+ {
+ bytes_read = ReadMemoryFromFileCache (resolved_addr, dst, dst_len, error);
+ if (bytes_read > 0)
+ return bytes_read;
+ }
if (process_is_valid)
{
@@ -623,7 +660,7 @@
}
else
{
- size_t bytes_read = m_process_sp->ReadMemory(load_addr, dst, dst_len, error);
+ bytes_read = m_process_sp->ReadMemory(load_addr, dst, dst_len, error);
if (bytes_read != dst_len)
{
if (error.Success())
@@ -646,14 +683,11 @@
}
}
- const Section *section = resolved_addr.GetSection();
- if (section && section->GetModule())
+ if (!prefer_file_cache)
{
- ObjectFile *objfile = section->GetModule()->GetObjectFile();
- return section->ReadSectionDataFromObjectFile (objfile,
- resolved_addr.GetOffset(),
- dst,
- dst_len);
+ // If we didn't already try and read from the object file cache, then
+ // try it after failing to read from the process.
+ return ReadMemoryFromFileCache (resolved_addr, dst, dst_len, error);
}
return 0;
}
From bruce.mitchener at gmail.com Thu Jan 6 23:58:51 2011
From: bruce.mitchener at gmail.com (Bruce Mitchener)
Date: Fri, 7 Jan 2011 12:58:51 +0700
Subject: [Lldb-commits] [Patch] fix typos on website
Message-ID:
Minor patch, but this fixes a couple of spelling errors on the website.
Cheers!
- Bruce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lldb_www.diff
Type: application/octet-stream
Size: 1570 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/lldb-commits/attachments/20110107/6b6a47f9/attachment.obj
From gclayton at apple.com Fri Jan 7 00:08:19 2011
From: gclayton at apple.com (Greg Clayton)
Date: Fri, 07 Jan 2011 06:08:19 -0000
Subject: [Lldb-commits] [lldb] r122996 - in /lldb/trunk:
include/lldb/Target/Process.h source/Plugins/Process/Utility/UnwindLLDB.cpp
source/Plugins/Process/Utility/UnwindLLDB.h source/Target/Process.cpp
Message-ID: <20110107060819.84D0F2A6C12C@llvm.org>
Author: gclayton
Date: Fri Jan 7 00:08:19 2011
New Revision: 122996
URL: http://llvm.org/viewvc/llvm-project?rev=122996&view=rev
Log:
Added memory caching to lldb_private::Process. All lldb_private::Process
subclasses will automatically be able to take advantage of caching. The
cache line size is set to 512 by default.
This greatly speeds up stack backtraces on MacOSX when using the
ProcessGDBRemote process plug-in since only about 6300 packets per second
can be sent.
Initial speedups show:
Prior to caching: 10,000 stack frames took 5.2 seconds
After caching: 10,000 stack frames in 240 ms!
About a 20x speedup!
Modified:
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h
lldb/trunk/source/Target/Process.cpp
Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=122996&r1=122995&r2=122996&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Fri Jan 7 00:08:19 2011
@@ -1336,6 +1336,12 @@
size_t size,
Error &error);
+ size_t
+ ReadMemoryFromInferior (lldb::addr_t vm_addr,
+ void *buf,
+ size_t size,
+ Error &error);
+
//------------------------------------------------------------------
/// Reads an unsigned integer of the specified byte size from
/// process memory.
@@ -1769,6 +1775,43 @@
GetSP ();
protected:
+ class MemoryCache
+ {
+ public:
+ //------------------------------------------------------------------
+ // Constructors and Destructors
+ //------------------------------------------------------------------
+ MemoryCache ();
+
+ ~MemoryCache ();
+
+ void
+ Clear();
+
+ void
+ Flush (lldb::addr_t addr, size_t size);
+
+ size_t
+ Read (Process *process,
+ lldb::addr_t addr,
+ void *dst,
+ size_t dst_len,
+ Error &error);
+
+ protected:
+ typedef std::map collection;
+ //------------------------------------------------------------------
+ // Classes that inherit from MemoryCache can see and modify these
+ //------------------------------------------------------------------
+ uint32_t m_cache_line_byte_size;
+ Mutex m_cache_mutex;
+ collection m_cache;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN (MemoryCache);
+ };
+
+
//------------------------------------------------------------------
// Member variables
//------------------------------------------------------------------
@@ -1800,7 +1843,8 @@
lldb_private::Communication m_stdio_communication;
lldb_private::Mutex m_stdio_communication_mutex;
std::string m_stdout_data;
-
+ MemoryCache m_memory_cache;
+
typedef std::map LanguageRuntimeCollection;
LanguageRuntimeCollection m_language_runtimes;
Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp?rev=122996&r1=122995&r2=122996&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp Fri Jan 7 00:08:19 2011
@@ -33,10 +33,24 @@
{
if (m_frames.empty())
{
+//#define DEBUG_FRAME_SPEED 1
+#if DEBUG_FRAME_SPEED
+ TimeValue time_value (TimeValue::Now());
+#endif
if (!AddFirstFrame ())
return 0;
while (AddOneMoreFrame ())
- ;
+ {
+#if DEBUG_FRAME_SPEED
+ if ((m_frames.size() % 10000) == 0)
+ {
+ TimeValue now(TimeValue::Now());
+ uint64_t delta_t = now - time_value;
+ printf ("10000 frames in %llu.%09llu ms\n", delta_t / NSEC_PER_SEC, delta_t % NSEC_PER_SEC);
+ time_value = now;
+ }
+#endif
+ }
}
return m_frames.size ();
}
Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h?rev=122996&r1=122995&r2=122996&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h Fri Jan 7 00:08:19 2011
@@ -72,6 +72,6 @@
DISALLOW_COPY_AND_ASSIGN (UnwindLLDB);
};
-}
+} // namespace lldb_private
#endif // lldb_UnwindLLDB_h_
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=122996&r1=122995&r2=122996&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Fri Jan 7 00:08:19 2011
@@ -37,6 +37,145 @@
using namespace lldb;
using namespace lldb_private;
+
+//----------------------------------------------------------------------
+// MemoryCache constructor
+//----------------------------------------------------------------------
+Process::MemoryCache::MemoryCache() :
+ m_cache_line_byte_size (512),
+ m_cache_mutex (Mutex::eMutexTypeRecursive),
+ m_cache ()
+{
+}
+
+//----------------------------------------------------------------------
+// Destructor
+//----------------------------------------------------------------------
+Process::MemoryCache::~MemoryCache()
+{
+}
+
+void
+Process::MemoryCache::Clear()
+{
+ Mutex::Locker locker (m_cache_mutex);
+ m_cache.clear();
+}
+
+void
+Process::MemoryCache::Flush (addr_t addr, size_t size)
+{
+ if (size == 0)
+ return;
+
+ const uint32_t cache_line_byte_size = m_cache_line_byte_size;
+ const addr_t end_addr = (addr + size - 1);
+ const addr_t flush_start_addr = addr - (addr % cache_line_byte_size);
+ const addr_t flush_end_addr = end_addr - (end_addr % cache_line_byte_size);
+
+ Mutex::Locker locker (m_cache_mutex);
+ if (m_cache.empty())
+ return;
+
+ assert ((flush_start_addr % cache_line_byte_size) == 0);
+
+ for (addr_t curr_addr = flush_start_addr; curr_addr <= flush_end_addr; curr_addr += cache_line_byte_size)
+ {
+ collection::iterator pos = m_cache.find (curr_addr);
+ if (pos != m_cache.end())
+ m_cache.erase(pos);
+ }
+}
+
+size_t
+Process::MemoryCache::Read
+(
+ Process *process,
+ addr_t addr,
+ void *dst,
+ size_t dst_len,
+ Error &error
+)
+{
+ size_t bytes_left = dst_len;
+ if (dst && bytes_left > 0)
+ {
+ const uint32_t cache_line_byte_size = m_cache_line_byte_size;
+ uint8_t *dst_buf = (uint8_t *)dst;
+ addr_t curr_addr = addr - (addr % cache_line_byte_size);
+ addr_t cache_offset = addr - curr_addr;
+ Mutex::Locker locker (m_cache_mutex);
+
+ while (bytes_left > 0)
+ {
+ collection::const_iterator pos = m_cache.find (curr_addr);
+ collection::const_iterator end = m_cache.end ();
+
+ if (pos != end)
+ {
+ size_t curr_read_size = cache_line_byte_size - cache_offset;
+ if (curr_read_size > bytes_left)
+ curr_read_size = bytes_left;
+
+ memcpy (dst_buf + dst_len - bytes_left, pos->second->GetBytes() + cache_offset, curr_read_size);
+
+ bytes_left -= curr_read_size;
+ curr_addr += curr_read_size + cache_offset;
+ cache_offset = 0;
+
+ if (bytes_left > 0)
+ {
+ // Get sequential cache page hits
+ for (++pos; (pos != end) && (bytes_left > 0); ++pos)
+ {
+ assert ((curr_addr % cache_line_byte_size) == 0);
+
+ if (pos->first != curr_addr)
+ break;
+
+ curr_read_size = pos->second->GetByteSize();
+ if (curr_read_size > bytes_left)
+ curr_read_size = bytes_left;
+
+ memcpy (dst_buf + dst_len - bytes_left, pos->second->GetBytes(), curr_read_size);
+
+ bytes_left -= curr_read_size;
+ curr_addr += curr_read_size;
+
+ // We have a cache page that succeeded to read some bytes
+ // but not an entire page. If this happens, we must cap
+ // off how much data we are able to read...
+ if (pos->second->GetByteSize() != cache_line_byte_size)
+ return dst_len - bytes_left;
+ }
+ }
+ }
+
+ // We need to read from the process
+
+ if (bytes_left > 0)
+ {
+ assert ((curr_addr % cache_line_byte_size) == 0);
+ std::auto_ptr data_buffer_heap_ap(new DataBufferHeap (cache_line_byte_size, 0));
+ size_t process_bytes_read = process->ReadMemoryFromInferior (curr_addr,
+ data_buffer_heap_ap->GetBytes(),
+ data_buffer_heap_ap->GetByteSize(),
+ error);
+ if (process_bytes_read == 0)
+ return dst_len - bytes_left;
+
+ if (process_bytes_read != cache_line_byte_size)
+ data_buffer_heap_ap->SetByteSize (process_bytes_read);
+ m_cache[curr_addr] = DataBufferSP (data_buffer_heap_ap.release());
+ // We have read data and put it into the cache, continue through the
+ // loop again to get the data out of the cache...
+ }
+ }
+ }
+
+ return dst_len - bytes_left;
+}
+
Process*
Process::FindPlugin (Target &target, const char *plugin_name, Listener &listener)
{
@@ -97,7 +236,8 @@
m_process_input_reader (),
m_stdio_communication ("lldb.process.stdio"),
m_stdio_communication_mutex (Mutex::eMutexTypeRecursive),
- m_stdout_data ()
+ m_stdout_data (),
+ m_memory_cache ()
{
UpdateInstanceName();
@@ -508,6 +648,7 @@
if (StateIsStoppedState(new_state))
{
m_stop_id++;
+ m_memory_cache.Clear();
if (log)
log->Printf("Process::SetPrivateState (%s) stop_id = %u", StateAsCString(new_state), m_stop_id);
}
@@ -1043,10 +1184,68 @@
}
+// Comment out line below to disable memory caching
+#define ENABLE_MEMORY_CACHING
+// Uncomment to verify memory caching works after making changes to caching code
+//#define VERIFY_MEMORY_READS
+
+#if defined (ENABLE_MEMORY_CACHING)
+
+#if defined (VERIFY_MEMORY_READS)
size_t
Process::ReadMemory (addr_t addr, void *buf, size_t size, Error &error)
{
+ // Memory caching is enabled, with debug verification
+ if (buf && size)
+ {
+ // Uncomment the line below to make sure memory caching is working.
+ // I ran this through the test suite and got no assertions, so I am
+ // pretty confident this is working well. If any changes are made to
+ // memory caching, uncomment the line below and test your changes!
+
+ // Verify all memory reads by using the cache first, then redundantly
+ // reading the same memory from the inferior and comparing to make sure
+ // everything is exactly the same.
+ std::string verify_buf (size, '\0');
+ assert (verify_buf.size() == size);
+ const size_t cache_bytes_read = m_memory_cache.Read (this, addr, buf, size, error);
+ Error verify_error;
+ const size_t verify_bytes_read = ReadMemoryFromInferior (addr, const_cast(verify_buf.data()), verify_buf.size(), verify_error);
+ assert (cache_bytes_read == verify_bytes_read);
+ assert (memcmp(buf, verify_buf.data(), verify_buf.size()) == 0);
+ assert (verify_error.Success() == error.Success());
+ return cache_bytes_read;
+ }
+ return 0;
+}
+
+#else // #if defined (VERIFY_MEMORY_READS)
+
+size_t
+Process::ReadMemory (addr_t addr, void *buf, size_t size, Error &error)
+{
+ // Memory caching enabled, no verification
+ return m_memory_cache.Read (this, addr, buf, size, error);
+}
+
+#endif // #else for #if defined (VERIFY_MEMORY_READS)
+
+#else // #if defined (ENABLE_MEMORY_CACHING)
+
+size_t
+Process::ReadMemory (addr_t addr, void *buf, size_t size, Error &error)
+{
+ // Memory caching is disabled
+ return ReadMemoryFromInferior (addr, buf, size, error);
+}
+
+#endif // #else for #if defined (ENABLE_MEMORY_CACHING)
+
+
+size_t
+Process::ReadMemoryFromInferior (addr_t addr, void *buf, size_t size, Error &error)
+{
if (buf == NULL || size == 0)
return 0;
@@ -1118,6 +1317,10 @@
size_t
Process::WriteMemory (addr_t addr, const void *buf, size_t size, Error &error)
{
+#if defined (ENABLE_MEMORY_CACHING)
+ m_memory_cache.Flush (addr, size);
+#endif
+
if (buf == NULL || size == 0)
return 0;
// We need to write any data that would go where any current software traps
From ctice at apple.com Fri Jan 7 11:16:03 2011
From: ctice at apple.com (Caroline Tice)
Date: Fri, 07 Jan 2011 17:16:03 -0000
Subject: [Lldb-commits] [lldb] r123002 - /lldb/trunk/www/architecture.html
Message-ID: <20110107171604.0BD582A6C12C@llvm.org>
Author: ctice
Date: Fri Jan 7 11:16:03 2011
New Revision: 123002
URL: http://llvm.org/viewvc/llvm-project?rev=123002&view=rev
Log:
Apply patch from Bruce Mitchener to fix spelling errors.
Modified:
lldb/trunk/www/architecture.html
Modified: lldb/trunk/www/architecture.html
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/www/architecture.html?rev=123002&r1=123001&r2=123002&view=diff
==============================================================================
--- lldb/trunk/www/architecture.html (original)
+++ lldb/trunk/www/architecture.html Fri Jan 7 11:16:03 2011
@@ -59,7 +59,7 @@
Classes can't inherit from any other classes.
Classes can't contain virtual methods.
Classes should be compatible with script bridging utilities like swig.
- Classes should be lighweight and be backed by a single object pointer, shared pointer or global variable in the lldb_private.
+ Classes should be lightweight and be backed by a single object pointer, shared pointer or global variable in the lldb_private.
The interface should be as minimal as possible in order to give a complete API.
By adhering to these rules we should be able to continue to
@@ -104,7 +104,7 @@
or lldb_private::CommandObjectMultiword object.
lldb_private::CommandObjectMultiword are commands that
have subcommands and allow command line commands to be
- logically grouped into a hiearchy.
+ logically grouped into a hierarchy.
lldb_private::CommandObject command line commands
are the objects that implement the functionality of the
command. They can optionally define
From johnny.chen at apple.com Fri Jan 7 14:34:32 2011
From: johnny.chen at apple.com (Johnny Chen)
Date: Fri, 07 Jan 2011 20:34:32 -0000
Subject: [Lldb-commits] [lldb] r123029 -
/lldb/trunk/test/class_types/TestClassTypesDisassembly.py
Message-ID: <20110107203432.96D592A6C12C@llvm.org>
Author: johnny
Date: Fri Jan 7 14:34:32 2011
New Revision: 123029
URL: http://llvm.org/viewvc/llvm-project?rev=123029&view=rev
Log:
Modify disassemble_call_stack_python() to not rely on the "disassemble -n function_name"
command to do the disassembly. Instead, use the Python API.
Modified:
lldb/trunk/test/class_types/TestClassTypesDisassembly.py
Modified: lldb/trunk/test/class_types/TestClassTypesDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypesDisassembly.py?rev=123029&r1=123028&r2=123029&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypesDisassembly.py (original)
+++ lldb/trunk/test/class_types/TestClassTypesDisassembly.py Fri Jan 7 14:34:32 2011
@@ -96,7 +96,15 @@
for i in range(depth - 1):
frame = thread.GetFrameAtIndex(i)
function = frame.GetFunction()
- self.runCmd("disassemble -n '%s'" % function.GetName())
+ # Print the function header.
+ print
+ print function
+ if function.IsValid():
+ # Get all instructions for this function and print them out.
+ insts = function.GetInstructions(target)
+ from lldbutil import lldb_iter
+ for i in lldb_iter(insts, 'GetSize', 'GetInstructionAtIndex'):
+ print i
if __name__ == '__main__':
From gclayton at apple.com Fri Jan 7 16:10:25 2011
From: gclayton at apple.com (Greg Clayton)
Date: Fri, 07 Jan 2011 22:10:25 -0000
Subject: [Lldb-commits] [lldb] r123037 - in /lldb/trunk/test/recurse: ./
Makefile main.c
Message-ID: <20110107221025.EA7772A6C12C@llvm.org>
Author: gclayton
Date: Fri Jan 7 16:10:25 2011
New Revision: 123037
URL: http://llvm.org/viewvc/llvm-project?rev=123037&view=rev
Log:
Added a recursive loop stress test for the unwinder. Not a real world test
by any means, but something to stress test our unwinder with 260,000+ frames
on a standard darwin thread.
Added:
lldb/trunk/test/recurse/
lldb/trunk/test/recurse/Makefile
lldb/trunk/test/recurse/main.c
Added: lldb/trunk/test/recurse/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/recurse/Makefile?rev=123037&view=auto
==============================================================================
--- lldb/trunk/test/recurse/Makefile (added)
+++ lldb/trunk/test/recurse/Makefile Fri Jan 7 16:10:25 2011
@@ -0,0 +1,5 @@
+LEVEL = ../make
+
+C_SOURCES := main.c
+
+include $(LEVEL)/Makefile.rules
Added: lldb/trunk/test/recurse/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/recurse/main.c?rev=123037&view=auto
==============================================================================
--- lldb/trunk/test/recurse/main.c (added)
+++ lldb/trunk/test/recurse/main.c Fri Jan 7 16:10:25 2011
@@ -0,0 +1,28 @@
+#include
+#include
+
+uint32_t
+recurse_crash (uint32_t depth)
+{
+ if (depth > 0)
+ return recurse_crash (depth - 1);
+ return 0;
+}
+
+int
+main (int argc, char const *argv[])
+{
+ // If we have more than one argument, then it should a depth to recurse to.
+ // If we have just the program name as an argument, use UINT32_MAX so we
+ // eventually crash the program by overflowing the stack
+ uint32_t depth = UINT32_MAX;
+ if (argc > 1)
+ {
+ char *end = NULL;
+ depth = strtoul (argv[1], &end, 0);
+ if (end == NULL || *end != '\0')
+ depth = UINT32_MAX;
+ }
+ recurse_crash (depth);
+ return 0;
+}
\ No newline at end of file
From gclayton at apple.com Fri Jan 7 18:05:13 2011
From: gclayton at apple.com (Greg Clayton)
Date: Sat, 08 Jan 2011 00:05:13 -0000
Subject: [Lldb-commits] [lldb] r123045 - in /lldb/trunk:
include/lldb/Core/Address.h include/lldb/Symbol/FuncUnwinders.h
include/lldb/Symbol/UnwindTable.h source/Core/Address.cpp
source/Symbol/FuncUnwinders.cpp source/Symbol/UnwindTable.cpp
Message-ID: <20110108000513.1E4292A6C12C@llvm.org>
Author: gclayton
Date: Fri Jan 7 18:05:12 2011
New Revision: 123045
URL: http://llvm.org/viewvc/llvm-project?rev=123045&view=rev
Log:
Fixed issues with the unwinding code where the collection of FuncUnwinders
was being searched and sorted using a shared pointer as the value which means
the pointer value was what was being searched for. This means that anytime
you did a stack backtrace, the collection of FuncUnwinders doubled and then
the array or shared pointer got sorted (by pointer value), so you had an ever
increasing collection of shared pointer where a match was never found. This
means we had a ton of duplicates in this table and would cause issues after
one had been debugging for a long time.
Modified:
lldb/trunk/include/lldb/Core/Address.h
lldb/trunk/include/lldb/Symbol/FuncUnwinders.h
lldb/trunk/include/lldb/Symbol/UnwindTable.h
lldb/trunk/source/Core/Address.cpp
lldb/trunk/source/Symbol/FuncUnwinders.cpp
lldb/trunk/source/Symbol/UnwindTable.cpp
Modified: lldb/trunk/include/lldb/Core/Address.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=123045&r1=123044&r2=123045&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Fri Jan 7 18:05:12 2011
@@ -434,15 +434,29 @@
lldb::addr_t m_offset; ///< Offset into section if \a m_section != NULL, else the absolute address value.
};
-//bool operator< (const Address& lhs, const Address& rhs);
-//bool operator<= (const Address& lhs, const Address& rhs);
-//bool operator> (const Address& lhs, const Address& rhs);
-//bool operator>= (const Address& lhs, const Address& rhs);
+
+//----------------------------------------------------------------------
+// NOTE: Be careful using this operator. It can correctly compare two
+// addresses from the same Module correctly. It can't compare two
+// addresses from different modules in any meaningful way, but it will
+// compare the module pointers.
+//
+// To sum things up:
+// - works great for addresses within the same module
+// - it works for addresses across multiple modules, but don't expect the
+// address results to make much sense
+//
+// This basically lets Address objects be used in ordered collection
+// classes.
+//----------------------------------------------------------------------
+bool operator< (const Address& lhs, const Address& rhs);
+bool operator> (const Address& lhs, const Address& rhs);
+
+
+
bool operator== (const Address& lhs, const Address& rhs);
bool operator!= (const Address& lhs, const Address& rhs);
-//Stream& operator << (Stream& strm, const Address& so_addr);
-
} // namespace lldb_private
#endif // liblldb_Address_h_
Modified: lldb/trunk/include/lldb/Symbol/FuncUnwinders.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/FuncUnwinders.h?rev=123045&r1=123044&r2=123045&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/FuncUnwinders.h (original)
+++ lldb/trunk/include/lldb/Symbol/FuncUnwinders.h Fri Jan 7 18:05:12 2011
@@ -72,26 +72,22 @@
UnwindAssemblyProfiler *m_assembly_profiler;
AddressRange m_range;
- UnwindPlan* m_unwind_at_call_site;
- UnwindPlan* m_unwind_at_non_call_site;
- UnwindPlan* m_fast_unwind;
- UnwindPlan* m_arch_default_unwind;
-
+ std::auto_ptr m_unwind_at_call_site_ap;
+ std::auto_ptr m_unwind_at_non_call_site_ap;
+ std::auto_ptr m_fast_unwind_ap;
+ UnwindPlan *m_arch_default_unwind;
+
+ bool m_tried_unwind_at_call_site:1,
+ m_tried_unwind_at_non_call_site:1,
+ m_tried_fast_unwind:1,
+ m_tried_arch_default_unwind:1;
+
Address m_first_non_prologue_insn;
DISALLOW_COPY_AND_ASSIGN (FuncUnwinders);
}; // class FuncUnwinders
-inline bool
-operator<(const FuncUnwinders& a, const FuncUnwinders& b)
-{
- if (a.GetFunctionStartAddress().GetOffset() < b.GetFunctionStartAddress().GetOffset())
- return true;
- else
- return false;
-}
-
} // namespace lldb_private
Modified: lldb/trunk/include/lldb/Symbol/UnwindTable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/UnwindTable.h?rev=123045&r1=123044&r2=123045&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/UnwindTable.h (original)
+++ lldb/trunk/include/lldb/Symbol/UnwindTable.h Fri Jan 7 18:05:12 2011
@@ -11,7 +11,7 @@
#ifndef liblldb_UnwindTable_h
#define liblldb_UnwindTable_h
-#include
+#include