* [PATCH] Documentation: add debugging doc
@ 2011-08-07 0:59 Davidlohr Bueso
2011-08-08 11:51 ` Karel Zak
2011-08-23 10:47 ` Karel Zak
0 siblings, 2 replies; 5+ messages in thread
From: Davidlohr Bueso @ 2011-08-07 0:59 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Documentation: add debugging doc
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
1 sibling, 0 replies; 5+ messages in thread
From: Karel Zak @ 2011-08-08 11:51 UTC (permalink / raw)
To: Davidlohr Bueso; +Cc: util-linux
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
I'll merge this change after v2.20 stable release. The v2.20 will be
without the Documentation/ directory.
> +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)
BTW, for mount I sometimes use --enable-static-programs and then
mount/mount.static which is out of the libtool control :-)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Documentation: add debugging doc
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
2011-08-23 19:41 ` Sami Kerola
1 sibling, 1 reply; 5+ messages in thread
From: Karel Zak @ 2011-08-23 10:47 UTC (permalink / raw)
To: Davidlohr Bueso, Sami Kerola; +Cc: util-linux
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Documentation: add debugging doc
2011-08-23 10:47 ` Karel Zak
@ 2011-08-23 19:41 ` Sami Kerola
2011-08-23 21:46 ` Davidlohr Bueso
0 siblings, 1 reply; 5+ messages in thread
From: Sami Kerola @ 2011-08-23 19:41 UTC (permalink / raw)
To: Karel Zak; +Cc: Davidlohr Bueso, util-linux
On Tue, Aug 23, 2011 at 12:47, Karel Zak <kzak@redhat.com> wrote:
> =A0Semi, could you add howto-debug to your docs branch?
I could. I also modestly edit the patch; see addition in commit
message what I did & how the file looks in general.
https://github.com/kerolasa/lelux-utiliteetit/commit/1b1ea43afb0c0d6c3bf386=
e85e03c03b975194a5
--=20
=A0=A0 Sami Kerola
=A0=A0 http://www.iki.fi/kerolasa/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Documentation: add debugging doc
2011-08-23 19:41 ` Sami Kerola
@ 2011-08-23 21:46 ` Davidlohr Bueso
0 siblings, 0 replies; 5+ messages in thread
From: Davidlohr Bueso @ 2011-08-23 21:46 UTC (permalink / raw)
To: kerolasa; +Cc: Karel Zak, util-linux
On Tue, 2011-08-23 at 21:41 +0200, Sami Kerola wrote:
> On Tue, Aug 23, 2011 at 12:47, Karel Zak <kzak@redhat.com> wrote:
> > Semi, could you add howto-debug to your docs branch?
>
> I could. I also modestly edit the patch; see addition in commit
> message what I did & how the file looks in general.
Changes look good, thanks. BTW I had no idea I had a github account :)
>
> https://github.com/kerolasa/lelux-utiliteetit/commit/1b1ea43afb0c0d6c3bf386e85e03c03b975194a5
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-23 21:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2011-08-23 19:41 ` Sami Kerola
2011-08-23 21:46 ` Davidlohr Bueso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.