Commit 1eeaa5ad authored by Ashkan Kiaiesandjie's avatar Ashkan Kiaiesandjie
Browse files

assignements: tc-l: Add section for debug information

* assignements.texi: Here.
parent f0e7715c
......@@ -5,7 +5,7 @@
@settitle The Tiger Compiler Project Assignment
@c Updated when you save this file:
@set lastupdate April 14, 2016
@set lastupdate December 12, 2016
@set class 2019
@c Name of the project.
......@@ -452,6 +452,7 @@ TC-L, @acro{llvm ir}
* TC-L Code to Write:: Explanation on what you have to write
* TC-L FAQ:: Questions not to ask
* TC-L Improvements:: Other Designs
* TC-L Debug information:: Debugger bonus
Tools
......@@ -10306,6 +10307,7 @@ between strings.
* TC-L Code to Write:: Explanation on what you have to write
* TC-L FAQ:: Questions not to ask
* TC-L Improvements:: Other Designs
* TC-L Debug information:: Debugger bonus
@end menu
@node TC-L Goals
......@@ -10576,6 +10578,42 @@ class.
@end table
@node TC-L Debug information
@subsection TC-L Debug information
Adding debugging information is not easy and you should have a TC-L working
  • should have a correctly working TC-L. We will add some code into... and you can obviously add other files...

Please register or sign in to reply
correctly we will add some code into @code{src/llvmtranslate/translator.*} obviously you will
need to modify or create other files that we will deal with bellow.
Please register or sign in to reply
This link might help you to have a better understanding of how support debug information
Please register or sign in to reply
is done with llvm @href{http://llvm.org/docs/SourceLevelDebugging.html, Source Level Debugging}
What you will have to do and deal with:
@table @asis
@item TC-R
When adding debug information you don't want your symbols to be renamed into
Please register or sign in to reply
unique symbol. Indeed when debugging you want the actual name (the one from the source)
Please register or sign in to reply
of a function to break on it, or the actual name of variable to print it without
Please register or sign in to reply
as you have no idea of their renamed one. Thus renamer must be disable.
Please register or sign in to reply
@item Src/llvmtranslate/translator.*
Please register or sign in to reply
There you will have to emit locations for the node that you care about, manage scopes,
Please register or sign in to reply
and generate calls to @acro{llvm} intrinsic functions as @code{llvm.dbg.declare}
and @code{llvm.dbg.value} that use the metadata you generate (like locations for example)
to provide debug information.
@item Debug-type visitor
As have been done for TC-L tiger types have been translated to llvm types thanks to
Please register or sign in to reply
a visitor. This time you will have to create a new visitor to translate Tiger types
to llvm ditypes.
Please register or sign in to reply
@item Common problems
- When trying to debug your program using gdb after the debug informations have been
correctly generated, you can't step correctly in your source file then you should check
Please register or sign in to reply
your locations emission or nodes location.
- You generate wrong llvm code and nothing work anymore.
Please register or sign in to reply
@end table
@c ============================================================
@c ============================================================ Tools
@c ============================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment