Merge lp:~laurynas-biveinis/percona-server/mtr-manual-lldb-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis on 2014-06-10
Status: Merged
Approved by: Sergei Glushchenko on 2014-07-29
Approved revision: 662
Merged at revision: 685
Proposed branch: lp:~laurynas-biveinis/percona-server/mtr-manual-lldb-5.5
Merge into: lp:percona-server/5.5
Diff against target: 93 lines (+39/-2)
1 file modified
mysql-test/mysql-test-run.pl (+39/-2)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/mtr-manual-lldb-5.5
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 2014-06-10 Approve on 2014-07-29
Review via email: mp+222618@code.launchpad.net

Description of the change

Merge mysql-test-run.pl --manual-lldb from 5.1.

To post a comment you must log in.

Approve

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mysql-test/mysql-test-run.pl'
2--- mysql-test/mysql-test-run.pl 2014-03-27 15:42:21 +0000
3+++ mysql-test/mysql-test-run.pl 2014-06-10 11:01:44 +0000
4@@ -234,6 +234,7 @@
5 my $opt_boot_ddd;
6 our $opt_manual_gdb;
7 our $opt_manual_dbx;
8+our $opt_manual_lldb;
9 our $opt_manual_ddd;
10 our $opt_manual_debug;
11 our $opt_debugger;
12@@ -1089,6 +1090,7 @@
13 'gdb' => \$opt_gdb,
14 'client-gdb' => \$opt_client_gdb,
15 'manual-gdb' => \$opt_manual_gdb,
16+ 'manual-lldb' => \$opt_manual_lldb,
17 'boot-gdb' => \$opt_boot_gdb,
18 'manual-debug' => \$opt_manual_debug,
19 'ddd' => \$opt_ddd,
20@@ -1541,7 +1543,8 @@
21 }
22
23 if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd ||
24- $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx)
25+ $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx ||
26+ $opt_manual_lldb)
27 {
28 mtr_error("You need to use the client debug options for the",
29 "embedded server. Ex: --client-gdb");
30@@ -1570,7 +1573,7 @@
31 if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd ||
32 $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug ||
33 $opt_dbx || $opt_client_dbx || $opt_manual_dbx ||
34- $opt_debugger || $opt_client_debugger )
35+ $opt_manual_lldb || $opt_debugger || $opt_client_debugger )
36 {
37 # Indicate that we are using debugger
38 $glob_debugger= 1;
39@@ -4996,6 +4999,10 @@
40 {
41 gdb_arguments(\$args, \$exe, $mysqld->name());
42 }
43+ elsif ( $opt_manual_lldb )
44+ {
45+ lldb_arguments(\$args, \$exe, $mysqld->name());
46+ }
47 elsif ( $opt_ddd || $opt_manual_ddd )
48 {
49 ddd_arguments(\$args, \$exe, $mysqld->name());
50@@ -5743,6 +5750,34 @@
51
52
53 #
54+# Modify the exe and args so that program is run in lldb
55+#
56+sub lldb_arguments {
57+ my $args= shift;
58+ my $exe= shift;
59+ my $type= shift;
60+ my $input= shift;
61+
62+ my $lldb_init_file= "$opt_vardir/tmp/lldbinit.$type";
63+ unlink($lldb_init_file);
64+
65+ my $str= join(" ", @$$args);
66+ my $runline= $input ? "r $str < $input" : "r $str";
67+
68+ # write init file for mysqld or client
69+ mtr_tofile($lldb_init_file,
70+ "b main\n" .
71+ $runline);
72+
73+ print "\nTo start lldb for $type, type in another window:\n";
74+ print "(cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe)\n";
75+
76+ # Indicate the exe should not be started
77+ $$exe= undef;
78+ return;
79+}
80+
81+#
82 # Modify the exe and args so that program is run in ddd
83 #
84 sub ddd_arguments {
85@@ -6201,6 +6236,8 @@
86 running test(s)
87 manual-gdb Let user manually start mysqld in gdb, before running
88 test(s)
89+ manual-lldb Let user manually start mysqld in lldb, before running
90+ test(s)
91 manual-ddd Let user manually start mysqld in ddd, before running
92 test(s)
93 manual-dbx Let user manually start mysqld in dbx, before running

Subscribers

People subscribed via source and target branches