Compare commits

...

7 Commits
rawhide ... f25

Author SHA1 Message Date
Tom Stellard 37f688617f Add explicit Requires for llvm-libs and clang-libs 2017-03-21 23:25:13 +00:00
Tom Stellard 471c3eb484 Adjust python sys.path so lldb can find readline.so 2017-03-17 23:25:38 +00:00
Dave Airlie baf6b35be5 lldb: fix missing backport 2017-03-02 13:55:05 +10:00
Dave Airlie 366f67086b lldb: fix build 2017-03-02 13:37:50 +10:00
Dave Airlie 0d5b8a709f lldb 3.9.1 2017-03-02 10:42:59 +10:00
Michael Cronenworth 8d34357c79 Update to 3.8.1 to sync with llvm and clang 2017-01-17 13:32:15 -06:00
Nathaniel McCallum 1a211f9918 Disable libedit support until upstream fixes it (#1356140) 2016-11-14 15:28:25 -05:00
5 changed files with 425 additions and 14 deletions

6
.gitignore vendored
View File

@ -1,4 +1,2 @@
/lldb-3.7.1.src.tar.xz
/lldb-3.8.0rc2.src.tar.xz
/lldb-3.8.0rc3.src.tar.xz
/lldb-3.8.0.src.tar.xz
/lldb-3.8.1.src.tar.xz
/lldb-3.9.1.src.tar.xz

View File

@ -0,0 +1,214 @@
From 988829f74cfe3c9085c097387f7b8d56b64d3d00 Mon Sep 17 00:00:00 2001
From: Pavel Labath <labath@google.com>
Date: Tue, 13 Sep 2016 10:39:12 +0000
Subject: [PATCH] Remove MIUtilParse (no longer used)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Summary: follow-up to https://reviews.llvm.org/D23882
Reviewers: dawn, krytarowski, labath, ki.stfu
Subscribers: beanz, mgorny, labath, ki.stfu, lldb-commits
Differential Revision: https://reviews.llvm.org/D23883
Author: Michał Górny <mgorny@gentoo.org>
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@281317 91177308-0d34-0410-b5e6-96231b3b80d8
---
tools/lldb-mi/CMakeLists.txt | 1 -
tools/lldb-mi/MIUtilParse.cpp | 74 -----------------------------------------
tools/lldb-mi/MIUtilParse.h | 77 -------------------------------------------
3 files changed, 152 deletions(-)
delete mode 100644 tools/lldb-mi/MIUtilParse.cpp
delete mode 100644 tools/lldb-mi/MIUtilParse.h
diff --git a/tools/lldb-mi/CMakeLists.txt b/tools/lldb-mi/CMakeLists.txt
index 79f657a..01ad483 100644
--- a/tools/lldb-mi/CMakeLists.txt
+++ b/tools/lldb-mi/CMakeLists.txt
@@ -65,7 +65,6 @@ set(LLDB_MI_SOURCES
MIDriverBase.cpp
MIDriverMain.cpp
MIDriverMgr.cpp
- MIUtilParse.cpp
MIUtilDateTimeStd.cpp
MIUtilDebug.cpp
MIUtilFileStd.cpp
diff -up lldb-3.9.0.src/tools/lldb-mi/MIUtilParse.cpp.dave lldb-3.9.0.src/tools/lldb-mi/MIUtilParse.cpp
--- lldb-3.9.0.src/tools/lldb-mi/MIUtilParse.cpp.dave 2016-10-27 07:14:11.484573321 +1000
+++ lldb-3.9.0.src/tools/lldb-mi/MIUtilParse.cpp 2016-10-27 07:14:58.914009161 +1000
@@ -1,75 +0,0 @@
-//===-- MIUtilParse.cpp ----------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// Third party headers:
-#include <memory>
-
-// In-house headers:
-#include "MIUtilParse.h"
-
-//++ ------------------------------------------------------------------------------------
-// Details: CRegexParser constructor.
-// Type: Method.
-// Args: regexStr - Pointer to the regular expression to compile.
-// Return: None.
-// Throws: None.
-//--
-MIUtilParse::CRegexParser::CRegexParser(const char *regexStr)
- : m_isValid(llvm_regcomp(&m_emma, regexStr, REG_EXTENDED) == 0)
-{
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details: CRegexParser destructor.
-// Type: Method.
-// Args: None.
-// Return: None.
-// Throws: None.
-//--
-MIUtilParse::CRegexParser::~CRegexParser()
-{
- // Free up memory held within regex.
- if (m_isValid)
- llvm_regfree(&m_emma);
-}
-
-//++ ------------------------------------------------------------------------------------
-// Details: CRegexParser regex executer.
-// Match the input against the regular expression. Return an error
-// if the number of matches is less than minMatches. If the default
-// minMatches value of 0 is passed, an error will be returned if
-// the number of matches is less than the maxMatches value used to
-// initialize Match.
-// Type: Method.
-// Args: input (R) - Pointer to UTF8 text data to be parsed.
-// match (RW) - Reference to Match class.
-// minMatches (R) - Minimum number of regex matches expected.
-// Return: bool - True = minimum matches were met,
-// false = minimum matches were not met or regex failed.
-// Throws: None.
-//--
-bool
-MIUtilParse::CRegexParser::Execute(const char *input, Match& match, size_t minMatches)
-{
- if (!m_isValid)
- return false;
-
- std::unique_ptr<llvm_regmatch_t[]> matches(new llvm_regmatch_t[match.m_maxMatches]); // Array of matches
-
- if (llvm_regexec(&m_emma, input, match.m_maxMatches, matches.get(), 0) != 0)
- return false;
-
- size_t i;
- for (i = 0; i < match.m_maxMatches && matches[i].rm_so >= 0; i++)
- {
- const int n = matches[i].rm_eo - matches[i].rm_so;
- match.m_matchStrs[i].assign(input + matches[i].rm_so, n);
- }
- return i >= minMatches;
-}
diff -up lldb-3.9.0.src/tools/lldb-mi/MIUtilParse.h.dave lldb-3.9.0.src/tools/lldb-mi/MIUtilParse.h
--- lldb-3.9.0.src/tools/lldb-mi/MIUtilParse.h.dave 2016-10-27 07:14:19.814649866 +1000
+++ lldb-3.9.0.src/tools/lldb-mi/MIUtilParse.h 2016-10-27 07:14:57.395995227 +1000
@@ -1,93 +0,0 @@
-//===-- MIUtilParse.h ------------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#pragma once
-
-// Third party headers:
-#include "../lib/Support/regex_impl.h"
-
-// In-house headers:
-#include "MIUtilString.h"
-
-namespace MIUtilParse
-{
-
-//++ ============================================================================
-// Details: MI common code utility class. Used to parse the output
-// returned from lldb commands using regex.
-//--
-class CRegexParser
-{
- public:
- // Helper class for keeping track of regex matches.
- class Match
- {
- friend CRegexParser;
- public:
- /* ctor */ explicit Match(size_t nmatches)
- : m_matchStrs(nmatches), m_maxMatches(nmatches)
- {
- }
- size_t
- GetMatchCount() const
- {
- return m_matchStrs.size();
- }
- CMIUtilString
- GetMatchAtIndex(size_t i) const
- {
- if (m_matchStrs.size() > i)
- return m_matchStrs[i];
- return CMIUtilString();
- }
- private:
- CMIUtilString::VecString_t m_matchStrs;
- const size_t m_maxMatches;
- };
-
- // Methods:
- // Compile the regular expression.
- /* ctor */ explicit CRegexParser(const char *regexStr);
-
- // Free the memory used by the regular expression.
- /* dtor */ ~CRegexParser();
-
- // No copies
- CRegexParser(const CRegexParser&) = delete;
- void operator=(CRegexParser&) = delete;
-
- // Return the match at the index.
- int
- GetMatchCount(const Match& match) const
- {
- if (m_isValid)
- return match.GetMatchCount();
- return 0;
- }
-
- bool
- IsValid() const
- {
- return m_isValid;
- }
-
- // Match the input against the regular expression. Return an error
- // if the number of matches is less than minMatches. If the default
- // minMatches value of 0 is passed, an error will be returned if
- // the number of matches is less than the maxMatches value used to
- // initialize Match.
- bool
- Execute(const char *input, Match& match, size_t minMatches = 0);
-
- private:
- llvm_regex_t m_emma;
- const bool m_isValid;
-};
-
-}

View File

@ -0,0 +1,167 @@
From 96868d29541c046cf85ed0423cfee4ebf64b341a Mon Sep 17 00:00:00 2001
From: Pavel Labath <labath@google.com>
Date: Mon, 5 Sep 2016 15:15:12 +0000
Subject: [PATCH] Replace uses of MIUtilParse::CRegexParser with llvm::Regex
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Summary:
Replace uses of the local MIUtilParse::CRegexParser class with the LLVM support class llvm::Regex. This reduces duplication of code, and makes it possible to remove the MIUtilParse::CRegexParser class that requires LLVM internal implementation headers.
Bug: https://llvm.org/bugs/show_bug.cgi?id=29138
Reviewers: dawn, abidh, ki.stfu
Subscribers: labath, ki.stfu, lldb-commits
Differential Revision: https://reviews.llvm.org/D23882
Author: Michał Górny <mgorny@gentoo.org>
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@280662 91177308-0d34-0410-b5e6-96231b3b80d8
---
tools/lldb-mi/MICmdCmdData.cpp | 28 +++++++++++++++-------------
tools/lldb-mi/MICmdCmdSymbol.cpp | 38 ++++++++++++++++++++------------------
2 files changed, 35 insertions(+), 31 deletions(-)
diff --git a/tools/lldb-mi/MICmdCmdData.cpp b/tools/lldb-mi/MICmdCmdData.cpp
index a46fb55..7f4c2e8 100644
--- a/tools/lldb-mi/MICmdCmdData.cpp
+++ b/tools/lldb-mi/MICmdCmdData.cpp
@@ -25,6 +25,9 @@
#include "lldb/API/SBInstruction.h"
#include "lldb/API/SBInstructionList.h"
#include "lldb/API/SBStream.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Regex.h"
// In-house headers:
#include "MICmdCmdData.h"
@@ -42,7 +45,6 @@
#include "MICmdArgValConsume.h"
#include "MICmnLLDBDebugSessionInfoVarObj.h"
#include "MICmnLLDBUtilSBValue.h"
-#include "MIUtilParse.h"
//++ ------------------------------------------------------------------------------------
// Details: CMICmdCmdDataEvaluateExpression constructor.
@@ -1651,24 +1653,24 @@ ParseLLDBLineEntry(const char *input, CMIUtilString &start, CMIUtilString &end,
// is remains is assumed to be the filename.
// Match LineEntry using regex.
- static MIUtilParse::CRegexParser g_lineentry_nocol_regex(
- "^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$");
- static MIUtilParse::CRegexParser g_lineentry_col_regex(
- "^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$");
- // ^1=start ^2=end ^3=f ^4=line ^5=:col(opt)
+ static llvm::Regex g_lineentry_nocol_regex(
+ llvm::StringRef("^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"));
+ static llvm::Regex g_lineentry_col_regex(
+ llvm::StringRef("^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$"));
+ // ^1=start ^2=end ^3=f ^4=line ^5=:col(opt)
- MIUtilParse::CRegexParser::Match match(6);
+ llvm::SmallVector<llvm::StringRef, 6> match;
// First try matching the LineEntry with the column,
// then try without the column.
- const bool ok = g_lineentry_col_regex.Execute(input, match) ||
- g_lineentry_nocol_regex.Execute(input, match);
+ const bool ok = g_lineentry_col_regex.match(input, &match) ||
+ g_lineentry_nocol_regex.match(input, &match);
if (ok)
{
- start = match.GetMatchAtIndex(1);
- end = match.GetMatchAtIndex(2);
- file = match.GetMatchAtIndex(3);
- line = match.GetMatchAtIndex(4);
+ start = match[1];
+ end = match[2];
+ file = match[3];
+ line = match[4];
}
return ok;
}
diff --git a/tools/lldb-mi/MICmdCmdSymbol.cpp b/tools/lldb-mi/MICmdCmdSymbol.cpp
index abaa392..b2519af 100644
--- a/tools/lldb-mi/MICmdCmdSymbol.cpp
+++ b/tools/lldb-mi/MICmdCmdSymbol.cpp
@@ -11,6 +11,9 @@
// Third Party Headers:
#include "lldb/API/SBCommandInterpreter.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Regex.h"
// In-house headers:
#include "MICmdArgValFile.h"
@@ -19,7 +22,6 @@
#include "MICmnMIResultRecord.h"
#include "MICmnMIValueList.h"
#include "MICmnMIValueTuple.h"
-#include "MIUtilParse.h"
//++ ------------------------------------------------------------------------------------
// Details: CMICmdCmdSymbolListLines constructor.
@@ -105,15 +107,15 @@ static bool
ParseLLDBLineAddressHeader(const char *input, CMIUtilString &file)
{
// Match LineEntry using regex.
- static MIUtilParse::CRegexParser g_lineentry_header_regex(
- "^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$");
- // ^1=file ^2=cu ^3=module
+ static llvm::Regex g_lineentry_header_regex(
+ llvm::StringRef("^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$"));
+ // ^1=file ^2=cu ^3=module
- MIUtilParse::CRegexParser::Match match(4);
+ llvm::SmallVector<llvm::StringRef, 4> match;
- const bool ok = g_lineentry_header_regex.Execute(input, match);
+ const bool ok = g_lineentry_header_regex.match(input, &match);
if (ok)
- file = match.GetMatchAtIndex(1);
+ file = match[1];
return ok;
}
@@ -141,23 +143,23 @@ ParseLLDBLineAddressEntry(const char *input, CMIUtilString &addr,
// is remains is assumed to be the filename.
// Match LineEntry using regex.
- static MIUtilParse::CRegexParser g_lineentry_nocol_regex(
- "^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$");
- static MIUtilParse::CRegexParser g_lineentry_col_regex(
- "^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$");
- // ^1=start ^2=end ^3=f ^4=line ^5=:col(opt)
+ static llvm::Regex g_lineentry_nocol_regex(
+ llvm::StringRef("^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"));
+ static llvm::Regex g_lineentry_col_regex(
+ llvm::StringRef("^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$"));
+ // ^1=start ^2=end ^3=f ^4=line ^5=:col(opt)
- MIUtilParse::CRegexParser::Match match(6);
+ llvm::SmallVector<llvm::StringRef, 6> match;
// First try matching the LineEntry with the column,
// then try without the column.
- const bool ok = g_lineentry_col_regex.Execute(input, match) ||
- g_lineentry_nocol_regex.Execute(input, match);
+ const bool ok = g_lineentry_col_regex.match(input, &match) ||
+ g_lineentry_nocol_regex.match(input, &match);
if (ok)
{
- addr = match.GetMatchAtIndex(1);
- file = match.GetMatchAtIndex(3);
- line = match.GetMatchAtIndex(4);
+ addr = match[1];
+ file = match[3];
+ line = match[4];
}
return ok;
}
--
2.5.5

View File

@ -1,25 +1,29 @@
Name: lldb
Version: 3.8.0
Release: 2%{?dist}
Version: 3.9.1
Release: 1%{?dist}.2
Summary: Next generation high-performance debugger
License: NCSA
URL: http://llvm.org
Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.xz
# hack patch from upstream review systems to fix out of tree builds.
Patch0: D15067.id41365.diff
# Patch to remove use of private llvm headers
Patch1: 0001-Replace-uses-of-MIUtilParse-CRegexParser-with-llvm-R.patch
Patch2: 0001-Remove-MIUtilParse-no-longer-used.patch
BuildRequires: cmake
BuildRequires: llvm-devel = %{version}
BuildRequires: clang-devel = %{version}
BuildRequires: libedit-devel
BuildRequires: ncurses-devel
BuildRequires: swig
BuildRequires: llvm-static = %{version}
BuildRequires: libffi-devel
BuildRequires: zlib-devel
BuildRequires: libxml2-devel
Requires: llvm-libs = %{version}
Requires: clang-libs = %{version}
%description
LLDB is a next generation, high-performance debugger. It is built as a set
of reusable components which highly leverage existing libraries in the
@ -44,8 +48,16 @@ The package contains the LLDB Python module.
%prep
%setup -q -n %{name}-%{version}.src
%patch0 -p1 -b .dave
%patch1 -p1
%patch2 -p1
# HACK so that lldb can find its custom readline.so, because we move it
# after install.
sed -i -e "s~import sys~import sys\nsys.path.insert\(1, '%{python_sitearch}/lldb'\)~g" source/Interpreter/embedded_interpreter.py
%build
rm tools/lldb-mi/MIUtilParse.*
mkdir -p _build
cd _build
@ -53,8 +65,8 @@ cd _build
LDFLAGS="%{__global_ldflags} -lpthread -ldl"
CFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security"
CXXFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security"
CFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security -fno-rtti"
CXXFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security -fno-rtti"
%cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
@ -65,8 +77,13 @@ CXXFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security"
-DLLDB_PATH_TO_CLANG_BUILD=%{_prefix} \
\
-DLLDB_DISABLE_CURSES:BOOL=OFF \
-DLLDB_DISABLE_LIBEDIT:BOOL=OFF \
-DLLDB_DISABLE_LIBEDIT:BOOL=ON \
-DLLDB_DISABLE_PYTHON:BOOL=OFF \
%if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \
%else
-DLLVM_LIBDIR_SUFFIX= \
%endif
\
-DPYTHON_EXECUTABLE:STRING=%{__python} \
-DPYTHON_VERSION_MAJOR:STRING=$(%{__python} -c "import sys; print sys.version_info.major") \
@ -104,6 +121,21 @@ rm -f %{buildroot}%{python_sitearch}/six.*
%{python_sitearch}/lldb
%changelog
* Tue Mar 21 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-1.2
- Add explicit Requires for llvm-libs and clang-libs
* Fri Mar 17 2017 Tom Stellard <tstellar@redhat.org> - 3.9.1-1.1
- Adjust python sys.path so lldb can find readline.so
* Thu Mar 02 2017 Dave Airlie <airlied@redhat.com> - 3.9.1-1
- lldb 3.9.1
* Tue Jan 17 2017 Michael Cronenworth <mike@cchtml.com> - 3.8.1-1
- lldb 3.8.1
* Mon Nov 14 2016 Nathaniel McCallum <npmccallum@redhat.com> - 3.8.0-3
- Disable libedit support until upstream fixes it (#1356140)
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.8.0-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

View File

@ -1 +1 @@
a5da35ed9cc8c8817ee854e3dbfba00e lldb-3.8.0.src.tar.xz
SHA512 (lldb-3.9.1.src.tar.xz) = e2957a1da60284595b21c205b07fa3db5c474bfad1935ab8e1bc832f30af497e9eb709efeb703591ef62e7dd73a28d22fc21398097a232c8a729946d72eb5df7