summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-07-13 12:22:34 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-07-13 12:22:34 (GMT)
commite4a493abc91398b20324f9751ea23bae4b6f9572 (patch)
tree7ed51147707b1316f9612313747a366181f6372f
parentc6025fb66ab49c7980abe5c75e3a6b5a9b32b172 (diff)
Add ltrace (and libelf) utilities.
Marked as BROKEN for others to debug that if they need it.
-rw-r--r--TODO2
-rw-r--r--config/debug/ltrace.in41
-rw-r--r--config/tools/libelf.in84
-rw-r--r--scripts/build/debug/ltrace.sh44
-rw-r--r--scripts/build/tools/libelf.sh48
-rwxr-xr-xtools/addToolVersion.sh4
6 files changed, 221 insertions, 2 deletions
diff --git a/TODO b/TODO
index 745c135..7145721 100644
--- a/TODO
+++ b/TODO
@@ -15,6 +15,6 @@ O: Finished
- Memcheck http://hald.dnsalias.net/projects/memcheck/
- MemCheck Deluxe http://prj.softpixel.com/mcd/
- Memwatch http://www.linkdata.se/sourcecode.html
- + ltrace ???
+ ! ltrace ftp://ftp.debian.org/debian/pool/main/l/ltrace/
O strace http://sourceforge.net/projects/strace/
- Valgrind http://valgrind.org/
diff --git a/config/debug/ltrace.in b/config/debug/ltrace.in
new file mode 100644
index 0000000..f9448ee
--- /dev/null
+++ b/config/debug/ltrace.in
@@ -0,0 +1,41 @@
+# ltrace
+
+menuconfig LTRACE
+ bool
+ prompt "ltrace"
+ default n
+ depends on BROKEN
+ select LIBELF
+ help
+ ltrace is currently BROKEN! It depends on libelf, and I don't
+ know how to configure/compile that so that ltrace can successfully
+ use it. I you manage to build ltrace (and libelf!), please be so
+ kind as to tell me! Thank you!
+
+if LTRACE
+
+choice
+ bool
+ prompt "ltrace version"
+
+config LTRACE_V_0_3_36
+ bool
+ prompt "0.3.36"
+ depends on OBSOLETE
+
+config LTRACE_V_0_4
+ bool
+ prompt "0.4"
+
+# CT_INSERT_VERSION_ABOVE
+# Don't remove above line!
+endchoice
+
+config LTRACE_VERSION
+ string
+ default "0.3.36" if LTRACE_V_0_3_36
+ default "0.4" if LTRACE_V_0_4
+# CT_INSERT_VERSION_STRING_ABOVE
+# # Don't remove above line!
+
+endif
diff --git a/config/tools/libelf.in b/config/tools/libelf.in
new file mode 100644
index 0000000..a780dc8
--- /dev/null
+++ b/config/tools/libelf.in
@@ -0,0 +1,84 @@
+# libelf config file
+
+menuconfig LIBELF
+ bool
+ prompt "libelf"
+ default n
+ depends on BROKEN
+ help
+ libelf lets you read, modify or create ELF files in an
+ architecture-independent way.
+
+ libelf is BROKEN! If you manage to make it actually _work_,
+ please be so kind as to tell me. (By working, I mean it is
+ useable at least by ltrace.) Thank you!
+
+if LIBELF
+
+choice
+ bool
+ prompt "libelf version"
+
+config LIBELF_V_0_8_0
+ bool
+ prompt "0.8.0"
+ depends on OBSOLETE
+
+config LIBELF_V_0_8_2
+ bool
+ prompt "0.8.2"
+ depends on OBSOLETE
+
+config LIBELF_V_0_8_3
+ bool
+ prompt "0.8.3"
+ depends on OBSOLETE
+
+config LIBELF_V_0_8_4
+ bool
+ prompt "0.8.4"
+ depends on OBSOLETE
+
+config LIBELF_V_0_8_5
+ bool
+ prompt "0.8.5"
+ depends on OBSOLETE
+
+config LIBELF_V_0_8_6
+ bool
+ prompt "0.8.6"
+ depends on OBSOLETE
+
+config LIBELF_V_0_8_7
+ bool
+ prompt "0.8.7"
+ depends on OBSOLETE
+
+config LIBELF_V_0_8_8
+ bool
+ prompt "0.8.8"
+ depends on OBSOLETE
+
+config LIBELF_V_0_8_9
+ bool
+ prompt "0.8.9"
+
+# CT_INSERT_VERSION_ABOVE
+# Don't remove above line!
+endchoice
+
+config LIBELF_VERSION
+ string
+ default "0.8.0" if LIBELF_V_0_8_0
+ default "0.8.2" if LIBELF_V_0_8_2
+ default "0.8.3" if LIBELF_V_0_8_3
+ default "0.8.4" if LIBELF_V_0_8_4
+ default "0.8.5" if LIBELF_V_0_8_5
+ default "0.8.6" if LIBELF_V_0_8_6
+ default "0.8.7" if LIBELF_V_0_8_7
+ default "0.8.8" if LIBELF_V_0_8_8
+ default "0.8.9" if LIBELF_V_0_8_9
+# CT_INSERT_VERSION_STRING_ABOVE
+# Don't remove above line!
+
+endif
diff --git a/scripts/build/debug/ltrace.sh b/scripts/build/debug/ltrace.sh
new file mode 100644
index 0000000..3c85263
--- /dev/null
+++ b/scripts/build/debug/ltrace.sh
@@ -0,0 +1,44 @@
+# Build script for ltrace
+
+is_enabled="${CT_LTRACE}"
+
+do_print_filename() {
+ [ "${CT_LTRACE}" = "y" ] || return 0
+ echo "ltrace-${CT_LTRACE_VERSION}.orig"
+}
+
+do_debug_ltrace_get() {
+ CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" ftp://ftp.de.debian.org/debian/pool/main/l/ltrace/
+ # Create a link so that the following steps are easier to do:
+ cd "${CT_TARBALLS_DIR}"
+ ltrace_ext=`CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig"`
+ ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
+}
+
+do_debug_ltrace_extract() {
+ CT_ExtractAndPatch "ltrace-${CT_LTRACE_VERSION}"
+}
+
+do_debug_ltrace_build() {
+ CT_DoStep INFO "Installing ltrace"
+ mkdir -p "${CT_BUILD_DIR}/build-ltrace"
+ CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
+
+ CT_DoLog EXTRA "Configuring ltrace"
+# CFLAGS="-I${CT_SYSROOT_DIR}/usr/include" \
+# LDFLAGS="-L${CT_SYSROOT_DIR}/usr/include" \
+ "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/configure" \
+ --build=${CT_BUILD} \
+ --host=${CT_TARGET} \
+ --prefix=/usr
+
+ CT_DoLog EXTRA "Building ltrace"
+ make
+
+ CT_DoLog EXTRA "Installing ltrace"
+ make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
+
+ CT_Popd
+ CT_EndStep
+}
+
diff --git a/scripts/build/tools/libelf.sh b/scripts/build/tools/libelf.sh
new file mode 100644
index 0000000..5bb1d7b
--- /dev/null
+++ b/scripts/build/tools/libelf.sh
@@ -0,0 +1,48 @@
+# Build script for libelf
+
+is_enabled="${CT_LIBELF}"
+
+do_print_filename() {
+ [ "{CT_LIBELF}" = "y" ] || return 0
+ echo "libelf-${CT_LIBELF_VERSION}"
+}
+
+do_tools_libelf_get() {
+ # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
+ # error code if we try to download a file that does not exists there.
+ # So we have to request the file with an explicit extension.
+ CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
+}
+
+do_tools_libelf_extract() {
+ CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}"
+}
+
+do_tools_libelf_build() {
+ CT_DoStep INFO "Installing libelf"
+ mkdir -p "${CT_BUILD_DIR}/build-libelf"
+ CT_Pushd "${CT_BUILD_DIR}/build-libelf"
+
+ CT_DoLog EXTRA "Configuring libelf"
+ CC="${CT_TARGET}-gcc" \
+ "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
+ --build=${CT_BUILD} \
+ --host=${CT_TARGET} \
+ --target=${CT_TARGET} \
+ --prefix=/usr \
+ --enable-compat \
+ --enable-elf64 \
+ --enable-shared \
+ --enable-extended-format \
+ --enable-static 2>&1 |CT_DoLog ALL
+
+ CT_DoLog EXTRA "Building libelf"
+ make 2>&1 |CT_DoLog ALL
+
+ CT_DoLog EXTRA "Installing libelf"
+ make instroot="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
+
+ CT_Popd
+ CT_EndStep
+}
+
diff --git a/tools/addToolVersion.sh b/tools/addToolVersion.sh
index 941a486..08b3bb9 100755
--- a/tools/addToolVersion.sh
+++ b/tools/addToolVersion.sh
@@ -8,7 +8,7 @@ doHelp() {
Usage: ${myname} <tool> [option] <version>
'tool' in one of:
--gcc, --binutils, --glibc, --uClibc, --linux,
- --gdb, --dmalloc, --duma, --strace
+ --gdb, --dmalloc, --duma, --strace, --ltrace, --libelf
Valid options for all tools:
--experimental, -x
@@ -57,6 +57,8 @@ while [ $i -le $# ]; do
--dmalloc) cat=DMALLOC; tool=dmalloc; tool_prefix=debug/ tool_suffix=;;
--duma) cat=DUMA; tool=duma; tool_prefix=debug/ tool_suffix=;;
--strace) cat=STRACE; tool=strace; tool_prefix=debug/ tool_suffix=;;
+ --ltrace) cat=LTRACE; tool=ltrace; tool_prefix=debug/ tool_suffix=;;
+ --libelf) cat=LIBELF; tool=libelf; tool_prefix=tools/ tool_suffix=;;
# Tools options:
-x|--experimental) EXP=1; OBS=;;
-o|--obsolete) OBS=1; EXP=;;