JVM
attributes.c File Reference
#include "attributes.h"
#include "readfunctions.h"
#include "utf8.h"
#include "opcodes.h"
#include "debugging.h"
#include <inttypes.h>
Include dependency graph for attributes.c:

Macros

#define DECLARE_ATTR_FUNCS(attr)
 
#define IF_ATTR_CHECK(name)
 
#define OPCODE_INTERVAL(begin, end)   (opcode >= opcode_##begin && opcode <= opcode_##end)
 
#define NEXTBYTE   (*(info->code + ++code_offset))
 
#define ATTR_CASE(attr)   case ATTR_##attr: freeAttribute##attr(entry); return;
 
#define ATTR_CASE(attr)   case ATTR_##attr: printAttribute##attr(jc, entry, identationLevel); break;
 

Functions

char readAttribute (JavaClass *jc, attribute_info *entry)
 
void ident (int level)
 
uint8_t readAttributeDeprecated (JavaClass *jc, attribute_info *entry)
 
void printAttributeDeprecated (JavaClass *jc, attribute_info *entry, int identationLevel)
 
void freeAttributeDeprecated (attribute_info *entry)
 
uint8_t readAttributeConstantValue (JavaClass *jc, attribute_info *entry)
 
void printAttributeConstantValue (JavaClass *jc, attribute_info *entry, int identationLevel)
 
void freeAttributeConstantValue (attribute_info *entry)
 
uint8_t readAttributeSourceFile (JavaClass *jc, attribute_info *entry)
 
void printAttributeSourceFile (JavaClass *jc, attribute_info *entry, int identationLevel)
 
void freeAttributeSourceFile (attribute_info *entry)
 
uint8_t readAttributeInnerClasses (JavaClass *jc, attribute_info *entry)
 
void printAttributeInnerClasses (JavaClass *jc, attribute_info *entry, int identationLevel)
 
void freeAttributeInnerClasses (attribute_info *entry)
 
uint8_t readAttributeLineNumberTable (JavaClass *jc, attribute_info *entry)
 
void printAttributeLineNumberTable (JavaClass *jc, attribute_info *entry, int identationLevel)
 
void freeAttributeLineNumberTable (attribute_info *entry)
 
uint8_t readAttributeCode (JavaClass *jc, attribute_info *entry)
 
void printAttributeCode (JavaClass *jc, attribute_info *entry, int identationLevel)
 
void freeAttributeCode (attribute_info *entry)
 
uint8_t readAttributeExceptions (JavaClass *jc, attribute_info *entry)
 
void printAttributeExceptions (JavaClass *jc, attribute_info *entry, int identationLevel)
 
void freeAttributeExceptions (attribute_info *entry)
 
void freeAttributeInfo (attribute_info *entry)
 
void printAttribute (JavaClass *jc, attribute_info *entry, int identationLevel)
 
void printAllAttributes (JavaClass *jc)
 
attribute_infogetAttributeByType (attribute_info *attributes, uint16_t attributes_length, enum AttributeType type)
 

Macro Definition Documentation

§ ATTR_CASE [1/2]

#define ATTR_CASE (   attr)    case ATTR_##attr: freeAttribute##attr(entry); return;

§ ATTR_CASE [2/2]

#define ATTR_CASE (   attr)    case ATTR_##attr: printAttribute##attr(jc, entry, identationLevel); break;

§ DECLARE_ATTR_FUNCS

#define DECLARE_ATTR_FUNCS (   attr)
Value:
uint8_t readAttribute##attr(JavaClass* jc, attribute_info* entry); \
void printAttribute##attr(JavaClass* jc, attribute_info* entry, int identationLevel); \
void freeAttribute##attr(attribute_info* entry);
Definition: attributes.h:9
char readAttribute(JavaClass *jc, attribute_info *entry)
Definition: attributes.c:21
void printAttribute(JavaClass *jc, attribute_info *entry, int identationLevel)
Definition: attributes.c:1244
Definition: javaclass.h:96

§ IF_ATTR_CHECK

