summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace')
-rw-r--r--external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Bug-fix-for-data-type-length-judgment.patch42
-rw-r--r--external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch46
-rw-r--r--external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch33
-rw-r--r--external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-move-fprintf-into-same-block-where-modname-and-symna.patch37
-rw-r--r--external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch30
5 files changed, 188 insertions, 0 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Bug-fix-for-data-type-length-judgment.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Bug-fix-for-data-type-length-judgment.patch
new file mode 100644
index 00000000..98cc9ba9
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-Bug-fix-for-data-type-length-judgment.patch
@@ -0,0 +1,42 @@
+From 5226333bddb755dbefd780d31450e0238dd5d3bd Mon Sep 17 00:00:00 2001
+From: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
+Date: Wed, 16 Oct 2019 08:24:23 +0900
+Subject: [PATCH] Bug fix for data type length judgment.
+
+...
+if (byte_size == sizeof(long)) {
+
+ *type = is_signed ? ARGTYPE_LONG : ARGTYPE_ULONG;
+
+ return true;
+
+}
+...
+
+If ltrace's target command has a dbg package, ltrace will look for the debug file and analyze its contents.
+Ltrace determines the type of analysis result variable. The type of the variable is longlong.
+On 32-bit systems, longlong is 8 and long is 4 (same as in).
+An error occurred because the ltrace code did not process a variable of length 8.
+
+Upstream-Status: Pending
+Signed-off-by: Wang Mingyu <wangmy.fnst@cn.fujitsu.com>
+---
+ dwarf_prototypes.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dwarf_prototypes.c b/dwarf_prototypes.c
+index bfac177..9887d4b 100644
+--- a/dwarf_prototypes.c
++++ b/dwarf_prototypes.c
+@@ -190,7 +190,7 @@ static bool get_integer_base_type(enum arg_type *type, int byte_size,
+ return true;
+ }
+
+- if (byte_size == sizeof(long)) {
++ if (byte_size == sizeof(long long)) {
+ *type = is_signed ? ARGTYPE_LONG : ARGTYPE_ULONG;
+ return true;
+ }
+--
+2.7.4
+
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch
new file mode 100644
index 00000000..9def41ca
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch
@@ -0,0 +1,46 @@
+From 67a8fa478a4484bc4dbfb3ac74e11be1dd5af594 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Dec 2019 19:35:48 -0800
+Subject: [PATCH] ensure the struct pointers are null initilized
+
+Do not delete if pointer is already null
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ expr.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/expr.c b/expr.c
+index 4059a32..5ffd0ad 100644
+--- a/expr.c
++++ b/expr.c
+@@ -189,10 +189,8 @@ int
+ expr_clone(struct expr_node *retp, const struct expr_node *node)
+ {
+ *retp = *node;
+-
++ struct expr_node *nlhs = 0, *nrhs = 0;
+ switch (node->kind) {
+- struct expr_node *nlhs;
+- struct expr_node *nrhs;
+
+ case EXPR_OP_ARGNO:
+ case EXPR_OP_SELF:
+@@ -236,8 +234,10 @@ expr_clone(struct expr_node *retp, const struct expr_node *node)
+ if (expr_alloc_and_clone(&nlhs, node->lhs, node->own_lhs) < 0) {
+ if (node->kind == EXPR_OP_CALL2
+ && node->u.call.own_rhs) {
+- expr_destroy(nrhs);
+- free(nrhs);
++ if (nrhs) {
++ expr_destroy(nrhs);
++ free(nrhs);
++ }
+ return -1;
+ }
+ }
+--
+2.24.1
+
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch
new file mode 100644
index 00000000..28903738
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch
@@ -0,0 +1,33 @@
+From 8321f8b3befbaa355cfed988fdd8494133989676 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 4 Feb 2019 00:38:16 -0800
+Subject: [PATCH] hook: Do not append int to std::string
+
+Clang find this error
+
+| ../../../git/sysdeps/linux-gnu/hooks.c:205:51: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus
+-int]
+| || sprintf(syspath, "%s/%s", sysconfdir, FN + 1) < 0)
+| ~~~^~~
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/linux-gnu/hooks.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sysdeps/linux-gnu/hooks.c
++++ b/sysdeps/linux-gnu/hooks.c
+@@ -200,9 +200,10 @@ os_get_ltrace_conf_filenames(struct vect
+ const char *sysconfdir = SYSCONFDIR;
+ if (sysconfdir != NULL && *sysconfdir != '\0') {
+ /* No +1, we skip the initial period. */
+- syspath = malloc(strlen(sysconfdir) + sizeof FN);
++ syspath = malloc(strlen(sysconfdir) + sizeof FN + 2);
++ syspath[strlen(sysconfdir) + sizeof FN + 1] = '\0';
+ if (syspath == NULL
+- || sprintf(syspath, "%s/%s", sysconfdir, FN + 1) < 0)
++ || sprintf(syspath, "%s/%s", sysconfdir, FN) < 0)
+ goto fail;
+ }
+
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-move-fprintf-into-same-block-where-modname-and-symna.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-move-fprintf-into-same-block-where-modname-and-symna.patch
new file mode 100644
index 00000000..54acaace
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/0001-move-fprintf-into-same-block-where-modname-and-symna.patch
@@ -0,0 +1,37 @@
+From 0cad025f80cf090dc16a5b70e21477f5b08a67fd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Dec 2018 11:27:45 -0800
+Subject: [PATCH] move fprintf into same block where modname and symname are
+ computed
+
+In its current state if mod turns out to be NULL then modname and
+symname will also turn out to be NULL and fprinting them as strings will
+be problematic
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ output.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/output.c b/output.c
+index b63befe..5aada7b 100644
+--- a/output.c
++++ b/output.c
+@@ -654,12 +654,11 @@ frame_callback (Dwfl_Frame *state, void *arg)
+ NULL, NULL, NULL);
+ symname = dwfl_module_addrinfo(mod, pc, &off, &sym,
+ NULL, NULL, NULL);
++ /* This mimics the output produced by libunwind below. */
++ fprintf(options.output, " > %s(%s+0x%" PRIx64 ") [%" PRIx64 "]\n",
++ modname, symname, off, pc);
+ }
+
+- /* This mimics the output produced by libunwind below. */
+- fprintf(options.output, " > %s(%s+0x%" PRIx64 ") [%" PRIx64 "]\n",
+- modname, symname, off, pc);
+-
+ /* See if we can extract the source line too and print it on
+ the next line if we can find it. */
+ if (mod != NULL) {
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch
new file mode 100644
index 00000000..e4490bbb
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch
@@ -0,0 +1,30 @@
+kernel headers have restructured mips syscall generation in kernel
+in recent versions, however, ltrace still has logic to define the
+syscall numbers based on old logic, this patch includes the legacy
+UAPI headers to get these defines
+
+Fixes errors e.g.
+../../../../git/sysdeps/linux-gnu/mips/trace.c:138:29: error: '__NR_O32_Linux' undeclared (first use in this function)
+ const int syscallbase[] = {__NR_O32_Linux, __NR_N32_Linux,
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/sysdeps/linux-gnu/mips/trace.c
++++ b/sysdeps/linux-gnu/mips/trace.c
+@@ -34,6 +34,16 @@
+ #include <assert.h>
+ #include <asm/unistd.h>
+
++#ifndef __NR_O32_Linux
++#include <asm/unistd_nr_o32.h>
++#endif
++#ifndef __NR_N32_Linux
++#include <asm/unistd_nr_n64.h>
++#endif
++#ifndef __NR_N64_Linux
++#include <asm/unistd_nr_n32.h>
++#endif
++
+ #include "backend.h"
+ #include "common.h"
+ #include "debug.h"