#1955: Heap profiling on Windows doesn't work
----------------------------+-----------------------------------------------
Reporter: NeilMitchell | Owner: simonmar
Type: bug | Status: new
Priority: normal | Milestone: 6.8.3
Component: Runtime System | Version: 6.8.1
Severity: normal | Resolution:
Keywords: | Difficulty: Easy (1 hr)
Testcase: | Architecture: Unknown
Os: Windows |
----------------------------+-----------------------------------------------
Changes (by igloo):
* owner: => simonmar
Comment:
OK, part of the problem is that with the gcc 3.4.2 supplied with GHC the
`argv[0]` value is changed to be the path to the executable if we are in a
cygwin shell, but not if we are in a cmd shell; the 3.4.4 I have installed
works as I'd expect in either case.
With a cygwin shell:
{{{
$ cat argv0.c
#include <stdio.h>
int main(int argc, char **argv) {
printf("%s\n", argv[0]);
}
$ gcc -dumpversion
3.4.4
$ gcc argv0.c -o 344
$ c:/ghc/ghc-6.8.2/gcc -dumpversion
3.4.2
$ c:/ghc/ghc-6.8.2/gcc argv0.c -o 342
$ ./344
./344
$ ./342
C:\cygwin\home\ian\q\342.exe
}}}
In cmd:
{{{
C:\cygwin\home\ian\q>344
344
C:\cygwin\home\ian\q>342
342
}}}
Simon, I am assigning this bug to you as it'll need to be you who upgrades
the version of gcc that comes with the nightly Windows build.
After that, I think that the best thing is to drop this code from
`utils/hp2ps/Main.c`:
{{{
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)
DropSuffix(pathName, ".exe");
pathName = copystring2(pathName,".exe");
#endif
}}}
That way, if people use `foo.exe` to run the program then `hp2ps foo.exe`
will work, and likewise, if they use `foo` then `hp2ps foo` will work.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1955#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs