X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=genevent-new%2Fparser.c;h=6dbf402d76fd4f008f8d8c5cce17378df0617b15;hb=ffaf5031680617709c7ae1b7f1a3cf5cdf784805;hp=42c38c316a52e9101cb45a610a82305ff6db88ec;hpb=70f46ac34d0f9f1f92f96c6d970e8278daa3308a;p=lttv.git diff --git a/genevent-new/parser.c b/genevent-new/parser.c index 42c38c31..6dbf402d 100644 --- a/genevent-new/parser.c +++ b/genevent-new/parser.c @@ -182,7 +182,6 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t, t->fmt = NULL; t->size = 0; - t->alignment = 0; while(1) { token = getToken(in); @@ -203,9 +202,6 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t, } else if(!strcmp("size",token)) { getEqual(in); t->size = getSize(in); - } else if(!strcmp("align",token)) { - getEqual(in); - t->alignment = getNumber(in); } } } @@ -271,6 +267,7 @@ void getFacilityAttributes(parse_file_t *in, facility_t *fac) char car; fac->name = NULL; + fac->arch = NULL; while(1) { token = getToken(in); @@ -285,7 +282,12 @@ void getFacilityAttributes(parse_file_t *in, facility_t *fac) if(car == EOF) in->error(in,"name was expected"); else if(car == '\"') fac->name = allocAndCopy(getQuotedString(in)); else fac->name = allocAndCopy(getName(in)); - } + } else if(!strcmp("arch", token)) { + getEqual(in); + car = seekNextChar(in); + if(car == '\"') fac->name = allocAndCopy(getQuotedString(in)); + else fac->arch = allocAndCopy(getName(in)); + } } } @@ -424,7 +426,7 @@ void parseFacility(parse_file_t *in, facility_t * fac) getFacilityAttributes(in, fac); if(fac->name == NULL) in->error(in, "Attribute not named"); - + fac->capname = allocAndCopy(fac->name); strupper(fac->capname); getRAnglebracket(in); @@ -733,10 +735,10 @@ type_descriptor_t *parseType(parse_file_t *in, type_descriptor_t *inType, t->already_printed = 0; getTypeAttributes(in, t, unnamed_types, named_types); //if(t->size == 0) in->error(in, "Sequence has empty size"); - //Mathieu : we fix enum size to 4 bytes. GCC is always like this. + //Mathieu : we fix enum size to target int size. GCC is always like this. //fox copy optimisation. - if(t->size != 0) in->error(in, "Enum has fixed size of 4."); - t->size = 4; + if(t->size != 0) in->error(in, "Enum has fixed size of target int."); + t->size = 0; getRAnglebracket(in); //