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

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