gwenhywfar 5.10.1
Functions | Variables
debug.c File Reference
#include "debug_p.h"
#include <stdarg.h>
#include <assert.h>
#include <stdio.h>
#include <gwenhywfar/misc.h>
Include dependency graph for debug.c:

Go to the source code of this file.

Functions

uint32_t GWEN_Debug_PrintDec (char *buffer, uint32_t size, uint32_t num, int leadingZero, uint32_t length)
 
uint32_t GWEN_Debug_PrintHex (char *buffer, uint32_t size, uint32_t num, int leadingZero, int up, uint32_t length)
 
uint32_t GWEN_Debug_Snprintf (char *buffer, uint32_t size, const char *fmt,...)
 
void GWEN_MemoryDebug__DumpObject (GWEN_MEMORY_DEBUG_OBJECT *o, uint32_t mode)
 
GWEN_MEMORY_DEBUG_OBJECTGWEN_MemoryDebug__FindObject (const char *name)
 
void GWEN_MemoryDebug_CleanUp (void)
 
void GWEN_MemoryDebug_Decrement (const char *name, const char *wFile, int wLine)
 
void GWEN_MemoryDebug_Dump (uint32_t mode)
 
void GWEN_MemoryDebug_DumpObject (const char *name, uint32_t mode)
 
long int GWEN_MemoryDebug_GetObjectCount (const char *name)
 
void GWEN_MemoryDebug_Increment (const char *name, const char *wFile, int wLine, int attach)
 
void GWEN_MemoryDebugEntry_free (GWEN_MEMORY_DEBUG_ENTRY *e)
 
GWEN_MEMORY_DEBUG_ENTRY * GWEN_MemoryDebugEntry_new (GWEN_MEMORY_DEBUG_ENTRY_TYPE t, const char *wFile, int wLine)
 
void GWEN_MemoryDebugObject_free (GWEN_MEMORY_DEBUG_OBJECT *o)
 
GWEN_MEMORY_DEBUG_OBJECTGWEN_MemoryDebugObject_new (const char *name)
 

Variables

static GWEN_MEMORY_DEBUG_OBJECTgwen_debug__memobjects =0
 

Function Documentation

◆ GWEN_Debug_PrintDec()

uint32_t GWEN_Debug_PrintDec ( char *  buffer,
uint32_t  size,
uint32_t  num,
int  leadingZero,
uint32_t  length 
)

Definition at line 49 of file debug.c.

Referenced by GWEN_Debug_Snprintf().

Here is the caller graph for this function:

◆ GWEN_Debug_PrintHex()

uint32_t GWEN_Debug_PrintHex ( char *  buffer,
uint32_t  size,
uint32_t  num,
int  leadingZero,
int  up,
uint32_t  length 
)

Definition at line 113 of file debug.c.

Referenced by GWEN_Debug_Snprintf().

Here is the caller graph for this function:

◆ GWEN_Debug_Snprintf()

uint32_t GWEN_Debug_Snprintf ( char *  buffer,
uint32_t  size,
const char *  fmt,
  ... 
)

Definition at line 186 of file debug.c.

References fmt, GWEN_Debug_PrintDec(), and GWEN_Debug_PrintHex().

Here is the call graph for this function:

◆ GWEN_MemoryDebug__DumpObject()

void GWEN_MemoryDebug__DumpObject ( GWEN_MEMORY_DEBUG_OBJECT o,
uint32_t  mode 
)

Definition at line 545 of file debug.c.

References DBG_ERROR, GWEN_MEMORY_DEBUG_MODE_DETAILED, and GWEN_MEMORY_DEBUG_MODE_SHORT.

Referenced by GWEN_MemoryDebug_Dump(), and GWEN_MemoryDebug_DumpObject().

Here is the caller graph for this function:

◆ GWEN_MemoryDebug__FindObject()

GWEN_MEMORY_DEBUG_OBJECT * GWEN_MemoryDebug__FindObject ( const char *  name)

Definition at line 460 of file debug.c.

References DBG_ERROR, gwen_debug__memobjects, and GWEN_LOGDOMAIN.

Referenced by GWEN_MemoryDebug_Decrement(), GWEN_MemoryDebug_DumpObject(), GWEN_MemoryDebug_GetObjectCount(), and GWEN_MemoryDebug_Increment().

Here is the caller graph for this function:

◆ GWEN_MemoryDebug_CleanUp()

void GWEN_MemoryDebug_CleanUp ( void  )

Definition at line 632 of file debug.c.

References gwen_debug__memobjects, and GWEN_MemoryDebugObject_free().

Here is the call graph for this function:

◆ GWEN_MemoryDebug_Decrement()

void GWEN_MemoryDebug_Decrement ( const char *  name,
const char *  wFile,
int  wLine 
)

Definition at line 513 of file debug.c.

References DBG_ERROR, gwen_debug__memobjects, GWEN_LIST_ADD, GWEN_LOGDOMAIN, GWEN_MemoryDebug__FindObject(), GWEN_MemoryDebugEntry_new(), and GWEN_MemoryDebugObject_new().

Here is the call graph for this function:

◆ GWEN_MemoryDebug_Dump()

void GWEN_MemoryDebug_Dump ( uint32_t  mode)

Definition at line 616 of file debug.c.

References DBG_ERROR, gwen_debug__memobjects, and GWEN_MemoryDebug__DumpObject().

Here is the call graph for this function:

◆ GWEN_MemoryDebug_DumpObject()

void GWEN_MemoryDebug_DumpObject ( const char *  name,
uint32_t  mode 
)

Definition at line 584 of file debug.c.

References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_MemoryDebug__DumpObject(), and GWEN_MemoryDebug__FindObject().

Here is the call graph for this function:

◆ GWEN_MemoryDebug_GetObjectCount()

long int GWEN_MemoryDebug_GetObjectCount ( const char *  name)

Definition at line 600 of file debug.c.

References DBG_ERROR, GWEN_LOGDOMAIN, and GWEN_MemoryDebug__FindObject().

Here is the call graph for this function:

◆ GWEN_MemoryDebug_Increment()

void GWEN_MemoryDebug_Increment ( const char *  name,
const char *  wFile,
int  wLine,
int  attach 
)

Definition at line 481 of file debug.c.

References gwen_debug__memobjects, GWEN_LIST_ADD, GWEN_MemoryDebug__FindObject(), GWEN_MemoryDebugEntry_new(), and GWEN_MemoryDebugObject_new().

Here is the call graph for this function:

◆ GWEN_MemoryDebugEntry_free()

void GWEN_MemoryDebugEntry_free ( GWEN_MEMORY_DEBUG_ENTRY *  e)

Definition at line 417 of file debug.c.

References GWEN_FREE_OBJECT.

Referenced by GWEN_MemoryDebugObject_free().

Here is the caller graph for this function:

◆ GWEN_MemoryDebugEntry_new()

GWEN_MEMORY_DEBUG_ENTRY * GWEN_MemoryDebugEntry_new ( GWEN_MEMORY_DEBUG_ENTRY_TYPE  t,
const char *  wFile,
int  wLine 
)

Definition at line 400 of file debug.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_MemoryDebug_Decrement(), and GWEN_MemoryDebug_Increment().

Here is the caller graph for this function:

◆ GWEN_MemoryDebugObject_free()

void GWEN_MemoryDebugObject_free ( GWEN_MEMORY_DEBUG_OBJECT o)

Definition at line 440 of file debug.c.

References GWEN_FREE_OBJECT, and GWEN_MemoryDebugEntry_free().

Referenced by GWEN_MemoryDebug_CleanUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_MemoryDebugObject_new()

GWEN_MEMORY_DEBUG_OBJECT * GWEN_MemoryDebugObject_new ( const char *  name)

Definition at line 428 of file debug.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_MemoryDebug_Decrement(), and GWEN_MemoryDebug_Increment().

Here is the caller graph for this function:

Variable Documentation

◆ gwen_debug__memobjects

GWEN_MEMORY_DEBUG_OBJECT* gwen_debug__memobjects =0
static