[DynInst_API:] change in getFile from libdwarf to libdw


Date: Mon, 19 Mar 2018 15:08:11 -0500
From: "Mark W. Krentel" <krentel@xxxxxxxx>
Subject: [DynInst_API:] change in getFile from libdwarf to libdw
I apologize for bringing this up now, shortly before 10.x.  I
discussed this with Bill back in early January, but I guess neither of
us followed up on it.  (Unless someone can point me to a commit that
I've missed.)

There's a difference between libdwarf and libdw that affects SymtabAPI
9.x versus 10.x over how it presents a file name in the line map info,
especially for out of source builds.

Libdwarf, and SymtabAPI 9.x based on libdwarf, prepends the compilation
directory to return a full path name, for example:

/home/krentel/unknown/hpctoolkit/build-932/src/lib/banal/../../../../src/lib/banal/Struct.cpp

Libdw, and SymtabAPI 10.x, does not, for example:

../../../../src/lib/banal/Struct.cpp

This happens with both getFile() from getSourceLines() and with
inlined functions and getCallsite().

This change causes me a bit of a headache as we (hpctoolkit)
transition from Dyninst 9.x to 10.x.

I propose one of two solutions.  I can live with either of them.

(1) Declare the change as unintended and revert to the libdwarf
behavior by having Symtab prepend the comp dir so that getFile() and
getCallsite() return a full path.

(2) Accept the libdw behavior and provide a new method to return the
old answer.  Maybe something like getFilePath() for the full path.

Either way, I suggest that it would useful to add a method to Module
to return the compilation directory.  Maybe something like
Module::getCompDir() that returns the value from DW_AT_comp_dir.
That seems like a basic thing to make available.

That way, I could do the prepending myself.  Actually, right now, with
the relative path, I don't see a sufficient way to get all the info
for this.  (Unless I'm missing a method somewhere.)

Anyway, I'm mostly looking for a clear path that I can rely on going
forward.

Thanks,

--Mark


[← Prev in Thread] Current Thread [Next in Thread→]