aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2011-11-14 15:18:54 +0000
committerYao Qi <yao@codesourcery.com>2011-11-14 15:18:54 +0000
commit1e4d17643d49f247df304245675551ee71995a37 (patch)
treecfc5abd91467ef7a0270e37de1512e806cf4a1c0 /gdb/testsuite
parent5c73ff4ec2c54aa1788d012003e59bfbd14a896b (diff)
downloadgdb-1e4d17643d49f247df304245675551ee71995a37.zip
gdb-1e4d17643d49f247df304245675551ee71995a37.tar.gz
gdb-1e4d17643d49f247df304245675551ee71995a37.tar.bz2
gdb/
* remote.c (struct remote_state): <install_in_trace> new field. (PACKET_InstallInTrace): New enum value. (remote_install_in_trace_feature): Support InstallInTrace. (remote_supports_install_in_trace): Likewise. (remote_protocol_features): Likewise. (_initialize_remote): Likewise. (remote_can_download_tracepoint): New. * target.h (struct target): New field `to_can_download_tracepoint'. (target_can_download_tracepoint): New macro. * target.c (update_current_target): Update. * breakpoint.h (struct bp_location): Add comment on field `duplicate'. (should_be_inserted): Don't differentiate breakpoint and tracepoint. (remove_breakpoints): Don't remove tracepoints. (tracepoint_locations_match ): New. (breakpoint_locations_match): Call it. (disable_breakpoints_in_unloaded_shlib): Handle tracepoint. (download_tracepoint_locations): New. (update_global_location_list): Call it. * tracepoint.c (find_matching_tracepoint): Delete. (find_matching_tracepoint_location): Renamed from find_matching_tracepoint. Return bp_location rather than tracepoint. (merge_uploaded_tracepoints): Set `inserted' field to 1 if tracepoint is found. gdb/doc/ * gdb.texinfo (Create and Delete Tracepoints): Describe changed behavior of tracepoint. (General Query Packets): New feature InstallInTrace. (Remote Configuration): Document "set remote install-in-trace-packet". gdb/gdbserver/ * server.c (handle_query): Handle InstallInTrace for qSupported. * tracepoint.c (add_tracepoint): Sort list. (install_tracepoint, download_tracepoint): New. (cmd_qtdp): Call them to install and download tracepoints. (sort_tracepoints): Removed. (cmd_qtstart): Update. gdb/testsuite/ * gdb.trace/change-loc-1.c: New. * gdb.trace/change-loc-2.c: New. * gdb.trace/change-loc.c: New. * gdb.trace/change-loc.exp: New. * gdb.trace/change-loc.h: New. * gdb.trace/trace-break.c (marker): Define new symbol. * gdb.trace/trace-break.exp (break_trace_same_addr_5): New. (break_trace_same_addr_6): New.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog12
-rw-r--r--gdb/testsuite/gdb.trace/change-loc-1.c29
-rw-r--r--gdb/testsuite/gdb.trace/change-loc-2.c24
-rw-r--r--gdb/testsuite/gdb.trace/change-loc.c53
-rw-r--r--gdb/testsuite/gdb.trace/change-loc.exp153
-rw-r--r--gdb/testsuite/gdb.trace/change-loc.h42
-rw-r--r--gdb/testsuite/gdb.trace/trace-break.c7
-rw-r--r--gdb/testsuite/gdb.trace/trace-break.exp202
8 files changed, 522 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 81dd708..8a6825f 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2011-11-14 Yao Qi <yao@codesourcery.com>
+
+ * gdb.trace/change-loc-1.c: New.
+ * gdb.trace/change-loc-2.c: New.
+ * gdb.trace/change-loc.c: New.
+ * gdb.trace/change-loc.exp: New.
+ * gdb.trace/change-loc.h: New.
+ * gdb.trace/trace-break.c (marker): Define new symbol.
+ * gdb.trace/trace-break.exp (break_trace_same_addr_5):
+ New.
+ (break_trace_same_addr_6): New.
+
2011-11-12 Matt Rice <ratmice@gmail.com>
* gdb.base/info-macros.exp: Make tests for info definitions
diff --git a/gdb/testsuite/gdb.trace/change-loc-1.c b/gdb/testsuite/gdb.trace/change-loc-1.c
new file mode 100644
index 0000000..92d453c
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/change-loc-1.c
@@ -0,0 +1,29 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "change-loc.h"
+
+void func1 (int x)
+{
+ int y = x + 4;
+ func4 ();
+}
+
+void func (int x)
+{
+ func1 (x);
+}
diff --git a/gdb/testsuite/gdb.trace/change-loc-2.c b/gdb/testsuite/gdb.trace/change-loc-2.c
new file mode 100644
index 0000000..d479917
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/change-loc-2.c
@@ -0,0 +1,24 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "change-loc.h"
+
+void
+func2 (int x)
+{
+ func4 ();
+}
diff --git a/gdb/testsuite/gdb.trace/change-loc.c b/gdb/testsuite/gdb.trace/change-loc.c
new file mode 100644
index 0000000..d1e0a7f
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/change-loc.c
@@ -0,0 +1,53 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <dlfcn.h>
+#include "change-loc.h"
+
+extern void func (int x);
+
+static void
+marker () {}
+
+int main()
+{
+ const char *libname = "change-loc-2.sl";
+ void *h;
+ int (*p_func) (int);
+
+ func (3);
+
+ func4 ();
+
+ marker ();
+
+ h = dlopen (libname, RTLD_LAZY);
+ if (h == NULL) return 1;
+
+ p_func = dlsym (h, "func2");
+ if (p_func == NULL) return 2;
+
+ (*p_func) (4);
+
+ marker ();
+
+ dlclose (h);
+
+ marker ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp
new file mode 100644
index 0000000..e125024
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/change-loc.exp
@@ -0,0 +1,153 @@
+# Copyright 2011 Free Software Foundation, Inc.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if {[skip_shlib_tests]} {
+ return 0
+}
+
+set testfile "change-loc"
+set libfile1 "change-loc-1"
+set libfile2 "change-loc-2"
+set srcfile $testfile.c
+set executable $testfile
+set libsrc1 $srcdir/$subdir/$libfile1.c
+set libsrc2 $srcdir/$subdir/$libfile2.c
+set binfile $objdir/$subdir/$testfile
+set lib_sl1 $objdir/$subdir/$libfile1.sl
+set lib_sl2 $objdir/$subdir/$libfile2.sl
+
+set lib_opts debug
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# Some targets have leading underscores on assembly symbols.
+set additional_flags [list debug shlib=$lib_sl1 shlib_load [gdb_target_symbol_prefix_flags]]
+
+if { [gdb_compile_shlib $libsrc1 $lib_sl1 $lib_opts] != ""
+ || [gdb_compile_shlib $libsrc2 $lib_sl2 $lib_opts] != ""
+ || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $additional_flags] != ""} {
+ untested "Could not compile either $libsrc1 or $srcdir/$subdir/$srcfile."
+ return -1
+}
+
+clean_restart $executable
+
+gdb_load_shlibs $lib_sl1
+gdb_load_shlibs $lib_sl2
+
+if ![runto_main] {
+ fail "Can't run to main to check for trace support"
+ return -1
+}
+
+if { ![gdb_target_supports_trace] } then {
+ unsupported "Current target does not support trace"
+ return -1;
+}
+
+if [is_amd64_regs_target] {
+ set pcreg "rip"
+} elseif [is_x86_like_target] {
+ set pcreg "eip"
+} else {
+ set pcreg "pc"
+}
+
+
+# Set tracepoint during tracing experiment.
+
+proc tracepoint_change_loc_1 { trace_type } {
+ global testfile
+ global srcfile
+ global pcreg
+ global gdb_prompt
+ global pf_prefix
+
+ set old_pf_prefix $pf_prefix
+ set pf_prefix "$pf_prefix 1 $trace_type:"
+
+ clean_restart ${testfile}
+ if ![runto_main] {
+ fail "Can't run to main"
+ set pf_prefix $old_pf_prefix
+ return -1
+ }
+ gdb_test_no_output "delete break 1"
+
+ # Set a tracepoint we'll never meet. Just to avoid the complain after
+ # type `tstart' later.
+ gdb_test "next" ".*"
+ gdb_test "trace main" "Tracepoint \[0-9\] at.* file .*$srcfile, line.*" \
+ "set tracepoint on main"
+
+ gdb_test "break marker" "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint on marker"
+
+ gdb_test_no_output "tstart"
+
+ gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \
+ "continue to marker 1"
+ # Set a tracepoint during tracing.
+ gdb_test "${trace_type} set_tracepoint" ".*" "set tracepoint on set_tracepoint"
+
+ gdb_trace_setactions "set action for tracepoint" "" \
+ "collect \$$pcreg" "^$"
+
+ # tracepoint has two locations after shlib change-loc-1 is loaded.
+ gdb_test "info trace" \
+ "Num Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*4\.1.* in func4.*4\.2.* in func4.*" \
+ "tracepoint with two locations"
+
+ setup_kfail "gdb/13392" x86_64-*-*
+ gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \
+ "continue to marker 2"
+
+ # tracepoint has three locations after shlib change-loc-2 is loaded.
+ gdb_test "info trace" \
+ "Num Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*4\.1.* in func4.*4\.2.* in func4.*4\.3.* in func4 .*" \
+ "tracepoint with three locations"
+
+ gdb_test_no_output "tstop"
+
+ setup_kfail "gdb/13392" x86_64-*-*
+ gdb_test "tfind" "Found trace frame 0, tracepoint 4.*" "tfind frame 0"
+ gdb_test "tfind" "Target failed to find requested trace frame\\..*"
+
+ set pf_prefix $old_pf_prefix
+}
+
+
+tracepoint_change_loc_1 "trace"
+
+# Re-compile test case with IPA.
+set libipa $objdir/../gdbserver/libinproctrace.so
+gdb_load_shlibs $libipa
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable \
+ [list debug nowarnings shlib=$libipa shlib=$lib_sl1 shlib_load] ] != "" } {
+ untested change-loc.exp
+ return -1
+}
+
+tracepoint_change_loc_1 "ftrace"
diff --git a/gdb/testsuite/gdb.trace/change-loc.h b/gdb/testsuite/gdb.trace/change-loc.h
new file mode 100644
index 0000000..1b0e303
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/change-loc.h
@@ -0,0 +1,42 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef SYMBOL_PREFIX
+#define SYMBOL(str) SYMBOL_PREFIX #str
+#else
+#define SYMBOL(str) #str
+#endif
+
+/* Called from asm. */
+static void __attribute__((used))
+func5 (void)
+{}
+
+static void
+func4 (void)
+{
+ /* `set_tracepoint' is the label where we'll set multiple tracepoints and
+ breakpoints at. The insn at the label must the large enough to
+ fit a fast tracepoint jump. */
+ asm (" .global " SYMBOL(set_tracepoint) "\n"
+ SYMBOL(set_tracepoint) ":\n"
+#if (defined __x86_64__ || defined __i386__)
+ " call " SYMBOL(func5) "\n"
+#endif
+ );
+
+}
diff --git a/gdb/testsuite/gdb.trace/trace-break.c b/gdb/testsuite/gdb.trace/trace-break.c
index fd06142..a327202 100644
--- a/gdb/testsuite/gdb.trace/trace-break.c
+++ b/gdb/testsuite/gdb.trace/trace-break.c
@@ -43,6 +43,13 @@ marker (void)
" call " SYMBOL(func) "\n"
#endif
);
+
+ asm (" .global " SYMBOL(after_set_point) "\n"
+ SYMBOL(after_set_point) ":\n"
+#if (defined __x86_64__ || defined __i386__)
+ " call " SYMBOL(func) "\n"
+#endif
+ );
}
static void
diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp
index c2d7b2c..50344d2 100644
--- a/gdb/testsuite/gdb.trace/trace-break.exp
+++ b/gdb/testsuite/gdb.trace/trace-break.exp
@@ -39,6 +39,20 @@ if ![gdb_target_supports_trace] {
return -1;
}
+set fpreg "fp"
+set spreg "sp"
+set pcreg "pc"
+
+if [is_amd64_regs_target] {
+ set fpreg "rbp"
+ set spreg "rsp"
+ set pcreg "rip"
+} elseif [is_x86_like_target] {
+ set fpreg "ebp"
+ set spreg "esp"
+ set pcreg "eip"
+}
+
# Set breakpoint and tracepoint at the same address.
proc break_trace_same_addr_1 { trace_type option } {
@@ -200,6 +214,159 @@ proc break_trace_same_addr_4 { trace_type option } {
set pf_prefix $old_pf_prefix
}
+# Set two tracepoints TRACE1 and TRACE2 at two locations, and start tracing.
+# Then, set tracepoint TRACE3 at either of these two locations.
+# TRACE3_AT_FIRST_LOC is a boolean variable to decide insert TRACE3 at which
+# of two locations. Verify these tracepoints work as expected.
+
+proc break_trace_same_addr_5 { trace1 trace2 trace3 trace3_at_first_loc } {
+ global executable
+ global pf_prefix
+ global hex
+ global fpreg
+ global spreg
+ global pcreg
+
+ set old_pf_prefix $pf_prefix
+ set pf_prefix "$pf_prefix 5 $trace1 $trace2 ${trace3}@${trace3_at_first_loc}:"
+
+ # Start with a fresh gdb.
+ clean_restart ${executable}
+ if ![runto_main] {
+ fail "Can't run to main"
+ set pf_prefix $old_pf_prefix
+ return -1
+ }
+
+ gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*"
+ gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*"
+
+ gdb_test "${trace1} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
+ "${trace1} set_point 1"
+ gdb_trace_setactions "set action for tracepoint 1" "" \
+ "collect \$$pcreg" "^$"
+ gdb_test "${trace2} after_set_point" \
+ "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
+ "${trace2} after_set_point 1"
+
+ gdb_trace_setactions "set action for tracepoint 2" "" \
+ "collect \$$spreg" "^$"
+
+ gdb_test_no_output "tstart"
+
+ gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to marker"
+
+ if [string equal $trace3_at_first_loc "1"] {
+ gdb_test "${trace3} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
+ "${trace3} set_point 2"
+ } else {
+ gdb_test "${trace3} after_set_point" \
+ "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
+ "${trace2} after_set_point 2"
+ }
+ gdb_trace_setactions "set action for tracepoint 3" "" \
+ "collect \$$fpreg" "^$"
+
+ gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end"
+ gdb_test_no_output "tstop"
+
+ gdb_test "tfind tracepoint 4" "Found trace frame \[0-9\], tracepoint .*" \
+ "tfind test frame of tracepoint 4"
+ gdb_test "tdump" \
+ "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${pcreg} = .*" \
+ "tdump 1"
+ gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" \
+ "reset to frame 0 (1)"
+ gdb_test "tfind tracepoint 5" "Found trace frame \[0-9\], tracepoint .*" \
+ "tfind test frame of tracepoint 5"
+ gdb_test "tdump" \
+ "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${spreg} = .*" \
+ "tdump 2"
+ gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" \
+ "reset to frame 0 (2)"
+ gdb_test "tfind tracepoint 6" "Found trace frame \[0-9\], tracepoint .*" \
+ "tfind test frame of tracepoint 6"
+ gdb_test "tdump" \
+ "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${fpreg} = .*" \
+ "tdump 3"
+
+ set pf_prefix $old_pf_prefix
+}
+
+# Set two tracepoints at the same address, and enable/disable them. Verify
+# tracepoints work as expect.
+
+proc break_trace_same_addr_6 { trace1 enable1 trace2 enable2 } {
+ global executable
+ global pf_prefix
+ global hex
+ global gdb_prompt
+ global spreg
+ global pcreg
+
+ set old_pf_prefix $pf_prefix
+ set pf_prefix "$pf_prefix 6 $trace1 $enable1 $trace2 $enable2:"
+
+ # Start with a fresh gdb.
+ clean_restart ${executable}
+ if ![runto_main] {
+ fail "Can't run to main"
+ set pf_prefix $old_pf_prefix
+ return -1
+ }
+
+ gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*"
+ gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*"
+
+ gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to marker"
+
+ gdb_test "${trace1} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
+ "${trace1} set_point 1"
+ gdb_trace_setactions "set action for tracepoint 1" "" \
+ "collect \$$pcreg" "^$"
+ gdb_test "${trace2} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
+ "${trace2} set_point 2"
+ gdb_trace_setactions "set action for tracepoint 2" "" \
+ "collect \$$spreg" "^$"
+
+ gdb_test_no_output "$enable1 4"
+ gdb_test_no_output "$enable2 5"
+
+ gdb_test_no_output "tstart"
+ gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end"
+ gdb_test_no_output "tstop"
+
+
+ if [string equal $enable1 "enable"] {
+ gdb_test "tfind tracepoint 4" "Found trace frame \[0-9\], tracepoint .*" \
+ "tfind test frame of tracepoint 4"
+ gdb_test "tdump" \
+ "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${pcreg} = .*" \
+ "tdump 1"
+ gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" \
+ "reset to frame 0 (1)"
+ } else {
+ gdb_test "tfind tracepoint 4" "Target failed to find requested trace frame.*" \
+ "tfind test frame of tracepoint 4"
+ }
+
+ if [string equal $enable2 "enable"] {
+ gdb_test "tfind tracepoint 5" "Found trace frame \[0-9\], tracepoint .*" \
+ "tfind test frame of tracepoint 5"
+ gdb_test "tdump" \
+ "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${spreg} = .*" \
+ "tdump 2"
+ gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" \
+ "reset to frame 0 (2)"
+ } else {
+ gdb_test "tfind tracepoint 5" "Target failed to find requested trace frame.*" \
+ "tfind test frame of tracepoint 5"
+ }
+
+ set pf_prefix $old_pf_prefix
+}
+
+
foreach break_always_inserted { "on" "off" } {
break_trace_same_addr_1 "trace" ${break_always_inserted}
break_trace_same_addr_2 "trace" "trace" ${break_always_inserted}
@@ -207,6 +374,13 @@ foreach break_always_inserted { "on" "off" } {
break_trace_same_addr_4 "trace" ${break_always_inserted}
}
+foreach at_first_loc { "1" "0" } {
+ break_trace_same_addr_5 "trace" "trace" "trace" ${at_first_loc}
+}
+
+break_trace_same_addr_6 "trace" "enable" "trace" "disable"
+break_trace_same_addr_6 "trace" "disable" "trace" "enable"
+
set libipa $objdir/../gdbserver/libinproctrace.so
gdb_load_shlibs $libipa
@@ -238,4 +412,32 @@ if { [gdb_test "info sharedlibrary" ".*libinproctrace\.so.*" "IPA loaded"] != 0
break_trace_same_addr_3 "ftrace" ${break_always_inserted}
break_trace_same_addr_4 "ftrace" ${break_always_inserted}
}
+
+ foreach trace1 { "trace" "ftrace" } {
+ foreach trace2 { "trace" "ftrace" } {
+ foreach trace3 { "trace" "ftrace" } {
+
+ if { [string equal $trace1 "trace"]
+ && [string equal $trace2 "trace"]
+ && [string equal $trace3 "trace"] } {
+ continue
+ }
+
+ foreach at_first_loc { "1" "0" } {
+ break_trace_same_addr_5 $trace1 $trace2 $trace3 $at_first_loc
+ }
+ }
+ }
+ }
+
+ foreach trace1 { "trace" "ftrace" } {
+ foreach trace2 { "trace" "ftrace" } {
+ if { [string equal $trace1 "trace"]
+ && [string equal $trace2 "trace"] } {
+ continue
+ }
+ break_trace_same_addr_6 $trace1 "enable" $trace2 "disable"
+ break_trace_same_addr_6 $trace1 "disable" $trace2 "enable"
+ }
+ }
}