ctool-users Mailing List for cTool Library
Brought to you by:
flisakow
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Kwanghoon C. <cho...@ya...> - 2006-10-04 01:02:48
|
Hi there,=0A=0AWhen I tried to apply CTool to a C source code including=0A= =0A> extern int fun_name (=0A> float f ( int a )=0A> );=0A=0AI go= t an error message as=0A=0A> test.c:4: Function type not allowed:=0A> = );=0A> ^=0A=0Awhere the caret points to the closed paranthesis.=0A=0A= =0AThe error message comes from the rule param_decl_bis in=0Agram.y, which = is a parser specification of CTool, as follows:=0A=0A> param_decl_bis: dec= l_specs_reentrance_bis declarator=0A> {=0A> assert (gProj= ect->Parse_TOS->err_top_level ||=0A> $1 =3D=3D gProject-= >Parse_TOS->parseCtxt->curCtxt->decl_specs);=0A> gProject->Parse= _TOS->possibleType =3D true;=0A> $$ =3D $2;=0A> Type = * decl =3D gProject->Parse_TOS->parseCtxt->UseDeclCtxt();=0A> Ty= pe * extended =3D $$->extend(decl); =0A> if ($$->for= m &&=0A> $$->form->isFunction())=0A> {=0A> = if(yyerr ("Function type not allowed"))=0A> YYER= ROR;=0A> }=0A> else if (extended && =0A=0A=0AI am cu= rious about the reason on the ban imposed by CTool.=0AI thought the ban com= es from the definition of ANSI C standard,=0Aso I looked at the K&R C book = to find the reason of the ban =0Abut in vain. =0A=0A=0AWould anybody give m= e any explanation for my curiosity?=0A=0AThanks in advance.=0A=0A=0A=0ABest= regards,=0A=0A=0AKwanghoon Choi=0A=0A=0A=09=09=0A_________________________= _______________________________ =0A180=B5=B5 =B4=DE=B6=F3=C1=F8 =BE=DF=C8= =C4! =B8=DE=C0=CF - =C4=C4=C7=BB=C5=CD=BF=CD =C8=DE=B4=EB=C6=F9=C0=B8=B7=CE= =BE=F0=C1=A6 =BE=EE=B5=F0=BC=AD=B3=AA =BB=F5=B7=CE=BF=EE =BE=DF=C8=C4! =B8= =DE=C0=CF=C0=BB =C8=AE=C0=CE=C7=D8=BA=B8=BC=BC=BF=E4.=0Ahttp://kr.content.m= ail.yahoo.com/cgland |
From: <cto...@kh...> - 2006-06-19 15:55:27
|
On Sun, 18 Jun 2006, Shaun Flisakowski wrote: Thanks Shawn, > > If you're calling a callback for each function, you can set the name > inside it (to a global), then you'll have it for each statement you > do from within it. > > Take a look at the atFuncDef() method in the call-graph example: > exampes/cgraph/cgraph.cpp That's what I'd been doing for findFunctionDef() findExpr(). My problem was, if calling findStemnt() from main without calling either of the other 2 callbacks, I couldn't figure out how to tell which function the statement was part of (that's where I thought the info would be somewhere in the symbol table of the statement. is it there? this is not an essential question, since i've solved my problem for now, just curiosity as i didn't find it easily). Now that i'm getting my head around c++ and oo I've realised I can use findFunctionDef() and cast its FunctionDef parameter to a Block which then gives me access to the findStemnt() callback. so sorry, it was a case of still figuring out how it all holds together.. thanks for the quick answer! nessim > > Shawn > > On Jun 18, 2006, at 6:13 AM, cto...@kh... wrote: > > > Dear all, > > > > First, thanks for all the good work on ctool, i'm hoping to start > > building some useful > > tools around it.. > > > > I'm currently working on a simple control-flow aware function call > > graph. > > I can easily get a list of all control flow statements by calling > > findStemnt() with a callback. > > > > In the callback, I'd like to know what function the statement is > > part of. > > Unfortunately I haven't been able to find that.. > > > > Although I can find the name of the executing function in the > > TransUnit's syms SymTbl I don't see how to differentiate it from > > any of the other > > functions visible at the same level in the table. > > > > in the first level of the SymTbl i do see the __FUNCTION__ and > > __PRETTY_FUNCTION__ > > symbols which seem like good candidates but neither is defined. > > > > Any help is appreciated! > > > > thanks, > > nessim > > ps. i'm using cpp-3.3.5 and cpp-4.0 > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > The Borg assimilated my cat...He doesn't act any differently. > > unknown > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > > _______________________________________________ > > Ctool-users mailing list > > Cto...@li... > > https://lists.sourceforge.net/lists/listinfo/ctool-users > > > |
From: Shaun F. <fli...@so...> - 2006-06-18 16:54:29
|
If you're calling a callback for each function, you can set the name inside it (to a global), then you'll have it for each statement you do from within it. Take a look at the atFuncDef() method in the call-graph example: exampes/cgraph/cgraph.cpp Shawn On Jun 18, 2006, at 6:13 AM, cto...@kh... wrote: > Dear all, > > First, thanks for all the good work on ctool, i'm hoping to start > building some useful > tools around it.. > > I'm currently working on a simple control-flow aware function call > graph. > I can easily get a list of all control flow statements by calling > findStemnt() with a callback. > > In the callback, I'd like to know what function the statement is > part of. > Unfortunately I haven't been able to find that.. > > Although I can find the name of the executing function in the > TransUnit's syms SymTbl I don't see how to differentiate it from > any of the other > functions visible at the same level in the table. > > in the first level of the SymTbl i do see the __FUNCTION__ and > __PRETTY_FUNCTION__ > symbols which seem like good candidates but neither is defined. > > Any help is appreciated! > > thanks, > nessim > ps. i'm using cpp-3.3.5 and cpp-4.0 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > The Borg assimilated my cat...He doesn't act any differently. > unknown > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > _______________________________________________ > Ctool-users mailing list > Cto...@li... > https://lists.sourceforge.net/lists/listinfo/ctool-users > |
From: <cto...@kh...> - 2006-06-18 13:13:33
|
Dear all, First, thanks for all the good work on ctool, i'm hoping to start building some useful tools around it.. I'm currently working on a simple control-flow aware function call graph. I can easily get a list of all control flow statements by calling findStemnt() with a callback. In the callback, I'd like to know what function the statement is part of. Unfortunately I haven't been able to find that.. Although I can find the name of the executing function in the TransUnit's syms SymTbl I don't see how to differentiate it from any of the other functions visible at the same level in the table. in the first level of the SymTbl i do see the __FUNCTION__ and __PRETTY_FUNCTION__ symbols which seem like good candidates but neither is defined. Any help is appreciated! thanks, nessim ps. i'm using cpp-3.3.5 and cpp-4.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Borg assimilated my cat...He doesn't act any differently. unknown ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
From: Kaustubh G. <kau...@ya...> - 2004-11-03 06:41:09
|
Hi, I am trying to compile the source of CTOOL, using "make all" in the src directory. I have changed the variables abs_top_builddir and abs_top_src_dir to point to the corresponding directories. But still, it is unable to locate the constructor for the BaseType(unsigned long). Here is a small part of the entire list of errors: --------------------------------------- In function `yylex(lex_union*)': /root/software/ctool_2.12/src/lexer.l:210: undefined reference to `operator new(unsigned)' /root/software/ctool_2.12/src/lexer.l:210: undefined reference to `BaseType::BaseType[in-charge](unsigned long)' /root/software/ctool_2.12/src/lexer.l:210: undefined reference to `operator delete(void*)' /root/software/ctool_2.12/src/lexer.l:210: undefined reference to `operator delete(void*)' --------------------------------------- Most of the errors are of the same type. Please tell me what I need to do to correctly compile the code. Thanks in Advance, Kaustubh __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com |
From: Flynn, L. A. (Lori) <la...@lu...> - 2004-07-15 14:52:51
|
I am having problems with ctool, combined with Flex 2.5.4a (or version 2.5.31) and gcc 3.3.1. I am compiling ctool on cygwin over WinXP Pro, and the 'make depend' for ctool (which uses flex to compile a dependency) complains about Flex not seeing standard c libraries such as cstdio and string. (Although I have put the 'using namespace std;' required line under all included std libraries in files.) However, the ctool program does compile in spite of the warnings about the flex file not finding the std libraries. But then the compiled ctool program does not pass any run tests from the regression directory, and gives many '__STDC__ redefined' warnings. In the ctool code, __STDC__ is defined to be 1 (if a Windows environment is discovered). A relevant similar issue, is that ulong should be typedef'd in file utype.h (once the WINDOWS environment is discovered). However, I have to typedef that myself...so maybe the problem is there. I'm not sure if I'm supposed to do a: #define WINDOWS 1 Or if that is some environmental variable that is sensed. Hope to hear some ideas for fixes! Cheers, -Lori |
From: Emil O. <em...@ee...> - 2002-05-13 04:37:39
|
Hi, I think that I've discovered at least part of the problem: it looks like in the current grammar, #line statements are illegal at the beginning of a compound statement, so if I change the code to this: static void runas_setup() { if ((sudo_user._runas_pw) ->pw_name != ((void *)0) ) { { if (setgid((sudo_user._runas_pw) ->pw_gid)) perror("cannot set gid to runas gid"); # 318 "set_perms.c" if (! (sudo_defs_table[( 34 )].sd_un.flag) && initgroups(* (sudo_user.runas) , (sudo_user._runas_pw) ->pw_gid) < 0) perror("cannot set group vector"); } } } everything parses. I also tried putting the #line between the "if" line and the "perror" line, but that will not parse. Also, it looks like #line must appear after a statement (i.e. not after an opt_declaration_list). Am I right about this? If so, how can I fix it? Thanks, Emil flisakow wrote: > Hi, > > I received this message from the email list, and I'm CC'ing it back > to the user's list also, so you should receive two copies. I was > on vacation for the last week, and didn't reply to any email. > > One possible problem is that CTool uses gcc as its preprocessor by > default (that's controlled by a compile-time option). Perhaps the > #line directives inserted by that 2nd pass are actually causing > the problem. There's a remove(cpp_file) call in project.cpp that > could be commented out so you could see the actual input to CTool > (its stored in filename.pp). > > I'll that a look at this myself in the next few days, but I wanted > to reply sooner so you'd know the list is not dead. > > Shaun > > >>Hi, >> >>I'm having trouble parsing a few files in sudo-1.6.5p2 (though I'm >>having similar problems in other packages). The ctool parser doesn't >>seem to like files produced by bison/flex (who would? ;). In sudo, the >>offending files are lex.yy.c and sudo.tab.c. Then there's the file >>set_perms.c which has a really strange error. I extracted the >>problematic preprocessed code: >> >>static void >>runas_setup() >>{ >> if ((sudo_user._runas_pw) ->pw_name != ((void *)0) ) { >># 314 "set_perms.c" >> { >> if (setgid((sudo_user._runas_pw) ->pw_gid)) >> perror("cannot set gid to runas gid"); >> >> >> >> >> if (! (sudo_defs_table[( 34 )].sd_un.flag) && >> initgroups(* (sudo_user.runas) , (sudo_user._runas_pw) ->pw_gid) < 0) >> perror("cannot set group vector"); >> >> } >> } >>} >> >>set_perms.c:312: Error (parse error) before '#line' >># 313 "set_perms.c" >> ^ >>set_perms.c:327: Error (parse error) before 'String Constant' >>} >> >>The first error is really strange to me considering that the line >>mentioned is not in the file! Any ideas on where this is coming from? >> >>Thanks, >>Emil >> >> >>_______________________________________________________________ >> >>Have big pipes? SourceForge.net is looking for download mirrors. We supply >>the hardware. You get the recognition. Email Us: ban...@so... >>_______________________________________________ >>Ctool-users mailing list >>Cto...@li... >>https://lists.sourceforge.net/lists/listinfo/ctool-users >> > > > |
From: flisakow <fli...@so...> - 2002-05-07 20:55:46
|
Hi, I received this message from the email list, and I'm CC'ing it back to the user's list also, so you should receive two copies. I was on vacation for the last week, and didn't reply to any email. One possible problem is that CTool uses gcc as its preprocessor by default (that's controlled by a compile-time option). Perhaps the #line directives inserted by that 2nd pass are actually causing the problem. There's a remove(cpp_file) call in project.cpp that could be commented out so you could see the actual input to CTool (its stored in filename.pp). I'll that a look at this myself in the next few days, but I wanted to reply sooner so you'd know the list is not dead. Shaun > Hi, > > I'm having trouble parsing a few files in sudo-1.6.5p2 (though I'm > having similar problems in other packages). The ctool parser doesn't > seem to like files produced by bison/flex (who would? ;). In sudo, the > offending files are lex.yy.c and sudo.tab.c. Then there's the file > set_perms.c which has a really strange error. I extracted the > problematic preprocessed code: > > static void > runas_setup() > { > if ((sudo_user._runas_pw) ->pw_name != ((void *)0) ) { > # 314 "set_perms.c" > { > if (setgid((sudo_user._runas_pw) ->pw_gid)) > perror("cannot set gid to runas gid"); > > > > > if (! (sudo_defs_table[( 34 )].sd_un.flag) && > initgroups(* (sudo_user.runas) , (sudo_user._runas_pw) ->pw_gid) < 0) > perror("cannot set group vector"); > > } > } > } > > set_perms.c:312: Error (parse error) before '#line' > # 313 "set_perms.c" > ^ > set_perms.c:327: Error (parse error) before 'String Constant' > } > > The first error is really strange to me considering that the line > mentioned is not in the file! Any ideas on where this is coming from? > > Thanks, > Emil > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Ctool-users mailing list > Cto...@li... > https://lists.sourceforge.net/lists/listinfo/ctool-users > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shaun Flisakowski fli...@sp... "In your heart, you know it's flat." - The Flat Earth Society http://www.spf-15.com/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
From: Emil O. <em...@ee...> - 2002-05-02 16:47:46
|
Hi, I'm having trouble parsing a few files in sudo-1.6.5p2 (though I'm having similar problems in other packages). The ctool parser doesn't seem to like files produced by bison/flex (who would? ;). In sudo, the offending files are lex.yy.c and sudo.tab.c. Then there's the file set_perms.c which has a really strange error. I extracted the problematic preprocessed code: static void runas_setup() { if ((sudo_user._runas_pw) ->pw_name != ((void *)0) ) { # 314 "set_perms.c" { if (setgid((sudo_user._runas_pw) ->pw_gid)) perror("cannot set gid to runas gid"); if (! (sudo_defs_table[( 34 )].sd_un.flag) && initgroups(* (sudo_user.runas) , (sudo_user._runas_pw) ->pw_gid) < 0) perror("cannot set group vector"); } } } set_perms.c:312: Error (parse error) before '#line' # 313 "set_perms.c" ^ set_perms.c:327: Error (parse error) before 'String Constant' } The first error is really strange to me considering that the line mentioned is not in the file! Any ideas on where this is coming from? Thanks, Emil |