Ghidra Decompiler Analysis Engine
|
A description of a byte-code object referenced by a constant. More...
#include <cpool.hh>
Public Types | |
enum | { primitive =0, string_literal =1, class_reference =2, pointer_method =3, pointer_field =4, array_length =5, instance_of =6, check_cast =7 } |
Generic constant pool tag types. More... | |
enum | { is_constructor = 0x1, is_destructor = 0x2 } |
Public Member Functions | |
void | saveXml (ostream &s) const |
Save object to an XML stream. More... | |
void | restoreXml (const Element *el, TypeFactory &typegrp) |
Restore object from XML stream. More... | |
Friends | |
class | ConstantPool |
A description of a byte-code object referenced by a constant.
Byte-code languages can make use of objects that the system knows about but which aren't fully embedded in the encoding of instructions that use them. Instead the instruction refers to the object via a special encoded reference. This class describes one object described by such a reference. In order to provide a concrete interpretation of the instruction (i.e. a p-code translation), these objects generally resolve to some sort of constant value (hence the term constant pool). The type of constant goes to the formal CPoolRecord tag field which can be a:
For decompilation, knowing the actual constant a byte-code interpreter would need is secondary to knowing what object is being referenced. So the CPoolRecord can hold a constant value, but generally it provides a data-type associated with the object and a symbol name or other string token naming the object.
anonymous enum |
Generic constant pool tag types.
anonymous enum |
void CPoolRecord::restoreXml | ( | const Element * | el, |
TypeFactory & | typegrp | ||
) |
Restore object from XML stream.
Initialize this CPoolRecord instance from a <cpoolrec> tag.
el | is the <cpoolrec> element |
typegrp | is the TypeFactory used to resolve data-types |
void CPoolRecord::saveXml | ( | ostream & | s | ) | const |
Save object to an XML stream.
Save the constant pool object description as a <cpoolrec> tag.
s | is the output stream |