Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e82cde6

Browse filesBrowse files
committed
py-objfile: export objfile gdbarch
1 parent 287b2b1 commit e82cde6
Copy full SHA for e82cde6

File tree

Expand file treeCollapse file tree

1 file changed

+21
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+21
-0
lines changed
Open diff view settings
Collapse file

‎gdb/python/py-objfile.c‎

Copy file name to clipboardExpand all lines: gdb/python/py-objfile.c
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,25 @@ objfpy_get_xmethods (PyObject *o, void *ignore)
382382
return self->xmethods;
383383
}
384384

385+
static PyObject *
386+
objfpy_get_architecture (PyObject *o, void *ignore)
387+
{
388+
objfile_object *self = (objfile_object *) o;
389+
struct gdbarch *gdbarch = NULL;
390+
391+
TRY
392+
{
393+
gdbarch = get_objfile_arch(self->objfile);
394+
}
395+
CATCH (except, RETURN_MASK_ALL)
396+
{
397+
GDB_PY_HANDLE_EXCEPTION (except);
398+
}
399+
END_CATCH
400+
401+
return gdbarch_to_arch_object (gdbarch);
402+
}
403+
385404
/* Set the 'type_printers' attribute. */
386405

387406
static int
@@ -704,6 +723,8 @@ static PyGetSetDef objfile_getset[] =
704723
"Type printers.", NULL },
705724
{ "xmethods", objfpy_get_xmethods, NULL,
706725
"Debug methods.", NULL },
726+
{ "architecture", objfpy_get_architecture, NULL, "Objfile Architecture",
727+
NULL },
707728
{ NULL }
708729
};
709730

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.