* [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB
@ 2013-03-02 16:09 Hui Zhu
2013-03-02 16:11 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Hui Zhu
` (2 more replies)
0 siblings, 3 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-02 16:09 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves
[-- Attachment #1: Type: text/plain, Size: 1901 bytes --]
Hello,
According to the mail thread in http://sourceware-org.1504.n7.nabble.com/PATCH-Support-targets-that-know-how-to-step-over-breakpoints-td61666.html
I update patches to change step to continue. When thread hop needed, GDB can use continue over breakpoints let the inferior keep going.
The interface that add to target is:
to_can_continue_over_breakpoints, it will return true if target can continue over breakpoints.
to_next_continue_over_breakpoints, call this function before call to_resume will make to_resume do continue_over_breakpoints instead of continue.
This patch is the GDB part that support continue over breakpoints. And there also have patches for doc, server and test. I will introduce them clear inside the mails of that paches.
Please help me review it.
Thanks,
Hui
2013-03-03 Luis Machado <lgustavo@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
Hui Zhu <hui_zhu@mentor.com>
* infrun.c (handle_inferior_event): Check if target can continue
over breakpoints.
* remote.c (struct remote_state): New member
can_continue_over_breakpoints.
(remote_continue_over_breakpoints_feature): New.
(remote_protocol_features): Add ContinueOverBreakpoints feature.
(remote_open_1): Clear can_continue_over_breakpoints.
(remote_is_cob): New.
(append_resumption, remote_resume): Check remote_is_cob.
(remote_can_continue_over_breakpoints,
remote_next_continue_over_breakpoints): New.
(init_remote_ops): Set remote_ops.to_can_continue_over_breakpoints
to remote_can_continue_over_breakpoints.
Set to_next_continue_over_breakpoints to
remote_next_continue_over_breakpoints.
* target.c (update_current_target): Inherit
to_can_continue_over_breakpoints, and default it to return 0.
Inherit to_next_continue_over_breakpoints.
* target.h (struct target_ops): Add new
to_can_step_over_breakpoints member.
(target_can_step_over_breakpoints): New.
[-- Attachment #2: remote-cob.txt --]
[-- Type: text/plain, Size: 8779 bytes --]
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1781,8 +1781,9 @@ how to step past a permanent breakpoint
a command like `return' or `jump' to continue execution."));
}
- /* If enabled, step over breakpoints by executing a copy of the
- instruction at a different address.
+ /* If enabled and this target doesn't continue over breakpoints,
+ step over breakpoints by executing a copy of the instruction
+ at a different address.
We can't use displaced stepping when we have a signal to deliver;
the comments for displaced_step_prepare explain why. The
@@ -1792,7 +1793,8 @@ a command like `return' or `jump' to con
We can't use displaced stepping when we are waiting for vfork_done
event, displaced stepping breaks the vfork child similarly as single
step software breakpoint. */
- if (use_displaced_stepping (gdbarch)
+ if (!target_can_continue_over_breakpoints ()
+ && use_displaced_stepping (gdbarch)
&& (tp->control.trap_expected
|| (step && gdbarch_software_single_step_p (gdbarch)))
&& sig == GDB_SIGNAL_0
@@ -3940,10 +3942,11 @@ handle_inferior_event (struct execution_
singlestep_breakpoints_inserted_p = 0;
}
- /* If the arch can displace step, don't remove the
- breakpoints. */
+ /* If the target can continue over breakpoints transparently,
+ or the arch can displace step, don't remove the breakpoints. */
thread_regcache = get_thread_regcache (ecs->ptid);
- if (!use_displaced_stepping (get_regcache_arch (thread_regcache)))
+ if (!use_displaced_stepping (get_regcache_arch (thread_regcache))
+ && !target_can_continue_over_breakpoints())
remove_status = remove_breakpoints ();
/* Did we fail to remove breakpoints? If so, try
@@ -3957,15 +3960,26 @@ handle_inferior_event (struct execution_
error (_("Cannot step over breakpoint hit in wrong thread"));
else
{ /* Single step */
- if (!non_stop)
+ if (!non_stop && !target_can_continue_over_breakpoints ())
{
/* Only need to require the next event from this
- thread in all-stop mode. */
+ thread in all-stop mode.
+ Continue over breakpoints doesn't need wait a special
+ thread, so doesn't set it. */
waiton_ptid = ecs->ptid;
infwait_state = infwait_thread_hop_state;
}
- ecs->event_thread->stepping_over_breakpoint = 1;
+ if (target_can_continue_over_breakpoints ())
+ {
+ target_next_continue_over_breakpoints();
+ if (debug_infrun)
+ fprintf_unfiltered (gdb_stdlog,
+ "infrun: continue over breakpoints\n");
+ }
+ else
+ ecs->event_thread->stepping_over_breakpoint = 1;
+
keep_going (ecs);
return;
}
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -311,6 +311,10 @@ struct remote_state
/* True if the stub reports support for vCont;t. */
int support_vCont_t;
+ /* True if the stub reports support for continue over breakpoints
+ transparently. */
+ int can_continue_over_breakpoints;
+
/* True if the stub reports support for conditional tracepoints. */
int cond_tracepoints;
@@ -3928,6 +3932,15 @@ remote_string_tracing_feature (const str
rs->string_tracing = (support == PACKET_ENABLE);
}
+static void
+remote_continue_over_breakpoints_feature (const struct protocol_feature *feature,
+ enum packet_support support,
+ const char *value)
+{
+ struct remote_state *rs = get_remote_state ();
+ rs->can_continue_over_breakpoints = (support == PACKET_ENABLE);
+}
+
static struct protocol_feature remote_protocol_features[] = {
{ "PacketSize", PACKET_DISABLE, remote_packet_size, -1 },
{ "qXfer:auxv:read", PACKET_DISABLE, remote_supported_packet,
@@ -3958,6 +3971,8 @@ static struct protocol_feature remote_pr
PACKET_QStartNoAckMode },
{ "multiprocess", PACKET_DISABLE, remote_multi_process_feature, -1 },
{ "QNonStop", PACKET_DISABLE, remote_non_stop_feature, -1 },
+ { "ContinueOverBreakpoints", PACKET_DISABLE,
+ remote_continue_over_breakpoints_feature, -1 },
{ "qXfer:siginfo:read", PACKET_DISABLE, remote_supported_packet,
PACKET_qXfer_siginfo_read },
{ "qXfer:siginfo:write", PACKET_DISABLE, remote_supported_packet,
@@ -4283,6 +4298,7 @@ remote_open_1 (char *name, int from_tty,
rs->extended = extended_p;
rs->non_stop_aware = 0;
rs->waiting_for_stop_reply = 0;
+ rs->can_continue_over_breakpoints = 0;
rs->ctrlc_pending_p = 0;
general_thread = not_sent_ptid;
@@ -4673,6 +4689,8 @@ remote_vcont_probe (struct remote_state
the thread to be stepped and/or signalled is given in the global
INFERIOR_PTID. */
+static int remote_is_cob = 0;
+
static char *
append_resumption (char *p, char *endp,
ptid_t ptid, int step, enum gdb_signal siggnal)
@@ -4685,6 +4703,8 @@ append_resumption (char *p, char *endp,
p += xsnprintf (p, endp - p, ";s");
else if (siggnal != GDB_SIGNAL_0)
p += xsnprintf (p, endp - p, ";C%02x", siggnal);
+ else if (remote_is_cob)
+ p += xsnprintf (p, endp - p, ";cob");
else
p += xsnprintf (p, endp - p, ";c");
@@ -4878,6 +4898,7 @@ remote_resume (struct target_ops *ops,
putpkt (buf);
done:
+ remote_is_cob = 0;
/* We are about to start executing the inferior, let's register it
with the event loop. NOTE: this is the one place where all the
execution commands end up. We could alternatively do this in each
@@ -11115,6 +11136,21 @@ remote_can_use_agent (void)
return (remote_protocol_packets[PACKET_QAgent].support != PACKET_DISABLE);
}
+static int
+remote_can_continue_over_breakpoints (void)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ return rs->can_continue_over_breakpoints;
+}
+
+static void
+remote_next_continue_over_breakpoints (void)
+{
+ make_cleanup_restore_integer (&remote_is_cob);
+ remote_is_cob = 1;
+}
+
static void
init_remote_ops (void)
{
@@ -11133,6 +11169,10 @@ Specify the serial device it is connecte
remote_ops.to_fetch_registers = remote_fetch_registers;
remote_ops.to_store_registers = remote_store_registers;
remote_ops.to_prepare_to_store = remote_prepare_to_store;
+ remote_ops.to_can_continue_over_breakpoints =
+ remote_can_continue_over_breakpoints;
+ remote_ops.to_next_continue_over_breakpoints =
+ remote_next_continue_over_breakpoints;
remote_ops.deprecated_xfer_memory = remote_xfer_memory;
remote_ops.to_files_info = remote_files_info;
remote_ops.to_insert_breakpoint = remote_insert_breakpoint;
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -596,6 +596,8 @@ update_current_target (void)
/* Do not inherit to_fetch_registers. */
/* Do not inherit to_store_registers. */
INHERIT (to_prepare_to_store, t);
+ INHERIT (to_can_continue_over_breakpoints, t);
+ INHERIT (to_next_continue_over_breakpoints, t);
INHERIT (deprecated_xfer_memory, t);
INHERIT (to_files_info, t);
INHERIT (to_insert_breakpoint, t);
@@ -730,6 +732,12 @@ update_current_target (void)
de_fault (to_prepare_to_store,
(void (*) (struct regcache *))
noprocess);
+ de_fault (to_can_continue_over_breakpoints,
+ (int (*) (void))
+ return_zero);
+ de_fault (to_next_continue_over_breakpoints,
+ (void (*) (void))
+ target_ignore);
de_fault (deprecated_xfer_memory,
(int (*) (CORE_ADDR, gdb_byte *, int, int,
struct mem_attrib *, struct target_ops *))
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -430,6 +430,15 @@ struct target_ops
void (*to_store_registers) (struct target_ops *, struct regcache *, int);
void (*to_prepare_to_store) (struct regcache *);
+ /* Return true if GDB does not need to lift breakpoints from the
+ the inferior while continue over a breakpoint; the target
+ handles that transparently. */
+ int (*to_can_continue_over_breakpoints) (void);
+
+ /* After call this function, the continue will be changed to
+ continue over breakpoints. */
+ void (*to_next_continue_over_breakpoints) (void);
+
/* Transfer LEN bytes of memory between GDB address MYADDR and
target address MEMADDR. If WRITE, transfer them to the target, else
transfer them from the target. TARGET is the target from which we
@@ -972,6 +981,12 @@ extern void target_store_registers (stru
#define target_prepare_to_store(regcache) \
(*current_target.to_prepare_to_store) (regcache)
+#define target_can_continue_over_breakpoints() \
+ (*current_target.to_can_continue_over_breakpoints) ()
+
+#define target_next_continue_over_breakpoints() \
+ (*current_target.to_next_continue_over_breakpoints) ()
+
/* Determine current address space of thread PTID. */
struct address_space *target_thread_address_space (ptid_t);
^ permalink raw reply [flat|nested] 24+ messages in thread* [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc
2013-03-02 16:09 [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB Hui Zhu
@ 2013-03-02 16:11 ` Hui Zhu
2013-03-02 16:13 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Hui Zhu
` (2 more replies)
2013-03-12 10:04 ` [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB Hui Zhu
2013-03-24 12:33 ` Hui Zhu
2 siblings, 3 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-02 16:11 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves, Eli Zaretskii
[-- Attachment #1: Type: text/plain, Size: 337 bytes --]
Hello,
This is the doc patch for continue over breakpoints function.
Please help me review it.
Thanks,
Hui
2013-03-03 Luis Machado <lgustavo@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
Hui Zhu <hui_zhu@mentor.com>
* gdb.texinfo (General Query Packets): Document
ContinueOverBreakpoints under qSupported.
[-- Attachment #2: remote-cob-doc.txt --]
[-- Type: text/plain, Size: 1047 bytes --]
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -37383,6 +37383,11 @@ These are the currently defined stub fea
@tab @samp{-}
@tab No
+@item @samp{ContinueOverBreakpoints}
+@tab No
+@tab @samp{-}
+@tab No
+
@end multitable
These are the currently defined stub features, in more detail:
@@ -37537,6 +37542,15 @@ See @ref{Bytecode Descriptions} for deta
The remote stub supports running a breakpoint's command list itself,
rather than reporting the hit to @value{GDBN}.
+@item ContinueOverBreakpoints
+The remote stub knows how to continue over breakpoints itself. If this
+feature is supported by the target, then @value{GDBN} does not need to
+lift breakpoints off of the inferior and step over them. This feature
+only applies to continue requests. This feature is only defined when the
+remote stub supports managing breakpoints itself (see @ref{insert
+breakpoint or watchpoint packet}). @value{GDBN} assumes that this feature
+is applicable to all breakpoints types supported by the stub.
+
@end table
@item qSymbol::
^ permalink raw reply [flat|nested] 24+ messages in thread* [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver
2013-03-02 16:11 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Hui Zhu
@ 2013-03-02 16:13 ` Hui Zhu
2013-03-02 16:14 ` [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite Hui Zhu
` (2 more replies)
2013-03-02 16:19 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Eli Zaretskii
2013-03-12 10:04 ` Hui Zhu
2 siblings, 3 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-02 16:13 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves
[-- Attachment #1: Type: text/plain, Size: 732 bytes --]
Hello,
This patch add a new option "--cob" to gdbserver. When gdbserver called with this option, it will open support of continue over breakpoints.
Then we can use testsuite test the function of continue over breakpoints.
To support this function, I add new function step_over_breakpoints to let the thread that is stop by breakpoints before continue all theads. It is not very fast. But I think for test is OK. Please give me more comments about it.
Thanks,
Hui
2013-03-03 Hui Zhu <hui_zhu@mentor.com>
* server.c (use_cob): New.
(handle_query): Check use_cob.
(step_over_breakpoints): New.
(handle_v_cont): Check use_cob. If need, handle continue over
breakpoints.
(gdbserver_usage): Add "--cob".
(main): Ditto.
[-- Attachment #2: remote-cob-server.txt --]
[-- Type: text/plain, Size: 3307 bytes --]
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -53,6 +53,8 @@ static int exit_requested;
/* --once: Exit after the first connection has closed. */
int run_once;
+int use_cob = 0;
+
int multi_process;
int non_stop;
@@ -1619,6 +1621,9 @@ handle_query (char *own_buf, int packet_
if (target_supports_non_stop ())
strcat (own_buf, ";QNonStop+");
+ if (use_cob)
+ strcat (own_buf, ";ContinueOverBreakpoints+");
+
if (target_supports_disable_randomization ())
strcat (own_buf, ";QDisableRandomization+");
@@ -1842,6 +1847,36 @@ handle_query (char *own_buf, int packet_
own_buf[0] = 0;
}
+static void
+step_over_breakpoints (void)
+{
+ CORE_ADDR pc;
+ struct thread_resume resume_info[2];
+ int valid_cont_thread;
+ struct target_waitstatus status;
+
+ set_desired_inferior (1);
+ pc = regcache_read_pc (get_thread_regcache (current_inferior, 1));
+ (*the_target->remove_point) ('0', pc, 1);
+
+ set_desired_inferior (0);
+ valid_cont_thread = (!ptid_equal (cont_thread, null_ptid)
+ && !ptid_equal (cont_thread, minus_one_ptid));
+ resume_info[0].thread = current_ptid;
+ resume_info[0].kind = resume_step;
+ resume_info[0].sig = 0;
+ if (!valid_cont_thread)
+ {
+ resume_info[1].thread = minus_one_ptid;
+ resume_info[1].kind = resume_continue;
+ resume_info[1].sig = 0;
+ }
+ (*the_target->resume) (resume_info, 2);
+ mywait (minus_one_ptid, &status, 0, 1);
+
+ (*the_target->insert_point) ('0', pc, 1);
+}
+
static void gdb_wants_all_threads_stopped (void);
/* Parse vCont packets. */
@@ -1852,6 +1887,7 @@ handle_v_cont (char *own_buf)
int n = 0, i = 0;
struct thread_resume *resume_info;
struct thread_resume default_action = {{0}};
+ int is_cob = 0;
/* Count the number of semicolons in the packet. There should be one
for every action. */
@@ -1875,7 +1911,14 @@ handle_v_cont (char *own_buf)
if (p[0] == 's' || p[0] == 'S')
resume_info[i].kind = resume_step;
else if (p[0] == 'c' || p[0] == 'C')
- resume_info[i].kind = resume_continue;
+ {
+ if (use_cob && strcmp (p, "cob") == 0)
+ {
+ is_cob = 1;
+ p += 2;
+ }
+ resume_info[i].kind = resume_continue;
+ }
else if (p[0] == 't')
resume_info[i].kind = resume_stop;
else
@@ -1939,6 +1982,9 @@ handle_v_cont (char *own_buf)
cont_thread = minus_one_ptid;
set_desired_inferior (0);
+ if (is_cob)
+ step_over_breakpoints ();
+
if (!non_stop)
enable_async_io ();
@@ -2404,7 +2450,8 @@ gdbserver_usage (FILE *stream)
" --version Display version information and exit.\n"
" --wrapper WRAPPER -- Run WRAPPER to start new programs.\n"
" --once Exit after the first connection has "
- "closed.\n");
+ "closed.\n"
+ " --cob Support continue over breakpoints.\n");
if (REPORT_BUGS_TO[0] && stream == stdout)
fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
}
@@ -2630,6 +2677,8 @@ main (int argc, char *argv[])
disable_randomization = 0;
else if (strcmp (*next_arg, "--once") == 0)
run_once = 1;
+ else if (strcmp (*next_arg, "--cob") == 0)
+ use_cob = 1;
else
{
fprintf (stderr, "Unknown argument: %s\n", *next_arg);
^ permalink raw reply [flat|nested] 24+ messages in thread* [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite
2013-03-02 16:13 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Hui Zhu
@ 2013-03-02 16:14 ` Hui Zhu
2013-03-03 2:18 ` Hui Zhu
2013-03-12 10:05 ` Hui Zhu
2013-03-02 16:20 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Eli Zaretskii
2013-03-12 10:05 ` Hui Zhu
2 siblings, 2 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-02 16:14 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves
[-- Attachment #1: Type: text/plain, Size: 389 bytes --]
Hello,
This patch add a new test cob.exp use the "--cob" that add by prev patch test the continue over breakpoints function of GDB.
Thanks,
Hui
2013-03-03 Hui Zhu <hui_zhu@mentor.com>
* gdb.server/Makefile.in (EXECUTABLES): Add cob.
* gdb.server/cob.c: New file.
* gdb.server/cob.exp: New file.
* lib/gdbserver-support.exp (gdbserver_start): Add check for
gdbserver_use_cob_p.
[-- Attachment #2: remote-cob-test.txt --]
[-- Type: text/plain, Size: 3884 bytes --]
--- a/gdb/testsuite/gdb.server/Makefile.in
+++ b/gdb/testsuite/gdb.server/Makefile.in
@@ -1,7 +1,7 @@
VPATH = @srcdir@
srcdir = @srcdir@
-EXECUTABLES = ext-attach ext-run file-transfer server-mon server-run \
+EXECUTABLES = cob ext-attach ext-run file-transfer server-mon server-run \
no-thread-db
MISCELLANEOUS =
--- /dev/null
+++ b/gdb/testsuite/gdb.server/cob.c
@@ -0,0 +1,54 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2013 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 <pthread.h>
+
+void
+foo (void)
+{
+}
+
+void
+bar (void)
+{
+}
+
+void *
+thread_function (void *arg)
+{
+ sleep (2);
+ foo ();
+
+ return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ pthread_t thread;
+ int i;
+
+ pthread_create (&thread, NULL, thread_function, NULL);
+ bar ();
+
+ for (i = 0; i < 10; i++)
+ foo ();
+
+ pthread_join (thread, NULL);
+
+ return 0;
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.server/cob.exp
@@ -0,0 +1,56 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2013 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/>.
+
+# Test the basic functionality of gdbserver.
+
+load_lib gdbserver-support.exp
+
+standard_testfile .c
+
+if { [skip_gdbserver_tests] } {
+ return 0
+}
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" \
+ "${binfile}" executable {debug}] == -1} {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_load $binfile
+
+# Make sure we're disconnected, in case we're testing with an
+# extended-remote board, therefore already connected.
+gdb_test "disconnect" ".*"
+
+set gdbserver_use_cob_p 1
+gdbserver_run ""
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_breakpoint bar
+gdb_test "continue" "Breakpoint.* bar .*" "continue to bar"
+
+gdb_test "info threads" ".*2 *Thread.*\\* 1 *Thread.*" "info threads before set thread breakpoint, current thread is 1"
+
+gdb_test_no_output "set debug infrun 1"
+
+gdb_breakpoint "foo thread 2"
+gdb_test "continue" ".*infrun: thread_hop_needed.*infrun: continue over breakpoints.*Breakpoint.* foo .*" "continue to foo"
+
+gdb_test "info threads" ".*\\* 2 *Thread.*1 *Thread.*" "info threads after continue over breakpoint, current thread is 2"
+
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -247,6 +247,11 @@ proc gdbserver_start { options arguments
append gdbserver_command " --once"
}
+ global gdbserver_use_cob_p
+ if {[info exists gdbserver_use_cob_p] && $gdbserver_use_cob_p} {
+ append gdbserver_command " --cob"
+ }
+
if { $options != "" } {
append gdbserver_command " $options"
}
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite
2013-03-02 16:14 ` [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite Hui Zhu
@ 2013-03-03 2:18 ` Hui Zhu
2013-03-24 14:45 ` Hui Zhu
2013-03-12 10:05 ` Hui Zhu
1 sibling, 1 reply; 24+ messages in thread
From: Hui Zhu @ 2013-03-03 2:18 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves
[-- Attachment #1: Type: text/plain, Size: 838 bytes --]
On 03/03/13 00:14, Hui Zhu wrote:
> Hello,
>
> This patch add a new test cob.exp use the "--cob" that add by prev patch test the continue over breakpoints function of GDB.
>
> Thanks,
> Hui
>
> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>
> * gdb.server/Makefile.in (EXECUTABLES): Add cob.
> * gdb.server/cob.c: New file.
> * gdb.server/cob.exp: New file.
> * lib/gdbserver-support.exp (gdbserver_start): Add check for
> gdbserver_use_cob_p.
Because the option "--cob" is changed to "--continue-over-breakpoints". So I post a new version for that change.
Thanks,
Hui
2013-03-03 Hui Zhu <hui_zhu@mentor.com>
* gdb.server/Makefile.in (EXECUTABLES): Add cob.
* gdb.server/cob.c: New file.
* gdb.server/cob.exp: New file.
* lib/gdbserver-support.exp (gdbserver_start): Add check for
gdbserver_use_cob_p.
[-- Attachment #2: remote-cob-test.txt --]
[-- Type: text/plain, Size: 3906 bytes --]
--- a/gdb/testsuite/gdb.server/Makefile.in
+++ b/gdb/testsuite/gdb.server/Makefile.in
@@ -1,7 +1,7 @@
VPATH = @srcdir@
srcdir = @srcdir@
-EXECUTABLES = ext-attach ext-run file-transfer server-mon server-run \
+EXECUTABLES = cob ext-attach ext-run file-transfer server-mon server-run \
no-thread-db
MISCELLANEOUS =
--- /dev/null
+++ b/gdb/testsuite/gdb.server/cob.c
@@ -0,0 +1,54 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2013 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 <pthread.h>
+
+void
+foo (void)
+{
+}
+
+void
+bar (void)
+{
+}
+
+void *
+thread_function (void *arg)
+{
+ sleep (2);
+ foo ();
+
+ return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ pthread_t thread;
+ int i;
+
+ pthread_create (&thread, NULL, thread_function, NULL);
+ bar ();
+
+ for (i = 0; i < 10; i++)
+ foo ();
+
+ pthread_join (thread, NULL);
+
+ return 0;
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.server/cob.exp
@@ -0,0 +1,56 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2013 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/>.
+
+# Test the basic functionality of gdbserver.
+
+load_lib gdbserver-support.exp
+
+standard_testfile .c
+
+if { [skip_gdbserver_tests] } {
+ return 0
+}
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" \
+ "${binfile}" executable {debug}] == -1} {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_load $binfile
+
+# Make sure we're disconnected, in case we're testing with an
+# extended-remote board, therefore already connected.
+gdb_test "disconnect" ".*"
+
+set gdbserver_use_cob_p 1
+gdbserver_run ""
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_breakpoint bar
+gdb_test "continue" "Breakpoint.* bar .*" "continue to bar"
+
+gdb_test "info threads" ".*2 *Thread.*\\* 1 *Thread.*" "info threads before set thread breakpoint, current thread is 1"
+
+gdb_test_no_output "set debug infrun 1"
+
+gdb_breakpoint "foo thread 2"
+gdb_test "continue" ".*infrun: thread_hop_needed.*infrun: continue over breakpoints.*Breakpoint.* foo .*" "continue to foo"
+
+gdb_test "info threads" ".*\\* 2 *Thread.*1 *Thread.*" "info threads after continue over breakpoint, current thread is 2"
+
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -247,6 +247,11 @@ proc gdbserver_start { options arguments
append gdbserver_command " --once"
}
+ global gdbserver_use_cob_p
+ if {[info exists gdbserver_use_cob_p] && $gdbserver_use_cob_p} {
+ append gdbserver_command " --continue-over-breakpoints"
+ }
+
if { $options != "" } {
append gdbserver_command " $options"
}
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite
2013-03-03 2:18 ` Hui Zhu
@ 2013-03-24 14:45 ` Hui Zhu
2013-05-07 2:46 ` Hui Zhu
0 siblings, 1 reply; 24+ messages in thread
From: Hui Zhu @ 2013-03-24 14:45 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, lgustavo, Pedro Alves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00057.html
Thanks,
Hui
On Sun, Mar 3, 2013 at 10:18 AM, Hui Zhu <hui_zhu@mentor.com> wrote:
> On 03/03/13 00:14, Hui Zhu wrote:
>>
>> Hello,
>>
>> This patch add a new test cob.exp use the "--cob" that add by prev patch
>> test the continue over breakpoints function of GDB.
>>
>> Thanks,
>> Hui
>>
>> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>>
>> * gdb.server/Makefile.in (EXECUTABLES): Add cob.
>> * gdb.server/cob.c: New file.
>> * gdb.server/cob.exp: New file.
>> * lib/gdbserver-support.exp (gdbserver_start): Add check for
>> gdbserver_use_cob_p.
>
>
> Because the option "--cob" is changed to "--continue-over-breakpoints". So
> I post a new version for that change.
>
>
> Thanks,
> Hui
>
> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>
> * gdb.server/Makefile.in (EXECUTABLES): Add cob.
> * gdb.server/cob.c: New file.
> * gdb.server/cob.exp: New file.
> * lib/gdbserver-support.exp (gdbserver_start): Add check for
> gdbserver_use_cob_p.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite
2013-03-24 14:45 ` Hui Zhu
@ 2013-05-07 2:46 ` Hui Zhu
0 siblings, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-05-07 2:46 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, lgustavo, Pedro Alves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00066.html
Thanks,
Hui
On Sun, Mar 24, 2013 at 1:36 PM, Hui Zhu <teawater@gmail.com> wrote:
> Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00057.html
>
> Thanks,
> Hui
>
> On Sun, Mar 3, 2013 at 10:18 AM, Hui Zhu <hui_zhu@mentor.com> wrote:
>> On 03/03/13 00:14, Hui Zhu wrote:
>>>
>>> Hello,
>>>
>>> This patch add a new test cob.exp use the "--cob" that add by prev patch
>>> test the continue over breakpoints function of GDB.
>>>
>>> Thanks,
>>> Hui
>>>
>>> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>>>
>>> * gdb.server/Makefile.in (EXECUTABLES): Add cob.
>>> * gdb.server/cob.c: New file.
>>> * gdb.server/cob.exp: New file.
>>> * lib/gdbserver-support.exp (gdbserver_start): Add check for
>>> gdbserver_use_cob_p.
>>
>>
>> Because the option "--cob" is changed to "--continue-over-breakpoints". So
>> I post a new version for that change.
>>
>>
>> Thanks,
>> Hui
>>
>> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>>
>> * gdb.server/Makefile.in (EXECUTABLES): Add cob.
>> * gdb.server/cob.c: New file.
>> * gdb.server/cob.exp: New file.
>> * lib/gdbserver-support.exp (gdbserver_start): Add check for
>> gdbserver_use_cob_p.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite
2013-03-02 16:14 ` [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite Hui Zhu
2013-03-03 2:18 ` Hui Zhu
@ 2013-03-12 10:05 ` Hui Zhu
1 sibling, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-12 10:05 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00057.html
Thanks,
Hui
On 03/03/13 00:14, Hui Zhu wrote:
> Hello,
>
> This patch add a new test cob.exp use the "--cob" that add by prev patch test the continue over breakpoints function of GDB.
>
> Thanks,
> Hui
>
> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>
> * gdb.server/Makefile.in (EXECUTABLES): Add cob.
> * gdb.server/cob.c: New file.
> * gdb.server/cob.exp: New file.
> * lib/gdbserver-support.exp (gdbserver_start): Add check for
> gdbserver_use_cob_p.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver
2013-03-02 16:13 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Hui Zhu
2013-03-02 16:14 ` [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite Hui Zhu
@ 2013-03-02 16:20 ` Eli Zaretskii
2013-03-03 2:15 ` Hui Zhu
2013-03-12 10:05 ` Hui Zhu
2 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2013-03-02 16:20 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, lgustavo, palves
> Date: Sun, 3 Mar 2013 00:13:09 +0800
> From: Hui Zhu <hui_zhu@mentor.com>
> CC: <lgustavo@codesourcery.com>, Pedro Alves <palves@redhat.com>
>
> This patch add a new option "--cob" to gdbserver. When gdbserver called with this option, it will open support of continue over breakpoints.
Can we have something less cryptic, like "--continue-over-breakpoints",
please?
Thanks.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver
2013-03-02 16:20 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Eli Zaretskii
@ 2013-03-03 2:15 ` Hui Zhu
2013-03-24 14:10 ` Hui Zhu
0 siblings, 1 reply; 24+ messages in thread
From: Hui Zhu @ 2013-03-03 2:15 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches, lgustavo, palves
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]
On 03/03/13 00:20, Eli Zaretskii wrote:
>> Date: Sun, 3 Mar 2013 00:13:09 +0800
>> From: Hui Zhu <hui_zhu@mentor.com>
>> CC: <lgustavo@codesourcery.com>, Pedro Alves <palves@redhat.com>
>>
>> This patch add a new option "--cob" to gdbserver. When gdbserver called with this option, it will open support of continue over breakpoints.
>
> Can we have something less cryptic, like "--continue-over-breakpoints",
> please?
>
> Thanks.
>
OK. Update this option to "--continue-over-breakpoints".
Post a new version for that.
Thanks,
Hui
2013-03-03 Hui Zhu <hui_zhu@mentor.com>
* server.c (use_cob): New.
(handle_query): Check use_cob.
(step_over_breakpoints): New.
(handle_v_cont): Check use_cob. If need, handle continue over
breakpoints.
(gdbserver_usage): Add "--continue-over-breakpoints".
(main): Ditto.
[-- Attachment #2: remote-cob-server.txt --]
[-- Type: text/plain, Size: 3335 bytes --]
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -53,6 +53,8 @@ static int exit_requested;
/* --once: Exit after the first connection has closed. */
int run_once;
+int use_cob = 0;
+
int multi_process;
int non_stop;
@@ -1619,6 +1621,9 @@ handle_query (char *own_buf, int packet_
if (target_supports_non_stop ())
strcat (own_buf, ";QNonStop+");
+ if (use_cob)
+ strcat (own_buf, ";ContinueOverBreakpoints+");
+
if (target_supports_disable_randomization ())
strcat (own_buf, ";QDisableRandomization+");
@@ -1842,6 +1847,36 @@ handle_query (char *own_buf, int packet_
own_buf[0] = 0;
}
+static void
+step_over_breakpoints (void)
+{
+ CORE_ADDR pc;
+ struct thread_resume resume_info[2];
+ int valid_cont_thread;
+ struct target_waitstatus status;
+
+ set_desired_inferior (1);
+ pc = regcache_read_pc (get_thread_regcache (current_inferior, 1));
+ (*the_target->remove_point) ('0', pc, 1);
+
+ set_desired_inferior (0);
+ valid_cont_thread = (!ptid_equal (cont_thread, null_ptid)
+ && !ptid_equal (cont_thread, minus_one_ptid));
+ resume_info[0].thread = current_ptid;
+ resume_info[0].kind = resume_step;
+ resume_info[0].sig = 0;
+ if (!valid_cont_thread)
+ {
+ resume_info[1].thread = minus_one_ptid;
+ resume_info[1].kind = resume_continue;
+ resume_info[1].sig = 0;
+ }
+ (*the_target->resume) (resume_info, 2);
+ mywait (minus_one_ptid, &status, 0, 1);
+
+ (*the_target->insert_point) ('0', pc, 1);
+}
+
static void gdb_wants_all_threads_stopped (void);
/* Parse vCont packets. */
@@ -1852,6 +1887,7 @@ handle_v_cont (char *own_buf)
int n = 0, i = 0;
struct thread_resume *resume_info;
struct thread_resume default_action = {{0}};
+ int is_cob = 0;
/* Count the number of semicolons in the packet. There should be one
for every action. */
@@ -1875,7 +1911,14 @@ handle_v_cont (char *own_buf)
if (p[0] == 's' || p[0] == 'S')
resume_info[i].kind = resume_step;
else if (p[0] == 'c' || p[0] == 'C')
- resume_info[i].kind = resume_continue;
+ {
+ if (use_cob && strcmp (p, "cob") == 0)
+ {
+ is_cob = 1;
+ p += 2;
+ }
+ resume_info[i].kind = resume_continue;
+ }
else if (p[0] == 't')
resume_info[i].kind = resume_stop;
else
@@ -1939,6 +1982,9 @@ handle_v_cont (char *own_buf)
cont_thread = minus_one_ptid;
set_desired_inferior (0);
+ if (is_cob)
+ step_over_breakpoints ();
+
if (!non_stop)
enable_async_io ();
@@ -2404,7 +2450,8 @@ gdbserver_usage (FILE *stream)
" --version Display version information and exit.\n"
" --wrapper WRAPPER -- Run WRAPPER to start new programs.\n"
" --once Exit after the first connection has "
- "closed.\n");
+ "closed.\n"
+ " --continue-over-breakpoints Support continue over breakpoints.\n");
if (REPORT_BUGS_TO[0] && stream == stdout)
fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
}
@@ -2630,6 +2677,8 @@ main (int argc, char *argv[])
disable_randomization = 0;
else if (strcmp (*next_arg, "--once") == 0)
run_once = 1;
+ else if (strcmp (*next_arg, "--continue-over-breakpoints") == 0)
+ use_cob = 1;
else
{
fprintf (stderr, "Unknown argument: %s\n", *next_arg);
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver
2013-03-03 2:15 ` Hui Zhu
@ 2013-03-24 14:10 ` Hui Zhu
2013-03-25 3:46 ` Eli Zaretskii
2013-05-07 2:45 ` Hui Zhu
0 siblings, 2 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-24 14:10 UTC (permalink / raw)
To: Hui Zhu; +Cc: Eli Zaretskii, gdb-patches, lgustavo, palves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00056.html
Thanks,
Hui
On Sun, Mar 3, 2013 at 10:15 AM, Hui Zhu <hui_zhu@mentor.com> wrote:
> On 03/03/13 00:20, Eli Zaretskii wrote:
>>>
>>> Date: Sun, 3 Mar 2013 00:13:09 +0800
>>> From: Hui Zhu <hui_zhu@mentor.com>
>>> CC: <lgustavo@codesourcery.com>, Pedro Alves <palves@redhat.com>
>>>
>>> This patch add a new option "--cob" to gdbserver. When gdbserver called
>>> with this option, it will open support of continue over breakpoints.
>>
>>
>> Can we have something less cryptic, like "--continue-over-breakpoints",
>> please?
>>
>> Thanks.
>>
>
> OK. Update this option to "--continue-over-breakpoints".
> Post a new version for that.
>
>
> Thanks,
> Hui
>
> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>
> * server.c (use_cob): New.
> (handle_query): Check use_cob.
> (step_over_breakpoints): New.
> (handle_v_cont): Check use_cob. If need, handle continue over
> breakpoints.
> (gdbserver_usage): Add "--continue-over-breakpoints".
> (main): Ditto.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver
2013-03-24 14:10 ` Hui Zhu
@ 2013-03-25 3:46 ` Eli Zaretskii
2013-03-25 8:06 ` Hui Zhu
2013-05-07 2:45 ` Hui Zhu
1 sibling, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2013-03-25 3:46 UTC (permalink / raw)
To: Hui Zhu; +Cc: hui_zhu, gdb-patches, lgustavo, palves
> From: Hui Zhu <teawater@gmail.com>
> Date: Sun, 24 Mar 2013 13:36:31 +0800
> Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org, lgustavo@codesourcery.com,
> palves@redhat.com
>
> Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00056.html
Are you waiting for me? I already approved the docs, and if you have
changed the option's name, then I'm completely happy.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver
2013-03-25 3:46 ` Eli Zaretskii
@ 2013-03-25 8:06 ` Hui Zhu
0 siblings, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-25 8:06 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: hui_zhu, gdb-patches, lgustavo, palves
Hi Eli,
On Sun, Mar 24, 2013 at 11:35 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Hui Zhu <teawater@gmail.com>
>> Date: Sun, 24 Mar 2013 13:36:31 +0800
>> Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org, lgustavo@codesourcery.com,
>> palves@redhat.com
>>
>> Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00056.html
>
> Are you waiting for me? I already approved the docs, and if you have
> changed the option's name, then I'm completely happy.
I am sorry for that. I just ping this patch for review that I can
check in all this function.
Thanks,
Hui
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver
2013-03-24 14:10 ` Hui Zhu
2013-03-25 3:46 ` Eli Zaretskii
@ 2013-05-07 2:45 ` Hui Zhu
1 sibling, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-05-07 2:45 UTC (permalink / raw)
To: Hui Zhu; +Cc: Eli Zaretskii, gdb-patches, lgustavo, palves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00065.html
Thanks,
Hui
On Sun, Mar 24, 2013 at 1:36 PM, Hui Zhu <teawater@gmail.com> wrote:
> Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00056.html
>
> Thanks,
> Hui
>
> On Sun, Mar 3, 2013 at 10:15 AM, Hui Zhu <hui_zhu@mentor.com> wrote:
>> On 03/03/13 00:20, Eli Zaretskii wrote:
>>>>
>>>> Date: Sun, 3 Mar 2013 00:13:09 +0800
>>>> From: Hui Zhu <hui_zhu@mentor.com>
>>>> CC: <lgustavo@codesourcery.com>, Pedro Alves <palves@redhat.com>
>>>>
>>>> This patch add a new option "--cob" to gdbserver. When gdbserver called
>>>> with this option, it will open support of continue over breakpoints.
>>>
>>>
>>> Can we have something less cryptic, like "--continue-over-breakpoints",
>>> please?
>>>
>>> Thanks.
>>>
>>
>> OK. Update this option to "--continue-over-breakpoints".
>> Post a new version for that.
>>
>>
>> Thanks,
>> Hui
>>
>> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>>
>> * server.c (use_cob): New.
>> (handle_query): Check use_cob.
>> (step_over_breakpoints): New.
>> (handle_v_cont): Check use_cob. If need, handle continue over
>> breakpoints.
>> (gdbserver_usage): Add "--continue-over-breakpoints".
>> (main): Ditto.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver
2013-03-02 16:13 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Hui Zhu
2013-03-02 16:14 ` [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite Hui Zhu
2013-03-02 16:20 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Eli Zaretskii
@ 2013-03-12 10:05 ` Hui Zhu
2 siblings, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-12 10:05 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00056.html
Thanks,
Hui
On 03/03/13 00:13, Hui Zhu wrote:
> Hello,
>
> This patch add a new option "--cob" to gdbserver. When gdbserver called with this option, it will open support of continue over breakpoints.
> Then we can use testsuite test the function of continue over breakpoints.
>
> To support this function, I add new function step_over_breakpoints to let the thread that is stop by breakpoints before continue all theads. It is not very fast. But I think for test is OK. Please give me more comments about it.
>
> Thanks,
> Hui
>
> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
>
> * server.c (use_cob): New.
> (handle_query): Check use_cob.
> (step_over_breakpoints): New.
> (handle_v_cont): Check use_cob. If need, handle continue over
> breakpoints.
> (gdbserver_usage): Add "--cob".
> (main): Ditto.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc
2013-03-02 16:11 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Hui Zhu
2013-03-02 16:13 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Hui Zhu
@ 2013-03-02 16:19 ` Eli Zaretskii
2013-03-03 2:06 ` Hui Zhu
2013-03-12 10:04 ` Hui Zhu
2 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2013-03-02 16:19 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, lgustavo, palves
> Date: Sun, 3 Mar 2013 00:11:27 +0800
> From: Hui Zhu <hui_zhu@mentor.com>
> CC: <lgustavo@codesourcery.com>, Pedro Alves <palves@redhat.com>, Eli
> Zaretskii <eliz@gnu.org>
>
> This is the doc patch for continue over breakpoints function.
Thanks.
> +@item ContinueOverBreakpoints
> +The remote stub knows how to continue over breakpoints itself.
Please remove the "itself" part, it is not needed.
> If this
> +feature is supported by the target, then @value{GDBN} does not need to
> +lift breakpoints off of the inferior and step over them. This feature
"... @value{GDBN} does not need to remove breakpoints in order to
step over them."
> +only applies to continue requests. This feature is only defined when the
^^ ^^^^^^^
Two spaces here. And "available" instead of "defined".
> +remote stub supports managing breakpoints itself (see @ref{insert
> +breakpoint or watchpoint packet}).
Please use "@pxref" instead of "see @ref".
> @value{GDBN} assumes that this feature
> +is applicable to all breakpoints types supported by the stub.
^^^^^^^^^^^
"breakpoint", in singular.
OK with those changes.
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc
2013-03-02 16:19 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Eli Zaretskii
@ 2013-03-03 2:06 ` Hui Zhu
2013-03-03 3:51 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Hui Zhu @ 2013-03-03 2:06 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches, lgustavo, palves
[-- Attachment #1: Type: text/plain, Size: 1711 bytes --]
Hi Eli,
Thanks for your review.
Post a new version according to your comments.
Best,
Hui
On 03/03/13 00:18, Eli Zaretskii wrote:
>> Date: Sun, 3 Mar 2013 00:11:27 +0800
>> From: Hui Zhu <hui_zhu@mentor.com>
>> CC: <lgustavo@codesourcery.com>, Pedro Alves <palves@redhat.com>, Eli
>> Zaretskii <eliz@gnu.org>
>>
>> This is the doc patch for continue over breakpoints function.
>
> Thanks.
>
>> +@item ContinueOverBreakpoints
>> +The remote stub knows how to continue over breakpoints itself.
>
> Please remove the "itself" part, it is not needed.
>
>> If this
>> +feature is supported by the target, then @value{GDBN} does not need to
>> +lift breakpoints off of the inferior and step over them. This feature
>
> "... @value{GDBN} does not need to remove breakpoints in order to
> step over them."
>
>
>> +only applies to continue requests. This feature is only defined when the
> ^^ ^^^^^^^
> Two spaces here. And "available" instead of "defined".
>
>> +remote stub supports managing breakpoints itself (see @ref{insert
>> +breakpoint or watchpoint packet}).
>
> Please use "@pxref" instead of "see @ref".
>
>> @value{GDBN} assumes that this feature
>> +is applicable to all breakpoints types supported by the stub.
> ^^^^^^^^^^^
> "breakpoint", in singular.
>
> OK with those changes.
>
2013-03-03 Luis Machado <lgustavo@codesourcery.com>
Pedro Alves <pedro@codesourcery.com>
Hui Zhu <hui_zhu@mentor.com>
* gdb.texinfo (General Query Packets): Document
ContinueOverBreakpoints under qSupported.
[-- Attachment #2: remote-cob-doc.txt --]
[-- Type: text/plain, Size: 1022 bytes --]
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -37383,6 +37383,11 @@ These are the currently defined stub fea
@tab @samp{-}
@tab No
+@item @samp{ContinueOverBreakpoints}
+@tab No
+@tab @samp{-}
+@tab No
+
@end multitable
These are the currently defined stub features, in more detail:
@@ -37537,6 +37542,15 @@ See @ref{Bytecode Descriptions} for deta
The remote stub supports running a breakpoint's command list itself,
rather than reporting the hit to @value{GDBN}.
+@item ContinueOverBreakpoints
+The remote stub knows how to continue over breakpoints. If this
+feature is supported by the target, then @value{GDBN} does not
+remove breakpoints in order to step over them. This feature
+only applies to continue requests. This feature is only available
+when the remote stub supports managing breakpoints itself (@pxref{insert
+breakpoint or watchpoint packet}). @value{GDBN} assumes that
+this feature is applicable to all breakpoint types supported by the stub.
+
@end table
@item qSymbol::
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc
2013-03-03 2:06 ` Hui Zhu
@ 2013-03-03 3:51 ` Eli Zaretskii
2013-03-03 3:58 ` Hui Zhu
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2013-03-03 3:51 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, lgustavo, palves
> Date: Sun, 3 Mar 2013 10:06:18 +0800
> From: Hui Zhu <hui_zhu@mentor.com>
> CC: <gdb-patches@sourceware.org>, <lgustavo@codesourcery.com>,
> <palves@redhat.com>
>
> Thanks for your review.
>
> Post a new version according to your comments.
You don't need to post it, I OK'd it in advance.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc
2013-03-03 3:51 ` Eli Zaretskii
@ 2013-03-03 3:58 ` Hui Zhu
0 siblings, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-03 3:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches, lgustavo, palves
On 03/03/13 11:51, Eli Zaretskii wrote:
>> Date: Sun, 3 Mar 2013 10:06:18 +0800
>> From: Hui Zhu <hui_zhu@mentor.com>
>> CC: <gdb-patches@sourceware.org>, <lgustavo@codesourcery.com>,
>> <palves@redhat.com>
>>
>> Thanks for your review.
>>
>> Post a new version according to your comments.
>
> You don't need to post it, I OK'd it in advance.
>
Got it. Thanks. :)
Best,
Hui
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc
2013-03-02 16:11 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Hui Zhu
2013-03-02 16:13 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Hui Zhu
2013-03-02 16:19 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Eli Zaretskii
@ 2013-03-12 10:04 ` Hui Zhu
2013-05-07 2:37 ` Hui Zhu
2 siblings, 1 reply; 24+ messages in thread
From: Hui Zhu @ 2013-03-12 10:04 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves, Eli Zaretskii
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00055.html
Thanks,
Hui
On 03/03/13 00:11, Hui Zhu wrote:
> Hello,
>
> This is the doc patch for continue over breakpoints function.
> Please help me review it.
>
> Thanks,
> Hui
>
> 2013-03-03 Luis Machado <lgustavo@codesourcery.com>
> Pedro Alves <pedro@codesourcery.com>
> Hui Zhu <hui_zhu@mentor.com>
>
> * gdb.texinfo (General Query Packets): Document
> ContinueOverBreakpoints under qSupported.
>
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc
2013-03-12 10:04 ` Hui Zhu
@ 2013-05-07 2:37 ` Hui Zhu
0 siblings, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-05-07 2:37 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, lgustavo, Pedro Alves, Eli Zaretskii
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00055.html
Thanks,
Hui
On Tue, Mar 12, 2013 at 6:04 PM, Hui Zhu <hui_zhu@mentor.com> wrote:
> Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00055.html
>
> Thanks,
> Hui
>
>
> On 03/03/13 00:11, Hui Zhu wrote:
>>
>> Hello,
>>
>> This is the doc patch for continue over breakpoints function.
>> Please help me review it.
>>
>> Thanks,
>> Hui
>>
>> 2013-03-03 Luis Machado <lgustavo@codesourcery.com>
>> Pedro Alves <pedro@codesourcery.com>
>> Hui Zhu <hui_zhu@mentor.com>
>>
>> * gdb.texinfo (General Query Packets): Document
>> ContinueOverBreakpoints under qSupported.
>>
>>
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB
2013-03-02 16:09 [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB Hui Zhu
2013-03-02 16:11 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Hui Zhu
@ 2013-03-12 10:04 ` Hui Zhu
2013-03-24 12:33 ` Hui Zhu
2 siblings, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-03-12 10:04 UTC (permalink / raw)
To: gdb-patches; +Cc: lgustavo, Pedro Alves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00054.html
Thanks,
Hui
On 03/03/13 00:09, Hui Zhu wrote:
> Hello,
>
> According to the mail thread in http://sourceware-org.1504.n7.nabble.com/PATCH-Support-targets-that-know-how-to-step-over-breakpoints-td61666.html
> I update patches to change step to continue. When thread hop needed, GDB can use continue over breakpoints let the inferior keep going.
>
> The interface that add to target is:
> to_can_continue_over_breakpoints, it will return true if target can continue over breakpoints.
> to_next_continue_over_breakpoints, call this function before call to_resume will make to_resume do continue_over_breakpoints instead of continue.
>
> This patch is the GDB part that support continue over breakpoints. And there also have patches for doc, server and test. I will introduce them clear inside the mails of that paches.
>
> Please help me review it.
>
> Thanks,
> Hui
>
> 2013-03-03 Luis Machado <lgustavo@codesourcery.com>
> Pedro Alves <pedro@codesourcery.com>
> Hui Zhu <hui_zhu@mentor.com>
>
> * infrun.c (handle_inferior_event): Check if target can continue
> over breakpoints.
>
> * remote.c (struct remote_state): New member
> can_continue_over_breakpoints.
> (remote_continue_over_breakpoints_feature): New.
> (remote_protocol_features): Add ContinueOverBreakpoints feature.
> (remote_open_1): Clear can_continue_over_breakpoints.
> (remote_is_cob): New.
> (append_resumption, remote_resume): Check remote_is_cob.
> (remote_can_continue_over_breakpoints,
> remote_next_continue_over_breakpoints): New.
> (init_remote_ops): Set remote_ops.to_can_continue_over_breakpoints
> to remote_can_continue_over_breakpoints.
> Set to_next_continue_over_breakpoints to
> remote_next_continue_over_breakpoints.
>
> * target.c (update_current_target): Inherit
> to_can_continue_over_breakpoints, and default it to return 0.
> Inherit to_next_continue_over_breakpoints.
>
> * target.h (struct target_ops): Add new
> to_can_step_over_breakpoints member.
> (target_can_step_over_breakpoints): New.
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB
2013-03-02 16:09 [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB Hui Zhu
2013-03-02 16:11 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Hui Zhu
2013-03-12 10:04 ` [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB Hui Zhu
@ 2013-03-24 12:33 ` Hui Zhu
2013-05-07 2:35 ` Hui Zhu
2 siblings, 1 reply; 24+ messages in thread
From: Hui Zhu @ 2013-03-24 12:33 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, lgustavo, Pedro Alves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00054.html
Thanks,
Hui
On Sun, Mar 3, 2013 at 12:09 AM, Hui Zhu <hui_zhu@mentor.com> wrote:
> Hello,
>
> According to the mail thread in
> http://sourceware-org.1504.n7.nabble.com/PATCH-Support-targets-that-know-how-to-step-over-breakpoints-td61666.html
> I update patches to change step to continue. When thread hop needed, GDB
> can use continue over breakpoints let the inferior keep going.
>
> The interface that add to target is:
> to_can_continue_over_breakpoints, it will return true if target can continue
> over breakpoints.
> to_next_continue_over_breakpoints, call this function before call to_resume
> will make to_resume do continue_over_breakpoints instead of continue.
>
> This patch is the GDB part that support continue over breakpoints. And
> there also have patches for doc, server and test. I will introduce them
> clear inside the mails of that paches.
>
> Please help me review it.
>
> Thanks,
> Hui
>
> 2013-03-03 Luis Machado <lgustavo@codesourcery.com>
> Pedro Alves <pedro@codesourcery.com>
> Hui Zhu <hui_zhu@mentor.com>
>
> * infrun.c (handle_inferior_event): Check if target can continue
> over breakpoints.
>
> * remote.c (struct remote_state): New member
> can_continue_over_breakpoints.
> (remote_continue_over_breakpoints_feature): New.
> (remote_protocol_features): Add ContinueOverBreakpoints feature.
> (remote_open_1): Clear can_continue_over_breakpoints.
> (remote_is_cob): New.
> (append_resumption, remote_resume): Check remote_is_cob.
> (remote_can_continue_over_breakpoints,
> remote_next_continue_over_breakpoints): New.
> (init_remote_ops): Set remote_ops.to_can_continue_over_breakpoints
> to remote_can_continue_over_breakpoints.
> Set to_next_continue_over_breakpoints to
> remote_next_continue_over_breakpoints.
>
> * target.c (update_current_target): Inherit
> to_can_continue_over_breakpoints, and default it to return 0.
> Inherit to_next_continue_over_breakpoints.
>
> * target.h (struct target_ops): Add new
> to_can_step_over_breakpoints member.
> (target_can_step_over_breakpoints): New.
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB
2013-03-24 12:33 ` Hui Zhu
@ 2013-05-07 2:35 ` Hui Zhu
0 siblings, 0 replies; 24+ messages in thread
From: Hui Zhu @ 2013-05-07 2:35 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches, lgustavo, Pedro Alves
Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00054.html
Thanks,
Hui
On Sun, Mar 24, 2013 at 1:35 PM, Hui Zhu <teawater@gmail.com> wrote:
> Ping http://sourceware.org/ml/gdb-patches/2013-03/msg00054.html
>
> Thanks,
> Hui
>
> On Sun, Mar 3, 2013 at 12:09 AM, Hui Zhu <hui_zhu@mentor.com> wrote:
>> Hello,
>>
>> According to the mail thread in
>> http://sourceware-org.1504.n7.nabble.com/PATCH-Support-targets-that-know-how-to-step-over-breakpoints-td61666.html
>> I update patches to change step to continue. When thread hop needed, GDB
>> can use continue over breakpoints let the inferior keep going.
>>
>> The interface that add to target is:
>> to_can_continue_over_breakpoints, it will return true if target can continue
>> over breakpoints.
>> to_next_continue_over_breakpoints, call this function before call to_resume
>> will make to_resume do continue_over_breakpoints instead of continue.
>>
>> This patch is the GDB part that support continue over breakpoints. And
>> there also have patches for doc, server and test. I will introduce them
>> clear inside the mails of that paches.
>>
>> Please help me review it.
>>
>> Thanks,
>> Hui
>>
>> 2013-03-03 Luis Machado <lgustavo@codesourcery.com>
>> Pedro Alves <pedro@codesourcery.com>
>> Hui Zhu <hui_zhu@mentor.com>
>>
>> * infrun.c (handle_inferior_event): Check if target can continue
>> over breakpoints.
>>
>> * remote.c (struct remote_state): New member
>> can_continue_over_breakpoints.
>> (remote_continue_over_breakpoints_feature): New.
>> (remote_protocol_features): Add ContinueOverBreakpoints feature.
>> (remote_open_1): Clear can_continue_over_breakpoints.
>> (remote_is_cob): New.
>> (append_resumption, remote_resume): Check remote_is_cob.
>> (remote_can_continue_over_breakpoints,
>> remote_next_continue_over_breakpoints): New.
>> (init_remote_ops): Set remote_ops.to_can_continue_over_breakpoints
>> to remote_can_continue_over_breakpoints.
>> Set to_next_continue_over_breakpoints to
>> remote_next_continue_over_breakpoints.
>>
>> * target.c (update_current_target): Inherit
>> to_can_continue_over_breakpoints, and default it to return 0.
>> Inherit to_next_continue_over_breakpoints.
>>
>> * target.h (struct target_ops): Add new
>> to_can_step_over_breakpoints member.
>> (target_can_step_over_breakpoints): New.
>>
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2013-05-07 2:46 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-02 16:09 [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB Hui Zhu
2013-03-02 16:11 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Hui Zhu
2013-03-02 16:13 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Hui Zhu
2013-03-02 16:14 ` [PATCH] Support targets that know how to continue over breakpoints[4/4] -- testsuite Hui Zhu
2013-03-03 2:18 ` Hui Zhu
2013-03-24 14:45 ` Hui Zhu
2013-05-07 2:46 ` Hui Zhu
2013-03-12 10:05 ` Hui Zhu
2013-03-02 16:20 ` [PATCH] Support targets that know how to continue over breakpoints[3/4] -- gdbserver Eli Zaretskii
2013-03-03 2:15 ` Hui Zhu
2013-03-24 14:10 ` Hui Zhu
2013-03-25 3:46 ` Eli Zaretskii
2013-03-25 8:06 ` Hui Zhu
2013-05-07 2:45 ` Hui Zhu
2013-03-12 10:05 ` Hui Zhu
2013-03-02 16:19 ` [PATCH] Support targets that know how to continue over breakpoints[2/4] -- Doc Eli Zaretskii
2013-03-03 2:06 ` Hui Zhu
2013-03-03 3:51 ` Eli Zaretskii
2013-03-03 3:58 ` Hui Zhu
2013-03-12 10:04 ` Hui Zhu
2013-05-07 2:37 ` Hui Zhu
2013-03-12 10:04 ` [PATCH] Support targets that know how to continue over breakpoints[1/4] -- GDB Hui Zhu
2013-03-24 12:33 ` Hui Zhu
2013-05-07 2:35 ` Hui Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox