[Lldb-commits] [lldb] r161039 - in /lldb/branches/apple/python-GIL: ./ source/Host/common/Host.cpp source/Target/ExecutionContext.cpp source/Target/SectionLoadList.cpp
Filipe Cabecinhas
me at filcab.net
Tue Jul 31 01:12:29 PDT 2012
Author: filcab
Date: Tue Jul 31 03:12:29 2012
New Revision: 161039
URL: http://llvm.org/viewvc/llvm-project?rev=161039&view=rev
Log:
Merge changes from ToT trunk.
Modified:
lldb/branches/apple/python-GIL/ (props changed)
lldb/branches/apple/python-GIL/source/Host/common/Host.cpp
lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp
lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp
Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 31 03:12:29 2012
@@ -1 +1 @@
-/lldb/trunk:156467-160909
+/lldb/trunk:156467-161013
Modified: lldb/branches/apple/python-GIL/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/common/Host.cpp?rev=161039&r1=161038&r2=161039&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/common/Host.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Host/common/Host.cpp Tue Jul 31 03:12:29 2012
@@ -992,9 +992,11 @@
case ePathTypePythonDir:
{
// TODO: Anyone know how we can determine this for linux? Other systems?
- // For linux we are currently assuming the location of the lldb
- // binary that contains this function is the directory that will
- // contain lldb.so, lldb.py and embedded_interpreter.py...
+ // For linux and FreeBSD we are currently assuming the
+ // location of the lldb binary that contains this function is
+ // the directory that will contain a python directory which
+ // has our lldb module. This is how files get placed when
+ // compiling with Makefiles.
static ConstString g_lldb_python_dir;
if (!g_lldb_python_dir)
@@ -1013,6 +1015,10 @@
framework_pos += strlen("LLDB.framework");
::strncpy (framework_pos, "/Resources/Python", PATH_MAX - (framework_pos - raw_path));
}
+#else
+ // We may get our string truncated. Should we protect
+ // this with an assert?
+ ::strncat(raw_path, "/python", sizeof(raw_path) - strlen(raw_path) - 1);
#endif
FileSpec::Resolve (raw_path, resolved_path, sizeof(resolved_path));
g_lldb_python_dir.SetCString(resolved_path);
Modified: lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp?rev=161039&r1=161038&r2=161039&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp Tue Jul 31 03:12:29 2012
@@ -8,6 +8,8 @@
//===----------------------------------------------------------------------===//
#include "lldb/Target/ExecutionContext.h"
+
+#include "lldb/Core/State.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Process.h"
@@ -639,18 +641,22 @@
m_process_wp = process_sp;
if (process_sp)
{
- lldb::ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread());
- if (!thread_sp)
- thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0);
-
- if (thread_sp && process_sp->GetState() == lldb::eStateStopped)
+ // Only fill in the thread and frame if our process is stopped
+ if (StateIsStoppedState (process_sp->GetState(), true))
{
- SetThreadSP (thread_sp);
- lldb::StackFrameSP frame_sp (thread_sp->GetSelectedFrame());
- if (!frame_sp)
- frame_sp = thread_sp->GetStackFrameAtIndex(0);
- if (frame_sp)
- SetFrameSP (frame_sp);
+ lldb::ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread());
+ if (!thread_sp)
+ thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0);
+
+ if (thread_sp)
+ {
+ SetThreadSP (thread_sp);
+ lldb::StackFrameSP frame_sp (thread_sp->GetSelectedFrame());
+ if (!frame_sp)
+ frame_sp = thread_sp->GetStackFrameAtIndex(0);
+ if (frame_sp)
+ SetFrameSP (frame_sp);
+ }
}
}
}
Modified: lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp?rev=161039&r1=161038&r2=161039&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp Tue Jul 31 03:12:29 2012
@@ -109,12 +109,16 @@
ModuleSP module_sp (section->GetModule());
if (module_sp)
{
- module_sp->ReportWarning ("address 0x%16.16llx maps to more than one section: %s.%s and %s.%s",
- load_addr,
- module_sp->GetFileSpec().GetFilename().GetCString(),
- section->GetName().GetCString(),
- ats_pos->second->GetModule()->GetFileSpec().GetFilename().GetCString(),
- ats_pos->second->GetName().GetCString());
+ ModuleSP curr_module_sp (ats_pos->second->GetModule());
+ if (curr_module_sp)
+ {
+ module_sp->ReportWarning ("address 0x%16.16llx maps to more than one section: %s.%s and %s.%s",
+ load_addr,
+ module_sp->GetFileSpec().GetFilename().GetCString(),
+ section->GetName().GetCString(),
+ curr_module_sp->GetFileSpec().GetFilename().GetCString(),
+ ats_pos->second->GetName().GetCString());
+ }
}
}
ats_pos->second = section;
More information about the lldb-commits
mailing list