mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-19 04:12:46 +00:00
Update sdb, simplify some makefiles
This commit is contained in:
parent
209ac5696c
commit
dc8e37f420
2
libr/cons/t/Makefile
Normal file
2
libr/cons/t/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
all:
|
||||
gcc test-rgb.c -I../../include -lr_cons -L../../libr/cons -L../../libr/util -lr_util
|
@ -111,12 +111,12 @@ static void cmd_debug_pid(RCore *core, const char *input) {
|
||||
} else eprintf ("cmd_debug_pid: Invalid arguments (%s)\n", input);
|
||||
break;
|
||||
case 'n':
|
||||
eprintf ("TODO: debug_fork: %d\n", r_debug_fork (core->dbg));
|
||||
eprintf ("TODO: debug_fork: %d\n", r_debug_child_fork (core->dbg));
|
||||
break;
|
||||
case 't':
|
||||
switch (input[2]) {
|
||||
case 'n':
|
||||
eprintf ("TODO: debug_clone: %d\n", r_debug_clone (core->dbg));
|
||||
eprintf ("TODO: debug_clone: %d\n", r_debug_child_clone (core->dbg));
|
||||
break;
|
||||
case '=':
|
||||
case ' ':
|
||||
|
@ -13,9 +13,6 @@ SDB_OBJS+=buffer.o
|
||||
SDB_OBJS+=cdb.o
|
||||
SDB_OBJS+=cdb_make.o
|
||||
SDB_OBJS+=ht.o
|
||||
SDB_OBJS+=json/js0n.o
|
||||
SDB_OBJS+=json/json.o
|
||||
SDB_OBJS+=json/rangstr.o
|
||||
SDB_OBJS+=json.o
|
||||
SDB_OBJS+=lock.o
|
||||
SDB_OBJS+=ls.o
|
||||
|
@ -481,13 +481,13 @@ R_API RList *r_debug_frames (RDebug *dbg, ut64 at) {
|
||||
}
|
||||
|
||||
/* TODO: Implement fork and clone */
|
||||
R_API int r_debug_fork (RDebug *dbg) {
|
||||
R_API int r_debug_child_fork (RDebug *dbg) {
|
||||
//if (dbg && dbg->h && dbg->h->frames)
|
||||
//return dbg->h->frames (dbg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
R_API int r_debug_clone (RDebug *dbg) {
|
||||
R_API int r_debug_child_clone (RDebug *dbg) {
|
||||
//if (dbg && dbg->h && dbg->h->frames)
|
||||
//return dbg->h->frames (dbg);
|
||||
return 0;
|
||||
|
@ -9,7 +9,7 @@ LINK=-lm
|
||||
endif
|
||||
endif
|
||||
|
||||
OBJS=state.o md5c.o crc16.o crc32.o sha1.o hash.o
|
||||
OBJS=state.o md5c.o crc16.o crc32.o sha1.o hash.o md4.o
|
||||
OBJS+=hamdist.o entropy.o sha2.o calc.o xxhash.o adler32.o
|
||||
|
||||
include ../rules.mk
|
||||
|
@ -53,7 +53,6 @@ static void mdfour64(ut32 * M, ut32 * A, ut32 *B, ut32 * C, ut32 *D) {
|
||||
ut32 AA, BB, CC, DD;
|
||||
ut32 X[16];
|
||||
|
||||
|
||||
for (j = 0; j < 16; j++)
|
||||
X[j] = M[j];
|
||||
|
||||
@ -143,7 +142,7 @@ static void copy4(ut8 *out, ut32 x) {
|
||||
|
||||
/* produce a md4 message digest from data of length n bytes */
|
||||
// XXX : rename as a static method
|
||||
void mdfour(ut8 *out, const ut8 *in, int n) {
|
||||
R_API void mdfour(ut8 *out, const ut8 *in, int n) {
|
||||
unsigned char buf[128];
|
||||
ut32 M[16];
|
||||
ut32 b = n * 8;
|
||||
|
@ -1,11 +1,11 @@
|
||||
/* radare - LGPL - Copyright 2009-2011 pancake<nopcode.org> */
|
||||
/* radare - LGPL - Copyright 2009-2013 pancake<nopcode.org> */
|
||||
|
||||
// TODO: use ptr tablez here
|
||||
#include "r_hash.h"
|
||||
#include "md5.h"
|
||||
#include "sha1.h"
|
||||
#include "sha2.h"
|
||||
#include "md4.c" // included directly
|
||||
R_API void mdfour(ut8 *out, const ut8 *in, int n);
|
||||
|
||||
#define CHKFLAG(f,x) if (f==0||f&x)
|
||||
|
||||
|
@ -308,8 +308,8 @@ R_API RDebugTracepoint *r_debug_trace_add (RDebug *dbg, ut64 addr, int size);
|
||||
R_API RDebugTrace *r_debug_trace_new ();
|
||||
R_API void r_debug_trace_free (RDebug *dbg);
|
||||
R_API int r_debug_trace_tag (RDebug *dbg, int tag);
|
||||
R_API int r_debug_fork (RDebug *dbg);
|
||||
R_API int r_debug_clone (RDebug *dbg);
|
||||
R_API int r_debug_child_fork (RDebug *dbg);
|
||||
R_API int r_debug_child_clone (RDebug *dbg);
|
||||
|
||||
/* plugin pointers */
|
||||
extern RDebugPlugin r_debug_plugin_native;
|
||||
|
@ -34,7 +34,7 @@ R_API const char *r_constr_append (RConstr *c, const char *str) {
|
||||
}
|
||||
|
||||
R_API const char *r_constr_add (RConstr *c, const char *str) {
|
||||
char *p = r_constr_get (c, str);
|
||||
char *p = (char *)r_constr_get (c, str);
|
||||
return p? p: r_constr_append (c, str);
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,12 @@
|
||||
/* radare - LGPL - Copyright 2013 - pancake */
|
||||
|
||||
#include <iconv.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
char *r_str_iconv (const char *str, int *len) {
|
||||
iconv_t cd;
|
||||
char *inbuf = str;
|
||||
char *inbuf = (char*)str; // XXX dangerous cast
|
||||
size_t inbytesleft = strlen (str);
|
||||
char data[1024];
|
||||
char *outbuf = (char*)&data;
|
||||
|
@ -85,7 +85,7 @@ R_API void r_sys_backtrace(void) {
|
||||
#if (__linux__ && __GNU_LIBRARY__) || (__APPLE__ && APPLE_WITH_BACKTRACE)
|
||||
void *array[10];
|
||||
size_t i, size = backtrace (array, 10);
|
||||
char **strings = backtrace_symbols (array, size);
|
||||
char **strings = (char **)(size_t)backtrace_symbols (array, size);
|
||||
printf ("Backtrace %zd stack frames.\n", size);
|
||||
for (i = 0; i < size; i++)
|
||||
printf ("%s\n", strings[i]);
|
||||
|
@ -20,7 +20,8 @@ src/sdb-version.h:
|
||||
EMCCFLAGS=-O2 -s ASM_JS=1
|
||||
#EMCCFLAGS+=--embed-file sdb.data
|
||||
sdb.js: src/sdb-version.h
|
||||
cd src ; emcc ${EMCCFLAGS} -I. -o ../sdb.js *.c json/api.c json/js0n.c json/json.c json/rangstr.c
|
||||
cd src ; emcc ${EMCCFLAGS} -I. -o ../sdb.js *.c
|
||||
#json/api.c json/js0n.c json/json.c json/rangstr.c
|
||||
|
||||
clean:
|
||||
rm -f src/sdb-version.h
|
||||
|
@ -3,7 +3,8 @@ include ../config.mk
|
||||
CFLAGS+= -g -ggdb
|
||||
#CFLAGS+=-DOLDFMT=1
|
||||
OBJ=cdb.o buffer.o cdb_make.o ls.o ht.o sdb.o sdbn.o sdba.o query.o
|
||||
OBJ+=json.o json/js0n.o json/json.o json/rangstr.o ns.o lock.o util.o
|
||||
OBJ+=json.o ns.o lock.o util.o
|
||||
#json/js0n.o json/json.o json/rangstr.o
|
||||
|
||||
SOBJ=$(subst .o,._o,${OBJ})
|
||||
|
||||
|
@ -2,7 +2,11 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "sdb.h"
|
||||
#include "json/json.h"
|
||||
//#include "json/json.h"
|
||||
#include "json/api.c"
|
||||
#include "json/js0n.c"
|
||||
#include "json/json.c"
|
||||
#include "json/rangstr.c"
|
||||
|
||||
static void __itoa(int value, char *string) {
|
||||
int i, sign, count = 0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
include ../../config.mk
|
||||
|
||||
CFLAGS+=-Wall -g -ggdb
|
||||
BIN=a.out
|
||||
OBJ=rangstr.o json.o js0n.o api.o main.o
|
||||
@ -7,7 +8,7 @@ OBJ+=../libsdb.a
|
||||
all: ${BIN}
|
||||
|
||||
${BIN}: ${OBJ}
|
||||
${CC} -o ${BIN} ${OBJ}
|
||||
${CC} main.c -DMAIN=1 -o ${BIN} ../libsdb.a
|
||||
|
||||
clean:
|
||||
rm -f ${OBJ} ${BIN}
|
||||
|
1
shlr/sdb/src/sdb-version.h
Normal file
1
shlr/sdb/src/sdb-version.h
Normal file
@ -0,0 +1 @@
|
||||
#define SDB_VERSION "0.6.4"
|
Loading…
x
Reference in New Issue
Block a user