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]

[RFA] tracepoint.c: tfile_trace_find, make it return -1 when num is -1


Hi,

I found that when GDB parse a tfile, tfile_trace_find will be call
with num is -1 when GDB call target_read_live_memory.
But it will not find anything.  Because -1 is mean live frame.

So I make a patch to make it return -1 when num is -1.

Thanks,
Hui

2011-05-19  Hui Zhu  <teawater@gmail.com>

	* tracepoint.c (tfile_trace_find): Return directly when num is -1.
---
 tracepoint.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/tracepoint.c
+++ b/tracepoint.c
@@ -3815,6 +3815,8 @@ tfile_trace_find (enum trace_find_type t
      first.  */
   if (type != tfind_number)
     set_tfile_traceframe ();
+  else if (num == -1)
+    return -1;

   lseek (trace_fd, trace_frames_offset, SEEK_SET);
   offset = trace_frames_offset;


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