Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Davidlohr Bueso <dave@gnu.org>, Sami Kerola <kerolasa@iki.fi>
Cc: util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH] Documentation: add debugging doc
Date: Tue, 23 Aug 2011 12:47:32 +0200	[thread overview]
Message-ID: <20110823104732.GE20457@nb.net.home> (raw)
In-Reply-To: <1312678772.3408.3.camel@offbook>


 Semi, could you add howto-debug to your docs branch?

    Karel

On Sat, Aug 06, 2011 at 08:59:32PM -0400, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@gnu.org>
> 
> Layout the base for tips on debugging util-linux programs/wrappers.
> 
> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> ---
>  Documentation/README.debug |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/README.debug
> 
> diff --git a/Documentation/README.debug b/Documentation/README.debug
> new file mode 100644
> index 0000000..7ead12f
> --- /dev/null
> +++ b/Documentation/README.debug
> @@ -0,0 +1,30 @@
> +Debugging util-linux programs
> +-----------------------------
> +
> +There are considerations to be made when profiling or debugging some programs found
> +in the util-linux package. Because wrapper scripts are used for the binaries to make
> +sure all library dependencies are met, you cannot use tools such as gdb or valgrind
> +directly with them.
> +
> +Let's take for example the mount command:
> +
> +$> file /path/util-linux/mount/mount
> +mount: Bourne-Again shell script text executable
> +
> +The binary itself is located in the .libs/ dir:
> +
> +$> file /path/util-linux/mount/.libs/mount
> +mount: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
> +
> +When this command is run, there's a library dependency error:
> +./mount: /lib/x86_64-linux-gnu/libblkid.so.1: version `BLKID_2.20' not found (required by ./mount)
> +
> +To overcome this we need set the LD_LIBRARY_PATH variable to read the path of the shared lib found in
> +the sources, and not system-wide:
> +
> +$> export LD_LIBRARY_PATH=/path/util-linux/libblkid/src/.libs/:$LD_LIBRARY_PATH
> +
> +Now external debugging tools can be run on the binary.
> +
> +Happy hacking!
> +Davidlohr Bueso, August 2011
> -- 
> 1.7.4.1
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  parent reply	other threads:[~2011-08-23 10:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-07  0:59 [PATCH] Documentation: add debugging doc Davidlohr Bueso
2011-08-08 11:51 ` Karel Zak
2011-08-23 10:47 ` Karel Zak [this message]
2011-08-23 19:41   ` Sami Kerola
2011-08-23 21:46     ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110823104732.GE20457@nb.net.home \
    --to=kzak@redhat.com \
    --cc=dave@gnu.org \
    --cc=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox