[Lldb-commits] Fix -break-insert not working when using absolute paths

2016-07-27 Thread Marc-Andre Laperle via lldb-commits
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


bug28709.patch
Description: Binary data
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2016-07-27 Thread Marc-Andre Laperle via lldb-commits
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


bug28709.patch
Description: Binary data
___
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-07-28 Thread Marc-Andre Laperle via lldb-commits
malaperle updated this revision to Diff 66055.
malaperle added a comment.

The test actually already existed but now it passed.


https://reviews.llvm.org/D22902

Files:
  packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
  tools/lldb-mi/MICmdArgValString.cpp
  tools/lldb-mi/MICmdArgValString.h
  tools/lldb-mi/MICmdCmdBreak.cpp

Index: tools/lldb-mi/MICmdCmdBreak.cpp
===
--- tools/lldb-mi/MICmdCmdBreak.cpp
+++ tools/lldb-mi/MICmdCmdBreak.cpp
@@ -100,7 +100,7 @@
 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();
 }
 
Index: tools/lldb-mi/MICmdArgValString.h
===
--- tools/lldb-mi/MICmdArgValString.h
+++ tools/lldb-mi/MICmdArgValString.h
@@ -32,6 +32,8 @@
 /* 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;
 
Index: tools/lldb-mi/MICmdArgValString.cpp
===
--- tools/lldb-mi/MICmdArgValString.cpp
+++ tools/lldb-mi/MICmdArgValString.cpp
@@ -85,6 +85,30 @@
 }
 
 //++ 

+// 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.
Index: packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
===
--- packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
@@ -155,7 +155,6 @@
 
 @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."""
 


Index: tools/lldb-mi/MICmdCmdBreak.cpp
===
--- tools/lldb-mi/MICmdCmdBreak.cpp
+++ tools/lldb-mi/MICmdCmdBreak.cpp
@@ -100,7 +100,7 @@
 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 CMI

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

2016-07-28 Thread Marc-Andre Laperle via lldb-commits
malaperle added a comment.

BTW, I had trouble running the lldb-mi tests. There seems to be a bug in 
dotest.py.

  lldbMiExec = lldbtest_config.lldbExec + "-mi"

I used 'python dotest.py --executable /path/to/llvm/build/bin/lldb

This failed for me because lldb is a symlink to lldb-4.0.0 and lldb-4.0.0-mi 
doesn't exist. I'm not sure if there either a way to not make it resolve the 
symlink or if the script should be changed.


https://reviews.llvm.org/D22902



___
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-07-28 Thread Marc-Andre Laperle via lldb-commits
malaperle added a comment.

In https://reviews.llvm.org/D22902#500174, @malaperle wrote:

> This failed for me because lldb is a symlink to lldb-4.0.0 and lldb-4.0.0-mi 
> doesn't exist. I'm not sure if there either a way to not make it resolve the 
> symlink or if the script should be changed.


By fail, I mean that the tests were getting skipped.


https://reviews.llvm.org/D22902



___
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-07-28 Thread Marc-Andre Laperle via lldb-commits
malaperle added a comment.

Thanks! Newcomer silly question: now that the change is accepted, is there any 
action required on my end?


https://reviews.llvm.org/D22902



___
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] r345563 - [lldb-mi] Implement -gdb-set breakpoint pending on/off

2019-10-04 Thread Marc-Andre Laperle via lldb-commits
Author: malaperle
Date: Mon Oct 29 20:10:41 2018
New Revision: 345563

URL: http://llvm.org/viewvc/llvm-project?rev=345563&view=rev
Log:
[lldb-mi] Implement -gdb-set breakpoint pending on/off

Summary:
This allows creating pending breakpoint automatically when a location is not 
found.
This is used by some front-ends instead of doing "-break-insert -f" every time.

See also https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html

Signed-off-by: Marc-Andre Laperle 

Subscribers: MaskRay, llvm-commits, lldb-commits, ki.stfu

Tags: #lldb

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

Added:
lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert-enable-pending.test
lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert-pending.c
Modified:
lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.h
lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.cpp
lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.h
lldb/trunk/tools/lldb-mi/MICmnResources.cpp
lldb/trunk/tools/lldb-mi/MICmnResources.h

Added: lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert-enable-pending.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert-enable-pending.test?rev=345563&view=auto
==
--- lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert-enable-pending.test 
(added)
+++ lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert-enable-pending.test 
Mon Oct 29 20:10:41 2018
@@ -0,0 +1,47 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/break-insert-pending.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test for enabling pending breakpoints globally
+
+-break-insert printf
+# CHECK: ^error,msg="Command 'break-insert'. Breakpoint location 'printf' not 
found
+
+-gdb-set breakpoint pending on
+# CHECK: ^done
+-gdb-show breakpoint pending
+# CHECK: ^done,value="on"
+-break-insert printf
+# CHECK: 
^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x",func="??",file="??",fullname="??/??",line="0",pending=["printf"],times="0",original-location="printf"}
+
+-exec-run
+# CHECK: ^running
+# CHECK: 
*stopped,reason="breakpoint-hit",disp="del",bkptno="2",frame={level="0",addr="{{0x[0-9a-f]*[^f][0-9a-f]*}}"
+-break-disable 2
+# CHECK: ^done
+-exec-continue
+# CHECK: ^running
+# CHECK: *stopped,reason="exited-normally"
+
+# Test that it can be turned back off
+-gdb-show breakpoint pending
+# CHECK: ^done,value="on"
+-gdb-set breakpoint pending off
+# CHECK: ^done
+-gdb-show breakpoint pending
+# CHECK: ^done,value="off"
+-break-insert printf-non-existent
+# CHECK: ^error,msg="Command 'break-insert'. Breakpoint location 
'printf-non-existent' not found"
+# Check that enable/disable with 1 and 0 works
+-gdb-set breakpoint pending 1
+# CHECK: ^done
+-gdb-show breakpoint pending
+# CHECK: ^done,value="on"
+-gdb-set breakpoint pending 0
+# CHECK: ^done
+-gdb-show breakpoint pending
+# CHECK: ^done,value="off"
+-gdb-set breakpoint pending garbage
+# CHECK: ^done

Added: lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert-pending.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert-pending.c?rev=345563&view=auto
==
--- lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert-pending.c 
(added)
+++ lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert-pending.c Mon 
Oct 29 20:10:41 2018
@@ -0,0 +1,6 @@
+#include 
+
+int main(int argc, char const *argv[]) {
+printf("Print a formatted string so that GCC does not optimize this printf 
call: %s\n", argv[0]);
+return 0;
+}

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp?rev=345563&r1=345562&r2=345563&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp Mon Oct 29 20:10:41 2018
@@ -165,8 +165,15 @@ bool CMICmdCmdBreakInsert::Execute() {
 
   if (sbTarget == rSessionInfo.GetDebugger().GetDummyTarget())
 m_bBrkPtIsPending = true;
-  else
+  else {
 m_bBrkPtIsPending = pArgPendingBrkPt->GetFound();
+if (!m_bBrkPtIsPending) {
+  CMIUtilString pending;
+  if (m_rLLDBDebugSessionInfo.SharedDataRetrieve("breakpoint.pending", 
pending)) {
+m_bBrkPtIsPending = pending == "on";
+  }
+}
+  }
 
   if (pArgLocation->GetFound())
 m_brkName = pArgLocation->GetValue();

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.cpp?rev=345563&r1=345562&r2=345563&view=diff
==
--- lldb/t