#define IF_ATTR_CHECK (   name)
Value:
if (cmp_UTF8_Ascii(cp->Utf8.bytes, cp->Utf8.length, (uint8_t*)#name, sizeof(#name) - 1)) { \
entry->attributeType = ATTR_##name; \
result = readAttribute##name(jc, entry); \
}
char cmp_UTF8_Ascii(const uint8_t *utf8_bytes, int32_t utf8_len, const uint8_t *ascii_bytes, int32_t ascii_len)
Function to compare two strings, one in UTF-8 and other in ASCII.
Definition: utf8.c:76
char readAttribute(JavaClass *jc, attribute_info *entry)
Definition: attributes.c:21

§ NEXTBYTE

#define NEXTBYTE   (*(info->code + ++code_offset))

§ OPCODE_INTERVAL

#define OPCODE_INTERVAL (   begin,
  end 
)    (opcode >= opcode_##begin && opcode <= opcode_##end)

Function Documentation

§ freeAttributeCode()

void freeAttributeCode ( attribute_info entry)
Here is the call graph for this function:

§ freeAttributeConstantValue()

void freeAttributeConstantValue ( attribute_info entry)

§ freeAttributeDeprecated()

void freeAttributeDeprecated ( attribute_info entry)

§ freeAttributeExceptions()

void freeAttributeExceptions ( attribute_info entry)

§ freeAttributeInfo()

void freeAttributeInfo ( attribute_info entry)
Here is the caller graph for this function:

§ freeAttributeInnerClasses()

void freeAttributeInnerClasses ( attribute_info entry)

§ freeAttributeLineNumberTable()

void freeAttributeLineNumberTable ( attribute_info entry)

§ freeAttributeSourceFile()

void freeAttributeSourceFile ( attribute_info entry)

§ getAttributeByType()

attribute_info* getAttributeByType ( attribute_info attributes,
uint16_t  attributes_length,
enum AttributeType  type 
)
Here is the caller graph for this function:

§ ident()

void ident ( int  level)
Here is the caller graph for this function:

§ printAllAttributes()

void printAllAttributes ( JavaClass jc)
Here is the call graph for this function:
Here is the caller graph for this function:

§ printAttribute()

void printAttribute ( JavaClass jc,
attribute_info entry,
int  identationLevel 
)
Here is the call graph for this function:
Here is the caller graph for this function:

§ printAttributeCode()

void printAttributeCode ( JavaClass jc,
attribute_info entry,
int  identationLevel 
)
Here is the call graph for this function:

§ printAttributeConstantValue()

void printAttributeConstantValue ( JavaClass jc,
attribute_info entry,
int  identationLevel 
)
Here is the call graph for this function:

§ printAttributeDeprecated()

void printAttributeDeprecated ( JavaClass jc,
attribute_info entry,
int  identationLevel 
)
Here is the call graph for this function:

§ printAttributeExceptions()

void printAttributeExceptions ( JavaClass jc,
attribute_info entry,
int  identationLevel 
)
Here is the call graph for this function:

§ printAttributeInnerClasses()

void printAttributeInnerClasses ( JavaClass jc,
attribute_info entry,
int  identationLevel 
)
Here is the call graph for this function:

§ printAttributeLineNumberTable()

void printAttributeLineNumberTable ( JavaClass jc,
attribute_info entry,
int  identationLevel 
)
Here is the call graph for this function:

§ printAttributeSourceFile()

void printAttributeSourceFile ( JavaClass jc,
attribute_info entry,
int  identationLevel 
)
Here is the call graph for this function:

§ readAttribute()

char readAttribute ( JavaClass jc,
attribute_info entry 
)
Here is the call graph for this function:
Here is the caller graph for this function:

§ readAttributeCode()

uint8_t readAttributeCode ( JavaClass jc,
attribute_info entry 
)
Here is the call graph for this function:

§ readAttributeConstantValue()

uint8_t readAttributeConstantValue ( JavaClass jc,
attribute_info entry 
)
Here is the call graph for this function:

§ readAttributeDeprecated()

uint8_t readAttributeDeprecated ( JavaClass jc,
attribute_info entry 
)

§ readAttributeExceptions()

uint8_t readAttributeExceptions ( JavaClass jc,
attribute_info entry 
)
Here is the call graph for this function:

§ readAttributeInnerClasses()

uint8_t readAttributeInnerClasses ( JavaClass jc,
attribute_info entry 
)
Here is the call graph for this function:

§ readAttributeLineNumberTable()

uint8_t readAttributeLineNumberTable ( JavaClass jc,
attribute_info entry 
)
Here is the call graph for this function:

§ readAttributeSourceFile()

uint8_t readAttributeSourceFile ( JavaClass jc,
attribute_info entry 
)
Here is the call graph for this function: