[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

@mgorny

I can't get anything to work.   I've tried running  a local VM with virtualbox 
but it's networking driver crashes my kernel.   I've tried a local VM with 
VMware but it won't boot netbsd.   I've tried AWS but they only have netbsd 7, 
which is too old.   I've tried google cloud, but their image creator script 
only works for netbsd 9, and python won't build because x11 isn't installed.   
I've tried installing the pkgsrc binaries from netbsd 8 onto netbsd 9, but that 
doesn't work either.   I'm completely at a loss.  I can't figure out how to 
make a netbsd VM that can actually build LLDB.

Do you have  a machine image on AWS or google cloud or even a VMDK or something 
that I could use?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

That's dedication. I wasn't able to get it to run on qemu-kvm either. Regular 
qemu works bit the performance is terrible. I ended installing it as a second 
system on my laptop.

I'll try to figure it out myself. If you could suggest roughly what syscalls 
are involved, that might be helpful. Otherwise, I'll figure out how to run it 
outside of lit and/or add some cheap debugging hacks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [PATCH] D69230: RFC: specialized Optional for T that can represent its own invalid state

2019-10-22 Thread serge via Phabricator via lldb-commits
serge-sans-paille added inline comments.



Comment at: llvm/include/llvm/ADT/Optional.h:216
+  OptionalStorage &operator=(T const &y) {
+assert(Info::is_valid(y));
+value = y;

Slight note (borrowed from [this 
thread](https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/46J1onhWJ-s/discussion).

This implementation, compared to the generic one, is not type-safe and relies 
on an assert on `y` to check whether it's the sentinel or not. This is a slight 
change that may matter (somehow trading type-safety for performance).

Possible exploration path: if the sentinel has its own type (e.g. 
std::nullptr_t) we somehow improve type safety, but still don't have the same 
guarantee as the generic implementation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69230/new/

https://reviews.llvm.org/D69230



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


[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

In D68856#1717683 , @lawrence_danna 
wrote:

> @mgorny
>
> I can't get anything to work.   I've tried running  a local VM with 
> virtualbox but it's networking driver crashes my kernel.   I've tried a local 
> VM with VMware but it won't boot netbsd.   I've tried AWS but they only have 
> netbsd 7, which is too old.   I've tried google cloud, but their image 
> creator script only works for netbsd 9, and python won't build because x11 
> isn't installed.   I've tried installing the pkgsrc binaries from netbsd 8 
> onto netbsd 9, but that doesn't work either.   I'm completely at a loss.  I 
> can't figure out how to make a netbsd VM that can actually build LLDB.
>
> Do you have  a machine image on AWS or google cloud or even a VMDK or 
> something that I could use?


For the python part, you need to either install all basesystem sets (including 
x11) or set `X11_TYPE=modular` in `/etc/mk.conf`.

All my NetBSD setups are either native or qemu+haxm. I cannot test virtualbox 
or vmware as of now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

For the git part you will need to install mozilla-rootcerts and follow 
post-install instructions, as otherwise `https://` won't work nicely.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [PATCH] D69309: Support template instantiation in the expression evaluator

2019-10-22 Thread Jaroslav Sevcik via Phabricator via lldb-commits
jarin created this revision.
Herald added subscribers: lldb-commits, arphaman, aprantl.
Herald added a project: LLDB.

WORK IN PROGRESS

This change is mostly for discussion, it is messy and likely wrong as I am new 
to the lldb codebase.

The goal of this exercise is to support expressions containing template 
instantiations, e.g. foo::x.

The idea here is to collect all template types in the dwarf index. Later, when 
asked to find a name X, we import all the instantiations of X and pass the 
template declaration with the instantiations to Clang. In addition to my poor 
abstraction skills, the major problem with this is that we need to import all 
the instantiations even when only one is used. I tried to only import forward 
declarations, but if the instantiations were already previously completed, the 
AST importer still imports everything. This leads to massive evaluation times 
(tens of seconds) on templates with many instantiations (std::vector and the 
likes).

I am planning to pursue a different avenue, where I would introduce another 
hook into clang (perhaps in Sema::CheckTemplateIdType), but I am not sure how 
viable that path is.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69309

Files:
  
lldb/packages/Python/lldbsuite/test/lang/cpp/class-template-instantiation/Makefile
  
lldb/packages/Python/lldbsuite/test/lang/cpp/class-template-instantiation/TestClassTemplateInstantiation.py
  
lldb/packages/Python/lldbsuite/test/lang/cpp/class-template-instantiation/main.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Symbol/TypeMap.cpp

Index: lldb/source/Symbol/TypeMap.cpp
===
--- lldb/source/Symbol/TypeMap.cpp
+++ lldb/source/Symbol/TypeMap.cpp
@@ -141,6 +141,27 @@
exact_match);
 }
 
+namespace {
+
+bool TypeBasenamesMatch(const std::string &type_basename,
+llvm::StringRef match_type_basename,
+bool is_instantiation) {
+  if (match_type_basename == type_basename)
+return true;
+  // If the basenames do not match, let us see if {match_type_basename} could
+  // be an instantiation of {type_basename}.
+  if (is_instantiation)
+return false;
+  size_t basename_size = type_basename.size();
+  if (match_type_basename.size() <= basename_size)
+return false;
+  if (match_type_basename[basename_size] != '<')
+return false;
+  return match_type_basename.take_front(basename_size) == type_basename;
+}
+
+} // namespace
+
 void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
 const std::string &type_basename,
 TypeClass type_class, bool exact_match) {
@@ -152,6 +173,8 @@
 
   iterator pos, end = m_types.end();
 
+  bool is_instantiation = type_basename.find('<') != std::string::npos;
+
   for (pos = m_types.begin(); pos != end; ++pos) {
 Type *the_type = pos->second.get();
 bool keep_match = false;
@@ -171,7 +194,8 @@
   if (Type::GetTypeScopeAndBasename(match_type_name, match_type_scope,
 match_type_basename,
 match_type_class)) {
-if (match_type_basename == type_basename) {
+if (TypeBasenamesMatch(type_basename, match_type_basename,
+   is_instantiation)) {
   const size_t type_scope_size = type_scope.size();
   const size_t match_type_scope_size = match_type_scope.size();
   if (exact_match || (type_scope_size == match_type_scope_size)) {
@@ -203,7 +227,9 @@
   } else {
 // The type we are currently looking at doesn't exists in a namespace
 // or class, so it only matches if there is no type scope...
-keep_match = type_scope.empty() && type_basename == match_type_name;
+keep_match = type_scope.empty() &&
+ TypeBasenamesMatch(type_basename, match_type_name,
+is_instantiation);
   }
 }
 
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2419,6 +2419,24 @@
 }
   }
 
+  die_offsets.clear();
+  m_index->GetGenericTypes(name, die_offsets);
+  for (size_t i = 0; i < die_offsets.size(); ++i) {

[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

In D68856#1717767 , @krytarowski wrote:

> In D68856#1717683 , @lawrence_danna 
> wrote:
>
> > @mgorny
> >
> > I can't get anything to work.   I've tried running  a local VM with 
> > virtualbox but it's networking driver crashes my kernel.   I've tried a 
> > local VM with VMware but it won't boot netbsd.   I've tried AWS but they 
> > only have netbsd 7, which is too old.   I've tried google cloud, but their 
> > image creator script only works for netbsd 9, and python won't build 
> > because x11 isn't installed.   I've tried installing the pkgsrc binaries 
> > from netbsd 8 onto netbsd 9, but that doesn't work either.   I'm completely 
> > at a loss.  I can't figure out how to make a netbsd VM that can actually 
> > build LLDB.
> >
> > Do you have  a machine image on AWS or google cloud or even a VMDK or 
> > something that I could use?
>
>
> For the python part, you need to either install all basesystem sets 
> (including x11) or set `X11_TYPE=modular` in `/etc/mk.conf`.


I tried `X11_TYPE`, it does nothing.  I'm a bit confused there because I 
did not have a file called `/etc/mk.conf`.

Is there a way to install those missing basesystem sets once the machine is up? 
  Or do I have to go back and reinstall from scratch?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

now I'm stuck on  this trying to install cmake.

  pkg_add: no pkg found for 'libunistring>=0.9.4', sorry.
  pkg_add: Can't install dependency libunistring>=0.9.4
  pkg_add: 1 package addition failed
  *** Error code 1




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.



In D68856#1718096 , @lawrence_danna 
wrote:

> now I'm stuck on  this trying to install cmake.
>
>   pkg_add: no pkg found for 'libunistring>=0.9.4', sorry.
>   pkg_add: Can't install dependency libunistring>=0.9.4
>   pkg_add: 1 package addition failed
>   *** Error code 1
>


I recommend to just use pkgsrc from source code. As of today packages are 
imperfect and always there is a set of things that are not prebuilt.

If there are mixed packages for binary packages vs source ones, it's reasonable 
to `rm -rf /usr/pkg /var/db/pkg` before starting.

Steps:

1. Download pkgsrc from tarball.

http://cdn.netbsd.org/pub/pkgsrc/pkgsrc-2019Q3/pkgsrc-2019Q3.tar.bz2

2. Unpack, e.g. into /usr/pkgsrc
3. cd /usr/pkgsrc/devel/git-base && make install
4. cd /usr/pkgsrc/security/mozilla-rootcerts && make install

And follow the MESSAGE commands to finish the installation.

5. Follow this process for all the dependencies (if I remember correctly: 
cmake, swig3, ninja-build).

In D68856#1718075 , @lawrence_danna 
wrote:

> In D68856#1717767 , @krytarowski 
> wrote:
>
> > In D68856#1717683 , 
> > @lawrence_danna wrote:
> >
> > > @mgorny
> > >
> > > I can't get anything to work.   I've tried running  a local VM with 
> > > virtualbox but it's networking driver crashes my kernel.   I've tried a 
> > > local VM with VMware but it won't boot netbsd.   I've tried AWS but they 
> > > only have netbsd 7, which is too old.   I've tried google cloud, but 
> > > their image creator script only works for netbsd 9, and python won't 
> > > build because x11 isn't installed.   I've tried installing the pkgsrc 
> > > binaries from netbsd 8 onto netbsd 9, but that doesn't work either.   I'm 
> > > completely at a loss.  I can't figure out how to make a netbsd VM that 
> > > can actually build LLDB.
> > >
> > > Do you have  a machine image on AWS or google cloud or even a VMDK or 
> > > something that I could use?
> >
> >
> > For the python part, you need to either install all basesystem sets 
> > (including x11) or set `X11_TYPE=modular` in `/etc/mk.conf`.
>
>
> I tried `X11_TYPE`, it does nothing.  I'm a bit confused there because I 
> did not have a file called `/etc/mk.conf`.
>
> Is there a way to install those missing basesystem sets once the machine is 
> up?   Or do I have to go back and reinstall from scratch?


The typical approach is to fetch set file and untarball it into /, all other 
approaches are at most wrappers to this. The list of installed sets is stored 
in `/etc/mtree/`.

Please remember to use tar options to preserve file properties.

http://pub.nethence.com/bsd/wo.sysinst notes: `tar xzphfe $set.tgz -C /`.

Another option is to disable x11 option either for all packages or for python. 
In my opinion it's easier to just set the `modular` in the `X11_TYPE` variable.

> PS: oh,  //of course// I have to set the environment variable 
> `MAKECONF=/etc/mk.conf`

`/etc/mk.conf` is the default file for MAKECONF, no need to set this variable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [lldb] 0bff9bd - [lldb] Adjust for the new class_rw_t layout.

2019-10-22 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2019-10-22T10:22:06-07:00
New Revision: 0bff9bd26e3d8b424f96f66b4297a73a873c4e53

URL: 
https://github.com/llvm/llvm-project/commit/0bff9bd26e3d8b424f96f66b4297a73a873c4e53
DIFF: 
https://github.com/llvm/llvm-project/commit/0bff9bd26e3d8b424f96f66b4297a73a873c4e53.diff

LOG: [lldb] Adjust for the new class_rw_t layout.

The field holding the "ro" will now be a union. If the low bit is set,
then it isn't an ro and it needs to be dereferenced once more to get to
it. If the low bit isn't set, then it is a proper class_ro_t

No dedicated test is needed as this code path will trigger when running
the existing Objective-C tests under a current version of the runtime.

Added: 


Modified: 

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
index 93aa07f89165..859b693477a9 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
@@ -111,6 +111,18 @@ bool ClassDescriptorV2::class_rw_t::Read(Process *process, 
lldb::addr_t addr) {
   m_firstSubclass = extractor.GetAddress_unchecked(&cursor);
   m_nextSiblingClass = extractor.GetAddress_unchecked(&cursor);
 
+  if (m_ro_ptr & 1) {
+DataBufferHeap buffer(ptr_size, '\0');
+process->ReadMemory(m_ro_ptr ^ 1, buffer.GetBytes(), ptr_size, error);
+if (error.Fail())
+  return false;
+cursor = 0;
+DataExtractor extractor(buffer.GetBytes(), ptr_size,
+process->GetByteOrder(),
+process->GetAddressByteSize());
+m_ro_ptr = extractor.GetAddress_unchecked(&cursor);
+  }
+
   return true;
 }
 



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


[Lldb-commits] [PATCH] D69230: RFC: specialized Optional for T that can represent its own invalid state

2019-10-22 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

Seems like there's a consensus that if we have something like this it should be 
called `DenseOptional`, and changes to `Optional` should only make it more like 
`std::optional`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69230/new/

https://reviews.llvm.org/D69230



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


[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

In the meantime, I found the root issue. It's in `PythonDataObjects.cpp`, 
`PythonFile::ConvertToFile(bool borrowed)`. The function unconditionally calls 
`flush()` on the fd. However, it's invalid to call `flush()` on stdin or — more 
generally — on file open only for reading. I'm going to submit a patch in a few 
minutes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [PATCH] D68856: convert SBDebugger::***FileHandle() wrappers to native files.

2019-10-22 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

In D68856#1718240 , @mgorny wrote:

> In the meantime, I found the root issue. It's in `PythonDataObjects.cpp`, 
> `PythonFile::ConvertToFile(bool borrowed)`. The function unconditionally 
> calls `flush()` on the fd. However, it's invalid to call `flush()` on stdin 
> or — more generally — on file open only for reading. I'm going to submit a 
> patch in a few minutes.


🎉


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68856/new/

https://reviews.llvm.org/D68856



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


[Lldb-commits] [PATCH] D67793: new api class: SBFile

2019-10-22 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

While looking at the other bug, I noticed something suspicious here.




Comment at: lldb/trunk/source/Host/common/File.cpp:74
+  .Case("r", File::eOpenOptionRead)
+  .Case("w", File::eOpenOptionWrite)
+  .Case("a", File::eOpenOptionWrite | File::eOpenOptionAppend |

Shouldn't this also include `File::eOpenOptionCanCreate | 
File::eOpenOptionTruncate`?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67793/new/

https://reviews.llvm.org/D67793



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


[Lldb-commits] [PATCH] D69320: [lldb] [Python] Do not attempt to flush() a read-only fd

2019-10-22 Thread Michał Górny via Phabricator via lldb-commits
mgorny created this revision.
mgorny added reviewers: lawrence_danna, labath, krytarowski.

When creating a FileSP object, do not flush() the underlying file unless
it is open for writing.  Attempting to flush() a read-only fd results
in EBADF on NetBSD.


https://reviews.llvm.org/D69320

Files:
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp


Index: lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1367,11 +1367,13 @@
   if (!options)
 return options.takeError();
 
-  // LLDB and python will not share I/O buffers.  We should probably
-  // flush the python buffers now.
-  auto r = CallMethod("flush");
-  if (!r)
-return r.takeError();
+  if (options.get() & File::eOpenOptionWrite) {
+// LLDB and python will not share I/O buffers.  We should probably
+// flush the python buffers now.
+auto r = CallMethod("flush");
+if (!r)
+  return r.takeError();
+  }
 
   FileSP file_sp;
   if (borrowed) {


Index: lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1367,11 +1367,13 @@
   if (!options)
 return options.takeError();
 
-  // LLDB and python will not share I/O buffers.  We should probably
-  // flush the python buffers now.
-  auto r = CallMethod("flush");
-  if (!r)
-return r.takeError();
+  if (options.get() & File::eOpenOptionWrite) {
+// LLDB and python will not share I/O buffers.  We should probably
+// flush the python buffers now.
+auto r = CallMethod("flush");
+if (!r)
+  return r.takeError();
+  }
 
   FileSP file_sp;
   if (borrowed) {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D69320: [lldb] [Python] Do not attempt to flush() a read-only fd

2019-10-22 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna accepted this revision.
lawrence_danna added a comment.
This revision is now accepted and ready to land.

LGTM


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69320/new/

https://reviews.llvm.org/D69320



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


[Lldb-commits] [PATCH] D69320: [lldb] [Python] Do not attempt to flush() a read-only fd

2019-10-22 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

Could you push this for me? It seems that I have missed the GitHub migration 
and I didn't get commit access to the new repository.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69320/new/

https://reviews.llvm.org/D69320



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


[Lldb-commits] [PATCH] D69320: [lldb] [Python] Do not attempt to flush() a read-only fd

2019-10-22 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

In D69320#1718288 , @mgorny wrote:

> Could you push this for me? It seems that I have missed the GitHub migration 
> and I didn't get commit access to the new repository.


looks like i've got the same problem


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69320/new/

https://reviews.llvm.org/D69320



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


[Lldb-commits] [PATCH] D69320: [lldb] [Python] Do not attempt to flush() a read-only fd

2019-10-22 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

Same here, I cannot commit.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69320/new/

https://reviews.llvm.org/D69320



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