|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
80687511 |
| 20-Jul-2022 |
Michał Górny <[email protected]> |
[lldb] [gdb-remote] Refactor killing process and move it to client
Refactor the code responsible for sending the "k" packet and move it into GDBRemoteCommunicationClient::KillProcess() method. This
[lldb] [gdb-remote] Refactor killing process and move it to client
Refactor the code responsible for sending the "k" packet and move it into GDBRemoteCommunicationClient::KillProcess() method. This is part of refactoring to enable multiprocess support in the client, and to support using the vKill packet instead.
As part of the refactoring, the following functional changes apply:
- Some redundant logging has been removed, as any failures are returned via exit_string anyway.
- SetLastStopPacket() is no longer called. It is used only to populate the thread list, and since the process has just exited and we're terminating the process instance, there's really no reason to set it.
- On successful kill, exit_string is set to "killed", to clearly indicate that the process has terminated on our request rather than on its own.
Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D130340
show more ...
|
| #
1b4b12a3 |
| 23-Jul-2022 |
Nico Weber <[email protected]> |
Revert "[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute." and follow-ups
This reverts commit 9429b67b8e300e638d7828bbcb95585f85c4df4d.
It broke
Revert "[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute." and follow-ups
This reverts commit 9429b67b8e300e638d7828bbcb95585f85c4df4d.
It broke the build on Windows, see comments on https://reviews.llvm.org/D130309
It also reverts these follow-ups:
Revert "Fix buildbot breakage after https://reviews.llvm.org/D130309." This reverts commit f959d815f4637890ebbacca379f1c38ab47e4e14.
Revert "Fix buildbot breakage after https://reviews.llvm.org/D130309." This reverts commit 0bbce7a4c2d2bff622bdadd4323f93f5d90e6d24.
Revert "Cache the value for absolute path in FileSpec." This reverts commit dabe877248b85b34878e75d5510339325ee087d0.
show more ...
|
| #
9429b67b |
| 21-Jul-2022 |
Greg Clayton <[email protected]> |
[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute.
The FileSpect APIs allow users to modify instance variables directly by getting a non const ref
[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute.
The FileSpect APIs allow users to modify instance variables directly by getting a non const reference to the directory and filename instance variables. This makes it impossibly to control all of the times the FileSpec object is modified so we can clear the cache. This patch modifies the APIs of FileSpec so no one can modify the directory or filename directly by adding set accessors and by removing the get accessors that are non const.
Many clients were using FileSpec::GetCString(...) which returned a unique C string from a ConstString'ified version of the result of GetPath() which returned a std::string. This caused many locations to use this convenient function incorrectly and could cause many strings to be added to the constant string pool that didn't need to. Most clients were converted to using FileSpec::GetPath().c_str() when possible. Other clients were modified to use the newly renamed version of this function which returns an actualy ConstString: ConstString FileSpec::GetPathAsConstString(bool denormalize = true) const;
This avoids the issue where people were getting an already uniqued "const char *" that came from a ConstString only to put the "const char *" back into a "ConstString" object. By returning the ConstString instead of a "const char *" clients can be more efficient with the result.
The patch: - Removes the non const GetDirectory() and GetFilename() get accessors - Adds set accessors to replace the above functions: SetDirectory() and SetFilename(). - Adds ClearDirectory() and ClearFilename() to replace usage of the FileSpec::GetDirectory().Clear()/FileSpec::GetFilename().Clear() call sites - Fixed all incorrect usage of FileSpec::GetCString() to use FileSpec::GetPath().c_str() where appropriate, and updated other call sites that wanted a ConstString to use the newly returned ConstString appropriately and efficiently.
Differential Revision: https://reviews.llvm.org/D130309
show more ...
|
| #
b61b8efc |
| 18-Jul-2022 |
Michał Górny <[email protected]> |
[lldb] [gdb-remote] Fix process ID after following forked child
Update the process ID after handling fork/vfork to ensure that the process plugin reports the correct PID immediately.
Sponsored by:
[lldb] [gdb-remote] Fix process ID after following forked child
Update the process ID after handling fork/vfork to ensure that the process plugin reports the correct PID immediately.
Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D130037
show more ...
|
| #
c1b07d61 |
| 23-Jun-2022 |
Jim Ingham <[email protected]> |
Have CommandObjectParsed check for "commands that take no arguments".
This is currently being done in an ad hoc way, and so for some commands it isn't being checked. We have the info to make this c
Have CommandObjectParsed check for "commands that take no arguments".
This is currently being done in an ad hoc way, and so for some commands it isn't being checked. We have the info to make this check, since commands are supposed to add their arguments to the m_arguments field of the CommandObject. This change uses that info to check whether the command received arguments in error.
A handful of commands weren't defining their argument types, I also had to fix them. And a bunch of commands were checking for arguments by hand, so I removed those checks in favor of the CommandObject one. That also meant I had to change some tests that were checking for the ad hoc error outputs.
Differential Revision: https://reviews.llvm.org/D128453
show more ...
|
|
Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4 |
|
| #
bff4673b |
| 11-May-2022 |
Jim Ingham <[email protected]> |
Add a darwin platform setting to specify which exceptions debugserver should not receive as exceptions (some will get converted to BSD signals instead). This is really the only stable way to ensure
Add a darwin platform setting to specify which exceptions debugserver should not receive as exceptions (some will get converted to BSD signals instead). This is really the only stable way to ensure that a Mach exception gets converted to it's equivalent BSD signal. For programs that rely on BSD signal handlers, this has to happen or you can't even get the program to invoke the signal handler when under the debugger.
This builds on a previous solution to this problem which required you start debugserver with the -U flag. This was not very discoverable and required lldb be the one to launch debugserver, which is not always the case.
Differential Revision: https://reviews.llvm.org/D125434
show more ...
|
|
Revision tags: llvmorg-14.0.3, llvmorg-14.0.2 |
|
| #
af91446a |
| 14-Apr-2022 |
Jonas Devlieghere <[email protected]> |
[lldb] Show the DBGError if dsymForUUID can't find a dSYM
Show the user the DBGError (if available) when dsymForUUID fails.
rdar://90949180
Differential revision: https://reviews.llvm.org/D123743
|
|
Revision tags: llvmorg-14.0.1 |
|
| #
fc54427e |
| 01-Apr-2022 |
Jonas Devlieghere <[email protected]> |
[lldb] Refactor DataBuffer so we can map files as read-only
Currently, all data buffers are assumed to be writable. This is a problem on macOS where it's not allowed to load unsigned binaries in mem
[lldb] Refactor DataBuffer so we can map files as read-only
Currently, all data buffers are assumed to be writable. This is a problem on macOS where it's not allowed to load unsigned binaries in memory as writable. To be more precise, MAP_RESILIENT_CODESIGN and MAP_RESILIENT_MEDIA need to be set for mapped (unsigned) binaries on our platform.
Binaries are mapped through FileSystem::CreateDataBuffer which returns a DataBufferLLVM. The latter is backed by a llvm::WritableMemoryBuffer because every DataBuffer in LLDB is considered to be writable. In order to use a read-only llvm::MemoryBuffer I had to split our abstraction around it.
This patch distinguishes between a DataBuffer (read-only) and WritableDataBuffer (read-write) and updates LLDB to use the appropriate one.
rdar://74890607
Differential revision: https://reviews.llvm.org/D122856
show more ...
|
| #
12606d16 |
| 23-Mar-2022 |
Adrian Prantl <[email protected]> |
Revert "Expose GetAddressingBits() in the Process API."
This reverts commit 7504dd5e00f514628614db8ee07514c73220e597.
In newer review feedback it was pointed out that there is a better API for this
Revert "Expose GetAddressingBits() in the Process API."
This reverts commit 7504dd5e00f514628614db8ee07514c73220e597.
In newer review feedback it was pointed out that there is a better API for this in Process::GetCodeAddressMask().
show more ...
|
| #
7504dd5e |
| 23-Mar-2022 |
Adrian Prantl <[email protected]> |
Expose GetAddressingBits() in the Process API.
This is needed by the Swift Plugin.
See also https://github.com/apple/llvm-project/pull/4110.
Differential Revision: https://reviews.llvm.org/D122347
|
| #
74b45f91 |
| 17-Mar-2022 |
Jonas Devlieghere <[email protected]> |
[lldb] Migrate ProcessGDBRemote to ReportWarning
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4 |
|
| #
68099b1d |
| 11-Mar-2022 |
Jonas Devlieghere <[email protected]> |
[lldb] Add a getter for the process' system architecture
This patch adds a getter for the process' system architecture. I went with Process::GetSystemArchitecture to match Platform::GetSystemArchite
[lldb] Add a getter for the process' system architecture
This patch adds a getter for the process' system architecture. I went with Process::GetSystemArchitecture to match Platform::GetSystemArchitecture.
Differential revision: https://reviews.llvm.org/D121443
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc3 |
|
| #
ed1a83be |
| 09-Mar-2022 |
Pavel Labath <[email protected]> |
[lldb/gdb-remote] Remove ancient debugserver workaround
This workaround is the source of an awkwared Process->Platform dependency. While this could be solved in various ways (the only thing we reall
[lldb/gdb-remote] Remove ancient debugserver workaround
This workaround is the source of an awkwared Process->Platform dependency. While this could be solved in various ways (the only thing we really use is the plugin name), it may be better to just remove it -- the workaround was added 10 years ago (43c555dfc), and the affected debugservers were "old" even then, so hopefully they are not in use anymore.
Differential Revision: https://reviews.llvm.org/D121305
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1 |
|
| #
d2edca62 |
| 07-Feb-2022 |
Pavel Labath <[email protected]> |
[lldb/Platform] Prepare decouple instance and plugin names
This patch changes the return value of Platform::GetName() to a StringRef, and uses the opportunity (compile errors) to change some callsit
[lldb/Platform] Prepare decouple instance and plugin names
This patch changes the return value of Platform::GetName() to a StringRef, and uses the opportunity (compile errors) to change some callsites to use GetPluginName() instead. The two methods still remain hardwired to return the same thing, but this will change once the ideas in <https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594> are implemented.
Differential Revision: https://reviews.llvm.org/D119146
show more ...
|
| #
12c9c4a8 |
| 22-Feb-2022 |
Pavel Labath <[email protected]> |
[lldb/host] Remove monitor_signals argument from process monitoring functions
All current callers set the argument to false. monitor_signals=true used to be used in the Process plugins (which needed
[lldb/host] Remove monitor_signals argument from process monitoring functions
All current callers set the argument to false. monitor_signals=true used to be used in the Process plugins (which needed to know when the debugged process gets a signal), but this implementation has several serious issues, which means that individual process plugins now orchestrate the monitoring of debugged processes themselves.
This allows us to simplify the implementation (no need to play with process groups), and the interface (we only catch fatal events, so the callback is always called just once).
Differential Revision: https://reviews.llvm.org/D120425
show more ...
|
| #
d0810779 |
| 21-Feb-2022 |
Pavel Labath <[email protected]> |
[lldb] Modernize ThreadLauncher
Accept a function object instead of a raw pointer. This avoids a bunch of boilerplate typically needed to pass arguments to the thread functions.
Differential Revisi
[lldb] Modernize ThreadLauncher
Accept a function object instead of a raw pointer. This avoids a bunch of boilerplate typically needed to pass arguments to the thread functions.
Differential Revision: https://reviews.llvm.org/D120321
show more ...
|
|
Revision tags: llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
| #
2937b282 |
| 01-Dec-2021 |
David Spickett <[email protected]> |
Reland "[lldb] Remove non address bits when looking up memory regions"
This reverts commit 0df522969a7a0128052bd79182c8d58e00556e2f.
Additional checks are added to fix the detection of the last mem
Reland "[lldb] Remove non address bits when looking up memory regions"
This reverts commit 0df522969a7a0128052bd79182c8d58e00556e2f.
Additional checks are added to fix the detection of the last memory region in GetMemoryRegions or repeating the "memory region" command when the target has non-address bits.
Normally you keep reading from address 0, looking up each region's end address until you get LLDB_INVALID_ADDR as the region end address. (0xffffffffffffffff)
This is what the remote will return once you go beyond the last mapped region: [0x0000fffffffdf000-0x0001000000000000) rw- [stack] [0x0001000000000000-0xffffffffffffffff) ---
Problem is that when we "fix" the lookup address, we remove some bits from it. On an AArch64 system we have 48 bit virtual addresses, so when we fix the end address of the [stack] region the result is 0. So we loop back to the start.
[0x0000fffffffdf000-0x0001000000000000) rw- [stack] [0x0000000000000000-0x0000000000400000) ---
To fix this I added an additional check for the last range. If the end address of the region is different once you apply FixDataAddress, we are at the last region.
Since the end of the last region will be the last valid mappable address, plus 1. That 1 will be removed by the ABI plugin.
The only side effect is that on systems with non-address bits, you won't get that last catch all unmapped region from the max virtual address up to 0xf...f.
[0x0000fffff8000000-0x0000fffffffdf000) --- [0x0000fffffffdf000-0x0001000000000000) rw- [stack] <ends here>
Though in some way this is more correct because that region is not just unmapped, it's not mappable at all.
No extra testing is needed because this is already covered by TestMemoryRegion.py, I simply forgot to run it on system that had both top byte ignore and pointer authentication.
This change has been tested on a qemu VM with top byte ignore, memory tagging and pointer authentication enabled.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D115508
show more ...
|
| #
c34698a8 |
| 03-Feb-2022 |
Pavel Labath <[email protected]> |
[lldb] Rename Logging.h to LLDBLog.h and clean up includes
Most of our code was including Log.h even though that is not where the "lldb" log channel is defined (Log.h defines the generic logging inf
[lldb] Rename Logging.h to LLDBLog.h and clean up includes
Most of our code was including Log.h even though that is not where the "lldb" log channel is defined (Log.h defines the generic logging infrastructure). This worked because Log.h included Logging.h, even though it should.
After the recent refactor, it became impossible the two files include each other in this direction (the opposite inclusion is needed), so this patch removes the workaround that was put in place and cleans up all files to include the right thing. It also renames the file to LLDBLog to better reflect its purpose.
show more ...
|
| #
a007a6d8 |
| 31-Jan-2022 |
Pavel Labath <[email protected]> |
[lldb] Convert "LLDB" log channel to the new API
|
| #
b1127753 |
| 28-Jan-2022 |
Pavel Labath <[email protected]> |
[lldb] Convert ProcessGDBRemoteLog to the new API
|
| #
0f08db66 |
| 17-Jan-2022 |
Pavel Labath <[email protected]> |
[lldb] Make logging machinery type-safe
This patch makes use of c++ type checking and scoped enums to make logging statements shorter and harder to misuse.
Defines like LIBLLDB_LOG_PROCESS are repl
[lldb] Make logging machinery type-safe
This patch makes use of c++ type checking and scoped enums to make logging statements shorter and harder to misuse.
Defines like LIBLLDB_LOG_PROCESS are replaces with LLDBLog::Process. Because it now carries type information we do not need to worry about matching a specific enum value with the right getter function -- the compiler will now do that for us.
The main entry point for the logging machinery becomes the GetLog (template) function, which will obtain the correct Log object based on the enum type. It achieves this through another template function (LogChannelFor<T>), which must be specialized for each type, and should return the appropriate channel object.
This patch also removes the ability to log a message if multiple categories are enabled simultaneously as it was unused and confusing.
This patch does not actually remove any of the existing interfaces. The defines and log retrieval functions are left around as wrappers around the new interfaces. They will be removed in follow-up patch.
Differential Revision: https://reviews.llvm.org/D117490
show more ...
|
| #
e69a3d18 |
| 09-Jan-2022 |
Michał Górny <[email protected]> |
[lldb] [gdb-remote] Support client fallback for servers without reg defs
Provide minimal register definition defaults for working with servers that implement neither target.xml nor qRegisterInfo pac
[lldb] [gdb-remote] Support client fallback for servers without reg defs
Provide minimal register definition defaults for working with servers that implement neither target.xml nor qRegisterInfo packets. This is useful e.g. when interacting with FreeBSD's kernel minimal gdbserver that does not send target.xml but uses the same layout for its supported register subset as GDB.
The prerequisite for this is the ability to determine the correct architecture, e.g. from the target executable.
Differential Revision: https://reviews.llvm.org/D116896
show more ...
|
| #
1267506e |
| 10-Jan-2022 |
Lirong Yuan <[email protected]> |
[lldb] fix memory leak in "GetGDBServerRegisterInfoXMLAndProcess"
While running heap checker on a test that uses LLDB API, the following memory leak is found:
RAW: HeapChecker started... RAW: Leak
[lldb] fix memory leak in "GetGDBServerRegisterInfoXMLAndProcess"
While running heap checker on a test that uses LLDB API, the following memory leak is found:
RAW: HeapChecker started... RAW: Leak check _main_ detected leaks of 34 bytes in 4 objects RAW: The 2 largest leaks: RAW: Leak of 17 bytes in 2 objects allocated from: @ 0x7fb93bd20166 NewHook() @ 0x7fb929372a73 absl::base_internal::MallocHook::InvokeNewHookSlow() @ 0x5600d1046093 libc_malloc @ 0x7fb974529c03 xmlStrdup @ 0x7fb9744c2a0b xmlGetProp @ 0x7fb9749d9ed6 lldb_private::XMLNode::GetAttributeValue() @ 0x7fb979043001 std::u::function::policy_invoker<>::__call_impl<>() @ 0x7fb9749da06d lldb_private::XMLNode::ForEachChildElement() @ 0x7fb97903c54d lldb_private::process_gdb_remote::ProcessGDBRemote::GetGDBServerRegisterInfoXMLAndProcess() @ 0x7fb97902cfe4 lldb_private::process_gdb_remote::ProcessGDBRemote::GetGDBServerRegisterInfo() @ 0x7fb97902c1d0 lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo() @ 0x7fb97902e92a lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo() @ 0x7fb97902db18 lldb_private::process_gdb_remote::ProcessGDBRemote::DoConnectRemote() @ 0x7fb97584965e lldb_private::Process::ConnectRemote() @ 0x7fb975839fa6 lldb_private::Platform::DoConnectProcess() @ 0x7fb97583a39e lldb_private::Platform::ConnectProcessSynchronous() @ 0x7fb97545b28b CommandObjectProcessConnect::DoExecute() @ 0x7fb9755a70c9 lldb_private::CommandObjectParsed::Execute() @ 0x7fb97559c0e9 lldb_private::CommandInterpreter::HandleCommand() @ 0x7fb975460145 lldb_private::CommandObjectRegexCommand::DoExecute() @ 0x7fb9755a72d2 lldb_private::CommandObjectRaw::Execute() @ 0x7fb97559c0e9 lldb_private::CommandInterpreter::HandleCommand() @ 0x7fb997a5f22e lldb::SBCommandInterpreter::HandleCommand() @ 0x7fb997a5ef9b lldb::SBCommandInterpreter::HandleCommand()
This change fixes the memory leaks by freeing memory after it is no longer in use. Tested with "ninja check-lldb".
Differential revision: https://reviews.llvm.org/D116707
show more ...
|
| #
a8ae6828 |
| 03-Jan-2022 |
Pavel Labath <[email protected]> |
[lldb] Delete GDBRemoteCommunicationReplayServer
This survived the reproducer deletion.
|
| #
8a26ba6a |
| 23-Dec-2021 |
Jason Molenda <[email protected]> |
Load binary by UUID from qProcessInfo packet fields
Support three new keys in the qProcessInfo response from the remote gdb stub to handle the case of attaching to a core running some type of standa
Load binary by UUID from qProcessInfo packet fields
Support three new keys in the qProcessInfo response from the remote gdb stub to handle the case of attaching to a core running some type of standalone/firmware code and the stub knows the UUID and load address-or-slide for the binary. There will be no proper DynamicLoader plugin in this scenario, but we can try to locate and load the binary into lldb at the correct offset.
Differential Revision: https://reviews.llvm.org/D116211 rdar://75191077
show more ...
|