mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-29 09:05:49 +00:00
Add DXIL bitstream parsing support for LEXICAL_BLOCK_FILE
This commit is contained in:
@@ -1236,6 +1236,7 @@ struct DIBase
|
||||
LocalVariable,
|
||||
Expression,
|
||||
LexicalBlock,
|
||||
LexicalBlockFile,
|
||||
Subrange,
|
||||
Namespace,
|
||||
ImportedEntity,
|
||||
|
||||
@@ -274,6 +274,15 @@ bool Program::ParseDebugMetaRecord(MetadataList &metadata, const LLVMBC::BlockOr
|
||||
|
||||
meta.dwarf = expr;
|
||||
}
|
||||
else if(id == LLVMBC::MetaDataRecord::LEXICAL_BLOCK_FILE)
|
||||
{
|
||||
meta.isDistinct = (metaRecord.ops[0] & 0x1);
|
||||
|
||||
meta.dwarf = new DILexicalBlockFile(metadata.getOrNULL(metaRecord.ops[1]),
|
||||
metadata.getOrNULL(metaRecord.ops[2]), metaRecord.ops[3]);
|
||||
|
||||
meta.children = {metadata.getOrNULL(metaRecord.ops[1]), metadata.getOrNULL(metaRecord.ops[2])};
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@@ -732,6 +741,20 @@ rdcstr DILexicalBlock::toString(bool dxcStyleFormatting) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
rdcstr DILexicalBlockFile::toString(bool dxcStyleFormatting) const
|
||||
{
|
||||
rdcstr ret = "!DILexicalBlockFile(";
|
||||
if(scope)
|
||||
ret += StringFormat::Fmt("scope: %s", scope->refString(dxcStyleFormatting).c_str());
|
||||
else
|
||||
ret += "scope: null";
|
||||
if(file)
|
||||
ret += StringFormat::Fmt(", file: %s", file->refString(dxcStyleFormatting).c_str());
|
||||
ret += StringFormat::Fmt(", discriminator: %llu", discriminator);
|
||||
ret += ")";
|
||||
return ret;
|
||||
}
|
||||
|
||||
rdcstr DISubrange::toString(bool dxcStyleFormatting) const
|
||||
{
|
||||
rdcstr ret = "!DISubrange(";
|
||||
|
||||
@@ -710,6 +710,21 @@ struct DILexicalBlock : public DIBase
|
||||
virtual rdcstr toString(bool dxcStyleFormatting) const;
|
||||
};
|
||||
|
||||
struct DILexicalBlockFile : public DIBase
|
||||
{
|
||||
static const DIBase::Type DIType = DIBase::LexicalBlockFile;
|
||||
DILexicalBlockFile(const Metadata *scope, const Metadata *file, uint64_t discriminator)
|
||||
: DIBase(DIType), scope(scope), file(file), discriminator(discriminator)
|
||||
{
|
||||
}
|
||||
|
||||
const Metadata *scope;
|
||||
const Metadata *file;
|
||||
uint64_t discriminator;
|
||||
|
||||
virtual rdcstr toString(bool dxcStyleFormatting) const;
|
||||
};
|
||||
|
||||
struct DISubrange : public DIBase
|
||||
{
|
||||
static const DIBase::Type DIType = DIBase::Subrange;
|
||||
|
||||
Reference in New Issue
Block a user