[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Original names; was: Assignment statement isn't parsing



Oops, forgot to tell you in which file

soot/coffi/LocalVariableTable_attribute.java

Cheers,
===========================================================
Feng Qian                             fqian@sable.mcgill.ca

On Sun, 3 Mar 2002, Feng QIAN wrote:

> Nathan,
>
> I believe the problem was caused by following code
>     74           e = local_variable_table[i];
>     75           if (e.index==idx &&
>     76               (code==-1 ||
>     77                (code>=e.start_pc && code<e.start_pc+e.length))) {
>
> Line 77 should be a bug, because according to the spec, the interval
> should be [start_pc, start_pc+length] inclusively. So changing the line
> 77 to:
>  new 77               (code>=e.start_pc && code<=e.start_pc+e.length))) {
>                     /* [start_pc, start_pc+length] should be inclusive */
>
> This will fix the bug in your example, and hopefully it will fix your other
> programs as well.
>
> Cheers,
> ===========================================================
> Feng Qian                             fqian@sable.mcgill.ca
>
> On Sat, 2 Mar 2002, Nathan Kitchen wrote:
>
> > I didn't miss Pat's email about the splitter.  The 'verbatim' option
> > subsumes 'no-splitting' and a slew of others, because it prevents _any_
> > BodyTransformers, including LocalSplitter, from transforming the body.
> > At least that's what I see in the source code that I have.
> >
> > About the output being wrong:  The real reason I'm making such a fuss
> > about this is because I'm trying very hard to keep the original variable
> > names.  I realize that I won't always be able to do that, because the
> > info won't always be in the class files that I parse.  However, I don't
> > believe that that justifies my failure to get the results I want in this
> > case.  This is what I want to see with the command line below:
> >
> > void run()
> > {
> >     .unknown this, $stack0, e;
> >
> >     this := @this;
> >     $stack0 = 0;
> >     e = $stack0;
> >     $stack0 = this;
> >     $stack0 = $stack0.calc();
> >     e = $stack0;  // This line is the key.
> >     return;
> > }
> >
> > Navindra Umanee wrote:
> > >>(command line: java soot.Main --soot-classpath
> > >>.:$JAVA_HOME/jre/lib/rt.jar -p jb use-original-names -p jb verbatim -j
> > >>A).  This is the result I get:
> > >>
> > >
> > > I think you missed Pat's email about the splitter.  I added "-p jb
> > > no-splitting" and it seemed to produce the desired output.  Either
> > > way, I'm not sure I see what the problem was with the original
> > > output...
> > >
> > >
> > >>public class A extends java.lang.Object
> > >>{
> > >>     void run()
> > >>     {
> > >>         .unknown this, $stack0, e, l1;
> > >>
> > >>         this := @this;
> > >>         $stack0 = 0;
> > >>         e = $stack0;
> > >>         $stack0 = this;
> > >>         $stack0 = $stack0.calc();
> > >>         l1 = $stack0;
> > >>         return;
> > >>     }
> > >>
> > --
> > Nathan Kitchen
> > kitchen@ee.byu.edu
> >
>
>