Remove most uses of ALL_OBJFILES
[deliverable/binutils-gdb.git] / gdb / jit.c
index e6b3cc25ca42c0accae6b8ef0adb9d24345ed209..e77c03ad59b649a727426a995053ba5feb45f096 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -1,6 +1,6 @@
 /* Handle JIT code generation in the inferior for GDB, the GNU Debugger.
 
-   Copyright (C) 2009-2018 Free Software Foundation, Inc.
+   Copyright (C) 2009-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -986,9 +986,7 @@ jit_unregister_code (struct objfile *objfile)
 static struct objfile *
 jit_find_objf_with_entry_addr (CORE_ADDR entry_addr)
 {
-  struct objfile *objf;
-
-  ALL_OBJFILES (objf)
+  for (objfile *objf : all_objfiles (current_program_space))
     {
       struct jit_objfile_data *objf_data;
 
@@ -1464,7 +1462,8 @@ free_objfile_data (struct objfile *objfile, void *data)
       if (ps_data != NULL && ps_data->objfile == objfile)
        {
          ps_data->objfile = NULL;
-         delete_breakpoint (ps_data->jit_breakpoint);
+         if (ps_data->jit_breakpoint != NULL)
+           delete_breakpoint (ps_data->jit_breakpoint);
          ps_data->cached_code_address = 0;
        }
     }
This page took 0.024336 seconds and 4 git commands to generate.