Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Enumerations
object.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OBJVALID(obj)   ((obj)->obj_flags & OBJ_VALID)
 
#define OBJDIRTY(obj)   ((obj)->obj_flags & OBJ_DIRTY)
 
#define OBJLIVE(obj)   ((obj)->obj_flags & OBJ_LIVE)
 
#define OBJNEW(obj)   ((obj)->obj_flags & OBJ_NEW)
 
#define OBJMOD(obj)   ((obj)->obj_flags & OBJ_MOD)
 
#define OBJDEL(obj)   ((obj)->obj_flags & OBJ_DEL)
 
#define OBJSVALID(obj)   ((obj)->obj_flags |= OBJ_VALID)
 
#define OBJSINVALID(obj)   (obj)->obj_flags &= ~OBJ_VALID
 
#define OBJSDIRTY(obj)   ((obj)->obj_flags |= OBJ_DIRTY)
 
#define OBJSCLEAN(obj)   (obj)->obj_flags &= ~OBJ_DIRTY
 
#define OBJSLIVE(obj, type)   (obj)->obj_flags |= OBJ_LIVE ; type ## _obj_flags_propagate(obj,OBJ_LIVE,0)
 
#define OBJSDEAD(obj, type)   (obj)->obj_flags &= ~(OBJ_LIVE | OBJ_NEW | OBJ_MOD) ; type ## _obj_flags_propagate(obj,0,OBJ_DEL)
 
#define OBJSNEW(obj)   ((obj)->obj_flags |= (OBJ_NEW | OBJ_LIVE))
 
#define OBJSMOD(obj)   ((obj)->obj_flags |= (OBJ_MOD | OBJ_LIVE))
 
#define OBJSDEL(obj)   ((obj)->obj_flags |= OBJ_DEL)
 
#define OBJSCLEAR(obj)   ((obj)->obj_flags &= OBJ_LIVE)
 

Enumerations

enum  obj_flags_t {
  OBJ_VALID = 1 << 0, OBJ_DIRTY = 1 << 1, OBJ_LIVE = 1 << 2, OBJ_NEW = 1 << 3,
  OBJ_MOD = 1 << 4, OBJ_DEL = 1 << 5
}
 

Macro Definition Documentation

#define OBJDEL (   obj)    ((obj)->obj_flags & OBJ_DEL)

True if the object is deleted; false otherwise.

Definition at line 96 of file object.h.

#define OBJDIRTY (   obj)    ((obj)->obj_flags & OBJ_DIRTY)

True if the object is dirty; false otherwise.

Definition at line 80 of file object.h.

#define OBJLIVE (   obj)    ((obj)->obj_flags & OBJ_LIVE)

True if the object is live; false otherwise.

Definition at line 84 of file object.h.

#define OBJMOD (   obj)    ((obj)->obj_flags & OBJ_MOD)

True if the object is modified; false otherwise.

Definition at line 92 of file object.h.

#define OBJNEW (   obj)    ((obj)->obj_flags & OBJ_NEW)

True if the object is new; false otherwise.

Definition at line 88 of file object.h.

#define OBJSCLEAN (   obj)    (obj)->obj_flags &= ~OBJ_DIRTY

Mark the object as not dirty (clean). Not propagated to children.

Definition at line 116 of file object.h.

#define OBJSCLEAR (   obj)    ((obj)->obj_flags &= OBJ_LIVE)

Clear the new, mod, and del bits – but not the liveness bit! Not propagated to children.

Definition at line 146 of file object.h.

#define OBJSDEAD (   obj,
  type 
)    (obj)->obj_flags &= ~(OBJ_LIVE | OBJ_NEW | OBJ_MOD) ; type ## _obj_flags_propagate(obj,0,OBJ_DEL)

Mark the object as dead – this also unsets the new and mod bits. This is propagated to children.

Definition at line 127 of file object.h.

#define OBJSDEL (   obj)    ((obj)->obj_flags |= OBJ_DEL)

Mark the object as deleted. Not propagated to children.

Definition at line 141 of file object.h.

#define OBJSDIRTY (   obj)    ((obj)->obj_flags |= OBJ_DIRTY)

Mark the object as dirty. Not propagated to children.

Definition at line 111 of file object.h.

#define OBJSINVALID (   obj)    (obj)->obj_flags &= ~OBJ_VALID

Mark the object as not valid. Not propagated to children.

Definition at line 106 of file object.h.

#define OBJSLIVE (   obj,
  type 
)    (obj)->obj_flags |= OBJ_LIVE ; type ## _obj_flags_propagate(obj,OBJ_LIVE,0)

Mark the object as live. This is propagated to children.

Definition at line 121 of file object.h.

#define OBJSMOD (   obj)    ((obj)->obj_flags |= (OBJ_MOD | OBJ_LIVE))

Mark the object as modified (and live). Not propagated to children.

Definition at line 137 of file object.h.

#define OBJSNEW (   obj)    ((obj)->obj_flags |= (OBJ_NEW | OBJ_LIVE))

Mark the object as new (and live). Not propagated to children.

Definition at line 133 of file object.h.

#define OBJSVALID (   obj)    ((obj)->obj_flags |= OBJ_VALID)

Mark the object as valid. Not propagated to children.

Definition at line 101 of file object.h.

#define OBJVALID (   obj)    ((obj)->obj_flags & OBJ_VALID)

True if the object is valid; false otherwise.

Definition at line 76 of file object.h.

Enumeration Type Documentation

Object liveness tracking. Some of our objects are either "live" or not. "Live" (in the case of the target components, especially) tends to mean the object is a model of a real object that is live in the target program, and thus the model object is hashed (tracked) in the main target object. Objects may also be marked new, updated, and deleted. Many objects and algorithms watching them benefit from having these flags.

Any objects you wish to apply liveness macros to must have a field "obj_flags_t obj_flags", and there must be a function called "<type>_obj_flags_propagate()" function so that some macros can propagate the new flags to the object's owned children. Not all macro setters propagate the values to children; see their documentation below to know which is which! At the moment, only the LIVE flag (set via OBJSLIVE() and OBJSDEAD() macros) is propagated. Anyway, this propagation assumes that the flags for the object have already been set. Thus, the propagation function must set the flags on any child objects, then call their propagation function, and so on.

Enumerator
OBJ_VALID 

Marks the object as validly loaded since the last check or exception.

OBJ_DIRTY 

Marks the object as modified since the last check or exception.

OBJ_LIVE 

Marks the object as live.

OBJ_NEW 

Marks if the object is newly created.

OBJ_MOD 

Marks if the object was modified in the last check or exception.

OBJ_DEL 

The deleted flag exists separately from the live flag because an object may be still live, but deleted — because it is live in the library, but deleted in the target program.

Definition at line 43 of file object.h.