diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-05-03 08:32:19 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-05-23 14:53:18 -0700 |
commit | 4ea5e39b27a74190bf5bf587666d8bfaa86e9547 (patch) | |
tree | 14da65daa99b70324ffd26aafbd4394d3d3bd8db /src/testlib | |
parent | 6b739f836b15ae8942820d1840e3f44d2648084c (diff) |
StackTraceHandler: simplify the gdb and lldb commands
Instead of piping stuff via the shell into them, just use batch mode.
And also take the opportunity to tell them not to read their user-
provided configuration files.
Pick-to: 6.3
Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eba21e71afaefa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestcase.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index b06c88b6cb..3691f71044 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -286,20 +286,11 @@ static void prepareStackTrace() // prepare the command to be run (our PID shouldn't change!) # ifdef Q_OS_LINUX qsnprintf(stackTraceCommand.data(), stackTraceCommand.size(), - "gdb --pid %d 1>&2 2>/dev/null <<EOF\n" - "set prompt\n" - "set height 0\n" - "thread apply all where full\n" - "detach\n" - "quit\n" - "EOF\n", + "gdb --nx --batch --pid %d -ex 'thread apply all bt' 1>&2", static_cast<int>(getpid())); # elif defined(Q_OS_MACOS) qsnprintf(stackTraceCommand.data(), stackTraceCommand.size(), - "lldb -p %d 1>&2 2>/dev/null <<EOF\n" - "bt all\n" - "quit\n" - "EOF\n", + "lldb --batch --no-lldbinit -p %d -o 'bt all' 1>&2", static_cast<int>(getpid())); # endif } |