|
|
@ -128,17 +128,6 @@ void compound_identity::Init(Core *core)
|
|
|
|
// they are called in an undefined order.
|
|
|
|
// they are called in an undefined order.
|
|
|
|
for (compound_identity *p = list; p; p = p->next)
|
|
|
|
for (compound_identity *p = list; p; p = p->next)
|
|
|
|
p->doInit(core);
|
|
|
|
p->doInit(core);
|
|
|
|
|
|
|
|
|
|
|
|
//FIXME: ... nuked. the group was empty...
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
// Read pre-filled vtable ptrs
|
|
|
|
|
|
|
|
OffsetGroup *ptr_table = core->vinfo->getGroup("vtable");
|
|
|
|
|
|
|
|
for (virtual_identity *p = list; p; p = p->next) {
|
|
|
|
|
|
|
|
void * tmp;
|
|
|
|
|
|
|
|
if (ptr_table->getSafeAddress(p->getName(),tmp))
|
|
|
|
|
|
|
|
p->vtable_ptr = tmp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bitfield_identity::bitfield_identity(size_t size,
|
|
|
|
bitfield_identity::bitfield_identity(size_t size,
|
|
|
@ -223,17 +212,23 @@ virtual_identity::virtual_identity(size_t size, TAllocateFn alloc,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Vtable name to identity lookup. */
|
|
|
|
static std::map<std::string, virtual_identity*> name_lookup;
|
|
|
|
static std::map<std::string, virtual_identity*> name_lookup;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Vtable pointer to identity lookup. */
|
|
|
|
|
|
|
|
std::map<void*, virtual_identity*> virtual_identity::known;
|
|
|
|
|
|
|
|
|
|
|
|
void virtual_identity::doInit(Core *core)
|
|
|
|
void virtual_identity::doInit(Core *core)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct_identity::doInit(core);
|
|
|
|
struct_identity::doInit(core);
|
|
|
|
|
|
|
|
|
|
|
|
name_lookup[getOriginalName()] = this;
|
|
|
|
auto vtname = getOriginalName();
|
|
|
|
}
|
|
|
|
name_lookup[vtname] = this;
|
|
|
|
|
|
|
|
|
|
|
|
/* Vtable to identity lookup. */
|
|
|
|
vtable_ptr = core->vinfo->getVTable(vtname);
|
|
|
|
std::map<void*, virtual_identity*> virtual_identity::known;
|
|
|
|
if (vtable_ptr)
|
|
|
|
|
|
|
|
known[vtable_ptr] = this;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual_identity *virtual_identity::get(virtual_ptr instance_ptr)
|
|
|
|
virtual_identity *virtual_identity::get(virtual_ptr instance_ptr)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -265,8 +260,8 @@ virtual_identity *virtual_identity::get(virtual_ptr instance_ptr)
|
|
|
|
<< ", previous 0x" << unsigned(p->vtable_ptr) << std::dec << std::endl;
|
|
|
|
<< ", previous 0x" << unsigned(p->vtable_ptr) << std::dec << std::endl;
|
|
|
|
abort();
|
|
|
|
abort();
|
|
|
|
} else if (!p->vtable_ptr) {
|
|
|
|
} else if (!p->vtable_ptr) {
|
|
|
|
std::cerr << "class '" << p->getName() << "': vtable = 0x"
|
|
|
|
std::cerr << "<vtable-address name='" << p->getOriginalName() << "' value='0x"
|
|
|
|
<< std::hex << unsigned(vtable) << std::dec << std::endl;
|
|
|
|
<< std::hex << unsigned(vtable) << std::dec << "'/>" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
known[vtable] = p;
|
|
|
|
known[vtable] = p;
|
|
|
|