Add more methods to gdb.Progspace
[deliverable/binutils-gdb.git] / gdb / python / py-block.c
index 70a0a76dc43d0d60f67b6541daa542ee41e28cb7..5fc33f0f0fbbcf7fcc5b975ba9a9be0561e40623 100644 (file)
@@ -366,44 +366,6 @@ blpy_iter_is_valid (PyObject *self, PyObject *args)
   Py_RETURN_TRUE;
 }
 
-/* Return the innermost lexical block containing the specified pc value,
-   or 0 if there is none.  */
-PyObject *
-gdbpy_block_for_pc (PyObject *self, PyObject *args)
-{
-  gdb_py_ulongest pc;
-  const struct block *block = NULL;
-  struct compunit_symtab *cust = NULL;
-
-  if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc))
-    return NULL;
-
-  TRY
-    {
-      cust = find_pc_compunit_symtab (pc);
-
-      if (cust != NULL && COMPUNIT_OBJFILE (cust) != NULL)
-       block = block_for_pc (pc);
-    }
-  CATCH (except, RETURN_MASK_ALL)
-    {
-      GDB_PY_HANDLE_EXCEPTION (except);
-    }
-  END_CATCH
-
-  if (cust == NULL || COMPUNIT_OBJFILE (cust) == NULL)
-    {
-      PyErr_SetString (PyExc_RuntimeError,
-                      _("Cannot locate object file for block."));
-      return NULL;
-    }
-
-  if (block)
-    return block_to_block_object (block, COMPUNIT_OBJFILE (cust));
-
-  Py_RETURN_NONE;
-}
-
 /* This function is called when an objfile is about to be freed.
    Invalidate the block as further actions on the block would result
    in bad data.  All access to obj->symbol should be gated by
This page took 0.027682 seconds and 4 git commands to generate.