Re: [Lldb-commits] [PATCH] D20565: Add MemoryRegionInfo to SB API
hhellyer marked 12 inline comments as done. hhellyer added a comment. http://reviews.llvm.org/D20565 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20565: Add MemoryRegionInfo to SB API
hhellyer updated this revision to Diff 61253. hhellyer added a comment. Updating to ensure I have the latest changes. http://reviews.llvm.org/D20565 Files: include/lldb/API/LLDB.h include/lldb/API/SBDefines.h include/lldb/API/SBMemoryRegionInfo.h include/lldb/API/SBMemoryRegionInfoList.h include/lldb/API/SBProcess.h include/lldb/API/SBStream.h include/lldb/Target/MemoryRegionInfo.h include/lldb/Target/Process.h include/lldb/lldb-forward.h source/API/CMakeLists.txt source/API/SBMemoryRegionInfo.cpp source/API/SBMemoryRegionInfoList.cpp source/API/SBProcess.cpp Index: source/API/SBProcess.cpp === --- source/API/SBProcess.cpp +++ source/API/SBProcess.cpp @@ -23,6 +23,7 @@ #include "lldb/Core/State.h" #include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" +#include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/SystemRuntime.h" @@ -36,6 +37,8 @@ #include "lldb/API/SBDebugger.h" #include "lldb/API/SBEvent.h" #include "lldb/API/SBFileSpec.h" +#include "lldb/API/SBMemoryRegionInfo.h" +#include "lldb/API/SBMemoryRegionInfoList.h" #include "lldb/API/SBThread.h" #include "lldb/API/SBThreadCollection.h" #include "lldb/API/SBStream.h" @@ -1476,3 +1479,74 @@ error.ref() = PluginManager::SaveCore(process_sp, core_file); return error; } + +lldb::SBError +SBProcess::GetMemoryRegionInfo (lldb::addr_t load_addr, SBMemoryRegionInfo &sb_region_info) +{ +lldb::SBError sb_error; +ProcessSP process_sp(GetSP()); +MemoryRegionInfoSP region_info_sp = std::make_shared(); +if (process_sp) +{ +Process::StopLocker stop_locker; +if (stop_locker.TryLock(&process_sp->GetRunLock())) +{ +std::lock_guard guard(process_sp->GetTarget().GetAPIMutex()); +sb_error.ref() = process_sp->GetMemoryRegionInfo(load_addr, *region_info_sp); +if( sb_error.Success() ) { +sb_region_info.ref() = *region_info_sp; +} +} +else +{ +Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); +if (log) +log->Printf ("SBProcess(%p)::GetMemoryRegionInfo() => error: process is running", + static_cast(process_sp.get())); +sb_error.SetErrorString("process is running"); +} +} +else +{ +sb_error.SetErrorString ("SBProcess is invalid"); +} +return sb_error; +} + +lldb::SBMemoryRegionInfoList +SBProcess::GetMemoryRegions() +{ +lldb::SBError sb_error; +lldb::SBMemoryRegionInfoList sb_region_list; +ProcessSP process_sp(GetSP()); +if (process_sp) +{ +Process::StopLocker stop_locker; +if (stop_locker.TryLock(&process_sp->GetRunLock())) +{ +std::lock_guard guard(process_sp->GetTarget().GetAPIMutex()); +std::vector region_list; +sb_error.ref() = process_sp->GetMemoryRegions(region_list); +if( sb_error.Success() ) { +std::vector::iterator end = region_list.end(); +for( std::vector::iterator it = region_list.begin(); it != end; it++ ) { +SBMemoryRegionInfo sb_region_info(it->get()); +sb_region_list.Append(sb_region_info); +} +} +} +else +{ +Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); +if (log) +log->Printf ("SBProcess(%p)::GetMemoryRegionInfo() => error: process is running", + static_cast(process_sp.get())); +sb_error.SetErrorString("process is running"); +} +} +else +{ +sb_error.SetErrorString ("SBProcess is invalid"); +} +return sb_region_list; +} Index: source/API/SBMemoryRegionInfoList.cpp === --- /dev/null +++ source/API/SBMemoryRegionInfoList.cpp @@ -0,0 +1,162 @@ +//===-- SBMemoryRegionInfoList.cpp --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#include "lldb/API/SBMemoryRegionInfo.h" +#include "lldb/API/SBMemoryRegionInfoList.h" +#include "lldb/API/SBStream.h" +#include "lldb/Core/Log.h" +#include "lldb/Target/MemoryRegionInfo.h" + +#include + +using namespace lldb; +using namespace lldb_private; + +class MemoryRegionInfoListImpl +{ +public: +MemoryRegionInfoListImpl () : +m_regions() +{ +} + +MemoryRegionInfoListImpl (const MemoryRegionInfoListImpl& rhs) : +m_regions(rhs.m_regions) +{ +} + +MemoryRegionIn
Re: [Lldb-commits] [PATCH] D20565: Add MemoryRegionInfo to SB API
hhellyer added a comment. I re-updated the patch via arc diff (rather than a manual patch upload). Phabricator now seems to know which revision my changes are based off and has added the "Next Step: arc commit" status. Do I need to request an svn password to run arc commit or can you (or someone) else land this for me? http://reviews.llvm.org/D20565 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21516: Allow unaligned byte/word selection watchpoints for arm- linux/android targets.
tberghammer accepted this revision. tberghammer added a reviewer: tberghammer. tberghammer added a comment. This revision is now accepted and ready to land. Looks good http://reviews.llvm.org/D21516 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21164: Improve watchpoint error reporting specially for arm/aarch64 targets
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Seems like CheckIfWatchpointsExhausted() inside Target.cpp works for some targets, but not all of them. Seems like this functionality should be pushed down into RegisterContext to do this right. For now this is OK, but we should file a bug to track fixing this correctly so that multiple watchpoints can share a single hardware watchpoint when possible. Comment at: source/Target/Target.cpp:714 @@ -713,2 +713,3 @@ { uint32_t num_current_watchpoints = target->GetWatchpointList().GetSize(); +if (num_supported_hardware_watchpoints == 0) This logic isn't necessarily correct. If we have the ability to watch N bytes at a time with a single hardware watchpoint, we might have 1 hardware watchpoint that is able to watch multiple things. So for code like: ``` char buffer[8] = ...; ``` then we watch "buffer[1]" and "buffer[7]", we could actually have 2 watchpoints but only use 1 hardware watchpoint. We really should be allowing each process plug-in to try and set the watchpoint and return the correct error instead of generically trying to catch _anything_ at the target level. So it seems like this code should be removed and moved into RegisterContext and allow each register context plug-in to respond correctly as only the it will know what can be done. http://reviews.llvm.org/D21164 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r273211 - Test that lldb calls the right 'printf' even when a 'printf' method exists.
Author: spyffe Date: Mon Jun 20 18:01:11 2016 New Revision: 273211 URL: http://llvm.org/viewvc/llvm-project?rev=273211&view=rev Log: Test that lldb calls the right 'printf' even when a 'printf' method exists. This test is currently failing. We have a bug for it, as noted. Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/main.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py?rev=273211&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py Mon Jun 20 18:01:11 2016 @@ -0,0 +1,4 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(bugnumber="rdar://problem/24599697")] ) Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/main.cpp?rev=273211&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/main.cpp (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/main.cpp Mon Jun 20 18:01:11 2016 @@ -0,0 +1,21 @@ +//===-- main.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +class PrintfContainer { +public: +int printf() { +return 0; +} +}; + +int main() { +PrintfContainer().printf(); //% self.expect("expression -- printf(\"Hello\\n\")", substrs = ['6']) +return 0; +} + ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21422: Fix typo in eOpenOptionDontFollowSymlinks
This revision was automatically updated to reflect the committed changes. Closed by commit rL273225: Fix typo in eOpenOptionDontFollowSymlinks (authored by fjricci). Changed prior to commit: http://reviews.llvm.org/D21422?vs=60937&id=61325#toc Repository: rL LLVM http://reviews.llvm.org/D21422 Files: lldb/trunk/include/lldb/Host/File.h lldb/trunk/source/Host/common/File.cpp lldb/trunk/source/Target/Platform.cpp Index: lldb/trunk/source/Host/common/File.cpp === --- lldb/trunk/source/Host/common/File.cpp +++ lldb/trunk/source/Host/common/File.cpp @@ -238,7 +238,7 @@ oflag |= O_RDONLY; #ifndef _WIN32 -if (options & eOpenoptionDontFollowSymlinks) +if (options & eOpenOptionDontFollowSymlinks) oflag |= O_NOFOLLOW; #endif } Index: lldb/trunk/source/Target/Platform.cpp === --- lldb/trunk/source/Target/Platform.cpp +++ lldb/trunk/source/Target/Platform.cpp @@ -1431,7 +1431,7 @@ uint32_t source_open_options = File::eOpenOptionRead | File::eOpenOptionCloseOnExec; if (source.GetFileType() == FileSpec::eFileTypeSymbolicLink) -source_open_options |= File::eOpenoptionDontFollowSymlinks; +source_open_options |= File::eOpenOptionDontFollowSymlinks; File source_file(source, source_open_options, lldb::eFilePermissionsUserRW); Error error; Index: lldb/trunk/include/lldb/Host/File.h === --- lldb/trunk/include/lldb/Host/File.h +++ lldb/trunk/include/lldb/Host/File.h @@ -45,7 +45,7 @@ eOpenOptionNonBlocking = (1u << 4),// File reads eOpenOptionCanCreate= (1u << 5),// Create file if doesn't already exist eOpenOptionCanCreateNewOnly = (1u << 6),// Can create file only if it doesn't already exist -eOpenoptionDontFollowSymlinks = (1u << 7), +eOpenOptionDontFollowSymlinks = (1u << 7), eOpenOptionCloseOnExec = (1u << 8) // Close the file when executing a new process }; Index: lldb/trunk/source/Host/common/File.cpp === --- lldb/trunk/source/Host/common/File.cpp +++ lldb/trunk/source/Host/common/File.cpp @@ -238,7 +238,7 @@ oflag |= O_RDONLY; #ifndef _WIN32 -if (options & eOpenoptionDontFollowSymlinks) +if (options & eOpenOptionDontFollowSymlinks) oflag |= O_NOFOLLOW; #endif } Index: lldb/trunk/source/Target/Platform.cpp === --- lldb/trunk/source/Target/Platform.cpp +++ lldb/trunk/source/Target/Platform.cpp @@ -1431,7 +1431,7 @@ uint32_t source_open_options = File::eOpenOptionRead | File::eOpenOptionCloseOnExec; if (source.GetFileType() == FileSpec::eFileTypeSymbolicLink) -source_open_options |= File::eOpenoptionDontFollowSymlinks; +source_open_options |= File::eOpenOptionDontFollowSymlinks; File source_file(source, source_open_options, lldb::eFilePermissionsUserRW); Error error; Index: lldb/trunk/include/lldb/Host/File.h === --- lldb/trunk/include/lldb/Host/File.h +++ lldb/trunk/include/lldb/Host/File.h @@ -45,7 +45,7 @@ eOpenOptionNonBlocking = (1u << 4),// File reads eOpenOptionCanCreate= (1u << 5),// Create file if doesn't already exist eOpenOptionCanCreateNewOnly = (1u << 6),// Can create file only if it doesn't already exist -eOpenoptionDontFollowSymlinks = (1u << 7), +eOpenOptionDontFollowSymlinks = (1u << 7), eOpenOptionCloseOnExec = (1u << 8) // Close the file when executing a new process }; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r273225 - Fix typo in eOpenOptionDontFollowSymlinks
Author: fjricci Date: Mon Jun 20 19:03:57 2016 New Revision: 273225 URL: http://llvm.org/viewvc/llvm-project?rev=273225&view=rev Log: Fix typo in eOpenOptionDontFollowSymlinks Summary: Fix capitalization Reviewers: labath, sas, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D21422 Modified: lldb/trunk/include/lldb/Host/File.h lldb/trunk/source/Host/common/File.cpp lldb/trunk/source/Target/Platform.cpp Modified: lldb/trunk/include/lldb/Host/File.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/File.h?rev=273225&r1=273224&r2=273225&view=diff == --- lldb/trunk/include/lldb/Host/File.h (original) +++ lldb/trunk/include/lldb/Host/File.h Mon Jun 20 19:03:57 2016 @@ -45,7 +45,7 @@ public: eOpenOptionNonBlocking = (1u << 4),// File reads eOpenOptionCanCreate= (1u << 5),// Create file if doesn't already exist eOpenOptionCanCreateNewOnly = (1u << 6),// Can create file only if it doesn't already exist -eOpenoptionDontFollowSymlinks = (1u << 7), +eOpenOptionDontFollowSymlinks = (1u << 7), eOpenOptionCloseOnExec = (1u << 8) // Close the file when executing a new process }; Modified: lldb/trunk/source/Host/common/File.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/File.cpp?rev=273225&r1=273224&r2=273225&view=diff == --- lldb/trunk/source/Host/common/File.cpp (original) +++ lldb/trunk/source/Host/common/File.cpp Mon Jun 20 19:03:57 2016 @@ -238,7 +238,7 @@ File::Open (const char *path, uint32_t o oflag |= O_RDONLY; #ifndef _WIN32 -if (options & eOpenoptionDontFollowSymlinks) +if (options & eOpenOptionDontFollowSymlinks) oflag |= O_NOFOLLOW; #endif } Modified: lldb/trunk/source/Target/Platform.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=273225&r1=273224&r2=273225&view=diff == --- lldb/trunk/source/Target/Platform.cpp (original) +++ lldb/trunk/source/Target/Platform.cpp Mon Jun 20 19:03:57 2016 @@ -1431,7 +1431,7 @@ Platform::PutFile (const FileSpec& sourc uint32_t source_open_options = File::eOpenOptionRead | File::eOpenOptionCloseOnExec; if (source.GetFileType() == FileSpec::eFileTypeSymbolicLink) -source_open_options |= File::eOpenoptionDontFollowSymlinks; +source_open_options |= File::eOpenOptionDontFollowSymlinks; File source_file(source, source_open_options, lldb::eFilePermissionsUserRW); Error error; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21221: Fix for PrintStackTraces
clayborg resigned from this revision. clayborg removed a reviewer: clayborg. clayborg added a comment. Jason Molenda should be able to adequately review any patches. If he is OK, then I am OK. http://reviews.llvm.org/D21221 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21328: [lldb] Fixed incorrect endianness when evaluating certain expressions
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Sean Callanan needs to OK this as well. http://reviews.llvm.org/D21328 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D17856: Fix expression evaluation with operator new
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. I am OK if Sean is OK with this. http://reviews.llvm.org/D17856 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r273236 - Change the "debugserver-mini" target (a version of debugserver
Author: jmolenda Date: Mon Jun 20 22:39:39 2016 New Revision: 273236 URL: http://llvm.org/viewvc/llvm-project?rev=273236&view=rev Log: Change the "debugserver-mini" target (a version of debugserver which doesn't like against all the extra UI frameworks on ios) so it now generates a binary called "debugserver-nonui" and puts it in /usr/local/bin instead of /Developer/usr/bin. Add some cruft to RNBDefs.h to get the version number (provided by Xcode at build time) with either the name "debugserver" or "debugserver_nonui" as appropriate. Add the "debugserver-mini" target to the top level "ios" target in lldb xcode project file, so this nonui debugserver will be built along with the normal lldb / debugserver. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj lldb/trunk/tools/debugserver/source/RNBDefs.h Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=273236&r1=273235&r2=273236&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jun 20 22:39:39 2016 @@ -43,6 +43,7 @@ AF3059151B4B390800E25622 /* Run Script - remove unneeded Resources and Swift dirs from iOS LLDB.framework bundle */, ); dependencies = ( + AFCA21D21D18E556004386B8 /* PBXTargetDependency */, 26CEF3C214FD5973007286B2 /* PBXTargetDependency */, 2687EACF1508116300DD8C2E /* PBXTargetDependency */, ); @@ -1084,6 +1085,13 @@ remoteGlobalIDString = 26DC6A0F1337FE6900FF7998; remoteInfo = "lldb-server"; }; + AFCA21D11D18E556004386B8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 265E9BE1115C2BAA00D0DCCB /* debugserver.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 456F67431AD46CE9002850C2; + remoteInfo = "debugserver-mini"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -6297,7 +6305,7 @@ 239504C51BDD3FD700963CEA /* debugserver */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; - path = debugserver; + path = "debugserver-mini"; remoteRef = 239504C41BDD3FD700963CEA /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -7374,6 +7382,11 @@ target = 26DC6A0F1337FE6900FF7998 /* lldb-server */; targetProxy = 94E829C8152D33B4006F96A3 /* PBXContainerItemProxy */; }; + AFCA21D21D18E556004386B8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "debugserver-mini"; + targetProxy = AFCA21D11D18E556004386B8 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=273236&r1=273235&r2=273236&view=diff == --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Mon Jun 20 22:39:39 2016 @@ -163,7 +163,7 @@ 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImplX86_64.cpp; sourceTree = ""; }; 26CF99A31142EB7400011AAB /* DNBArchImplX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBArchImplX86_64.h; sourceTree = ""; }; 26E6B9DA0D1329010037ECDD /* RNBDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBDefs.h; sourceTree = ""; }; - 456F67721AD46CE9002850C2 /* debugserver */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = debugserver; sourceTree = BUILT_PRODUCTS_DIR; }; + 456F67721AD46CE9002850C2 /* debugserver-nonui */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "debugserver-nonui";