Skip to content
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

Improve again x86/ELF for GNU debugging tools #4888

Closed
vicuna opened this Issue Oct 5, 2009 · 5 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Oct 5, 2009

Original bug ID: 4888
Reporter: apoirot
Status: closed (set by @xavierleroy on 2013-08-31T10:48:45Z)
Resolution: fixed
Priority: normal
Severity: tweak
Version: 3.11.1
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #5487
Monitored by: meyer meurer @lefessan dschauer mehdi "Pascal Cuoq" @ygrek @glondu thelema till @hcarty

Bug description

A lot of debugging tools are based on two ELF declarations that ocaml compiler does not handle : .file and .loc.
By enabling these two little things you can :

I've already done a patch which modify all compilation chain in order to add a new fun_dbg:Debuginfo.t on all fun_decl types.
This attribute is filled in closure.ml:close_functions and then is just copied in each compilation step, with some new functions arguments in order to pass this new information.
-> patch-file-and-loc-v1-cvs-2008-11-11.patch

This is not the cleanest and best solution, but that's working for all function calls.
A better solution is to set the dbg:Debuginfo.t attribute in instruction type, and that for all instructions ... but I was really unable to do that!
Nor was I able to set this attribute just for the first instruction of all function...
But with this approach, we would be able to set breakpoint on any ocaml source code line! (instead of just function call with my current work)

Keep me in touch if you decide to get this solution or if you know any other way for adding these two declarations.

File attachments

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Dec 19, 2009

Comment author: dschauer

I had to patch asmcomp/amd64/emit.mlp as well in order for the patch-file-and-loc-v1-cvs-2008-11-11.patch to do me any good. At least I can break on function entry points now.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 7, 2010

Comment author: @damiendoligez

In order to do this properly, we'll have to propagate location information through the back-end. A good idea, but a lot of work.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Sep 30, 2011

Comment author: till

I tried to redo the patch propagating the location from the type system, see:

file_pos_amd64.patch

(Patch on the tip of the repo)

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Dec 16, 2011

Comment author: tgazagna

Recently, I've worked enhancing the support of GDB. The result is a serie of patches against 3.12.1 (including some patches from ygrek and Till). If there is an interest, I can pass some time to port them to trunk:

https://github.com/OCamlPro/ocaml-testing/compare/3.12.1...3.12.1-gdb

Feedback welcome.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Mar 14, 2012

Comment author: @xavierleroy

I believe (correct me if I'm wrong) that this functionality is part of Thomas Gazagnaire's patch (#5487), which is now merged in and will appear in release 4.00.

@vicuna vicuna closed this Aug 31, 2013

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.