diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2020-11-18 11:55:55 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-03-03 19:09:34 +0000 |
commit | a7aac008f69ca48e5ab3d4186fdcb3214c6e1463 (patch) | |
tree | b41d57ca638eddfad54d9cfedf9b47c66106e34a /docs/users_guide/debug-info.rst | |
parent | 4b297979d25740d31241a9000e36068db112545a (diff) | |
download | haskell-a7aac008f69ca48e5ab3d4186fdcb3214c6e1463.tar.gz |
Add option to give each usage of a data constructor its own info table
The `-fdistinct-constructor-tables` flag will generate a fresh info
table for the usage of any data constructor. This is useful for
debugging as now by inspecting the info table, you can determine which
usage of a constructor caused that allocation rather than the old
situation where the info table always mapped to the definition site of
the data constructor which is useless.
In conjunction with `-hi` and `-finfo-table-map` this gives a more fine
grained understanding of where constructor allocations arise from in a
program.
Diffstat (limited to 'docs/users_guide/debug-info.rst')
-rw-r--r-- | docs/users_guide/debug-info.rst | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/users_guide/debug-info.rst b/docs/users_guide/debug-info.rst index ce640691a2..932cbf2b2e 100644 --- a/docs/users_guide/debug-info.rst +++ b/docs/users_guide/debug-info.rst @@ -373,10 +373,10 @@ to a source location. This lookup table is generated by using the ``-finfo-table :since: 9.2 For every usage of a data constructor in the source program - a new info table will be created. This is useful for debugging - as if each usage has a unique info table then the info table map - and profiling modes can distinguish the allocation sites of - a data constructor. + a new info table will be created. This is useful with + :ghc-flag:`-finfo-table-map` and the :rts-flag:`-hi` profiling mode as + each info table will correspond to the usage of a data constructor rather + than the data constructor itself. @@ -386,10 +386,11 @@ Querying the Info Table Map If it is generated then the info table map can be used in two ways. -1. The ``whereFrom`` function can be used to determine the source +1. The ``whereFrom`` Haskell function can be used to determine the source position which we think a specific closure was created. 2. The complete mapping is also dumped into the eventlog. -If you are using gdb then you can use the ``lookupIPE`` function +If you are using gdb then you can use the ``lookupIPE`` function (provided +by ``IPE.h`` and exported in the public API) directly in order to find any information which is known about the info table for a specific closure. |