aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/SourceLevelDebugging.rst
diff options
context:
space:
mode:
authorChih-Ping Chen <chih-ping.chen@intel.com>2022-04-06 08:22:49 -0400
committerChih-Ping Chen <chih-ping.chen@intel.com>2022-04-15 16:38:23 -0400
commiteab6e94f912d014e6f19e1737ef81e36e4601faf (patch)
treeac3aaa61d4613284e68fb869e3bc07e3f92a117b /llvm/docs/SourceLevelDebugging.rst
parent39a68cc016ec3ef51091c1469b80c6733a9b7c5f (diff)
downloadllvm-eab6e94f912d014e6f19e1737ef81e36e4601faf.zip
llvm-eab6e94f912d014e6f19e1737ef81e36e4601faf.tar.gz
llvm-eab6e94f912d014e6f19e1737ef81e36e4601faf.tar.bz2
[DebugInfo] Add a TargetFuncName field in DISubprogram for
specifying DW_AT_trampoline as a string. Also update the signature of DIBuilder::createFunction to reflect this addition. Differential Revision: https://reviews.llvm.org/D123697
Diffstat (limited to 'llvm/docs/SourceLevelDebugging.rst')
-rw-r--r--llvm/docs/SourceLevelDebugging.rst23
1 files changed, 21 insertions, 2 deletions
diff --git a/llvm/docs/SourceLevelDebugging.rst b/llvm/docs/SourceLevelDebugging.rst
index ae26268..a9ce600 100644
--- a/llvm/docs/SourceLevelDebugging.rst
+++ b/llvm/docs/SourceLevelDebugging.rst
@@ -1086,8 +1086,8 @@ a Fortran front-end would generate the following descriptors:
!DILocalVariable(name: "string", arg: 1, scope: !10, file: !3, line: 4, type: !15)
!DIStringType(name: "character(*)!2", stringLength: !16, stringLengthExpression: !DIExpression(), size: 32)
-
-A fortran deferred-length character can also contain the information of raw storage of the characters in addition to the length of the string. This information is encoded in the stringLocationExpression field. Based on this information, DW_AT_data_location attribute is emitted in a DW_TAG_string_type debug info.
+
+A fortran deferred-length character can also contain the information of raw storage of the characters in addition to the length of the string. This information is encoded in the stringLocationExpression field. Based on this information, DW_AT_data_location attribute is emitted in a DW_TAG_string_type debug info.
!DIStringType(name: "character(*)!2", stringLengthExpression: !DIExpression(), stringLocationExpression: !DIExpression(DW_OP_push_object_address, DW_OP_deref), size: 32)
@@ -1105,6 +1105,25 @@ and this will materialize in DWARF tags as:
...
DW_AT_artificial (true)
+A Fortran front-end may need to generate a *trampoline* function to call a
+function defined in a different compilation unit. In this case, the front-end
+can emit the following descriptor for the trampoline function:
+
+.. code-block:: text
+
+ !DISubprogram(name: "sub1_.t0p", linkageName: "sub1_.t0p", scope: !4, file: !4, type: !5, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !7, retainedNodes: !24, targetFuncName: "sub1_")
+
+The targetFuncName field is the name of the function that the trampoline
+calls. This descriptor results in the following DWARF tag:
+
+.. code-block:: text
+
+ DW_TAG_subprogram
+ ...
+ DW_AT_linkage_name ("sub1_.t0p")
+ DW_AT_name ("sub1_.t0p")
+ DW_AT_trampoline ("sub1_")
+
Debugging information format
============================