From: Marc Khouzam Date: Sat, 18 Dec 2010 02:08:43 +0000 (+0000) Subject: * python/py-progspace.c (py_free_pspace): Obtain arch another X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3422a0d89b53878bd912c570369227e91519776;p=binutils-gdb.git * python/py-progspace.c (py_free_pspace): Obtain arch another way to avoid dereferencing a null pointer. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8f227b29ddb..42a3b3ee896 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-12-17 Marc Khouzam + + * python/py-progspace.c (py_free_pspace): Obtain arch another + way to avoid dereferencing a null pointer. + 2010-12-17 Michael Snyder * utils.c (do_my_cleanups): Comment fix-up. diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c index 2c8a677b709..093b93f1ba7 100644 --- a/gdb/python/py-progspace.c +++ b/gdb/python/py-progspace.c @@ -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;