+2012-12-15 Yao Qi <yao@codesourcery.com>
+
+ * breakpoint.c (print_one_breakpoint_location): Display the
+ state of 'installed' of each non-pending location of a tracepoint
+ in both CLI and MI.
+ (download_tracepoint_locations): Notify 'breakpoint-modified'
+ observer if any tracepoint location is downloaded.
+ * tracepoint.c (start_tracing): Likewise.
+ (merge_uploaded_tracepoints): Record all modified
+ tracepoints and notify 'breakpoint-modified' observer for them.
+
+ * NEWS: Mention the change for CLI and MI.
+
2012-12-15 Yao Qi <yao@codesourcery.com>
* breakpoint.c (download_tracepoint_locations): Iterate over
* The command 'forward-search' can now be abbreviated as 'fo'.
+* The command 'info tracepoints' can now display 'installed on target'
+ or 'not installed on target' for each non-pending location of tracepoint.
+
* New configure options
--enable-libmcheck/--disable-libmcheck
command, to allow pattern filling of memory areas.
** New commands "-catch-load"/"-catch-unload" added for intercepting
library load/unload events.
+ ** The response to breakpoint commands and breakpoint async records
+ includes an "installed" field containing a boolean state about each
+ non-pending tracepoint location is whether installed on target or not.
* GDB now supports the "mini debuginfo" section, .gnu_debugdata.
You must have the LZMA library available when configuring GDB for this
ui_out_field_int (uiout, "pass", t->pass_count);
ui_out_text (uiout, " \n");
}
+
+ /* Don't display it when tracepoint or tracepoint location is
+ pending. */
+ if (!header_of_multiple && loc != NULL && !loc->shlib_disabled)
+ {
+ annotate_field (11);
+
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string (uiout, "installed",
+ loc->inserted ? "y" : "n");
+ else
+ {
+ if (loc->inserted)
+ ui_out_text (uiout, "\t");
+ else
+ ui_out_text (uiout, "\tnot ");
+ ui_out_text (uiout, "installed on target\n");
+ }
+ }
}
if (ui_out_is_mi_like_p (uiout) && !part_of_multiple)
{
struct bp_location *bl;
struct tracepoint *t;
+ int bp_location_downloaded = 0;
if ((b->type == bp_fast_tracepoint
? !may_insert_fast_tracepoints
target_download_tracepoint (bl);
bl->inserted = 1;
+ bp_location_downloaded = 1;
}
t = (struct tracepoint *) b;
t->number_on_target = b->number;
+ if (bp_location_downloaded)
+ observer_notify_breakpoint_modified (b);
}
do_cleanups (old_chain);
+2012-12-15 Yao Qi <yao@codesourcery.com>
+
+ * gdb.texinfo (Listing Tracepoints): New item and example about
+ 'installed on target' output.
+ Add more in the example about 'installed on target'.
+ (GDB/MI Breakpoint Commands): Doc about 'installed field.
+
2012-12-14 Tom Tromey <tromey@redhat.com>
* gdb.texinfo (SVR4 Process Information): Mention core files.
@itemize @bullet
@item
its passcount as given by the @code{passcount @var{n}} command
+
+@item
+the state about installed on target of each location
@end itemize
@smallexample
collect globfoo2
end
pass count 1200
+2 tracepoint keep y <MULTIPLE>
+ collect $eip
+2.1 y 0x0804859c in func4 at change-loc.h:35
+ installed on target
+2.2 y 0xb7ffc480 in func4 at change-loc.h:35
+ installed on target
+2.3 y <PENDING> set_tracepoint
+3 tracepoint keep y 0x080485b1 in foo at change-loc.c:29
+ not installed on target
(@value{GDBP})
@end smallexample
^done,bkpt=@{number="@var{number}",type="@var{type}",disp="del"|"keep",
enabled="y"|"n",addr="@var{hex}",func="@var{funcname}",file="@var{filename}",
fullname="@var{full_filename}",line="@var{lineno}",[thread="@var{threadno},]
-times="@var{times}"@}
+times="@var{times}"[,installed="@var{installed}"]@}
@end smallexample
@noindent
where @var{number} is the @value{GDBN} number for this breakpoint,
@var{funcname} is the name of the function where the breakpoint was
inserted, @var{filename} is the name of the source file which contains
-this function, @var{lineno} is the source line number within that file
-and @var{times} the number of times that the breakpoint has been hit
+this function, @var{lineno} is the source line number within that file,
+@var{times} the number of times that the breakpoint has been hit
(always 0 for -break-insert but may be greater for -break-info or -break-list
-which use the same output).
+which use the same output), and @var{installed}, which is an optional
+boolean, is about the state of each non-pending tracepoint location
+installed on target or not.
Note: this format is open to change.
@c An out-of-band breakpoint instead of part of the result?
+2012-12-15 Yao Qi <yao@codesourcery.com>
+
+ * gdb.trace/mi-tracepoint-changed.exp (test_pending_resolved): Check
+ 'installed' field in '=breakpoint-modified'.
+ (test_reconnect): Check 'installed' field in
+ '=breakpoint-modified' and '=breakpoint-created'.
+
+ * gdb.trace/actions.exp: Update test for 'installed' field.
+ * gdb.trace/change-loc.exp (tracepoint_change_loc_1):
+ (tracepoint_change_loc_2): Likewise.
+ Check 'info tracepoint' display nothing else.
+ * gdb.trace/deltrace.exp: Likewise.
+ * gdb.trace/infotrace.exp: Likewise.
+ * gdb.trace/mi-traceframe-changed.exp (test_tfind_remote):
+ Likewise.
+ * gdb.trace/passcount.exp: Likewise.
+ * gdb.trace/tracecmd.exp: Likewise.
+ * gdb.trace/while-stepping.exp: Likewise.
+
2012-12-14 Tom Tromey <tromey@redhat.com>
* gdb.cp/member-name.exp: New file.
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
\[\t \]+collect gdb_char_test.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"5.1c: verify actions set for first tracepoint"
gdb_trace_setactions "5.1d: set actions for second tracepoint" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
\[\t \]+collect gdb_char_test.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
\[\t \]+collect gdb_short_test.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"5.1e: verify actions set for second tracepoint"
gdb_trace_setactions "5.2a: set actions for last (default) tracepoint" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
\[\t \]+collect gdb_char_test.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
\[\t \]+collect gdb_short_test.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test." \
+\[\t \]+collect gdb_long_test.
+\[\t \]+not installed on target." \
"5.2b: verify actions set for second tracepoint"
# 5.3 replace actions set earlier
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
\[\t \]+collect gdb_struct1_test.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
\[\t \]+collect gdb_short_test.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test." \
+\[\t \]+collect gdb_long_test.
+\[\t \]+not installed on target." \
"5.3b: verify actions set for first tracepoint"
#
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
\[\t \]+teval gdb_char_test.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
\[\t \]+teval \\\$tsv \\\+= 1.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test." \
+\[\t \]+collect gdb_long_test.
+\[\t \]+not installed on target." \
"5.10a: verify teval actions set for two tracepoints"
# shlib is unloaded, there are still three locations, but one is pending.
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.* \<PENDING\>\[\t \]+set_tracepoint|4\.2.* \<PENDING\>\[\t \]+set_tracepoint\r\n4\.3.* in func4).*" \
+\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*
+4\.1.* in func4.*\tinstalled on target\r\n(4\.2.* in func4.*\tinstalled on target\r\n4\.3.* \<PENDING\>\[\t \]+set_tracepoint|4\.2.* \<PENDING\>\[\t \]+set_tracepoint.*4\.3.* in func4.*\tinstalled on target).*" \
"tracepoint with two locations (unload)"
gdb_test_no_output "tstop"
gdb_trace_setactions "set action for tracepoint" "" \
"collect \$$pcreg" "^$"
- # tracepoint has no location information now.
+ # tracepoint has no location information now. Make sure nothing
+ # else is displayed.
gdb_test "info trace" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*PENDING.*set_tracepoint.*" \
+\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*PENDING.*set_tracepoint\r\n\[\t \]+collect \\$$pcreg\r" \
"single pending tracepoint info (without symbols)"
gdb_load ${binfile}
# shlib is unloaded, there are still three locations, but one is pending.
gdb_test "info trace" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*1\.1.* in func4.*(1\.2.* in func4.*1\.3.* \<PENDING\>\[\t \]+set_tracepoint|1\.2.* \<PENDING\>\[\t \]+set_tracepoint\r\n1\.3.* in func4).*" \
+\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*
+1\.1.* in func4.*\tinstalled on target\r\n(1\.2.* in func4.*\tinstalled on target\r\n1\.3.* \<PENDING\>\[\t \]+set_tracepoint|1\.2.* \<PENDING\>\[\t \]+set_tracepoint\r\n1\.3.* in func4.*\tinstalled on target).*" \
"tracepoint with two locations (unload)"
gdb_test_no_output "tstop"
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"3.1a: set three tracepoints"
gdb_test "delete tracepoints" \
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"3.2a: set three tracepoints"
#gdb_test_no_output "delete tracepoint $trcpt1" ""
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"3.2c: verify delete first tracepoint"
#gdb_test_no_output "delete tracepoint $trcpt2" ""
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"3.2e: verify delete second tracepoint"
#gdb_test_no_output "delete tracepoint $trcpt3" ""
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"3.3a: set three tracepoints"
#gdb_test_no_output "delete tracepoint $trcpt1 $trcpt2 $trcpt3" ""
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"2.1: info tracepoints (all)"
# 2.2 info tracepoint (specific)
gdb_test "info tracepoint $c_test_num" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+." \
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"2.2a: info tracepoint $c_test_num (gdb_c_test)"
gdb_test "info tracepoint $asm_test_num" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+." \
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
# 2.3 info tracepoint (invalid tracepoint number)
mi_gdb_test "-break-insert end" "\\^done.*" "break end"
mi_gdb_test "-break-insert -a func2" "\\^done.*" "break func2"
- mi_gdb_test "-trace-start" "\\^done.*" "trace start"
+ mi_gdb_test "-trace-start" "=breakpoint-modified,bkpt={.*installed=\"y\".*}.*\\^done.*" \
+ "trace start"
mi_execute_to "exec-continue" "breakpoint-hit" end "" ".*" ".*" \
{ "" "disp=\"keep\"" } \
fail "$test: 2"
exp_continue
}
- -re "=breakpoint-created,bkpt=\{number=\"3\",type=\"tracepoint\",disp=\"keep\",enabled=\"y\",.*,func=\"main\".*${mi_gdb_prompt}" {
+ -re "=breakpoint-created,bkpt=\{number=\"3\",type=\"tracepoint\",disp=\"keep\",enabled=\"y\",\[^\n\]+,func=\"main\"\[^\n\]+,installed=\"y\"" {
# A tracepoint on main was defined in the stub, not in GDB,
# so we should see a =breakpoint-created notification.
pass $test
}
- timeout {
- fail $test
+ }
+ # Tracepoint on marker is defined. After the sync, we know that
+ # the tracepoint is in remote stub. Mark it 'installed'.
+ set test "tracepoint on marker is installed"
+ gdb_expect {
+ -re "=breakpoint-modified,bkpt=\{number=\"2\".*,func=\"marker\".*installed=\"y\".*${mi_gdb_prompt}$" {
+ pass "$test"
}
}
# Check that tracepoint 1 is still pending.
mi_send_resuming_command "exec-continue" "continuing execution to marker 1"
+ # It is expected to get two "=breakpoint-modified" notifications.
+ # Pending tracepoint is resolved.
set test "tracepoint on pendfunc2 resolved"
gdb_expect {
- -re ".*=breakpoint-modified,bkpt=\{number=\"1\",type=\"tracepoint\".*.*times=\"0\"" {
+ -re "=breakpoint-modified,bkpt=\{number=\"1\",type=\"tracepoint\".*.*times=\"0\".*installed=\"n\"" {
pass "$test"
}
- -re ".*${mi_gdb_prompt}$" {
- fail $test
- }
- timeout {
- fail "$test (timeout)"
+ }
+ # Resolved tracepoint is installed.
+ set test "tracepoint on pendfunc2 installed"
+ gdb_expect {
+ -re "=breakpoint-modified,bkpt=\{number=\"1\",type=\"tracepoint\".*.*times=\"0\".*installed=\"y\"" {
+ pass "$test"
}
}
+
mi_expect_stop "breakpoint-hit" "marker" ".*" ".*" ".*" \
{"" "disp=\"keep\""} "continue to marker"
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"4.1a: set three tracepoints, passcounts all zero"
gdb_test "passcount 2 $trcpt1" \
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 2 .*
+\[\t \]+pass count 2 .
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"4.1c: verify 1st tracepoint's passcount set to two"
gdb_test "passcount 4 $trcpt2" \
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 2 .*
+\[\t \]+pass count 2 .
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+\[\t \]+pass count 4 .
+\[\t \]+not installed on target.
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"4.1c: verify 2nd tracepoint's passcount set to four"
# 4.2 passcount of last (default) tracepoint
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*
+\[\t \]+pass count 4 .
+\[\t \]+not installed on target.
\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+pass count 4 .*" \
+\[\t \]+pass count 4 .
+\[\t \]+not installed on target." \
"4.6: set passcount to zero"
# 4.7 (test a very large passcount)
gdb_test "trace $srcfile:$testline2" \
"Tracepoint $decimal at $hex: file.*$srcfile, line $testline2." \
"1.1a: set tracepoint at sourceline"
-gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2" \
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2.
+\[\t \]+not installed on target." \
"1.1b: trace sourcefile:line"
# 1.2 trace invalid source line
gdb_test "trace gdb_recursion_test" \
"Tracepoint $decimal at $hex: file.*$srcfile, line $testline1." \
"1.4a: trace function by name"
-gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1" \
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1.
+\[\t \]+not installed on target." \
"1.4b: trace function by name"
# 1.5 trace non-existant function
gdb_test "trace \*gdb_recursion_test" \
"Tracepoint $decimal at .*$c_test_addr.*" \
"1.7a: trace at function label (before prologue)"
-gdb_test "info trace" "$c_test_addr.*in gdb_recursion_test.*:$baseline" \
+gdb_test "info trace" "$c_test_addr.*in gdb_recursion_test.*:$baseline.
+\[\t \]+not installed on target." \
"1.7b: verify trace at specific address"
# 1.8 trace at invalid address
gdb_test "trace gdb_recursion_test if q1 > 0" \
"Tracepoint $decimal at $hex: file.*$srcfile, line $testline1." \
"1.11a: conditional tracepoint"
-gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1.*trace only if q1 > 0" \
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1.
+\[\t \]+trace only if q1 > 0.
+\[\t \]+not installed on target." \
"1.11b: verify conditional tracepoint"
# 1.12 set tracepoint in prologue
gdb_test "info tracepoints" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
+\[\t \]+not installed on target." \
"5.12: set a tracepoint, stepcount is zero"
set stepcount 12
{
struct tracepoint *t = (struct tracepoint *) b;
struct bp_location *loc;
+ int bp_location_downloaded = 0;
/* Clear `inserted' flag. */
for (loc = b->loc; loc; loc = loc->next)
target_download_tracepoint (loc);
loc->inserted = 1;
+ bp_location_downloaded = 1;
}
t->number_on_target = b->number;
for (loc = b->loc; loc; loc = loc->next)
if (loc->probe != NULL)
loc->probe->pops->set_semaphore (loc->probe, loc->gdbarch);
+
+ if (bp_location_downloaded)
+ observer_notify_breakpoint_modified (b);
}
VEC_free (breakpoint_p, tp_vec);
merge_uploaded_tracepoints (struct uploaded_tp **uploaded_tps)
{
struct uploaded_tp *utp;
+ /* A set of tracepoints which are modified. */
+ VEC(breakpoint_p) *modified_tp = NULL;
+ int ix;
+ struct breakpoint *b;
/* Look for GDB tracepoints that match up with our uploaded versions. */
for (utp = *uploaded_tps; utp; utp = utp->next)
loc = find_matching_tracepoint_location (utp);
if (loc)
{
+ int found = 0;
+
/* Mark this location as already inserted. */
loc->inserted = 1;
t = (struct tracepoint *) loc->owner;
"as target's tracepoint %d at %s.\n"),
loc->owner->number, utp->number,
paddress (loc->gdbarch, utp->addr));
+
+ /* The tracepoint LOC->owner was modified (the location LOC
+ was marked as inserted in the target). Save it in
+ MODIFIED_TP if not there yet. The 'breakpoint-modified'
+ observers will be notified later once for each tracepoint
+ saved in MODIFIED_TP. */
+ for (ix = 0;
+ VEC_iterate (breakpoint_p, modified_tp, ix, b);
+ ix++)
+ if (b == loc->owner)
+ {
+ found = 1;
+ break;
+ }
+ if (!found)
+ VEC_safe_push (breakpoint_p, modified_tp, loc->owner);
}
else
{
t->number_on_target = utp->number;
}
+ /* Notify 'breakpoint-modified' observer that at least one of B's
+ locations was changed. */
+ for (ix = 0; VEC_iterate (breakpoint_p, modified_tp, ix, b); ix++)
+ observer_notify_breakpoint_modified (b);
+
+ VEC_free (breakpoint_p, modified_tp);
free_uploaded_tps (uploaded_tps);
}