You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4642 Reporter: apoirot Assigned to:@xavierleroy Status: closed (set by @xavierleroy on 2008-11-08T16:11:54Z) Resolution: fixed Priority: normal Severity: tweak Version: 3.11.0+beta Category: ~DO NOT USE (was: OCaml general)
Bug description
They 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!
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.
Original bug ID: 4642
Reporter: apoirot
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2008-11-08T16:11:54Z)
Resolution: fixed
Priority: normal
Severity: tweak
Version: 3.11.0+beta
Category: ~DO NOT USE (was: OCaml general)
Bug description
They 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 information
I wrote a clean note (in french) with ELF examples and some examples of valgrind and kcachegrind use :
http://blog.techno-barje.fr/post/2008/06/20/ocaml-callgraph
File attachments
The text was updated successfully, but these errors were encountered: