public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: [RFC] libdw: prepend current directory in read_srclines
       [not found]     ` <608A6FA9-0831-4640-A3A1-9D11B9DFD930@gmx.de>
@ 2017-05-05 12:11       ` Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2017-05-05 12:11 UTC (permalink / raw)
  To: Torsten Polle; +Cc: elfutils-devel, systemtap

Hi Torsten,

On Wed, 2017-05-03 at 22:34 +0200, Torsten Polle wrote:
> I compile the simple program relative.c:
> 
> int main()
> {
>   return 0;
> }
> 
> with the command "gcc -g ../2017-05-03-elfutils/relative.c -o relative“.
> 
> When I run systemtap with the command
> /opt/tooling/adit/systemtap/bin/stap -g -a i386 -B CROSS_COMPILE=i586-poky-linux- -r /home/polle/work/build/poky/build/tmp/work/qemux86-poky-linux/linux-yocto/4.8.12+gitAUTOINC+926c93ae07_021b4aef55-r0/build --sysroot=/home/polle/work/build/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/rootfs -L 'process("/bin/relative").function("main").call‘
> 
> I get the following output:
> process("/bin/relative").function("main@../2017-05-03-elfutils/relative.c:1").call
> 
> But running nm returns the following.
> nm -l | grep relative
> 080483eb T main	/home/polle/work/issues/2017-05-03-elfutils/../2017-05-03-elfutils/relative.c:1
> 
> I hope this helps.

Yes. But I think it is an systemtap issue, not an elfutils issue.
So systemtap mailinglist CCed.

If I understand the systemtap sources correctly then the above comes
from either dwarf_decl_file (Dwarf_Die *). Which returns the file name
as recorded in the DIE. If that name doesn't start with '/' then if a
full path is needed then the compile unit comp_dir needs to be prefixed:

dwarf_formstring (dwarf_attr (dwarf_diecu (die, ...), DW_AT_comp_dir, ...));

If the name already started with a '/' then it is already a full path.

It might make the systemtap output more consistent if it did that. But
since the file names are also used to match against regular expressions
you might need a bit careful where you do or don't add the full path.

Cheers,

Mark

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-05 12:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <BB17FFBB-B202-460A-8AD2-45D68D76C0C1@gmx.de>
     [not found] ` <20170327204510.GA2448@stream>
     [not found]   ` <68860EF1-F2CA-4EB4-9420-F1783C4AF9F1@gmx.de>
     [not found]     ` <608A6FA9-0831-4640-A3A1-9D11B9DFD930@gmx.de>
2017-05-05 12:11       ` [RFC] libdw: prepend current directory in read_srclines Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).