You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <da...@apache.org> on 2013/01/21 12:05:20 UTC

Running gdb in the build tree Re: OWP: Introduction for Gabriela Gibson

On Mon, Dec 10, 2012 at 11:02:22PM -0500, C. Michael Pilato wrote:
> On 12/10/2012 07:32 PM, Daniel Shahaf wrote:
> > Gabriela Gibson wrote on Tue, Dec 11, 2012 at 00:21:19 +0000:
> >> For my initial submission I have written a test for issue 4263 which
> >> I'll mail shortly.  I admit that I struggled to figure out how to
> >> connect gdb to svnrdump in my build tree (since svnrdump is actually a
> >> shell script, and svnrdump reads from stdin) but I am now working on a
> >> fix for 4263.
> >>
> > 
> > libtool --mode=execute gdb -args subversion/svnrdump/svnrdump
> > 
> > (documentation patches welcome...)
> 
> I often run gdb using subversion/svnrdump/.libs/lt-svnrdump.  But note that
> that program doesn't exist until after the first post-compilation invocation
> of subversion/svnrdump/svnrdump itself, so I'm thankful to also learn of the
> method Daniel reports here.

For completion, need to re-set $SHELL too:

libtool --mode=execute env SHELL=$SHELL gdb ./subversion/svn/svn

(That is so shelling out from gdb will start your $SHELL, rather than sh.)

Re: Running gdb in the build tree Re: OWP: Introduction for Gabriela Gibson

Posted by Ben Reser <be...@reser.org>.
On Wed, Jan 23, 2013 at 11:13 AM, Gabriela Gibson
<ga...@gmail.com> wrote:
> I've parked the current collection here for now:
>
> http://wiki.apache.org/subversion/DebuggingTips

I made some tweaks.

I'm not sure it's even worth mentioning the lt-* trick.  The libtool
execute mode always works when done properly.  lt-* only happens on
some platforms since not every platform has the ability to adjust
rpaths.  For instance lt-* doesn't show up at all on OS X since you
can only replace rpaths in executables with paths of exactly the same
length.

Re: Running gdb in the build tree Re: OWP: Introduction for Gabriela Gibson

Posted by Gabriela Gibson <ga...@gmail.com>.
On 21/01/13 16:05, Hyrum K Wright wrote:
>
> We might want to think about putting them on the site or on the wiki, as
> it might be hard for newcomers to find them buried in an email thread.
>   But I agree that a location collecting debugging tips would be useful.

I've parked the current collection here for now:

http://wiki.apache.org/subversion/DebuggingTips



Re: Running gdb in the build tree Re: OWP: Introduction for Gabriela Gibson

Posted by Gabriela Gibson <ga...@gmail.com>.
On 21/01/13 16:11, Daniel Shahaf wrote:
> Hyrum K Wright wrote on Mon, Jan 21, 2013 at 11:05:23 -0500:
>> On Mon, Jan 21, 2013 at 6:41 AM, Gabriela Gibson
>> <ga...@gmail.com>wrote:

>>
>> We might want to think about putting them on the site or on the wiki, as it
>> might be hard for newcomers to find them buried in an email thread.  But I
>> agree that a location collecting debugging tips would be useful.
>
> http://wiki.apache.org/subversion/BuildNotes ?
>
There is a debugging section in the web pages, that could do with some 
polish:

http://subversion.apache.org/docs/community-guide/debugging.html

or perhaps it should be moved to the wiki?


Re: Running gdb in the build tree Re: OWP: Introduction for Gabriela Gibson

