[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-18 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 151773. apolyakov edited the summary of this revision. apolyakov added a comment. I removed comments about optional arguments since I didn't find any info about it in LLVM coding style. https://reviews.llvm.org/D47991 Files: include/lldb/API/SBThread.h

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-18 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg, labath. Herald added a subscriber: ki.stfu. The new method takes one parameter of type SBError and, if it has an error, sets error message and returns MIstatus::failure, returns MIstatus::success otherwise. https://r

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-18 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. This approach is quite simple and can be used in `-exec-...`, `-target-...` and future commands. Also, I've been thinking about another approach with having a method in CMICmdBase that takes two parameters: pointers to a functions in which user could specify needed

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-18 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: tools/lldb-mi/MICmdBase.cpp:221 +// Args:error - (R) Error description object. +// Return: None. +// Throws: None. aprantl wrote: > It returns a bool, right? > > At some point it sure would be nice if we could c

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-18 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. I got an idea how to deal with different number of parameters: what if we suggest to user to create own lambda functions(where he can specify needed actions) without parameters, but with capturing required variables by reference or by value? `auto f = [&x1, &x2...]{do

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-18 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Sure. For example we may look at `bool CMICmdCmdExecContinue::Execute()`, there we may see following code: if (error.Success()) { // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM if (!CMIDriver::Instance().SetDriverStateRunningDebugging

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-18 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. SuccessHandler and ErrorHandler will be a member variables of CMICmdBase. https://reviews.llvm.org/D48295 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commit

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-19 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 151906. apolyakov added a comment. Attached another realization of `CMICmdBase::ReturnMIStatus`. It uses lambda functions to get user defined actions. It works, but, as you may see, I had to define `auto error_handler = ...` in `Execute` function since in

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-19 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. In https://reviews.llvm.org/D48295#1136663, @aprantl wrote: > In this design the success_handlers return an exit status *and* set a string > error. We could unify this by having the handler return an llvm::Error > (https://llvm.org/doxygen/classllvm_1_1Error.html). Wh

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-19 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Sorry, but I still don't understand you. In my thoughts, user specify actions for success and/or error cases. Success case means that out SBError objects' status is success(`sb_error.Success() == true`). Error case means similar except SBError object has fail status.

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-19 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. > bool handleSBError(SBError error, std::function > convert) { > if (error.Success()) > return false; > > SetError(convert(error)); > return error_handler(); > } > > ... > bool CMICmdCmdExecContinue::Execute() { > if > (handleSBError

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-20 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 152069. apolyakov added a comment. Changed method's name from `ReturnMIStatus` to `HandleSBError`. Also added one more use case(see -exec-step's Execute function). The only thing that worries me is that if we want to specify handler for error case, we sho

[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-20 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Just reminder that it still needs a review. Thanks in advance. https://reviews.llvm.org/D47991 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-20 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. I think we just can make old versions of API methods returning SBError in all cases. This way we'll deal with SBError and won't break down API calls. For example: // old void StepOver() { ... } // new SBError StepOver() { ... return sb_error;

[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-20 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. If some client uses `StepOver` like `sbThread.StepOver()`, then making `StepOver` return SBError won't break anything since in this case returned SBError value will just be ignored. Am I missing something? https://reviews.llvm.org/D47991 __

[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-20 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. In https://reviews.llvm.org/D47991#1138071, @jingham wrote: > The client won't be expecting a struct return, and will have generated code > to take a void return. If SBError happens to be returned in registers, > nothing bad will happen, but if it's returned on the s

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-20 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. With such overloads we'll get compile time error. If we have overload: bool HandleSBError(SBError error, std::function successHandler = [] {some func}, std::function errorHandler = [] {some func}); bool HandleSBError(SBError error, std::function errorHandler); and

[Lldb-commits] [PATCH] D48295: [WIP] Implement new ReturnMIStatus method of CMICmdBase class.

2018-06-20 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. By the way, I do not see a solution better than current patch, but, at the same time, I do not like current patch. Maybe we should discard this idea? https://reviews.llvm.org/D48295 ___ lldb-commits mailing list lldb-comm

[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-20 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL335180: Improve SBThread's stepping API using SBError parameter. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D47991

[Lldb-commits] [PATCH] D48295: [WIP] Implement new methods for handling an error in MI commands.

2018-06-21 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 152310. apolyakov retitled this revision from "[WIP] Implement new ReturnMIStatus method of CMICmdBase class." to "[WIP] Implement new methods for handling an error in MI commands.". apolyakov edited the summary of this revision. apolyakov added a comment.

[Lldb-commits] [PATCH] D48295: Implement new methods for handling an error in MI commands.

2018-06-21 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 152339. apolyakov retitled this revision from "[WIP] Implement new methods for handling an error in MI commands." to "Implement new methods for handling an error in MI commands.". apolyakov added a comment. Removed usage examples. Also I wanted to ask if s

[Lldb-commits] [PATCH] D47992: [lldb-mi] Clean up and update a few MI commands.

2018-06-21 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 152351. apolyakov retitled this revision from "[lldb-mi] Correct error processing in exec-next command." to "[lldb-mi] Clean up and update a few MI commands.". apolyakov edited the summary of this revision. apolyakov added a comment. I didn't committed patc

[Lldb-commits] [PATCH] D47992: [lldb-mi] Clean up and update a few MI commands.

2018-06-21 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. I don't like creating a new class just for one feature. It looks like only 3 commands use that code, so maybe we should let it be at it is? https://reviews.llvm.org/D47992 ___ lldb-commits mailing list lldb-commits@lists.

[Lldb-commits] [PATCH] D47992: [lldb-mi] Clean up and update a few MI commands.

2018-06-22 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Would be really nice to get review of this patch before this weekend. Thanks for your time, folks. https://reviews.llvm.org/D47992 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/ma

[Lldb-commits] [PATCH] D47992: [lldb-mi] Clean up and update a few MI commands.

2018-06-23 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: tools/lldb-mi/MICmdCmdExec.cpp:137 + auto successHandler = [this] { +// CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM +if (!CMIDriver::Instance().SetDriverStateRunningDebugging()) { aprantl

[Lldb-commits] [PATCH] D47992: [lldb-mi] Clean up and update a few MI commands.

2018-06-23 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 152589. apolyakov added a comment. Removed accidentally added comment, added `const` qualifier to lambdas. https://reviews.llvm.org/D47992 Files: tools/lldb-mi/MICmdCmdExec.cpp tools/lldb-mi/MICmdCmdExec.h Index: tools/lldb-mi/MICmdCmdExec.h

[Lldb-commits] [PATCH] D48520: [lldb-mi] Re-implement a few MI commands.

2018-06-23 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg. Herald added a subscriber: ki.stfu. This patch updates exec-next-instruction, exec-step-instruction, exec-finish, exec-interrupt commands to use SB API instead of HandleCommand. https://reviews.llvm.org/D48520 Files

[Lldb-commits] [PATCH] D48520: [lldb-mi] Re-implement a few MI commands.

2018-06-23 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. [WIP] Fully test `-exec-interrupt` command. It needs a program being executed at the moment of debugging to stop it. https://reviews.llvm.org/D48520 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.l

[Lldb-commits] [PATCH] D48520: [lldb-mi] Re-implement a few MI commands.

2018-06-24 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. You are right about python tests. Let's remove them. https://reviews.llvm.org/D48520 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [PATCH] D47992: [lldb-mi] Clean up and update a few MI commands.

2018-06-25 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 152694. apolyakov added a comment. Removed unnecessary `this->`. https://reviews.llvm.org/D47992 Files: tools/lldb-mi/MICmdCmdExec.cpp tools/lldb-mi/MICmdCmdExec.h Index: tools/lldb-mi/MICmdCmdExec.h ==

[Lldb-commits] [PATCH] D48520: [lldb-mi] Re-implement a few MI commands.

2018-06-25 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 152715. apolyakov added a comment. Removed duplicated and error prone(without --synchronous option) testing. https://reviews.llvm.org/D48520 Files: lit/tools/lldb-mi/exec/exec-finish.test lit/tools/lldb-mi/exec/exec-interrupt.test lit/tools/lldb-mi/

[Lldb-commits] [PATCH] D48520: [lldb-mi] Re-implement a few MI commands.

2018-06-25 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py:228 -# Test that --thread is optional -self.runCmd("-exec-next-instruction --frame 0") -self.expect("\^running") aprantl wrote

[Lldb-commits] [PATCH] D48295: Implement new methods for handling an error in MI commands.

2018-06-25 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL335541: Implement new methods for handling an error in MI commands. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D48

[Lldb-commits] [PATCH] D48775: Add new SBTarget::IsDummy method.

2018-06-29 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg. The new member function allows to check if a target is dummy or real. https://reviews.llvm.org/D48775 Files: include/lldb/API/SBTarget.h scripts/interface/SBTarget.i source/API/SBTarget.cpp Index: source/API/

[Lldb-commits] [PATCH] D48775: Add new SBTarget::IsDummy method.

2018-06-29 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 153516. apolyakov edited the summary of this revision. apolyakov added a comment. Added description to source files and commit message. https://reviews.llvm.org/D48775 Files: include/lldb/API/SBTarget.h scripts/interface/SBTarget.i source/API/SBTarg

[Lldb-commits] [PATCH] D47992: [lldb-mi] Clean up and update a few MI commands.

2018-06-29 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL336009: [lldb-mi] Clean up and update a few MI commands. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D47992?vs=1526

[Lldb-commits] [PATCH] D48801: Add new API to SBTarget and SBModule classes.

2018-06-30 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg. The new API allows to find a list of compile units related to target/module. https://reviews.llvm.org/D48801 Files: include/lldb/API/SBModule.h include/lldb/API/SBTarget.h scripts/interface/SBModule.i scripts

[Lldb-commits] [PATCH] D48802: [lldb-mi] Re-implement symbol-list-lines command.

2018-06-30 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg. Herald added subscribers: eraman, ki.stfu. Now this command uses SB API instead of HandleCommand. https://reviews.llvm.org/D48802 Files: lit/tools/lldb-mi/symbol/inputs/list-lines-helper.c lit/tools/lldb-mi/symbo

[Lldb-commits] [PATCH] D48802: [lldb-mi] Re-implement symbol-list-lines command.

2018-06-30 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: tools/lldb-mi/MICmdCmdSymbol.cpp:24 +namespace { +inline const CMICmnMIValueTuple +CreateMITuplePCLine(const uint32_t addr, const uint32_t line_number) { aprantl wrote: > Please remove the `inline` keyword. LLVM will i

[Lldb-commits] [PATCH] D48520: [lldb-mi] Re-implement a few MI commands.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Update comment. It still needs a review, thanks for your time. https://reviews.llvm.org/D48520 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [PATCH] D48801: Add new API to SBTarget and SBModule classes.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 153817. apolyakov added a comment. Added documentation and tests. https://reviews.llvm.org/D48801 Files: include/lldb/API/SBModule.h include/lldb/API/SBTarget.h packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py pack

[Lldb-commits] [PATCH] D48802: [lldb-mi] Re-implement symbol-list-lines command.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 153818. apolyakov added a comment. Removed `inline` keyword. https://reviews.llvm.org/D48802 Files: lit/tools/lldb-mi/symbol/inputs/list-lines-helper.c lit/tools/lldb-mi/symbol/inputs/list-lines-helper.h lit/tools/lldb-mi/symbol/inputs/main.c lit/

[Lldb-commits] [PATCH] D48801: Add new API to SBTarget and SBModule classes.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py:54 +self.setTearDownCleanup(dictionary=d) +self.find_compile_units('b.out') + aprantl wrote: > shouldn't this be `self.getBuildArtifact(

[Lldb-commits] [PATCH] D48801: Add new API to SBTarget and SBModule classes.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: include/lldb/API/SBModule.h:136 + /// + /// @param[in] sb_file_spec + /// A lldb::SBFileSpec object that contains source file aprantl wrote: > We typically use `\param` instead of `@param` in LLVM. I did it like

[Lldb-commits] [PATCH] D48520: [lldb-mi] Re-implement a few MI commands.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL336155: [lldb-mi] Re-implement a few MI commands. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D48520?vs=152715&id=1

[Lldb-commits] [PATCH] D48775: Add new SBTarget::IsDummy method.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. I think we can remove comments added by me and commit patch as it is. Any thoughts about it? https://reviews.llvm.org/D48775 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/

[Lldb-commits] [PATCH] D48775: Add new SBTarget::IsDummy method.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. It's hard to choose something, both variants are good enough. But, if there is no necessity in such a method, we can drop it. https://reviews.llvm.org/D48775 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http:

[Lldb-commits] [PATCH] D48775: Add new SBTarget::IsDummy method.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov abandoned this revision. apolyakov added a comment. Abandoned since suggested functionality is optional. https://reviews.llvm.org/D48775 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

[Lldb-commits] [PATCH] D48801: Add new API to SBTarget and SBModule classes.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 153846. apolyakov added a comment. Updated passing an argument to `find_compile_units` function. https://reviews.llvm.org/D48801 Files: include/lldb/API/SBModule.h include/lldb/API/SBTarget.h packages/Python/lldbsuite/test/python_api/module_section

[Lldb-commits] [PATCH] D48802: [lldb-mi] Re-implement symbol-list-lines command.

2018-07-02 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 153847. apolyakov added a comment. Removed `sb_target.IsDummy()` since `IsDummy` won't be a member of SBTarget class. Now `sb_target == rSessionInfo.GetDebugger().GetDummyTarget()` is used for this goal. https://reviews.llvm.org/D48802 Files: lit/tool

[Lldb-commits] [PATCH] D48801: Add new API to SBTarget and SBModule classes.

2018-07-03 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL336200: Add new API to SBTarget and SBModule classes. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D48801?vs=153846&

[Lldb-commits] [PATCH] D48802: [lldb-mi] Re-implement symbol-list-lines command.

2018-07-03 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL336206: [lldb-mi] Re-implement symbol-list-lines command. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D48802?vs=153

[Lldb-commits] [PATCH] D49006: Add LLDB_API to SBAddress's operator==

2018-07-06 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov accepted this revision. apolyakov added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D49006 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[Lldb-commits] [PATCH] D49006: Add LLDB_API to SBAddress's operator==

2018-07-06 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Unfortunately, I don't have an opportunity to check this out on windows, but if this works, I'll be glad that someone found out how to fix compilation failure on windows. https://reviews.llvm.org/D49006 ___ lldb-commits

[Lldb-commits] [PATCH] D49006: Add LLDB_API to SBAddress's operator==

2018-07-07 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL336494: Add LLDB_API to SBAddress's operator==. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D49006?vs=154360&id=154

[Lldb-commits] [PATCH] D49062: [lldb-mi] Re-implement data-info-line command.

2018-07-08 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg. Herald added a subscriber: ki.stfu. Now data-info-line command uses SB API instead of HandleCommand. https://reviews.llvm.org/D49062 Files: packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py tools/ll

[Lldb-commits] [PATCH] D49062: [lldb-mi] Re-implement data-info-line command.

2018-07-09 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 154623. apolyakov added a comment. Returned accidentally removed backslashes in `self.expect` pattern, removed comment from: `#include // For std::to_string.` https://reviews.llvm.org/D49062 Files: packages/Python/lldbsuite/test/tools/lldb-mi/data/Tes

[Lldb-commits] [PATCH] D49062: [lldb-mi] Re-implement data-info-line command.

2018-07-09 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: tools/lldb-mi/MICmdCmdData.cpp:1691 +break; + for (uint32_t j = 0, e = cu.GetNumLineEntries(); j < e; ++j) { +const lldb::SBLineEntry &curLine = cu.GetLineEntryAtIndex(j); aprantl wrote: > @claybor

[Lldb-commits] [PATCH] D48802: [lldb-mi] Re-implement symbol-list-lines command.

2018-07-09 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Could you please provide an output of this command on Windows: `E:\_work\4\b\LLVMBuild\Release\bin\lldb-mi.EXE --synchronous E:\_work\4\b\LLVMBuild\tools\lldb\lit\tools\lldb-mi\symbol\Output\symbol-list-lines.test.tmp < E:\_work\4\s\llvm\tools\lldb\lit\tools\lldb-mi\

[Lldb-commits] [PATCH] D49062: [lldb-mi] Re-implement data-info-line command.

2018-07-09 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py:22 @skipIfDarwin # pexpect is known to be unreliable on Darwin @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_

[Lldb-commits] [PATCH] D48802: [lldb-mi] Re-implement symbol-list-lines command.

2018-07-13 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. In https://reviews.llvm.org/D48802#1161904, @stella.stamenova wrote: > @apolyakov Perhaps we can mark the test as XFAIL on Windows while you > investigate. Any objections? Sure, I'll do it. Repository: rL LLVM https://reviews.llvm.org/D48802 _

[Lldb-commits] [PATCH] D49062: [lldb-mi] Re-implement data-info-line command.

2018-07-13 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. It would be good to convert to LIT as more tests as we can. I'll do this in one of a next patches. Let's continue with this one? https://reviews.llvm.org/D49062 ___ lldb-commits mailing list lldb-commits@lists.llvm.org ht

[Lldb-commits] [PATCH] D48802: [lldb-mi] Re-implement symbol-list-lines command.

2018-07-13 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. @stella.stamenova Done in r337064. Repository: rL LLVM https://reviews.llvm.org/D48802 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [PATCH] D49062: [lldb-mi] Re-implement data-info-line command.

2018-07-19 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 156299. apolyakov added a comment. Converted data-info-line python test to a lit one. https://reviews.llvm.org/D49062 Files: lit/tools/lldb-mi/data/data-info-line.test lit/tools/lldb-mi/data/inputs/data-info-line.c lit/tools/lldb-mi/data/lit.local.c

[Lldb-commits] [PATCH] D49632: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.

2018-07-21 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg, labath. Herald added a subscriber: ki.stfu. Now this function uses SB API instead of HandleCommand. https://reviews.llvm.org/D49632 Files: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Index: tools/lldb-mi/MICm

[Lldb-commits] [PATCH] D49632: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.

2018-07-21 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:963 +sbProcess.GetDescription(streamOut); +for (uint32_t i = 0, e = sbProcess.GetNumThreads(); i < e; ++i) { + const lldb::SBThread thread = sbProcess.GetThreadAtIndex(i); --

[Lldb-commits] [PATCH] D49632: [WIP] Re-implement MI HandleProcessEventStateSuspended.

2018-07-21 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. In https://reviews.llvm.org/D49632#1171024, @clayborg wrote: > So with CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateSuspended() it > will report a bunch of text back through the MI interface with this each > time? Why would it do that? I would assume that th

[Lldb-commits] [PATCH] D49062: [lldb-mi] Re-implement data-info-line command.

2018-07-23 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337689: [lldb-mi] Re-implement data-info-line command. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D49062?vs=156299

[Lldb-commits] [PATCH] D47302: [WIP] New class SBTargetSettings to store and manipulate all target's properties.

2018-07-23 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Another approach is to implement SBTargetSettings' functionality such as serialization inside lldb_private TargetProperties class and then just add an API to the SBTarget. For example: `void SBTarget::SerializeProperties(...)` What do you think about this way? https

[Lldb-commits] [PATCH] D49632: [WIP] Re-implement MI HandleProcessEventStateSuspended.

2018-07-23 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. You mean that it's unreasonable to provide such an output to stdout since MI clients are text redactors, IDE and not people? https://reviews.llvm.org/D49632 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http:/

[Lldb-commits] [PATCH] D47302: [WIP] New class SBTargetSettings to store and manipulate all target's properties.

2018-07-23 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. In https://reviews.llvm.org/D47302#1171639, @clayborg wrote: > We could end up moving anything that is set by a target property into the > lldb_private target property class if it isn't already there and then that > would fix things. If you remember, we started this

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-24 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg, labath. Herald added a subscriber: ki.stfu. In this patch I suggest a way to deal with the problem started in https://reviews.llvm.org/D47302 and use it to re-implement MI target-select command. You are welcome to com

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-25 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. What do you think about running tests with a hardcoded port number(as it's done in a web-services). Doing this, we get rid of additional scripts and os-specific things. AFAIK, debugserver even has its own default port. P.S. As I saw in the lldb-mi python tests, port n

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-25 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. `packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py` test contains `port = 12000 + random.randint(0, 3999)`. https://reviews.llvm.org/D49739 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http:

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-25 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Thanks, I used this `lldb-server gdbserver --pipe 0 localhost:0` and got a port chosen by debugserver. But to let lldb-mi know about this port we need an additional script, is python a good choice for that? https://reviews.llvm.org/D49739 _

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-25 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 157310. apolyakov added a comment. Moved test from bash to python, removed unnecessary `Target::AppendImageSearchPath`. https://reviews.llvm.org/D49739 Files: include/lldb/API/SBTarget.h lit/lit.cfg lit/tools/lldb-mi/target/inputs/main.c lit/tool

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-25 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: lit/lit.cfg:59 -debugserver = lit.util.which('debugserver', lldb_tools_dir) +if platform.system() in ['Darwin']: +debugserver = lit.util.which('debugserver', lldb_tools_dir) Do we have `debugserver` only on macOS

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-26 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: lit/tools/lldb-mi/target/inputs/target-select-so-path.py:8-11 +def get_free_port(): +s = socket.socket() +s.bind(('', 0)) +return s.getsockname()[1] labath wrote: > This is still racy, because the port can

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-26 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: lit/tools/lldb-mi/target/inputs/target-select-so-path.py:8-11 +def get_free_port(): +s = socket.socket() +s.bind(('', 0)) +return s.getsockname()[1] labath wrote: > apolyakov wrote: > > labath wrote: > > >

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-26 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: lit/tools/lldb-mi/target/inputs/target-select-so-path.py:8-11 +def get_free_port(): +s = socket.socket() +s.bind(('', 0)) +return s.getsockname()[1] labath wrote: > apolyakov wrote: > > labath wrote: > > >

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-26 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 157512. apolyakov added a comment. Now tcp port is choosing by debugserver. https://reviews.llvm.org/D49739 Files: include/lldb/API/SBTarget.h lit/lit.cfg lit/tools/lldb-mi/target/inputs/main.c lit/tools/lldb-mi/target/inputs/target-select-so-path

[Lldb-commits] [PATCH] D49632: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.

2018-07-26 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 157533. apolyakov retitled this revision from "[WIP] Re-implement MI HandleProcessEventStateSuspended." to "[lldb-mi] Re-implement MI HandleProcessEventStateSuspended.". apolyakov added a comment. It seems that it's impossible to get `HandleProcessEventSta

[Lldb-commits] [PATCH] D49632: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.

2018-07-30 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. In https://reviews.llvm.org/D49632#1180465, @clayborg wrote: > I still don't get why we are printing process stopped information to STDOUT. > MI is a machine interface for a IDE. The IDE should be showing the process > state in the GUI. AFAIK, all lldb-mi commands p

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-31 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. So, do you have any thoughts about this approach letting the debugserver choose a tcp port and patch overall? https://reviews.llvm.org/D49739 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-31 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. OK, thank you for respond. Then, I think, we should wait for review from @clayborg or @aprantl, and if they accept the patch I'll divide it into two parts: SB API part and target-select one. https://reviews.llvm.org/D49739 _

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-31 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: source/API/SBTarget.cpp:1468 + } + if (from[0] && to[0]) { +Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); aprantl wrote: > apolyakov wrote: > > I didn't find nullptr check in other API functi

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-31 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 158319. apolyakov added a comment. Added converting from `const char *` to `ConstString`, documented new API. https://reviews.llvm.org/D49739 Files: include/lldb/API/SBTarget.h lit/lit.cfg lit/tools/lldb-mi/target/inputs/main.c lit/tools/lldb-mi/t

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-31 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 158330. apolyakov added a comment. Made error handling more meaningful: added different error messages for cases - empty path and empty path. https://reviews.llvm.org/D49739 Files: include/lldb/API/SBTarget.h lit/lit.cfg lit/tools/lldb-mi/target/

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-31 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: source/API/SBTarget.cpp:1467 + } + const ConstString csFrom(from), csTo(to); + if (csFrom && csTo) { aprantl wrote: > personally I would write this as: > ``` > if (!csFrom) > return error.SetErrorString(" path is

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-31 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments. Comment at: source/API/SBTarget.cpp:1467 + } + const ConstString csFrom(from), csTo(to); + if (csFrom && csTo) { aprantl wrote: > apolyakov wrote: > > aprantl wrote: > > > personally I would write this as: > > > ``` > > > if (!

[Lldb-commits] [PATCH] D49739: [WIP] Re-implement MI target-select command.

2018-07-31 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 158377. apolyakov added a comment. Changed the order of `if` statements to follow llvm coding standards. https://reviews.llvm.org/D49739 Files: include/lldb/API/SBTarget.h lit/lit.cfg lit/tools/lldb-mi/target/inputs/main.c lit/tools/lldb-mi/target

[Lldb-commits] [PATCH] D49632: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.

2018-08-01 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. @clayborg can you explain what are you worry about because I don't completely understand you? As I said, all lldb-mi commands print their result to STDOUT, AFAIK, an IDE should parse it and then show in a GUI. https://reviews.llvm.org/D49632 __

[Lldb-commits] [PATCH] D49632: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.

2018-08-07 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL339160: [lldb-mi] Re-implement MI HandleProcessEventStateSuspended. (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D49

[Lldb-commits] [PATCH] D49739: Add new API to SBTarget class

2018-08-07 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 159582. apolyakov retitled this revision from "[WIP] Re-implement MI target-select command." to "Add new API to SBTarget class". apolyakov edited the summary of this revision. apolyakov added a comment. Splitted the patch into two parts: this part with the

[Lldb-commits] [PATCH] D49739: Add new API to SBTarget class

2018-08-07 Thread Alexander Polyakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL339175: Add new API to SBTarget class (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D49739?vs=159582&id=159587#toc R

[Lldb-commits] [PATCH] D49739: Add new API to SBTarget class

2018-08-07 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. Sure, will do it. Repository: rL LLVM https://reviews.llvm.org/D49739 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [PATCH] D47302: [WIP] New class SBTargetSettings to store and manipulate all target's properties.

2018-08-07 Thread Alexander Polyakov via Phabricator via lldb-commits
polyakov.alex abandoned this revision. polyakov.alex added a comment. Abandoned since suggested functionality is already done in https://reviews.llvm.org/D49739. https://reviews.llvm.org/D47302 ___ lldb-commits mailing list lldb-commits@lists.llvm

[Lldb-commits] [PATCH] D49739: Add new API to SBTarget class

2018-08-09 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a subscriber: t.p.northover. apolyakov added a comment. It seems that `target-select-so-path.test` hangs on macOS. Thanks to @t.p.northover for noting this. The debugserver doesn't have `--pipe` option, so on macOS it fails to start and the test hangs waiting for output from de

[Lldb-commits] [PATCH] D49739: Add new API to SBTarget class

2018-08-09 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added a comment. I think those options don't fit. I'm looking for behavior like this: ~/workspace/gsoc/build/bin/lldb-server gdbserver --pipe 1 localhost:0 36251 Here lldb-server prints out the port number he is listening on and continues running. If debugserver can choose a tcp

[Lldb-commits] [PATCH] D50525: [WIP] Move lldb-mi interpreter tests to LIT

2018-08-09 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov created this revision. apolyakov added reviewers: aprantl, clayborg, jingham, labath. Herald added a subscriber: ki.stfu. In this patch I move some of interpreter tests from python to LIT(I will move all interpreter test if these are OK). It's a WIP since I want to get your opinion abo

<    1   2   3   >