summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2018-12-20 11:33:24 -0800
committerKhem Raj <raj.khem@gmail.com>2018-12-23 13:29:20 -0800
commit79ab090e2f5b53ea317ed0038b4f408665f6908c (patch)
treefe2203150e19716993c66e2d035a6684260abbff /meta-oe/recipes-devtools
parentd596859cdf1d0c3d9a3dafcf73c5f40ab7321bd8 (diff)
downloadmeta-openembedded-79ab090e2f5b53ea317ed0038b4f408665f6908c.tar.gz
ltrace: Fix a NULL string use
This case is likely to happen when mod == NULL so print it when we are computing modname and symname Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools')
-rw-r--r--meta-oe/recipes-devtools/ltrace/ltrace/0001-move-fprintf-into-same-block-where-modname-and-symna.patch37
-rw-r--r--meta-oe/recipes-devtools/ltrace/ltrace_git.bb1
2 files changed, 38 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-move-fprintf-into-same-block-where-modname-and-symna.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-move-fprintf-into-same-block-where-modname-and-symna.patch
new file mode 100644
index 000000000..54acaace1
--- /dev/null
+++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-move-fprintf-into-same-block-where-modname-and-symna.patch
@@ -0,0 +1,37 @@
1From 0cad025f80cf090dc16a5b70e21477f5b08a67fd Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 20 Dec 2018 11:27:45 -0800
4Subject: [PATCH] move fprintf into same block where modname and symname are
5 computed
6
7In its current state if mod turns out to be NULL then modname and
8symname will also turn out to be NULL and fprinting them as strings will
9be problematic
10
11Upstream-Status: Pending
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 output.c | 7 +++----
16 1 file changed, 3 insertions(+), 4 deletions(-)
17
18diff --git a/output.c b/output.c
19index b63befe..5aada7b 100644
20--- a/output.c
21+++ b/output.c
22@@ -654,12 +654,11 @@ frame_callback (Dwfl_Frame *state, void *arg)
23 NULL, NULL, NULL);
24 symname = dwfl_module_addrinfo(mod, pc, &off, &sym,
25 NULL, NULL, NULL);
26+ /* This mimics the output produced by libunwind below. */
27+ fprintf(options.output, " > %s(%s+0x%" PRIx64 ") [%" PRIx64 "]\n",
28+ modname, symname, off, pc);
29 }
30
31- /* This mimics the output produced by libunwind below. */
32- fprintf(options.output, " > %s(%s+0x%" PRIx64 ") [%" PRIx64 "]\n",
33- modname, symname, off, pc);
34-
35 /* See if we can extract the source line too and print it on
36 the next line if we can find it. */
37 if (mod != NULL) {
diff --git a/meta-oe/recipes-devtools/ltrace/ltrace_git.bb b/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
index f4033f7c2..83043cd21 100644
--- a/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
+++ b/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
@@ -25,6 +25,7 @@ SRC_URI = "git://github.com/sparkleholic/ltrace.git;branch=master;protocol=http
25 file://0001-Add-support-for-mips64-n32-n64.patch \ 25 file://0001-Add-support-for-mips64-n32-n64.patch \
26 file://0001-configure-Recognise-linux-musl-as-a-host-OS.patch \ 26 file://0001-configure-Recognise-linux-musl-as-a-host-OS.patch \
27 file://0001-mips-plt.c-Delete-include-error.h.patch \ 27 file://0001-mips-plt.c-Delete-include-error.h.patch \
28 file://0001-move-fprintf-into-same-block-where-modname-and-symna.patch \
28 " 29 "
29S = "${WORKDIR}/git" 30S = "${WORKDIR}/git"
30 31