[Lldb-commits] [lldb] r280652 - Add default_packet_timeout key to the new TestGdbRemoteHostInfo test
Author: labath Date: Mon Sep 5 03:34:56 2016 New Revision: 280652 URL: http://llvm.org/viewvc/llvm-project?rev=280652&view=rev Log: Add default_packet_timeout key to the new TestGdbRemoteHostInfo test android targets use this key, so the test should recognize it. Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/host-info/TestGdbRemoteHostInfo.py Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/host-info/TestGdbRemoteHostInfo.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/host-info/TestGdbRemoteHostInfo.py?rev=280652&r1=280651&r2=280652&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/host-info/TestGdbRemoteHostInfo.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/host-info/TestGdbRemoteHostInfo.py Mon Sep 5 03:34:56 2016 @@ -26,7 +26,8 @@ class TestGdbRemoteHostInfo(GdbRemoteTes "ptrsize", "triple", "vendor", -"watchpoint_exceptions_received" +"watchpoint_exceptions_received", +"default_packet_timeout", ]) DARWIN_REQUIRED_HOST_INFO_KEYS = set([ ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24187: Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
labath added a comment. Thanks for the patch. The changes seem pretty straight-forward. I'd just like to sort out some issues in the new test first. Comment at: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py:27 @@ +26,3 @@ + +@skipIfiOSSimulator +@skipIf(compiler="clang") Do we really need the ios simulator decorator here? Comment at: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py:29 @@ +28,3 @@ +@skipIf(compiler="clang") +@expectedFailureAll(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) +@skipIf(archs=no_match(['amd64', 'i386', 'x86_64'])) I presume this is XFAIL because the compiler does not have the required features. If that is true then a "skip" result would be more appropriate. Comment at: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py:30 @@ +29,3 @@ +@expectedFailureAll(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) +@skipIf(archs=no_match(['amd64', 'i386', 'x86_64'])) +def test_mpx_registers_with_example_code(self): It shouldn't be necessary to specify `amd64` here. I know some old code does that, but now we have code in `lldbtest.py` which automatically remaps it to `x86_64`. Comment at: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py:43 @@ +42,3 @@ + +self.runCmd('settings set target.inline-breakpoint-strategy always') +self.addTearDownHook( Why is this necessary? (Also it looks like your cleanup function is the same as the setup) Comment at: packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py:50 @@ +49,3 @@ + +self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT, +substrs = ["stop reason = breakpoint 1."]) So, this test will fail if run on hardware which does not have the registers you are testing now (as far as I can tell, that's pretty much all of it). We should detect that situation (the inferior already has code for that, apparently), and skip the test. Something like: ``` if inferior_exited_with_minus_1: self.skipTest("blah blah") ``` https://reviews.llvm.org/D24187 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20041: File path comparisons should be case-insensitive on OS X
labath added a subscriber: labath. labath added a comment. Comment at: include/lldb/Host/FileSpec.h:712 @@ +711,3 @@ + PathSyntax syntax = ePathSyntaxHostNative, + llvm::Triple *triple = nullptr); + I don't think the default-null parameter here is a good idea. This means some of your file-specs will be case-sensitive and some will not (depending on whether the the person who created the FileSpec remembered to pass in the triple). If it were up to me, I wouldn't even make case-sensitivity a property of the file spec. I think it should be a property of the comparison between them. Otherwise, what are you going to do when someone asks you to compare a case-insensitive "/foo/bar" with a case-sensitive "/Foo/Bar" ? https://reviews.llvm.org/D20041 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20041: File path comparisons should be case-insensitive on OS X
stigger added inline comments. Comment at: include/lldb/Host/FileSpec.h:712 @@ +711,3 @@ + PathSyntax syntax = ePathSyntaxHostNative, + llvm::Triple *triple = nullptr); + labath wrote: > I don't think the default-null parameter here is a good idea. This means some > of your file-specs will be case-sensitive and some will not (depending on > whether the the person who created the FileSpec remembered to pass in the > triple). > > If it were up to me, I wouldn't even make case-sensitivity a property of the > file spec. I think it should be a property of the comparison between them. > Otherwise, what are you going to do when someone asks you to compare a > case-insensitive "/foo/bar" with a case-sensitive "/Foo/Bar" ? If we get rid of `PathSyntax`, then default-null is going to be an equivalent of `ePathSyntaxHostNative`, meaning "use host triple". > Otherwise, what are you going to do when someone asks you to compare a > case-insensitive "/foo/bar" with a case-sensitive "/Foo/Bar" ? That's already handled in `FileSpec::Equal` and `FileSpec::Compare`: the comparison is case-insensitive only when both operands are case-insensitive. https://reviews.llvm.org/D20041 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D23882: Replace uses of MIUtilParse::CRegexParser with llvm::Regex
labath added a comment. Tests run clean when I apply this locally. Do you want me to put that in for you? https://reviews.llvm.org/D23882 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D23882: Replace uses of MIUtilParse::CRegexParser with llvm::Regex
mgorny added a comment. In https://reviews.llvm.org/D23882#534038, @labath wrote: > Tests run clean when I apply this locally. Do you want me to put that in for > you? I'd appreciate that. Thanks a lot! https://reviews.llvm.org/D23882 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D24236: gdb-remote: Add jModulesInfo packet
labath created this revision. labath added a reviewer: clayborg. labath added a subscriber: lldb-commits. Herald added subscribers: danalbert, tberghammer. This adds the jModulesInfo packet, which is the equivalent of qModulesInfo, but it enables us to query multiple modules at once. This makes a significant speed improvement in case the application has many (over a hundred) modules, and the communication link has a non-negligible latency. This functionality is accessed by ProcessGdbRemote::PrefetchModuleSpecs(), which does the caching. GetModuleSpecs() is modified to first consult the cache before asking the remote stub. PrefetchModuleSpecs is currently only called from POSIX-DYLD dynamic loader plugin, after it reads the list of modules from the inferior memory, but other uses are possible. This decreases the attach time to an android application by about 40%. https://reviews.llvm.org/D24236 Files: docs/lldb-gdb-remote.txt include/lldb/Target/Process.h packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp source/Plugins/Process/gdb-remote/ProcessGDBRemote.h source/Utility/StringExtractorGDBRemote.cpp source/Utility/StringExtractorGDBRemote.h unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp Index: unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp === --- unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp +++ unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp @@ -19,6 +19,7 @@ #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h" #include "lldb/Core/DataBuffer.h" +#include "lldb/Core/ModuleSpec.h" #include "llvm/ADT/ArrayRef.h" @@ -182,3 +183,75 @@ HandlePacket(server, "QSyncThreadState:0047;", "OK"); ASSERT_TRUE(async_result.get()); } + +TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) +{ +TestClient client; +MockServer server; +Connect(client, server); +if (HasFailure()) +return; + +llvm::Triple triple("i386-pc-linux"); + +// Empty list of module specs should not send any packets +ASSERT_TRUE(client.GetModulesInfo({}, triple).empty()); + +FileSpec file_specs[] = { FileSpec("/foo/bar.so", false), FileSpec("/foo/baz.so", false) }; +std::future> async_result = +std::async(std::launch::async, [&] { return client.GetModulesInfo(file_specs, triple); }); +HandlePacket(server, "jModulesInfo:[" + R"({"file":"/foo/bar.so","triple":"i386-pc-linux"},)" + R"({"file":"/foo/baz.so","triple":"i386-pc-linux"}])", + R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)" + R"("file_path":"/foo/bar.so","file_offset":0,"file_size":1234}]])"); + +std::vector result = async_result.get(); +ASSERT_EQ(1u, result.size()); +EXPECT_EQ("/foo/bar.so", result[0].GetFileSpec().GetPath()); +EXPECT_EQ(triple, result[0].GetArchitecture().GetTriple()); +EXPECT_EQ(UUID("@ABCDEFGHIJKLMNO", 16), result[0].GetUUID()); +EXPECT_EQ(0u, result[0].GetObjectOffset()); +EXPECT_EQ(1234u, result[0].GetObjectSize()); +} + +TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfoInvalidResponse) +{ +TestClient client; +MockServer server; +Connect(client, server); +if (HasFailure()) +return; + +llvm::Triple triple("i386-pc-linux"); +FileSpec file_spec("/foo/bar.so", false); + +const char *invalid_responses[] = { +"OK", "E47", "[]", "[{}]]", +// no UUID +R"([{"triple":"i386-pc-linux",)" +R"("file_path":"/foo/bar.so","file_offset":0,"file_size":1234}])", +// no triple +R"([{"uuid":"404142434445464748494a4b4c4d4e4f",)" +R"("file_path":"/foo/bar.so","file_offset":0,"file_size":1234}])", +// no file_path +R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)" +R"("file_offset":0,"file_size":1234}])", +// no file_offset +R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)" +R"("file_path":"/foo/bar.so","file_size":1234}])", +// no file_size +R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)" +R"("file_path":"/foo/bar.so","file_offset":0}])", +}; + +for(const char *response: invalid_responses) +{ +std::future> async_result = +std::async(std::launch::async, [&] { return client.GetModulesInfo(file_spec, triple);
Re: [Lldb-commits] [PATCH] D22914: [WIP] Add concurrent packets support to gdb-remote client
labath abandoned this revision. labath added a comment. I am abandoning this for the time being in favour of https://reviews.llvm.org/D24236. The actual implementation of it turned out to be more hackish then I anticipated. https://reviews.llvm.org/D22914 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16128: Fix TestProcessLaunch.test_environment_with_special_char for Python 3
labath added a comment. There has been no activity here for 6 months. Shall we close it? https://reviews.llvm.org/D16128 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r280662 - Replace uses of MIUtilParse::CRegexParser with llvm::Regex
Author: labath Date: Mon Sep 5 10:15:12 2016 New Revision: 280662 URL: http://llvm.org/viewvc/llvm-project?rev=280662&view=rev Log: Replace uses of MIUtilParse::CRegexParser with llvm::Regex Summary: Replace uses of the local MIUtilParse::CRegexParser class with the LLVM support class llvm::Regex. This reduces duplication of code, and makes it possible to remove the MIUtilParse::CRegexParser class that requires LLVM internal implementation headers. Bug: https://llvm.org/bugs/show_bug.cgi?id=29138 Reviewers: dawn, abidh, ki.stfu Subscribers: labath, ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D23882 Author: Michał Górny Modified: lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp Modified: lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp?rev=280662&r1=280661&r2=280662&view=diff == --- lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp Mon Sep 5 10:15:12 2016 @@ -25,6 +25,9 @@ #include "lldb/API/SBInstruction.h" #include "lldb/API/SBInstructionList.h" #include "lldb/API/SBStream.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/Regex.h" // In-house headers: #include "MICmdCmdData.h" @@ -42,7 +45,6 @@ #include "MICmdArgValConsume.h" #include "MICmnLLDBDebugSessionInfoVarObj.h" #include "MICmnLLDBUtilSBValue.h" -#include "MIUtilParse.h" //++ // Details: CMICmdCmdDataEvaluateExpression constructor. @@ -1651,24 +1653,24 @@ ParseLLDBLineEntry(const char *input, CM // is remains is assumed to be the filename. // Match LineEntry using regex. -static MIUtilParse::CRegexParser g_lineentry_nocol_regex( -"^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"); -static MIUtilParse::CRegexParser g_lineentry_col_regex( -"^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$"); -//^1=start ^2=end ^3=f ^4=line ^5=:col(opt) +static llvm::Regex g_lineentry_nocol_regex( +llvm::StringRef("^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$")); +static llvm::Regex g_lineentry_col_regex( +llvm::StringRef("^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$")); +//^1=start ^2=end ^3=f ^4=line ^5=:col(opt) -MIUtilParse::CRegexParser::Match match(6); +llvm::SmallVector match; // First try matching the LineEntry with the column, // then try without the column. -const bool ok = g_lineentry_col_regex.Execute(input, match) || -g_lineentry_nocol_regex.Execute(input, match); +const bool ok = g_lineentry_col_regex.match(input, &match) || +g_lineentry_nocol_regex.match(input, &match); if (ok) { -start = match.GetMatchAtIndex(1); -end = match.GetMatchAtIndex(2); -file = match.GetMatchAtIndex(3); -line = match.GetMatchAtIndex(4); +start = match[1]; +end = match[2]; +file = match[3]; +line = match[4]; } return ok; } Modified: lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp?rev=280662&r1=280661&r2=280662&view=diff == --- lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp Mon Sep 5 10:15:12 2016 @@ -11,6 +11,9 @@ // Third Party Headers: #include "lldb/API/SBCommandInterpreter.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/Regex.h" // In-house headers: #include "MICmdArgValFile.h" @@ -19,7 +22,6 @@ #include "MICmnMIResultRecord.h" #include "MICmnMIValueList.h" #include "MICmnMIValueTuple.h" -#include "MIUtilParse.h" //++ // Details: CMICmdCmdSymbolListLines constructor. @@ -105,15 +107,15 @@ static bool ParseLLDBLineAddressHeader(const char *input, CMIUtilString &file) { // Match LineEntry using regex. -static MIUtilParse::CRegexParser g_lineentry_header_regex( -"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$"); -// ^1=file ^2=cu^3=module +static llvm::Regex g_lineentry_header_regex( +llvm::StringRef("^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$")); +// ^1=file ^2=cu^3=modu
Re: [Lldb-commits] [PATCH] D23882: Replace uses of MIUtilParse::CRegexParser with llvm::Regex
labath closed this revision. labath added a comment. r280662 https://reviews.llvm.org/D23882 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20041: File path comparisons should be case-insensitive on OS X
Assert probably On Mon, Sep 5, 2016 at 4:04 AM Pavel Labath wrote: > labath added a subscriber: labath. > labath added a comment. > > > > > > Comment at: include/lldb/Host/FileSpec.h:712 > @@ +711,3 @@ > + PathSyntax syntax = ePathSyntaxHostNative, > + llvm::Triple *triple = nullptr); > + > > I don't think the default-null parameter here is a good idea. This means > some of your file-specs will be case-sensitive and some will not (depending > on whether the the person who created the FileSpec remembered to pass in > the triple). > > If it were up to me, I wouldn't even make case-sensitivity a property of > the file spec. I think it should be a property of the comparison between > them. Otherwise, what are you going to do when someone asks you to compare > a case-insensitive "/foo/bar" with a case-sensitive "/Foo/Bar" ? > > > https://reviews.llvm.org/D20041 > > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D23882: Replace uses of MIUtilParse::CRegexParser with llvm::Regex
BTW, what tests are failing for you now? I bet they failures are caused by one of two things: - unexpected compiler, for which we don't have the correct @xfail annotations: the annotations are correct for gcc-4.8, gcc-4.9, clang-3.5, clang-3.6 and ToT clang. If you have a different compiler, they could be wrong, in which case we can fix them. - environment setup problems, probably a missing package (libstdc++-dev ?, I forget whether it is needed these days). We can at least add these to the web page. If you send me a list of failures, I can try to take a look what is going on. pl On 2 September 2016 at 22:09, Michał Górny wrote: > mgorny added a comment. > > In https://reviews.llvm.org/D23882#527682, @ki.stfu wrote: > >> lgtm if tests are passed > > > I can't say tests pass for me right now, but the results (failures, errors > and unexpected passes) are the same with and without the patch. > > > https://reviews.llvm.org/D23882 > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24187: Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
This revision was automatically updated to reflect the committed changes. Closed by commit rL280668: Intel(R) Memory Protection Extensions (Intel(R) MPX) support. (authored by valentinagiusti). Changed prior to commit: https://reviews.llvm.org/D24187?vs=70152&id=70342#toc Repository: rL LLVM https://reviews.llvm.org/D24187 Files: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/a.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/a.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/main.cpp lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_i386.h lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h lldb/trunk/source/Plugins/Process/Utility/lldb-x86-register-enums.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/main.cpp === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/main.cpp +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/main.cpp @@ -0,0 +1,36 @@ +//===-- main.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// +#include + +#include +#include + +long double outermost_return_long_double (long double my_long_double); + +int main (int argc, char const *argv[]) +{ +lldb_enable_attach(); + +char my_string[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 0}; +double my_double = 1234.5678; +long double my_long_double = 1234.5678; + +// For simplicity assume that any cmdline argument means wait for attach. +if (argc > 1) +{ +volatile int wait_for_attach=1; +while (wait_for_attach) +std::this_thread::sleep_for(std::chrono::microseconds(1)); +} + +printf("my_string=%s\n", my_string); +printf("my_double=%g\n", my_double); +outermost_return_long_double (my_long_double); +return 0; +} Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/a.cpp === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/a.cpp +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/a.cpp @@ -0,0 +1,44 @@ +//===-- a.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// +#include + +long double +return_long_double (long double value) +{ +#if defined (__i386__) || defined (__x86_64__) +float a=2, b=4,c=8, d=16, e=32, f=64, k=128, l=256, add=0; +__asm__ ( +"int3 ;" +"flds %1 ;" +"flds %2 ;" +"flds %3 ;" +"flds %4 ;" +"flds %5 ;" +"flds %6 ;" +"flds %7 ;" +"faddp ;" : "=g" (add) : "g" (a), "g" (b), "g" (c), "g" (d), "g" (e), "g" (f), "g" (k), "g" (l) ); // Set break point at this line. +#endif// #if defined (__i386__) || defined (__x86_64__) +return value; +} + +long double +outer_return_long_double (long double value) +{ +long double val = return_long_double(value); +val *= 2 ; +return val; +} + +lo
[Lldb-commits] [lldb] r280668 - Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
Author: valentinagiusti Date: Mon Sep 5 12:43:10 2016 New Revision: 280668 URL: http://llvm.org/viewvc/llvm-project?rev=280668&view=rev Log: Intel(R) Memory Protection Extensions (Intel(R) MPX) support. Summary: The Intel(R) Memory Protection Extensions (Intel(R) MPX) associates pointers to bounds, against which the software can check memory references to prevent out of bound memory access. This patch allows accessing the MPX registers: * bnd0-3: 128-bit registers to hold the bound values, * bndcfgu, bndstatus: 64-bit configuration registers, This patch also adds read/write tests for the MPX registers in the register command tests and adds a new subdirectory for MPX specific tests. Signed-off-by: Valentina Giusti Reviewers: labath, granata.enrico, lldb-commits, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24187 Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/Makefile - copied, changed from r280662, lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py - copied, changed from r280662, lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/a.cpp - copied, changed from r280662, lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/a.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/main.cpp - copied, changed from r280662, lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/main.cpp Removed: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/a.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/main.cpp Modified: lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_i386.h lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h lldb/trunk/source/Plugins/Process/Utility/lldb-x86-register-enums.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Removed: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/Makefile?rev=280667&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/Makefile (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/Makefile (removed) @@ -1,5 +0,0 @@ -LEVEL = ../../make - -CXX_SOURCES := main.cpp a.cpp - -include $(LEVEL)/Makefile.rules Removed: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py?rev=280667&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py (removed) @@ -1,350 +0,0 @@ -""" -Test the 'register' command. -""" - -from __future__ import print_function - - - -import os, sys, time -import re -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - -class RegisterCommandsTestCase(TestBase): - -mydir = TestBase.compute_mydir(__file__) - -def setUp(self): -TestBase.setUp(self) -self.has_teardown = False - -def tearDown(self): -self.dbg.GetSelectedTarget().GetProcess().Destroy() -TestBase.te
[Lldb-commits] [lldb] r280675 - remove dependence of TestGdbRemoteExitCode.py on parent directory source
Author: tfiala Date: Mon Sep 5 17:03:02 2016 New Revision: 280675 URL: http://llvm.org/viewvc/llvm-project?rev=280675&view=rev Log: remove dependence of TestGdbRemoteExitCode.py on parent directory source As Pavel pointed out in a comment on llvm.org/pr30271, the VPATH I was using here to eliminate duplication of a .cpp file had a side effect of attempting to pull in a .o/.obj file from that same parent dir, where other tests can be running in parallel. This is no good. For now, I have removed the VPATH, which should address llvm.org/pr30271. I have also removed the XFAIL. Added: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/TestGdbRemoteExitCode.py Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile?rev=280675&r1=280674&r2=280675&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile Mon Sep 5 17:03:02 2016 @@ -1,7 +1,5 @@ LEVEL = ../../../make -VPATH = .. - override CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS ENABLE_THREADS := YES CXX_SOURCES := main.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/TestGdbRemoteExitCode.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/TestGdbRemoteExitCode.py?rev=280675&r1=280674&r2=280675&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/TestGdbRemoteExitCode.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/TestGdbRemoteExitCode.py Mon Sep 5 17:03:02 2016 @@ -59,7 +59,6 @@ class TestGdbRemoteExitCode(GdbRemoteTes self.start_inferior() @llgs_test -@expectedFailureAll(bugnumber="llvm.org/pr30271") def test_start_inferior_llgs(self): self.init_llgs_test() self.build() @@ -119,7 +118,6 @@ class TestGdbRemoteExitCode(GdbRemoteTes self.inferior_exit_42() @llgs_test -@expectedFailureAll(bugnumber="llvm.org/pr30271") def test_inferior_exit_42_llgs(self): self.init_llgs_test() self.build() Added: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp?rev=280675&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp (added) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp Mon Sep 5 17:03:02 2016 @@ -0,0 +1,391 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__APPLE__) +__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2) +int pthread_threadid_np(pthread_t,__uint64_t*); +#elif defined(__linux__) +#include +#endif + +static const char *const RETVAL_PREFIX = "retval:"; +static const char *const SLEEP_PREFIX= "sleep:"; +static const char *const STDERR_PREFIX = "stderr:"; +static const char *const SET_MESSAGE_PREFIX = "set-message:"; +static const char *const PRINT_MESSAGE_COMMAND = "print-message:"; +static const char *const GET_DATA_ADDRESS_PREFIX = "get-data-address-hex:"; +static const char *const GET_STACK_ADDRESS_COMMAND = "get-stack-address-hex:"; +static const char *const GET_HEAP_ADDRESS_COMMAND= "get-heap-address-hex:"; + +static const char *const GET_CODE_ADDRESS_PREFIX = "get-code-address-hex:"; +static const char *const CALL_FUNCTION_PREFIX= "call-function:"; + +static const char *const THREAD_PREFIX = "thread:"; +static const char *const THREAD_COMMAND_NEW = "new"; +static const char *const THREAD_COMMAND_PRINT_IDS = "print-ids"; +static const char *const THREAD_COMMAND_SEGFAULT = "segfault"; + +static bool g_print_thread_ids = false; +static pthread_mutex_t g_print_mutex = PTHREAD_MUTEX_INITIALIZER; +static bool g_threads_do_segfault = false; + +static pthread_mutex_t g_jump_buffer_mutex = PTHREAD_MUTEX_INITIALIZER; +static jmp_buf g_jump_buffer; +static bool g_is_segfaulting = false; + +static char g_message[256]; + +static volatile char g_c1 = '0'; +static volatile char g_c2 = '1'; + +static void +print_thread_id () +{ + /
Re: [Lldb-commits] [lldb] r280652 - Add default_packet_timeout key to the new TestGdbRemoteHostInfo test
Thanks, Pavel! I grepped around the code for all the keys used, but looks like I missed that one. Thanks for addressing. -Todd On Mon, Sep 5, 2016 at 1:34 AM, Pavel Labath via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: labath > Date: Mon Sep 5 03:34:56 2016 > New Revision: 280652 > > URL: http://llvm.org/viewvc/llvm-project?rev=280652&view=rev > Log: > Add default_packet_timeout key to the new TestGdbRemoteHostInfo test > > android targets use this key, so the test should recognize it. > > Modified: > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/host-info/ > TestGdbRemoteHostInfo.py > > Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb- > server/host-info/TestGdbRemoteHostInfo.py > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/ > Python/lldbsuite/test/tools/lldb-server/host-info/ > TestGdbRemoteHostInfo.py?rev=280652&r1=280651&r2=280652&view=diff > > == > --- > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/host-info/TestGdbRemoteHostInfo.py > (original) > +++ > lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/host-info/TestGdbRemoteHostInfo.py > Mon Sep 5 03:34:56 2016 > @@ -26,7 +26,8 @@ class TestGdbRemoteHostInfo(GdbRemoteTes > "ptrsize", > "triple", > "vendor", > -"watchpoint_exceptions_received" > +"watchpoint_exceptions_received", > +"default_packet_timeout", > ]) > > DARWIN_REQUIRED_HOST_INFO_KEYS = set([ > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > -- -Todd ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r280692 - Added the "frame diagnose" command and use its output to make crash info better.
Author: spyffe Date: Mon Sep 5 23:48:36 2016 New Revision: 280692 URL: http://llvm.org/viewvc/llvm-project?rev=280692&view=rev Log: Added the "frame diagnose" command and use its output to make crash info better. When a process stops due to a crash, we get the crashing instruction and the crashing memory location (if there is one). From the user's perspective it is often unclear what the reason for the crash is in a symbolic sense. To address this, I have added new fuctionality to StackFrame to parse the disassembly and reconstruct the sequence of dereferneces and offsets that were applied to a known variable (or fuction retrn value) to obtain the invalid pointer. This makes use of enhancements in the disassembler, as well as new information provided by the DWARF expression infrastructure, and is exposed through a "frame diagnose" command. It is also used to provide symbolic information, when available, in the event of a crash. The algorithm is very rudimentary, and it needs a bunch of work, including - better parsing for assembly, preferably with help from LLVM - support for non-Apple platforms - cleanup of the algorithm core, preferably to make it all work in terms of Operands instead of register/offset pairs - improvement of the GetExpressioPath() logic to make prettier expression paths, and - better handling of vtables. I welcome all suggestios, improvements, and testcases. Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/main.c lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/main.c lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/main.c lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/main.c lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/main.c lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-