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]

[PATCH 0/2] [GDBserver] Fix compiling conditional expressions accessing registers


Hi all,

I noticed compiled conditions for fast tracepoints failed to read
registers.  We can uncover the issue by compiling and executing the
following expression: `$rip == *set_point' on x86_64, with `set_point'
being the tracepoint symbol.  The expression should always be true but this
shows it isn't:

~~~
(gdb) ftrace set_point if $rip == *set_point
Fast tracepoint 2 at 0x4006b9: ...
(gdb) tstart
(gdb) continue
Continuing.

Breakpoint 3, end () at ..
(gdb) tstatus
Trace is running on the target.
Collected 0 trace frames.
^^^^^^^^^^^^^^^^^^^^^^^^^
Trace buffer has 5242880 bytes of 5242880 bytes free (0% full).
Trace will stop if GDB disconnects.
Not looking at any trace frame.
Trace started at 1441727485.544642 secs.
~~~

The following patches address this particular issue and adds a test case.
However, the test cases uncovered other issues which have been marked as
known failures, linking to PR/18955.

I have ran the test suite on both x86_64-linux and i386-linux, in a remote
configuration.

Thanks,
Pierre

Pierre Langlois (2):
  [GDBserver] Fix compiling conditional expressions accessing registers
  [testsuite] Add test case for tracepoints with conditions

 gdb/gdbserver/linux-amd64-ipa.c             |   9 --
 gdb/gdbserver/linux-i386-ipa.c              |  15 ---
 gdb/gdbserver/linux-x86-low.c               |   4 +-
 gdb/gdbserver/tracepoint.c                  |  42 ++++---
 gdb/gdbserver/tracepoint.h                  |   9 +-
 gdb/testsuite/gdb.trace/trace-condition.c   |  66 +++++++++++
 gdb/testsuite/gdb.trace/trace-condition.exp | 167 ++++++++++++++++++++++++++++
 7 files changed, 263 insertions(+), 49 deletions(-)
 create mode 100644 gdb/testsuite/gdb.trace/trace-condition.c
 create mode 100644 gdb/testsuite/gdb.trace/trace-condition.exp

-- 
2.4.6


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