aboutsummaryrefslogtreecommitdiff
path: root/gdb/progspace.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-10-18 10:47:48 -0600
committerTom Tromey <tom@tromey.com>2022-07-28 14:16:50 -0600
commitb382c16682acc33d2e81e5604c9dbd408be376d2 (patch)
tree46ca3ab29dfb4437dd35db2ab605fbc1ebdf1195 /gdb/progspace.h
parente5213e2c851c295c5e4c3e9b52606c1012029b67 (diff)
downloadfsf-binutils-gdb-b382c16682acc33d2e81e5604c9dbd408be376d2.zip
fsf-binutils-gdb-b382c16682acc33d2e81e5604c9dbd408be376d2.tar.gz
fsf-binutils-gdb-b382c16682acc33d2e81e5604c9dbd408be376d2.tar.bz2
Change address_space to use new and delete
This changes address_space to use new and delete, and makes some other small C++-ification changes as well, like changing address_space_num to be a method. This patch was needed for the subsequent patch to rewrite the registry system.
Diffstat (limited to 'gdb/progspace.h')
-rw-r--r--gdb/progspace.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/gdb/progspace.h b/gdb/progspace.h
index 662e569..8531da4 100644
--- a/gdb/progspace.h
+++ b/gdb/progspace.h
@@ -385,10 +385,22 @@ private:
associating caches to each address space. */
struct address_space
{
- int num;
+ /* Create a new address space object, and add it to the list. */
+ address_space ();
+ ~address_space ();
+ DISABLE_COPY_AND_ASSIGN (address_space);
+
+ /* Returns the integer address space id of this address space. */
+ int num () const
+ {
+ return m_num;
+ }
/* Per aspace data-pointers required by other GDB modules. */
- REGISTRY_FIELDS;
+ REGISTRY_FIELDS {};
+
+private:
+ int m_num;
};
/* The list of all program spaces. There's always at least one. */
@@ -430,17 +442,11 @@ private:
program_space *m_saved_pspace;
};
-/* Create a new address space object, and add it to the list. */
-extern struct address_space *new_address_space (void);
-
/* Maybe create a new address space object, and add it to the list, or
return a pointer to an existing address space, in case inferiors
share an address space. */
extern struct address_space *maybe_new_address_space (void);
-/* Returns the integer address space id of ASPACE. */
-extern int address_space_num (struct address_space *aspace);
-
/* Update all program spaces matching to address spaces. The user may
have created several program spaces, and loaded executables into
them before connecting to the target interface that will create the