Introduce regcache_get_ptid
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 13 Mar 2017 22:51:38 +0000 (18:51 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 13 Mar 2017 22:51:38 +0000 (18:51 -0400)
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.

gdb/ChangeLog
gdb/regcache.c
gdb/regcache.h

index 7de2498746365538576d5ab97d3bbf4d484a3f23..3e155a3e68ac4cb741e97a959504d01c8d36f294 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 0728a03b65d60df0d032bfe9518d663d632523f8..58d4f5629213d96d2e26ce658f589debed730206 100644 (file)
@@ -215,6 +215,16 @@ struct regcache
   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)
index e1495f61426f879386b905ab1e97421bdd061bf5..d0107cd76e349f2bd76868dbd5b27127b8277870 100644 (file)
@@ -39,6 +39,10 @@ struct cleanup *make_cleanup_regcache_xfree (struct regcache *regcache);
 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);
This page took 0.026577 seconds and 4 git commands to generate.