This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [committed] : [PATCH 4/5] download and install tracepoint via agent


On 04/16/2012 07:36 PM, Yao Qi wrote:
>  	      else
>  		{
> -		  if (install_fast_tracepoint (tpoint, packet) == 0)
> +		  /* Tracepoint is installed successfully?  */
> +		  int installed = 0;
> +
> +		  /* Download and install fast tracepoint by agent.  */
> +		  if (use_agent
> +		      && agent_capability_check (AGENT_CAPA_FAST_TRACE))
> +		    installed = !tracepoint_send_agent (tpoint);
> +		  else
> +		    {
> +		      download_tracepoint_1 (tpoint);
> +		      installed = !install_fast_tracepoint (tpoint, packet);
> +		    }
> +
> +		  if (installed)
>  		    prev_ftpoint = tpoint;
>  		}

Looks like I picked up an out-of-date patch to commit.  Here is an
update on top of it.  Sorry about that.

When we setting multiple fast tracepoints on the same address, GDB
still has to either send tracepoint to agent or download tracepoint.

-- 

gdb/gdbserver:

2012-04-16  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (cmd_qtstart): Download tracepoint even when it is
	duplicated on address.
---
 gdb/gdbserver/tracepoint.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index a0fd39e..2d5cb05 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -3244,17 +3244,26 @@ cmd_qtstart (char *packet)
 
 	  if (tpoint->type == fast_tracepoint)
 	    {
+	      int use_agent_p
+		= use_agent && agent_capability_check (AGENT_CAPA_FAST_TRACE);
+
 	      if (prev_ftpoint != NULL
 		  && prev_ftpoint->address == tpoint->address)
-		clone_fast_tracepoint (tpoint, prev_ftpoint);
+		{
+		  if (use_agent_p)
+		    tracepoint_send_agent (tpoint);
+		  else
+		    download_tracepoint_1 (tpoint);
+
+		  clone_fast_tracepoint (tpoint, prev_ftpoint);
+		}
 	      else
 		{
 		  /* Tracepoint is installed successfully?  */
 		  int installed = 0;
 
 		  /* Download and install fast tracepoint by agent.  */
-		  if (use_agent
-		      && agent_capability_check (AGENT_CAPA_FAST_TRACE))
+		  if (use_agent_p)
 		    installed = !tracepoint_send_agent (tpoint);
 		  else
 		    {
-- 
1.7.0.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]