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