From c0d4d1c0f81b3452286bdb9e30ede03706ba0a9f Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Mon, 16 Apr 2012 11:29:08 +0000 Subject: [PATCH] gdb/testsuite/ * lib/trace-support.exp (get_in_proc_agent): New. * gdb.trace/change-loc.exp: Call get_in_proc_agent to get the location of in process trace agent. * gdb.trace/ftrace.exp: Likewise. * gdb.trace/pending.exp: Likewise. * gdb.trace/trace-break.exp: Likewise. * gdb.trace/trace-mt.exp * gdb.trace/tspeed.exp: Likewise. * gdb.trace/tstatus.exp * gdb.trace/strace.exp: Likewise. --- gdb/testsuite/ChangeLog | 13 +++++++++++++ gdb/testsuite/gdb.trace/change-loc.exp | 2 +- gdb/testsuite/gdb.trace/ftrace.exp | 4 ++-- gdb/testsuite/gdb.trace/pending.exp | 2 +- gdb/testsuite/gdb.trace/strace.exp | 2 +- gdb/testsuite/gdb.trace/trace-break.exp | 4 ++-- gdb/testsuite/gdb.trace/trace-mt.exp | 4 ++-- gdb/testsuite/gdb.trace/tspeed.exp | 2 +- gdb/testsuite/gdb.trace/tstatus.exp | 4 ++-- gdb/testsuite/lib/trace-support.exp | 12 ++++++++++++ 10 files changed, 37 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a4acfd83fcd..c276178b96e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2012-04-16 Yao Qi + + * lib/trace-support.exp (get_in_proc_agent): New. + * gdb.trace/change-loc.exp: Call get_in_proc_agent to get the location + of in process trace agent. + * gdb.trace/ftrace.exp: Likewise. + * gdb.trace/pending.exp: Likewise. + * gdb.trace/trace-break.exp: Likewise. + * gdb.trace/trace-mt.exp + * gdb.trace/tspeed.exp: Likewise. + * gdb.trace/tstatus.exp + * gdb.trace/strace.exp: Likewise. + 2012-04-16 Thomas Schwinge * gdb.asm/sh.inc (gdbasm_startup): Only set up the stack pointer if the diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp index db9bdbdb08e..ef8ab45953e 100644 --- a/gdb/testsuite/gdb.trace/change-loc.exp +++ b/gdb/testsuite/gdb.trace/change-loc.exp @@ -275,7 +275,7 @@ tracepoint_change_loc_1 "trace" tracepoint_change_loc_2 "trace" # Re-compile test case with IPA. -set libipa $objdir/../gdbserver/libinproctrace.so +set libipa [get_in_proc_agent] gdb_load_shlibs $libipa if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable \ diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp index 70a8f0ffb4e..634d77b21c5 100644 --- a/gdb/testsuite/gdb.trace/ftrace.exp +++ b/gdb/testsuite/gdb.trace/ftrace.exp @@ -39,7 +39,7 @@ if ![gdb_target_supports_trace] { return -1 } -set libipa $objdir/../gdbserver/libinproctrace.so +set libipa [get_in_proc_agent] gdb_load_shlibs $libipa # Can't use prepare_for_testing, because that splits compiling into @@ -166,7 +166,7 @@ proc test_fast_tracepoints {} { gdb_reinitialize_dir $srcdir/$subdir -if { [gdb_test "info sharedlibrary" ".*libinproctrace\.so.*" "IPA loaded"] != 0 } { +if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } { untested "Could not find IPA lib loaded" return 1 } diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trace/pending.exp index 4e7dc31a6d4..018ded2bc45 100644 --- a/gdb/testsuite/gdb.trace/pending.exp +++ b/gdb/testsuite/gdb.trace/pending.exp @@ -499,7 +499,7 @@ pending_tracepoint_with_action_resolved "trace" pending_tracepoint_installed_during_trace "trace" # Re-compile test case with IPA. -set libipa $objdir/../gdbserver/libinproctrace.so +set libipa [get_in_proc_agent] gdb_load_shlibs $libipa lappend exec_opts "shlib=$libipa" diff --git a/gdb/testsuite/gdb.trace/strace.exp b/gdb/testsuite/gdb.trace/strace.exp index 88039ffc065..00fca8afd6c 100644 --- a/gdb/testsuite/gdb.trace/strace.exp +++ b/gdb/testsuite/gdb.trace/strace.exp @@ -23,7 +23,7 @@ set srcfile $testfile.c set binfile $objdir/$subdir/$testfile set executable $testfile -set libipa $objdir/../gdbserver/libinproctrace.so +set libipa [get_in_proc_agent] set lib_opts debug diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp index 6c5e43a57e7..2d19511450a 100644 --- a/gdb/testsuite/gdb.trace/trace-break.exp +++ b/gdb/testsuite/gdb.trace/trace-break.exp @@ -352,7 +352,7 @@ foreach at_first_loc { "1" "0" } { break_trace_same_addr_6 "trace" "enable" "trace" "disable" break_trace_same_addr_6 "trace" "disable" "trace" "enable" -set libipa $objdir/../gdbserver/libinproctrace.so +set libipa [get_in_proc_agent] gdb_load_shlibs $libipa # Can't use prepare_for_testing, because that splits compiling into @@ -372,7 +372,7 @@ if ![runto_main] { } gdb_reinitialize_dir $srcdir/$subdir -if { [gdb_test "info sharedlibrary" ".*libinproctrace\.so.*" "IPA loaded"] != 0 } { +if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } { untested "Could not find IPA lib loaded" } else { foreach break_always_inserted { "on" "off" } { diff --git a/gdb/testsuite/gdb.trace/trace-mt.exp b/gdb/testsuite/gdb.trace/trace-mt.exp index 961c9341f8a..d6b619cd684 100644 --- a/gdb/testsuite/gdb.trace/trace-mt.exp +++ b/gdb/testsuite/gdb.trace/trace-mt.exp @@ -108,7 +108,7 @@ foreach break_always_inserted { "on" "off" } { step_over_tracepoint "trace" -set libipa $objdir/../gdbserver/libinproctrace.so +set libipa [get_in_proc_agent] gdb_load_shlibs $libipa # Compile test case again with IPA. @@ -125,7 +125,7 @@ if ![runto_main] { } gdb_reinitialize_dir $srcdir/$subdir -if { [gdb_test "info sharedlibrary" ".*libinproctrace\.so.*" "IPA loaded"] != 0 } { +if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } { untested "Could not find IPA lib loaded" } else { foreach break_always_inserted { "on" "off" } { diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/tspeed.exp index b6e6ecad57b..5f7f36dccee 100644 --- a/gdb/testsuite/gdb.trace/tspeed.exp +++ b/gdb/testsuite/gdb.trace/tspeed.exp @@ -20,7 +20,7 @@ set srcfile ${testfile}.c set executable $testfile set binfile $objdir/$subdir/$executable -set ipalib $objdir/../gdbserver/libinproctrace.so +set ipalib [get_in_proc_agent] if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable [concat {debug nowarnings c} libs=$ipalib]] != "" } { diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp index 1146e1fbc1d..5c4055b1fc9 100644 --- a/gdb/testsuite/gdb.trace/tstatus.exp +++ b/gdb/testsuite/gdb.trace/tstatus.exp @@ -36,7 +36,7 @@ if ![gdb_target_supports_trace] { return -1 } -set libipa $objdir/../gdbserver/libinproctrace.so +set libipa [get_in_proc_agent] gdb_load_shlibs $libipa # Can't use prepare_for_testing, because that splits compiling into @@ -166,7 +166,7 @@ proc test_tracepoints {} { gdb_reinitialize_dir $srcdir/$subdir -if { [gdb_test "info sharedlibrary" ".*libinproctrace\.so.*" "IPA loaded"] != 0 } { +if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } { untested "Could not find IPA lib loaded" return 1 } diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-support.exp index ef28ec8f289..35a8a9db388 100644 --- a/gdb/testsuite/lib/trace-support.exp +++ b/gdb/testsuite/lib/trace-support.exp @@ -301,3 +301,15 @@ proc gdb_find_recursion_test_baseline { filename } { } return $baseline; } + +# Return the location of the IPA library. + +proc get_in_proc_agent {} { + global objdir + + if [target_info exists in_proc_agent] { + return [target_info in_proc_agent] + } else { + return $objdir/../gdbserver/libinproctrace.so + } +} -- 2.30.2