Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004642OCaml~DO NOT USE (was: OCaml general)public2008-11-07 18:522008-11-08 17:11
Assigned Toxleroy 
PlatformOSOS Version
Product Version3.11.0+beta 
Target VersionFixed in Version 
Summary0004642: improve gnu ELF for valgrind
DescriptionThey is currently no way to use valgrind in callgrind mode for native ocaml programs.
Actually I checked valgrind sources and found that it ignores zero length symbols.
(checked with : valgrind --trace-symtab=yes ./test)
Symbol's length is computed with .size intructions which ocaml compiler doesn't add.

I'm a real beginner in ELF asm, but with some C reverse engineering I made a simple 2-lines patch which add theses intructions and open a new (great) way for debugging native programs!
Additional InformationI wrote a clean note (in french) with ELF examples and some examples of valgrind and kcachegrind use : [^]
TagsNo tags attached.
Attached Filespatch file icon patch-alter_elf_for_valgrind-cvs-20081107.patch [^] (926 bytes) 2008-11-07 18:52 [Show Content]

- Relationships

-  Notes
xleroy (administrator)
2008-11-08 17:11

I wasn't aware of the callgrind mode of valgrind, but that's an interesting alternative to gprof profiling. I'll add the .size declarations to the x86/ELF and amd64/ELF code generators, in release 3.11.

Concerning anonymous functions, it might be possible to encode line number information in the functions' names at relatively low cost. I haven't checked the details but that's something to keep in mind.

- Issue History
Date Modified Username Field Change
2008-11-07 18:52 apoirot New Issue
2008-11-07 18:52 apoirot File Added: patch-alter_elf_for_valgrind-cvs-20081107.patch
2008-11-08 17:11 xleroy Note Added: 0004714
2008-11-08 17:11 xleroy Assigned To => xleroy
2008-11-08 17:11 xleroy Status new => closed
2008-11-08 17:11 xleroy Resolution open => fixed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker