[PATCH] D26210: Define DbiStreamBuilder::addSectionContribs.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 11 14:42:01 PST 2016
zturner added inline comments.
================
Comment at: lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp:315
+ Entry.Size = Sec.SizeOfRawData;
+ Entry.Characteristics = Sec.Characteristics;
+ }
----------------
ruiu wrote:
> zturner wrote:
> > I think you should try to fill out `Entry.ISect` and `Entry.IMod`. The first one seems like it's probably just the index, so you could get it by iterating over using `llvm::enumerate()`. Not sure how you will get the last one, but it seems important nonetheless. What do you think?
> I will fill `ISect` but probably not `IMod` in this patch because I don't understand the meaning of the field yet.
`IMod` is the index of the module in the DBI Stream's `ModInfo` array. For example, if this section contribution is for `foo.obj`, and `foo.obj` is the 7th entry in the `ModInfo` array, then `IMod` would be 7. For example, if I run `-section-contribs` against `empty.pdb` I get this:
```
Section Contributions [
Contribution {
ISect: 1
Off: 0
Size: 10
Characteristics [ (0x60000020)
IMAGE_SCN_CNT_CODE (0x20)
IMAGE_SCN_MEM_EXECUTE (0x20000000)
IMAGE_SCN_MEM_READ (0x40000000)
]
Module {
Index: 1
Name: * Linker *
}
Data CRC: 0
Reloc CRC: 0
}
Contribution {
ISect: 1
Off: 16
Size: 10
Characteristics [ (0x60500020)
IMAGE_SCN_ALIGN_16BYTES (0x500000)
IMAGE_SCN_CNT_CODE (0x20)
IMAGE_SCN_MEM_EXECUTE (0x20000000)
IMAGE_SCN_MEM_READ (0x40000000)
]
Module {
Index: 0
Name: d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.obj
}
Data CRC: 3617027124
Reloc CRC: 0
}
```
We have indices of 1 and 0. Now if I run with `-modules`, I get this:
```
Modules [
{
Name: d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.obj
Debug Stream Index: 12
Object File Name: d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.obj
Num Files: 1
Source File Name Idx: 0
Pdb File Name Idx: 0
Line Info Byte Size: 0
C13 Line Info Byte Size: 88
Symbol Byte Size: 208
Type Server Index: 0
Has EC Info: No
}
{
Name: * Linker *
Debug Stream Index: 14
Object File Name:
Num Files: 0
Source File Name Idx: 0
Pdb File Name Idx: 1
Line Info Byte Size: 0
C13 Line Info Byte Size: 0
Symbol Byte Size: 516
Type Server Index: 0
Has EC Info: No
}
```
and we can see that the `IMod` field matches up with the order of the module in the module info array.
https://reviews.llvm.org/D26210
More information about the llvm-commits
mailing list