This patch introduces the regcache_get_ptid function, which can be used
to retrieve the ptid a regcache is connected to. It is used in
subsequent patches.
gdb/ChangeLog:
* regcache.h (regcache_get_ptid): New function.
* regcache.c (regcache_get_ptid): New function.
+2017-03-13 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * regcache.h (regcache_get_ptid): New function.
+ * regcache.c (regcache_get_ptid): New function.
+
2017-03-13 Mark Wielaard <mark@klomp.org>
* cp-name-parser.y (make_empty): Initialize d_printing to zero.
ptid_t ptid;
};
+/* See regcache.h. */
+
+ptid_t
+regcache_get_ptid (const struct regcache *regcache)
+{
+ gdb_assert (!ptid_equal (regcache->ptid, minus_one_ptid));
+
+ return regcache->ptid;
+}
+
static struct regcache *
regcache_xmalloc_1 (struct gdbarch *gdbarch, struct address_space *aspace,
int readonly_p)
struct regcache *regcache_xmalloc (struct gdbarch *gdbarch,
struct address_space *aspace);
+/* Return REGCACHE's ptid. */
+
+extern ptid_t regcache_get_ptid (const struct regcache *regcache);
+
/* Return REGCACHE's architecture. */
extern struct gdbarch *get_regcache_arch (const struct regcache *regcache);