This is an archive of the discontinued LLVM Phabricator instance.

Support for OCaml native debugging
ClosedPublic

Authored by ebtaleb on Jul 8 2016, 5:53 AM.

Details

Summary

This introduces basic support for debugging OCaml binaries.
Use of the native compiler with DWARF emission support (see https://github.com/ocaml/ocaml/pull/574) is required.

Available variables are considered as 64 bits unsigned integers, their interpretation will be left to a OCaml-made debugging layer.

Diff Detail

Repository
rL LLVM

Event Timeline

ebtaleb updated this revision to Diff 63210.Jul 8 2016, 5:53 AM
ebtaleb retitled this revision from to Support for OCaml native debugging.
ebtaleb updated this object.
ebtaleb updated this object.Jul 8 2016, 5:57 AM
ebtaleb updated this object.
ebtaleb added a subscriber: lldb-commits.
clayborg requested changes to this revision.Jul 8 2016, 9:56 AM
clayborg edited edge metadata.

Just a few fixes and this will be ready.

include/lldb/lldb-forward.h
147 ↗(On Diff #63210)

You shouldn't have to add this into lldb-forward.h

368 ↗(On Diff #63210)

You shouldn't have to add this into lldb-forward.h

source/Plugins/Language/OCaml/CMakeLists.txt
4 ↗(On Diff #63210)

Add newline

This revision now requires changes to proceed.Jul 8 2016, 9:56 AM
source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4315 ↗(On Diff #63210)

From what I understood, when calculating addresses using location lists,
the location slide is computed as the absolute distance
between the function low PC and the CU low PC.

Then, in DWARFExpression, when testing whether a variable is available at a given PC,
the Evaluate method computes the absolute address ranges of the location list
(location list offset - location list slide + function base address) and test if
the current PC falls into that range.

The naive solution here is not maintainable here.

Is the default behaviour due to something specific to the way Clang generates
location list offsets?

What is the use of location slides when calculating location list addresses?
Can I overwrite location slide setting with a custom DWARF parser?
Or should I include the slide offset in the location list generation in the compiler itself?

ebtaleb updated this revision to Diff 64473.Jul 19 2016, 5:49 AM
ebtaleb updated this object.
ebtaleb removed a reviewer: tberghammer.
clayborg accepted this revision.Jul 25 2016, 1:23 PM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Jul 25 2016, 1:23 PM
This comment was removed by ebtaleb.
tberghammer accepted this revision.Aug 1 2016, 9:40 AM
tberghammer added a reviewer: tberghammer.
tberghammer added a subscriber: tberghammer.

Do you want me to commit it in for you?

Do you want me to commit it in for you?

Sure, if you don't mind. Thank you.

This revision was automatically updated to reflect the committed changes.