-
Notifications
You must be signed in to change notification settings - Fork 510
[Linux] Implement generation dwarf debuginfo for types and vars #5542
Conversation
// | ||
// type builder is used to convert .Net types into CodeView descriptors. | ||
// | ||
// Copyright (c) Microsoft. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please use our standard license headers on new files?
(I am fixing wrong license headers few existing files in #5544.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
The CI tests are failing with:
We are going to need a new objectwriter package uploaded to make this work. Do you think you could comment out this call, or ignore this exception, so that we can get the change through and work on unloading objectwriter package as separate step? |
9975c38
to
e319a4d
Compare
@jkotas I've added commit that fixes CI tests with current objwriter package. |
// | ||
// dwarf type builder implementation | ||
// | ||
// Copyright (c) Microsoft. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
std::string Name; | ||
int Size; | ||
DwarfMemberFunctionIdTypeInfo *MethodTypeInfo; | ||
std::vector<EHClauseInfo> EHClauseInfos; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the EHClauseInfo help with debugging - what does the debugger use it for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used to emit DW_TAG_try_block
and DW_TAG_catch_block
DIEs. They will be used in our lldb to fix stepping though try-catch block (similar approach is used for JITed code now).
@@ -10,6 +10,7 @@ interface IMethodCodeNode : IMethodNode, ISymbolDefinitionNode | |||
{ | |||
void SetCode(ObjectNode.ObjectData data); | |||
void InitializeFrameInfos(FrameInfo[] frameInfos); | |||
void InitializeEHClauseInfos(EHClauseInfo[] ehClauseInfos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be rather called DebugEHClauseInfo to make it clear it is just for debugger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
public void EmitEHClause(EHClauseInfo ehClause) | ||
{ | ||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to have all places with workarounds for the out-of-sync object writer package to be marked with a easy to search for TODO, with a link to #5177
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@davidwrighton @sandreenko Could you please take a look since you have done most work on the debuginfo emission so far? |
Could you please insert some examples of variables in gdb after your change? For example enum, struct, 1d/2d array, class with recursion, C# String. Thanks. |
- Ignore exceptions in GetPrimitiveTypeIndex and EmitEHClause methods - Call EmitDebugVarInfo only for Windows - Don't call GetMethodFunctionIdTypeIndex in EmitDebugFunctionInfo
@sandreenko using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
enum TestEnum
{
A,
B,
C,
D
}
struct TestStruct
{
public int Int;
public float Float;
}
class TestClass
{
public string String;
public TestClass Object;
public TestStruct Struct;
public TestClass(string Name)
{
String = Name;
Object = this;
Struct.Int = 10;
Struct.Float = 5.0F;
}
}
class Program
{
static int Main()
{
TestClass t = new TestClass("Test");
TestEnum e = TestEnum.B;
TestStruct s;
s.Int = (int)e;
int[] arr = new int[] {1, 2, 3, 4};
int[,] arr2 = new int[,] {{1, 2}, {3, 4}};
Console.WriteLine("Test " + t.String);
return 0;
}
} gdb output:
Type for enum vars is fixed in #5550 |
Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Just the object writer part. It is not built by default. |
…rs (dotnet#5542)" This reverts commit d78cf62.
No description provided.