From 94c93c35b50d0783fdfda277508d0ae6c3e372fb Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 8 May 2020 14:21:22 -0600 Subject: Remove ALL_PSPACES This removes the ALL_PSPACES macro. In this case it seemed cleanest to change how program spaces are stored -- instead of using a linked list, they are now stored in a std::vector. gdb/ChangeLog 2020-05-08 Tom Tromey * symtab.c (set_symbol_cache_size) (maintenance_print_symbol_cache, maintenance_flush_symbol_cache) (maintenance_print_symbol_cache_statistics): Update. * symmisc.c (print_symbol_bcache_statistics) (print_objfile_statistics, maintenance_print_objfiles) (maintenance_info_symtabs, maintenance_check_symtabs) (maintenance_expand_symtabs, maintenance_info_line_tables): Update. * symfile-debug.c (set_debug_symfile): Update. * source.c (forget_cached_source_info): Update. * python/python.c (gdbpy_progspaces): Update. * psymtab.c (maintenance_info_psymtabs): Update. * probe.c (parse_probes): Update. * linespec.c (iterate_over_all_matching_symtabs) (collect_symtabs_from_filename, search_minsyms_for_name): Update. * guile/scm-progspace.c (gdbscm_progspaces): Update. * exec.c (exec_target::close): Update. * ada-tasks.c (ada_tasks_new_objfile_observer): Update. * breakpoint.c (print_one_breakpoint_location) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint): Update. * progspace.c (program_spaces): Now a std::vector. (maybe_new_address_space): Update. (add_program_space): Remove. (program_space::program_space): Update. (remove_program_space): Update. (number_of_program_spaces): Remove. (print_program_space, update_address_spaces): Update. * progspace.h (program_spaces): Change type. (ALL_PSPACES): Remove. (number_of_program_spaces): Don't declare. (struct program_space) : Remove. --- gdb/python/python.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'gdb/python') diff --git a/gdb/python/python.c b/gdb/python/python.c index 4875ffd2..67f362b 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1350,19 +1350,17 @@ gdbpy_print_stack_or_quit () static PyObject * gdbpy_progspaces (PyObject *unused1, PyObject *unused2) { - struct program_space *ps; - gdbpy_ref<> list (PyList_New (0)); if (list == NULL) return NULL; - ALL_PSPACES (ps) - { - gdbpy_ref<> item = pspace_to_pspace_object (ps); + for (struct program_space *ps : program_spaces) + { + gdbpy_ref<> item = pspace_to_pspace_object (ps); - if (item == NULL || PyList_Append (list.get (), item.get ()) == -1) - return NULL; - } + if (item == NULL || PyList_Append (list.get (), item.get ()) == -1) + return NULL; + } return list.release (); } -- cgit v1.1