[Lldb-commits] [lldb] r338712 - Move ClangHighlighter.cpp to hopefully better place in Xcode project.
Author: tnorthover Date: Thu Aug 2 05:50:23 2018 New Revision: 338712 URL: http://llvm.org/viewvc/llvm-project?rev=338712&view=rev Log: Move ClangHighlighter.cpp to hopefully better place in Xcode project. But with a write-only format, who can really say? Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=338712&r1=338711&r2=338712&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Aug 2 05:50:23 2018 @@ -65,6 +65,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 228B1B672113340200E61C70 /* ClangHighlighter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58A080AB2112AABB00D5580F /* ClangHighlighter.cpp */; }; 268900E813353E6F00698AC0 /* ABI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 497E7B9D1188F6690065CCA1 /* ABI.cpp */; }; 26DB3E161379E7AD0080DC73 /* ABIMacOSX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */; }; 26DB3E191379E7AD0080DC73 /* ABIMacOSX_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E0B1379E7AD0080DC73 /* ABIMacOSX_arm64.cpp */; }; @@ -1283,8 +1284,6 @@ dstPath = "$(DEVELOPER_INSTALL_DIR)/usr/share/man/man1"; dstSubfolderSpec = 0; files = ( - 58A080AE2112AAC500D5580F /* ClangHighlighter.h in CopyFiles */, - 58A080AC2112AABB00D5580F /* ClangHighlighter.cpp in CopyFiles */, AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 1; @@ -7958,6 +7957,7 @@ 268900F313353E6F00698AC0 /* StackFrame.cpp in Sources */, 268900F413353E6F00698AC0 /* StackFrameList.cpp in Sources */, 268900F513353E6F00698AC0 /* StackID.cpp in Sources */, + 228B1B672113340200E61C70 /* ClangHighlighter.cpp in Sources */, 268900F613353E6F00698AC0 /* StopInfo.cpp in Sources */, 256CBDB41ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.cpp in Sources */, 267F684F1CC02E270086832B /* RegisterContextPOSIXCore_s390x.cpp in Sources */, ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r339178 - [lldb-mi] Re-implement target-select command
Hi, I think this is causing the lldb-cmake test to hang on Green Dragon. The build revision numbers don't exactly match up for reasons I don't quite understand, but when I locally run check-lldb this is the test that spins for ages, and reverting this change doesn't move the timeout elsewhere. I think the root of the issue is that macOS's debugserver has a very different command-line interface from lldb-server, it bails and that causes the pipe read to hang. But there seem to be other issues when I try to run it manually too: tim@timn ~/llvm/llvm-project/lldb $ /opt/local/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python /Users/tim/llvm/llvm-project/lldb/lit/tools/lldb-mi/target/inputs/target-select-so-path.py /Users/tim/llvm/build.lldb/bin/debugserver /Users/tim/llvm/build.lldb/bin/lldb-mi --synchronous /Users/tim/llvm/build.lldb/tools/lldb/lit/tools/lldb-mi/target/Output/target-select-so-path.test.tmp /Users/tim/llvm/llvm-project/lldb/lit/tools/lldb-mi/target/target-select-so-path.test FileCheck: Unknown command line argument '--synchronous'. Try: 'FileCheck -help' FileCheck: Did you mean '-version'? FileCheck: Not enough positional command line arguments specified! Must specify at least 1 positional argument: See: FileCheck -help debugserver: unrecognized option `--pipe' debugserver-@(#)PROGRAM:LLDB PROJECT:lldb-360.99.0 for x86_64. error: failed to launch process /Users/tim/llvm/build.lldb/bin/debugserver: No such file or directory (localhost:0) Exiting. (It doesn't exit, it hangs). Could you take a look? Cheers. Tim. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r339343 - Darwin: mark test unsupported while we sort out how to make it generic.
Author: tnorthover Date: Thu Aug 9 06:21:05 2018 New Revision: 339343 URL: http://llvm.org/viewvc/llvm-project?rev=339343&view=rev Log: Darwin: mark test unsupported while we sort out how to make it generic. This test relies on communicating with debugserver via an unnamed (pre-opened) pipe, but macOS's version of debugserver doesn't seem to support that mode of operation. So disable the test for now. Modified: lldb/trunk/lit/tools/lldb-mi/target/target-select-so-path.test Modified: lldb/trunk/lit/tools/lldb-mi/target/target-select-so-path.test URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/target/target-select-so-path.test?rev=339343&r1=339342&r2=339343&view=diff == --- lldb/trunk/lit/tools/lldb-mi/target/target-select-so-path.test (original) +++ lldb/trunk/lit/tools/lldb-mi/target/target-select-so-path.test Thu Aug 9 06:21:05 2018 @@ -1,4 +1,4 @@ -# UNSUPPORTED: windows +# UNSUPPORTED: windows, darwin # # RUN: %cc -o %t %p/inputs/main.c -g # RUN: python %p/inputs/target-select-so-path.py "%debugserver" "%lldbmi %t" %s ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r339178 - [lldb-mi] Re-implement target-select command
On Thu, 9 Aug 2018 at 16:28, Davide Italiano wrote: > Feel free to revert this in the meanwhile, Tim, if you need to get the > bots going again. Thanks Davide. I've marked it unsupported after some discussion with Александр, as a slightly less intrusive solution. Tim. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r322183 - Fix Xcode build for r322174
Author: tnorthover Date: Wed Jan 10 05:32:01 2018 New Revision: 322183 URL: http://llvm.org/viewvc/llvm-project?rev=322183&view=rev Log: Fix Xcode build for r322174 Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=322183&r1=322182&r2=322183&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jan 10 05:32:01 2018 @@ -53,6 +53,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 22DC561A20064C9700A7E9E8 /* Environment.cpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 22DC561920064C9600A7E9E8 /* Environment.cpp */; }; 23042D121976CA1D00621B2C /* PlatformKalimba.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23042D101976CA0A00621B2C /* PlatformKalimba.cpp */; }; 23059A0719532B96007B8189 /* LinuxSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0519532B96007B8189 /* LinuxSignals.cpp */; }; 23059A101958B319007B8189 /* SBUnixSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0F1958B319007B8189 /* SBUnixSignals.cpp */; }; @@ -1246,6 +1247,7 @@ dstSubfolderSpec = 0; files = ( 9A20570F1F3B821A00F6C293 /* test-dwarf.cpp in CopyFiles */, + 22DC561A20064C9700A7E9E8 /* Environment.cpp in CopyFiles */, 9A2057101F3B821A00F6C293 /* test-dwarf.exe in CopyFiles */, AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */, ); @@ -1268,6 +1270,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 22DC561920064C9600A7E9E8 /* Environment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Environment.cpp; path = source/Utility/Environment.cpp; sourceTree = ""; }; 23042D101976CA0A00621B2C /* PlatformKalimba.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformKalimba.cpp; sourceTree = ""; }; 23042D111976CA0A00621B2C /* PlatformKalimba.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformKalimba.h; sourceTree = ""; }; 23059A0519532B96007B8189 /* LinuxSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LinuxSignals.cpp; path = Utility/LinuxSignals.cpp; sourceTree = ""; }; @@ -4372,6 +4375,7 @@ 2682F168115ED9C800CCFF99 /* Utility */ = { isa = PBXGroup; children = ( + 22DC561920064C9600A7E9E8 /* Environment.cpp */, AF6CA6651FBBAF27005A0DC3 /* ArchSpec.cpp */, AF6CA6671FBBAF37005A0DC3 /* ArchSpec.h */, 26BC7D5710F1B77400F91463 /* Connection.h */, ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] Fix for PR25300
Hi, I decided to take a quick look at PR25300 (roughly, an '*' at the end of an environment variable crashes lldb-server). The issue is that during packet decompression (apparently even for uncompressed packets) there is basic RLE, triggered by '*', so it needs to be quoted in some way before being sent. I came up with patches doing it in two different places (both attached here): 1. Switch to QEnvironmentHexEncoded if the string has these chars. 2. Safely escape these chars in SendPackedNoLock. The second seems more robust and semantically correct (viewing only '$' and '#' as characters that are actually special in a non transport-dependent way). But it does have a performance overhead for each packet sent (a likely not very optimised extra strcpy). Which would be preferred, and does anyone have any hints on writing a test for it? I can't see any existing QEnvironment tests to base mine on. Cheers. Tim. diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index ea95298..9392af7 100644 --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -238,12 +238,29 @@ GDBRemoteCommunication::SendPacketNoLock (const char *payload, size_t payload_le { if (IsConnected()) { -StreamString packet(0, 4, eByteOrderBig); +std::string safe_payload; +safe_payload.reserve(payload_length); +for (const char *c = payload; c != payload + payload_length; ++c) +{ +if (*c == '*' || *c == '}') +{ +// These have special meaning even for nominally uncompressed +// strings, so we must escape them. Fortunately, the special +// meaning of '}' is precisely an escape of the next char (^ +// 0x20). +safe_payload.push_back('}'); +safe_payload.push_back(*c ^ 0x20); +} +else +safe_payload.push_back(*c); +} +payload_length = safe_payload.size(); +StreamString packet(0, 4, eByteOrderBig); packet.PutChar('$'); -packet.Write (payload, payload_length); +packet.Write (safe_payload.data(), payload_length); packet.PutChar('#'); -packet.PutHex8(CalculcateChecksum (payload, payload_length)); +packet.PutHex8(CalculcateChecksum (safe_payload.data(), payload_length)); Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS)); ConnectionStatus status = eConnectionStatusSuccess; diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index a6fcd14..5e0964b 100644 --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1577,6 +1577,8 @@ GDBRemoteCommunicationClient::SendEnvironmentPacket (char const *name_equal_valu { case '$': case '#': +case '*': +case '}': send_hex_encoding = true; break; default: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252521 - Avoid sending bare '*' and '}' in an lldb-server packet
Author: tnorthover Date: Mon Nov 9 16:05:05 2015 New Revision: 252521 URL: http://llvm.org/viewvc/llvm-project?rev=252521&view=rev Log: Avoid sending bare '*' and '}' in an lldb-server packet They get treated as special RLE encoding symbols and packets get corrupted. Most other packet types already know about this apparently, but QEnvironment missed these two. Should fix PR25300. Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/print_env.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py?rev=252521&r1=252520&r2=252521&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py Mon Nov 9 16:05:05 2015 @@ -178,3 +178,24 @@ class ProcessLaunchTestCase(TestBase): if not success: self.fail(err_msg) + +def test_environment_with_special_char (self): +"""Test that environment variables containing '*' and '}' are communicated correctly to the lldb-server.""" +d = {'CXX_SOURCES' : 'print_env.cpp'} +self.build(dictionary=d) +self.setTearDownCleanup(d) +exe = os.path.join (os.getcwd(), "a.out") + +evil_var = 'INIT*MIDDLE}TAIL' + +target = self.dbg.CreateTarget(exe) +process = target.LaunchSimple(None, ['EVIL=' + evil_var], self.get_process_working_directory()) +self.assertEqual(process.GetState(), lldb.eStateExited, PROCESS_EXITED) + +out = process.GetSTDOUT(len(evil_var))[:len(evil_var)] +if out != evil_var: +self.fail('The environment variable was mis-coded: %s\n' % repr(out)) + +newline = process.GetSTDOUT(1)[0] +if newline != '\r' and newline != '\n': +self.fail('Garbage at end of environment variable') Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/print_env.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/print_env.cpp?rev=252521&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/print_env.cpp (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/print_env.cpp Mon Nov 9 16:05:05 2015 @@ -0,0 +1,11 @@ +#include +#include +#include + +int main (int argc, char **argv) +{ + char *evil = getenv("EVIL"); + puts(evil); + + return 0; +} Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=252521&r1=252520&r2=252521&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Mon Nov 9 16:05:05 2015 @@ -1584,6 +1584,7 @@ GDBRemoteCommunicationClient::SendEnviro case '$': case '#': case '*': +case '}': send_hex_encoding = true; break; default: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Fix for PR25300
On 3 November 2015 at 07:38, Pavel Labath wrote: > Looks good, but I'd like to avoid adding new "not remote ready" tests > to the test suite. Your test looks like it should be easy to fix -- > the only problem there is the stdout redirection. If you *don't* > redirect the output, you should be able to access the stdout via > self.process.GetSTDOUT() and verify that. Thanks Pavel, that made the test quite a bit simpler. I've committed it in r252521. Tim. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D22463: [RFC] Moving to GitHub Proposal: NOT DECISION!
>> Can't handle the update of the umbrella *because of GitHub*, this could be >> possible with our own hosting of git for instance. >> > Pre-commit hooks are not designed to update the umbrella. Webhooks will be > able to update the umbrella with a small external service, as proposed in the > IRC. I think we could emulate any pre-commit hook we like via GitHub WebHooks by having two repositories: llvm and llvm-staging (say). People push to llvm-staging, which notifies some LLVM server we own. That does basic sanity checks and pushes to llvm proper if passed. It has disadvantages (no instant "success" feedback being the obvious one), but would allow us to vet commits with relatively little overhead (as James says, running a server responding to webhooks is a very different proposition from one hammered by hundreds of developers daily). I'm not strongly in favour of this, just thought I'd mention it as a possibility. Tim. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits