New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved GDB support #5487
Comments
Comment author: @mshinwell I'm a strong supporter of having improved GDB support. I think it's worth spending some time looking at how this works (or could be made to work) on various architectures. For example, does it work on ARM? I have a feeling that for Mac OS X you may be able to use CFI directives by assembling using clang, which I think will end up using the LLVM assembler, rather than gas. |
Comment author: @xavierleroy Just to record what was discussed today with Thomas and others:
|
Comment author: tgazagna I've uploaded an archive which contains the 8 first patches rebased on trunk. I've also added a one-line patch to add location information on function calls and exception raising (so it is less precise that the 9th and 10th patches, but way shorter :-) And also, I've ported the file/loc patch on i386 as well. I don't have an i386 machine to test it, but the patch looks simple (2 lines in amscomp/i386/emit.mlp). |
Comment author: @xavierleroy "Rebased" patch committed in SVN trunk (rev 12179). Thanks! Re: testing on i386, it can be done rather easily on a Linux/x86-64 installation by forcing compilation in 32-bit mode: |
Original bug ID: 5487
Reporter: tgazagna
Status: closed (set by @xavierleroy on 2013-08-31T10:49:08Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.1
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #5505
Related to: #4888 #5603
Monitored by: tgazagna mehdi @ygrek @mshinwell jm @hcarty
Bug description
I have been working recently on improving the support of GDB for native code, mainly on x86 linux architectures. This work integrates patches from ygrek (#5314), Till Varoqueaux (#4888) and myself. Currently, it target ocaml-3.12.1 only and it supports:
So now it's possible to inspect crash dumps (and so should fix [2]), to debug multi-threaded native application in production (to find deadlocks) or to debug step-by-step a native application with C bindings. The patches also improve the accuracy of profiling tools.
Reading and writing OCaml values is not supported; however, it is possible to read OCaml values (when you know its address) using the mlvalues.py script from ygrek [1].
[1] http://ygrek.org.ua/p/code/mlvalues.py.html
[2] http://blog.incubaid.com/tag/gdb/
Additional information
The patch is well tested on amd64 linux. OSX does not support CFI directives (and hence will generate incorrect stacktraces).
I can port the patch to SVN trunk if it has any chance to be integrated. Some initial port to trunk (but not totally complete) has been done at https://github.com/OCamlPro/ocaml-testing
File attachments
The text was updated successfully, but these errors were encountered: