94 Commits

Author SHA1 Message Date
nerix
3f61e4eae6
[LLDB][NativePDB] Resolve declaration for tag types (#152579)
Tag types like stucts or enums didn't have a declaration attached to
them. The source locations are present in the IPI stream in
`LF_UDT_MOD_SRC_LINE` records:

```
   0x101F | LF_UDT_MOD_SRC_LINE [size = 18, hash = 0x1C63]
            udt = 0x1058, mod = 3, file = 1, line = 0
   0x2789 | LF_UDT_MOD_SRC_LINE [size = 18, hash = 0x1E5A]
            udt = 0x1253, mod = 35, file = 93, line = 17069
```

The file is an ID in the string table `/names`:

```
     ID | String
      1 | '\<unknown>'
     12 | 'D:\a\_work\1\s\src\ExternalAPIs\WindowsSDKInc\c\Include\10.0.22621.0\um\wingdi.h'
     93 | 'D:\a\_work\1\s\src\ExternalAPIs\WindowsSDKInc\c\Include\10.0.22621.0\um\winnt.h'
```

Here, we're not interested in `mod`. This would indicate which module
contributed the UDT.

I was looking at Rustc's PDB and found that it uses `<unknown>` for some
types, so I added a check for that.

This makes two DIA PDB shell tests to work with the native PDB plugin.

---------

Co-authored-by: Michael Buch <michaelbuch12@gmail.com>
2025-08-13 14:47:21 +01:00
nerix
44f41f55b4
Reland "[LLDB][NativePDB] Find functions by basename" ( #152295) (#153160)
Relands #152295.

Checking for the overloads did not account for them being out of order.
For example, [the failed
output](https://github.com/llvm/llvm-project/pull/152295#issuecomment-3177563247)
contained the overloads, but out of order. The last commit here fixes
that by using `-DAG`.

---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-08-12 12:49:47 -05:00
Jonas Devlieghere
3a682864d9
Revert "[LLDB][NativePDB] Find functions by basename" (#153131)
Reverts llvm/llvm-project#152295
2025-08-11 22:23:20 -05:00
nerix
7e2cc725db
[LLDB][NativePDB] Find functions by basename (#152295)
This adds the ability for functions to be matched by their basename.

Before, the globals were searched for the name. This works if the full
name is available but fails for basenames.
PDB only includes the full names of functions, so we need to cache all
basenames. This is (again) very similar to
[SymbolFilePDB](b242150b07/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (L1291-L1383)).
There are two main differences:

- We can't just access the parent of a function to determine that it's a
member function - we need to check the type of the function, and its
"this type".
- SymbolFilePDB saved the full method name in the map. However, when
searching for methods, only the basename is passed, so the function
never found any methods.

Fixes #51933.

---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-08-11 20:51:37 -05:00
nerix
2d4e5c4e1f
[LLDB][NativePDB] Use undecorated name for types if UniqueName isn't mangled (#152114)
Languages other than C/C++ don't necessarily emit mangled names in the
`UniqueName` field of type records. Rust specifically emits a unique ID
that doesn't contain the name.

For example, `(i32, i32)` is emitted as

```llvm
!266 = !DICompositeType(
  tag: DW_TAG_structure_type, name: "tuple$<i32,i32>", file: !9, size: 64, align: 32,
  elements: !267, templateParams: !17, identifier: "19122721b0632fe96c0dd37477674472"
)
```

which results in

```
  0x1091 | LF_STRUCTURE [size = 72, hash = 0x1AC67] `tuple$<i32,i32>`
           unique name: `19122721b0632fe96c0dd37477674472`
           vtable: <no type>, base list: <no type>, field list: 0x1090
           options: has unique name, sizeof 8
```

In C++ with Clang and MSVC, a structure similar to this would result in
```
   0x136F | LF_STRUCTURE [size = 44, hash = 0x30BE2] `MyTuple`
            unique name: `.?AUMyTuple@@`
            vtable: <no type>, base list: <no type>, field list: 0x136E
            options: has unique name, sizeof 8
```

With this PR, if a `UniqueName` is encountered that couldn't be parsed,
it will fall back to using the undecorated (→ do the same as if the
unique name is empty/unavailable).

I'm not sure how to test this. Maybe compiling the LLVM IR that rustc
emits?

Fixes #152051.
2025-08-05 19:57:26 -07:00
nerix
852cc9200f
[LLDB][NativePDB] Implement FindNamespace (#151950)
`FindNamespace` was not implemented for `SymbolFileNativePDB`. Without
it, it wasn't possible to lookup items through namespaces when
evaluating expressions.

This is mostly the same as in
[SymbolFilePDB](f1eb869bae/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (L1664-L1696))
as well as
[PDBAstParser](f1eb869bae/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (L1126-L1150)):
The AST parser/builder saves the created namespaces in a map to lookup
when a namespace is requested.

This is working towards making
[Shell/SymbolFile/PDB/expressions.test](f1eb869bae/lldb/test/Shell/SymbolFile/PDB/expressions.test)
pass with the native PDB plugin.
2025-08-05 11:10:27 +01:00
nerix
d95dadff8f
[LLDB][NativePDB] Allow type lookup in namespaces (#149876)
Previously, `type lookup` for types in namespaces didn't work with the
native PDB plugin, because `FindTypes` would only look for types whose
base name was equal to their full name. PDB/CodeView does not store the
base names in the TPI stream, but the types have their full name (e.g.
`std::thread` instead of `thread`). So `findRecordsByName` would only
return types in the top level namespace.

This PR changes the lookup to go through all types and check their base
name. As that could be a bit expensive, the names are first cached
(similar to the function lookup in the DIA PDB plugin). Potential types
are checked with `TypeQuery::ContextMatches`.

To be able to handle anonymous namespaces, I changed
`TypeQuery::ContextMatches`. The [`TypeQuery`
constructor](9ad7edef42/lldb/source/Symbol/Type.cpp (L76-L79))
inserts all name components as `CompilerContextKind::AnyDeclContext`. To
skip over anonymous namespaces, `ContextMatches` checked if a component
was empty and exactly of kind `Namespace`. For our query, the last check
was always false, so we never skipped anonymous namespaces. DWARF
doesn't have this problem, as it [constructs the context
outside](abe93d9d7e/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp (L154-L160))
and has proper information about namespaces. I'm not fully sure if my
change is correct and that it doesn't break other users of `TypeQuery`.

This enables `type lookup <type>` to work on types in namespaces.
However, expressions don't work with this yet, because `FindNamespace`
is unimplemented for native PDB.
2025-08-04 08:56:04 +01:00
Michael Buch
1e7ec351c4
[lldb] Adjust default target.max-children-depth (#149282)
Deeply nested structs can be noisy, so Apple's LLDB fork sets the
default to `4`:
9c93adbb28/lldb/source/Target/TargetProperties.td (L134-L136)

Thought it would be useful to upstream this. Though happy to pick a
different default or keep it as-is.
2025-07-17 21:24:27 +01:00
Michael Buch
a3f8359410 [lldb][test] Fix NativePDB/inline_sites_live.cpp inlined frame format
Adjust after https://github.com/llvm/llvm-project/pull/135343
2025-04-14 06:31:50 +01:00
Vladislav Dzhidzhoev
e0b76bafde
[lldb][test] Disable inline_sites_live.cpp for non-Windows targets (#116196)
This is a follow-up for the conversation here
https://github.com/llvm/llvm-project/pull/115722/.

This test is designed for Windows target/PDB format, so it shouldn't be
built and run for DWARF/etc.
2024-11-15 14:15:29 +01:00
Vladislav Dzhidzhoev
0afdac41ce
[lldb][test] Fix inline_sites_live.cpp Shell when run on Windows remotely from Linux (#115722)
This test fails on
https://lab.llvm.org/staging/#/builders/197/builds/76/steps/18/logs/FAIL__lldb-shell__inline_sites_live_cpp
because of a little difference in the lldb output.

```
# .---command stderr------------
# | C:\buildbot\as-builder-10\lldb-x-aarch64\llvm-project\lldb\test\Shell\SymbolFile\NativePDB\inline_sites_live.cpp:25:11: error: CHECK: expected string not found in input
# | // CHECK: * thread #1, stop reason = breakpoint 1
# |           ^
# | <stdin>:1:1: note: scanning from here
# | (lldb) platform select remote-linux
# | ^
# | <stdin>:28:27: note: possible intended match here
# | * thread #1, name = 'inline_sites_li', stop reason = breakpoint 1.3
# |                           ^
# | 

```
2024-11-13 18:49:32 +01:00
Vladislav Dzhidzhoev
20c4e95b9c
[lldb][test] Fix remote Shell tests failures on Windows host (#115716)
Since the remote Shell test execution feature was added, these tests
should now be disabled on Windows target instead of Windows host.

It should fix failures on
https://lab.llvm.org/staging/#/builders/197/builds/76.
2024-11-12 18:03:24 +01:00
Zequan Wu
0cfcd387f9
[lldb][NativePDB] Parse global variables. (#114303)
This doesn't parse S_CONSTANT case yet, because I found that the global
variable `std::strong_ordering::equal` is a S_CONSTANT and has type of
LF_STRUCTURE which is not currently handled when creating dwarf
expression for the variable. Left a TODO for it to finish later.

This makes `lldb/test/Shell/SymbolFile/PDB/ast-restore.test` and
`lldb/test/Shell/SymbolFile/PDB/calling-conventions-x86.test` pass on
windows with native pdb plugin only.
2024-11-01 14:15:54 -04:00
Jonas Devlieghere
cf3464bbb7
[lldb] Set LLDB_USE_NATIVE_PDB_READER at the directory level (#114455)
Lit allows you to set environment variables for all tests in a directory
using a `lit.local.cfg` file. Do this for the PDB and NativePDB tests.
2024-10-31 15:31:51 -07:00
Jonas Devlieghere
88591aa0ca
[lldb] Remove lldb-repro utility
Remove lldb-repro which was used to run the test suite against a
reproducer. The corresponding functionality has been removed from LLDB
so there's no need for the tool anymore.
2024-10-31 10:39:48 -07:00
Luke Drummond
b55c52c047 Revert "Renormalize line endings whitespace only after dccebddb3b80"
This reverts commit 9d98acb196a40fee5229afeb08f95fd36d41c10a.
2024-10-18 21:16:50 +01:00
Luke Drummond
9d98acb196 Renormalize line endings whitespace only after dccebddb3b80
Line ending policies were changed in the parent, dccebddb3b80. To make
it easier to resolve downstream merge conflicts after line-ending
policies are adjusted this is a separate whitespace-only commit. If you
have merge conflicts as a result, you can simply `git add --renormalize
-u && git merge --continue` or `git add --renormalize -u && git rebase
--continue` - depending on your workflow.
2024-10-17 14:49:26 +01:00
Adrian Prantl
d33fa70ddd [lldb] Inline expression evaluator error visualization (#106470)
This patch is a reworking of Pete Lawrence's (@PortalPete) proposal
for better expression evaluator error messages:
https://github.com/llvm/llvm-project/pull/80938

Before:

```
$ lldb -o "expr a+b"
(lldb) expr a+b
error: <user expression 0>:1:1: use of undeclared identifier 'a'
a+b
^
error: <user expression 0>:1:3: use of undeclared identifier 'b'
a+b
  ^
```

After:

```
(lldb) expr a+b
            ^ ^
            │ ╰─ error: use of undeclared identifier 'b'
            ╰─ error: use of undeclared identifier 'a'
```

This eliminates the confusing `<user expression 0>:1:3` source
location and avoids echoing the expression to the console again, which
results in a cleaner presentation that makes it easier to grasp what's
going on. You can't see it here, bug the word "error" is now also in
color, if so desired.

Depends on https://github.com/llvm/llvm-project/pull/106442.
2024-09-27 18:09:52 -07:00
Adrian Prantl
41dca012e5 Revert "[lldb] Inline expression evaluator error visualization (#106470)"
This reverts commit 49372d1cccf50f404d52d40ae4b663db5604eb2c.
2024-09-27 17:05:37 -07:00
Adrian Prantl
49372d1ccc
[lldb] Inline expression evaluator error visualization (#106470)
This patch is a reworking of Pete Lawrence's (@PortalPete) proposal
for better expression evaluator error messages:
https://github.com/llvm/llvm-project/pull/80938

Before:

```
$ lldb -o "expr a+b"
(lldb) expr a+b
error: <user expression 0>:1:1: use of undeclared identifier 'a'
a+b
^
error: <user expression 0>:1:3: use of undeclared identifier 'b'
a+b
  ^
```

After:

```
(lldb) expr a+b
            ^ ^
            │ ╰─ error: use of undeclared identifier 'b'
            ╰─ error: use of undeclared identifier 'a'
```

This eliminates the confusing `<user expression 0>:1:3` source
location and avoids echoing the expression to the console again, which
results in a cleaner presentation that makes it easier to grasp what's
going on. You can't see it here, bug the word "error" is now also in
color, if so desired.

Depends on https://github.com/llvm/llvm-project/pull/106442.
2024-09-27 16:32:35 -07:00
David Spickett
1459c627f0 [lldb][PDB] Fix message order in test case
Launch/stopped ordering was fixed by bd8f1068cad06b0f0342ac7ef351bf01c2e27322
but the Windows on Arm bot wasn't running at the time it landed.
2023-11-28 09:15:51 +00:00
Daniel Paoliello
a8138c3d2f [lldb] Fix inline_sites.test
Fixes `lldb/test/Shell/SymbolFile/NativePDB/inline_sites.test` to use the correct line number now that f2f36c9b29 is causing the inline call site info to be taken into account.
2023-09-06 11:20:39 -07:00
Adrian Prantl
59b5581833 Speculative fix for windows test 2023-06-12 14:51:24 -07:00
Michael Buch
73927d574f [lldb][test] incomplete-tag-type.cpp: fix expected error message
Follow up to 133c3eaac0a532380c3d6ad21a60da1490f51fb8

Differential Revision: https://reviews.llvm.org/D152590
2023-06-12 19:33:10 +01:00
Dave Lee
8c040d0f49 [lldb] Fix d875838e8b45cb0da5070298d0c1a2d1ee78ce7e 2023-03-17 10:45:46 -07:00
Dave Lee
d875838e8b [lldb][test] Replace use of p with expression in Shell tests (NFC)
In Shell tests, replace use of the `p` alias with the `expression` command.

To avoid conflating tests of the alias with tests of the expression command,
this patch canonicalizes to the use `expression`.

See also D141539 which made the same change to API tests.

Differential Revision: https://reviews.llvm.org/D146230
2023-03-17 10:29:24 -07:00
Michael Buch
ef7adbe2b7 Reland "[lldb][TypeSystemClang] Format pointers to member functions as eFormatHex"
Before this patch, LLDB used to format pointers to members, such as,
```
void (Foo::*pointer_to_member_func)() = &Foo::member_func;
```
as `eFormatBytes`. E.g.,
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) $1 = 94 3f 00 00 01 00 00 00 00 00 00 00 00 00 00 00
```

This patch makes sure we format pointers to member functions the same
way we do regular function pointers.

After this patch we format member pointers as:
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94
```

Differential Revision: https://reviews.llvm.org/D145241
2023-03-07 19:45:49 +00:00
Michael Buch
bc112b1447 Revert "[lldb][test] NativePDB/ast-types: fix expected pointer format"
Reverted because dependecies had to be reverted.

This reverts commit 96e39fdbb90b26191fc79b6226f299e3c10e559b.
2023-03-07 11:18:37 +00:00
Michael Buch
96e39fdbb9 [lldb][test] NativePDB/ast-types: fix expected pointer format
Format changed in `b642fd5ee250247ccefb38099169b4ee8ac4112b`

Differential Revision: https://reviews.llvm.org/D145241
2023-03-03 21:41:18 +00:00
Zequan Wu
6435fe699c [LLDB][NativePDB] Forcefully complete a record type if it has empty debug info and is required to have complete type.
It's required in following situations:
1. As a base class.
2. As a data member.
3. As an array element type.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D134066
2022-11-16 11:17:07 -08:00
Zequan Wu
a7fa5febaa [Test] Fix CHECK typo.
Differential Revision: https://reviews.llvm.org/D137287
2022-11-04 10:18:04 -07:00
Zequan Wu
d3492ed016 [LLDB][NativePDB] Fix struct layout when it has anonymous unions.
Previously, lldb mistook fields in anonymous union in a struct as the direct
field of the struct, which causes lldb crashes due to multiple fields sharing
the same offset in a struct. This patch fixes it.

MSVC generated pdb doesn't have the debug info entity representing a anonymous
union in a struct. It looks like the following:
```
struct S {
union {
  char c;
  int i;
};
};

0x1004 | LF_FIELDLIST [size = 40]
         - LF_MEMBER [name = `c`, Type = 0x0070 (char), offset = 0, attrs = public]
         - LF_MEMBER [name = `i`, Type = 0x0074 (int), offset = 0, attrs = public]
0x1005 | LF_STRUCTURE [size = 32] `S`
         unique name: `.?AUS@@`
         vtable: <no type>, base list: <no type>, field list: 0x1004
```
Clang generated pdb is similar, though due to the [[ https://github.com/llvm/llvm-project/issues/57999 | bug ]],
it's not more useful than the debug info above. But that's not very relavent,
lldb should still be able to understand MSVC geneerated pdb.
```
0x1003 | LF_UNION [size = 60] `S::<unnamed-tag>`
         unique name: `.?AT<unnamed-type-$S1>@S@@`
         field list: <no type>
         options: forward ref (= 0x1003) | has unique name | is nested, sizeof 0
0x1004 | LF_FIELDLIST [size = 40]
         - LF_MEMBER [name = `c`, Type = 0x0070 (char), offset = 0, attrs = public]
         - LF_MEMBER [name = `i`, Type = 0x0074 (int), offset = 0, attrs = public]
         - LF_NESTTYPE [name = ``, parent = 0x1003]
0x1005 | LF_STRUCTURE [size = 32] `S`
         unique name: `.?AUS@@`
         vtable: <no type>, base list: <no type>, field list: 0x1004
         options: contains nested class | has unique name, sizeof 4
0x1006 | LF_FIELDLIST [size = 28]
         - LF_MEMBER [name = `c`, Type = 0x0070 (char), offset = 0, attrs = public]
         - LF_MEMBER [name = `i`, Type = 0x0074 (int), offset = 0, attrs = public]
0x1007 | LF_UNION [size = 60] `S::<unnamed-tag>`
         unique name: `.?AT<unnamed-type-$S1>@S@@`
         field list: 0x1006
         options: has unique name | is nested | sealed, sizeof
```
This patch delays the FieldDecl creation when travesing LF_FIELDLIST so we know
if there are multiple fields are in the same offsets and are able to group them
into different anonymous unions based on offsets. Nested anonymous union will
be flatten into one anonymous union, because we simply don't have that info, but
they are equivalent in terms of union layout.

Differential Revision: https://reviews.llvm.org/D134849
2022-10-13 12:43:45 -07:00
Zequan Wu
d434f43720 [LLDB][NativePDB] Add class/union layout bit size.
Missing it causes lldb to crash or give incorrect result.

Differential Revision: https://reviews.llvm.org/D134656
2022-09-27 11:41:55 -07:00
Zequan Wu
d21b417025 [LLDB][NativePDB] ResolveSymbolContext should return the innermost block
Before, it returns the outermost blocks if nested blocks have the same
address range. That casuses lldb unable to find variables that are inside
inner blocks.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D133601
2022-09-16 10:19:09 -07:00
Zequan Wu
8704281c56 [LLDB][NativePDB] Global ctor and dtor should be global decls.
This fixes a crash that mistaken global ctor/dtor as funciton methods.

Differential Revision: https://reviews.llvm.org/D133446
2022-09-15 22:35:58 -07:00
Zequan Wu
aedad60231 [LLDB][NativePDB] Add local variables with no location info.
If we don't add local variables with no location info, when trying to print it,
lldb won't find it in the its parent DeclContext, which makes lldb to spend more
time to search all the way up in DeclContext hierarchy until found same name
variable or failed. Dwarf plugin also add local vars even if they don't have
location info.

Differential Revision: https://reviews.llvm.org/D133626
2022-09-12 12:01:24 -07:00
Zequan Wu
6037936989 [LLDB][NativePDB] Replace blocks.cpp with blocks.s so the test won't be affected by codegen changes. 2022-09-09 15:47:27 -07:00
Zequan Wu
32530e0493 [LLDB][NativePDB] Set block address range.
The block address range was missing before.

Differential Revision: https://reviews.llvm.org/D133461
2022-09-08 14:51:47 -07:00
Zequan Wu
9b825dcdb2 [LLDB][NativePDB] Fix PdbAstBuilder::GetParentDeclContext when ICF happens.
Removed `GetParentDeclContextForSymbol` as this is not necesssary. We can get
the demangled names from CVSymbol and then using it to create tag decl or
namespace decl. This also fixed a bug when icf applied.

Differential Revision: https://reviews.llvm.org/D133243
2022-09-08 10:42:12 -07:00
Zequan Wu
71d778f33e [LLDB][NativePDB] Switch to use DWARFLocationList.
Before, NativePDB uses scoped range as a workaround for value range, that causes
problems (e.g. a variable's value can only have one range, but usually a
variable's value is located at different address ranges, each at different
locations, in optimized build).
This patch let NativePDB switch to DWARFLocationList so a variable's value can
be described at multiple non-overlapped address ranges and each range maps to a
location.
Because overlapping ranges exists, here's peference when choosing ranges:
1. Always prefer whole value locations. Suppose a variable size is 8 bytes, one record is that for range [1, 5) first 4 bytes is at ecx, and another record is that for range [2, 8) the 8 bytes value is at rdx. This results: [1, 2) has first 4 bytes at ecx, [2, 8) has the whole value at rdx.
2. Always prefer the locations parsed later. Suppose first record is that for range [1, 5) value is at ecx, second record is that for range [2, 6) value is at eax. This results: [1, 2) -> ecx, [2, 6) -> eax.

Differential Revision: https://reviews.llvm.org/D130796
2022-08-17 13:37:13 -07:00
Zequan Wu
b8cf916b89 [LLDB][NativePDB] Add MSInheritanceAttr when creating pointer type that is a pointer to member.
Differential Revision: https://reviews.llvm.org/D129807
2022-07-19 15:36:35 -07:00
Muhammad Omair Javaid
68cc1eeb1d [LLDB] Fix NativePDB/local-variables.cpp for AArch64/Windows
This patch fixes NativePDB/local-variables.cpp test for AArch64 Windows.
There are two changes:
1) Replace function breakpoint with line breakpoint required due to pr56288
2) Adjust "target modules dump ast" test as the output was slightly different
on AArch64/Windows.
2022-07-12 16:26:47 +05:00
Zequan Wu
5c9f3ec4ad [LLDB][NativePDB] Check for missing type info to avoid crash.
NativePDB often assumes that all debug info are available.
This is one step to make it more pervasive.

Differential Revision: https://reviews.llvm.org/D125844
2022-05-25 13:19:27 -07:00
Zequan Wu
2fa2734690 [LLDB][NativePDB] Fix the case when S_DEFRANGE_SUBFIELD_REGISTERs are out of order.
Previously, I was assuming that S_DEFRANGE_SUBFIELD_REGISTERs are always in the
increasing order of offset_in_parent until I saw a counter example.

Using `std::map` so that they are sorted by offset_in_parent.

Differential Revision: https://reviews.llvm.org/D124061
2022-04-20 10:33:00 -07:00
Zequan Wu
2f78f9455f [LLDB][NativePDB] Fix subfield_register_simple_type.s test 2022-04-15 10:36:25 -07:00
Zequan Wu
3dbf524ad7 [LLDB][NativePDB] Fix a crash when S_DEFRANGE_SUBFIELD_REGISTER descirbes a simple type
When a variable is simple type and has 64 bits, the debug info may look like the following when targeting 32bit windows. The variable's content is split into two 32bits registers.
```
480 | S_LOCAL [size = 12] `x`
      type=0x0013 (__int64), flags = param
492 | S_DEFRANGE_SUBFIELD_REGISTER [size = 20]
      register = EAX, may have no name = true, offset in parent = 0
      range = [0001:0073,+7), gaps = []
512 | S_DEFRANGE_SUBFIELD_REGISTER [size = 20]
      register = ECX, may have no name = true, offset in parent = 4
      range = [0001:0073,+7), gaps = []
```

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D122943
2022-04-14 11:06:21 -07:00
Zequan Wu
ef7cba7148 [LLDB][NativePDB] Fix inline line info in line table
It fixes the following case:
```
0602      line 1 (+1)
0315      code 0x15 (+0x15)
0B2B      code 0x20 (+0xB) line 2 (+1)
0602      line 3 (+1)
0311      code 0x31 (+0x11)
...
```

Inline ranges should have following mapping:
`[0x15, 0x20) -> line 1`
`[0x20, 0x31) -> line 2`
Inline line entries:
`0x15, line 1`, `0x20, line 2`, `0x31, line 3`.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D123092
2022-04-14 11:00:56 -07:00
Zequan Wu
c50eec400c [LLDB] Add require x86 for NativePdb Test. 2022-04-01 10:39:06 -07:00
Zequan Wu
c45975cbf9 [LLDB][NativePDB] Create inline function decls
This creates inline functions decls in the TUs where the funcitons are inlined and local variable decls inside those functions.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D121967
2022-04-01 10:06:31 -07:00
David Spickett
9f052f3dd2 [lldb] Require x86 target for NativePDB test
This test would fail if you only build for example,
just the AArch64 backend, due to the x86 triple.
2022-03-18 12:31:03 +00:00