[Haskell-cafe] Breaking in library, and getting stacktrace

11 views
Skip to first unread message

Constantine Kharlamov

unread,
Jul 28, 2016, 9:43:14 AM7/28/16
to haskel...@haskell.org
I'm trying to find a function reacting for key press in Haskell application. For whatever reason I didn't manage to find the code with grepping. I could probably ask at their mailing list, but that gives me a more general question:
 
is there a way to set a breakpoint on a library call, and get a stracktrace?
 
I.e. if I were to debug C++/C code, I'd find a library function reacting on a key press, set a breakpoint (perhaps conditional) there, and upon a break I'd look at backtrace, and find the function (given, an app compiled with debugging symbols).
 
Can I do the same, i.e. set a break somewhere in a c-style library, and get Haskell stacktrace out of there?
 
I do understand that ghc is free to reorder function calls, but I don't think it matters very much in my particular case.

Carlos D'Agostino

unread,
Jul 29, 2016, 8:34:10 AM7/29/16
to haskel...@haskell.org, hi-a...@ya.ru
Without knowing too much about your project setup, and if I'm understanding correctly, see


Keep in mind that you have to build with the corresponding flags in order to get it working correctly. Assuming you're using stack that would be:

stack build --enable-profiling --library-profiling --ghc-options="-fprof-auto-rtsopts"

Though I'm not sure if that's 100% what you're looking for since it doesn't break as much as that it logs with a stack trace.

Hope it helps!

 
----------------------------------------------------------------------

Message: 1
Date: Thu, 28 Jul 2016 16:43:03 +0300
From: Constantine Kharlamov <hi-a...@ya.ru>
To: haskel...@haskell.org
Subject: [Haskell-cafe] Breaking in library, and getting stacktrace
Message-ID: <1473614...@web5j.yandex.ru>
Content-Type: text/plain; charset="utf-8"

An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160728/b4652af8/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe


------------------------------

End of Haskell-Cafe Digest, Vol 155, Issue 33
*********************************************



--
Carlos D'Agostino.
Reply all
Reply to author
Forward
0 new messages