]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* python/py-progspace.c (py_free_pspace): Obtain arch another
authorMarc Khouzam <marc.khouzam@ericsson.com>
Sat, 18 Dec 2010 01:28:06 +0000 (01:28 +0000)
committerMarc Khouzam <marc.khouzam@ericsson.com>
Sat, 18 Dec 2010 01:28:06 +0000 (01:28 +0000)
way to avoid dereferencing a null pointer.

gdb/ChangeLog
gdb/python/py-progspace.c

index ef0b0a7b638ce47b2da701ce51ae0fb1355502c6..fff3a49a16dd00b6488f84ee18b0df32c69d7b61 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-17  Marc Khouzam  <marc.khouzam@ericsson.com>
+
+       * python/py-progspace.c (py_free_pspace): Obtain arch another
+       way to avoid dereferencing a null pointer.
+
 2010-12-12  Stan Shebs  <stan@codesourcery.com>
 
        * value.c (value_of_internalvar): Add case for trace state
index 87245328c83e4cbca45d161dad0f48fe6b7562f3..71a1c9f2d6998fab21c9cb0d62cd7e8140b35c12 100644 (file)
@@ -23,6 +23,7 @@
 #include "progspace.h"
 #include "objfiles.h"
 #include "language.h"
+#include "arch-utils.h"
 
 typedef struct
 {
@@ -134,9 +135,7 @@ py_free_pspace (struct program_space *pspace, void *datum)
 {
   struct cleanup *cleanup;
   pspace_object *object = datum;
-  /* FIXME: What's the right way to get a program space's arch?
-     There may be multiple.  */
-  struct gdbarch *arch = get_objfile_arch (pspace->symfile_object_file);
+  struct gdbarch *arch = get_current_arch ();
 
   cleanup = ensure_python_env (arch, current_language);
   object->pspace = NULL;