Posted by Daniel Shahaf <da...@apache.org>.
Hyrum K Wright wrote on Mon, Jan 21, 2013 at 11:05:23 -0500:
> On Mon, Jan 21, 2013 at 6:41 AM, Gabriela Gibson
> <ga...@gmail.com>wrote:
> 
> > On 21/01/13 11:05, Daniel Shahaf wrote:
> >
> >> On Mon, Dec 10, 2012 at 11:02:22PM -0500, C. Michael Pilato wrote:
> >>
> >>> On 12/10/2012 07:32 PM, Daniel Shahaf wrote:
> >>>
> >>>> Gabriela Gibson wrote on Tue, Dec 11, 2012 at 00:21:19 +0000:
> >>>>
> >>>>> For my initial submission I have written a test for issue 4263 which
> >>>>> I'll mail shortly.  I admit that I struggled to figure out how to
> >>>>> connect gdb to svnrdump in my build tree (since svnrdump is actually a
> >>>>> shell script, and svnrdump reads from stdin) but I am now working on a
> >>>>> fix for 4263.
> >>>>>
> >>>>>
> >>>> libtool --mode=execute gdb -args subversion/svnrdump/svnrdump
> >>>>
> >>>> (documentation patches welcome...)
> >>>>
> >>>
> > A collection of 'how to debug svn' tips would be nice to have, and this
> > thread seems like a good place to post them.
> 
> 
> We might want to think about putting them on the site or on the wiki, as it
> might be hard for newcomers to find them buried in an email thread.  But I
> agree that a location collecting debugging tips would be useful.

http://wiki.apache.org/subversion/BuildNotes ?

Re: Running gdb in the build tree Re: OWP: Introduction for Gabriela Gibson

Posted by Hyrum K Wright <hy...@hyrumwright.org>.
On Mon, Jan 21, 2013 at 6:41 AM, Gabriela Gibson
<ga...@gmail.com>wrote:

> On 21/01/13 11:05, Daniel Shahaf wrote:
>
>> On Mon, Dec 10, 2012 at 11:02:22PM -0500, C. Michael Pilato wrote:
>>
>>> On 12/10/2012 07:32 PM, Daniel Shahaf wrote:
>>>
>>>> Gabriela Gibson wrote on Tue, Dec 11, 2012 at 00:21:19 +0000:
>>>>
>>>>> For my initial submission I have written a test for issue 4263 which
>>>>> I'll mail shortly.  I admit that I struggled to figure out how to
>>>>> connect gdb to svnrdump in my build tree (since svnrdump is actually a
>>>>> shell script, and svnrdump reads from stdin) but I am now working on a
>>>>> fix for 4263.
>>>>>
>>>>>
>>>> libtool --mode=execute gdb -args subversion/svnrdump/svnrdump
>>>>
>>>> (documentation patches welcome...)
>>>>
>>>
> A collection of 'how to debug svn' tips would be nice to have, and this
> thread seems like a good place to post them.


We might want to think about putting them on the site or on the wiki, as it
might be hard for newcomers to find them buried in an email thread.  But I
agree that a location collecting debugging tips would be useful.

-Hyrum

Re: Running gdb in the build tree Re: OWP: Introduction for Gabriela Gibson

Posted by Gabriela Gibson <ga...@gmail.com>.
On 21/01/13 11:05, Daniel Shahaf wrote:
> On Mon, Dec 10, 2012 at 11:02:22PM -0500, C. Michael Pilato wrote:
>> On 12/10/2012 07:32 PM, Daniel Shahaf wrote:
>>> Gabriela Gibson wrote on Tue, Dec 11, 2012 at 00:21:19 +0000:
>>>> For my initial submission I have written a test for issue 4263 which
>>>> I'll mail shortly.  I admit that I struggled to figure out how to
>>>> connect gdb to svnrdump in my build tree (since svnrdump is actually a
>>>> shell script, and svnrdump reads from stdin) but I am now working on a
>>>> fix for 4263.
>>>>
>>>
>>> libtool --mode=execute gdb -args subversion/svnrdump/svnrdump
>>>
>>> (documentation patches welcome...)

A collection of 'how to debug svn' tips would be nice to have, and this 
thread seems like a good place to post them.

>>
>> I often run gdb using subversion/svnrdump/.libs/lt-svnrdump.  But note that
>> that program doesn't exist until after the first post-compilation invocation
>> of subversion/svnrdump/svnrdump itself, so I'm thankful to also learn of the
>> method Daniel reports here.
>
> For completion, need to re-set $SHELL too:
>
> libtool --mode=execute env SHELL=$SHELL gdb ./subversion/svn/svn
>
> (That is so shelling out from gdb will start your $SHELL, rather than sh.)
>
It turns out that emacs 24.1.1 can run gdb with libtool inside gdb mode 
if you add the -epoch switch like so:

libtool --mode=execute gdb -i=mi -epoch /your/target.file

There is also this rather entertaining course on debugging currently 
available:
http://www.udacity.com/view#Course/cs259/CourseRev/1/Unit/135001/Nugget/137001