<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>Use llvm::endianness::{big,little,native} (NFC)</title>
<updated>2023-10-11T05:54:51+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-10-11T05:54:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b8885926f8115d5fe2c06907e066cae061d5f230'/>
<id>b8885926f8115d5fe2c06907e066cae061d5f230</id>
<content type='text'>
Note that llvm::support::endianness has been renamed to
llvm::endianness while becoming an enum class as opposed to an enum.
This patch replaces llvm::support::{big,little,native} with
llvm::endianness::{big,little,native}.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note that llvm::support::endianness has been renamed to
llvm::endianness while becoming an enum class as opposed to an enum.
This patch replaces llvm::support::{big,little,native} with
llvm::endianness::{big,little,native}.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB][PDB] Fix age field in UUID in PDB file.</title>
<updated>2023-06-06T15:24:50+00:00</updated>
<author>
<name>Zequan Wu</name>
<email>zequanwu@google.com</email>
</author>
<published>2023-06-05T19:07:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cb9a7c22ee6789569e28dde073e6827761b4d003'/>
<id>cb9a7c22ee6789569e28dde073e6827761b4d003</id>
<content type='text'>
There are two age fields in a PDB file. One from the PDB Stream and another one
from the DBI stream.

According to https://randomascii.wordpress.com/2011/11/11/source-indexing-is-underused-awesomeness/#comment-34328,
The age in DBI stream is used to against the binary's age. `Pdbstr.exe` is used
to only increment the age from PDB stream without changing the DBI age. I
also verified this by manually changing the DBI age of a PDB file and let
`windbg.exe` to load it. It shows the following logs before and after changing:

Before:
```
SYMSRV:  BYINDEX: 0xA
         c:\symbols*https://msdl.microsoft.com/download/symbols
         nlaapi.pdb
         D72AA69CD5ABE5D28C74FADB17DE3F8C1
SYMSRV:  PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
SYMSRV:  RESULT: 0x00000000
*** WARNING: Unable to verify checksum for NLAapi.dll
DBGHELP: NLAapi - public symbols
        c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
...
```

After:
```
SYMSRV:  BYINDEX: 0xA
         c:\symbols*https://msdl.microsoft.com/download/symbols
         nlaapi.pdb
         D72AA69CD5ABE5D28C74FADB17DE3F8C1
SYMSRV:  PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
SYMSRV:  RESULT: 0x00000000
DBGHELP: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb - mismatched pdb
SYMSRV:  BYINDEX: 0xB
         c:\symbols*https://chromium-browser-symsrv.commondatastorage.googleapis.com
         nlaapi.pdb
         D72AA69CD5ABE5D28C74FADB17DE3F8C1
SYMSRV:  PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
SYMSRV:  RESULT: 0x00000000
DBGHELP: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb - mismatched pdb
SYMSRV:  BYINDEX: 0xC
         c:\src\symbols*https://msdl.microsoft.com/download/symbols
         nlaapi.pdb
         D72AA69CD5ABE5D28C74FADB17DE3F8C1
SYMSRV:  PATH: c:\src\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
SYMSRV:  RESULT: 0x00000000
*** WARNING: Unable to verify checksum for NLAapi.dll
DBGHELP: NLAapi - public symbols
        c:\src\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
```

So, `windbg.exe` uses the DBI age to detect mismatched pdb, but it still loads
the pdb even if the age mismatched. Probably lldb should do the same and give
some warnings.

This fixes a bug that lldb can't load some windows system pdbs due to mismatched
uuid.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D152189
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are two age fields in a PDB file. One from the PDB Stream and another one
from the DBI stream.

According to https://randomascii.wordpress.com/2011/11/11/source-indexing-is-underused-awesomeness/#comment-34328,
The age in DBI stream is used to against the binary's age. `Pdbstr.exe` is used
to only increment the age from PDB stream without changing the DBI age. I
also verified this by manually changing the DBI age of a PDB file and let
`windbg.exe` to load it. It shows the following logs before and after changing:

Before:
```
SYMSRV:  BYINDEX: 0xA
         c:\symbols*https://msdl.microsoft.com/download/symbols
         nlaapi.pdb
         D72AA69CD5ABE5D28C74FADB17DE3F8C1
SYMSRV:  PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
SYMSRV:  RESULT: 0x00000000
*** WARNING: Unable to verify checksum for NLAapi.dll
DBGHELP: NLAapi - public symbols
        c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
...
```

After:
```
SYMSRV:  BYINDEX: 0xA
         c:\symbols*https://msdl.microsoft.com/download/symbols
         nlaapi.pdb
         D72AA69CD5ABE5D28C74FADB17DE3F8C1
SYMSRV:  PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
SYMSRV:  RESULT: 0x00000000
DBGHELP: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb - mismatched pdb
SYMSRV:  BYINDEX: 0xB
         c:\symbols*https://chromium-browser-symsrv.commondatastorage.googleapis.com
         nlaapi.pdb
         D72AA69CD5ABE5D28C74FADB17DE3F8C1
SYMSRV:  PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
SYMSRV:  RESULT: 0x00000000
DBGHELP: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb - mismatched pdb
SYMSRV:  BYINDEX: 0xC
         c:\src\symbols*https://msdl.microsoft.com/download/symbols
         nlaapi.pdb
         D72AA69CD5ABE5D28C74FADB17DE3F8C1
SYMSRV:  PATH: c:\src\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
SYMSRV:  RESULT: 0x00000000
*** WARNING: Unable to verify checksum for NLAapi.dll
DBGHELP: NLAapi - public symbols
        c:\src\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
```

