Flow-Centric, Back-In-Time Debugging

23
Flow-Centric, Back-In-Time Debugging Adrian Lienhard, Julien Fierz and Oscar Nierstrasz Software Composition Group University of Bern, Switzerland

description

 

Transcript of Flow-Centric, Back-In-Time Debugging

Page 1: Flow-Centric, Back-In-Time Debugging

Flow-Centric,Back-In-Time Debugging

Adrian Lienhard, Julien Fierz and Oscar Nierstrasz

Software Composition Group University of Bern, Switzerland

Page 2: Flow-Centric, Back-In-Time Debugging

class Account {

Money balance;

void deposit(Money amount) {

this.balance += money;

}

...

}

Debugger call stack

....

....

....

....

..

NullPointerException >>

Page 3: Flow-Centric, Back-In-Time Debugging

class Company {

void pay(Money money, Person person) {

person.account().deposit(money);

}

}

class Account {

Money balance;

void deposit(Money amount) {

this.balance += money;

}

...

}

where does the

account object

come from?

Debugger call stack

...

NullPointerException >>

Page 4: Flow-Centric, Back-In-Time Debugging

class Company {

void pay(Money money, Person person) {

person.account().deposit(money);

}

}

class Account {

Money balance;

void deposit(Money amount) {

this.balance += money;

}

...

}

return

where does the

account object

come from?

Debugger call stack

...

NullPointerException >>

Page 5: Flow-Centric, Back-In-Time Debugging

class Company {

void pay(Money money, Person person) {

person.account().deposit(money);

}

}

class Account {

Money balance;

void deposit(Money amount) {

this.balance += money;

}

...

}

returnfield read

where does the

account object

come from?

Debugger call stack

...

NullPointerException >>

Page 6: Flow-Centric, Back-In-Time Debugging

class Company {

void pay(Money money, Person person) {

person.account().deposit(money);

}

}

class Person {

void createAccount(Bank bank) {

this.account = bank.openAccount();

}

}

class Account {

Money balance;

void deposit(Money amount) {

this.balance += money;

}

...

}

returnfield readfield writereturn

where does the

account object

come from?

Debugger call stack

...

Page 7: Flow-Centric, Back-In-Time Debugging

class Company {

void pay(Money money, Person person) {

person.account().deposit(money);

}

}

class Bank {

Account openAccount() {

return new Account();

}

}

class Person {

void createAccount(Bank bank) {

this.account = bank.openAccount();

}

}

class Account {

Money balance;

void deposit(Money amount) {

this.balance += money;

}

...

}

returnfield readfield writereturnallocation

where does the

account object

come from?

Debugger call stack

...

Page 8: Flow-Centric, Back-In-Time Debugging

In 50% of the cases the execution stack contains essentially no information about the bug’s cause.

[Liblit PLDI’05]

lost method executions

current call stack

Page 9: Flow-Centric, Back-In-Time Debugging

With Back-in-time debuggers, we have all data we need at hand

complete execution history

Page 10: Flow-Centric, Back-In-Time Debugging

With Back-in-time debuggers, we have all data we need at hand

⇒ programs slow down and run out of memory

Large amount of data:

Page 11: Flow-Centric, Back-In-Time Debugging

With Back-in-time debuggers, we have all data we need at hand

⇒ programs slow down and run out of memory

Large amount of data:Popthier etal.

OOPSLA'07

Lienhard etal.

ECOOP'08

Page 12: Flow-Centric, Back-In-Time Debugging

With Back-in-time debuggers, we have all data we need at hand

Large amount of data:

⇒ developer may not find the root cause⇒ programs slow down and run out of memory

Page 13: Flow-Centric, Back-In-Time Debugging

?

Developer: “where did this object come from?”

Problem: how far back in time do we need to step?

Page 14: Flow-Centric, Back-In-Time Debugging

14

Flow-centric debugging

Object flow (red) mapped to execution trace

Page 15: Flow-Centric, Back-In-Time Debugging

15

Flow-centric debugging

Object flow (red) mapped to execution trace

Page 16: Flow-Centric, Back-In-Time Debugging

16

The Compass Debugger

Debugger frontend makes object flow accessible

Debugging VM tracks object flow

Page 17: Flow-Centric, Back-In-Time Debugging

17

1 8

2

4

6

5

3

7

9

Frontend

Page 18: Flow-Centric, Back-In-Time Debugging

18

Execution trace visualization

selected method

methodstart time

stackdepth

Page 19: Flow-Centric, Back-In-Time Debugging

19

Navigating Execution Traces

execution trace

call stack

Page 20: Flow-Centric, Back-In-Time Debugging

20

execution stack

method traceobject flow of aselected value

object flow list

Object flow

Page 21: Flow-Centric, Back-In-Time Debugging

21

short demo...

Page 22: Flow-Centric, Back-In-Time Debugging

22

Alias Objectvalue

1*

*0..1

Activation

context1

*

origin

0..1

caller

*

ASTNode

Alias

Activation

Dynamic model Static modelCompass Model

Compass Frontend

Object Flow VM

program

execution

recording

Page 23: Flow-Centric, Back-In-Time Debugging

23

Conclusion

http://scg.iam.unibe.ch/research/objectflowPrototype:

Flow-centric views improve the effectiveness of debugging

Conventional back-in-time debuggers adopt traditional stack-oriented views

Future work: concurrency bugs