aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorMarc Khouzam <marc.khouzam@ericsson.com>2010-12-18 02:08:43 +0000
committerMarc Khouzam <marc.khouzam@ericsson.com>2010-12-18 02:08:43 +0000
commitb3422a0d89b53878bd912c570369227e91519776 (patch)
tree1adf9e880ee08d0c7321028e54259bec52e4f534 /gdb/python
parent5f2302abf841da9ff30a3005118660c5e8dc41e8 (diff)
downloadgdb-b3422a0d89b53878bd912c570369227e91519776.zip
gdb-b3422a0d89b53878bd912c570369227e91519776.tar.gz
gdb-b3422a0d89b53878bd912c570369227e91519776.tar.bz2
* python/py-progspace.c (py_free_pspace): Obtain arch another
way to avoid dereferencing a null pointer.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-progspace.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c
index 2c8a677..093b93f 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;