So, `windbg.exe` uses the DBI age to detect mismatched pdb, but it still loads
the pdb even if the age mismatched. Probably lldb should do the same and give
some warnings.

This fixes a bug that lldb can't load some windows system pdbs due to mismatched
uuid.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D152189
</pre>
</div>
</content>
</entry>
<entry>
<title>Change the meaning of a UUID with all zeros for data.</title>
<updated>2022-08-30T17:17:58+00:00</updated>
<author>
<name>Jim Ingham</name>
<email>jingham@apple.com</email>
</author>
<published>2022-08-19T00:20:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5ad6ed0e5519ed26442cd0a21cdb07f5c53b854e'/>
<id>5ad6ed0e5519ed26442cd0a21cdb07f5c53b854e</id>
<content type='text'>
Previously, depending on how you constructed a UUID from data or a
StringRef, an input value of all zeros was valid (e.g. setFromData)
or not (e.g. setFromOptionalData).  Since there was no way to tell
which interpretation to use, it was done somewhat inconsistently.
This standardizes the meaning of a UUID of all zeros to Not Valid,
and removes all the Optional methods and their uses, as well as the
static factories that supported them.

Differential Revision: https://reviews.llvm.org/D132191
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, depending on how you constructed a UUID from data or a
StringRef, an input value of all zeros was valid (e.g. setFromData)
or not (e.g. setFromOptionalData).  Since there was no way to tell
which interpretation to use, it was done somewhat inconsistently.
This standardizes the meaning of a UUID of all zeros to Not Valid,
and removes all the Optional methods and their uses, as well as the
static factories that supported them.

Differential Revision: https://reviews.llvm.org/D132191
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Stop passing both i386 and i686 in parallel as architectures on Windows</title>
<updated>2022-07-06T09:13:36+00:00</updated>
<author>
<name>Martin Storsjö</name>
<email>martin@martin.st</email>
</author>
<published>2022-06-23T11:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4270c9cd44f2703bc5376ff085d0add156af9080'/>
<id>4270c9cd44f2703bc5376ff085d0add156af9080</id>
<content type='text'>
When an object file returns multiple architectures, it is treated
as a fat binary - which really isn't the case of i386 vs i686 where
the object file actually has one architecture.

This allows getting rid of hardcoded architecture triples in
PlatformWindows.

The parallel i386 and i686 architecture strings stem from
5e6f45201f0b62c1e7a24fc396f3ea6e10dc880d / D7120 and
ad587ae4ca143d388c0ec4ef2faa1b5eddedbf67 / D4658.

Differential Revision: https://reviews.llvm.org/D128617
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When an object file returns multiple architectures, it is treated
as a fat binary - which really isn't the case of i386 vs i686 where
the object file actually has one architecture.

This allows getting rid of hardcoded architecture triples in
PlatformWindows.

The parallel i386 and i686 architecture strings stem from
5e6f45201f0b62c1e7a24fc396f3ea6e10dc880d / D7120 and
ad587ae4ca143d388c0ec4ef2faa1b5eddedbf67 / D4658.

Differential Revision: https://reviews.llvm.org/D128617
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Change CreateMemoryInstance to take a WritableDataBuffer</title>
<updated>2022-04-05T20:46:41+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2022-04-05T20:33:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f2ea125ea09d9e4512fa08a89eac5e0069d83738'/>
<id>f2ea125ea09d9e4512fa08a89eac5e0069d83738</id>
<content type='text'>
Change the CreateMemoryInstance interface to take a WritableDataBuffer.

Differential revision: https://reviews.llvm.org/D123073
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change the CreateMemoryInstance interface to take a WritableDataBuffer.

Differential revision: https://reviews.llvm.org/D123073
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Prevent object file plugins from changing the data buffer</title>
<updated>2022-04-04T16:24:24+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2022-04-04T16:17:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c69307e5eeb585203a68b24f020d17ad75821c8a'/>
<id>c69307e5eeb585203a68b24f020d17ad75821c8a</id>
<content type='text'>
The current design allows that the object file contents could be mapped
by one object file plugin and then used by another. Presumably the idea
here was to avoid mapping the same file twice.

This becomes an issue when one object file plugin wants to map the file
differently from the others. For example, ObjectFileELF needs to map its
memory as writable while others likeObjectFileMachO needs it to be
mapped read-only.

This patch prevents plugins from changing the buffer by passing them is
by value rather than by reference.

