[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-18 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle added a comment.

Gentle ping?


Repository:
  rL LLVM

https://reviews.llvm.org/D52953



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


[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-18 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle added a comment.

In https://reviews.llvm.org/D52953#1268810, @MaskRay wrote:

> And there is no reviewers set :)


I don't know who to add.


Repository:
  rL LLVM

https://reviews.llvm.org/D52953



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


[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-19 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle updated this revision to Diff 170301.
malaperle added a comment.

Clang-format it


https://reviews.llvm.org/D52953

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

Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -264,11 +264,14 @@
   IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND,
   IDS_CMD_ERR_INFO_PRINTFN_FAILED,
   IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
+  IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
   IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_EXPR_INVALID,
   IDS_CMD_ERR_ATTACH_FAILED,
   IDS_CMD_ERR_ATTACH_BAD_ARGS
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -439,6 +439,8 @@
 {IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
 {IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
  "'target-async' expects \"on\" or \"off\""},
+{IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
+ "'breakpoint' expects \"pending on\" or \"pending off\""},
 {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
  "'solib-search-path' requires at least one argument"},
 {IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
@@ -449,6 +451,10 @@
  "'print' expects option-name and \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
  "'print' error. The option '%s' not found"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+"'breakpoint' expects option-name"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
+"'breakpoint' error. The option '%s' not found"},
 {IDS_CMD_ERR_EXPR_INVALID, "Failed to evaluate expression: %s"},
 {IDS_CMD_ERR_ATTACH_FAILED,
  "Command '%s'. Attach to process failed: %s"},
Index: tools/lldb-mi/MICmdCmdGdbShow.h
===
--- tools/lldb-mi/MICmdCmdGdbShow.h
+++ tools/lldb-mi/MICmdCmdGdbShow.h
@@ -80,6 +80,7 @@
   bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnBreakpoint(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:
 private:
Index: tools/lldb-mi/MICmdCmdGdbShow.cpp
===
--- tools/lldb-mi/MICmdCmdGdbShow.cpp
+++ tools/lldb-mi/MICmdCmdGdbShow.cpp
@@ -32,7 +32,8 @@
 {"print", &CMICmdCmdGdbShow::OptionFnPrint},
 {"language", &CMICmdCmdGdbShow::OptionFnLanguage},
 {"disassembly-flavor", &CMICmdCmdGdbShow::OptionFnDisassemblyFlavor},
-{"fallback", &CMICmdCmdGdbShow::OptionFnFallback}};
+{"fallback", &CMICmdCmdGdbShow::OptionFnFallback},
+{"breakpoint", &CMICmdCmdGdbShow::OptionFnBreakpoint}};
 
 //++
 //
@@ -347,6 +348,40 @@
   return MIstatus::success;
 }
 
+//++
+//
+// Details: Carry out work to complete the GDB show option 'breakpoint' to prepare
+//  and send back the requested information.
+// Type:Method.
+// Args:vrWords - (R) List of additional parameters used by this option.
+// Return:  MIstatus::success - Function succeeded.
+//  MIstatus::failure - Function failed.
+// Throws:  None.
+//--
+bool CMICmdCmdGdbShow::OptionFnBreakpoint(const CMIUtilString::VecString_t &vrWords) {
+if (vrWords.size() != 1) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS);
+return MIstatus::failure;
+}
+
+const CMIUtilString strOption(vrWords[0]);
+if (CMIUtilString::Compare(strOption, "pending")) {
+if (!m_rLLDBDebugSessionInfo.SharedDataRetrieve("breakpoint.pending", m_strValue)) {
+if (m_strValue.empty())
+m_strValue = "off";
+}
+} else {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = CMIUtilString::Format(
+  MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION),
+ 

[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-26 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle updated this revision to Diff 171388.
malaperle added a comment.

Convert to lit test, convert some code to an early return, clang-format.


https://reviews.llvm.org/D52953

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

Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -264,11 +264,14 @@
   IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND,
   IDS_CMD_ERR_INFO_PRINTFN_FAILED,
   IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
+  IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
   IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_EXPR_INVALID,
   IDS_CMD_ERR_ATTACH_FAILED,
   IDS_CMD_ERR_ATTACH_BAD_ARGS
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -439,6 +439,8 @@
 {IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
 {IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
  "'target-async' expects \"on\" or \"off\""},
+{IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
+ "'breakpoint' expects \"pending on\" or \"pending off\""},
 {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
  "'solib-search-path' requires at least one argument"},
 {IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
@@ -449,6 +451,10 @@
  "'print' expects option-name and \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
  "'print' error. The option '%s' not found"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+"'breakpoint' expects option-name"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
+"'breakpoint' error. The option '%s' not found"},
 {IDS_CMD_ERR_EXPR_INVALID, "Failed to evaluate expression: %s"},
 {IDS_CMD_ERR_ATTACH_FAILED,
  "Command '%s'. Attach to process failed: %s"},
Index: tools/lldb-mi/MICmdCmdGdbShow.h
===
--- tools/lldb-mi/MICmdCmdGdbShow.h
+++ tools/lldb-mi/MICmdCmdGdbShow.h
@@ -80,6 +80,7 @@
   bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnBreakpoint(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:
 private:
Index: tools/lldb-mi/MICmdCmdGdbShow.cpp
===
--- tools/lldb-mi/MICmdCmdGdbShow.cpp
+++ tools/lldb-mi/MICmdCmdGdbShow.cpp
@@ -32,7 +32,8 @@
 {"print", &CMICmdCmdGdbShow::OptionFnPrint},
 {"language", &CMICmdCmdGdbShow::OptionFnLanguage},
 {"disassembly-flavor", &CMICmdCmdGdbShow::OptionFnDisassemblyFlavor},
-{"fallback", &CMICmdCmdGdbShow::OptionFnFallback}};
+{"fallback", &CMICmdCmdGdbShow::OptionFnFallback},
+{"breakpoint", &CMICmdCmdGdbShow::OptionFnBreakpoint}};
 
 //++
 //
@@ -347,6 +348,43 @@
   return MIstatus::success;
 }
 
+//++
+//
+// Details: Carry out work to complete the GDB show option 'breakpoint' to
+// prepare
+//  and send back the requested information.
+// Type:Method.
+// Args:vrWords - (R) List of additional parameters used by this option.
+// Return:  MIstatus::success - Function succeeded.
+//  MIstatus::failure - Function failed.
+// Throws:  None.
+//--
+bool CMICmdCmdGdbShow::OptionFnBreakpoint(
+const CMIUtilString::VecString_t &vrWords) {
+  if (vrWords.size() != 1) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS);
+return MIstatus::failure;
+  }
+
+  const CMIUtilString strOption(vrWords[0]);
+  if (!CMIUtilString::Compare(strOption, "pending")) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = CMIUtilString::Format(
+MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION),
+strOption.c_str());
+return MIstatus::failure;
+  }
+
+  if (!m_rLLDBDebugSessionInfo.SharedDataRetrieve("breakpoint.pending",
+

[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-27 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle updated this revision to Diff 171415.
malaperle added a comment.

Fixes to lit test


https://reviews.llvm.org/D52953

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

Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -264,11 +264,14 @@
   IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND,
   IDS_CMD_ERR_INFO_PRINTFN_FAILED,
   IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
+  IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
   IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_EXPR_INVALID,
   IDS_CMD_ERR_ATTACH_FAILED,
   IDS_CMD_ERR_ATTACH_BAD_ARGS
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -439,6 +439,8 @@
 {IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
 {IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
  "'target-async' expects \"on\" or \"off\""},
+{IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
+ "'breakpoint' expects \"pending on\" or \"pending off\""},
 {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
  "'solib-search-path' requires at least one argument"},
 {IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
@@ -449,6 +451,10 @@
  "'print' expects option-name and \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
  "'print' error. The option '%s' not found"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+"'breakpoint' expects option-name"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
+"'breakpoint' error. The option '%s' not found"},
 {IDS_CMD_ERR_EXPR_INVALID, "Failed to evaluate expression: %s"},
 {IDS_CMD_ERR_ATTACH_FAILED,
  "Command '%s'. Attach to process failed: %s"},
Index: tools/lldb-mi/MICmdCmdGdbShow.h
===
--- tools/lldb-mi/MICmdCmdGdbShow.h
+++ tools/lldb-mi/MICmdCmdGdbShow.h
@@ -80,6 +80,7 @@
   bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnBreakpoint(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:
 private:
Index: tools/lldb-mi/MICmdCmdGdbShow.cpp
===
--- tools/lldb-mi/MICmdCmdGdbShow.cpp
+++ tools/lldb-mi/MICmdCmdGdbShow.cpp
@@ -32,7 +32,8 @@
 {"print", &CMICmdCmdGdbShow::OptionFnPrint},
 {"language", &CMICmdCmdGdbShow::OptionFnLanguage},
 {"disassembly-flavor", &CMICmdCmdGdbShow::OptionFnDisassemblyFlavor},
-{"fallback", &CMICmdCmdGdbShow::OptionFnFallback}};
+{"fallback", &CMICmdCmdGdbShow::OptionFnFallback},
+{"breakpoint", &CMICmdCmdGdbShow::OptionFnBreakpoint}};
 
 //++
 //
@@ -347,6 +348,43 @@
   return MIstatus::success;
 }
 
+//++
+//
+// Details: Carry out work to complete the GDB show option 'breakpoint' to
+// prepare
+//  and send back the requested information.
+// Type:Method.
+// Args:vrWords - (R) List of additional parameters used by this option.
+// Return:  MIstatus::success - Function succeeded.
+//  MIstatus::failure - Function failed.
+// Throws:  None.
+//--
+bool CMICmdCmdGdbShow::OptionFnBreakpoint(
+const CMIUtilString::VecString_t &vrWords) {
+  if (vrWords.size() != 1) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS);
+return MIstatus::failure;
+  }
+
+  const CMIUtilString strOption(vrWords[0]);
+  if (!CMIUtilString::Compare(strOption, "pending")) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = CMIUtilString::Format(
+MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION),
+strOption.c_str());
+return MIstatus::failure;
+  }
+
+  if (!m_rLLDBDebugSessionInfo.SharedDataRetrieve("breakpoint.pending",
+  m_strValue)) {
+if (m_strValue.empty())
+  m_

[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-27 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle marked an inline comment as done.
malaperle added inline comments.



Comment at: lit/tools/lldb-mi/breakpoint/break-insert-enable-pending.test:4
+#
+# RUN: %cc -o b.exe %p/inputs/break-insert-pending.c -g
+# RUN: %lldbmi < %s | FileCheck %s

apolyakov wrote:
> As far as your first command is `file-exec-and-symbols`, the best way is to 
> use a generic executable's name. Here it should be:
> ```
> # RUN: %cc -o %t %p/inputs/break-insert-pending.c -g
> # RUN: %lldbmi %t < %s | FileCheck %s
> ```
How can I use %t for the second file-exec-and-symbols? It doesn't seem to work


https://reviews.llvm.org/D52953



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


[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-28 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle added a comment.

In https://reviews.llvm.org/D52953#1278331, @apolyakov wrote:

> I ran the test and got a fail:


Can you paste the full input of the failure? You can add 
"--dump-input-on-failure" arg to FileCheck in the test. The test passes for me 
but it might be that a regex needs to be tweaked depending on the environment.


https://reviews.llvm.org/D52953



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


[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-28 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle added inline comments.



Comment at: lit/tools/lldb-mi/breakpoint/break-insert-enable-pending.test:4
+#
+# RUN: %cc -o b.exe %p/inputs/break-insert-pending.c -g
+# RUN: %lldbmi < %s | FileCheck %s

apolyakov wrote:
> malaperle wrote:
> > apolyakov wrote:
> > > As far as your first command is `file-exec-and-symbols`, the best way is 
> > > to use a generic executable's name. Here it should be:
> > > ```
> > > # RUN: %cc -o %t %p/inputs/break-insert-pending.c -g
> > > # RUN: %lldbmi %t < %s | FileCheck %s
> > > ```
> > How can I use %t for the second file-exec-and-symbols? It doesn't seem to 
> > work
> Should you use `file-exec-and-symbols` two times? AFAIK, after exiting a 
> program, your target remains the same, so you don't need to load it again.
I did that so that printf would not be resolved in order to test that it 
behaves properly after turning off pending breakpoints. But I can -break-insert 
printf on a different, non-existent symbol and it should be OK I think.


https://reviews.llvm.org/D52953



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


[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-28 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle updated this revision to Diff 171436.
malaperle added a comment.

Remove need for second -file-exec-and-symbols


https://reviews.llvm.org/D52953

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

Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -264,11 +264,14 @@
   IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND,
   IDS_CMD_ERR_INFO_PRINTFN_FAILED,
   IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
+  IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
   IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_EXPR_INVALID,
   IDS_CMD_ERR_ATTACH_FAILED,
   IDS_CMD_ERR_ATTACH_BAD_ARGS
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -439,6 +439,8 @@
 {IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
 {IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
  "'target-async' expects \"on\" or \"off\""},
+{IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
+ "'breakpoint' expects \"pending on\" or \"pending off\""},
 {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
  "'solib-search-path' requires at least one argument"},
 {IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
@@ -449,6 +451,10 @@
  "'print' expects option-name and \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
  "'print' error. The option '%s' not found"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+"'breakpoint' expects option-name"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
+"'breakpoint' error. The option '%s' not found"},
 {IDS_CMD_ERR_EXPR_INVALID, "Failed to evaluate expression: %s"},
 {IDS_CMD_ERR_ATTACH_FAILED,
  "Command '%s'. Attach to process failed: %s"},
Index: tools/lldb-mi/MICmdCmdGdbShow.h
===
--- tools/lldb-mi/MICmdCmdGdbShow.h
+++ tools/lldb-mi/MICmdCmdGdbShow.h
@@ -80,6 +80,7 @@
   bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnBreakpoint(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:
 private:
Index: tools/lldb-mi/MICmdCmdGdbShow.cpp
===
--- tools/lldb-mi/MICmdCmdGdbShow.cpp
+++ tools/lldb-mi/MICmdCmdGdbShow.cpp
@@ -32,7 +32,8 @@
 {"print", &CMICmdCmdGdbShow::OptionFnPrint},
 {"language", &CMICmdCmdGdbShow::OptionFnLanguage},
 {"disassembly-flavor", &CMICmdCmdGdbShow::OptionFnDisassemblyFlavor},
-{"fallback", &CMICmdCmdGdbShow::OptionFnFallback}};
+{"fallback", &CMICmdCmdGdbShow::OptionFnFallback},
+{"breakpoint", &CMICmdCmdGdbShow::OptionFnBreakpoint}};
 
 //++
 //
@@ -347,6 +348,43 @@
   return MIstatus::success;
 }
 
+//++
+//
+// Details: Carry out work to complete the GDB show option 'breakpoint' to
+// prepare
+//  and send back the requested information.
+// Type:Method.
+// Args:vrWords - (R) List of additional parameters used by this option.
+// Return:  MIstatus::success - Function succeeded.
+//  MIstatus::failure - Function failed.
+// Throws:  None.
+//--
+bool CMICmdCmdGdbShow::OptionFnBreakpoint(
+const CMIUtilString::VecString_t &vrWords) {
+  if (vrWords.size() != 1) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS);
+return MIstatus::failure;
+  }
+
+  const CMIUtilString strOption(vrWords[0]);
+  if (!CMIUtilString::Compare(strOption, "pending")) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = CMIUtilString::Format(
+MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION),
+strOption.c_str());
+return MIstatus::failure;
+  }
+
+  if (!m_rLLDBDebugSessionInfo.SharedDataRetrieve("breakpoint.pending",
+  m_strValue)) {
+if (m

[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-28 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle updated this revision to Diff 171451.
malaperle added a comment.

Simply checks

I think those =breakpoint-modified checks are a bit overzealous. The important
check is whether of not we hit the breakpoint in a resolved location,
i.e. not 0x. So, at the *stopped. The presence and timing of

breakpoint-modified is orthogonal to this patch.



https://reviews.llvm.org/D52953

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

Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -264,11 +264,14 @@
   IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND,
   IDS_CMD_ERR_INFO_PRINTFN_FAILED,
   IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
+  IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
   IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSET_OPT_PRINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_BAD_ARGS,
   IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+  IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
   IDS_CMD_ERR_EXPR_INVALID,
   IDS_CMD_ERR_ATTACH_FAILED,
   IDS_CMD_ERR_ATTACH_BAD_ARGS
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -439,6 +439,8 @@
 {IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
 {IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
  "'target-async' expects \"on\" or \"off\""},
+{IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
+ "'breakpoint' expects \"pending on\" or \"pending off\""},
 {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
  "'solib-search-path' requires at least one argument"},
 {IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
@@ -449,6 +451,10 @@
  "'print' expects option-name and \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
  "'print' error. The option '%s' not found"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+"'breakpoint' expects option-name"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
+"'breakpoint' error. The option '%s' not found"},
 {IDS_CMD_ERR_EXPR_INVALID, "Failed to evaluate expression: %s"},
 {IDS_CMD_ERR_ATTACH_FAILED,
  "Command '%s'. Attach to process failed: %s"},
Index: tools/lldb-mi/MICmdCmdGdbShow.h
===
--- tools/lldb-mi/MICmdCmdGdbShow.h
+++ tools/lldb-mi/MICmdCmdGdbShow.h
@@ -80,6 +80,7 @@
   bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnBreakpoint(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:
 private:
Index: tools/lldb-mi/MICmdCmdGdbShow.cpp
===
--- tools/lldb-mi/MICmdCmdGdbShow.cpp
+++ tools/lldb-mi/MICmdCmdGdbShow.cpp
@@ -32,7 +32,8 @@
 {"print", &CMICmdCmdGdbShow::OptionFnPrint},
 {"language", &CMICmdCmdGdbShow::OptionFnLanguage},
 {"disassembly-flavor", &CMICmdCmdGdbShow::OptionFnDisassemblyFlavor},
-{"fallback", &CMICmdCmdGdbShow::OptionFnFallback}};
+{"fallback", &CMICmdCmdGdbShow::OptionFnFallback},
+{"breakpoint", &CMICmdCmdGdbShow::OptionFnBreakpoint}};
 
 //++
 //
@@ -347,6 +348,43 @@
   return MIstatus::success;
 }
 
+//++
+//
+// Details: Carry out work to complete the GDB show option 'breakpoint' to
+// prepare
+//  and send back the requested information.
+// Type:Method.
+// Args:vrWords - (R) List of additional parameters used by this option.
+// Return:  MIstatus::success - Function succeeded.
+//  MIstatus::failure - Function failed.
+// Throws:  None.
+//--
+bool CMICmdCmdGdbShow::OptionFnBreakpoint(
+const CMIUtilString::VecString_t &vrWords) {
+  if (vrWords.size() != 1) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS);
+return MIstatus::failure;
+  }
+
+  const CMIUtilString strOption(vrWords[0]);
+  if (!CMIUtilString::Compare(strOption, "pending")) {
+m_bGbbOptionFnHasError = true;
+m_strGdbOptionFnError = CMIUtilString::Format

[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-28 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle added a comment.

In https://reviews.llvm.org/D52953#1278491, @malaperle wrote:

> Simply checks


*Simplify


https://reviews.llvm.org/D52953



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


[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-29 Thread Marc-Andre Laperle via Phabricator via lldb-commits
malaperle added a comment.

In https://reviews.llvm.org/D52953#1278523, @apolyakov wrote:

> LGTM.


Thanks a lot!


https://reviews.llvm.org/D52953



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


[Lldb-commits] [PATCH] D52953: [lldb-mi] Implement -gdb-set breakpoint pending on/off

2018-10-29 Thread Marc-Andre Laperle via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL345563: [lldb-mi] Implement -gdb-set breakpoint pending 
on/off (authored by malaperle, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52953?vs=171451&id=171629#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52953

Files:
  lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert-enable-pending.test
  lldb/trunk/lit/tools/lldb-mi/breakpoint/inputs/break-insert-pending.c
  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

Index: lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.h
===
--- lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.h
+++ lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.h
@@ -80,6 +80,7 @@
   bool OptionFnSolibSearchPath(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnOutputRadix(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnBreakpoint(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:
Index: lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.h
===
--- lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.h
+++ lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.h
@@ -80,6 +80,7 @@
   bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
   bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
+  bool OptionFnBreakpoint(const CMIUtilString::VecString_t &vrWords);
 
   // Attributes:
 private:
Index: lldb/trunk/tools/lldb-mi/MICmnResources.cpp
===
--- lldb/trunk/tools/lldb-mi/MICmnResources.cpp
+++ lldb/trunk/tools/lldb-mi/MICmnResources.cpp
@@ -439,6 +439,8 @@
 {IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
 {IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
  "'target-async' expects \"on\" or \"off\""},
+{IDS_CMD_ERR_GDBSET_OPT_BREAKPOINT,
+ "'breakpoint' expects \"pending on\" or \"pending off\""},
 {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
  "'solib-search-path' requires at least one argument"},
 {IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
@@ -449,6 +451,10 @@
  "'print' expects option-name and \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
  "'print' error. The option '%s' not found"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_BAD_ARGS,
+"'breakpoint' expects option-name"},
+{IDS_CMD_ERR_GDBSHOW_OPT_BREAKPOINT_UNKNOWN_OPTION,
+"'breakpoint' error. The option '%s' not found"},
 {IDS_CMD_ERR_EXPR_INVALID, "Failed to evaluate expression: %s"},
 {IDS_CMD_ERR_ATTACH_FAILED,
  "Command '%s'. Attach to process failed: %s"},
Index: lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
===
--- lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
@@ -165,8 +165,15 @@
 
   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();
Index: lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.cpp
===
--- lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.cpp
@@ -32,7 +32,8 @@
 {"print", &CMICmdCmdGdbShow::OptionFnPrint},
 {"language", &CMICmdCmdGdbShow::OptionFnLanguage},
 {"disassembly-flavor", &CMICmdCmdGdbShow::OptionFnDisassemblyFlavor},
-{"fallback", &CMICmdCmdGdbShow::OptionFnFallback}};
+{"fallback", &CMICmdCmdGdbShow::OptionFnFallback},
+{"breakpoint", &CMICmdCmdGdbShow::OptionFnBreakpoint}};
 
 //++
 //
@@ -349,6 +350,43 @@
 
 //++
 //
+// Details: Carry out work to complete the GDB show option 'breakpoint' to
+// prepare
+//  and send back the requested information.
+// Type:Method.
+// Args:vrWords - (R) List of additional parameters used by this