
I'm getting an error, printf not having enough arguments. I need to find where this is happening, and I understand there are ways of getting a stack trace, but apparently I need to compile for profiling. That means I need to compile my one library dependency (Text.XML.Light) for profiling, I believe. How do I do this? I'm on Windows and have only installed libraries in the past with cabal. D

Dennis Raddle writes:
I'm getting an error, printf not having enough arguments. I need to find where this is happening, and I understand there are ways of getting a stack trace, but apparently I need to compile for profiling. That means I need to compile my one library dependency (Text.XML.Light) for profiling, I believe. How do I do this? I'm on Windows and have only installed libraries in the past with cabal.
How many calls to `printf` do you actually have? Wouldn't a search for all calls and a quick inspection of them be good enough? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus If our ideas of intellectual property are wrong, we must change them, improve them and return them to their original purpose. When intellectual property rules diminish the supply of new ideas, they steal from all of us. -- Andrew Brown, November 19, 2005, The Guardian

I started by looking everywhere I thought I called printf in this
particular case, and couldn't find a single problematic printf. Given the
input I was using, I thought I knew where the printf was probably going to
be. But that failed, and there are hundreds throughout the rest of the
program. (I use them for generating output and warning/error messages--- I
happen to like the format string method of describing your output.)
Then I thought, I sure would like to learn more about the debugger and
profiling, so I thought it was worth asking. I never have gotten clear on
how to compile libraries for profiling.
While waiting for a reply here, it struck me where the printf was, and I
found it and solved the problem. So there's not an immediate need for the
stack trace.
D
On Sat, Dec 5, 2015 at 12:11 AM, Magnus Therning
Dennis Raddle writes:
I'm getting an error, printf not having enough arguments. I need to find where this is happening, and I understand there are ways of getting a stack trace, but apparently I need to compile for profiling. That means I need to compile my one library dependency (Text.XML.Light) for profiling, I believe. How do I do this? I'm on Windows and have only installed libraries in the past with cabal.
How many calls to `printf` do you actually have?
Wouldn't a search for all calls and a quick inspection of them be good enough?
/M
-- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus
If our ideas of intellectual property are wrong, we must change them, improve them and return them to their original purpose. When intellectual property rules diminish the supply of new ideas, they steal from all of us. -- Andrew Brown, November 19, 2005, The Guardian
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

Not sure about windows, but for Linux – you just do `stack build
--executable-profiling` (for cabal it's `cabal
--enable-executable-profiling`) to build with profiling.
Also, I want to recommend a package called formatting
http://hackage.haskell.org/package/formatting , which is a bit more
type-safe way to format strings:
format ("Person's name is " % text % ", age is " % hex) "Dave" 54
There are short-named formatters available, and if you omit spaces it would
look almost as dense as printf.
Cheers.
On Sat, Dec 5, 2015 at 2:50 AM, Dennis Raddle
I'm getting an error, printf not having enough arguments. I need to find where this is happening, and I understand there are ways of getting a stack trace, but apparently I need to compile for profiling. That means I need to compile my one library dependency (Text.XML.Light) for profiling, I believe. How do I do this? I'm on Windows and have only installed libraries in the past with cabal.
D
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

I wouldn't approach this from that perspective. If it's just a small codebase you might want to just grep -R "printf" . and look through each statement. To be honest I've never really used ghci for debugging (I'm definitely a beginner) but getting a stack trace seems like overkill and I'd be willing to bet ghci would be more productive anyway. If you really want to though the flag is -prof. To compile the library with it you could edit the .cabal file and add it under ghc-options. or cabal build --ghc-options="-prof" would probably also work. (if I'm wrong about any of the above I'd really appreciate it if someone more experienced than me would correct me so I don't make the same mistakes!) On 12/4/15 7:50 PM, Dennis Raddle wrote:
I'm getting an error, printf not having enough arguments. I need to find where this is happening, and I understand there are ways of getting a stack trace, but apparently I need to compile for profiling. That means I need to compile my one library dependency (Text.XML.Light) for profiling, I believe. How do I do this? I'm on Windows and have only installed libraries in the past with cabal.
D
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

On Sat, 05 Dec 2015 01:50:22 +0100, Dennis Raddle
I'm getting an error, printf not having enough arguments. I need to find where this is happening, and I understand there are ways of getting a stack trace, but apparently I need to compile for profiling. That means I need to compile my one library dependency (Text.XML.Light) for profiling, I believe. How do I do this? I'm on Windows and have only installed libraries in the past with cabal.
Try the GHCi debugger: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci-debugge... Regards, Henk-Jan van Tuyl -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --
participants (5)
-
Dennis Raddle
-
Henk-Jan van Tuyl
-
Kostiantyn Rybnikov
-
Magnus Therning
-
Thomas Jakway