[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-05 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE333993: [clangd] Rewrite JSON dispatcher loop using C IO (FILE*) instead of stdā€¦ (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D47643?vs=149685&id=149923#to

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-05 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM Comment at: clangd/JSONRPCDispatcher.cpp:70 } - log(llvm::Twine("--> ") + S); + log(llvm::Twine("--> ") + S + "\n"); } sammccall wro

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-04 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle added a comment. In https://reviews.llvm.org/D47643#1120913, @ilya-biryukov wrote: > PS I've checked it on my Mac and lldb seems to attach just fine. Working fine in my setup too! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47643 __

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/JSONRPCDispatcher.cpp:70 } - log(llvm::Twine("--> ") + S); + log(llvm::Twine("--> ") + S + "\n"); } ilya-biryukov wrote: > Log adds a newline for us, right? Why do we want two newlines here? Oops, forgot t

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-04 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a subscriber: hokein. ilya-biryukov added a comment. The change LG, but I'm not a big expert on C APIs, so I might've missed something. @ioeric, @hokein, maybe you have some experience with those and want to take a look? PS I've checked it on my Mac and lldb seems to attach

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 149685. sammccall added a comment. Handle one more case where fgets is interrupted. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47643 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/JSONRPCDispatcher.cpp clang

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In https://reviews.llvm.org/D47643#1120385, @malaperle wrote: > In https://reviews.llvm.org/D47643#1119187, @sammccall wrote: > > > @malaperle: would you mind patching this in and checking whether attaching > > a debugger still works on Mac (this was the reason for the

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 149682. sammccall added a comment. clearerr() on (partial) successful read, and recover from EAGAIN during fread. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47643 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-03 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle added a comment. In https://reviews.llvm.org/D47643#1119187, @sammccall wrote: > @malaperle: would you mind patching this in and checking whether attaching a > debugger still works on Mac (this was the reason for the EINTR loop, right?) > > I want to preserve this but now people other

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-01 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. @malaperle: would you mind patching this in and checking whether attaching a debugger still works on Mac (this was the reason for the EINTR loop, right?) I want to preserve this but now people other than me are complaining about old clangds hanging around and eating a

[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

2018-06-01 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added reviewers: malaperle, ilya-biryukov. Herald added subscribers: cfe-commits, jkorous, ioeric, klimek. The EINTR loop around getline was added to fix an issue with mac gdb, but seems to loop infinitely in rare cases on linux where the parent editor ex