public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Specifying a debuginfo path independently of sysroot
@ 2008-06-13 14:12 Ray Ruvinskiy
  2008-06-13 15:07 ` Sami Wagiaalla
  0 siblings, 1 reply; 7+ messages in thread
From: Ray Ruvinskiy @ 2008-06-13 14:12 UTC (permalink / raw)
  To: frysk

Hello,

I was wondering if it was possible to pass a custom debuginfo path  
from frysk to libdwfl without using the -sysroot switch. For example,  
suppose I have /my/path/to/program and its debug file is /my/path/ 
to/.debug/program. This works with gdb, and the callback documentation  
in libdwfl.h (line 242) suggests that libdwfl supports this idiom, as  
well.

If this is not currently possible, I was wondering if it might be  
desirable to allow for this. I wouldn't mind taking a crack at  
implementing this, if given an idea as to what semantics would be  
desired.

Thanks,

Ray

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Specifying a debuginfo path independently of sysroot
  2008-06-13 14:12 Specifying a debuginfo path independently of sysroot Ray Ruvinskiy
@ 2008-06-13 15:07 ` Sami Wagiaalla
  2008-06-13 15:56   ` Ray Ruvinskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Sami Wagiaalla @ 2008-06-13 15:07 UTC (permalink / raw)
  To: Ray Ruvinskiy; +Cc: frysk

Hi Ray,

> I was wondering if it was possible to pass a custom debuginfo path from 
> frysk to libdwfl without using the -sysroot switch.

I guess the first question is why would one want to do this ?..maybe 
there is a larger problem that we should fix, also for the record :)

> If this is not currently possible, I was wondering if it might be 
> desirable to allow for this. I wouldn't mind taking a crack at 
> implementing this, if given an idea as to what semantics would be desired.

If you do go for it here are a couple of things to look out for:

1) I think CommandLineParser.java would be a good spot to add it so that 
the functionality tricles down to all the command line utilities.

2) We are currently in a slow switch from CNI to JNI so we have two sets 
of bindings that we are maintaining. So if you do touch the bindings 
make sure you update the JNI side of things... hopefully this would be 
over by frysk 0.5 :)

3) It would be really cool if your patch comes with a test case. The 
frysk test suite is nice to work with now-a-days. You can find examples 
in Test*.java... then copy/paste and edit.

Cheers,
   Sami

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Specifying a debuginfo path independently of sysroot
  2008-06-13 15:07 ` Sami Wagiaalla
@ 2008-06-13 15:56   ` Ray Ruvinskiy
  2008-06-13 21:14     ` Rick Moseley
  0 siblings, 1 reply; 7+ messages in thread
From: Ray Ruvinskiy @ 2008-06-13 15:56 UTC (permalink / raw)
  To: Sami Wagiaalla; +Cc: frysk

Hi Sami,

We save debug symbols for every build on a central server. The  
binaries that are tested (and shipped) are stripped, except for a  
gnu_debuglink. To debug issues on QA machines or customer issues, we  
find it convenient to simply create a symbolic .debug link from the  
directory where the binaries and libraries are installed to where we  
keep the symbols for the particular build we want to debug. The  
directory structure of the symbol repository does not necessarily  
match the directory structure of the location where the software was  
installed.

Thanks,

Ray

On 13-Jun-08, at 10:12 AM, Sami Wagiaalla wrote:

