Output a part of the analysed results

30 views
Skip to first unread message

Zell

unread,
Jan 6, 2012, 4:48:39 AM1/6/12
to chord-discuss
I would like to obtain a subset of the analyzed result.

My source is
********************************
package test;

public class HelloWorld {
public static void main(String[] args) {
Lst x=new Lst();
Lst y=new Lst();
Lst z=new Lst();
}
}
class Lst { Lst n; }
*******************************

I use the command:
ant -Dchord.work.dir=examples/hello_world -
Dchord.run.analyses=cipa-0cfa-dlog -Dchord.print.rels=VH run

And get the tuples of VH:
**************
<R0!<init>:()V...@java.lang.Object,0!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<R0!<init>:()V...@java.lang.Object,8!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<R0!<init>:()V...@java.lang.Object,16!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<T6!main:([Ljava/lang/String;)V...@test.HelloWorld,0!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<T7!main:([Ljava/lang/String;)V...@test.HelloWorld,0!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<R3!main:([Ljava/lang/String;)V...@test.HelloWorld,0!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<T8!main:([Ljava/lang/String;)V...@test.HelloWorld,8!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<T9!main:([Ljava/lang/String;)V...@test.HelloWorld,8!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<R4!main:([Ljava/lang/String;)V...@test.HelloWorld,8!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<T10!main:([Ljava/lang/String;)V...@test.HelloWorld,16!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<T11!main:([Ljava/lang/String;)V...@test.HelloWorld,16!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<R5!main:([Ljava/lang/String;)V...@test.HelloWorld,16!main:([Ljava/lang/
String;)V...@test.HelloWorld>
<R0!<init>:()V...@test.Lst,0!main:([Ljava/lang/String;)V...@test.HelloWorld>
<R0!<init>:()V...@test.Lst,8!main:([Ljava/lang/String;)V...@test.HelloWorld>
<R0!<init>:()V...@test.Lst,16!main:([Ljava/lang/
String;)V...@test.HelloWorld>
**************************

This is quite messy because only the 3 lines with
<R3!...,
<R4!...,
<R5!...
are interesting (which, if I understand well, correspond to x, y, z
in the main() )

Is there a simple way to output that 3 lines instead of output the
redundant VH.txt? I tried to set some scope-related properties, but
cannot see how to use those properties for this purpose.

Thanks.


Zell

unread,
Jan 6, 2012, 5:07:49 AM1/6/12
to chord-discuss
I forgot to precise that I had tried to set chord.reuse.scope=true and
modify methods.txt to contain only one line:
main:([Ljava/lang/String;)V...@test.HelloWorld

but this still gives a messy VH.txt because it contains those tuples
concerning temporary registers like <T10!....

Ariel Rabkin

unread,
Jan 6, 2012, 12:55:27 PM1/6/12
to chord-...@googlegroups.com
I always just write chord Java analyses that read in relations, and
then iterate over them, printing the bits I care about.

See conf_analyzer/src/java/chord/analyses/PrettyCallGraph.java for an example

--Ari

> --
> You received this message because you are subscribed to the Google Groups "chord-discuss" group.
> To post to this group, send email to chord-...@googlegroups.com.
> To unsubscribe from this group, send email to chord-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/chord-discuss?hl=en.
>

--
Ari Rabkin asra...@gmail.com
UC Berkeley Computer Science Department

Reply all
Reply to author
Forward
0 new messages