+2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * breakpoint.c (bkpt_probe_insert_location): Call set_semaphore
+ only if it is not NULL.
+ (bkpt_probe_remove_location): Likewise, for clear_semaphore.
+ * probe.h (struct probe_ops) <set_semaphore>: Update comment.
+ (struct probe_ops) <clear_semaphore>: Likewise.
+ * tracepoint.c (start_tracing): Call set_semaphore only if it is
+ not NULL.
+ (stop_tracing): Likewise, for clear_semaphore.
+
2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com>
* stap-probe.c (stap_parse_argument): Initialize expout explicitly
{
/* The insertion was successful, now let's set the probe's semaphore
if needed. */
- bl->probe.probe->pops->set_semaphore (bl->probe.probe,
- bl->probe.objfile,
- bl->gdbarch);
+ if (bl->probe.probe->pops->set_semaphore != NULL)
+ bl->probe.probe->pops->set_semaphore (bl->probe.probe,
+ bl->probe.objfile,
+ bl->gdbarch);
}
return v;
bkpt_probe_remove_location (struct bp_location *bl)
{
/* Let's clear the semaphore before removing the location. */
- bl->probe.probe->pops->clear_semaphore (bl->probe.probe,
- bl->probe.objfile,
- bl->gdbarch);
+ if (bl->probe.probe->pops->clear_semaphore != NULL)
+ bl->probe.probe->pops->clear_semaphore (bl->probe.probe,
+ bl->probe.objfile,
+ bl->gdbarch);
return bkpt_remove_location (bl);
}
/* Set the semaphore associated with the PROBE. This function only makes
sense if the probe has a concept of semaphore associated to a
- probe. */
+ probe, otherwise it can be set to NULL. */
void (*set_semaphore) (struct probe *probe, struct objfile *objfile,
struct gdbarch *gdbarch);
/* Clear the semaphore associated with the PROBE. This function only
makes sense if the probe has a concept of semaphore associated to
- a probe. */
+ a probe, otherwise it can be set to NULL. */
void (*clear_semaphore) (struct probe *probe, struct objfile *objfile,
struct gdbarch *gdbarch);
t->number_on_target = b->number;
for (loc = b->loc; loc; loc = loc->next)
- if (loc->probe.probe != NULL)
+ if (loc->probe.probe != NULL
+ && loc->probe.probe->pops->set_semaphore != NULL)
loc->probe.probe->pops->set_semaphore (loc->probe.probe,
loc->probe.objfile,
loc->gdbarch);
but we don't really care if this semaphore goes out of sync.
That's why we are decrementing it here, but not taking care
in other places. */
- if (loc->probe.probe != NULL)
+ if (loc->probe.probe != NULL
+ && loc->probe.probe->pops->clear_semaphore != NULL)
loc->probe.probe->pops->clear_semaphore (loc->probe.probe,
loc->probe.objfile,
loc->gdbarch);