From 77c23c62ae28611f660ea4a8b25525c3cfe2871f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 26 Jan 2021 11:56:17 +0100 Subject: support for mtr --valgdb add a new "debugger" to mtr, that runs the executable under valgrind in gdb. valgrind pid is auto-detected, but the delay (sleep) and vgdb path are hard-coded for now --- mysql-test/lib/My/Debugger.pm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'mysql-test/lib') diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm index 700124ec3cb..f6aa41269cb 100644 --- a/mysql-test/lib/My/Debugger.pm +++ b/mysql-test/lib/My/Debugger.pm @@ -79,6 +79,22 @@ my %debuggers = ( if ::mtr_grab_file('/proc/sys/kernel/perf_event_paranoid') > 1; } }, + valgdb => { + term => 1, + run => 'gdb', + options => '-x {script} {exe}', + script => < 'windbg', @@ -147,16 +163,17 @@ sub do_args($$$$$) { my $options = subst($v->{options}, %vars); @$$args = map { unquote_for_mtr $_ } $options =~ /("[^"]+"|\S+)/g; + my $run = $v->{run} || $k; if ($opt =~ /^manual-/) { print "\nTo start $k for $type, type in another window:\n"; - print "$k $options\n"; + print "$run $options\n"; $$exe= undef; # Indicate the exe should not be started } elsif ($v->{term}) { - unshift @$$args, '-title', $type, '-e', $k; + unshift @$$args, '-title', $type, '-e', $run; $$exe = 'xterm'; } else { - $$exe = $k; + $$exe = $run; } } -- cgit v1.2.1