/* Pointer to the current program space. */
struct program_space *current_program_space;
-/* The last address space number assigned. */
-static int highest_address_space_num;
-
-\f
-
-/* Create a new address space object, and add it to the list. */
-
-address_space::address_space ()
- : m_num (++highest_address_space_num)
-{
-}
-
/* 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 on this target system. */
return new_address_space ();
}
-/* Start counting over from scratch. */
-
-static void
-init_address_spaces (void)
-{
- highest_address_space_num = 0;
-}
-
-\f
-
/* Remove a program space from the program spaces list. */
static void
int shared_aspace
= gdbarch_has_shared_address_space (current_inferior ()->arch ());
- init_address_spaces ();
-
if (shared_aspace)
{
address_space_ref_ptr aspace = new_address_space ();
struct address_space : public refcounted_object
{
/* Create a new address space object, and add it to the list. */
- address_space ();
+ address_space () = default;
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<address_space> registry_fields;
-
-private:
- int m_num;
};
using address_space_ref_ptr