> Hi Ray,
>
>> I was wondering if it was possible to pass a custom debuginfo path  
>> from frysk to libdwfl without using the -sysroot switch.
>
> I guess the first question is why would one want to do this ?..maybe  
> there is a larger problem that we should fix, also for the record :)
>
>> If this is not currently possible, I was wondering if it might be  
>> desirable to allow for this. I wouldn't mind taking a crack at  
>> implementing this, if given an idea as to what semantics would be  
>> desired.
>
> If you do go for it here are a couple of things to look out for:
>
> 1) I think CommandLineParser.java would be a good spot to add it so  
> that the functionality tricles down to all the command line utilities.
>
> 2) We are currently in a slow switch from CNI to JNI so we have two  
> sets of bindings that we are maintaining. So if you do touch the  
> bindings make sure you update the JNI side of things... hopefully  
> this would be over by frysk 0.5 :)
>
> 3) It would be really cool if your patch comes with a test case. The  
> frysk test suite is nice to work with now-a-days. You can find  
> examples in Test*.java... then copy/paste and edit.
>
> Cheers,
>  Sami
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Specifying a debuginfo path independently of sysroot
  2008-06-13 15:56   ` Ray Ruvinskiy
@ 2008-06-13 21:14     ` Rick Moseley
  2008-06-16 12:22       ` Ray Ruvinskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Rick Moseley @ 2008-06-13 21:14 UTC (permalink / raw)
  To: frysk

Hi Ray,

I was trying to think of a good/simple/easy way to do this.  I wonder if 
we could set some sort of shell variable similar to "LD_LIBRARY_PATH", 
maybe "FRYSK_DEBUGINFO_PATH" that we could interrogate and if there is a 
path there use it first to search for the debuginfo and failing that 
then look in the usual places.

Another probably idea is to have a file either in ~/.frysk or just in ~ 
called something like .fryskdebuginfopath that has a line with the 
initial paths to search.  If that file exists, search those first and 
the usual places last.  Would make it better than having to override 
with a commandline command every time.

Just a couple of thoughts.

Rick


Ray Ruvinskiy wrote:
> Hi Sami,
>
> We save debug symbols for every build on a central server. The 
> binaries that are tested (and shipped) are stripped, except for a 
> gnu_debuglink. To debug issues on QA machines or customer issues, we 
> find it convenient to simply create a symbolic .debug link from the 
> directory where the binaries and libraries are installed to where we 
> keep the symbols for the particular build we want to debug. The 
> directory structure of the symbol repository does not necessarily 
> match the directory structure of the location where the software was 
> installed.
>
> Thanks,
>
> Ray
>
> On 13-Jun-08, at 10:12 AM, Sami Wagiaalla wrote:
>
>> Hi Ray,
>>
>>> I was wondering if it was possible to pass a custom debuginfo path 
>>> from frysk to libdwfl without using the -sysroot switch.
>>
>> I guess the first question is why would one want to do this ?..maybe 
>> there is a larger problem that we should fix, also for the record :)
>>
>>> If this is not currently possible, I was wondering if it might be 
>>> desirable to allow for this. I wouldn't mind taking a crack at 
>>> implementing this, if given an idea as to what semantics would be 
>>> desired.
>>
>> If you do go for it here are a couple of things to look out for:
>>
>> 1) I think CommandLineParser.java would be a good spot to add it so 
>> that the functionality tricles down to all the command line utilities.
>>
>> 2) We are currently in a slow switch from CNI to JNI so we have two 
>> sets of bindings that we are maintaining. So if you do touch the 
>> bindings make sure you update the JNI side of things... hopefully 
>> this would be over by frysk 0.5 :)
>>
>> 3) It would be really cool if your patch comes with a test case. The 
>> frysk test suite is nice to work with now-a-days. You can find 
>> examples in Test*.java... then copy/paste and edit.
>>
>> Cheers,
>>  Sami
>>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Specifying a debuginfo path independently of sysroot
  2008-06-13 21:14     ` Rick Moseley
