public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* data tracepoints
@ 2016-06-20 18:28 taylor, david
  0 siblings, 0 replies; only message in thread
From: taylor, david @ 2016-06-20 18:28 UTC (permalink / raw)
  To: gdb; +Cc: taylor, david

For some applications and/or targets, "bad things" happen if the wrong
thread / process stops at a breakpoint waiting for the user to do something.

For such applications, tracepoints are extremely useful.

Sometimes instead of "when the program reaches this location I want to do ...",
you have the situation "when this variable is accessed / written, I want to do ...".

If the hardware supports it, you can use hardware watchpoints.  But, if the wrong
thread / process stops, things do south.

We have implemented what, for lack of a better name, I'll call data tracepoints.
From GDB's perspective, they are a kludge.  GDB knows nothing about them.
The GUI asks GDB the size of the variable -- which becomes the default number
of bytes to trace.  Through casting and overloading of some fields (e.g., number
of bytes to trace ==> step count), they get defined and then downloaded to the
target.

One of the kludges is that the actions must be in the 'while-stepping' part of the
tracepoint, or tdump will not dump the data collected.  [Since the tracepoint location
is a data address, it does not match the pc at the time of the collection, so GDB thinks
that the current trace frame is in the 'while-stepping' part of a tracepoint...]

I'd like to make it no longer be a kludge.

The number and length of hardware watchpoints is extremely limited.  So, the
number of data tracepoints is also extremely limited.  But, they have proven very
useful.

Adding support immediately raises a number of questions.

For starters, what should they be called?

Should they be just tracepoints with GDB knowing that they are different since they are
in data space, not text space?  Or should there be a new command -- perhaps 'dtrace'?

Also, is overloading the QTDP packet okay?  Or should there be a new packet for
data tracepoints?

Opinions?

David

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-20 18:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20 18:28 data tracepoints taylor, david

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).