Re: [Lldb-commits] [PATCH] D15046: Fix for TestNoreturnUnwind.py on i386

2015-12-02 Thread Ravitheja Addepally via lldb-commits
ravitheja added a comment.

The reason assembly unwind did not work is because if the ebp register is set 
to 0 at that time, so the CFA is not available. In the case of clang the frame 
pointer is not set by any function, which is why the formula does not work.

(lldb) image show-unwind -n __kernel_vsyscall
UNWIND PLANS for [vdso]`__kernel_vsyscall (start addr 0xf7fd9d70)

Asynchronous (not restricted to call-sites) UnwindPlan is 'assembly insn 
profiling'
Synchronous (restricted to call-sites) UnwindPlan is 'eh_frame CFI'

Assembly language inspection UnwindPlan:
This UnwindPlan originally sourced from assembly insn profiling
This UnwindPlan is sourced from the compiler: no.
This UnwindPlan is valid at all instruction locations: yes.
Address range of this UnwindPlan: [[vdso]..text + 1600-0x0654)
row[0]:0: CFA=esp +4 => esp=CFA+0 eip=[CFA-4] 
row[1]:1: CFA=esp +8 => esp=CFA+0 eip=[CFA-4] 
row[2]:2: CFA=esp+12 => esp=CFA+0 eip=[CFA-4] 
row[3]:3: CFA=esp+16 => ebp=[CFA-16] esp=CFA+0 eip=[CFA-4] 
row[4]:5: CFA=ebp+16 => ebp=[CFA-16] esp=CFA+0 eip=[CFA-4] 
row[5]:   17: CFA=esp+12 => esp=CFA+0 eip=[CFA-4] 
row[6]:   18: CFA=esp +8 => esp=CFA+0 eip=[CFA-4] 
row[7]:   19: CFA=esp +4 => esp=CFA+0 eip=[CFA-4]

eh_frame UnwindPlan:
This UnwindPlan originally sourced from eh_frame CFI
This UnwindPlan is sourced from the compiler: yes.
This UnwindPlan is valid at all instruction locations: no.
Address range of this UnwindPlan: [[vdso]..text + 1600-0x0654)
row[0]:0: CFA=esp +4 => eip=[CFA-4] 
row[1]:1: CFA=esp +8 => eip=[CFA-4] 
row[2]:2: CFA=esp+12 => eip=[CFA-4] 
row[3]:3: CFA=esp+16 => ebp=[CFA-16] eip=[CFA-4] 
row[4]:   17: CFA=esp+12 => ebp=[CFA-16] eip=[CFA-4] 
row[5]:   18: CFA=esp +8 => ebp=[CFA-16] eip=[CFA-4] 
row[6]:   19: CFA=esp +4 => ebp=[CFA-16] eip=[CFA-4]

Arch default UnwindPlan:
This UnwindPlan originally sourced from i386 default unwind plan
This UnwindPlan is sourced from the compiler: no.
This UnwindPlan is valid at all instruction locations: no.
row[0]:0: CFA=ebp +8 => esp=CFA+0 ebp=[CFA-8] eip=[CFA-4]

Arch default at entry point UnwindPlan:
This UnwindPlan originally sourced from i386 at-func-entry default
This UnwindPlan is sourced from the compiler: no.
This UnwindPlan is valid at all instruction locations: not specified.
row[0]:0: CFA=esp +4 => esp=CFA+0 eip=[CFA-4]


http://reviews.llvm.org/D15046



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r254499 - PTRACE ABI to read FXSAVE area for 32-bit inferior

2015-12-02 Thread Abhishek Aggarwal via lldb-commits
Author: abhishek
Date: Wed Dec  2 03:40:17 2015
New Revision: 254499

URL: http://llvm.org/viewvc/llvm-project?rev=254499&view=rev
Log:
PTRACE ABI to read FXSAVE area for 32-bit inferior

Summary:
 - Problem occurs when:
-- 32-bit inferiors run on x86_32 machine and
   the architecture doesn't have AVX feature

-- This causes FPRType to be set to eFPRTypeFXSAVE

-- PTRACE_GETFPREGS was being used to read FXSAVE area

-- For 32-bit inferiors running on x86_32 machine,
   PTRACE_GETFPREGS reads FSAVE area and not FXSAVE area

 - Changed ptrace API to PTRACE_GETREGSET for 32-bit inferiors
-- This reads FPR data in FXSAVE format.
-- For 64-bit inferiors, no change has been made.

 - Modified XFAIL for TestReturnValue.py
-- Earlier, this test was passing for Linux OS
-- Now, it passes for Android OS as well

Change-Id: Ieed72bc969b79516fc7b263b32493aa1e7a1a2ac
Signed-off-by: Abhishek Aggarwal 

Reviewers: ovyalov, jingham, lldb-commits, tberghammer, labath

Subscribers: jevinskie, labath, tberghammer, danalbert

Differential Revision: http://reviews.llvm.org/D15042

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py?rev=254499&r1=254498&r2=254499&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
 Wed Dec  2 03:40:17 2015
@@ -16,7 +16,7 @@ class ReturnValueTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailurei386
+@expectedFailureAll(oslist=["macosx","freebsd"], archs=["i386"])
 @expectedFailureWindows("llvm.org/pr24778")
 @add_test_categories(['pyapi'])
 def test_with_python(self):

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=254499&r1=254498&r2=254499&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
Wed Dec  2 03:40:17 2015
@@ -327,6 +327,9 @@ namespace
 #ifndef NT_X86_XSTATE
 #define NT_X86_XSTATE 0x202
 #endif
+#ifndef NT_PRXFPREG
+#define NT_PRXFPREG 0x46e62b7f
+#endif
 
 NativeRegisterContextLinux*
 NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(const 
ArchSpec& target_arch,
@@ -832,6 +835,7 @@ NativeRegisterContextLinux_x86_64::IsGPR
 NativeRegisterContextLinux_x86_64::FPRType
 NativeRegisterContextLinux_x86_64::GetFPRType () const
 {
+Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
 if (m_fpr_type == eFPRTypeNotValid)
 {
 // TODO: Use assembly to call cpuid on the inferior and query ebx or 
ecx.
@@ -842,9 +846,15 @@ NativeRegisterContextLinux_x86_64::GetFP
 {
 // Fall back to general floating point with no AVX support.
 m_fpr_type = eFPRTypeFXSAVE;
+
+// Check if FXSAVE area can be read.
+if 
(const_cast(this)->ReadFPR().Fail())
+{
+if (log)
+log->Printf("NativeRegisterContextLinux_x86_64::%s ptrace 
APIs failed to read XSAVE/FXSAVE area", __FUNCTION__);
+}
 }
 }
-
 return m_fpr_type;
 }
 
@@ -868,10 +878,24 @@ Error
 NativeRegisterContextLinux_x86_64::WriteFPR()
 {
 const FPRType fpr_type = GetFPRType ();
+const lldb_private::ArchSpec& target_arch = 
GetRegisterInfoInterface().GetTargetArchitecture();
 switch (fpr_type)
 {
 case FPRType::eFPRTypeFXSAVE:
-return NativeRegisterContextLinux::WriteFPR();
+// For 32-bit inferiors on x86_32/x86_64 architectures,
+// FXSAVE area can be written using PTRACE_SETREGSET ptrace api
+// For 64-bit inferiors on x86_64 architectures,
+// FXSAVE area can be written using PTRACE_SETFPREGS ptrace api
+switch (target_arch.GetMachine ())
+{
+case llvm::Triple::x86:
+return WriteRegisterSet(&m_iovec, sizeof(m_fpr.xstate.xsave), 
NT_PRXFPREG);
+case llvm::Triple::x86_64:
+return NativeRegisterContextLinux::WriteFPR();
+default:
+assert(false && "Unhandled target architecture.");
+break;
+}
 case FPRType::eFPRTypeXSAVE:
 return WriteRe

[Lldb-commits] [lldb] r254502 - Revert "Added support for -gmodule debugging when debug info is left in the .o files on Darwin."

2015-12-02 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Wed Dec  2 05:35:54 2015
New Revision: 254502

URL: http://llvm.org/viewvc/llvm-project?rev=254502&view=rev
Log:
Revert "Added support for -gmodule debugging when debug info is left in the .o 
files on Darwin."

The commit caused a test failure on the linux buildbot in
TestDataFormatterSynthVal.

Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/SymbolVendor.h
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/include/lldb/lldb-private-enumerations.h

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/ClangASTImporter.cpp
lldb/trunk/source/Symbol/ClangExternalASTSourceCallbacks.cpp
lldb/trunk/source/Symbol/SymbolFile.cpp
lldb/trunk/source/Symbol/SymbolVendor.cpp
lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=254502&r1=254501&r2=254502&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Wed Dec  2 05:35:54 2015
@@ -1006,18 +1006,10 @@ public:
lldb::AccessType access,
bool is_artificial);
 
-static bool
+bool
 SetHasExternalStorage (lldb::opaque_compiler_type_t type, bool has_extern);
 
-
-static bool
-CanImport (const CompilerType &type, lldb_private::ClangASTImporter 
&importer);
-
-static bool
-Import (const CompilerType &type, lldb_private::ClangASTImporter 
&importer);
-
-static bool
-GetHasExternalStorage (const CompilerType &type);
+
 //--
 // Tag Declarations
 //--
@@ -1100,19 +1092,13 @@ public:
 
 void
 DumpTypeDescription (lldb::opaque_compiler_type_t type, Stream *s) 
override;
-
-static void
-DumpTypeName (const CompilerType &type);
-
+
 static clang::EnumDecl *
 GetAsEnumDecl (const CompilerType& type);
 
 static clang::RecordDecl *
 GetAsRecordDecl (const CompilerType& type);
-
-static clang::TagDecl *
-GetAsTagDecl (const CompilerType& type);
-
+
 clang::CXXRecordDecl *
 GetAsCXXRecordDecl (lldb::opaque_compiler_type_t type);
 
@@ -1123,12 +1109,9 @@ public:
 GetQualType (const CompilerType& type)
 {
 // Make sure we have a clang type before making a clang::QualType
-if (type.GetOpaqueQualType())
-{
-ClangASTContext *ast = 
llvm::dyn_cast_or_null(type.GetTypeSystem());
-if (ast)
-return 
clang::QualType::getFromOpaquePtr(type.GetOpaqueQualType());
-}
+ClangASTContext *ast = 
llvm::dyn_cast_or_null(type.GetTypeSystem());
+if (ast)
+return clang::QualType::getFromOpaquePtr(type.GetOpaqueQualType());
 return clang::QualType();
 }
 

Modified: lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTImporter.h?rev=254502&r1=254501&r2=254502&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTImporter.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTImporter.h Wed Dec  2 05:35:54 2015
@@ -107,11 +107,7 @@ public:
 CopyType (clang::ASTContext *dst_ctx,
   clang::ASTContext *src_ctx,
   lldb::opaque_compiler_type_t type);
-
-CompilerType
-CopyType (ClangASTContext &dst,
-  const CompilerType &src_type);
-
+
 clang::Decl *
 CopyDecl (clang::ASTContext *dst_ctx,
   clang::ASTContext *src_ctx,
@@ -138,10 +134,7 @@ public:
 
 bool
 CompleteObjCInterfaceDecl (clang::ObjCInterfaceDecl *interface_decl);
-
-bool
-CompleteAndFetchChildren (clang::QualType type);
-
+
 bool
 RequireCompleteType (clang::QualType type);
 

Modified: lldb/trunk/include/lld

[Lldb-commits] [lldb] r254504 - Fix "process load/unload" on android

2015-12-02 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Wed Dec  2 05:58:51 2015
New Revision: 254504

URL: http://llvm.org/viewvc/llvm-project?rev=254504&view=rev
Log:
Fix "process load/unload" on android

On android the symbols exposed by libdl (dlopen, dlclose, dlerror)
prefixed by "__dl_". This change moves the handling of process
load/unload to the platform object and override it for android to
handle the special prefix.

Differential revision: http://reviews.llvm.org/D11465

Modified:
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/include/lldb/Target/Process.h

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
lldb/trunk/source/API/SBProcess.cpp
lldb/trunk/source/Commands/CommandObjectProcess.cpp
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=254504&r1=254503&r2=254504&view=diff
==
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Wed Dec  2 05:58:51 2015
@@ -987,9 +987,41 @@ class ModuleCache;
 virtual uint32_t
 GetDefaultMemoryCacheLineSize() { return 0; }
 
+//--
+/// Load a shared library into this process.
+///
+/// Try and load a shared library into the current process. This
+/// call might fail in the dynamic loader plug-in says it isn't safe
+/// to try and load shared libraries at the moment.
+///
+/// @param[in] process
+/// The process to load the image.
+///
+/// @param[in] image_spec
+/// The image file spec that points to the shared library that
+/// you want to load.
+///
+/// @param[out] error
+/// An error object that gets filled in with any errors that
+/// might occur when trying to load the shared library.
+///
+/// @return
+/// A token that represents the shared library that can be
+/// later used to unload the shared library. A value of
+/// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared
+/// library can't be opened.
+//--
+virtual uint32_t
+LoadImage (lldb_private::Process* process,
+   const lldb_private::FileSpec& image_spec,
+   lldb_private::Error& error);
+
+virtual Error
+UnloadImage (lldb_private::Process* process, uint32_t image_token);
+
 protected:
 bool m_is_host;
-// Set to true when we are able to actually set the OS version while 
+// Set to true when we are able to actually set the OS version while
 // being connected. For remote platforms, we might set the version 
ahead
 // of time before we actually connect and this version might change 
when
 // we actually connect to a remote platform. For the host platform this

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=254504&r1=254503&r2=254504&view=diff
==
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Wed Dec  2 05:58:51 2015
@@ -1235,33 +1235,6 @@ public:
 GetImageInfoAddress ();
 
 //--
-/// Load a shared library into this process.
-///
-/// Try and load a shared library into the current process. This
-/// call might fail in the dynamic loader plug-in says it isn't safe
-/// to try and load shared libraries at the moment.
-///
-/// @param[in] image_spec
-/// The image file spec that points to the shared library that
-/// you want to load.
-///
-/// @param[out] error
-/// An error object that gets filled in with any errors that
-/// might occur when trying to load the shared library.
-///
-/// @return
-/// A token that represents the shared library that can be
-/// later used to unload the shared library. A value of
-/// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared
-/// library can't be opened.
-//--
-virtual uint32_t
-LoadImage (const FileSpec &image_spec, Error 

Re: [Lldb-commits] [PATCH] D11465: Fix "process load/unload" on android

2015-12-02 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL254504: Fix "process load/unload" on android (authored by 
tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D11465?vs=41491&id=41608#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11465

Files:
  lldb/trunk/include/lldb/Target/Platform.h
  lldb/trunk/include/lldb/Target/Process.h
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
  lldb/trunk/source/API/SBProcess.cpp
  lldb/trunk/source/Commands/CommandObjectProcess.cpp
  lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
  lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
  lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
  lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h
  lldb/trunk/source/Target/Platform.cpp
  lldb/trunk/source/Target/Process.cpp

Index: lldb/trunk/source/Commands/CommandObjectProcess.cpp
===
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp
@@ -1204,8 +1204,9 @@
 Error error;
 const char *image_path = command.GetArgumentAtIndex(i);
 FileSpec image_spec (image_path, false);
-process->GetTarget().GetPlatform()->ResolveRemotePath(image_spec, image_spec);
-uint32_t image_token = process->LoadImage(image_spec, error);
+PlatformSP platform = process->GetTarget().GetPlatform();
+platform->ResolveRemotePath(image_spec, image_spec);
+uint32_t image_token = platform->LoadImage(process, image_spec, error);
 if (image_token != LLDB_INVALID_IMAGE_TOKEN)
 {
 result.AppendMessageWithFormat ("Loading \"%s\"...ok\nImage %u loaded.\n", image_path, image_token);  
@@ -1267,7 +1268,7 @@
 }
 else
 {
-Error error (process->UnloadImage(image_token));
+Error error (process->GetTarget().GetPlatform()->UnloadImage(process, image_token));
 if (error.Success())
 {
 result.AppendMessageWithFormat ("Unloading shared library with index %u...ok\n", image_token);  
Index: lldb/trunk/source/Target/Platform.cpp
===
--- lldb/trunk/source/Target/Platform.cpp
+++ lldb/trunk/source/Target/Platform.cpp
@@ -1983,3 +1983,16 @@
 return Host::GetUnixSignals();
 return GetRemoteUnixSignals();
 }
+
+uint32_t
+Platform::LoadImage(lldb_private::Process* process, const FileSpec& image_spec, Error& error)
+{
+error.SetErrorString("LoadImage is not supported on the current platform");
+return LLDB_INVALID_IMAGE_TOKEN;
+}
+
+Error
+Platform::UnloadImage(lldb_private::Process* process, uint32_t image_token)
+{
+return Error("UnLoadImage is not supported on the current platform");
+}
Index: lldb/trunk/source/Target/Process.cpp
===
--- lldb/trunk/source/Target/Process.cpp
+++ lldb/trunk/source/Target/Process.cpp
@@ -1885,223 +1885,6 @@
 return LLDB_INVALID_ADDRESS;
 }
 
-//--
-// LoadImage
-//
-// This function provides a default implementation that works for most
-// unix variants. Any Process subclasses that need to do shared library
-// loading differently should override LoadImage and UnloadImage and
-// do what is needed.
-//--
-uint32_t
-Process::LoadImage (const FileSpec &image_spec, Error &error)
-{
-if (m_finalizing)
-{
-error.SetErrorString("process is tearing itself down");
-return LLDB_INVALID_IMAGE_TOKEN;
-}
-
-char path[PATH_MAX];
-image_spec.GetPath(path, sizeof(path));
-
-DynamicLoader *loader = GetDynamicLoader();
-if (loader)
-{
-error = loader->CanLoadImage();
-if (error.Fail())
-return LLDB_INVALID_IMAGE_TOKEN;
-}
-
-if (error.Success())
-{
-ThreadSP thread_sp(GetThreadList ().GetSelectedThread());
-
-if (thread_sp)
-{
-StackFrameSP frame_sp (thread_sp->GetStackFrameAtIndex (0));
-
-if (frame_sp)
-{
-ExecutionContext exe_ctx;
-frame_sp->CalculateExecutionContext (exe_ctx);
-EvaluateExpressionOptions expr_options;
-expr_options.SetUnwindOnError(true);
-expr_options.SetIgnoreBreakpoints(true);
-expr_options.SetExecutionPolicy(eExecutionPolicyAlways);
-expr_options.SetResultIsInternal(true);
-expr_options.SetLanguage(eLanguageTypeC_plus_plus);
-
-StreamString expr;
-expr.Print

[Lldb-commits] [lldb] r254507 - XFAIL TestReturnValue for linux i386 clang 3.5-3.6

2015-12-02 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Wed Dec  2 07:36:17 2015
New Revision: 254507

URL: http://llvm.org/viewvc/llvm-project?rev=254507&view=rev
Log:
XFAIL TestReturnValue for linux i386 clang 3.5-3.6

The test failing most likely because clang 3.5 and 3.6 uses an incorrect
ABI for returning small structs from  a function.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py?rev=254507&r1=254506&r2=254507&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
 Wed Dec  2 07:36:17 2015
@@ -17,6 +17,7 @@ class ReturnValueTestCase(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 @expectedFailureAll(oslist=["macosx","freebsd"], archs=["i386"])
+@expectedFailureAll(oslist=["linux"], compiler="clang", 
compiler_version=["<=", "3.6"], archs=["i386"])
 @expectedFailureWindows("llvm.org/pr24778")
 @add_test_categories(['pyapi'])
 def test_with_python(self):


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r254499 - PTRACE ABI to read FXSAVE area for 32-bit inferior

2015-12-02 Thread Tamas Berghammer via lldb-commits
Hi Abhishek,

After this change TestReturnValue.py is failing on Linux with i386 inferior
when compiling the inferior with clang-3.5 (it passes with gcc and with ToT
clang). I marked the test XFAIL for that specific configuration to get the
buildbot green but can you take a look?

My suspicion is that clang 3.5 and 3.6 uses an incorrect ABI for returning
small structs from functions (returning it in register instead of in memory
pointed by a register) what causing the issue but I am not certain.

Thanks,
Tamas

On Wed, Dec 2, 2015 at 9:43 AM Abhishek Aggarwal via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: abhishek
> Date: Wed Dec  2 03:40:17 2015
> New Revision: 254499
>
> URL: http://llvm.org/viewvc/llvm-project?rev=254499&view=rev
> Log:
> PTRACE ABI to read FXSAVE area for 32-bit inferior
>
> Summary:
>  - Problem occurs when:
> -- 32-bit inferiors run on x86_32 machine and
>the architecture doesn't have AVX feature
>
> -- This causes FPRType to be set to eFPRTypeFXSAVE
>
> -- PTRACE_GETFPREGS was being used to read FXSAVE area
>
> -- For 32-bit inferiors running on x86_32 machine,
>PTRACE_GETFPREGS reads FSAVE area and not FXSAVE area
>
>  - Changed ptrace API to PTRACE_GETREGSET for 32-bit inferiors
> -- This reads FPR data in FXSAVE format.
> -- For 64-bit inferiors, no change has been made.
>
>  - Modified XFAIL for TestReturnValue.py
> -- Earlier, this test was passing for Linux OS
> -- Now, it passes for Android OS as well
>
> Change-Id: Ieed72bc969b79516fc7b263b32493aa1e7a1a2ac
> Signed-off-by: Abhishek Aggarwal 
>
> Reviewers: ovyalov, jingham, lldb-commits, tberghammer, labath
>
> Subscribers: jevinskie, labath, tberghammer, danalbert
>
> Differential Revision: http://reviews.llvm.org/D15042
>
> Modified:
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
>
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py?rev=254499&r1=254498&r2=254499&view=diff
>
> ==
> ---
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
> (original)
> +++
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
> Wed Dec  2 03:40:17 2015
> @@ -16,7 +16,7 @@ class ReturnValueTestCase(TestBase):
>
>  mydir = TestBase.compute_mydir(__file__)
>
> -@expectedFailurei386
> +@expectedFailureAll(oslist=["macosx","freebsd"], archs=["i386"])
>  @expectedFailureWindows("llvm.org/pr24778")
>  @add_test_categories(['pyapi'])
>  def test_with_python(self):
>
> Modified:
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=254499&r1=254498&r2=254499&view=diff
>
> ==
> ---
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> (original)
> +++
> lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> Wed Dec  2 03:40:17 2015
> @@ -327,6 +327,9 @@ namespace
>  #ifndef NT_X86_XSTATE
>  #define NT_X86_XSTATE 0x202
>  #endif
> +#ifndef NT_PRXFPREG
> +#define NT_PRXFPREG 0x46e62b7f
> +#endif
>
>  NativeRegisterContextLinux*
>  NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(const
> ArchSpec& target_arch,
> @@ -832,6 +835,7 @@ NativeRegisterContextLinux_x86_64::IsGPR
>  NativeRegisterContextLinux_x86_64::FPRType
>  NativeRegisterContextLinux_x86_64::GetFPRType () const
>  {
> +Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
>  if (m_fpr_type == eFPRTypeNotValid)
>  {
>  // TODO: Use assembly to call cpuid on the inferior and query ebx
> or ecx.
> @@ -842,9 +846,15 @@ NativeRegisterContextLinux_x86_64::GetFP
>  {
>  // Fall back to general floating point with no AVX support.
>  m_fpr_type = eFPRTypeFXSAVE;
> +
> +// Check if FXSAVE area can be read.
> +if
> (const_cast(this)->ReadFPR().Fail())
> +{
> +if (log)
> +log->Printf("NativeRegisterContextLinux_x86_64::%s
> ptrace APIs failed to read XSAVE/FXSAVE area", __FUNCTION__);
> +}
>  }
>  }
> -
>  return m_fpr_type;
>  }
>
> @@ -868,10 +878,24 @@ Error
>  NativeRegisterContextLinux_x86_64::WriteFPR()
>  {
>  const FPRType fpr_type = GetFPRType ();
> +const lldb_private::ArchSpec& target_arch =
> GetRegisterInfoInterface().GetTargetArchitecture();
>  switch (fpr_type)
>  {
>  case

Re: [Lldb-commits] [lldb] r254499 - PTRACE ABI to read FXSAVE area for 32-bit inferior

2015-12-02 Thread Aggarwal, Abhishek A via lldb-commits
Hi Tamas

Yes, it was a bug in clang that I had submitted some months ago (ID: 23491) and 
it was fixed. But the fix is not present in clang 3.5/3.6. Hence, the failure 
is occurring.

Thanks & Regards
Abhishek Aggarwal

From: Tamas Berghammer [mailto:tbergham...@google.com]
Sent: Wednesday, December 2, 2015 2:41 PM
To: Aggarwal, Abhishek A ; 
lldb-commits@lists.llvm.org
Subject: Re: [Lldb-commits] [lldb] r254499 - PTRACE ABI to read FXSAVE area for 
32-bit inferior

Hi Abhishek,

After this change TestReturnValue.py is failing on Linux with i386 inferior 
when compiling the inferior with clang-3.5 (it passes with gcc and with ToT 
clang). I marked the test XFAIL for that specific configuration to get the 
buildbot green but can you take a look?

My suspicion is that clang 3.5 and 3.6 uses an incorrect ABI for returning 
small structs from functions (returning it in register instead of in memory 
pointed by a register) what causing the issue but I am not certain.

Thanks,
Tamas

On Wed, Dec 2, 2015 at 9:43 AM Abhishek Aggarwal via lldb-commits 
mailto:lldb-commits@lists.llvm.org>> wrote:
Author: abhishek
Date: Wed Dec  2 03:40:17 2015
New Revision: 254499

URL: http://llvm.org/viewvc/llvm-project?rev=254499&view=rev
Log:
PTRACE ABI to read FXSAVE area for 32-bit inferior

Summary:
 - Problem occurs when:
-- 32-bit inferiors run on x86_32 machine and
   the architecture doesn't have AVX feature

-- This causes FPRType to be set to eFPRTypeFXSAVE

-- PTRACE_GETFPREGS was being used to read FXSAVE area

-- For 32-bit inferiors running on x86_32 machine,
   PTRACE_GETFPREGS reads FSAVE area and not FXSAVE area

 - Changed ptrace API to PTRACE_GETREGSET for 32-bit inferiors
-- This reads FPR data in FXSAVE format.
-- For 64-bit inferiors, no change has been made.

 - Modified XFAIL for TestReturnValue.py
-- Earlier, this test was passing for Linux OS
-- Now, it passes for Android OS as well

Change-Id: Ieed72bc969b79516fc7b263b32493aa1e7a1a2ac
Signed-off-by: Abhishek Aggarwal 
mailto:abhishek.a.aggar...@intel.com>>

Reviewers: ovyalov, jingham, lldb-commits, tberghammer, labath

Subscribers: jevinskie, labath, tberghammer, danalbert

Differential Revision: http://reviews.llvm.org/D15042

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py?rev=254499&r1=254498&r2=254499&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
 Wed Dec  2 03:40:17 2015
@@ -16,7 +16,7 @@ class ReturnValueTestCase(TestBase):

 mydir = TestBase.compute_mydir(__file__)

-@expectedFailurei386
+@expectedFailureAll(oslist=["macosx","freebsd"], archs=["i386"])
 @expectedFailureWindows("llvm.org/pr24778")
 @add_test_categories(['pyapi'])
 def test_with_python(self):

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=254499&r1=254498&r2=254499&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
Wed Dec  2 03:40:17 2015
@@ -327,6 +327,9 @@ namespace
 #ifndef NT_X86_XSTATE
 #define NT_X86_XSTATE 0x202
 #endif
+#ifndef NT_PRXFPREG
+#define NT_PRXFPREG 0x46e62b7f
+#endif

 NativeRegisterContextLinux*
 NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(const 
ArchSpec& target_arch,
@@ -832,6 +835,7 @@ NativeRegisterContextLinux_x86_64::IsGPR
 NativeRegisterContextLinux_x86_64::FPRType
 NativeRegisterContextLinux_x86_64::GetFPRType () const
 {
+Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
 if (m_fpr_type == eFPRTypeNotValid)
 {
 // TODO: Use assembly to call cpuid on the inferior and query ebx or 
ecx.
@@ -842,9 +846,15 @@ NativeRegisterContextLinux_x86_64::GetFP
 {
 // Fall back to general floating point with no AVX support.
 m_fpr_type = eFPRTypeFXSAVE;
+
+// Check if FXSAVE area can be read.
+if 
(const_cast(this)->ReadFPR().Fail())
+{
+if (log)
+log->Printf("NativeRegisterContextLinux_x86_64::%s ptrace 
APIs failed to read XSAVE/FXSAVE area", 

[Lldb-commits] [PATCH] D15152: Change Platform::LoadImage to copy the file to the remote platform

2015-12-02 Thread Tamas Berghammer via lldb-commits
tberghammer created this revision.
tberghammer added reviewers: labath, clayborg.
tberghammer added a subscriber: lldb-commits.
Herald added subscribers: danalbert, tberghammer, emaste.

Change Platform::LoadImage to copy the file to the remote platform

The new implementation mimic the behavior of "process launch" what also copy 
the target executable from the host to the target.

http://reviews.llvm.org/D15152

Files:
  packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
  source/Plugins/Platform/Android/PlatformAndroid.cpp
  source/Plugins/Platform/POSIX/PlatformPOSIX.cpp

Index: source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
===
--- source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -903,6 +903,16 @@
 char path[PATH_MAX];
 image_spec.GetPath(path, sizeof(path));
 
+if (IsRemote() && IsConnected())
+{
+FileSpec remote_file = GetRemoteWorkingDirectory();
+remote_file.AppendPathComponent(image_spec.GetFilename().GetCString());
+error = Install(image_spec, remote_file);
+if (error.Fail())
+return LLDB_INVALID_IMAGE_TOKEN;
+remote_file.GetPath(path, sizeof(path));
+}
+
 StreamString expr;
 expr.Printf(R"(
struct __lldb_dlopen_result { void *image_ptr; const char 
*error_str; } the_result;
Index: source/Plugins/Platform/Android/PlatformAndroid.cpp
===
--- source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -383,6 +383,16 @@
 char path[PATH_MAX];
 image_spec.GetPath(path, sizeof(path));
 
+if (IsRemote() && IsConnected())
+{
+FileSpec remote_file = GetRemoteWorkingDirectory();
+remote_file.AppendPathComponent(image_spec.GetFilename().GetCString());
+error = Install(image_spec, remote_file);
+if (error.Fail())
+return LLDB_INVALID_IMAGE_TOKEN;
+remote_file.GetPath(path, sizeof(path));
+}
+
 StreamString expr;
 expr.Printf(R"(
struct __lldb_dlopen_result { void *image_ptr; const char 
*error_str; } the_result;
Index: 
packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
===
--- packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
+++ packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
@@ -210,18 +210,13 @@
 else:
 dylibName = 'libloadunload_a.so'
 
-if lldb.remote_platform:
-dylibPath = os.path.join(shlib_dir, dylibName)
-else:
-dylibPath = dylibName
-
 # Make sure that a_function does not exist at this point.
 self.expect("image lookup -n a_function", "a_function should not exist 
yet",
 error=True, matching=False, patterns = ["1 match found"])
 
 # Use lldb 'process load' to load the dylib.
-self.expect("process load %s" % dylibPath, "%s loaded correctly" % 
dylibPath,
-patterns = ['Loading "%s".*ok' % dylibPath,
+self.expect("process load %s" % dylibName, "%s loaded correctly" % 
dylibName,
+patterns = ['Loading "%s".*ok' % dylibName,
 'Image [0-9]+ loaded'])
 
 # Search for and match the "Image ([0-9]+) loaded" pattern.


Index: source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
===
--- source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -903,6 +903,16 @@
 char path[PATH_MAX];
 image_spec.GetPath(path, sizeof(path));
 
+if (IsRemote() && IsConnected())
+{
+FileSpec remote_file = GetRemoteWorkingDirectory();
+remote_file.AppendPathComponent(image_spec.GetFilename().GetCString());
+error = Install(image_spec, remote_file);
+if (error.Fail())
+return LLDB_INVALID_IMAGE_TOKEN;
+remote_file.GetPath(path, sizeof(path));
+}
+
 StreamString expr;
 expr.Printf(R"(
struct __lldb_dlopen_result { void *image_ptr; const char *error_str; } the_result;
Index: source/Plugins/Platform/Android/PlatformAndroid.cpp
===
--- source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -383,6 +383,16 @@
 char path[PATH_MAX];
 image_spec.GetPath(path, sizeof(path));
 
+if (IsRemote() && IsConnected())
+{
+FileSpec remote_file = GetRemoteWorkingDirectory();
+remote_file.AppendPathComponent(image_spec.GetFilename().GetCString());
+error = Install(image_spec, remote_file);
+if (error.Fail())
+   

[Lldb-commits] [lldb] r254522 - [LLDB][MIPS] fix watchpoint searched on client side for same masked variables

2015-12-02 Thread Mohit K. Bhakkad via lldb-commits
Author: mohit.bhakkad
Date: Wed Dec  2 11:45:02 2015
New Revision: 254522

URL: http://llvm.org/viewvc/llvm-project?rev=254522&view=rev
Log:
[LLDB][MIPS] fix watchpoint searched on client side for same masked variables

Reviewers: clayborg.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain,lldb-commits.
Differential Revision: http://reviews.llvm.org/D15106

Modified:
lldb/trunk/include/lldb/Core/ArchSpec.h
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/include/lldb/Core/ArchSpec.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ArchSpec.h?rev=254522&r1=254521&r2=254522&view=diff
==
--- lldb/trunk/include/lldb/Core/ArchSpec.h (original)
+++ lldb/trunk/include/lldb/Core/ArchSpec.h Wed Dec  2 11:45:02 2015
@@ -212,7 +212,11 @@ public:
 kCore_mips64_last   = eCore_mips64r6,
 
 kCore_mips64el_first  = eCore_mips64el,
-kCore_mips64el_last   = eCore_mips64r6el
+kCore_mips64el_last   = eCore_mips64r6el,
+
+kCore_mips_first  = eCore_mips32,
+kCore_mips_last   = eCore_mips64r6el
+
 };
 
 typedef void (* StopInfoOverrideCallbackType)(lldb_private::Thread 
&thread);

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=254522&r1=254521&r2=254522&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Wed Dec  
2 11:45:02 2015
@@ -2081,9 +2081,12 @@ ProcessGDBRemote::SetThreadStopInfo (lld
 watch_id_t watch_id = LLDB_INVALID_WATCH_ID;
 if (wp_addr != LLDB_INVALID_ADDRESS)
 {
-if (wp_hit_addr != LLDB_INVALID_ADDRESS)
-wp_addr = wp_hit_addr;
-WatchpointSP wp_sp = 
GetTarget().GetWatchpointList().FindByAddress(wp_addr);
+WatchpointSP wp_sp;
+ArchSpec::Core core = 
GetTarget().GetArchitecture().GetCore();
+if (core >= ArchSpec::kCore_mips_first && core 
<= ArchSpec::kCore_mips_last)
+wp_sp = 
GetTarget().GetWatchpointList().FindByAddress(wp_hit_addr);
+if (!wp_sp)
+wp_sp = 
GetTarget().GetWatchpointList().FindByAddress(wp_addr);
 if (wp_sp)
 {
 wp_sp->SetHardwareIndex(wp_index);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15106: [LLDB][MIPS] fix watchpoint searched on client side for same masked variables

2015-12-02 Thread Mohit Bhakkad via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL254522: [LLDB][MIPS] fix watchpoint searched on client side 
for same masked variables (authored by mohit.bhakkad).

Changed prior to commit:
  http://reviews.llvm.org/D15106?vs=41486&id=41644#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15106

Files:
  lldb/trunk/include/lldb/Core/ArchSpec.h
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2081,9 +2081,12 @@
 watch_id_t watch_id = LLDB_INVALID_WATCH_ID;
 if (wp_addr != LLDB_INVALID_ADDRESS)
 {
-if (wp_hit_addr != LLDB_INVALID_ADDRESS)
-wp_addr = wp_hit_addr;
-WatchpointSP wp_sp = 
GetTarget().GetWatchpointList().FindByAddress(wp_addr);
+WatchpointSP wp_sp;
+ArchSpec::Core core = 
GetTarget().GetArchitecture().GetCore();
+if (core >= ArchSpec::kCore_mips_first && core 
<= ArchSpec::kCore_mips_last)
+wp_sp = 
GetTarget().GetWatchpointList().FindByAddress(wp_hit_addr);
+if (!wp_sp)
+wp_sp = 
GetTarget().GetWatchpointList().FindByAddress(wp_addr);
 if (wp_sp)
 {
 wp_sp->SetHardwareIndex(wp_index);
Index: lldb/trunk/include/lldb/Core/ArchSpec.h
===
--- lldb/trunk/include/lldb/Core/ArchSpec.h
+++ lldb/trunk/include/lldb/Core/ArchSpec.h
@@ -212,7 +212,11 @@
 kCore_mips64_last   = eCore_mips64r6,
 
 kCore_mips64el_first  = eCore_mips64el,
-kCore_mips64el_last   = eCore_mips64r6el
+kCore_mips64el_last   = eCore_mips64r6el,
+
+kCore_mips_first  = eCore_mips32,
+kCore_mips_last   = eCore_mips64r6el
+
 };
 
 typedef void (* StopInfoOverrideCallbackType)(lldb_private::Thread 
&thread);


Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2081,9 +2081,12 @@
 watch_id_t watch_id = LLDB_INVALID_WATCH_ID;
 if (wp_addr != LLDB_INVALID_ADDRESS)
 {
-if (wp_hit_addr != LLDB_INVALID_ADDRESS)
-wp_addr = wp_hit_addr;
-WatchpointSP wp_sp = GetTarget().GetWatchpointList().FindByAddress(wp_addr);
+WatchpointSP wp_sp;
+ArchSpec::Core core = GetTarget().GetArchitecture().GetCore();
+if (core >= ArchSpec::kCore_mips_first && core <= ArchSpec::kCore_mips_last)
+wp_sp = GetTarget().GetWatchpointList().FindByAddress(wp_hit_addr);
+if (!wp_sp)
+wp_sp = GetTarget().GetWatchpointList().FindByAddress(wp_addr);
 if (wp_sp)
 {
 wp_sp->SetHardwareIndex(wp_index);
Index: lldb/trunk/include/lldb/Core/ArchSpec.h
===
--- lldb/trunk/include/lldb/Core/ArchSpec.h
+++ lldb/trunk/include/lldb/Core/ArchSpec.h
@@ -212,7 +212,11 @@
 kCore_mips64_last   = eCore_mips64r6,
 
 kCore_mips64el_first  = eCore_mips64el,
-kCore_mips64el_last   = eCore_mips64r6el
+kCore_mips64el_last   = eCore_mips64r6el,
+
+kCore_mips_first  = eCore_mips32,
+kCore_mips_last   = eCore_mips64r6el
+
 };
 
 typedef void (* StopInfoOverrideCallbackType)(lldb_private::Thread &thread);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15152: Change Platform::LoadImage to copy the file to the remote platform

2015-12-02 Thread Greg Clayton via lldb-commits
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

"process load" should probably be changed to have an options that allows us to 
specify where the shared library needs to be installed:

  (lldb) process load --install-path=/usr/lib ~/build/libfoo.so

Then we should add a new argument to LoadImage:

  uint32_t
  Platform::LoadImage(lldb_private::Process* process, const FileSpec& 
local_image_spec, const FileSpec& install_image_spec, Error& error)

This extra install_image_spec can be empty and if it is, we do what you did in 
the above patch, else we use the "install_image_spec" to copy the shared 
library to this location first, then load it from the install location.

This means we might want to change the Platform::LoadImage() to do more stuff 
up in Platform.cpp (like install the image using the virtual platform functions 
to install the shared library), and then change all current Platform subclasses 
that override LoadImage() over to DoLoadImage() and have the platform 
subclasses just do the actual "dlopen()" call on a specified file. Right now we 
are duplicating some code between LoadImage methods.


http://reviews.llvm.org/D15152



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15152: Change Platform::LoadImage to copy the file to the remote platform

2015-12-02 Thread Greg Clayton via lldb-commits
clayborg added a comment.

The --install-path option is optional and doesn't need to be specified, but if 
it is specified, we need all platforms, even the host platform, to install the 
shared library to this location prior to loading it.


http://reviews.llvm.org/D15152



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11465: Fix "process load/unload" on android

2015-12-02 Thread Jim Ingham via lldb-commits
jingham added a subscriber: jingham.
jingham added a comment.

It seems like an awful lot of logic is duplicated between the POSIX & Android 
versions of LoadImage when all that really changes is the name of the function 
you are calling.  Is it possible to centralize this some more?


Repository:
  rL LLVM

http://reviews.llvm.org/D11465



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D11465: Fix "process load/unload" on android

2015-12-02 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath.
labath added a comment.

In http://reviews.llvm.org/D11465#300581, @jingham wrote:

> It seems like an awful lot of logic is duplicated between the POSIX & Android 
> versions of LoadImage when all that really changes is the name of the 
> function you are calling.  Is it possible to centralize this some more?


We've been discussing this offline. I believe Tamas is working on resolving 
that.


Repository:
  rL LLVM

http://reviews.llvm.org/D11465



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15152: Change Platform::LoadImage to copy the file to the remote platform

2015-12-02 Thread Jim Ingham via lldb-commits
jingham added a subscriber: jingham.
jingham added a comment.

We use process load to load images that are already extant (and system 
libraries at that.)  So it's got to be possible to load a library into a target 
process without trying to get the image over to the target.  And given how slow 
some targets are, it would be better to have a mode which does no checking but 
goes straight to the dlopen.

If you follow Greg's suggestion of providing an install spec, then an empty 
install spec could be the indication that you assume the binary is already 
present.


http://reviews.llvm.org/D15152



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r254530 - Adds candidate formatter for replacing legacy summary results.

2015-12-02 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Wed Dec  2 12:48:38 2015
New Revision: 254530

URL: http://llvm.org/viewvc/llvm-project?rev=254530&view=rev
Log:
Adds candidate formatter for replacing legacy summary results.

Also cleans up some usages of strings where symbolic names
were safer and made more sense.

Try a test run with something like this to check out the new
basic results formatter (not used by default):

time test/dotest.py --executable `pwd`/build/Debug/lldb --results-formatter 
lldbsuite.test.basic_results_formatter.BasicResultsFormatter --results-file 
stdout

This will yield something like:

Testing: 1 test suites, 8 threads
1 out of 1 test suites processed - TestHelp.py
Test Results
Total Test Methods Run (excluding reruns): 13
Test Method rerun count: 0

===
Test Result Summary
===
Success:  13
Expected Failure:  0
Failure:   0
Error: 0
Unexpected Success:0
Skip:  0

Whereas something with a bit of error will look more like this:

42 out of 42 test suites processed - TestSymbolTable.py
Test Results
Total Test Methods Run (excluding reruns): 166
Test Method rerun count: 0

===
Test Result Summary
===
Success:  93
Expected Failure: 10
Failure:   2
Error: 2
Unexpected Success:0
Skip: 59

Details:
FAIL:
TestModulesInlineFunctions.ModulesInlineFunctionsTestCase.test_expr_dsym
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py)
FAIL:
TestModulesInlineFunctions.ModulesInlineFunctionsTestCase.test_expr_dwarf
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py)
ERROR: TestObjCCheckers.ObjCCheckerTestCase.test_objc_checker_dsym
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py)
ERROR: TestObjCCheckers.ObjCCheckerTestCase.test_objc_checker_dwarf
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py)

The Details header only prints if there are any issues to report.  The
Details section has tags that should get picked up using the normal
issue text scrapers (e.g. buildbot).

Test numbers reported are strictly test method runs.

The rerun bit at the top is in support of the multi-pass test
runner code (to run the low-load, single worker test pass for
tests that failed the first run), which I'll be able to put up
for review after this.

ResultsFormatters now have the ability to indicate they replace
the legacy summary, as this one does.

Once we come to agreement on the exact format, I will switch
us over to using this by default.

Added:
lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
Modified:
lldb/trunk/packages/Python/lldbsuite/test/curses_results.py
lldb/trunk/packages/Python/lldbsuite/test/dosep.py
lldb/trunk/packages/Python/lldbsuite/test/test_results.py

Added: lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py?rev=254530&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/basic_results_formatter.py Wed 
Dec  2 12:48:38 2015
@@ -0,0 +1,259 @@
+"""
+ The LLVM Compiler Infrastructure
+
+This file is distributed under the University of Illinois Open Source
+License. See LICENSE.TXT for details.
+
+Provides basic test result output.  This is intended to be suitable for
+normal LLDB test run output when no other option is specified.
+"""
+from __future__ import print_function
+
+from . import test_results
+
+
+class BasicResultsFormatter(test_results.ResultsFormatter):
+"""Provides basic test result output."""
+@classmethod
+def arg_parser(cls):
+"""@return arg parser used to parse formatter-specific options."""
+parser = super(BasicResultsFormatter, cls).arg_parser()
+
+parser.add_argument(
+"--assert-on-unknown-events",
+action="store_true",
+help=('cause unknown test events to generate '
+  'a python assert.  Default is to ignore.'))
+return parser
+
+def __init__(self, out_file, options):
+"""Initializes the BasicResultsFormatter instance.
+@param out_file file-like object where formatted output is written.
+@param options_dict specifies a dictionary of options for the
+formatter.
+"""
+# Initialize the parent
+super(BasicResultsFormatter, self).__init__(out_file, options)
+
+# self.result_event will store the most current resul

Re: [Lldb-commits] [lldb] r254476 - Added support for -gmodule debugging when debug info is left in the .o files on Darwin.

2015-12-02 Thread Greg Clayton via lldb-commits
So the question is why is "S" being found in "std" when we are essentially 
looking for "::S"?? Do we have a "using namespace std;" in the source? We 
recently added support for using all of the using directives in the user code 
so it might be doing a  "using namespace std;" into the expression due to the 
source file having it...

> On Dec 2, 2015, at 3:52 AM, Tamas Berghammer  wrote:
> 
> Hi Greg,
> 
> I reverted this CL as it regressed TestDataFormatterSynthVal.py on the Linux 
> buildbot.
> 
> The problem is that when we evaluate the "expression struct S { myInt 
> theInt{12}; }; S()" command then the return type is displayed as "std::S" 
> instead of displaying it as the type defined on the command line.
> 
> The definition for the conflicting type ("target modul lookup -t S -A"):
> /usr/lib/x86_64-linux-gnu/libstdc++.so.6:
> id = {0x0021550c}, name = "std::S", byte-size = 8, decl = string-inst.cc:43, 
> compiler_type = "typedef std::S"
>  typedef 'std::S': id = {0x00213434}, name = "basic_string std::char_traits, std::allocator >", qualified = 
> "std::basic_string, std::allocator >", 
> byte-size = 8, decl = basic_string.h:112, compiler_type = "class basic_string 
> {
> 
> }
> 
> If I change the name of the type we define in the expression to something not 
> conflicting with a type name in the std namespace then it works fine but it 
> should work even in case of conflicting types as they are leave in different 
> namespaces and it also worked before your change.
> 
> Currently I don't fully understand your change but please let me know if I 
> can help you to figure out why the test is failing on Linux.
> 
> Thanks,
> Tamas
> 
> On Wed, Dec 2, 2015 at 12:46 AM Greg Clayton via lldb-commits 
>  wrote:
> Author: gclayton
> Date: Tue Dec  1 18:43:32 2015
> New Revision: 254476
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=254476&view=rev
> Log:
> Added support for -gmodule debugging when debug info is left in the .o files 
> on Darwin.
> 
> This is done by finding the types that are forward declarations that come 
> from a module, and loading that module's debug info in a separate 
> lldb_private::Module, and copying the type over into the current module using 
> a ClangASTImporter object. ClangASTImporter objects are already used to copy 
> types from on clang::ASTContext to another for expressions so the type 
> copying code has been around for a while.
> 
> A new FindTypes variant was added to SymbolVendor and SymbolFile:
> 
> size_t
> SymbolVendor::FindTypes (const std::vector &context, bool 
> append, TypeMap& types);
> 
> size_t
> SymbolVendor::FindTypes (const std::vector &context, bool 
> append, TypeMap& types);
> 
> The CompilerContext is a way to represent the exact context of a type and 
> pass it through an agnostic API boundary so that we can find that exact 
> context elsewhere in another file. This was required here because we can have 
> a module that has submodules, both of which have a "foo" type.
> 
> I am not able to add tests for this yet as we currently don't build our 
> C/C++/ObjC binaries with the clang binary that we build. There are some 
> driver issues where it can't find the header files for the C and C++ standard 
> library which makes compiling these tests hard. We can't also guarantee that 
> if we are building with clang that it supporst the exact format of -gmodule 
> debugging that we are trying to test. We have had other versions of clang 
> that had a different implementation of -gmodule debugging that we are no 
> longer supporting, so we can't enable tests if we are building with clang 
> without compiling something and looking at the structure of the DWARF that 
> was generated to ensure that it is the format we can actually use.
> 
> 
> Modified:
> lldb/trunk/include/lldb/Symbol/ClangASTContext.h
> lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
> lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
> lldb/trunk/include/lldb/Symbol/SymbolFile.h
> lldb/trunk/include/lldb/Symbol/SymbolVendor.h
> lldb/trunk/include/lldb/Symbol/Type.h
> lldb/trunk/include/lldb/lldb-forward.h
> lldb/trunk/include/lldb/lldb-private-enumerations.h
> 
> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
> lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
> lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
> lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
> lldb/trunk/source/Symbol/ClangASTContext.cpp
> lldb/trunk/source/Symbol/ClangASTImporter.cpp
> lldb/trunk/source/Symbol/ClangExternalASTSourceCallbacks.cpp
> lldb/trunk/source/Symbol/SymbolFile.cpp
> ll

Re: [Lldb-commits] [PATCH] D13754: Split Socket class into Tcp/Udp/DomainSocket subclasses.

2015-12-02 Thread Oleksiy Vyalov via lldb-commits
ovyalov closed this revision.
ovyalov added a comment.

Submitted as r250474


http://reviews.llvm.org/D13754



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r254533 - Use sub-commands instead of --mode={client, server}.

2015-12-02 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Dec  2 13:00:52 2015
New Revision: 254533

URL: http://llvm.org/viewvc/llvm-project?rev=254533&view=rev
Log:
Use sub-commands instead of --mode={client,server}.

This is more pythonic and allows a more idiomatic way of getting
detailed usage information for each individual sub-command.

Modified:
lldb/trunk/scripts/swig_bot.py
lldb/trunk/scripts/swig_bot_lib/client.py
lldb/trunk/scripts/swig_bot_lib/server.py

Modified: lldb/trunk/scripts/swig_bot.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/swig_bot.py?rev=254533&r1=254532&r2=254533&view=diff
==
--- lldb/trunk/scripts/swig_bot.py (original)
+++ lldb/trunk/scripts/swig_bot.py Wed Dec  2 13:00:52 2015
@@ -14,16 +14,27 @@ import traceback
 # LLDB modules
 import use_lldb_suite
 
+# swig_bot modules
+from swig_bot_lib import client
+from swig_bot_lib import server
+
 def process_args(args):
 parser = argparse.ArgumentParser(
 description='Run swig-bot client or server.')
 
-# Arguments to control whether swig-bot runs as a client or server.
-parser.add_argument(
-"--mode",
-required=True,
-choices=["client", "server"],
-help="Run swig_bot in either client or server mode.")
+# Create and populate subparser arguments for when swig_bot is
+# run in client or server mode
+subparsers = parser.add_subparsers(
+help="Pass --help to a sub-command to print detailed usage")
+client_parser = subparsers.add_parser("client",
+  help="Run SWIG generation client")
+client.add_subparser_args(client_parser)
+client_parser.set_defaults(func=run_client)
+
+server_parser = subparsers.add_parser("server",
+  help="Run SWIG generation server")
+server.add_subparser_args(server_parser)
+server_parser.set_defaults(func=run_server)
 
 # Arguments to control logging verbosity.
 parser.add_argument(
@@ -32,7 +43,7 @@ def process_args(args):
 default=False,
 help="Increase logging verbosity level.")
 
-(options, remaining) = parser.parse_known_args(args)
+options = parser.parse_args(args)
 # Set logging level.
 if options.verbose:
 log_level = logging.DEBUG
@@ -41,22 +52,26 @@ def process_args(args):
 logging.basicConfig(level=log_level)
 logging.info("logging is using level: %d", log_level)
 
-return (options, remaining)
+return options
+
+def run_client(options):
+logging.info("Running swig_bot in client mode")
+client.finalize_subparser_options(options)
+client.run(options)
+
+def run_server(options):
+logging.info("Running swig_bot in server mode")
+server.finalize_subparser_options(options)
+server.run(options)
 
 if __name__ == "__main__":
-(options, remaining) = process_args(sys.argv[1:])
+options = process_args(sys.argv[1:])
 try:
-if options.mode == "client":
-logging.info("Running swig_bot in client mode")
-from swig_bot_lib import client
-client.run(remaining)
-elif options.mode == "server":
-logging.info("Running swig_bot in server mode")
-from swig_bot_lib import server
-server.run(remaining)
-else:
+if options.func is None:
 logging.error("Unknown mode specified.  Expected client or 
server.")
 sys.exit(-1)
+else:
+options.func(options)
 except KeyboardInterrupt as e:
 logging.info("Ctrl+C received.  Shutting down...")
 sys.exit(-1)

Modified: lldb/trunk/scripts/swig_bot_lib/client.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/swig_bot_lib/client.py?rev=254533&r1=254532&r2=254533&view=diff
==
--- lldb/trunk/scripts/swig_bot_lib/client.py (original)
+++ lldb/trunk/scripts/swig_bot_lib/client.py Wed Dec  2 13:00:52 2015
@@ -30,7 +30,7 @@ from . import remote
 default_ip = "127.0.0.1"
 default_port = 8537
 
-def process_args(args):
+def add_subparser_args(parser):
 """Returns options processed from the provided command line.
 
 @param args the command line to process.
@@ -75,10 +75,6 @@ def process_args(args):
 raise ValueError("Invalid connection string")
 setattr(namespace, self.dest, ip_port)
 
-# Setup the parser arguments that are accepted.
-parser = argparse.ArgumentParser(
-description='Generate SWIG bindings.')
-
 parser.add_argument(
 "--local",
 action=FindLocalSwigAction,
@@ -112,9 +108,7 @@ def process_args(args):
 action="append",
 help="Specifies the language to generate bindings for")
 
-# Process args.
-options = parser.parse_args(args)
-
+def finalize_subparser_options(options):
 if options.language

Re: [Lldb-commits] [lldb] r254476 - Added support for -gmodule debugging when debug info is left in the .o files on Darwin.

2015-12-02 Thread Greg Clayton via lldb-commits
So I was able to repro this with the following code:

#include 
#include 

namespace a
{
struct S
{ 
int s;
int ss;
};
}

int main (int argc, char const *argv[], char const *envp[])
{  
a::S s = { 11, 22 };
puts("stop here"); // evaluate expression: expression struct S { int a; 
S(int _a) : a(_a){} }; S(12)
return 0;
}
   

Then do:

lldb a.out
(lldb) b /stop here/
(lldb) r
(lldb) expression struct S { int a; S(int _a) : a(_a){} }; S(12)
(S) $0 = (s = 12, ss = 0)

Can you verify that this fails even with your LLDB that has my change backed 
out on linux? If you can reproduce this, then my change didn't cause it, and we 
need to fix the TestDataFormatterSynthVal.py test case and I will file a bug on 
our expression parser to get this fixed.

Greg


> On Dec 2, 2015, at 11:20 AM, Tamas Berghammer  wrote:
> 
> The source code is the inferior for TestDataFormatterSynthVal 
> (https://github.com/llvm-mirror/lldb/blob/fc6c6b9f1aa893b7fd1bd04ae9f05ff3f82d63c2/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/main.cpp)
>  what doesn't refer to anything in the std namespace and have no using 
> directives either.
> 
> On Wed, Dec 2, 2015 at 7:01 PM Greg Clayton  wrote:
> So the question is why is "S" being found in "std" when we are essentially 
> looking for "::S"?? Do we have a "using namespace std;" in the source? We 
> recently added support for using all of the using directives in the user code 
> so it might be doing a  "using namespace std;" into the expression due to the 
> source file having it...
> 
> > On Dec 2, 2015, at 3:52 AM, Tamas Berghammer  wrote:
> >
> > Hi Greg,
> >
> > I reverted this CL as it regressed TestDataFormatterSynthVal.py on the 
> > Linux buildbot.
> >
> > The problem is that when we evaluate the "expression struct S { myInt 
> > theInt{12}; }; S()" command then the return type is displayed as "std::S" 
> > instead of displaying it as the type defined on the command line.
> >
> > The definition for the conflicting type ("target modul lookup -t S -A"):
> > /usr/lib/x86_64-linux-gnu/libstdc++.so.6:
> > id = {0x0021550c}, name = "std::S", byte-size = 8, decl = 
> > string-inst.cc:43, compiler_type = "typedef std::S"
> >  typedef 'std::S': id = {0x00213434}, name = "basic_string > std::char_traits, std::allocator >", qualified = 
> > "std::basic_string, std::allocator >", 
> > byte-size = 8, decl = basic_string.h:112, compiler_type = "class 
> > basic_string {
> > 
> > }
> >
> > If I change the name of the type we define in the expression to something 
> > not conflicting with a type name in the std namespace then it works fine 
> > but it should work even in case of conflicting types as they are leave in 
> > different namespaces and it also worked before your change.
> >
> > Currently I don't fully understand your change but please let me know if I 
> > can help you to figure out why the test is failing on Linux.
> >
> > Thanks,
> > Tamas
> >
> > On Wed, Dec 2, 2015 at 12:46 AM Greg Clayton via lldb-commits 
> >  wrote:
> > Author: gclayton
> > Date: Tue Dec  1 18:43:32 2015
> > New Revision: 254476
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=254476&view=rev
> > Log:
> > Added support for -gmodule debugging when debug info is left in the .o 
> > files on Darwin.
> >
> > This is done by finding the types that are forward declarations that come 
> > from a module, and loading that module's debug info in a separate 
> > lldb_private::Module, and copying the type over into the current module 
> > using a ClangASTImporter object. ClangASTImporter objects are already used 
> > to copy types from on clang::ASTContext to another for expressions so the 
> > type copying code has been around for a while.
> >
> > A new FindTypes variant was added to SymbolVendor and SymbolFile:
> >
> > size_t
> > SymbolVendor::FindTypes (const std::vector &context, bool 
> > append, TypeMap& types);
> >
> > size_t
> > SymbolVendor::FindTypes (const std::vector &context, bool 
> > append, TypeMap& types);
> >
> > The CompilerContext is a way to represent the exact context of a type and 
> > pass it through an agnostic API boundary so that we can find that exact 
> > context elsewhere in another file. This was required here because we can 
> > have a module that has submodules, both of which have a "foo" type.
> >
> > I am not able to add tests for this yet as we currently don't build our 
> > C/C++/ObjC binaries with the clang binary that we build. There are some 
> > driver issues where it can't find the header files for the C and C++ 
> > standard library which makes compiling these tests hard. We can't also 
> > guarantee that if we are building with clang that it supporst the exact 
> > format of -gmodule debugging that we are trying to test. We have had other 
> > versions of clang that had a different implementation of -gmodule debugging 
> > that we are no longer supporting, s

Re: [Lldb-commits] [lldb] r254476 - Added support for -gmodule debugging when debug info is left in the .o files on Darwin.

2015-12-02 Thread Greg Clayton via lldb-commits
Never mind, top of tree LLDB is working correctly. I ran our Apple built LLDB 
that had a different version of this -gmodule fix for an Apple specific version 
we did and it shows the same issue so I was led to believe this existed for a 
while now, but it is definitely due to the -gmodule patch.

Greg

> On Dec 2, 2015, at 11:26 AM, Greg Clayton via lldb-commits 
>  wrote:
> 
> So I was able to repro this with the following code:
> 
> #include 
> #include 
> 
> namespace a
> {
>struct S
>{ 
>int s;
>int ss;
>};
> }
> 
> int main (int argc, char const *argv[], char const *envp[])
> {  
>a::S s = { 11, 22 };
>puts("stop here"); // evaluate expression: expression struct S { int a; 
> S(int _a) : a(_a){} }; S(12)
>return 0;
> }
> 
> 
> Then do:
> 
> lldb a.out
> (lldb) b /stop here/
> (lldb) r
> (lldb) expression struct S { int a; S(int _a) : a(_a){} }; S(12)
> (S) $0 = (s = 12, ss = 0)
> 
> Can you verify that this fails even with your LLDB that has my change backed 
> out on linux? If you can reproduce this, then my change didn't cause it, and 
> we need to fix the TestDataFormatterSynthVal.py test case and I will file a 
> bug on our expression parser to get this fixed.
> 
> Greg
> 
> 
>> On Dec 2, 2015, at 11:20 AM, Tamas Berghammer  wrote:
>> 
>> The source code is the inferior for TestDataFormatterSynthVal 
>> (https://github.com/llvm-mirror/lldb/blob/fc6c6b9f1aa893b7fd1bd04ae9f05ff3f82d63c2/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/main.cpp)
>>  what doesn't refer to anything in the std namespace and have no using 
>> directives either.
>> 
>> On Wed, Dec 2, 2015 at 7:01 PM Greg Clayton  wrote:
>> So the question is why is "S" being found in "std" when we are essentially 
>> looking for "::S"?? Do we have a "using namespace std;" in the source? We 
>> recently added support for using all of the using directives in the user 
>> code so it might be doing a  "using namespace std;" into the expression due 
>> to the source file having it...
>> 
>>> On Dec 2, 2015, at 3:52 AM, Tamas Berghammer  wrote:
>>> 
>>> Hi Greg,
>>> 
>>> I reverted this CL as it regressed TestDataFormatterSynthVal.py on the 
>>> Linux buildbot.
>>> 
>>> The problem is that when we evaluate the "expression struct S { myInt 
>>> theInt{12}; }; S()" command then the return type is displayed as "std::S" 
>>> instead of displaying it as the type defined on the command line.
>>> 
>>> The definition for the conflicting type ("target modul lookup -t S -A"):
>>> /usr/lib/x86_64-linux-gnu/libstdc++.so.6:
>>> id = {0x0021550c}, name = "std::S", byte-size = 8, decl = 
>>> string-inst.cc:43, compiler_type = "typedef std::S"
>>> typedef 'std::S': id = {0x00213434}, name = "basic_string>> std::char_traits, std::allocator >", qualified = 
>>> "std::basic_string, std::allocator >", 
>>> byte-size = 8, decl = basic_string.h:112, compiler_type = "class 
>>> basic_string {
>>> 
>>> }
>>> 
>>> If I change the name of the type we define in the expression to something 
>>> not conflicting with a type name in the std namespace then it works fine 
>>> but it should work even in case of conflicting types as they are leave in 
>>> different namespaces and it also worked before your change.
>>> 
>>> Currently I don't fully understand your change but please let me know if I 
>>> can help you to figure out why the test is failing on Linux.
>>> 
>>> Thanks,
>>> Tamas
>>> 
>>> On Wed, Dec 2, 2015 at 12:46 AM Greg Clayton via lldb-commits 
>>>  wrote:
>>> Author: gclayton
>>> Date: Tue Dec  1 18:43:32 2015
>>> New Revision: 254476
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=254476&view=rev
>>> Log:
>>> Added support for -gmodule debugging when debug info is left in the .o 
>>> files on Darwin.
>>> 
>>> This is done by finding the types that are forward declarations that come 
>>> from a module, and loading that module's debug info in a separate 
>>> lldb_private::Module, and copying the type over into the current module 
>>> using a ClangASTImporter object. ClangASTImporter objects are already used 
>>> to copy types from on clang::ASTContext to another for expressions so the 
>>> type copying code has been around for a while.
>>> 
>>> A new FindTypes variant was added to SymbolVendor and SymbolFile:
>>> 
>>> size_t
>>> SymbolVendor::FindTypes (const std::vector &context, bool 
>>> append, TypeMap& types);
>>> 
>>> size_t
>>> SymbolVendor::FindTypes (const std::vector &context, bool 
>>> append, TypeMap& types);
>>> 
>>> The CompilerContext is a way to represent the exact context of a type and 
>>> pass it through an agnostic API boundary so that we can find that exact 
>>> context elsewhere in another file. This was required here because we can 
>>> have a module that has submodules, both of which have a "foo" type.
>>> 
>>> I am not able to add tests for this yet as we currently don't build our 
>>> C/C++/ObjC binaries with the clang binary that we build. 

[Lldb-commits] [lldb] r254546 - Make --results-file stdout implied if unspecified when using a results formatter.

2015-12-02 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Wed Dec  2 15:12:17 2015
New Revision: 254546

URL: http://llvm.org/viewvc/llvm-project?rev=254546&view=rev
Log:
Make --results-file stdout implied if unspecified when using a results 
formatter.

Also cleans up pylint warnings (stock settings) in the modified function.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=254546&r1=254545&r2=254546&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Dec  2 15:12:17 2015
@@ -935,7 +935,15 @@ def setupTestResults():
 # Connect to the specified localhost port.
 results_file_object, cleanup_func = createSocketToLocalPort(
 results_port)
-default_formatter_name = 
"lldbsuite.test.test_results.RawPickledFormatter"
+default_formatter_name = (
+"lldbsuite.test.test_results.RawPickledFormatter")
+
+# If we have a results formatter name specified and we didn't specify
+# a results file, we should use stdout.
+if results_formatter_name is not None and results_file_object is None:
+# Use stdout.
+results_file_object = sys.stdout
+cleanup_func = None
 
 if results_file_object:
 # We care about the formatter.  Choose user-specified or, if
@@ -945,7 +953,8 @@ def setupTestResults():
 else:
 formatter_name = default_formatter_name
 
-# Create an instance of the class.  First figure out the 
package/module.
+# Create an instance of the class.
+# First figure out the package/module.
 components = formatter_name.split(".")
 module = importlib.import_module(".".join(components[:-1]))
 
@@ -963,7 +972,8 @@ def setupTestResults():
 command_line_options)
 
 # Create the TestResultsFormatter given the processed options.
-results_formatter_object = clazz(results_file_object, 
formatter_options)
+results_formatter_object = clazz(
+results_file_object, formatter_options)
 
 # Start the results formatter session - we'll only have one
 # during a given dotest process invocation.


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r254550 - Candidate fixes for python2/3 compatible string handling in pickling support.

2015-12-02 Thread Todd Fiala via lldb-commits
Author: tfiala
Date: Wed Dec  2 15:45:15 2015
New Revision: 254550

URL: http://llvm.org/viewvc/llvm-project?rev=254550&view=rev
Log:
Candidate fixes for python2/3 compatible string handling in pickling support.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py
lldb/trunk/packages/Python/lldbsuite/test/test_results.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py?rev=254550&r1=254549&r2=254550&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py Wed Dec  2 
15:45:15 2015
@@ -47,7 +47,7 @@ class UnpicklingForwardingReaderChannel(
 self.header_contents = ''
 self.packet_bytes_remaining = 0
 self.reading_header = True
-self.ibuffer = ''
+self.ibuffer = b''
 self.forwarding_func = forwarding_func
 if forwarding_func is None:
 # This whole class is useless if we do nothing with the
@@ -58,7 +58,7 @@ class UnpicklingForwardingReaderChannel(
 """Unpickles the collected input buffer bytes and forwards."""
 if len(self.ibuffer) > 0:
 self.forwarding_func(cPickle.loads(self.ibuffer))
-self.ibuffer = ''
+self.ibuffer = b''
 
 def consume_header_bytes(self, data):
 """Consumes header bytes from the front of data.

Modified: lldb/trunk/packages/Python/lldbsuite/test/test_results.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_results.py?rev=254550&r1=254549&r2=254550&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/test_results.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/test_results.py Wed Dec  2 
15:45:15 2015
@@ -1029,8 +1029,8 @@ class RawPickledFormatter(ResultsFormatt
 
 # Send it as {serialized_length_of_serialized_bytes}#{serialized_bytes}
 pickled_message = cPickle.dumps(test_event)
-self.out_file.send(
-"{}#{}".format(len(pickled_message), pickled_message))
+self.out_file.send("{}#".format(len(pickled_message)))
+self.out_file.send(pickled_message)
 
 
 class DumpFormatter(ResultsFormatter):


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D15162: Have result formatter send bytes instead of strings

2015-12-02 Thread Zachary Turner via lldb-commits
zturner created this revision.
zturner added a reviewer: tfiala.
zturner added a subscriber: lldb-commits.

http://reviews.llvm.org/D15162

Files:
  packages/Python/lldbsuite/test/dotest_channels.py
  packages/Python/lldbsuite/test/test_results.py

Index: packages/Python/lldbsuite/test/test_results.py
===
--- packages/Python/lldbsuite/test/test_results.py
+++ packages/Python/lldbsuite/test/test_results.py
@@ -1027,10 +1027,11 @@
 # Tack on the pid.
 test_event["pid"] = self.pid
 
-# Send it as {serialized_length_of_serialized_bytes}#{serialized_bytes}
-pickled_message = cPickle.dumps(test_event)
-self.out_file.send("{}#".format(len(pickled_message)))
-self.out_file.send(pickled_message)
+# Send it as {serialized_length_of_serialized_bytes}{serialized_bytes}
+import struct
+msg = cPickle.dumps(test_event)
+packet = struct.pack("!I%ds" % len(msg), len(msg), msg)
+self.out_file.send(packet)
 
 
 class DumpFormatter(ResultsFormatter):
Index: packages/Python/lldbsuite/test/dotest_channels.py
===
--- packages/Python/lldbsuite/test/dotest_channels.py
+++ packages/Python/lldbsuite/test/dotest_channels.py
@@ -44,7 +44,7 @@
 def __init__(self, file_object, async_map, forwarding_func):
 asyncore.dispatcher.__init__(self, sock=file_object, map=async_map)
 
-self.header_contents = ''
+self.header_contents = b""
 self.packet_bytes_remaining = 0
 self.reading_header = True
 self.ibuffer = b''
@@ -69,17 +69,21 @@
 if not data or (len(data) == 0):
 return None
 
-for index in range(len(data)):
-byte = data[index]
-if byte != '#':
-# Header byte.
-self.header_contents += byte
-else:
-# End of header.
-self.packet_bytes_remaining = int(self.header_contents)
-self.header_contents = ''
-self.reading_header = False
-return data[(index+1):]
+full_header_len = 4
+
+assert(len(self.header_contents) < full_header_len)
+
+bytes_avail = len(data)
+bytes_needed = full_header_len - len(self.header_contents)
+header_bytes_avail = min(bytes_needed, bytes_avail)
+self.header_contents += data[:header_bytes_avail]
+if len(self.header_contents) == full_header_len:
+import struct
+# End of header.
+self.packet_bytes_remaining = struct.unpack("!I", 
self.header_contents)[0]
+self.header_contents = b""
+self.reading_header = False
+return data[header_bytes_avail:]
 
 # If we made it here, we've exhausted the data and
 # we're still parsing header content.


Index: packages/Python/lldbsuite/test/test_results.py
===
--- packages/Python/lldbsuite/test/test_results.py
+++ packages/Python/lldbsuite/test/test_results.py
@@ -1027,10 +1027,11 @@
 # Tack on the pid.
 test_event["pid"] = self.pid
 
-# Send it as {serialized_length_of_serialized_bytes}#{serialized_bytes}
-pickled_message = cPickle.dumps(test_event)
-self.out_file.send("{}#".format(len(pickled_message)))
-self.out_file.send(pickled_message)
+# Send it as {serialized_length_of_serialized_bytes}{serialized_bytes}
+import struct
+msg = cPickle.dumps(test_event)
+packet = struct.pack("!I%ds" % len(msg), len(msg), msg)
+self.out_file.send(packet)
 
 
 class DumpFormatter(ResultsFormatter):
Index: packages/Python/lldbsuite/test/dotest_channels.py
===
--- packages/Python/lldbsuite/test/dotest_channels.py
+++ packages/Python/lldbsuite/test/dotest_channels.py
@@ -44,7 +44,7 @@
 def __init__(self, file_object, async_map, forwarding_func):
 asyncore.dispatcher.__init__(self, sock=file_object, map=async_map)
 
-self.header_contents = ''
+self.header_contents = b""
 self.packet_bytes_remaining = 0
 self.reading_header = True
 self.ibuffer = b''
@@ -69,17 +69,21 @@
 if not data or (len(data) == 0):
 return None
 
-for index in range(len(data)):
-byte = data[index]
-if byte != '#':
-# Header byte.
-self.header_contents += byte
-else:
-# End of header.
-self.packet_bytes_remaining = int(self.header_contents)
-self.header_contents = ''
-self.reading_header = False
-return data[(index+1):]
+full_header_len = 4
+
+assert(len(self.header_contents) < full_header_len)
+
+byte

Re: [Lldb-commits] [PATCH] D15162: Have result formatter send bytes instead of strings

2015-12-02 Thread Todd Fiala via lldb-commits
Lgtm

-Todd

> On Dec 2, 2015, at 2:28 PM, Zachary Turner  wrote:
> 
> zturner created this revision.
> zturner added a reviewer: tfiala.
> zturner added a subscriber: lldb-commits.
> 
> http://reviews.llvm.org/D15162
> 
> Files:
>  packages/Python/lldbsuite/test/dotest_channels.py
>  packages/Python/lldbsuite/test/test_results.py
> 
> Index: packages/Python/lldbsuite/test/test_results.py
> ===
> --- packages/Python/lldbsuite/test/test_results.py
> +++ packages/Python/lldbsuite/test/test_results.py
> @@ -1027,10 +1027,11 @@
> # Tack on the pid.
> test_event["pid"] = self.pid
> 
> -# Send it as 
> {serialized_length_of_serialized_bytes}#{serialized_bytes}
> -pickled_message = cPickle.dumps(test_event)
> -self.out_file.send("{}#".format(len(pickled_message)))
> -self.out_file.send(pickled_message)
> +# Send it as 
> {serialized_length_of_serialized_bytes}{serialized_bytes}
> +import struct
> +msg = cPickle.dumps(test_event)
> +packet = struct.pack("!I%ds" % len(msg), len(msg), msg)
> +self.out_file.send(packet)
> 
> 
> class DumpFormatter(ResultsFormatter):
> Index: packages/Python/lldbsuite/test/dotest_channels.py
> ===
> --- packages/Python/lldbsuite/test/dotest_channels.py
> +++ packages/Python/lldbsuite/test/dotest_channels.py
> @@ -44,7 +44,7 @@
> def __init__(self, file_object, async_map, forwarding_func):
> asyncore.dispatcher.__init__(self, sock=file_object, map=async_map)
> 
> -self.header_contents = ''
> +self.header_contents = b""
> self.packet_bytes_remaining = 0
> self.reading_header = True
> self.ibuffer = b''
> @@ -69,17 +69,21 @@
> if not data or (len(data) == 0):
> return None
> 
> -for index in range(len(data)):
> -byte = data[index]
> -if byte != '#':
> -# Header byte.
> -self.header_contents += byte
> -else:
> -# End of header.
> -self.packet_bytes_remaining = int(self.header_contents)
> -self.header_contents = ''
> -self.reading_header = False
> -return data[(index+1):]
> +full_header_len = 4
> +
> +assert(len(self.header_contents) < full_header_len)
> +
> +bytes_avail = len(data)
> +bytes_needed = full_header_len - len(self.header_contents)
> +header_bytes_avail = min(bytes_needed, bytes_avail)
> +self.header_contents += data[:header_bytes_avail]
> +if len(self.header_contents) == full_header_len:
> +import struct
> +# End of header.
> +self.packet_bytes_remaining = struct.unpack("!I", 
> self.header_contents)[0]
> +self.header_contents = b""
> +self.reading_header = False
> +return data[header_bytes_avail:]
> 
> # If we made it here, we've exhausted the data and
> # we're still parsing header content.
> 
> 
> 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15162: Have result formatter send bytes instead of strings

2015-12-02 Thread Todd Fiala via lldb-commits
tfiala added a subscriber: tfiala.
tfiala added a comment.

Lgtm

-Todd


http://reviews.llvm.org/D15162



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r254563 - Fix test result serialization to use bytes.

2015-12-02 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Wed Dec  2 17:07:33 2015
New Revision: 254563

URL: http://llvm.org/viewvc/llvm-project?rev=254563&view=rev
Log:
Fix test result serialization to use bytes.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py
lldb/trunk/packages/Python/lldbsuite/test/test_results.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py?rev=254563&r1=254562&r2=254563&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_channels.py Wed Dec  2 
17:07:33 2015
@@ -44,7 +44,7 @@ class UnpicklingForwardingReaderChannel(
 def __init__(self, file_object, async_map, forwarding_func):
 asyncore.dispatcher.__init__(self, sock=file_object, map=async_map)
 
-self.header_contents = ''
+self.header_contents = b""
 self.packet_bytes_remaining = 0
 self.reading_header = True
 self.ibuffer = b''
@@ -69,17 +69,21 @@ class UnpicklingForwardingReaderChannel(
 if not data or (len(data) == 0):
 return None
 
-for index in range(len(data)):
-byte = data[index]
-if byte != '#':
-# Header byte.
-self.header_contents += byte
-else:
-# End of header.
-self.packet_bytes_remaining = int(self.header_contents)
-self.header_contents = ''
-self.reading_header = False
-return data[(index+1):]
+full_header_len = 4
+
+assert(len(self.header_contents) < full_header_len)
+
+bytes_avail = len(data)
+bytes_needed = full_header_len - len(self.header_contents)
+header_bytes_avail = min(bytes_needed, bytes_avail)
+self.header_contents += data[:header_bytes_avail]
+if len(self.header_contents) == full_header_len:
+import struct
+# End of header.
+self.packet_bytes_remaining = struct.unpack("!I", 
self.header_contents)[0]
+self.header_contents = b""
+self.reading_header = False
+return data[header_bytes_avail:]
 
 # If we made it here, we've exhausted the data and
 # we're still parsing header content.

Modified: lldb/trunk/packages/Python/lldbsuite/test/test_results.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_results.py?rev=254563&r1=254562&r2=254563&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/test_results.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/test_results.py Wed Dec  2 
17:07:33 2015
@@ -1027,10 +1027,11 @@ class RawPickledFormatter(ResultsFormatt
 # Tack on the pid.
 test_event["pid"] = self.pid
 
-# Send it as {serialized_length_of_serialized_bytes}#{serialized_bytes}
-pickled_message = cPickle.dumps(test_event)
-self.out_file.send("{}#".format(len(pickled_message)))
-self.out_file.send(pickled_message)
+# Send it as {serialized_length_of_serialized_bytes}{serialized_bytes}
+import struct
+msg = cPickle.dumps(test_event)
+packet = struct.pack("!I%ds" % len(msg), len(msg), msg)
+self.out_file.send(packet)
 
 
 class DumpFormatter(ResultsFormatter):


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15162: Have result formatter send bytes instead of strings

2015-12-02 Thread Todd Fiala via lldb-commits
tfiala added a comment.

Okay I also had a chance to run it with the patch locally, and I didn't see any 
issues.


http://reviews.llvm.org/D15162



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15046: Fix for TestNoreturnUnwind.py on i386

2015-12-02 Thread Jason Molenda via lldb-commits
jasonmolenda added a comment.

Interesting.  The routine is

0xf7fd9d70 <+0>:  pushl  %ecx
 0xf7fd9d71 <+1>:  pushl  %edx
 0xf7fd9d72 <+2>:  pushl  %ebp
 0xf7fd9d73 <+3>:  movl   %esp, %ebp
 0xf7fd9d75 <+5>:  sysenter 
[...]
 0xf7fd9d7e <+14>: int$0x80
--> 0xf7fd9d80 <+16>: popl   %ebp
 0xf7fd9d81 <+17>: popl   %edx
 0xf7fd9d82 <+18>: popl   %ecx
 0xf7fd9d83 <+19>: retl

The only difference between the assembly profile v. eh_frame is that the 
assembly profile identifies the movl %esp, %esp instruction and says that the 
unwind should be done in terms of ebp.  ebp and esp should be identical at this 
point, so it doesn't matter which one is used.  But when we look at the unwind 
logging, ebp seems to have a value of 0 and esp seems to have a value of 
0xd2d4.  Does the sysenter / int instruction sequence mess with the 
contents of ebp?  This routine immediately trashes the contents of ebp with the 
'popl %ebp' so it's irrelevant what is stored there.  In fact, I don't 
understand why this function saves the caller's ebp with the 'movl %esp, %ebp' 
insn, considering that it doesn't make use of ebp at all.

Well, it is clear that lldb needs to be able to fall back to an alternate 
unwind scheme here - I don't know exactly what's happening during this 
function, but for some reason an unwind that tries to use ebp will fail.

I'm also curious why lldb didn't try to use the eh_frame instructions to begin 
with.  We generally try to do that if it looks like the instructions describe 
the prologue/epilogue (which this one does).  I'll go look at the eh_frame 
augmenter and see what the rules are but maybe it has a sanity check that it 
wants the starting unwind rule to match the ending unwind rule, but the 
eh_frame unwind rules don't clear the ebp save location once ebp is restored.

row[0]:0: CFA=esp +4 => eip=[CFA-4] 
row[6]:   19: CFA=esp +4 => ebp=[CFA-16] eip=[CFA-4]


http://reviews.llvm.org/D15046



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D15172: Fix in-memory section loading for JIT-ed code.

2015-12-02 Thread Oleksiy Vyalov via lldb-commits
ovyalov created this revision.
ovyalov added reviewers: clayborg, tberghammer.
ovyalov added a subscriber: lldb-commits.

Debug sections for JIT-ed code are stored in-memory and loaded as part of 
module's image once __jit_debug_register_code is called - 
if we cannot load a section by its base load address try to load it from 
in-memory data buffer if possible.

http://reviews.llvm.org/D15172

Files:
  source/Symbol/ObjectFile.cpp

Index: source/Symbol/ObjectFile.cpp
===
--- source/Symbol/ObjectFile.cpp
+++ source/Symbol/ObjectFile.cpp
@@ -537,6 +537,7 @@
 }
 }
 }
+return GetData(section->GetFileOffset(), section->GetFileSize(), 
section_data);
 }
 else
 {


Index: source/Symbol/ObjectFile.cpp
===
--- source/Symbol/ObjectFile.cpp
+++ source/Symbol/ObjectFile.cpp
@@ -537,6 +537,7 @@
 }
 }
 }
+return GetData(section->GetFileOffset(), section->GetFileSize(), section_data);
 }
 else
 {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.

2015-12-02 Thread Siva Chandra via lldb-commits
sivachandra updated this revision to Diff 41706.
sivachandra added a comment.

Rebased and updated to take in DWO changes.


http://reviews.llvm.org/D12809

Files:
  include/lldb/Symbol/ClangASTContext.h
  include/lldb/Symbol/CompilerDeclContext.h
  include/lldb/Symbol/GoASTContext.h
  include/lldb/Symbol/SymbolFile.h
  include/lldb/Symbol/TypeSystem.h
  include/lldb/Target/CPPLanguageRuntime.h
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
  
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
  
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
  
source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
  source/Plugins/SymbolFile/DWARF/DIERef.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Symbol/ClangASTContext.cpp
  source/Symbol/CompilerDeclContext.cpp
  source/Symbol/SymbolFile.cpp

Index: source/Symbol/SymbolFile.cpp
===
--- source/Symbol/SymbolFile.cpp
+++ source/Symbol/SymbolFile.cpp
@@ -134,6 +134,12 @@
 return 0;
 }
 
+void
+SymbolFile::GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector &mangled_names)
+{
+return;
+}
+
 uint32_t
 SymbolFile::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, TypeMap& types)
 {
Index: source/Symbol/CompilerDeclContext.cpp
===
--- source/Symbol/CompilerDeclContext.cpp
+++ source/Symbol/CompilerDeclContext.cpp
@@ -42,6 +42,15 @@
 return ConstString();
 }
 
+ConstString
+CompilerDeclContext::GetScopeQualifiedName () const
+{
+if (IsValid())
+return m_type_system->DeclContextGetScopeQualifiedName(m_opaque_decl_ctx);
+else
+return ConstString();
+}
+
 bool
 CompilerDeclContext::IsStructUnionOrClass () const
 {
Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -9245,6 +9245,18 @@
 return ConstString();
 }
 
+ConstString
+ClangASTContext::DeclContextGetScopeQualifiedName (void *opaque_decl_ctx)
+{
+if (opaque_decl_ctx)
+{
+clang::NamedDecl *named_decl = llvm::dyn_cast((clang::DeclContext *)opaque_decl_ctx);
+if (named_decl)
+return ConstString(llvm::StringRef(named_decl->getQualifiedNameAsString()));
+}
+return ConstString();
+}
+
 bool
 ClangASTContext::DeclContextIsClassMethod (void *opaque_decl_ctx,
lldb::LanguageType *language_ptr,
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 // Other libraries and framework includes
@@ -203,6 +204,10 @@
bool append,
lldb_private::SymbolContextList& sc_list) override;
 
+void
+GetMangledNamesForFunction (const std::string &scope_qualified_name,
+std::vector &mangled_names) override;
+
 uint32_t
 FindTypes (const lldb_private::SymbolContext& sc,
const lldb_private::ConstString &name,
@@ -560,6 +565,9 @@
 m_fetched_external_modules:1;
 lldb_private::LazyBool  m_supports_DW_AT_APPLE_objc_complete_type;
 
+typedef std::shared_ptr > DIERefSetSP;
+typedef std::unordered_map NameToOffsetMap;
+NameToOffsetMap m_function_scope_qualified_name_map;
 std::unique_ptr m_ranges;
 UniqueDWARFASTTypeMap m_unique_ast_type_map;
 DIEToTypePtr m_die_to_type;
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2856,6 +2856,40 @@
 return sc_list.GetSize() - original_size;
 }
 
+void
+SymbolFileDWARF::GetMangledNamesForFunction (const std::string &scope_qualified_name,
+ std::vector &mangled_names)
+{
+DWARFDebugInfo* info = DebugInfo();
+uint32_t num_comp_units = 0;
+if (info)
+num_comp_units = info->GetNumCompileUnits();
+
+for (uint32_t i = 0; i < num_comp_units; i++)
+{
+DWARFCompileUnit *cu = info->GetCompileUnitAtIndex(i);
+if (cu == nullptr)
+continue;
+
+Symbo

Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.

2015-12-02 Thread Siva Chandra via lldb-commits
sivachandra added a comment.

PTaL
I finally got time to work on this. I have now rebased it and updated it take 
in DWO changes.

I understand this change only enhances debug experience when GCC is used as the 
DWARF producer (the targeted functionality already works as expected when the 
producer is clang). However, GCC is still very important for Android 
development and hence this fix is very useful for us.


http://reviews.llvm.org/D12809



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.

2015-12-02 Thread Siva Chandra via lldb-commits
sivachandra added a comment.

A test for this already exists: TestCallStdStringFunction.py


http://reviews.llvm.org/D12809



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r254588 - [LLDB] Switch to assembly view if source is moved

2015-12-02 Thread Mohit K. Bhakkad via lldb-commits
Author: mohit.bhakkad
Date: Wed Dec  2 22:56:16 2015
New Revision: 254588

URL: http://llvm.org/viewvc/llvm-project?rev=254588&view=rev
Log:
[LLDB] Switch to assembly view if source is moved

Reviewers: clayborg, jingham, jasonmolenda.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain,lldb-commits.
Differential Revision: http://reviews.llvm.org/D12877

Modified:
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Target/StackFrame.cpp

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=254588&r1=254587&r2=254588&view=diff
==
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Wed Dec  2 22:56:16 2015
@@ -86,9 +86,10 @@ GetDebuggerList()
 OptionEnumValueElement
 g_show_disassembly_enum_values[] =
 {
-{ Debugger::eStopDisassemblyTypeNever,"never", "Never show 
disassembly when displaying a stop context."},
-{ Debugger::eStopDisassemblyTypeNoSource, "no-source", "Show disassembly 
when there is no source information, or the source file is missing when 
displaying a stop context."},
-{ Debugger::eStopDisassemblyTypeAlways,   "always","Always show 
disassembly when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeNever,  "never","Never 
show disassembly when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeNoDebugInfo,"no-debuginfo", "Show 
disassembly when there is no debug information."},
+{ Debugger::eStopDisassemblyTypeNoSource,   "no-source","Show 
disassembly when there is no source information, or the source file is missing 
when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeAlways, "always",   
"Always show disassembly when displaying a stop context."},
 { 0, NULL, NULL }
 };
 
@@ -150,7 +151,7 @@ g_properties[] =
 {   "prompt",   OptionValue::eTypeString  , true, 
OptionValueString::eOptionEncodeCharacterEscapeSequences, "(lldb) ", NULL, "The 
debugger command line prompt displayed for the user." },
 {   "script-lang",  OptionValue::eTypeEnum, true, 
eScriptLanguagePython, NULL, g_language_enumerators, "The script language to be 
used for evaluating user-written scripts." },
 {   "stop-disassembly-count",   OptionValue::eTypeSInt64  , true, 4, 
NULL, NULL, "The number of disassembly lines to show when displaying a stopped 
context." },
-{   "stop-disassembly-display", OptionValue::eTypeEnum, true, 
Debugger::eStopDisassemblyTypeNoSource, NULL, g_show_disassembly_enum_values, 
"Control when to display disassembly when displaying a stopped context." },
+{   "stop-disassembly-display", OptionValue::eTypeEnum, true, 
Debugger::eStopDisassemblyTypeNoDebugInfo, NULL, 
g_show_disassembly_enum_values, "Control when to display disassembly when 
displaying a stopped context." },
 {   "stop-line-count-after",OptionValue::eTypeSInt64  , true, 3, 
NULL, NULL, "The number of sources lines to display that come after the current 
source line when displaying a stopped context." },
 {   "stop-line-count-before",   OptionValue::eTypeSInt64  , true, 3, 
NULL, NULL, "The number of sources lines to display that come before the 
current source line when displaying a stopped context." },
 {   "term-width",   OptionValue::eTypeSInt64  , true, 80   , 
NULL, NULL, "The maximum number of columns to use for displaying text." },

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=254588&r1=254587&r2=254588&view=diff
==
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Wed Dec  2 22:56:16 2015
@@ -1519,7 +1519,7 @@ StackFrame::GetStatus (Stream& strm,
 if (show_source)
 {
 ExecutionContext exe_ctx (shared_from_this());
-bool have_source = false;
+bool have_source = false, have_debuginfo = false;
 Debugger::StopDisassemblyType disasm_display = 
Debugger::eStopDisassemblyTypeNever;
 Target *target = exe_ctx.GetTargetPtr();
 if (target)
@@ -1532,26 +1532,35 @@ StackFrame::GetStatus (Stream& strm,
 GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry);
 if (m_sc.comp_unit && m_sc.line_entry.IsValid())
 {
-have_source = true;
+have_debuginfo = true;
 if (source_lines_before > 0 || source_lines_after > 0)
 {
-
target->GetSourceManager().DisplaySourceLinesWithLineNumbers 
(m_sc.line_entry.file,
+size_t num_lines = 
target->GetSourceManager().DisplaySourceLinesWithLineNumbers 
(m_sc.line_ent

Re: [Lldb-commits] [PATCH] D12877: [LLDB] Switch to assembly view if source is moved

2015-12-02 Thread Mohit Bhakkad via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL254588: [LLDB] Switch to assembly view if source is moved 
(authored by mohit.bhakkad).

Changed prior to commit:
  http://reviews.llvm.org/D12877?vs=38799&id=41714#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12877

Files:
  lldb/trunk/source/Core/Debugger.cpp
  lldb/trunk/source/Target/StackFrame.cpp

Index: lldb/trunk/source/Core/Debugger.cpp
===
--- lldb/trunk/source/Core/Debugger.cpp
+++ lldb/trunk/source/Core/Debugger.cpp
@@ -86,9 +86,10 @@
 OptionEnumValueElement
 g_show_disassembly_enum_values[] =
 {
-{ Debugger::eStopDisassemblyTypeNever,"never", "Never show 
disassembly when displaying a stop context."},
-{ Debugger::eStopDisassemblyTypeNoSource, "no-source", "Show disassembly 
when there is no source information, or the source file is missing when 
displaying a stop context."},
-{ Debugger::eStopDisassemblyTypeAlways,   "always","Always show 
disassembly when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeNever,  "never","Never 
show disassembly when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeNoDebugInfo,"no-debuginfo", "Show 
disassembly when there is no debug information."},
+{ Debugger::eStopDisassemblyTypeNoSource,   "no-source","Show 
disassembly when there is no source information, or the source file is missing 
when displaying a stop context."},
+{ Debugger::eStopDisassemblyTypeAlways, "always",   
"Always show disassembly when displaying a stop context."},
 { 0, NULL, NULL }
 };
 
@@ -150,7 +151,7 @@
 {   "prompt",   OptionValue::eTypeString  , true, 
OptionValueString::eOptionEncodeCharacterEscapeSequences, "(lldb) ", NULL, "The 
debugger command line prompt displayed for the user." },
 {   "script-lang",  OptionValue::eTypeEnum, true, 
eScriptLanguagePython, NULL, g_language_enumerators, "The script language to be 
used for evaluating user-written scripts." },
 {   "stop-disassembly-count",   OptionValue::eTypeSInt64  , true, 4, 
NULL, NULL, "The number of disassembly lines to show when displaying a stopped 
context." },
-{   "stop-disassembly-display", OptionValue::eTypeEnum, true, 
Debugger::eStopDisassemblyTypeNoSource, NULL, g_show_disassembly_enum_values, 
"Control when to display disassembly when displaying a stopped context." },
+{   "stop-disassembly-display", OptionValue::eTypeEnum, true, 
Debugger::eStopDisassemblyTypeNoDebugInfo, NULL, 
g_show_disassembly_enum_values, "Control when to display disassembly when 
displaying a stopped context." },
 {   "stop-line-count-after",OptionValue::eTypeSInt64  , true, 3, 
NULL, NULL, "The number of sources lines to display that come after the current 
source line when displaying a stopped context." },
 {   "stop-line-count-before",   OptionValue::eTypeSInt64  , true, 3, 
NULL, NULL, "The number of sources lines to display that come before the 
current source line when displaying a stopped context." },
 {   "term-width",   OptionValue::eTypeSInt64  , true, 80   , 
NULL, NULL, "The maximum number of columns to use for displaying text." },
Index: lldb/trunk/source/Target/StackFrame.cpp
===
--- lldb/trunk/source/Target/StackFrame.cpp
+++ lldb/trunk/source/Target/StackFrame.cpp
@@ -1519,7 +1519,7 @@
 if (show_source)
 {
 ExecutionContext exe_ctx (shared_from_this());
-bool have_source = false;
+bool have_source = false, have_debuginfo = false;
 Debugger::StopDisassemblyType disasm_display = 
Debugger::eStopDisassemblyTypeNever;
 Target *target = exe_ctx.GetTargetPtr();
 if (target)
@@ -1532,26 +1532,35 @@
 GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry);
 if (m_sc.comp_unit && m_sc.line_entry.IsValid())
 {
-have_source = true;
+have_debuginfo = true;
 if (source_lines_before > 0 || source_lines_after > 0)
 {
-
target->GetSourceManager().DisplaySourceLinesWithLineNumbers 
(m_sc.line_entry.file,
+size_t num_lines = 
target->GetSourceManager().DisplaySourceLinesWithLineNumbers 
(m_sc.line_entry.file,

   m_sc.line_entry.line,

   source_lines_before,

   source_lines_after,

   "->",
  

[Lldb-commits] [PATCH] D15175: Fix breakpoint language filtering for other C variants (like C99) and Pascal.

2015-12-02 Thread Dawn Perchik via lldb-commits
dawn created this revision.
dawn added a reviewer: jingham.
dawn added a subscriber: lldb-commits.
dawn set the repository for this revision to rL LLVM.

This patch fixes setting breakpoints on symbol for variants of C and Pascal 
where the language is "unknown" within the filtering process added in r252356.  
It also renames GetLanguageForSymbolByName to GuessLanguageForSymbolByName and 
adds comments explaining the pitfalls of the flawed assumption that the 
language can be determined solely from the name and target.

Comment: Our users want to be able to set breakpoints in C, C++ or Pascal, but 
since the parsing of Pascal breakpoint identifiers is incompatible with ObjC, 
they're forced to set the target language option to Pascal.  After r252356 
however, the Pascal identifiers are interpreted as C++ and the C symbols are 
unknown, so all symbols are filtered out because they don't match the target 
language setting of Pascal, and they can no longer set symbolic breakpoints.  I 
don't see a way to fix this without breaking the intent of r252356.  Locally we 
have had to disable the filtering code.  Ideas for how to resolve this?

Repository:
  rL LLVM

http://reviews.llvm.org/D15175

Files:
  include/lldb/Target/LanguageRuntime.h
  source/Breakpoint/BreakpointResolverName.cpp
  source/Target/LanguageRuntime.cpp

Index: source/Target/LanguageRuntime.cpp
===
--- source/Target/LanguageRuntime.cpp
+++ source/Target/LanguageRuntime.cpp
@@ -347,16 +347,21 @@
 }
 
 lldb::LanguageType
-LanguageRuntime::GetLanguageForSymbolByName (Target &target, const char 
*symbol_name)
+LanguageRuntime::GuessLanguageForSymbolByName (Target &target, const char 
*symbol_name)
 {
-// This is not the right way to do this.  Different targets could have 
different ways of mangling names
-// from a given language.  So we should ask the various LanguageRuntime 
plugin instances for this target
-// to recognize the name.  But right now the plugin instances depend on 
the process, not the target.
-// That is unfortunate, because I want to use this for filtering 
breakpoints by language, and so I need to know
-// the "language for symbol-name" prior to running.  So we'd have to make 
a "LanguageRuntimeTarget" and
-// "LanguageRuntimeProcess", and direct the questions that don't need a 
running process to the former, and that
-// do to the latter.
+// We "guess" the language because we can't determine a symbol's language 
from it's name.
+// For example, a Pascal symbol can be mangled using the C++ Itanium 
scheme, and defined
+// in a compilation unit within the same module as other C++ units.
 //
+// In addition, different targets could have different ways of mangling 
names from a given
+// language, likewise compilation units within those targets.  It would 
help to be able to
+// ask the various LanguageRuntime plugin instances for this target to 
recognize the name,
+// but right now the plugin instances depend on the process, not the 
target.  That is
+// unfortunate, because to use this for filtering breakpoints by language, 
we need to know
+// the "language for symbol-name" prior to running.  So we'd have to make a
+// "LanguageRuntimeTarget" and "LanguageRuntimeProcess", and direct the 
questions that don't
+// need a running process to the former, and that do to the latter.
+//
 // That's more work than I want to do for this feature.
 if (CPlusPlusLanguage::IsCPPMangledName (symbol_name))
 return eLanguageTypeC_plus_plus;
Index: source/Breakpoint/BreakpointResolverName.cpp
===
--- source/Breakpoint/BreakpointResolverName.cpp
+++ source/Breakpoint/BreakpointResolverName.cpp
@@ -279,8 +279,9 @@
 const char *name = 
sc.GetFunctionName(Mangled::ePreferMangled).AsCString();
 if (name)
 {
-LanguageType sym_language = 
LanguageRuntime::GetLanguageForSymbolByName(target, name);
-if (m_language == eLanguageTypeC)
+LanguageType sym_language = 
LanguageRuntime::GuessLanguageForSymbolByName(target, name);
+if (Language::LanguageIsC(m_language) ||
+Language::LanguageIsPascal(m_language))
 {
 // We don't currently have a way to say "This symbol 
name is C" so for now, C means
 // not ObjC and not C++, etc...
@@ -293,6 +294,12 @@
 }
 else if (sym_language != m_language)
 {
+// Note: This code prevents us from being able to find 
symbols
+// like 'printf' if the target language's option is 
set.  It
+// would be better to limit this filtering to only 
when the
+  

[Lldb-commits] [lldb] r254590 - [LLDB][MIPS] Using enum instead of a constant to fetch PC and CAUSE registers.

2015-12-02 Thread Jaydeep Patil via lldb-commits
Author: jaydeep
Date: Thu Dec  3 00:41:24 2015
New Revision: 254590

URL: http://llvm.org/viewvc/llvm-project?rev=254590&view=rev
Log:
[LLDB][MIPS] Using enum instead of a constant to fetch PC and CAUSE registers.
SUMMARY:
Using enum instead of a constant to fetch PC and CAUSE registers.

Modified:

lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp?rev=254590&r1=254589&r2=254590&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp 
Thu Dec  3 00:41:24 2015
@@ -494,7 +494,7 @@ NativeRegisterContextLinux_mips64::GetPC
 log->Printf ("NativeRegisterContextLinux_mips64::%s Reading PC from 
breakpoint location", __FUNCTION__);
 
 // PC register is at index 34 of the register array
-const RegisterInfo *const pc_info_p = GetRegisterInfoAtIndex (34);
+const RegisterInfo *const pc_info_p = GetRegisterInfoAtIndex 
(gpr_pc_mips64);
 
 error = ReadRegister (pc_info_p, pc_value);
 if (error.Success ())
@@ -502,7 +502,7 @@ NativeRegisterContextLinux_mips64::GetPC
 pc = pc_value.GetAsUInt64 ();
 
 // CAUSE register is at index 37 of the register array
-const RegisterInfo *const cause_info_p = GetRegisterInfoAtIndex (37);
+const RegisterInfo *const cause_info_p = GetRegisterInfoAtIndex 
(gpr_cause_mips64);
 RegisterValue cause_value;
 
 ReadRegister (cause_info_p, cause_value);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits