Variables vs. Registers

17 views
Skip to first unread message

Damiano Zanardini

unread,
May 18, 2015, 9:51:20 AM5/18/15
to chord-...@googlegroups.com
Hello, I'm using Chord to implement a couple of static analyses.
Maybe this question is more related to Joeq, but I found nothing there
to solve my doubt.

Is there a way to go back from a Register to the variable in the source code?
I mean, which variable has been transformed into R7 in the method X?

Is there an order on Register names? (It seems R0 is this, but what
about the others?)

Thanks a lot to anyone reading this message and (hopefully) willing to help me!

Ravi Mangal

unread,
May 18, 2015, 10:00:35 AM5/18/15
to chord-...@googlegroups.com
Hi Damiano,

In jq_Method.java (located in libsrc/joeq/src/joeq/Class), we have
implemented two methods:

public List<Integer> getLineNumber(Register v)

public List<String> getRegName(Register v)

The first method returns the source line number where a particular
register is defined; and the second method returns the source variable
name that maps to the register. Note that both these calls are not
always guaranteed to work. The primary reason for this is that many
temporary registers are created in the course of generating the Joeq
quadcode and these registers do not map to any variable in the source
code.

Hope this helps.

Best,
Ravi
> --
> You received this message because you are subscribed to the Google Groups "chord-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chord-discus...@googlegroups.com.
> To post to this group, send email to chord-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/chord-discuss.
> For more options, visit https://groups.google.com/d/optout.

damiano....@gmail.com

unread,
May 18, 2015, 10:21:49 AM5/18/15
to chord-...@googlegroups.com
Thanks a lot!
I was looking into the wrong place...
getRegName solves my problem.

Have a nice day!
Reply all
Reply to author
Forward
0 new messages