Revision tags: llvmorg-21-init |
|
#
c4fb7180 |
| 15-Jan-2025 |
Greg Clayton <gclayton@fb.com> |
[lldb][NFC] Make the target's SectionLoadList private. (#113278)
Lots of code around LLDB was directly accessing the target's section
load list. This NFC patch makes the section load list private s
[lldb][NFC] Make the target's SectionLoadList private. (#113278)
Lots of code around LLDB was directly accessing the target's section
load list. This NFC patch makes the section load list private so the
Target class can access it, but everyone else now uses accessor
functions. This allows us to control the resolving of addresses and will
allow for functionality in LLDB which can lazily resolve addresses in
JIT plug-ins with a future patch.
show more ...
|
Revision tags: llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5 |
|
#
df9a14d7 |
| 21-Nov-2024 |
Kadir Cetinkaya <kadircet@google.com> |
Reapply "[NFC] Explicitly pass a VFS when creating DiagnosticsEngine (#115852)"
This reverts commit a1153cd6fedd4c906a9840987934ca4712e34cb2 with fixes to lldb breakages.
Fixes https://github.com/l
Reapply "[NFC] Explicitly pass a VFS when creating DiagnosticsEngine (#115852)"
This reverts commit a1153cd6fedd4c906a9840987934ca4712e34cb2 with fixes to lldb breakages.
Fixes https://github.com/llvm/llvm-project/issues/117145.
show more ...
|
Revision tags: llvmorg-19.1.4, llvmorg-19.1.3 |
|
#
b852fb1e |
| 25-Oct-2024 |
Jonas Devlieghere <jonas@devlieghere.com> |
[lldb] Move ValueObject into its own library (NFC) (#113393)
ValueObject is part of lldbCore for historical reasons, but conceptually
it deserves to be its own library. This does introduce a (link-
[lldb] Move ValueObject into its own library (NFC) (#113393)
ValueObject is part of lldbCore for historical reasons, but conceptually
it deserves to be its own library. This does introduce a (link-time) circular
dependency between lldbCore and lldbValueObject, which is unfortunate
but probably unavoidable because so many things in LLDB rely on
ValueObject. We already have cycles and these libraries are never built
as dylibs so while this doesn't improve the situation, it also doesn't
make things worse.
The header includes were updated with the following command:
```
find . -type f -exec sed -i.bak "s%include \"lldb/Core/ValueObject%include \"lldb/ValueObject/ValueObject%" '{}' \;
```
show more ...
|
Revision tags: llvmorg-19.1.2 |
|
#
d8de2391 |
| 14-Oct-2024 |
Shubham Sandeep Rastogi <srastogi22@apple.com> |
Revert "[lldb] Improve unwinding for discontinuous functions (#111409)"
This reverts commit a89e01634fe2e6ce0b967ead24280b6693b523dc.
This is being reverted because it broke the test:
Unwind/trap_
Revert "[lldb] Improve unwinding for discontinuous functions (#111409)"
This reverts commit a89e01634fe2e6ce0b967ead24280b6693b523dc.
This is being reverted because it broke the test:
Unwind/trap_frame_sym_ctx.test
/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake/llvm-project/lldb/test/Shell/Unwind/trap_frame_sym_ctx.test:21:10: error: CHECK: expected string not found in input CHECK: frame #2: {{.*}}`main
show more ...
|
#
a89e0163 |
| 14-Oct-2024 |
Pavel Labath <pavel@labath.sk> |
[lldb] Improve unwinding for discontinuous functions (#111409)
Currently, our unwinder assumes that the functions are continuous (or at
least, that there are no functions which are "in the middle"
[lldb] Improve unwinding for discontinuous functions (#111409)
Currently, our unwinder assumes that the functions are continuous (or at
least, that there are no functions which are "in the middle" of other
functions). Neither of these assumptions is true for functions optimized
by tools like propeller and (probably) bolt.
While there are many things that go wrong for these functions, the
biggest damage is caused by the unwind plan caching code, which
currently takes the maximalist extent of the function and assumes that
the unwind plan we get for that is going to be valid for all code inside
that range. If a part of the function has been moved into a "cold"
section, then the range of the function can be many megabytes, meaning
that any function within that range will probably fail to unwind.
We end up with this maximalist range because the unwinder asks for the
Function object for its range. This is only one of the strategies for
determining the range, but it is the first one -- and also the most
incorrect one. The second choice would is asking the eh_frame section
for the range of the function, and this one returns something reasonable
here (the address range of the current function fragment) -- which it
does because each fragment gets its own eh_frame entry (it has to,
because they have to be continuous).
With this in mind, this patch moves the eh_frame (and debug_frame) to
the front of the queue. I think that preferring this range makes sense
because eh_frame is one of the unwind plans that we return, and some
others (augmented eh_frame) are based on it. In theory this could break
some functions, where the debug info and eh_frame disagree on the extent
of the function (and eh_frame is the one who's wrong), but I don't know
of any such scenarios.
show more ...
|
#
8789c966 |
| 02-Oct-2024 |
Adrian Prantl <aprantl@apple.com> |
[lldb] Unify implementation of CommandReturnObject::SetError(NFC) (#110707)
This is a cleanup that moves the API towards value semantics.
|
Revision tags: llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4 |
|
#
0642cd76 |
| 27-Aug-2024 |
Adrian Prantl <aprantl@apple.com> |
[lldb] Turn lldb_private::Status into a value type. (#106163)
This patch removes all of the Set.* methods from Status.
This cleanup is part of a series of patches that make it harder use the
ant
[lldb] Turn lldb_private::Status into a value type. (#106163)
This patch removes all of the Set.* methods from Status.
This cleanup is part of a series of patches that make it harder use the
anti-pattern of keeping a long-lives Status object around and updating
it while dropping any errors it contains on the floor.
This patch is largely NFC, the more interesting next steps this enables
is to:
1. remove Status.Clear()
2. assert that Status::operator=() never overwrites an error
3. remove Status::operator=()
Note that step (2) will bring 90% of the benefits for users, and step
(3) will dramatically clean up the error handling code in various
places. In the end my goal is to convert all APIs that are of the form
` ResultTy DoFoo(Status& error)
`
to
` llvm::Expected<ResultTy> DoFoo()
`
How to read this patch?
The interesting changes are in Status.h and Status.cpp, all other
changes are mostly
` perl -pi -e 's/\.SetErrorString/ = Status::FromErrorString/g' $(git
grep -l SetErrorString lldb/source)
`
plus the occasional manual cleanup.
show more ...
|
Revision tags: llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2 |
|
#
5dbbc3b1 |
| 31-Jul-2024 |
Jonas Devlieghere <jonas@devlieghere.com> |
[lldb] Use Target references instead of pointers in CommandObject (NFC)
The GetTarget helper returns a Target reference so there's reason to convert it to a pointer and check its validity.
|
#
8398ad9c |
| 31-Jul-2024 |
Jonas Devlieghere <jonas@devlieghere.com> |
[lldb] Unify the way we get the Target in CommandObject (#101208)
Currently, CommandObjects are obtaining a target in a variety of ways.
Often the command incorrectly operates on the selected targe
[lldb] Unify the way we get the Target in CommandObject (#101208)
Currently, CommandObjects are obtaining a target in a variety of ways.
Often the command incorrectly operates on the selected target. As an
example, when a breakpoint command is running, the current target is
passed into the command but the target that hit the breakpoint is not
the selected target. In other places we use the CommandObject's
execution context, which is frozen during the execution of the command,
and comes with its own limitations. Finally, we often want to fall back
to the dummy target if no real target is available.
Instead of having to guess how to get the target, this patch introduces
one helper function in CommandObject to get the most relevant target. In
order of priority, that's the target from the command object's execution
context, from the interpreter's execution context, the selected target
or the dummy target.
rdar://110846511
show more ...
|
#
558315a0 |
| 27-Jul-2024 |
Shivam Gupta <shivam98.tkg@gmail.com> |
[LLDB] Remove the redundent 'properties' variable (#95675)
This is described in (N3) https://pvs-studio.com/en/blog/posts/cpp/1126/
Warning message -
V547 Expression 'properties ++ > 0' is alway
[LLDB] Remove the redundent 'properties' variable (#95675)
This is described in (N3) https://pvs-studio.com/en/blog/posts/cpp/1126/
Warning message -
V547 Expression 'properties ++ > 0' is always false.
CommandObjectTarget.cpp:100
I could not understand it properly but the properties++ operation is
performed twice when the target architecture is valid.
First increment seems unnecessary since it is always false '0>0'.
---------
Co-authored-by: xgupta <shivma98.tkg@gmail.com>
show more ...
|
Revision tags: llvmorg-19.1.0-rc1 |
|
#
d64eccf4 |
| 23-Jul-2024 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[clang] Split ObjectFilePCHContainerReader from ObjectFilePCHContainerWriter (#99599)
Close https://github.com/llvm/llvm-project/issues/99479
See https://github.com/llvm/llvm-project/issues/99479
[clang] Split ObjectFilePCHContainerReader from ObjectFilePCHContainerWriter (#99599)
Close https://github.com/llvm/llvm-project/issues/99479
See https://github.com/llvm/llvm-project/issues/99479 for details
show more ...
|
Revision tags: llvmorg-20-init |
|
#
b3e1f1b1 |
| 16-Jul-2024 |
Jonas Devlieghere <jonas@devlieghere.com> |
[lldb] Fix help syntax for add-dsym (target symbols add) (#98976)
The help output incorrectly states that this command takes a shared
library name (<shlib-name>) while really it takes a path to a s
[lldb] Fix help syntax for add-dsym (target symbols add) (#98976)
The help output incorrectly states that this command takes a shared
library name (<shlib-name>) while really it takes a path to a symbol
file.
rdar://131777043
show more ...
|
#
d1bc75c0 |
| 17-Jun-2024 |
Adrian Prantl <aprantl@apple.com> |
Convert ValueObject::Dump() to return llvm::Error() (NFCish)
This change by itself has no measurable effect on the LLDB testsuite. I'm making it in preparation for threading through more errors in t
Convert ValueObject::Dump() to return llvm::Error() (NFCish)
This change by itself has no measurable effect on the LLDB testsuite. I'm making it in preparation for threading through more errors in the Swift language plugin.
show more ...
|
Revision tags: 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 |
|
#
b7dd6012 |
| 15-Mar-2024 |
Jonas Devlieghere <jonas@devlieghere.com> |
[lldb] Show module name in progress update for downloading symbols (#85342)
Currently, we always show the argument passed to dsymForUUID in the
corresponding progress update. Most of the time this
[lldb] Show module name in progress update for downloading symbols (#85342)
Currently, we always show the argument passed to dsymForUUID in the
corresponding progress update. Most of the time this is a UUID, but it
can also be an absolute path. The former is pretty uninformative and the
latter needlessly noisy.
This changes the progress update to print the UUID and the module name,
if both are available. Otherwise, we print the UUID or the module name
depending on which one is available.
We now also unconditionally pass the module file spec and architecture
to DownloadObjectAndSymbolFile, while previously this was conditional on
the file existing on-disk. This should be harmless:
- We already check that the file exists in DownloadObjectAndSymbolFile.
- It doesn't make sense to check the filesystem for the architecutre.
rdar://124643548
show more ...
|
Revision tags: llvmorg-18.1.1 |
|
#
97281708 |
| 29-Feb-2024 |
jimingham <jingham@apple.com> |
Change `image list -r` so that it actually shows the ref count and whether the image is in the shared cache. (#83341)
The help for the `-r` option to `image list` says:
-r[<width>] ( --ref
Change `image list -r` so that it actually shows the ref count and whether the image is in the shared cache. (#83341)
The help for the `-r` option to `image list` says:
-r[<width>] ( --ref-count=[<width>] )
Display the reference count if the module is still in the shared module
cache.
but that's not what it actually does. It unconditionally shows the
use_count for all Module shared pointers, regardless of whether they are
still in the shared module cache or whether they are just in the
ModuleCollection and other entities are keeping them alive. That seems
like a more useful behavior, but then it is also useful to know what's
in the shared cache, so I changed this to:
-r[<width>] ( --ref-count=[<width>] )
Display whether the module is still in the the shared module cache
(Y/N), and its shared pointer use_count.
So instead of just `{5}` you will see `{Y 5}` if it is in the shared
cache and `{N 5}` if not.
I didn't add tests for this because I'm not sure how much we want to fix
shared cache behavior in the testsuite.
show more ...
|
#
2d704f4b |
| 27-Feb-2024 |
jimingham <jingham@apple.com> |
Start to clean up the process of defining command arguments. (#83097)
Partly, there's just a lot of unnecessary boiler plate. It's also
possible to define combinations of arguments that make no sen
Start to clean up the process of defining command arguments. (#83097)
Partly, there's just a lot of unnecessary boiler plate. It's also
possible to define combinations of arguments that make no sense (e.g.
eArgRepeatPlus followed by eArgRepeatPlain...) but these are never
checked since we just push_back directly into the argument definitions.
This commit is step 1 of this cleanup - do the obvious stuff. In it, all
the simple homogenous argument lists and the breakpoint/watchpoint
ID/Range types, are set with common functions. This is an NFC change, it
just centralizes boiler plate. There's no checking yet because you can't
get a single argument wrong.
The end goal is that all argument definition goes through functions and
m_arguments is hidden so that you can't define inconsistent argument
sets.
show more ...
|
Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3 |
|
#
563ef306 |
| 20-Feb-2024 |
jimingham <jingham@apple.com> |
Add the RegisterCompleter to eArgTypeRegisterName in g_argument_table (#82428)
This is a follow-on to:
https://github.com/llvm/llvm-project/pull/82085
The completer for register names was miss
Add the RegisterCompleter to eArgTypeRegisterName in g_argument_table (#82428)
This is a follow-on to:
https://github.com/llvm/llvm-project/pull/82085
The completer for register names was missing from the argument table. I
somehow missed that the only register completer test was x86_64, so that
test broke.
I added the completer in to the right slot in the argument table, and
added a small completions test that just uses the alias register names.
If we end up having a platform that doesn't define register names, we'll
have to skip this test there, but it should add a sniff test for
register completion that will run most everywhere.
show more ...
|
#
9ed8b272 |
| 20-Feb-2024 |
Shubham Sandeep Rastogi <srastogi22@apple.com> |
Revert "Centralize the handling of completion for simple argument lists. (#82085)"
This reverts commit 21631494b068d9364b8dc8f18e59adee9131a0a5.
Reverted because of greendragon failure:
**********
Revert "Centralize the handling of completion for simple argument lists. (#82085)"
This reverts commit 21631494b068d9364b8dc8f18e59adee9131a0a5.
Reverted because of greendragon failure:
******************** TEST 'lldb-api :: functionalities/completion/TestCompletion.py' FAILED ******************** Script:
show more ...
|
#
21631494 |
| 20-Feb-2024 |
jimingham <jingham@apple.com> |
Centralize the handling of completion for simple argument lists. (#82085)
Most commands were adding argument completion handling by themselves,
resulting in a lot of unnecessary boilerplate. In man
Centralize the handling of completion for simple argument lists. (#82085)
Most commands were adding argument completion handling by themselves,
resulting in a lot of unnecessary boilerplate. In many cases, this could
be done generically given the argument definition and the entries in the
g_argument_table.
I'm going to address this in a couple passes. In this first pass, I
added handling of commands that have only one argument list, with one
argument type, either single or repeated, and changed all the commands
that are of this sort (and don't have other bits of business in their
completers.)
I also added some missing connections between arg types and completions
to the table, and added a RemoteFilename and RemotePath to use in places
where we were using the Remote completers. Those arguments used to say
they were "files" but they were in fact remote files.
I also added a module arg type to use where we were using the module
completer. In that case, we should call the argument module.
show more ...
|
Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
7b925c3e |
| 22-Jan-2024 |
José Lira Junior <jljuniorpb@gmail.com> |
[lldb] refactor highlighting function for image lookup command (#76112)
Follow-up to #69422.
This PR puts all the highlighting settings into a single struct for
easier handling
Co-authored-by
[lldb] refactor highlighting function for image lookup command (#76112)
Follow-up to #69422.
This PR puts all the highlighting settings into a single struct for
easier handling
Co-authored-by: Talha Tahir <talha.tahir@10xengineers.ai>
show more ...
|
#
dd958779 |
| 13-Dec-2023 |
Greg Clayton <gclayton@fb.com> |
[lldb] Make only one function that needs to be implemented when searching for types (#74786)
This patch revives the effort to get this Phabricator patch into
upstream:
https://reviews.llvm.org/D
[lldb] Make only one function that needs to be implemented when searching for types (#74786)
This patch revives the effort to get this Phabricator patch into
upstream:
https://reviews.llvm.org/D137900
This patch was accepted before in Phabricator but I found some
-gsimple-template-names issues that are fixed in this patch.
A fixed up version of the description from the original patch starts
now.
This patch started off trying to fix Module::FindFirstType() as it
sometimes didn't work. The issue was the SymbolFile plug-ins didn't do
any filtering of the matching types they produced, and they only looked
up types using the type basename. This means if you have two types with
the same basename, your type lookup can fail when only looking up a
single type. We would ask the Module::FindFirstType to lookup "Foo::Bar"
and it would ask the symbol file to find only 1 type matching the
basename "Bar", and then we would filter out any matches that didn't
match "Foo::Bar". So if the SymbolFile found "Foo::Bar" first, then it
would work, but if it found "Baz::Bar" first, it would return only that
type and it would be filtered out.
Discovering this issue lead me to think of the patch Alex Langford did a
few months ago that was done for finding functions, where he allowed
SymbolFile objects to make sure something fully matched before parsing
the debug information into an AST type and other LLDB types. So this
patch aimed to allow type lookups to also be much more efficient.
As LLDB has been developed over the years, we added more ways to to type
lookups. These functions have lots of arguments. This patch aims to make
one API that needs to be implemented that serves all previous lookups:
- Find a single type
- Find all types
- Find types in a namespace
This patch introduces a `TypeQuery` class that contains all of the state
needed to perform the lookup which is powerful enough to perform all of
the type searches that used to be in our API. It contain a vector of
CompilerContext objects that can fully or partially specify the lookup
that needs to take place.
If you just want to lookup all types with a matching basename,
regardless of the containing context, you can specify just a single
CompilerContext entry that has a name and a CompilerContextKind mask of
CompilerContextKind::AnyType.
Or you can fully specify the exact context to use when doing lookups
like: CompilerContextKind::Namespace "std"
CompilerContextKind::Class "foo"
CompilerContextKind::Typedef "size_type"
This change expands on the clang modules code that already used a
vector<CompilerContext> items, but it modifies it to work with
expression type lookups which have contexts, or user lookups where users
query for types. The clang modules type lookup is still an option that
can be enabled on the `TypeQuery` objects.
This mirrors the most recent addition of type lookups that took a
vector<CompilerContext> that allowed lookups to happen for the
expression parser in certain places.
Prior to this we had the following APIs in Module:
```
void
Module::FindTypes(ConstString type_name, bool exact_match, size_t max_matches,
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeList &types);
void
Module::FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages,
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeMap &types);
void Module::FindTypesInNamespace(ConstString type_name,
const CompilerDeclContext &parent_decl_ctx,
size_t max_matches, TypeList &type_list);
```
The new Module API is much simpler. It gets rid of all three above
functions and replaces them with:
```
void FindTypes(const TypeQuery &query, TypeResults &results);
```
The `TypeQuery` class contains all of the needed settings:
- The vector<CompilerContext> that allow efficient lookups in the symbol
file classes since they can look at basename matches only realize fully
matching types. Before this any basename that matched was fully realized
only to be removed later by code outside of the SymbolFile layer which
could cause many types to be realized when they didn't need to.
- If the lookup is exact or not. If not exact, then the compiler context
must match the bottom most items that match the compiler context,
otherwise it must match exactly
- If the compiler context match is for clang modules or not. Clang
modules matches include a Module compiler context kind that allows types
to be matched only from certain modules and these matches are not needed
when d oing user type lookups.
- An optional list of languages to use to limit the search to only
certain languages
The `TypeResults` object contains all state required to do the lookup
and store the results:
- The max number of matches
- The set of SymbolFile objects that have already been searched
- The matching type list for any matches that are found
The benefits of this approach are:
- Simpler API, and only one API to implement in SymbolFile classes
- Replaces the FindTypesInNamespace that used a CompilerDeclContext as a
way to limit the search, but this only worked if the TypeSystem matched
the current symbol file's type system, so you couldn't use it to lookup
a type in another module
- Fixes a serious bug in our FindFirstType functions where if we were
searching for "foo::bar", and we found a "baz::bar" first, the basename
would match and we would only fetch 1 type using the basename, only to
drop it from the matching list and returning no results
show more ...
|
#
c90cb6ee |
| 08-Dec-2023 |
taalhaataahir0102 <77788288+taalhaataahir0102@users.noreply.github.com> |
[lldb] colorize symbols in image lookup with a regex pattern (#69422)
Fixes https://github.com/llvm/llvm-project/issues/57372
Previously some work has already been done on this. A PR was generate
[lldb] colorize symbols in image lookup with a regex pattern (#69422)
Fixes https://github.com/llvm/llvm-project/issues/57372
Previously some work has already been done on this. A PR was generated
but it remained in review:
https://reviews.llvm.org/D136462
In short previous approach was following:
Changing the symbol names (making the searched part colorized) ->
printing them -> restoring the symbol names back in their original form.
The reviewers suggested that instead of changing the symbol table, this
colorization should be done in the dump functions itself. Our strategy
involves passing the searched regex pattern to the existing dump
functions responsible for printing information about the searched
symbol. This pattern is propagated until it reaches the line in the dump
functions responsible for displaying symbol information on screen.
At this point, we've introduced a new function called
"PutCStringColorHighlighted," which takes the searched pattern, a prefix and suffix,
and the text and applies colorization to highlight the pattern in the
output. This approach aims to streamline the symbol search process to
improve readability of search results.
Co-authored-by: José L. Junior <josejunior@10xengineers.ai>
show more ...
|
Revision tags: llvmorg-17.0.6 |
|
#
5f64b940 |
| 16-Nov-2023 |
Jason Molenda <jmolenda@apple.com> |
Clarify error messages on corefiles that no plugin handles (#72559)
These error messages are written in a way that makes sense to an lldb
developer, but not to an end user who asks lldb to run on a
Clarify error messages on corefiles that no plugin handles (#72559)
These error messages are written in a way that makes sense to an lldb
developer, but not to an end user who asks lldb to run on a compressed
corefile or whatever. Simplfy the messages.
show more ...
|
Revision tags: llvmorg-17.0.5 |
|
#
745e8bfd |
| 05-Nov-2023 |
Jonas Devlieghere <jonas@devlieghere.com> |
[lldb] Remove LocateSymbolFile (#71301)
This completes the conversion of LocateSymbolFile into a SymbolLocator
plugin. The only remaining function is DownloadSymbolFileAsync which
doesn't really f
[lldb] Remove LocateSymbolFile (#71301)
This completes the conversion of LocateSymbolFile into a SymbolLocator
plugin. The only remaining function is DownloadSymbolFileAsync which
doesn't really fit into the plugin model, and therefore moves into the
SymbolLocator class, while still relying on the plugins to do the
underlying work.
show more ...
|
#
e7c61479 |
| 05-Nov-2023 |
Jonas Devlieghere <jonas@devlieghere.com> |
[lldb] Move DownloadObjectAndSymbolFile to SymbolLocator plugin (#71267)
This builds on top of the work started in c3a302d to convert
LocateSymbolFile to a SymbolLocator plugin. This commit moves
[lldb] Move DownloadObjectAndSymbolFile to SymbolLocator plugin (#71267)
This builds on top of the work started in c3a302d to convert
LocateSymbolFile to a SymbolLocator plugin. This commit moves
DownloadObjectAndSymbolFile.
show more ...
|