@ 2008-06-16 12:22       ` Ray Ruvinskiy
  2008-06-16 13:20         ` Stan Cox
  2008-06-18 13:27         ` Rick Moseley
  0 siblings, 2 replies; 7+ messages in thread
From: Ray Ruvinskiy @ 2008-06-16 12:22 UTC (permalink / raw)
  To: Rick Moseley; +Cc: frysk

Hi Rick,

The environment variable idea sounds good to me personally. Would this  
be checked in DwflCache.getDwfl before calling getRelativeSysroot and  
instantiating the new Dwfl instance?

Still, I don't fully understand why getRelativeSysroot always prepends  
the hardcoded "/usr/lib/debug" to anything you pass in. While that is  
the standard location to put debug files for binaries that go in /usr,  
what about software that goes in /usr/local or /opt?

Thanks,

Ray

On 13-Jun-08, at 11:56 AM, Rick Moseley wrote:

> Hi Ray,
>
> I was trying to think of a good/simple/easy way to do this.  I  
> wonder if we could set some sort of shell variable similar to  
> "LD_LIBRARY_PATH", maybe "FRYSK_DEBUGINFO_PATH" that we could  
> interrogate and if there is a path there use it first to search for  
> the debuginfo and failing that then look in the usual places.
>
> Another probably idea is to have a file either in ~/.frysk or just  
> in ~ called something like .fryskdebuginfopath that has a line with  
> the initial paths to search.  If that file exists, search those  
> first and the usual places last.  Would make it better than having  
> to override with a commandline command every time.
>
> Just a couple of thoughts.
>
> Rick
>
>
> Ray Ruvinskiy wrote:
>> Hi Sami,
>>
>> We save debug symbols for every build on a central server. The  
>> binaries that are tested (and shipped) are stripped, except for a  
>> gnu_debuglink. To debug issues on QA machines or customer issues,  
>> we find it convenient to simply create a symbolic .debug link from  
>> the directory where the binaries and libraries are installed to  
>> where we keep the symbols for the particular build we want to  
>> debug. The directory structure of the symbol repository does not  
>> necessarily match the directory structure of the location where the  
>> software was installed.
>>
>> Thanks,
>>
>> Ray
>>
>> On 13-Jun-08, at 10:12 AM, Sami Wagiaalla wrote:
>>
>>> Hi Ray,
>>>
>>>> I was wondering if it was possible to pass a custom debuginfo  
>>>> path from frysk to libdwfl without using the -sysroot switch.
>>>
>>> I guess the first question is why would one want to do  
>>> this ?..maybe there is a larger problem that we should fix, also  
>>> for the record :)
>>>
>>>> If this is not currently possible, I was wondering if it might be  
>>>> desirable to allow for this. I wouldn't mind taking a crack at  
>>>> implementing this, if given an idea as to what semantics would be  
>>>> desired.
>>>
>>> If you do go for it here are a couple of things to look out for:
>>>
>>> 1) I think CommandLineParser.java would be a good spot to add it  
>>> so that the functionality tricles down to all the command line  
>>> utilities.
>>>
>>> 2) We are currently in a slow switch from CNI to JNI so we have  
>>> two sets of bindings that we are maintaining. So if you do touch  
>>> the bindings make sure you update the JNI side of things...  
>>> hopefully this would be over by frysk 0.5 :)
>>>
>>> 3) It would be really cool if your patch comes with a test case.  
>>> The frysk test suite is nice to work with now-a-days. You can find  
>>> examples in Test*.java... then copy/paste and edit.
>>>
>>> Cheers,
>>> Sami
>>>
>>
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Specifying a debuginfo path independently of sysroot
  2008-06-16 12:22       ` Ray Ruvinskiy
@ 2008-06-16 13:20         ` Stan Cox
  2008-06-18 13:27         ` Rick Moseley
  1 sibling, 0 replies; 7+ messages in thread
From: Stan Cox @ 2008-06-16 13:20 UTC (permalink / raw)
  To: Ray Ruvinskiy; +Cc: frysk


On Fri, 2008-06-13 at 17:13 -0400, Ray Ruvinskiy wrote:
> "/usr/lib/debug"

The reason for /usr/lib/debug is that is the standard root location for
debug information on Linux: for
example /usr/lib/debug/bin, /usr/lib/debug/usr/bin.  So the theory is
that sysroot is imitating the standard linux behavior.  Frysk "always"
has a sysroot, with the default sysroot location being "/".  Specifying
a different sysroot just tells frysk to look for the standard Linux
debugging information in a sysroot whose root is somewhere other than
"/"  For example here is the sysroot which is used to run the Frysk
sysroot tests:

frysk-core/frysk/pkglibdir/test-sysroot/usr/bin:
./  ../  funit-quicksort*

frysk-core/frysk/pkglibdir/test-sysroot/usr/lib:
./  ../  debug/  libbubble.so*

frysk-core/frysk/pkglibdir/test-sysroot/usr/lib/debug/usr/bin:
./  ../  funit-quicksort.debug*

frysk-core/frysk/pkglibdir/test-sysroot/usr/lib/debug/usr/lib:
./  ../  funit-bubblesort.debug*

frysk-core/frysk/pkglibdir/test-sysroot/usr/src/debug:
./  ../  funit-bubblesort.c  funit-quicksort.c


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Specifying a debuginfo path independently of sysroot
  2008-06-16 12:22       ` Ray Ruvinskiy
  2008-06-16 13:20         ` Stan Cox
