Re: [DynInst_API:] change in getFile from libdwarf to libdw


Date: Tue, 20 Mar 2018 20:46:39 +0000
From: Sasha Da Rocha Pinheiro <darochapinhe@xxxxxxxx>
Subject: Re: [DynInst_API:] change in getFile from libdwarf to libdw

Hi Mark,

I tested this myself. I am getting the full path with Statement getFile(), with libdw.


Bill told me he remembers doing some change that corrected it at some point.

I suspect it's the commit 84ffda2a8cca36b1c8f34c4eab9f1319989014ab.

But I'm not sure, this commit has a lot of changes.


What commit are you at that you're getting relative path?


Sasha


From: Dyninst-api <dyninst-api-bounces@xxxxxxxxxxx> on behalf of Mark W. Krentel <krentel@xxxxxxxx>
Sent: Monday, March 19, 2018 3:08:11 PM
To: dyninst-api@xxxxxxxxxxx
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


_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
[← Prev in Thread] Current Thread [Next in Thread→]