1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
Douglas Bagnall
ecd65265ac selftest/gdb_backtrace: print info threads and some signpost headers
Search for '###'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-20 23:42:34 +00:00
Douglas Bagnall
12ce289922 selftest/gdb_backtrace: avoid printing backtrace twice with 1 thread
We call 'thread apply all bt full' in case there are interesting
things going on in other threads, but often there are no other threads
and it only serves to repeat the original trace (and very slowly, for
some reason).

The $_inferior_thread_count convenience variable is new in gdb 13.1
(2022-ish) so we init-if-undefined it to default to the old behaviour.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-20 23:42:34 +00:00
Douglas Bagnall
904479cdf6 selftest/gdb_backtrace: print python traceback if available
If a program happens to have 'PyList_New' defined but is not a python
script, gdb will print

> Undefined command: "py-bt".  Try "help".

and probably stop. This happens after the C backtraces have been
printed, so nothing is lost.

The traceback is printed twice -- once in conventional Python style
for clarity, and once with extra "full" information.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-20 23:42:34 +00:00
Andreas Schneider
1399b2430a selftest: Reformat shell scripts
shfmt -f selftest/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-03 00:59:34 +00:00
Douglas Bagnall
767287920a selftest/gdb_backtrace: remove duplicate assignment.
See 18 or so lines up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 10 01:17:52 UTC 2021 on sn-devel-184
2021-06-10 01:17:52 +00:00
Douglas Bagnall
5b7c2c3b1a selftest/gdb_backtrace: add an off switch
Sometime you know a test is going to crash and produce a LOT of
backtrace, and you already know what it will look like. For those
times you can set

PLEASE_NO_GDB_BACKTRACE=1

and there will be no backtrace, which can save quite a bit of time and
thousands of lines of log file. (In particular, backtraces of Python
programs can take over a minute to complete).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
2021-02-22 14:45:38 +00:00
Stefan Metzmacher
9178e72dcc selftest/gdb_backtrace: use 'unset LD_PRELOAD'
We may have bugs in socket_wrapper and others, we don't want
to inject these bugs into the debugger.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2021-02-10 14:00:32 +00:00
Stefan Metzmacher
e952a127d6 selftest/gdb_*: make use of 'mktemp'
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:21 +01:00
Andrew Bartlett
0ddafeba69 selftest: Cope with no binary argument being supplied to gdb_backtrace
Modern versions of gdb are better than us at working out what binary
is running, and so it is more reliable to omit the binary argument.

This change is required because samba4 no longer supplies this
argument.

Andrew Bartlett
2011-06-24 13:17:19 +10:00
Andrew Bartlett
985c7da604 selftest: Improve gdb_backtrace to run in batch mode
Following Tridge's advice, we need to have no input (/dev/null) and
-batch for reliable opeation on big backtraces.

We should also use --pid, and let gdb find the binary

Andrew Bartlett
2011-02-22 16:20:10 +11:00
Matthieu Patou
c254527386 build: update gdb_backtrace to make it search for gdb66 as it work on freebsd
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sun Nov 28 16:37:08 CET 2010 on sn-devel-104
2010-11-28 16:37:08 +01:00
Matthieu Patou
06beebd1e4 fix bad shell 2010-11-28 17:50:45 +03:00
Matthieu Patou
7e2b315ca0 add handling for solaris
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sun Nov 28 13:32:21 CET 2010 on sn-devel-104
2010-11-28 13:32:21 +01:00
Stefan Metzmacher
f79ff9582f selftest/gdb_backtrace: call "info locals" too
metze
2010-03-01 13:33:05 +01:00
Stefan Metzmacher
6bc9fb887f selftest: move gdb_* and valgrind_* scripts to selftest/
metze
2008-10-28 12:20:59 +01:00