@ 2008-06-18 13:27         ` Rick Moseley
  1 sibling, 0 replies; 7+ messages in thread
From: Rick Moseley @ 2008-06-18 13:27 UTC (permalink / raw)
  To: Ray Ruvinskiy; +Cc: frysk

Ray Ruvinskiy wrote:
> Hi Rick,
>
> The environment variable idea sounds good to me personally. Would this 
> be checked in DwflCache.getDwfl before calling getRelativeSysroot and 
> instantiating the new Dwfl instance?
That sounds right to me, although I am not familiar with that code.
>
> Still, I don't fully understand why getRelativeSysroot always prepends 
> the hardcoded "/usr/lib/debug" to anything you pass in. While that is 
> the standard location to put debug files for binaries that go in /usr, 
> what about software that goes in /usr/local or /opt?
>
> Thanks,
>
> Ray
>
> On 13-Jun-08, at 11:56 AM, Rick Moseley wrote:
>
>> Hi Ray,
>>
>> I was trying to think of a good/simple/easy way to do this.  I wonder 
>> if we could set some sort of shell variable similar to 
>> "LD_LIBRARY_PATH", maybe "FRYSK_DEBUGINFO_PATH" that we could 
>> interrogate and if there is a path there use it first to search for 
>> the debuginfo and failing that then look in the usual places.
>>
>> Another probably idea is to have a file either in ~/.frysk or just in 
>> ~ called something like .fryskdebuginfopath that has a line with the 
>> initial paths to search.  If that file exists, search those first and 
>> the usual places last.  Would make it better than having to override 
>> with a commandline command every time.
>>
>> Just a couple of thoughts.
>>
>> Rick
>>
>>
>> Ray Ruvinskiy wrote:
>>> Hi Sami,
>>>
>>> We save debug symbols for every build on a central server. The 
>>> binaries that are tested (and shipped) are stripped, except for a 
>>> gnu_debuglink. To debug issues on QA machines or customer issues, we 
>>> find it convenient to simply create a symbolic .debug link from the 
>>> directory where the binaries and libraries are installed to where we 
>>> keep the symbols for the particular build we want to debug. The 
>>> directory structure of the symbol repository does not necessarily 
>>> match the directory structure of the location where the software was 
>>> installed.
>>>
>>> Thanks,
>>>
>>> Ray
>>>
>>> On 13-Jun-08, at 10:12 AM, Sami Wagiaalla wrote:
>>>
>>>> Hi Ray,
>>>>
>>>>> I was wondering if it was possible to pass a custom debuginfo path 
>>>>> from frysk to libdwfl without using the -sysroot switch.
>>>>
>>>> I guess the first question is why would one want to do this 
>>>> ?..maybe there is a larger problem that we should fix, also for the 
>>>> record :)
>>>>
>>>>> If this is not currently possible, I was wondering if it might be 
>>>>> desirable to allow for this. I wouldn't mind taking a crack at 
>>>>> implementing this, if given an idea as to what semantics would be 
>>>>> desired.
>>>>
>>>> If you do go for it here are a couple of things to look out for:
>>>>
>>>> 1) I think CommandLineParser.java would be a good spot to add it so 
>>>> that the functionality tricles down to all the command line utilities.
>>>>
>>>> 2) We are currently in a slow switch from CNI to JNI so we have two 
>>>> sets of bindings that we are maintaining. So if you do touch the 
>>>> bindings make sure you update the JNI side of things... hopefully 
>>>> this would be over by frysk 0.5 :)
>>>>
>>>> 3) It would be really cool if your patch comes with a test case. 
>>>> The frysk test suite is nice to work with now-a-days. You can find 
>>>> examples in Test*.java... then copy/paste and edit.
>>>>
>>>> Cheers,
>>>> Sami
>>>>
>>>
>>
>>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-06-16 13:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-13 14:12 Specifying a debuginfo path independently of sysroot Ray Ruvinskiy
2008-06-13 15:07 ` Sami Wagiaalla
2008-06-13 15:56   ` Ray Ruvinskiy
2008-06-13 21:14     ` Rick Moseley
2008-06-16 12:22       ` Ray Ruvinskiy
2008-06-16 13:20         ` Stan Cox
2008-06-18 13:27         ` Rick Moseley

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).