Differential revision: https://reviews.llvm.org/D122944
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current design allows that the object file contents could be mapped
by one object file plugin and then used by another. Presumably the idea
here was to avoid mapping the same file twice.

This becomes an issue when one object file plugin wants to map the file
differently from the others. For example, ObjectFileELF needs to map its
memory as writable while others likeObjectFileMachO needs it to be
mapped read-only.

This patch prevents plugins from changing the buffer by passing them is
by value rather than by reference.

Differential revision: https://reviews.llvm.org/D122944
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Remove ConstString from GetPluginNameStatic of some plugins</title>
<updated>2021-10-21T10:58:45+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2021-10-18T08:39:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2ace1e5753a49195ca17f3e175c7e189cf147760'/>
<id>2ace1e5753a49195ca17f3e175c7e189cf147760</id>
<content type='text'>
This patch deals with ObjectFile, ObjectContainer and OperatingSystem
plugins. I'll convert the other types in separate patches.

In order to enable piecemeal conversion, I am leaving some ConstStrings
in the lowest PluginManager layers. I'll convert those as the last step.

Differential Revision: https://reviews.llvm.org/D112061
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch deals with ObjectFile, ObjectContainer and OperatingSystem
plugins. I'll convert the other types in separate patches.

In order to enable piecemeal conversion, I am leaving some ConstStrings
in the lowest PluginManager layers. I'll convert those as the last step.

Differential Revision: https://reviews.llvm.org/D112061
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Reordering parameters in getFile and getFileOrSTDIN</title>
<updated>2021-03-25T13:47:49+00:00</updated>
<author>
<name>Abhina Sreeskantharajan</name>
<email>Abhina.Sreeskantharajan@ibm.com</email>
</author>
<published>2021-03-25T13:47:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6'/>
<id>c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6</id>
<content type='text'>
In future patches I will be setting the IsText parameter frequently so I will refactor the args to be in the following order. I have removed the FileSize parameter because it is never used.

```
  static ErrorOr&lt;std::unique_ptr&lt;MemoryBuffer&gt;&gt;
  getFile(const Twine &amp;Filename, bool IsText = false,
          bool RequiresNullTerminator = true, bool IsVolatile = false);

  static ErrorOr&lt;std::unique_ptr&lt;MemoryBuffer&gt;&gt;
  getFileOrSTDIN(const Twine &amp;Filename, bool IsText = false,
                 bool RequiresNullTerminator = true);

 static ErrorOr&lt;std::unique_ptr&lt;MB&gt;&gt;
 getFileAux(const Twine &amp;Filename, uint64_t MapSize, uint64_t Offset,
            bool IsText, bool RequiresNullTerminator, bool IsVolatile);

  static ErrorOr&lt;std::unique_ptr&lt;WritableMemoryBuffer&gt;&gt;
  getFile(const Twine &amp;Filename, bool IsVolatile = false);
```

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D99182
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In future patches I will be setting the IsText parameter frequently so I will refactor the args to be in the following order. I have removed the FileSize parameter because it is never used.

```
  static ErrorOr&lt;std::unique_ptr&lt;MemoryBuffer&gt;&gt;
  getFile(const Twine &amp;Filename, bool IsText = false,
          bool RequiresNullTerminator = true, bool IsVolatile = false);

  static ErrorOr&lt;std::unique_ptr&lt;MemoryBuffer&gt;&gt;
  getFileOrSTDIN(const Twine &amp;Filename, bool IsText = false,
                 bool RequiresNullTerminator = true);

 static ErrorOr&lt;std::unique_ptr&lt;MB&gt;&gt;
 getFileAux(const Twine &amp;Filename, uint64_t MapSize, uint64_t Offset,
            bool IsText, bool RequiresNullTerminator, bool IsVolatile);

  static ErrorOr&lt;std::unique_ptr&lt;WritableMemoryBuffer&gt;&gt;
  getFile(const Twine &amp;Filename, bool IsVolatile = false);
```

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D99182
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][NFC] Refactor getUUID functionality</title>
<updated>2020-10-30T17:44:37+00:00</updated>
<author>
<name>Zequan Wu</name>
<email>zequanwu@google.com</email>
</author>
<published>2020-10-28T18:23:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4348e0eee4dd49623cbf315c52d11f413ed438be'/>
<id>4348e0eee4dd49623cbf315c52d11f413ed438be</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D90325
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D90325
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][PDB] Add ObjectFile PDB plugin</title>
<updated>2020-10-26T17:28:48+00:00</updated>
<author>
<name>Zequan Wu</name>
<email>zequanwu@google.com</email>
</author>
<published>2020-10-20T18:15:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=242e1e9910441ad00118e580e4cbd5743c77ea5e'/>
<id>242e1e9910441ad00118e580e4cbd5743c77ea5e</id>
<content type='text'>
To allow loading PDB file with `target symbols add` command.

Differential Revision: https://reviews.llvm.org/D89812
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To allow loading PDB file with `target symbols add` command.

Differential Revision: https://reviews.llvm.org/D89812
</pre>
</div>
</content>
</entry>
</feed>
