Re: [Lldb-commits] [lldb] r277117 - Fix -break-insert not working when using absolute paths (MI)

2016-08-02 Thread Ilia K via lldb-commits
Hi Hans!

The author of this commit asks me is there a chance to include this changes
to 3.9 release? I'm not sure about our policy when RC has already been
tagged.

On Fri, Jul 29, 2016 at 9:01 AM, Ilia K via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: ki.stfu
> Date: Fri Jul 29 01:01:20 2016
> New Revision: 277117
>
> URL: http://llvm.org/viewvc/llvm-project?rev=277117=rev
> Log:
> Fix -break-insert not working when using absolute paths (MI)
>
> Summary:
> When trying to parse the -break-insert arguments as a named location, the
> string parsing was not configured to allow directory paths. This patch adds
> a constructor to allow the parsing of string as directory path along with
> the other parameters.
>
> This fixes https://llvm.org/bugs/show_bug.cgi?id=28709
>
> Patch from malape...@gmail.com
> Reviewers: clayborg, ki.stfu
> Subscribers: lldb-commits, ki.stfu
> Differential Revision: https://reviews.llvm.org/D22902
>
>
> Modified:
>
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
> lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
> lldb/trunk/tools/lldb-mi/MICmdArgValString.h
> lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py?rev=277117=277116=277117=diff
>
> ==
> ---
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
> (original)
> +++
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
> Fri Jul 29 01:01:20 2016
> @@ -155,7 +155,6 @@ class MiBreakTestCase(lldbmi_testcase.Mi
>
>  @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on
> Windows
>  @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known
> thread races
> -@unittest2.expectedFailure("-break-insert doesn't work for absolute
> path")
>  def test_lldbmi_break_insert_file_line_absolute_path(self):
>  """Test that 'lldb-mi --interpreter' works for file:line
> breakpoints."""
>
>
> Modified: lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp?rev=277117=277116=277117=diff
>
> ==
> --- lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp (original)
> +++ lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp Fri Jul 29 01:01:20 2016
> @@ -85,6 +85,30 @@ CMICmdArgValString::CMICmdArgValString(c
>  }
>
>  //++
> 
> +// Details: CMICmdArgValString constructor.
> +// Type:Method.
> +// Args:vrArgName   - (R) Argument's name to search by.
> +//  vbMandatory - (R) True = Yes must be present, false =
> optional argument.
> +//  vbHandleByCmd   - (R) True = Command processes *this option,
> false = not handled.
> +//  vbHandleQuotes  - (R) True = Parse a string surrounded by
> quotes spaces are not delimiters, false = only text up to
> +// next delimiting space character.
> +//  vbAcceptNumbers - (R) True = Parse a string and accept as a
> number if number, false = numbers not recognised as
> +//  vbHandleDirPaths - (R) True = Parse a string and accept as a
> file path if a path, false = file paths are not
> +// string types.
> +// Return:  None.
> +// Throws:  None.
> +//--
> +CMICmdArgValString::CMICmdArgValString(const CMIUtilString ,
> const bool vbMandatory, const bool vbHandleByCmd,
> +   const bool vbHandleQuotes, const bool vbAcceptNumbers,
> const bool vbHandleDirPaths)
> +: CMICmdArgValBaseTemplate(vrArgName, vbMandatory, vbHandleByCmd)
> +, m_bHandleQuotedString(vbHandleQuotes)
> +, m_bAcceptNumbers(vbAcceptNumbers)
> +, m_bHandleDirPaths(vbHandleDirPaths)
> +, m_bHandleAnything(false)
> +{
> +}
> +
> +//++
> 
>  // Details: CMICmdArgValString destructor.
>  // Type:Overridden.
>  // Args:None.
>
> Modified: lldb/trunk/tools/lldb-mi/MICmdArgValString.h
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValString.h?rev=277117=277116=277117=diff
>
> ==
> --- lldb/trunk/tools/lldb-mi/MICmdArgValString.h (original)
> +++ lldb/trunk/tools/lldb-mi/MICmdArgValString.h Fri Jul 29 01:01:20 2016
> @@ -32,6 +32,8 @@ class CMICmdArgValString : public CMICmd
>  /* ctor */ CMICmdArgValString(const bool vbHandleQuotes, const bool
> vbAcceptNumbers, const bool vbHandleDirPaths);
>  /* ctor */ CMICmdArgValString(const CMIUtilString , const
> bool vbMandatory, const bool vbHandleByCmd,

Re: [Lldb-commits] [PATCH] D23026: [LLDB-MI] removing requirement of a parameter for -break-insert's -f flag

2016-08-02 Thread Pierson Lee via lldb-commits
pieandcakes added a comment.

Hi Ilia,

Thanks for the review. There is another change I do need to make in the 
Execute() method and probably add some tests.

I reviewed this 

 spec for GDB/MI and it looks like -f should be a flag that says if 
//location// isn't found, to go ahead and set it as pending. I would assume 
that if pending flag is set and no //location// is set that it should error. 
Let me know what you think.

-Pierson


Repository:
  rL LLVM

https://reviews.llvm.org/D23026



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


[Lldb-commits] [PATCH] D23070: [debugserver] Delete CFData.{h, cpp}, since they appear to be dead (NFCI)

2016-08-02 Thread Vedant Kumar via lldb-commits
vsk created this revision.
vsk added reviewers: clayborg, labath.
vsk added a subscriber: lldb-commits.

https://reviews.llvm.org/D23070

Files:
  tools/debugserver/source/MacOSX/CFData.cpp
  tools/debugserver/source/MacOSX/CFData.h
  tools/debugserver/source/MacOSX/CMakeLists.txt
  tools/debugserver/source/MacOSX/MachProcess.mm

Index: tools/debugserver/source/MacOSX/MachProcess.mm
===
--- tools/debugserver/source/MacOSX/MachProcess.mm
+++ tools/debugserver/source/MacOSX/MachProcess.mm
@@ -43,7 +43,6 @@
 #include "PseudoTerminal.h"
 
 #include "CFBundle.h"
-#include "CFData.h"
 #include "CFString.h"
 
 #ifdef WITH_SPRINGBOARD
Index: tools/debugserver/source/MacOSX/CMakeLists.txt
===
--- tools/debugserver/source/MacOSX/CMakeLists.txt
+++ tools/debugserver/source/MacOSX/CMakeLists.txt
@@ -37,7 +37,6 @@
 add_lldb_executable(debugserver
   HasAVX.s
   CFBundle.cpp
-  CFData.cpp
   CFString.cpp
   Genealogy.cpp
   MachException.cpp
Index: tools/debugserver/source/MacOSX/CFData.h
===
--- tools/debugserver/source/MacOSX/CFData.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===-- CFData.h *- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-//
-//  Created by Greg Clayton on 1/16/08.
-//
-//===--===//
-
-#ifndef __CFData_h__
-#define __CFData_h__
-
-#include "CFUtils.h"
-
-class CFData : public CFReleaser
-{
-public:
-//--
-// Constructors and Destructors
-//--
-CFData(CFDataRef data = NULL);
-CFData(const CFData& rhs);
-virtual ~CFData();
-
-CFDataRef Serialize(CFPropertyListRef plist, CFPropertyListFormat format);
-const uint8_t* GetBytePtr () const;
-CFIndex GetLength () const;
-protected:
-//--
-// Classes that inherit from CFData can see and modify these
-//--
-};
-
-#endif // #ifndef __CFData_h__
Index: tools/debugserver/source/MacOSX/CFData.cpp
===
--- tools/debugserver/source/MacOSX/CFData.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//===-- CFData.cpp --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-//
-//  Created by Greg Clayton on 1/16/08.
-//
-//===--===//
-
-#include "CFData.h"
-
-//--
-// CFData constructor
-//--
-CFData::CFData(CFDataRef data) :
-CFReleaser(data)
-{
-
-}
-
-//--
-// CFData copy constructor
-//--
-CFData::CFData(const CFData& rhs) :
-CFReleaser(rhs)
-{
-
-}
-
-//--
-// Destructor
-//--
-CFData::~CFData()
-{
-}
-
-
-CFIndex
-CFData::GetLength() const
-{
-CFDataRef data = get();
-if (data)
-return CFDataGetLength (data);
-return 0;
-}
-
-
-const uint8_t*
-CFData::GetBytePtr() const
-{
-CFDataRef data = get();
-if (data)
-return CFDataGetBytePtr (data);
-return NULL;
-}
-
-CFDataRef
-CFData::Serialize(CFPropertyListRef plist, CFPropertyListFormat format)
-{
-CFAllocatorRef alloc = kCFAllocatorDefault;
-reset();
-CFReleaser stream (::CFWriteStreamCreateWithAllocatedBuffers (alloc, alloc));
-::CFWriteStreamOpen (stream.get());
-CFIndex len = ::CFPropertyListWriteToStream (plist, stream.get(), format, NULL);
-if (len > 0)
-reset((CFDataRef)::CFWriteStreamCopyProperty (stream.get(), kCFStreamPropertyDataWritten));
-::CFWriteStreamClose (stream.get());
-return get();
-}
-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] FW: [Diffusion] rL277426: [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation…

2016-08-02 Thread Hans Wennborg via lldb-commits
While this all seems very MIPS-specific, so probably fine to merge if
you want to, it does look more like new development than just bug
fixing.

I'm OK with merging this if Clayton approves, though.

Thanks,
Hans

On Tue, Aug 2, 2016 at 12:49 AM, Nitesh Jain  wrote:
> Hi Hans,
>
> Could you please merge this to the LLDB 3.9 release branch ?
>
> Thanks & regards,
> Nitesh Jain
>
> -Original Message-
> From: Nitesh Jain
> Sent: 02 August 2016 12:56
> To: Nitesh Jain
> Subject: Re: [Diffusion] rL277426: [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI 
> instructions emulation . Fix emulation…
>
> nitesh.jain committed rL277426: [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI 
> instructions emulation . Fix emulation….
>
> [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation 
> for (D)ADDIU, SD/SW and LW/LD instructions
>
> Reviewers: clayborg, jaydeep, bhushan
>
> Subscribers: mohit.bhakkad, slthakur, sdardis, lldb-commits
>
> Differential Revision: https://reviews.llvm.org/D22851
>
>
> Files:
>   /lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
>   /lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
>   /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
>   /lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
>
> Users:
>   nitesh.jain (Author)
>
> https://reviews.llvm.org/rL277426
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D20357: [LLDB][MIPS] Fix FPU Size Based on Dynamic FR (Merge Request)

2016-08-02 Thread Hans Wennborg via lldb-commits
Looks like a pretty big change to merge at this stage.

I'll let Clayton decide.

Thanks,
Hans

On Mon, Aug 1, 2016 at 11:25 PM, Nitesh Jain  wrote:
> Hi Hans,
>
> Could you please add this to the LLDB 3.9 release branch ?
>
> Thanks & regards,
> Nitesh Jain
>
>
> -Original Message-
> From: Nitesh Jain
> Sent: 01 August 2016 19:24
> To: Nitesh Jain; jing...@apple.com; clayb...@gmail.com
> Cc: ema...@freebsd.org; nemanja.i@gmail.com; lab...@google.com; 
> lldb-commits@lists.llvm.org; Simon Dardis; Mohit Bhakkad; Sagar Thakur; 
> Bhushan Attarde; Jaydeep Patil
> Subject: Re: [PATCH] D20357: [LLDB][MIPS] Fix FPU Size Based on Dynamic FR
>
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL277343: [LLVM][MIPS] Fix FPU Size Based on Dynamic FR. 
> (authored by nitesh.jain).
>
> Changed prior to commit:
>   https://reviews.llvm.org/D20357?vs=65923=66314#toc
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D20357
>
> Files:
>   lldb/trunk/include/lldb/Target/RegisterContext.h
>   lldb/trunk/include/lldb/lldb-private-types.h
>   lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>   lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_arm.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_arm64.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_i386.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_mips.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_mips64.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_powerpc.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_s390x.h
>   lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
>   
> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
>   lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
>   lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>   lldb/trunk/source/Target/RegisterContext.cpp
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D22902: Fix -break-insert not working when using absolute paths

2016-08-02 Thread Marc-Andre Laperle via lldb-commits
malaperle added a comment.

Would it be possible to apply this fix to the release_39 branch?


Repository:
  rL LLVM

https://reviews.llvm.org/D22902



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


[Lldb-commits] [lldb] r277453 - Revert rL277429: Correct makefile.rules to use toolchain specific AR and OBJCOPY

2016-08-02 Thread Omair Javaid via lldb-commits
Author: omjavaid
Date: Tue Aug  2 08:17:49 2016
New Revision: 277453

URL: http://llvm.org/viewvc/llvm-project?rev=277453=rev
Log:
Revert rL277429: Correct makefile.rules to use toolchain specific AR and OBJCOPY

This commit is causing problems on gcc-* compiler with version number sufix.

Requires a new solution will post a follow up patch.

Differential revision: https://reviews.llvm.org/D20386


Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=277453=277452=277453=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Aug  2 
08:17:49 2016
@@ -265,6 +265,8 @@ cxx_linker_notdir = $(if $(findstring cl
 $(subst cc,c++,$(1))
 cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call 
cxx_linker_notdir,$(notdir $(1,$(call cxx_linker_notdir,$(1)))
 
+OBJCOPY := $(CROSS_COMPILE)objcopy
+
 #--
 # Windows specific options
 #--
@@ -285,25 +287,24 @@ endif
 #--
 # Android specific options
 #--
-
-ifdef PIE
-LDFLAGS += -pie
+ifeq "$(OS)" "Android"
+ifdef PIE
+LDFLAGS += -pie
+endif
+replace_with = $(if $(findstring clang,$(1)), \
+$(subst clang,$(2),$(1)), \
+$(if $(findstring gcc,$(1)), \
+ $(subst gcc,$(2),$(1)), \
+ $(subst cc,$(2),$(1
+ifeq "$(notdir $(CC))" "$(CC)"
+replace_cc_with = $(call replace_with,$(CC),$(1))
+else
+replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir 
$(CC)),$(1)))
+endif
+OBJCOPY = $(call replace_cc_with,objcopy)
+AR = $(call replace_cc_with,ar)
 endif
 
-replace_with = $(if $(findstring clang,$(1)), \
-$(subst clang,$(2),$(1)), \
-$(if $(findstring gcc,$(1)), \
- $(subst gcc,$(2),$(1)), \
- $(subst cc,$(2),$(1
-ifeq "$(notdir $(CC))" "$(CC)"
-replace_cc_with = $(call replace_with,$(CC),$(1))
-else
-replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir 
$(CC)),$(1)))
-endif
-
-OBJCOPY = $(call replace_cc_with,objcopy)
-AR = $(call replace_cc_with,ar)
-
 #--
 # C++ standard library options
 #--


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


Re: [Lldb-commits] [PATCH] D22132: Support for OCaml native debugging

2016-08-02 Thread Tamas Berghammer via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL277443: Support for OCaml native debugging (authored by 
tberghammer).

Changed prior to commit:
  https://reviews.llvm.org/D22132?vs=64473=66456#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22132

Files:
  lldb/trunk/cmake/LLDBDependencies.cmake
  lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
  lldb/trunk/include/lldb/Symbol/TypeSystem.h
  lldb/trunk/source/API/SystemInitializerFull.cpp
  lldb/trunk/source/Plugins/Language/CMakeLists.txt
  lldb/trunk/source/Plugins/Language/OCaml/CMakeLists.txt
  lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.cpp
  lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/trunk/source/Symbol/CMakeLists.txt
  lldb/trunk/source/Symbol/OCamlASTContext.cpp

Index: lldb/trunk/include/lldb/Symbol/TypeSystem.h
===
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h
@@ -75,6 +75,7 @@
 eKindSwift,
 eKindGo,
 eKindJava,
+eKindOCaml,
 kNumKinds
 };
 
Index: lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
===
--- lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
+++ lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
@@ -0,0 +1,355 @@
+//===-- OCamlASTContext.h --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef liblldb_OCamlASTContext_h_
+#define liblldb_OCamlASTContext_h_
+
+// C Includes
+// C++ Includes
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/ConstString.h"
+#include "lldb/Symbol/TypeSystem.h"
+#include "lldb/Symbol/CompilerType.h"
+
+namespace lldb_private
+{
+
+class OCamlASTContext : public TypeSystem
+{
+  public:
+class OCamlType;
+typedef std::map OCamlTypeMap;
+
+OCamlASTContext();
+~OCamlASTContext() override;
+
+ConstString
+GetPluginName() override;
+
+uint32_t
+GetPluginVersion() override;
+
+static ConstString
+GetPluginNameStatic ();
+
+static lldb::TypeSystemSP
+CreateInstance (lldb::LanguageType language, Module *module, Target *target);
+
+static void
+EnumerateSupportedLanguages(std::set _for_types,
+std::set _for_expressions);
+
+static void
+Initialize ();
+
+static void
+Terminate ();
+
+DWARFASTParser *GetDWARFParser() override;
+
+void
+SetAddressByteSize(int byte_size)
+{
+m_pointer_byte_size = byte_size;
+}
+
+static bool classof(const TypeSystem *ts)
+{
+return ts->getKind() == TypeSystem::eKindOCaml;
+}
+
+ConstString
+DeclGetName (void *opaque_decl) override
+{
+return ConstString();
+}
+
+bool
+DeclContextIsStructUnionOrClass(void *opaque_decl_ctx) override
+{
+return false;
+}
+
+ConstString
+DeclContextGetName(void *opaque_decl_ctx) override
+{
+return ConstString();
+}
+
+ConstString
+DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override
+{
+return ConstString();
+}
+
+bool
+DeclContextIsClassMethod(void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
+ bool *is_instance_method_ptr,
+ ConstString *language_object_name_ptr) override
+{
+return false;
+}
+
+bool SupportsLanguage (lldb::LanguageType language) override;
+uint32_t GetPointerByteSize() override;
+
+bool
+IsArrayType(lldb::opaque_compiler_type_t type, CompilerType *element_type, 
+uint64_t *size, bool *is_incomplete) override;
+
+bool IsAggregateType(lldb::opaque_compiler_type_t type) override;
+
+bool IsCharType(lldb::opaque_compiler_type_t type) override;
+
+bool IsCompleteType(lldb::opaque_compiler_type_t type) override;
+
+bool IsDefined(lldb::opaque_compiler_type_t type) override;
+
+bool IsFloatingPointType(lldb::opaque_compiler_type_t type, uint32_t , bool _complex) override;
+
+bool IsFunctionType(lldb::opaque_compiler_type_t type, bool *is_variadic_ptr = nullptr) override;
+
+size_t GetNumberOfFunctionArguments(lldb::opaque_compiler_type_t type) override;
+
+CompilerType 

[Lldb-commits] [lldb] r277443 - Support for OCaml native debugging

2016-08-02 Thread Tamas Berghammer via lldb-commits
Author: tberghammer
Date: Tue Aug  2 06:15:55 2016
New Revision: 277443

URL: http://llvm.org/viewvc/llvm-project?rev=277443=rev
Log:
Support for OCaml native debugging

This introduces basic support for debugging OCaml binaries.
Use of the native compiler with DWARF emission support (see
https://github.com/ocaml/ocaml/pull/574) is required.

Available variables are considered as 64 bits unsigned integers,
their interpretation will be left to a OCaml-made debugging layer.

Differential revision: https://reviews.llvm.org/D22132

Added:
lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
lldb/trunk/source/Plugins/Language/OCaml/
lldb/trunk/source/Plugins/Language/OCaml/CMakeLists.txt
lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.cpp
lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h
lldb/trunk/source/Symbol/OCamlASTContext.cpp
Modified:
lldb/trunk/cmake/LLDBDependencies.cmake
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Plugins/Language/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Symbol/CMakeLists.txt

Modified: lldb/trunk/cmake/LLDBDependencies.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=277443=277442=277443=diff
==
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)
+++ lldb/trunk/cmake/LLDBDependencies.cmake Tue Aug  2 06:15:55 2016
@@ -27,6 +27,7 @@ set( LLDB_USED_LIBS
   lldbPluginJavaLanguage
   lldbPluginObjCLanguage
   lldbPluginObjCPlusPlusLanguage
+  lldbPluginOCamlLanguage
 
   lldbPluginObjectFileELF
   lldbPluginObjectFileJIT

Added: lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/OCamlASTContext.h?rev=277443=auto
==
--- lldb/trunk/include/lldb/Symbol/OCamlASTContext.h (added)
+++ lldb/trunk/include/lldb/Symbol/OCamlASTContext.h Tue Aug  2 06:15:55 2016
@@ -0,0 +1,355 @@
+//===-- OCamlASTContext.h --*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef liblldb_OCamlASTContext_h_
+#define liblldb_OCamlASTContext_h_
+
+// C Includes
+// C++ Includes
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/ConstString.h"
+#include "lldb/Symbol/TypeSystem.h"
+#include "lldb/Symbol/CompilerType.h"
+
+namespace lldb_private
+{
+
+class OCamlASTContext : public TypeSystem
+{
+  public:
+class OCamlType;
+typedef std::map OCamlTypeMap;
+
+OCamlASTContext();
+~OCamlASTContext() override;
+
+ConstString
+GetPluginName() override;
+
+uint32_t
+GetPluginVersion() override;
+
+static ConstString
+GetPluginNameStatic ();
+
+static lldb::TypeSystemSP
+CreateInstance (lldb::LanguageType language, Module *module, Target 
*target);
+
+static void
+EnumerateSupportedLanguages(std::set 
_for_types,
+std::set 
_for_expressions);
+
+static void
+Initialize ();
+
+static void
+Terminate ();
+
+DWARFASTParser *GetDWARFParser() override;
+
+void
+SetAddressByteSize(int byte_size)
+{
+m_pointer_byte_size = byte_size;
+}
+
+static bool classof(const TypeSystem *ts)
+{
+return ts->getKind() == TypeSystem::eKindOCaml;
+}
+
+ConstString
+DeclGetName (void *opaque_decl) override
+{
+return ConstString();
+}
+
+bool
+DeclContextIsStructUnionOrClass(void *opaque_decl_ctx) override
+{
+return false;
+}
+
+ConstString
+DeclContextGetName(void *opaque_decl_ctx) override
+{
+return ConstString();
+}
+
+ConstString
+DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override
+{
+return ConstString();
+}
+
+bool
+DeclContextIsClassMethod(void *opaque_decl_ctx, lldb::LanguageType 
*language_ptr,
+ bool *is_instance_method_ptr,
+ ConstString *language_object_name_ptr) override
+{
+return false;
+}
+
+bool SupportsLanguage (lldb::LanguageType language) override;
+uint32_t GetPointerByteSize() override;
+
+bool
+IsArrayType(lldb::opaque_compiler_type_t type, 

Re: [Lldb-commits] [PATCH] D22132: Support for OCaml native debugging

2016-08-02 Thread Elias Boutaleb via lldb-commits
ebtaleb added a comment.

In https://reviews.llvm.org/D22132#502204, @tberghammer wrote:

> Do you want me to commit it in for you?


Sure, if you don't mind. Thank you.


https://reviews.llvm.org/D22132



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


Re: [Lldb-commits] [PATCH] D20386: Correct makefile.rules to use arm/aarch64 target specific AR and OBJCOPY

2016-08-02 Thread Muhammad Omair Javaid via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL277429: Correct makefile.rules to use toolchain specific AR 
and OBJCOPY (authored by omjavaid).

Changed prior to commit:
  https://reviews.llvm.org/D20386?vs=66258=66438#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D20386

Files:
  lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Index: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
===
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -265,8 +265,6 @@
 $(subst cc,c++,$(1))
 cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call 
cxx_linker_notdir,$(notdir $(1,$(call cxx_linker_notdir,$(1)))
 
-OBJCOPY := $(CROSS_COMPILE)objcopy
-
 #--
 # Windows specific options
 #--
@@ -287,24 +285,25 @@
 #--
 # Android specific options
 #--
-ifeq "$(OS)" "Android"
-ifdef PIE
-LDFLAGS += -pie
-endif
-replace_with = $(if $(findstring clang,$(1)), \
-$(subst clang,$(2),$(1)), \
-$(if $(findstring gcc,$(1)), \
- $(subst gcc,$(2),$(1)), \
- $(subst cc,$(2),$(1
-ifeq "$(notdir $(CC))" "$(CC)"
-replace_cc_with = $(call replace_with,$(CC),$(1))
-else
-replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir 
$(CC)),$(1)))
-endif
-OBJCOPY = $(call replace_cc_with,objcopy)
-AR = $(call replace_cc_with,ar)
+
+ifdef PIE
+LDFLAGS += -pie
+endif
+
+replace_with = $(if $(findstring clang,$(1)), \
+$(subst clang,$(2),$(1)), \
+$(if $(findstring gcc,$(1)), \
+ $(subst gcc,$(2),$(1)), \
+ $(subst cc,$(2),$(1
+ifeq "$(notdir $(CC))" "$(CC)"
+replace_cc_with = $(call replace_with,$(CC),$(1))
+else
+replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir 
$(CC)),$(1)))
 endif
 
+OBJCOPY = $(call replace_cc_with,objcopy)
+AR = $(call replace_cc_with,ar)
+
 #--
 # C++ standard library options
 #--


Index: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
===
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -265,8 +265,6 @@
 $(subst cc,c++,$(1))
 cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1,$(call cxx_linker_notdir,$(1)))
 
-OBJCOPY := $(CROSS_COMPILE)objcopy
-
 #--
 # Windows specific options
 #--
@@ -287,24 +285,25 @@
 #--
 # Android specific options
 #--
-ifeq "$(OS)" "Android"
-ifdef PIE
-LDFLAGS += -pie
-endif
-replace_with = $(if $(findstring clang,$(1)), \
-$(subst clang,$(2),$(1)), \
-$(if $(findstring gcc,$(1)), \
- $(subst gcc,$(2),$(1)), \
- $(subst cc,$(2),$(1
-ifeq "$(notdir $(CC))" "$(CC)"
-replace_cc_with = $(call replace_with,$(CC),$(1))
-else
-replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir $(CC)),$(1)))
-endif
-OBJCOPY = $(call replace_cc_with,objcopy)
-AR = $(call replace_cc_with,ar)
+
+ifdef PIE
+LDFLAGS += -pie
+endif
+
+replace_with = $(if $(findstring clang,$(1)), \
+$(subst clang,$(2),$(1)), \
+$(if $(findstring gcc,$(1)), \
+ $(subst gcc,$(2),$(1)), \
+ $(subst cc,$(2),$(1
+ifeq "$(notdir $(CC))" "$(CC)"
+replace_cc_with = $(call replace_with,$(CC),$(1))
+else
+replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir $(CC)),$(1)))
 endif
 
+OBJCOPY = $(call replace_cc_with,objcopy)
+AR = $(call replace_cc_with,ar)
+
 #--
 # C++ standard library options
 #--

[Lldb-commits] [lldb] r277429 - Correct makefile.rules to use toolchain specific AR and OBJCOPY

2016-08-02 Thread Omair Javaid via lldb-commits
Author: omjavaid
Date: Tue Aug  2 02:56:11 2016
New Revision: 277429

URL: http://llvm.org/viewvc/llvm-project?rev=277429=rev
Log:
Correct makefile.rules to use toolchain specific AR and OBJCOPY

Differential revision: https://reviews.llvm.org/D20386


Modified:
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=277429=277428=277429=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Aug  2 
02:56:11 2016
@@ -265,8 +265,6 @@ cxx_linker_notdir = $(if $(findstring cl
 $(subst cc,c++,$(1))
 cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call 
cxx_linker_notdir,$(notdir $(1,$(call cxx_linker_notdir,$(1)))
 
-OBJCOPY := $(CROSS_COMPILE)objcopy
-
 #--
 # Windows specific options
 #--
@@ -287,24 +285,25 @@ endif
 #--
 # Android specific options
 #--
-ifeq "$(OS)" "Android"
-ifdef PIE
-LDFLAGS += -pie
-endif
-replace_with = $(if $(findstring clang,$(1)), \
-$(subst clang,$(2),$(1)), \
-$(if $(findstring gcc,$(1)), \
- $(subst gcc,$(2),$(1)), \
- $(subst cc,$(2),$(1
-ifeq "$(notdir $(CC))" "$(CC)"
-replace_cc_with = $(call replace_with,$(CC),$(1))
-else
-replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir 
$(CC)),$(1)))
-endif
-OBJCOPY = $(call replace_cc_with,objcopy)
-AR = $(call replace_cc_with,ar)
+
+ifdef PIE
+LDFLAGS += -pie
 endif
 
+replace_with = $(if $(findstring clang,$(1)), \
+$(subst clang,$(2),$(1)), \
+$(if $(findstring gcc,$(1)), \
+ $(subst gcc,$(2),$(1)), \
+ $(subst cc,$(2),$(1
+ifeq "$(notdir $(CC))" "$(CC)"
+replace_cc_with = $(call replace_with,$(CC),$(1))
+else
+replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir 
$(CC)),$(1)))
+endif
+
+OBJCOPY = $(call replace_cc_with,objcopy)
+AR = $(call replace_cc_with,ar)
+
 #--
 # C++ standard library options
 #--


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


Re: [Lldb-commits] [PATCH] D22851: [LLDB][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation for (D)ADDIU, SD/SW and LW/LD instructions

2016-08-02 Thread Nitesh Jain via lldb-commits
nitesh.jain closed this revision.
nitesh.jain added a comment.

committed in revision https://reviews.llvm.org/rL277426,


https://reviews.llvm.org/D22851



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


[Lldb-commits] [lldb] r277426 - [LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation for (D)ADDIU, SD/SW and LW/LD instructions

2016-08-02 Thread Nitesh Jain via lldb-commits
Author: nitesh.jain
Date: Tue Aug  2 02:18:07 2016
New Revision: 277426

URL: http://llvm.org/viewvc/llvm-project?rev=277426=rev
Log:
[LLVM][MIPS] Add (D)SUBU, (D)ADDU, LUI instructions emulation . Fix emulation 
for (D)ADDIU, SD/SW and LW/LD instructions

Reviewers: clayborg, jaydeep, bhushan

Subscribers: mohit.bhakkad, slthakur, sdardis, lldb-commits

Differential Revision: https://reviews.llvm.org/D20357

Modified:
lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h

Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp?rev=277426=277425=277426=diff
==
--- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp 
(original)
+++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp Tue 
Aug  2 02:18:07 2016
@@ -494,9 +494,13 @@ EmulateInstructionMIPS::GetOpcodeForInst
 
//--
 // Prologue/Epilogue instructions
 
//--
-{ "ADDiu",  ::Emulate_ADDiu,   "ADDIU 
rt,rs,immediate"},
-{ "SW", ::Emulate_SW,  "SW 
rt,offset(rs)" },
-{ "LW", ::Emulate_LW,  "LW 
rt,offset(base)"   },
+{ "ADDiu",  ::Emulate_ADDiu,   "ADDIU 
rt, rs, immediate"},
+{ "SW", ::Emulate_SW,  "SW rt, 
offset(rs)"  },
+{ "LW", ::Emulate_LW,  "LW rt, 
offset(base)"},
+{ "SUBU",   ::Emulate_SUBU_ADDU,   "SUBU 
rd, rs, rt"},
+{ "ADDU",   ::Emulate_SUBU_ADDU,   "ADDU 
rd, rs, rt"},
+{ "LUI",::Emulate_LUI,  "LUI 
rt, immediate"  },
+
 
//--
 // MicroMIPS Prologue/Epilogue instructions
 
//--
@@ -904,36 +908,57 @@ EmulateInstructionMIPS::nonvolatile_reg_
 bool
 EmulateInstructionMIPS::Emulate_ADDiu (llvm::MCInst& insn)
 {
+// ADDIU rt, rs, immediate
+// GPR[rt] <- GPR[rs] + sign_extend(immediate)
+
+uint8_t dst, src;
 bool success = false;
 const uint32_t imm16 = insn.getOperand(2).getImm();
-uint32_t imm = SignedBits(imm16, 15, 0);
-uint64_t result;
-uint32_t src, dst;
+int64_t imm = SignedBits(imm16, 15, 0);
 
 dst = m_reg_info->getEncodingValue (insn.getOperand(0).getReg());
 src = m_reg_info->getEncodingValue (insn.getOperand(1).getReg());
 
-/* Check if this is addiu sp,,imm16 */
-if (dst == dwarf_sp_mips)
+// If immediate value is greater then 2^16 - 1 then clang generate
+// LUI, ADDIU, SUBU instructions in prolog.
+// Example
+// lui$1, 0x2
+// addiu $1, $1, -0x5920
+// subu  $sp, $sp, $1
+// In this case, ADDIU dst and src will be same and not equal to sp
+if (dst == src)
 {
+Context context;
+
 /* read  register */
-uint64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, 
dwarf_zero_mips + src, 0, );
+const int64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, 
dwarf_zero_mips + src, 0, );
 if (!success)
 return false;
 
-result = src_opd_val + imm;
+/* Check if this is daddiu sp, sp, imm16 */
+if (dst == dwarf_sp_mips)
+{
+uint64_t result = src_opd_val + imm;
+RegisterInfo reg_info_sp;
 
-Context context;
-RegisterInfo reg_info_sp;
-if (GetRegisterInfo (eRegisterKindDWARF, dwarf_sp_mips, reg_info_sp))
-context.SetRegisterPlusOffset (reg_info_sp, imm);
+if (GetRegisterInfo (eRegisterKindDWARF, dwarf_sp_mips, 
reg_info_sp))
+context.SetRegisterPlusOffset (reg_info_sp, imm);
 
-/* We are allocating bytes on stack */
-context.type = eContextAdjustStackPointer;
+/* We are allocating bytes on stack */
+context.type = eContextAdjustStackPointer;
 
-WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_sp_mips, 
result);
+WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_sp_mips, 
result);
+return true;
+}
+
+imm += src_opd_val;
+context.SetImmediateSigned (imm);
+context.type = eContextImmediate;
+
+if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, 
dwarf_zero_mips + dst, imm))
+return false;