public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] splitdebug
@ 2006-06-14 20:57 Bo Ørsted Andresen
  2006-06-14 21:28 ` Richard Fish
  0 siblings, 1 reply; 8+ messages in thread
From: Bo Ørsted Andresen @ 2006-06-14 20:57 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

If I want to take full advantage of the new splitdebug feature. Should I then 
emerge -e world? I don't think the backtraces doc [1] answers that.

[1] http://www.gentoo.org/proj/en/qa/backtraces.xml

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [gentoo-user] splitdebug
  2006-06-14 20:57 [gentoo-user] splitdebug Bo Ørsted Andresen
@ 2006-06-14 21:28 ` Richard Fish
  2006-06-14 21:45   ` Bo Ørsted Andresen
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Fish @ 2006-06-14 21:28 UTC (permalink / raw
  To: gentoo-user

On 6/14/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> If I want to take full advantage of the new splitdebug feature. Should I then
> emerge -e world? I don't think the backtraces doc [1] answers that.

For "full" advantage, yes, you would need to emerge -e world, since
otherwise the debugging information will only be generated for new
merges.  And of course, any binary packages won't get debug symbols in
any case.

But if there is a specific program you are wanting to get backtraces
from, you can simplify by just re-merging that program and dependant
libraries.

-Richard

-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] splitdebug
  2006-06-14 21:28 ` Richard Fish
@ 2006-06-14 21:45   ` Bo Ørsted Andresen
  2006-06-15  0:01     ` Richard Fish
  0 siblings, 1 reply; 8+ messages in thread
From: Bo Ørsted Andresen @ 2006-06-14 21:45 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 675 bytes --]

On Wednesday 14 June 2006 23:28, Richard Fish wrote:
> For "full" advantage, yes, you would need to emerge -e world, since
> otherwise the debugging information will only be generated for new
> merges.  And of course, any binary packages won't get debug symbols in
> any case.

Thanks. Good to know.

> But if there is a specific program you are wanting to get backtraces
> from, you can simplify by just re-merging that program and dependant
> libraries.

Like this:

# emerge -ep kontact kmail knode akregator | awk '$1~/ebuild/{print $4}' | \
	sed -e 's/\-[0-9][A-Za-z0-9._-]*$//' | grep lib | xargs emerge -vp 

Or how else to know?

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [gentoo-user] splitdebug
  2006-06-14 21:45   ` Bo Ørsted Andresen
@ 2006-06-15  0:01     ` Richard Fish
  2006-06-15  0:25       ` Bo Ørsted Andresen
  2006-06-15  8:53       ` Neil Bothwick
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Fish @ 2006-06-15  0:01 UTC (permalink / raw
  To: gentoo-user

On 6/14/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> Like this:
>
> # emerge -ep kontact kmail knode akregator | awk '$1~/ebuild/{print $4}' | \
>         sed -e 's/\-[0-9][A-Za-z0-9._-]*$//' | grep lib | xargs emerge -vp

This will merge all of system.  I was thinking more like:

ldd `which kontact kmail knode akregator` | grep '=>' | awk '{print $3}' \
    | sort | uniq | xargs equery belongs | grep '/' | sort | uniq \
    | xargs printf "=%s\n" | xargs emerge -p --oneshot

(Ok people, have at it.  Show me how you can do this in 5 commands or less.)

-Richard




>
> Or how else to know?
>
> --
> Bo Andresen
>
>
>

-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] splitdebug
  2006-06-15  0:01     ` Richard Fish
@ 2006-06-15  0:25       ` Bo Ørsted Andresen
  2006-06-15  1:09         ` Bo Ørsted Andresen
  2006-06-15  8:53       ` Neil Bothwick
  1 sibling, 1 reply; 8+ messages in thread
From: Bo Ørsted Andresen @ 2006-06-15  0:25 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

On Thursday 15 June 2006 02:01, Richard Fish wrote:
> I was thinking more like:
>
> ldd `which kontact kmail knode akregator` | grep '=>' | awk '{print $3}' \
>     | sort | uniq | xargs equery belongs | grep '/' | sort | uniq \
>     | xargs printf "=%s\n" | xargs emerge -p --oneshot
>
> (Ok people, have at it.  Show me how you can do this in 5 commands or
> less.)

