Blame SOURCES/0009-lib-Correct-the-syntax-for-gdb-backtrace-command.patch

10661d
From 7e9e07dc9ce67777a201beddc8cef32f08293a2b Mon Sep 17 00:00:00 2001
10661d
From: Martin Kutlak <mkutlak@redhat.com>
10661d
Date: Tue, 24 Jul 2018 10:17:05 +0200
10661d
Subject: [PATCH] lib: Correct the syntax for gdb backtrace command
10661d
10661d
abrt-action-generate-backtrace generates backtraces with error message:
10661d
A syntax error in expression, near `full'.
10661d
10661d
According to the GDB documentation the correct syntax for backtrace
10661d
command is:
10661d
backtrace [n]
10661d
backtrace full [n]
10661d
10661d
- sourceware.org/gdb/onlinedocs/gdb/Backtrace.html
10661d
10661d
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
10661d
---
10661d
 src/lib/hooklib.c | 4 ++--
10661d
 1 file changed, 2 insertions(+), 2 deletions(-)
10661d
10661d
diff --git a/src/lib/hooklib.c b/src/lib/hooklib.c
10661d
index 135c7cde..b66fc119 100644
10661d
--- a/src/lib/hooklib.c
10661d
+++ b/src/lib/hooklib.c
10661d
@@ -353,11 +353,11 @@ char *get_backtrace(const char *dump_dir_name, unsigned timeout_sec, const char
10661d
     /* Limit bt depth. With no limit, gdb sometimes OOMs the machine */
10661d
     unsigned bt_depth = 1024;
10661d
     const char *thread_apply_all = "thread apply all -ascending";
10661d
-    const char *full = " full";
10661d
+    const char *full = "full ";
10661d
     char *bt = NULL;
10661d
     while (1)
10661d
     {
10661d
-        args[bt_cmd_index] = xasprintf("%s backtrace %u%s", thread_apply_all, bt_depth, full);
10661d
+        args[bt_cmd_index] = xasprintf("%s backtrace %s%u", thread_apply_all, full, bt_depth);
10661d
         bt = exec_vp(args, /*redirect_stderr:*/ 1, timeout_sec, NULL);
10661d
         free(args[bt_cmd_index]);
10661d
         if ((bt && strnlen(bt, 256*1024) < 256*1024) || bt_depth <= 32)
10661d
-- 
10661d
2.17.2
10661d