[PATCH 5/5] Look for the last matched 'V' block in trace frame: CTF

Yao Qi yao@codesourcery.com
Thu Mar 7 02:42:00 GMT 2013


This patch depends on the pending 'CTF Support' patch series.

gdb:

2013-03-27  Yao Qi  <yao@codesourcery.com>

	* ctf.c (ctf_get_trace_state_variable_value): Check 'name' is
	NULL.  	Read the last matched event instead of the first
	matched.
---
 gdb/ctf.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/gdb/ctf.c b/gdb/ctf.c
index 6c4182b..e7f19f3 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1072,7 +1072,7 @@ ctf_get_trace_state_variable_value (int tsvnum, LONGEST *val)
 	= bt_ctf_iter_read_event (ctf_iter);
       const char *name = bt_ctf_event_name (event);
 
-      if (strcmp (name, "frame") == 0)
+      if (name == NULL || strcmp (name, "frame") == 0)
 	break;
       else if (strcmp (name, "tsv") == 0)
 	{
@@ -1089,7 +1089,6 @@ ctf_get_trace_state_variable_value (int tsvnum, LONGEST *val)
 	      *val = bt_ctf_get_uint64 (def);
 
 	      found = 1;
-	      break;
 	    }
 	}
 
-- 
1.7.7.6



More information about the Gdb-patches mailing list