Ejemplo n.º 1
0
static void
sympy_dealloc (PyObject *obj)
{
    symbol_object *sym_obj = (symbol_object *) obj;

    if (sym_obj->prev)
        sym_obj->prev->next = sym_obj->next;
    else if (SYMBOL_SYMTAB (sym_obj->symbol))
    {
        set_objfile_data (SYMBOL_SYMTAB (sym_obj->symbol)->objfile,
                          sympy_objfile_data_key, sym_obj->next);
    }
    if (sym_obj->next)
        sym_obj->next->prev = sym_obj->prev;
    sym_obj->symbol = NULL;
}
Ejemplo n.º 2
0
static void
add_class_symtab_symbol (struct symbol *sym)
{
  struct symtab *symtab
    = get_java_class_symtab (get_objfile_arch (SYMBOL_SYMTAB (sym)->objfile));
  struct blockvector *bv = BLOCKVECTOR (symtab);

  dict_add_symbol (BLOCK_DICT (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)), sym);
}
Ejemplo n.º 3
0
static SCM
gdbscm_symbol_symtab (SCM self)
{
    symbol_smob *s_smob
        = syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
    const struct symbol *symbol = s_smob->symbol;

    return stscm_scm_from_symtab (SYMBOL_SYMTAB (symbol));
}
Ejemplo n.º 4
0
static PyObject *
sympy_get_symtab (PyObject *self, void *closure)
{
    struct symbol *symbol = NULL;

    SYMPY_REQUIRE_VALID (self, symbol);

    return symtab_to_symtab_object (SYMBOL_SYMTAB (symbol));
}
Ejemplo n.º 5
0
/* Given a symbol, and a symbol_object that has previously been
   allocated and initialized, populate the symbol_object with the
   struct symbol data.  Also, register the symbol_object life-cycle
   with the life-cycle of the the object file associated with this
   symbol, if needed.  */
static void
set_symbol (symbol_object *obj, struct symbol *symbol)
{
    obj->symbol = symbol;
    obj->prev = NULL;
    if (SYMBOL_SYMTAB (symbol))
    {
        obj->next = objfile_data (SYMBOL_SYMTAB (symbol)->objfile,
                                  sympy_objfile_data_key);

        if (obj->next)
            obj->next->prev = obj;
        set_objfile_data (SYMBOL_SYMTAB (symbol)->objfile,
                          sympy_objfile_data_key, obj);
    }
    else
        obj->next = NULL;
}
Ejemplo n.º 6
0
static htab_t
syscm_objfile_symbol_map (struct symbol *symbol)
{
    struct objfile *objfile = SYMBOL_SYMTAB (symbol)->objfile;
    htab_t htab = objfile_data (objfile, syscm_objfile_data_key);

    if (htab == NULL)
    {
        htab = gdbscm_create_eqable_gsmob_ptr_map (syscm_hash_symbol_smob,
                syscm_eq_symbol_smob);
        set_objfile_data (objfile, syscm_objfile_data_key, htab);
    }

    return htab;
}