Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005583OCamlruntime system and C interfacepublic2012-04-11 15:182016-12-08 10:10
Assigned Todoligez 
PrioritynormalSeverityfeatureReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.04.0 
Summary0005583: debug info for OCaml runtime
DescriptionPlease compile the C code comprising OCaml runtime with debug information, so that looking into internal structures with gdb at run time is easier.

E.g. currently :

(gdb) p &caml_ref_table
$1 = (<data variable, no debug info> *) 0xbed2c0

Also when compiling C bindings ocamlc should do the same.

Currently -g is enabled for the debug runtime, but it has runtime cost due to -DDEBUG.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2012-05-02 16:53

What is the cost of doing this? Does -g preclude some optimizations? How much bigger is the executable? How many people want to look at the runtime with gdb? Don't they already know how to recompile with symbols?
ygrek (reporter)
2012-05-07 12:05

-g normally shouldn't change the generated code (but see [^]), it only adds debugging sections, so the executable naturally becomes bigger. Those sections are not loaded at runtime, so the RAM usage is not affected. Debugger maps those sections to memory when needed. Moreover, debug info can be stripped from the binaries and distributed separately (that's a common practice in various distros, witness -dbg packages in debian).

Size change after ./configure -cc 'gcc -g' :

lib/ocaml/*.a : 3.7M -> 5.9M
libasmrun.a : 296K -> 824K
libcamlrun.a : 344K -> 968K

Probably those who need it can recompile manually. My reason was that it doesn't hurt and can be useful sometimes.
shinwell (developer)
2016-12-08 10:10

In 4.04 the runtime is compiled with -g.

- Issue History
Date Modified Username Field Change
2012-04-11 15:18 ygrek New Issue
2012-05-02 16:53 doligez Note Added: 0007400
2012-05-02 16:53 doligez Assigned To => doligez
2012-05-02 16:53 doligez Status new => feedback
2012-05-07 12:05 ygrek Note Added: 0007419
2012-05-07 12:05 ygrek Status feedback => assigned
2016-12-08 10:10 shinwell Note Added: 0016825
2016-12-08 10:10 shinwell Status assigned => resolved
2016-12-08 10:10 shinwell Fixed in Version => 4.04.0
2016-12-08 10:10 shinwell Resolution open => fixed
2017-02-23 16:43 doligez Category OCaml runtime system => runtime system
2017-03-03 17:45 doligez Category runtime system => runtime system and C interface

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker