Yeah just about all (if not simply all) instances of error are probably supposed to be self.error. I guess I was mostly worried about it generating correct code. :)
Nate On Sun, Oct 25, 2009 at 6:08 PM, Beckmann, Brad <[email protected]> wrote: > Hi All, > > > > In the process of adding full system support to Ruby I came across an issue > with an error message from the new python SLICC ast files. In particular, > the MemberExprAST didn’t not generate the correct error message. Instead I > encountered the following python stack. The fix seems fairly easy (see > patch below as well), but before I check this in, I wonder if the other > usages of the error() should also call the self.error(). There appears to > be many AST files that fall in this category. > > > > Brad > > > > === Patch === > > > > diff -r d72798476e5f -r de11533c371c src/mem/slicc/ast/MemberExprAST.py > > --- a/src/mem/slicc/ast/MemberExprAST.py Sun Oct 25 17:48:45 2009 > -0700 > > +++ b/src/mem/slicc/ast/MemberExprAST.py Sun Oct 25 17:57:03 2009 > -0700 > > @@ -47,9 +47,9 @@ > > > > # Verify that this is a valid field name for this type > > if self.field not in return_type.data_members: > > - error("Invalid object field: " + > > - "Type '%s' does not have data member %s" % \ > > - (return_type, self.field)) > > + self.error("Invalid object field: " + > > + "Type '%s' does not have data member %s" % \ > > + (return_type, self.field)) > > > > # Return the type of the field > > return return_type.data_members[self.field].type > > > > > > === Python Stack === > > > > g++ -o /tmp/bbeckman/m5/build/ALPHA_FS_MI_example/mem/physical.do -c > -Wno-deprecated -pipe -fno-strict-aliasing -Wall -Wno-sign-compare -Wundef > -gg > > db3 -Werror -DDEBUG -DTRACING_ON=1 -I/tmp/bbeckman/m5/build/gzstream > -I/tmp/bbeckman/m5/build/libelf -Iext > -I/tool/pandora64/.package/python-2.5.4- > > a/include/python2.5 -I/tmp/bbeckman/m5/build/ALPHA_FS_MI_example > /tmp/bbeckman/m5/build/ALPHA_FS_MI_example/mem/physical.cc > > makeDefinesPyFile(["/tmp/bbeckman/m5/build/ALPHA_FS_MI_example/python/m5/defines.py"], > ["[('NO_VECTOR_BOUNDS_CHECKS', True), ('RUBY_DEBUG', True), > > ('GEMS_ROOT', '/proj/radl_extra/users/bbeckman/new-m5/src/mem'), > ('RUBY_TSO_CHECKER', False), ('FULL_SYSTEM', True), ('USE_FENV', True), > ('USE_MYSQ > > L', False), ('NO_FAST_ALLOC', True), ('FAST_ALLOC_DEBUG', False), > ('FAST_ALLOC_STATS', False), ('SS_COMPATIBLE_FP', False), ('USE_CHECKER', > False), > > ('TARGET_ISA', 'alpha'), ('CP_ANNOTATE', False)]", "'b1561bcc9ba6+ 6704+ > default qtip tip brad/ruby_fs_support2'"]) > > scons: *** > [/tmp/bbeckman/m5/build/ALPHA_FS_MI_example/mem/protocol/AccessModeType.hh] > Exception > > Traceback (most recent call last): > > File > "/tool/pandora64/.package/scons-0.98.1/lib/scons-0.98.1/SCons/Taskmaster.py", > line 222, in execute > > self.targets[0].build() > > File > "/tool/pandora64/.package/scons-0.98.1/lib/scons-0.98.1/SCons/Node/__init__.py", > line 372, in build > > apply(self.get_executor(), (self,), kw) > > File > "/tool/pandora64/.package/scons-0.98.1/lib/scons-0.98.1/SCons/Executor.py", > line 145, in __call__ > > return self.do_execute(target, kw) > > File > "/tool/pandora64/.package/scons-0.98.1/lib/scons-0.98.1/SCons/Executor.py", > line 131, in do_execute > > status = apply(act, (self.targets, self.get_sources(), env), kw) > > File > "/tool/pandora64/.package/scons-0.98.1/lib/scons-0.98.1/SCons/Action.py", > line 465, in __call__ > > stat = self.execute(target, source, env) > > File > "/tool/pandora64/.package/scons-0.98.1/lib/scons-0.98.1/SCons/Action.py", > line 837, in execute > > result = self.execfunction(target=target, source=rsources, env=env) > > File "/tmp/bbeckman/m5/build/ALPHA_FS_MI_example/mem/protocol/SConscript", > line 98, in slicc_action > > slicc.generate() > > File "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/parser.py", > line 106, in generate > > decl_list.generate() > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/DeclListAST.py", > line 47, in generate > > decl.generate() > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/MachineAST.py", > line 65, in generate > > self.decls.generate() > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/DeclListAST.py", > line 47, in generate > > decl.generate() > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/ActionDeclAST.py", > line 59, in generate > > self.statement_list.generate(code, None) > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/StatementListAST.py", > line 42, in generate > > statement.generate(code, return_type) > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/PeekStatementAST.py", > line 68, in generate > > self.statements.generate(code, return_type) > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/StatementListAST.py", > line 42, in generate > > statement.generate(code, return_type) > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/AssignStatementAST.py", > line 46, in generate > > rtype = self.rvalue.generate(rcode) > > File > "/proj/radl_extra/users/bbeckman/new-m5/src/mem/slicc/ast/MemberExprAST.py", > line 50, in generate > > error("Invalid object field: " + > > NameError: global name 'error' is not defined > > scons: building terminated because of errors. > > > > scons: *** Found dependency cycle(s): > > Internal Error: no cycle found for node > /tmp/bbeckman/m5/build/ALPHA_FS_MI_example/python/m5/defines.py.do > (<SCons.Node.FS.File instance at 0x2a9 > > ae1a560>) > > > > File > "/tool/pandora64/.package/scons-0.98.1/lib/scons-0.98.1/SCons/Taskmaster.py", > line 779, in cleanup > > _______________________________________________ > m5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/m5-dev > > _______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
