From 2f59c494a6ffff78334b796038cbef56d05c8102 Mon Sep 17 00:00:00 2001 From: Luc Chouinard Date: Wed, 8 Jul 2015 11:58:54 -0700 Subject: [PATCH] Add MIPS compile flags and clean up gcc 5.1 warnings. --- applications/crash/eppic.c | 3 ++- libeppic/Makefile | 3 +++ libeppic/eppic.h | 8 ++++++-- libeppic/eppic_alloc.c | 4 ++-- libeppic/eppic_api.c | 1 + libeppic/eppic_api.h | 5 ++++- libeppic/eppic_var.c | 2 ++ 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/applications/crash/eppic.c b/applications/crash/eppic.c index 66f7cd5..92430c1 100644 --- a/applications/crash/eppic.c +++ b/applications/crash/eppic.c @@ -54,6 +54,7 @@ #include #include +#include #include #include @@ -1003,7 +1004,7 @@ unsigned long get_curtask(); return eppic_makebtype((ull)get_curtask()); } -_init() /* Register the command set. */ +int _init() /* Register the command set. */ { #define LCDIR "/usr/share/eppic/crash" #define LCIDIR "include" diff --git a/libeppic/Makefile b/libeppic/Makefile index 1f97800..bcf2edf 100644 --- a/libeppic/Makefile +++ b/libeppic/Makefile @@ -34,6 +34,9 @@ endif ifeq ($(TARGET), X86) CFLAGS += -m32 endif +ifeq ($(TARGET), MIPS) + CFLAGS += -m32 +endif CFILES = eppic_util.c eppic_node.c eppic_var.c eppic_func.c eppic_str.c \ eppic_op.c eppic_num.c eppic_stat.c eppic_builtin.c eppic_type.c \ diff --git a/libeppic/eppic.h b/libeppic/eppic.h index 06320f2..5664583 100644 --- a/libeppic/eppic.h +++ b/libeppic/eppic.h @@ -334,6 +334,7 @@ void eppic_popallin(void); void eppic_tagst(void); void eppic_flushtdefs(void); void eppic_setsvlev(int newlev); +void eppic_setvlev(int lev); void eppic_flushmacs(void *tag); void eppic_add_auto(var_t*nv); void *eppic_chkbuiltin(char *name); @@ -352,6 +353,7 @@ void eppic_baseop(int op, value_t *v1, value_t *v2, value_t *result); void eppic_setinsizeof(int v); void eppic_freeidx(idx_t *idx); void eppic_freedvar(dvar_t*dv); +void eppic_caller(void *p, void *retaddr); void eppic_pushenums(enum_t *et); void eppic_addfunc_ctype(int idx); void eppic_setapiglobs(void); @@ -367,9 +369,9 @@ void eppic_addtolist(var_t*vl, var_t*v); void eppic_arch_swapvals(void* vp, void *sp); void eppic_fillst(stinfo_t *st); void eppic_exememlocal(value_t *vp, stmember_t* stm, value_t *v); -void eppic_do_deref(int n, value_t *v, value_t *ref); -void eppic_addneg(char *name); void eppic_print_type(type_t *t); +void eppic_vpush(); +void eppic_vpop(); stmember_t*eppic_member(char *mname, type_t*tp); @@ -445,6 +447,7 @@ int eppic_isenum(int atr); int eppic_funcexists(char *name); int eppic_isnew(void* p); int eppic_isneg(char *name); +int eppicpperror(char *s); char *eppic_vartofunc(node_t *name); char *eppic_gettdefname(ull idx); @@ -456,6 +459,7 @@ char *eppic_cursorp(void); char *eppic_getbtypename(int typattr); char *eppic_filename(void); char *eppic_curp(char *); +char *eppic_getipath(void); type_t *eppic_typeof(node_t *n); type_t *eppic_newctype(int ctype_t, node_t *n); diff --git a/libeppic/eppic_alloc.c b/libeppic/eppic_alloc.c index 057be4e..2654712 100644 --- a/libeppic/eppic_alloc.c +++ b/libeppic/eppic_alloc.c @@ -173,9 +173,9 @@ static int dir=0; } void -eppic_caller(char *p, void *retaddr) +eppic_caller(void *p, void *retaddr) { -blist *bl=(blist*)(((char*)p)-SIZEBL); +blist *bl=(blist*)(p-SIZEBL); bl->caller=retaddr; } diff --git a/libeppic/eppic_api.c b/libeppic/eppic_api.c index c2596f6..048f984 100644 --- a/libeppic/eppic_api.c +++ b/libeppic/eppic_api.c @@ -23,6 +23,7 @@ #include #include #include +#include /* here we do some caching of the information. This can have a speedup effect since it limits the number of accesses we do the dwarf (or whatever type) db that diff --git a/libeppic/eppic_api.h b/libeppic/eppic_api.h index e41d056..6dd6c79 100644 --- a/libeppic/eppic_api.h +++ b/libeppic/eppic_api.h @@ -208,7 +208,10 @@ void eppic_setarrbval(ARRAY_S*, int); /* get the array element coresponding to index */ ARRAY_S *eppic_getarrval(ARRAY_S**, VALUE_S*); /* get the initiale array for a variable */ -ARRAY_S *eppic_addarrelem(ARRAY_S**, VALUE_S*, VALUE_S*); +ARRAY_S *eppic_addarrelem(ARRAY_S**, VALUE_S*, VALUE_S*); +/* dereference a pointer to its value */ +void eppic_do_deref(int n, VALUE_S* v, VALUE_S* ref); +void eppic_addneg(char *name); /* type manipulation */ int eppic_is_struct(int); diff --git a/libeppic/eppic_var.c b/libeppic/eppic_var.c index 0f0d68e..7980dd3 100644 --- a/libeppic/eppic_var.c +++ b/libeppic/eppic_var.c @@ -828,6 +828,7 @@ var_t*v; evaluation of sizeof or typeof. */ int eppic_getvlev() { return vlev; } +void eppic_vpush() { if(vlev==S_MAXSDEEP) { @@ -841,6 +842,7 @@ eppic_vpush() } } +void eppic_vpop() { if(vlev) {