mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-12 21:56:54 +00:00
fix offset in generated code (#129)
This commit is contained in:
parent
feaf0e86ed
commit
c1f672b262
@ -2286,7 +2286,7 @@ bool OICodeGen::generateStructDef(drgn_type* e, std::string& code) {
|
|||||||
|
|
||||||
structDefinition.append(" ");
|
structDefinition.append(" ");
|
||||||
structDefinition.append(*tmpStr);
|
structDefinition.append(*tmpStr);
|
||||||
structDefinition.append("{\n");
|
structDefinition.append(" {\n");
|
||||||
if (kind == DRGN_TYPE_UNION) {
|
if (kind == DRGN_TYPE_UNION) {
|
||||||
// Pad out unions
|
// Pad out unions
|
||||||
structDefinition.append("char union_padding[" + std::to_string(*sz) +
|
structDefinition.append("char union_padding[" + std::to_string(*sz) +
|
||||||
@ -2490,8 +2490,8 @@ std::optional<uint64_t> OICodeGen::generateMember(
|
|||||||
currOffsetBits = 0;
|
currOffsetBits = 0;
|
||||||
VLOG(1) << "Member size: " << memberSize;
|
VLOG(1) << "Member size: " << memberSize;
|
||||||
} else {
|
} else {
|
||||||
currOffsetBits = currOffsetBits + memberSize;
|
|
||||||
addSizeComment(config.genPaddingStats, code, currOffsetBits, memberSize);
|
addSizeComment(config.genPaddingStats, code, currOffsetBits, memberSize);
|
||||||
|
currOffsetBits = currOffsetBits + memberSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
code.append(*tmpStr);
|
code.append(*tmpStr);
|
||||||
|
Loading…
Reference in New Issue
Block a user