summaryrefslogtreecommitdiff
path: root/rts/RtsStartup.c
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2014-10-05 21:20:39 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2014-10-05 22:10:08 +0100
commitcb0a503a44bf016de3d9042906c6ac0c0821ffea (patch)
tree02cd71760f54c6b5857eefc3d5f26f13fbf057aa /rts/RtsStartup.c
parent3549c952b535803270872adaf87262f2df0295a4 (diff)
downloadhaskell-cb0a503a44bf016de3d9042906c6ac0c0821ffea.tar.gz
rts: unrust 'libbfd' debug symbols parser
Summary: Patch does the following: - fixes detection of working libbfd on modern linux platforms (where bfd_uncompress_section_contents is a macro) - disables 'bfd' by default and adds '--enable-bfd-debug' configure option. As bfd's ABI is unstable the feature is primarily useful by ghc hackers. Not done (subject for another patch): - one-time bfd object memory leak in DEBUG_LoadSymbols - in '-dynamic' mode debugging symbols are loaded only for current executable, not all libraries it is linked against. Fixes Issue #8790 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: built unregisterised ghc on amd64 and ran './hello +RTS -Di' there Reviewers: simonmar, austin Reviewed By: simonmar, austin Subscribers: thomie, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D193 GHC Trac Issues: #8790
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r--rts/RtsStartup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index 98a43c0586..5e6f9fab54 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -19,6 +19,7 @@
#include "RtsFlags.h"
#include "RtsUtils.h"
#include "Prelude.h"
+#include "Printer.h" /* DEBUG_LoadSymbols */
#include "Schedule.h" /* initScheduler */
#include "Stats.h" /* initStats */
#include "STM.h" /* initSTM */
@@ -162,6 +163,11 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
rts_config.rts_opts_enabled, rts_config.rts_opts, rts_config.rts_hs_main);
}
+#ifdef DEBUG
+ /* load debugging symbols for current binary */
+ DEBUG_LoadSymbols((*argv)[0]);
+#endif /* DEBUG */
+
/* Initialise the stats department, phase 1 */
initStats1();