Преглед на файлове

moved syscall debugging function to a new file

master
root преди 5 години
родител
ревизия
2907716321
променени са 2 файла, в които са добавени 1 реда и са изтрити 25 реда
  1. 1
    6
      inc/lc6_helpers.h
  2. 0
    19
      src/lc6_helpers.c

+ 1
- 6
inc/lc6_helpers.h Целия файл

@@ -1,14 +1,9 @@
#ifndef LC6_HELPERS_H
#define LC6_HELPERS_H

// DO NOT include the common.h here.
// because we're overriding functions
// #include "../inc/lc6_common.h"
#include "../inc/lc6_common.h"

void lc6helpers_printhex(unsigned char*, int);
void lc6helpers_banner(unsigned char*);
void* lc6helpers_malloc(size_t, char *, const char*, int);
void* lc6helpers_realloc(void *ptr, size_t, char *, const char*, int);
void lc6helpers_free(void *ptr, char *, const char*, int);

#endif

+ 0
- 19
src/lc6_helpers.c Целия файл

@@ -20,22 +20,3 @@ void lc6helpers_banner(unsigned char *str) {
printf("################################################\n");
printf("\n");
}

#ifdef LC6_DEBUG

void* lc6helpers_malloc(size_t size, char *file, const char *func, int line) {
printf("[%s:%d] %s called malloc(%lu)\n", file, line, func, size);
return malloc(size);
}

void* lc6helpers_realloc(void *ptr, size_t size, char *file, const char *func, int line) {
printf("[%s:%d] %s called realloc(%p, %lu)\n", file, line, func, ptr, size);
return realloc(ptr, size);
}

void lc6helpers_free(void *ptr, char *file, const char *func, int line) {
printf("[%s:%d] %s called free(%p)\n", file, line, func, ptr);
free(ptr);
}

#endif

Loading…
Отказ
Запис