Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005583OCamlOCaml runtime systempublic2012-04-11 15:182012-05-07 12:05
Reporterygrek 
Assigned Todoligez 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
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
(0007400)
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?
(0007419)
ygrek (reporter)
2012-05-07 12:05

-g normally shouldn't change the generated code (but see http://stackoverflow.com/a/89619/118799 [^]), 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.

- 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker