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

Ilia K via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 28 23:01:20 PDT 2016


Author: ki.stfu
Date: Fri Jul 29 01:01:20 2016
New Revision: 277117

URL: http://llvm.org/viewvc/llvm-project?rev=277117&view=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 malaperle at 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&r1=277116&r2=277117&view=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&r1=277116&r2=277117&view=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 &vrArgName, 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&r1=277116&r2=277117&view=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 &vrArgName, const bool vbMandatory, const bool vbHandleByCmd,
                                   const bool vbHandleQuotes = false, const bool vbAcceptNumbers = false);
+    /* ctor */ CMICmdArgValString(const CMIUtilString &vrArgName, const bool vbMandatory, const bool vbHandleByCmd,
+                                  const bool vbHandleQuotes, const bool vbAcceptNumbers, const bool vbHandleDirPaths);
     //
     bool IsStringArg(const CMIUtilString &vrTxt) const;
 

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp?rev=277117&r1=277116&r2=277117&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp Fri Jul 29 01:01:20 2016
@@ -100,7 +100,7 @@ CMICmdCmdBreakInsert::ParseArgs()
         new CMICmdArgValOptionShort(m_constStrArgNamedInoreCnt, false, true, CMICmdArgValListBase::eArgValType_Number, 1));
     m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedRestrictBrkPtToThreadId, false, true,
                                                    CMICmdArgValListBase::eArgValType_Number, 1));
-    m_setCmdArgs.Add(new CMICmdArgValString(m_constStrArgNamedLocation, false, true));
+    m_setCmdArgs.Add(new CMICmdArgValString(m_constStrArgNamedLocation, false, true, false, false, true));
     return ParseValidateCmdOptions();
 }
 




More information about the lldb-commits mailing list