Skip to content

Instantly share code, notes, and snippets.

@vvuk
Created October 26, 2016 03:03
Show Gist options
  • Save vvuk/0112ab429e306d504f546d6a55a7bb82 to your computer and use it in GitHub Desktop.
Save vvuk/0112ab429e306d504f546d6a55a7bb82 to your computer and use it in GitHub Desktop.
diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index ebf80de..d787b2a 100644
--- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -693,6 +693,26 @@ void CodeViewDebug::emitDebugInfoForFunction(const Function *GV,
if (SP != nullptr)
emitDebugInfoForUDTs(LocalUDTs);
+ // Emit a S_FRAMEPROC
+ OS.AddComment("Record length");
+ OS.EmitIntValue(28, 2);
+ OS.AddComment("Record kind: S_FRAMEPROC");
+ OS.EmitIntValue(unsigned(SymbolKind::S_FRAMEPROC), 2);
+ OS.AddComment("Total frame bytes");
+ OS.EmitIntValue(0, 4);
+ OS.AddComment("Padding frame bytes");
+ OS.EmitIntValue(0, 4);
+ OS.AddComment("Offset to padding");
+ OS.EmitIntValue(0, 4);
+ OS.AddComment("Bytes of callee-saved registers");
+ OS.EmitIntValue(0, 4);
+ OS.AddComment("Offset of exception handler");
+ OS.EmitIntValue(0, 4);
+ OS.AddComment("Section ID of exception handler");
+ OS.EmitIntValue(0, 2);
+ OS.AddComment("Flags");
+ OS.EmitIntValue(unsigned(FrameProcedureOptions::Inlined), 4);
+
// We're done with this function.
OS.AddComment("Record length");
OS.EmitIntValue(0x0002, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment