[6] | 1 | /**
|
---|
[28] | 2 | * @file cf_debug.c
|
---|
| 3 | * @author myusgun <myusgun@gmail.com>
|
---|
| 4 | * @version 0.1
|
---|
[6] | 5 | */
|
---|
| 6 | #include "cf_debug.h"
|
---|
| 7 | #include "cf_local.h"
|
---|
[40] | 8 | #include "cf_error.h"
|
---|
[51] | 9 | #include "cf_thread.h"
|
---|
[6] | 10 |
|
---|
| 11 | #include <stdlib.h>
|
---|
| 12 | #include <ctype.h>
|
---|
| 13 | #include <stdarg.h>
|
---|
[9] | 14 | #include <string.h>
|
---|
[6] | 15 |
|
---|
[50] | 16 | #if defined(_WIN32) || defined(_WIN64)
|
---|
[7] | 17 | # include <io.h>
|
---|
[6] | 18 | #else
|
---|
| 19 | # include <unistd.h>
|
---|
| 20 | #endif
|
---|
| 21 |
|
---|
| 22 | #define IS_READABLE_CHAR(__c) (' ' <= __c && __c <= '~')
|
---|
| 23 |
|
---|
[55] | 24 | #define ASSERT_CTX(__ctx) \
|
---|
[6] | 25 | if (__ctx == NULL) \
|
---|
| 26 | return CF_ERROR_DEBUG_INVALID_CTX
|
---|
[10] | 27 |
|
---|
[51] | 28 | /**
|
---|
| 29 | * 디버그 컨텍스트
|
---|
| 30 | *
|
---|
| 31 | * @remark change from public to private
|
---|
| 32 | */
|
---|
| 33 | typedef void * CF_Debug_Ctx;
|
---|
| 34 |
|
---|
[53] | 35 | /* *
|
---|
[51] | 36 | * 콜스택 데이터
|
---|
| 37 | *
|
---|
| 38 | * @remark change from public to private
|
---|
| 39 | */
|
---|
| 40 | typedef struct cf_debug_callStack {
|
---|
[53] | 41 | char file[NAME_LENGTH + 1]; /* *< 파일 이름 */
|
---|
| 42 | char function[NAME_LENGTH + 1]; /* *< 함수 이름 */
|
---|
| 43 | int line; /* *< 라인 넘버 */
|
---|
[51] | 44 | } CF_Debug_CallStack;
|
---|
| 45 |
|
---|
[6] | 46 | typedef struct __cf_debug_callstack__
|
---|
| 47 | {
|
---|
[9] | 48 | char file[NAME_LENGTH + 1];
|
---|
[6] | 49 | char func[NAME_LENGTH + 1];
|
---|
| 50 | int line;
|
---|
| 51 |
|
---|
[51] | 52 | int frameIndex;
|
---|
| 53 |
|
---|
[6] | 54 | struct __cf_debug_callstack__ * caller;
|
---|
| 55 | } S_CF_DEBUG_CALLSTACK, CF_DEBUG_CALLSTACK;
|
---|
| 56 |
|
---|
[10] | 57 | typedef struct __cf_debug_ctx__
|
---|
[6] | 58 | {
|
---|
[51] | 59 | char file[NAME_LENGTH + 1];
|
---|
| 60 | char func[NAME_LENGTH + 1];
|
---|
| 61 | int line;
|
---|
[6] | 62 |
|
---|
[51] | 63 | CF_Mutex mutex;
|
---|
[6] | 64 |
|
---|
| 65 | CF_DEBUG_CALLSTACK callstack;
|
---|
| 66 | } S_CF_DEBUG_CTX, CF_DEBUG_CTX;
|
---|
| 67 |
|
---|
[51] | 68 | CF_Debug_Ctx gDebugSingleCtx = NULL;
|
---|
| 69 |
|
---|
[23] | 70 | static int
|
---|
[26] | 71 | CF_Debug_Local_UpdateCtx (CF_Debug_Ctx ctx,
|
---|
| 72 | const char * file,
|
---|
| 73 | const char * func,
|
---|
| 74 | const int line)
|
---|
| 75 | {
|
---|
| 76 | CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx;
|
---|
| 77 |
|
---|
[55] | 78 | ASSERT_CTX (ctx);
|
---|
[26] | 79 |
|
---|
| 80 | strncpy (context->file, file, strlen (file));
|
---|
| 81 | strncpy (context->func, func, strlen (func));
|
---|
| 82 | context->line = line;
|
---|
| 83 |
|
---|
| 84 | return CF_OK;
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 | static int
|
---|
[16] | 88 | CF_Debug_Local_Print (FILE * fp,
|
---|
| 89 | const char * file,
|
---|
| 90 | const char * func,
|
---|
| 91 | const int line,
|
---|
[12] | 92 | const char * fmt,
|
---|
| 93 | va_list valist)
|
---|
[6] | 94 | {
|
---|
[16] | 95 | fprintf (fp, "[DEBUG][%s:%d][%s] ", file, line, func);
|
---|
| 96 | vfprintf (fp, fmt, valist);
|
---|
[14] | 97 |
|
---|
| 98 | return CF_OK;
|
---|
[6] | 99 | }
|
---|
| 100 |
|
---|
[23] | 101 | static int
|
---|
[16] | 102 | CF_Debug_Local_PrintBin (FILE * fp,
|
---|
| 103 | const char * file,
|
---|
| 104 | const char * func,
|
---|
| 105 | const int line,
|
---|
| 106 | const unsigned char * bin,
|
---|
| 107 | const int len)
|
---|
| 108 | {
|
---|
| 109 | int i, j;
|
---|
| 110 |
|
---|
| 111 | for (i = 0 ; i < len ; i += 16)
|
---|
| 112 | {
|
---|
| 113 | fprintf (fp, "[DEBUG][%s:%d][%s] ", file, line, func);
|
---|
| 114 | fprintf (fp, "%06x : ", i);
|
---|
| 115 |
|
---|
| 116 | for (j = 0 ; j < 16 ; j++)
|
---|
| 117 | {
|
---|
| 118 | if (i+j < len)
|
---|
| 119 | fprintf (fp, "%02x ", bin[i+j]);
|
---|
| 120 | else
|
---|
| 121 | fprintf (fp, " ");
|
---|
| 122 | }
|
---|
| 123 | fprintf (fp, " ");
|
---|
| 124 |
|
---|
| 125 | for (j = 0 ; j < 16 ; j++)
|
---|
| 126 | {
|
---|
| 127 | if (i+j < len)
|
---|
| 128 | fprintf (fp, "%c", IS_READABLE_CHAR(bin[i+j]) ? bin[i+j] : '.');
|
---|
| 129 | }
|
---|
| 130 | fprintf (fp, "\n");
|
---|
| 131 | }
|
---|
| 132 |
|
---|
| 133 | return CF_OK;
|
---|
| 134 | }
|
---|
| 135 |
|
---|
[35] | 136 | /**
|
---|
| 137 | * 디버그 메시지를 지정된 파일 포인터로 출력
|
---|
| 138 | *
|
---|
| 139 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 140 | *
|
---|
| 141 | * @param fp 파일 포인터. 표준출력(stdout) 및 표준오류(stderr) 사용 가능
|
---|
| 142 | * @param file 파일 경로
|
---|
| 143 | * @param func 함수 이름
|
---|
| 144 | * @param line 라인 넘버
|
---|
| 145 | * @param fmt 포맷 스트링
|
---|
| 146 | * @param ... 가변 인자
|
---|
| 147 | *
|
---|
| 148 | * @see CF_DEBUG_PRINT
|
---|
| 149 | */
|
---|
[6] | 150 | int
|
---|
[16] | 151 | CF_Debug_Print (FILE * fp,
|
---|
| 152 | const char * file,
|
---|
| 153 | const char * func,
|
---|
| 154 | const int line,
|
---|
| 155 | const char * fmt, ...)
|
---|
| 156 | {
|
---|
| 157 | va_list valist;
|
---|
| 158 |
|
---|
| 159 | va_start (valist, fmt);
|
---|
| 160 | CF_Debug_Local_Print (fp, file, func, line, fmt, valist);
|
---|
| 161 | va_end (valist);
|
---|
| 162 |
|
---|
| 163 | return CF_OK;
|
---|
| 164 | }
|
---|
| 165 |
|
---|
[35] | 166 | /**
|
---|
| 167 | * 바이너리 데이터를 디버그 메시지와 함께 지정된 파일 포인터로 출력
|
---|
| 168 | *
|
---|
| 169 | * @return CF_OK 반환
|
---|
| 170 | *
|
---|
| 171 | * @param fp 파일 포인터. 표준출력(stdout) 및 표준오류(stderr) 사용 가능
|
---|
| 172 | * @param file 파일 경로
|
---|
| 173 | * @param func 함수 이름
|
---|
| 174 | * @param line 라인 넘버
|
---|
| 175 | * @param bin 라인 넘버
|
---|
| 176 | * @param len 바이너리 길이
|
---|
| 177 | * @param fmt 포맷 스트링
|
---|
| 178 | * @param ... 가변 인자
|
---|
| 179 | *
|
---|
| 180 | * @see CF_DEBUG_PRINT_BIN
|
---|
| 181 | */
|
---|
[16] | 182 | int
|
---|
| 183 | CF_Debug_PrintBin (FILE * fp,
|
---|
| 184 | const char * file,
|
---|
| 185 | const char * func,
|
---|
| 186 | const int line,
|
---|
| 187 | const unsigned char * bin,
|
---|
| 188 | const int len,
|
---|
| 189 | const char * fmt, ...)
|
---|
| 190 | {
|
---|
| 191 | va_list valist;
|
---|
| 192 |
|
---|
| 193 | va_start (valist, fmt);
|
---|
| 194 | CF_Debug_Local_Print (fp, file, func, line, fmt, valist);
|
---|
| 195 | va_end (valist);
|
---|
| 196 |
|
---|
| 197 | CF_Debug_Local_PrintBin (fp, file, func, line, bin, len);
|
---|
| 198 |
|
---|
| 199 | return CF_OK;
|
---|
| 200 | }
|
---|
| 201 |
|
---|
[35] | 202 | /**
|
---|
| 203 | * 컨텍스트에 콜스택 푸시
|
---|
| 204 | *
|
---|
| 205 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 206 | *
|
---|
| 207 | * @param ctx 디버그 컨텍스트
|
---|
| 208 | * @param file 파일 경로
|
---|
| 209 | * @param func 함수 이름
|
---|
| 210 | * @param line 라인 넘버
|
---|
| 211 | */
|
---|
[51] | 212 | static int
|
---|
[6] | 213 | CF_Debug_CallStackPush (CF_Debug_Ctx ctx,
|
---|
[9] | 214 | const char * file,
|
---|
[6] | 215 | const char * func,
|
---|
| 216 | const int line)
|
---|
| 217 | {
|
---|
| 218 | CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx;
|
---|
| 219 | CF_DEBUG_CALLSTACK * push = NULL;
|
---|
| 220 |
|
---|
[55] | 221 | ASSERT_CTX (ctx);
|
---|
[6] | 222 |
|
---|
| 223 | push = (CF_DEBUG_CALLSTACK *) calloc (sizeof (CF_DEBUG_CALLSTACK), 1);
|
---|
| 224 | if (push == NULL)
|
---|
| 225 | return CF_ERROR_DEBUG_PUSH_CALLSTACK;
|
---|
| 226 |
|
---|
[9] | 227 | /* push to callstack */
|
---|
| 228 | sprintf (push->file, "%s", file);
|
---|
[6] | 229 | sprintf (push->func, "%s", func);
|
---|
| 230 | push->line = line;
|
---|
| 231 | push->caller = context->callstack.caller;
|
---|
[52] | 232 | push->frameIndex = push->caller == NULL
|
---|
| 233 | ? 0
|
---|
| 234 | : push->caller->frameIndex + 1;
|
---|
[6] | 235 | context->callstack.caller = push;
|
---|
| 236 |
|
---|
[26] | 237 | CF_Debug_Local_UpdateCtx (ctx, file, func, line);
|
---|
[9] | 238 |
|
---|
[6] | 239 | return CF_OK;
|
---|
| 240 | }
|
---|
| 241 |
|
---|
[35] | 242 | /**
|
---|
[51] | 243 | * 컨텍스트에서 콜스택에서 TOP을 제거하지 않고 가져옴
|
---|
[35] | 244 | *
|
---|
| 245 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 246 | *
|
---|
| 247 | * @param ctx 디버그 컨텍스트
|
---|
| 248 | * @param callstack 콜스택 정보를 가져올 콜스택 데이터 구조체 포인터
|
---|
| 249 | *
|
---|
[51] | 250 | * @see CF_Debug_CallStack
|
---|
[35] | 251 | */
|
---|
[51] | 252 | static int
|
---|
| 253 | CF_Debug_CallStackPeek (CF_Debug_Ctx ctx,
|
---|
| 254 | CF_Debug_CallStack * callstack)
|
---|
[6] | 255 | {
|
---|
| 256 | CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx;
|
---|
| 257 | CF_DEBUG_CALLSTACK * pop = NULL;
|
---|
| 258 |
|
---|
| 259 | pop = context->callstack.caller;
|
---|
| 260 | if (pop == NULL)
|
---|
[51] | 261 | return CF_ERROR_DEBUG_PEEK_CALLSTACK;
|
---|
[6] | 262 |
|
---|
[9] | 263 | if (callstack != NULL)
|
---|
| 264 | {
|
---|
[14] | 265 | sprintf (callstack->file , "%s", pop->file);
|
---|
[9] | 266 | sprintf (callstack->function, "%s", pop->func);
|
---|
| 267 | callstack->line = pop->line;
|
---|
| 268 | }
|
---|
[6] | 269 |
|
---|
[51] | 270 | return CF_OK;
|
---|
| 271 | }
|
---|
| 272 |
|
---|
| 273 | /**
|
---|
| 274 | * 컨텍스트에서 콜스택 팝
|
---|
| 275 | *
|
---|
| 276 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 277 | *
|
---|
| 278 | * @param ctx 디버그 컨텍스트
|
---|
| 279 | * @param callstack 콜스택 정보를 가져올 콜스택 데이터 구조체 포인터
|
---|
| 280 | *
|
---|
| 281 | * @see CF_Debug_CallStack
|
---|
| 282 | */
|
---|
| 283 | static int
|
---|
| 284 | CF_Debug_CallStackPop (CF_Debug_Ctx ctx,
|
---|
| 285 | CF_Debug_CallStack * callstack)
|
---|
| 286 | {
|
---|
| 287 | CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx;
|
---|
| 288 | CF_DEBUG_CALLSTACK * pop = NULL;
|
---|
| 289 |
|
---|
[55] | 290 | ASSERT_CTX (ctx);
|
---|
[51] | 291 |
|
---|
| 292 | pop = context->callstack.caller;
|
---|
| 293 | if (pop == NULL)
|
---|
| 294 | return CF_ERROR_DEBUG_POP_CALLSTACK;
|
---|
| 295 |
|
---|
| 296 | if (CF_Debug_CallStackPeek (ctx, callstack) < 0)
|
---|
| 297 | return CF_ERROR_DEBUG_PEEK_CALLSTACK;
|
---|
| 298 |
|
---|
[9] | 299 | memset (context->file, 0x00, sizeof (context->file));
|
---|
| 300 | memset (context->func, 0x00, sizeof (context->func));
|
---|
| 301 | context->line = 0;
|
---|
| 302 |
|
---|
| 303 | /* restore current context */
|
---|
| 304 | if (pop->caller != NULL)
|
---|
| 305 | {
|
---|
[26] | 306 | CF_Debug_Local_UpdateCtx (ctx,
|
---|
| 307 | pop->caller->file,
|
---|
| 308 | pop->caller->func,
|
---|
| 309 | pop->caller->line);
|
---|
[9] | 310 | }
|
---|
| 311 |
|
---|
[14] | 312 | context->callstack.caller = pop->caller;
|
---|
[6] | 313 | free (pop);
|
---|
| 314 |
|
---|
| 315 | return CF_OK;
|
---|
| 316 | }
|
---|
[51] | 317 |
|
---|
| 318 | /**
|
---|
[62] | 319 | * 디버그 컨텍스트를 해제
|
---|
[51] | 320 | *
|
---|
| 321 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 322 | *
|
---|
[62] | 323 | * @param ctx 디버그 컨텍스트
|
---|
| 324 | *
|
---|
| 325 | * @see CF_DEBUG_DESTROY_CTX
|
---|
| 326 | */
|
---|
| 327 | static int
|
---|
| 328 | CF_Debug_DestroyCtx (CF_Debug_Ctx ctx)
|
---|
| 329 | {
|
---|
| 330 | CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx;
|
---|
| 331 |
|
---|
| 332 | ASSERT_CTX (ctx);
|
---|
| 333 |
|
---|
| 334 | while (context->callstack.caller)
|
---|
| 335 | CF_Debug_CallStackPop (ctx, NULL);
|
---|
| 336 |
|
---|
| 337 | if (context->mutex)
|
---|
| 338 | CF_Mutex_Destory (&context->mutex);
|
---|
| 339 |
|
---|
| 340 | free (context);
|
---|
| 341 |
|
---|
| 342 | return CF_OK;
|
---|
| 343 | }
|
---|
| 344 |
|
---|
| 345 | /**
|
---|
| 346 | * 디버그 컨텍스트를 생성
|
---|
| 347 | *
|
---|
| 348 | * @return 성공 시, CF_Debug_Ctx 형태의 컨텍스트; 실패 시, NULL
|
---|
| 349 | * @see CF_DEBUG_CREATE_CTX
|
---|
| 350 | */
|
---|
| 351 | static int
|
---|
| 352 | CF_Debug_CreateCtx (CF_Debug_Ctx * ctx)
|
---|
| 353 | {
|
---|
| 354 | int result = 0;
|
---|
| 355 | CF_DEBUG_CTX * context = NULL;
|
---|
| 356 |
|
---|
| 357 | TRY
|
---|
| 358 | {
|
---|
| 359 | context = (CF_DEBUG_CTX *) calloc (sizeof (CF_DEBUG_CTX), 1);
|
---|
| 360 | if (context == NULL)
|
---|
| 361 | {
|
---|
| 362 | result = CF_ERROR_DEBUG_ALLOCATE_CTX;
|
---|
| 363 | TRY_BREAK;
|
---|
| 364 | }
|
---|
| 365 |
|
---|
| 366 | result = CF_Mutex_Create (&context->mutex);
|
---|
| 367 | if (result < 0)
|
---|
| 368 | {
|
---|
| 369 | TRY_BREAK;
|
---|
| 370 | }
|
---|
| 371 |
|
---|
| 372 | *ctx = (CF_Debug_Ctx) context;
|
---|
| 373 | }
|
---|
| 374 | CATCH_IF (result < 0)
|
---|
| 375 | {
|
---|
| 376 | CF_Debug_DestroyCtx (context);
|
---|
| 377 | }
|
---|
| 378 |
|
---|
| 379 | return CF_OK;
|
---|
| 380 | }
|
---|
| 381 |
|
---|
| 382 | /**
|
---|
| 383 | * 콜스택 매니저 초기화 (글로벌 컨텍스트)
|
---|
| 384 | *
|
---|
| 385 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 386 | *
|
---|
| 387 | * @see CF_Debug_Finalize
|
---|
| 388 | */
|
---|
| 389 | int
|
---|
| 390 | CF_Debug_Initialize (void)
|
---|
| 391 | {
|
---|
| 392 | int result = 0;
|
---|
| 393 |
|
---|
| 394 | if (gDebugSingleCtx == NULL)
|
---|
| 395 | {
|
---|
| 396 | result = CF_Debug_CreateCtx (&gDebugSingleCtx);
|
---|
| 397 | if (result != CF_OK)
|
---|
| 398 | return result;
|
---|
| 399 | }
|
---|
| 400 |
|
---|
| 401 | return CF_OK;
|
---|
| 402 | }
|
---|
| 403 |
|
---|
| 404 | /**
|
---|
| 405 | * 콜스택 매니저 해제 (글로벌 컨텍스트)
|
---|
| 406 | *
|
---|
| 407 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 408 | */
|
---|
| 409 | int
|
---|
| 410 | CF_Debug_Finalize (void)
|
---|
| 411 | {
|
---|
| 412 | return CF_Debug_DestroyCtx (gDebugSingleCtx);
|
---|
| 413 | }
|
---|
| 414 |
|
---|
| 415 | /**
|
---|
| 416 | * 현재 콜스택을 출력 (글로벌 컨텍스트)
|
---|
| 417 | *
|
---|
| 418 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 419 | *
|
---|
[51] | 420 | * @param fp 출력 할 파일 포인터
|
---|
| 421 | */
|
---|
| 422 | int
|
---|
| 423 | CF_Debug_PrintCallStack (FILE * fp)
|
---|
| 424 | {
|
---|
| 425 | int iter = 0;
|
---|
| 426 |
|
---|
| 427 | CF_DEBUG_CTX * ctx = gDebugSingleCtx;
|
---|
| 428 | CF_DEBUG_CALLSTACK * callstack = NULL;
|
---|
| 429 |
|
---|
| 430 | if (ctx == NULL)
|
---|
| 431 | return CF_ERROR_DEBUG_INVALID_CTX;
|
---|
| 432 |
|
---|
[53] | 433 | for ( callstack = ctx->callstack.caller
|
---|
| 434 | ; callstack
|
---|
| 435 | ; callstack = callstack->caller)
|
---|
[51] | 436 | {
|
---|
[52] | 437 | fprintf (fp, "#%-4d %s <%s:%d>\n",
|
---|
| 438 | iter++,
|
---|
[51] | 439 | callstack->func,
|
---|
| 440 | callstack->file,
|
---|
| 441 | callstack->line);
|
---|
[52] | 442 | }
|
---|
[51] | 443 |
|
---|
| 444 | return CF_OK;
|
---|
| 445 | }
|
---|
| 446 |
|
---|
| 447 | /**
|
---|
[62] | 448 | * 함수 진입을 명시 (글로벌 컨텍스트)
|
---|
[51] | 449 | *
|
---|
| 450 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 451 | *
|
---|
| 452 | * @param file 파일 경로
|
---|
| 453 | * @param func 함수 이름
|
---|
| 454 | * @param line 라인 넘버
|
---|
| 455 | *
|
---|
| 456 | * @see CF_Debug_LeaveFunction
|
---|
| 457 | */
|
---|
| 458 | int
|
---|
| 459 | CF_Debug_EnterFunction (const char * file,
|
---|
| 460 | const char * func,
|
---|
| 461 | const int line)
|
---|
| 462 | {
|
---|
[62] | 463 | CF_DEBUG_CTX * ctx = (CF_DEBUG_CTX *)gDebugSingleCtx;
|
---|
[51] | 464 |
|
---|
[62] | 465 | ASSERT_CTX (ctx);
|
---|
[51] | 466 |
|
---|
| 467 | CF_Mutex_Lock (&ctx->mutex);
|
---|
| 468 | CF_Debug_CallStackPush (gDebugSingleCtx, file, func, line);
|
---|
| 469 | CF_Mutex_Unlock (&ctx->mutex);
|
---|
| 470 |
|
---|
| 471 | return CF_OK;
|
---|
| 472 | }
|
---|
| 473 |
|
---|
| 474 | /**
|
---|
[62] | 475 | * 함수 종료를 명시 (글로벌 컨텍스트)
|
---|
[51] | 476 | *
|
---|
| 477 | * @return 성공 시, CF_OK; 실패 시, 오류 코드
|
---|
| 478 | *
|
---|
| 479 | * @see CF_Debug_EnterFunction
|
---|
| 480 | */
|
---|
| 481 | int
|
---|
| 482 | CF_Debug_LeaveFunction (void)
|
---|
| 483 | {
|
---|
| 484 | CF_DEBUG_CTX * ctx = (CF_DEBUG_CTX *)gDebugSingleCtx;
|
---|
| 485 |
|
---|
[62] | 486 | ASSERT_CTX (ctx);
|
---|
[51] | 487 |
|
---|
| 488 | CF_Mutex_Lock (&ctx->mutex);
|
---|
| 489 | CF_Debug_CallStackPop (gDebugSingleCtx, NULL);
|
---|
| 490 | CF_Mutex_Unlock (&ctx->mutex);
|
---|
| 491 |
|
---|
| 492 | return CF_OK;
|
---|
| 493 | }
|
---|