caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Getting debugging symbols in ocamlopt-generated executable
@ 2003-08-20 13:25 Richard Jones
  2003-08-20 13:37 ` Xavier Leroy
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Jones @ 2003-08-20 13:25 UTC (permalink / raw)
  To: caml-list


(This is a Windows question)

I'm trying to debug a segfault which occurs in a natively-compiled
executable but not in the bytecode-equivalent program. I suspect that
the crash happens in libocamole.lib which is a C++ library linked
statically to the program. AFAICT libocamole.lib contains symbols (how
the hell _do_ you tell this sort of thing under Windows??).

The final link stage is:

ocamlopt -w s -I e:/d/cjs/libs/ocamole-pre.3b ocamole.cmxa excel.cmxa exceldemo.cmx -o exceldemo.opt.exe

This produces exceldemo.opt.exe (which crashes), but VC++ tells me
that this executable doesn't contain any symbols. Debugging the
assembly is not much fun.

How do I get symbols?

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you.
PTHRLIB is a library for writing small, efficient and fast servers in C.
HTTP, CGI, DBI, lightweight threads: http://www.annexia.org/freeware/pthrlib/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Getting debugging symbols in ocamlopt-generated executable
  2003-08-20 13:25 [Caml-list] Getting debugging symbols in ocamlopt-generated executable Richard Jones
@ 2003-08-20 13:37 ` Xavier Leroy
  2003-08-20 14:02   ` Richard Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Xavier Leroy @ 2003-08-20 13:37 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list

> This produces exceldemo.opt.exe (which crashes), but VC++ tells me
> that this executable doesn't contain any symbols. Debugging the
> assembly is not much fun.
> How do I get symbols?

You could try to pass the appropriate option to the C linker using
-ccopt during the final link stage.
For the MSVC port:
        ocamlopt -ccopt /Zi ....
For the Mingw port:
        ocamlopt -ccopt -g ...

I'm not 100% sure it works, but it's worth a try.

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Getting debugging symbols in ocamlopt-generated executable
  2003-08-20 13:37 ` Xavier Leroy
@ 2003-08-20 14:02   ` Richard Jones
  2003-08-20 14:26     ` Nicolas Cannasse
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Jones @ 2003-08-20 14:02 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list

Thanks! Worked.

Just out of interest, when I add this same option to the (GNU) Makefile,
I see:

ocamlopt -w s -I e:/d/cjs/libs/ocamole-pre.3b -ccopt "/Zi" ocamole.cmxa excel.cmxa exceldemo.cmx -o exceldemo.opt.exe
Command line warning D4024 : unrecognized source file type 'c:/msys/1.0/Zi', object file assumed
LINK : fatal error LNK1181: cannot open input file "c:/msys/1.0/Zi.obj"
Error during linking

I have no idea where it gets c:/msys/1.0/Zi from. Could this be
GNU make trying to rewrite paths or something??

But it works when typed in from the command line, and that's the
main thing.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you.
"I wish more software used text based configuration files!"
 -- A Windows NT user, quoted on Slashdot.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Getting debugging symbols in ocamlopt-generated executable
  2003-08-20 14:02   ` Richard Jones
@ 2003-08-20 14:26     ` Nicolas Cannasse
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Cannasse @ 2003-08-20 14:26 UTC (permalink / raw)
  To: Xavier Leroy, Richard Jones; +Cc: caml-list

> Thanks! Worked.
>
> Just out of interest, when I add this same option to the (GNU) Makefile,
> I see:
>
> ocamlopt -w s -I e:/d/cjs/libs/ocamole-pre.3b -ccopt "/Zi" ocamole.cmxa
excel.cmxa exceldemo.cmx -o exceldemo.opt.exe
> Command line warning D4024 : unrecognized source file type
'c:/msys/1.0/Zi', object file assumed
> LINK : fatal error LNK1181: cannot open input file "c:/msys/1.0/Zi.obj"
> Error during linking
>
> I have no idea where it gets c:/msys/1.0/Zi from. Could this be
> GNU make trying to rewrite paths or something??
>
> But it works when typed in from the command line, and that's the
> main thing.

Just a guess...
Maybe GNU make (is it cygwin one ?) is replacing the / unix path character
by a \ DOS before running the command.

Nicolas Cannasse

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-20 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-20 13:25 [Caml-list] Getting debugging symbols in ocamlopt-generated executable Richard Jones
2003-08-20 13:37 ` Xavier Leroy
2003-08-20 14:02   ` Richard Jones
2003-08-20 14:26     ` Nicolas Cannasse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).