Very nice. :)

I guess this would do:

# ldd `which kontact kmail knode akregator` | awk '$2~/^=>$/{print $3}' | \
	sort -u | xargs equery belongs | sort -u | while read pkg; do grep -q \
	splitdebug /var/db/pkg/"$pkg"/FEATURES || echo ="$pkg"; done | \
	xargs emerge -p1

:)

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [gentoo-user] splitdebug
  2006-06-15  0:25       ` Bo Ørsted Andresen
@ 2006-06-15  1:09         ` Bo Ørsted Andresen
  2006-06-15  1:57           ` Richard Fish
  0 siblings, 1 reply; 8+ messages in thread
From: Bo Ørsted Andresen @ 2006-06-15  1:09 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

Just in case others are interested I ended out with this script:

===============================================
#/bin/bash

for arg in $@; do
        if [[ "${arg}" =~ "^\-" ]]; then
                EMERGE_ARGS="${EMERGE_ARGS} ${arg}"
        else
                BINARIES="${BINARIES} ${arg}"
        fi
done

PKG_LIST=`which ${BINARIES} | xargs -r ldd | awk '$2~/^=>$/{print $3}' | \
	sort -u | xargs -r equery belongs | sort -u | while read pkg; do grep -q \
	splitdebug /var/db/pkg/"$pkg"/FEATURES || echo ="$pkg"; done | xargs`

if [[ -n "${PKG_LIST}" ]]; then
        emerge --verbose --oneshot ${EMERGE_ARGS} ${PKG_LIST}
fi
===============================================

This allows me to run it with -a or --ask to avoid having to wait for equery 
and emerge twice.

Thanks Richard. :)

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [gentoo-user] splitdebug
  2006-06-15  1:09         ` Bo Ørsted Andresen
@ 2006-06-15  1:57           ` Richard Fish
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Fish @ 2006-06-15  1:57 UTC (permalink / raw
  To: gentoo-user

On 6/14/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> Just in case others are interested I ended out with this script:

Very nice!

-Richard

-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] splitdebug
  2006-06-15  0:01     ` Richard Fish
  2006-06-15  0:25       ` Bo Ørsted Andresen
@ 2006-06-15  8:53       ` Neil Bothwick
  1 sibling, 0 replies; 8+ messages in thread
From: Neil Bothwick @ 2006-06-15  8:53 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]

On Wed, 14 Jun 2006 17:01:18 -0700, Richard Fish wrote:

> ldd `which kontact kmail knode akregator` | grep '=>' | awk '{print
> $3}' \
>     | sort | uniq | xargs equery belongs | grep '/' | sort | uniq \
>     | xargs printf "=%s\n" | xargs emerge -p --oneshot
> 
> (Ok people, have at it.  Show me how you can do this in 5 commands or
> less.)

<pedant>That should be "five commands or fewer"</pedant> :)

awk does pattern matching, so you can drop the first grep and use
awk '/=>/ {print $3}'

The second grep appears redundant too, when i tried this, all lines
contained '/'.

Both invocations of uniq are unnecessary, use sort -u instead.

Replacing 'xargs printf "=%s\n"' with 'sed s/^/=/' is technically one
less command, although the same number of pipeline stages.

So that's five commands removed without thinking or adding anything
original... I should be a consultant :)


-- 
Neil Bothwick

WinErr 01B: Illegal error - You are not allowed to get this error.
            Next time you will get a penalty for that.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2006-06-15  8:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-14 20:57 [gentoo-user] splitdebug Bo Ørsted Andresen
2006-06-14 21:28 ` Richard Fish
2006-06-14 21:45   ` Bo Ørsted Andresen
2006-06-15  0:01     ` Richard Fish
2006-06-15  0:25       ` Bo Ørsted Andresen
2006-06-15  1:09         ` Bo Ørsted Andresen
2006-06-15  1:57           ` Richard Fish
2006-06-15  8:53       ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox