[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-27 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment. Great, thanks! So it's not just my computer going crazy after all ;-). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68737/new/ https://reviews.llvm.org/D68737 ___ lldb-commits

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-27 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment. In D68737#1722620 , @mgorny wrote: > In D68737#1722575 , @lawrence_danna > wrote: > > > In D68737#1722255 , @mgorny wrote: > > > > > However,

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-27 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment. In D68737#1722575 , @lawrence_danna wrote: > In D68737#1722255 , @mgorny wrote: > > > However, I think this is only a symptom of a more generic problem. I don't > > think we should really b

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-27 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment. In D68737#1722255 , @mgorny wrote: > However, I think this is only a symptom of a more generic problem. I don't > think we should really be creating a second system of file objects outside > Python, and injecting it into P

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-27 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment. In D68737#1722556 , @mgorny wrote: > Which Python version are you using? 3.7.I'll try it with 2.7. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68737/new/ https://revi

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-27 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment. I've just tried on Linux and it seems that Python closes the same descriptors. So somehow closing stdin works here on Linux, and fails on NetBSD. Curious enough, with a simple test I can verify that both NetBSD and Linux return EBADF when trying to close stdin twice. So

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-27 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment. Which Python version are you using? I've just hacked Python 2.7 a bit and found that the failing `close()` is actually `fclose()` on `FILE*` object with fd=0. I can reproduce `EBADF` only when the same fd is closed twice, so I suspect that something else is closing stdin

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-26 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment. Hmm, that's weird. It happened on the buildbot which is running some recent 8.x kernel, and on my testing machine with 9.x. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68737/new/ https://reviews.llvm.org/D68737 ___

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-26 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment. In D68737#1722181 , @mgorny wrote: > Well, I found another problem with these series, specifically starting at > this commit. Any use of `script` in LLDB ends up with: > > (lldb) script True > True > close failed in f

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-25 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment. Well, I found another problem with these series, specifically starting at this commit. Any use of `script` in LLDB ends up with: (lldb) script True True close failed in file object destructor: IOError: [Errno 9] Bad file descriptor I'd suspect the same fd is usin

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-15 Thread Lawrence D'Anna via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd9b553ec9961: SBFile::GetFile: convert SBFile back into python native files. (authored by lawrence_danna). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D6873

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-15 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision. labath added inline comments. This revision is now accepted and ready to land. Comment at: lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py:781 +with open(self.out_filename, 'r') as f: +# python2 retu

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-15 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna updated this revision to Diff 225009. lawrence_danna marked an inline comment as done. lawrence_danna added a comment. pass ::flush to PyFile_FromFile Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68737/new/ https://reviews.llvm.org/

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-15 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna marked 3 inline comments as done. lawrence_danna added inline comments. Comment at: lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py:781 +with open(self.out_filename, 'r') as f: +# python2 returns None from write, py

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Looks good, just a couple of quick questions Comment at: lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py:776 @add_test_categories(['pyapi']) -@expectedFailure # FIXME implement SBFile::GetFile @skipIf(py_versio

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-14 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment. @labath, how's this look now? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68737/new/ https://reviews.llvm.org/D68737 ___ lldb-commits mailing list lldb-commits@lists.l

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-14 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna updated this revision to Diff 224922. lawrence_danna added a comment. rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68737/new/ https://reviews.llvm.org/D68737 Files: lldb/include/lldb/API/SBFile.h lldb/include/lldb/Host/

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-11 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added inline comments. Comment at: lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py:776 @add_test_categories(['pyapi']) -@expectedFailure # FIXME implement SBFile::GetFile @skipIf(py_version=['<', (3,)]) l

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-11 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna updated this revision to Diff 224659. lawrence_danna marked 8 inline comments as done. lawrence_danna added a comment. review fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68737/new/ https://reviews.llvm.org/D68737 Files: ll

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-11 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/include/lldb/Host/File.h:56 static bool DescriptorIsValid(int descriptor) { return descriptor >= 0; }; + static const char *GetStreamOpenModeFromOptions(uint32_t options); lawrence_danna wrote: > labath wrote:

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-10 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment. I split off the OpenOptions enum stuff into a separate patch, because changing it from uint32_t to the enum is kind of viral Comment at: lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h:674-682 + PythonFile(File &file, const ch

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-10 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna updated this revision to Diff 224527. lawrence_danna marked 7 inline comments as done. lawrence_danna added a comment. review fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68737/new/ https://reviews.llvm.org/D68737 Files: ll

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-10 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna marked an inline comment as done. lawrence_danna added inline comments. Comment at: lldb/include/lldb/Host/File.h:56 static bool DescriptorIsValid(int descriptor) { return descriptor >= 0; }; + static const char *GetStreamOpenModeFromOptions(uint32_t options);

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-10 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna marked an inline comment as done. lawrence_danna added inline comments. Comment at: lldb/include/lldb/Host/File.h:316 + ///The PyObject* that this File wraps, or NULL. + virtual void *GetPythonObject() const; + labath wrote: > We've spend a l

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-10 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna marked 3 inline comments as done. lawrence_danna added inline comments. Comment at: lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py:776 @add_test_categories(['pyapi']) -@expectedFailure # FIXME implement SBFile::GetFile @

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-10 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. It looks pretty straight-forward. The two main comments I have are: - implement rtti to get rid of the `GetPythonObject` method on the base class - it looks like the implementations of new apis you're adding (GetOptions, mainly) have to go out of their way to ignore error

[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

2019-10-09 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna created this revision. lawrence_danna added reviewers: JDevlieghere, jasonmolenda, labath. Herald added a project: LLDB. This makes SBFile::GetFile public and adds a SWIG typemap to convert the result back into a python native file. If the underlying File itself came from a python