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

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