aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-11-18 09:19:11 -0800
committerDoug Evans <xdje42@gmail.com>2014-11-18 09:19:11 -0800
commiteb822aa6d0f2cdc1a3125da084b96c5bbe32cb86 (patch)
treed26ba8ac15567c8accf2d4bb9b24a4ed83d00a1d /gdb/python
parent98387a2917d136b1acbaa9229d5b6a787d9efd54 (diff)
downloadgdb-eb822aa6d0f2cdc1a3125da084b96c5bbe32cb86.zip
gdb-eb822aa6d0f2cdc1a3125da084b96c5bbe32cb86.tar.gz
gdb-eb822aa6d0f2cdc1a3125da084b96c5bbe32cb86.tar.bz2
SYMTAB_OBJFILE: New macro.
gdb/ChangeLog: * symtab.h (SYMTAB_OBJFILE): New macro. All uses of member symtab.objfile updated to use it.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-block.c6
-rw-r--r--gdb/python/py-frame.c2
-rw-r--r--gdb/python/py-symtab.c19
3 files changed, 14 insertions, 13 deletions
diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c
index 3fa4530..7dee782 100644
--- a/gdb/python/py-block.c
+++ b/gdb/python/py-block.c
@@ -384,12 +384,12 @@ gdbpy_block_for_pc (PyObject *self, PyObject *args)
section = find_pc_mapped_section (pc);
symtab = find_pc_sect_symtab (pc, section);
- if (symtab != NULL && symtab->objfile != NULL)
+ if (symtab != NULL && SYMTAB_OBJFILE (symtab) != NULL)
block = block_for_pc (pc);
}
GDB_PY_HANDLE_EXCEPTION (except);
- if (!symtab || symtab->objfile == NULL)
+ if (!symtab || SYMTAB_OBJFILE (symtab) == NULL)
{
PyErr_SetString (PyExc_RuntimeError,
_("Cannot locate object file for block."));
@@ -397,7 +397,7 @@ gdbpy_block_for_pc (PyObject *self, PyObject *args)
}
if (block)
- return block_to_block_object (block, symtab->objfile);
+ return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
Py_RETURN_NONE;
}
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index bec84ed..62176df 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -303,7 +303,7 @@ frapy_block (PyObject *self, PyObject *args)
struct symtab *symt;
symt = SYMBOL_SYMTAB (BLOCK_FUNCTION (fn_block));
- return block_to_block_object (block, symt->objfile);
+ return block_to_block_object (block, SYMTAB_OBJFILE (symt));
}
Py_RETURN_NONE;
diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c
index 1065ba3..e4e3ec1 100644
--- a/gdb/python/py-symtab.c
+++ b/gdb/python/py-symtab.c
@@ -121,7 +121,7 @@ stpy_get_objfile (PyObject *self, void *closure)
STPY_REQUIRE_VALID (self, symtab);
- result = objfile_to_objfile_object (symtab->objfile);
+ result = objfile_to_objfile_object (SYMTAB_OBJFILE (symtab));
Py_XINCREF (result);
return result;
}
@@ -186,7 +186,7 @@ stpy_global_block (PyObject *self, PyObject *args)
blockvector = BLOCKVECTOR (symtab);
block = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
- return block_to_block_object (block, symtab->objfile);
+ return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
}
/* Return the STATIC_BLOCK of the underlying symtab. */
@@ -202,7 +202,7 @@ stpy_static_block (PyObject *self, PyObject *args)
blockvector = BLOCKVECTOR (symtab);
block = BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK);
- return block_to_block_object (block, symtab->objfile);
+ return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
}
/* Implementation of gdb.Symtab.linetable (self) -> gdb.Linetable.
@@ -252,7 +252,7 @@ stpy_dealloc (PyObject *obj)
symtab->prev->next = symtab->next;
else if (symtab->symtab)
{
- set_objfile_data (symtab->symtab->objfile,
+ set_objfile_data (SYMTAB_OBJFILE (symtab->symtab),
stpy_objfile_data_key, symtab->next);
}
if (symtab->next)
@@ -333,7 +333,7 @@ salpy_dealloc (PyObject *self)
if (self_sal->prev)
self_sal->prev->next = self_sal->next;
else if (self_sal->symtab != (symtab_object * ) Py_None)
- set_objfile_data (self_sal->symtab->symtab->objfile,
+ set_objfile_data (SYMTAB_OBJFILE (self_sal->symtab->symtab),
salpy_objfile_data_key, self_sal->next);
if (self_sal->next)
@@ -377,12 +377,12 @@ set_sal (sal_object *sal_obj, struct symtab_and_line sal)
objfile cleanup observer linked list. */
if (sal_obj->symtab != (symtab_object *)Py_None)
{
- sal_obj->next = objfile_data (sal_obj->symtab->symtab->objfile,
+ sal_obj->next = objfile_data (SYMTAB_OBJFILE (sal_obj->symtab->symtab),
salpy_objfile_data_key);
if (sal_obj->next)
sal_obj->next->prev = sal_obj;
- set_objfile_data (sal_obj->symtab->symtab->objfile,
+ set_objfile_data (SYMTAB_OBJFILE (sal_obj->symtab->symtab),
salpy_objfile_data_key, sal_obj);
}
else
@@ -403,10 +403,11 @@ set_symtab (symtab_object *obj, struct symtab *symtab)
obj->prev = NULL;
if (symtab)
{
- obj->next = objfile_data (symtab->objfile, stpy_objfile_data_key);
+ obj->next = objfile_data (SYMTAB_OBJFILE (symtab),
+ stpy_objfile_data_key);
if (obj->next)
obj->next->prev = obj;
- set_objfile_data (symtab->objfile, stpy_objfile_data_key, obj);
+ set_objfile_data (SYMTAB_OBJFILE (symtab), stpy_objfile_data_key, obj);
}
else
obj->next = NULL;