This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/19288] need a way to see if an address is covered by some existing object
- From: "tromey at sourceware dot org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 24 Nov 2015 21:38:54 +0000
- Subject: [Bug python/19288] need a way to see if an address is covered by some existing object
- Auto-submitted: auto-generated
- References: <bug-19288-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=19288
--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
This worked ok for me, but it's a big hack.
static PyObject *
gdbpy_text_address_claimed (PyObject *self, PyObject *args)
{
gdb_py_ulongest pc;
struct objfile *objfile;
struct obj_section *osect;
if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc))
return NULL;
ALL_OBJSECTIONS (objfile, osect)
{
/* Only process each object file once, even if there's a separate
debug file. */
if (objfile->separate_debug_objfile_backlink)
continue;
if (obj_section_addr (osect) <= pc && pc < obj_section_endaddr (osect))
{
Py_RETURN_TRUE;
}
}
Py_RETURN_FALSE;
}
--
You are receiving this mail because:
You are on the CC list for the bug.