Flow-Centric, Back-In-Time Debugging
-
Upload
lienhard -
Category
Technology
-
view
640 -
download
0
description
Transcript of 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
class Account {
Money balance;
void deposit(Money amount) {
this.balance += money;
}
...
}
Debugger call stack
....
....
....
....
..
NullPointerException >>
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 >>
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 >>
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 >>
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
...
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
...
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
With Back-in-time debuggers, we have all data we need at hand
complete execution history
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:
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
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
?
Developer: “where did this object come from?”
Problem: how far back in time do we need to step?
14
Flow-centric debugging
Object flow (red) mapped to execution trace
15
Flow-centric debugging
Object flow (red) mapped to execution trace
16
The Compass Debugger
Debugger frontend makes object flow accessible
Debugging VM tracks object flow
17
1 8
2
4
6
5
3
7
9
Frontend
18
Execution trace visualization
selected method
methodstart time
stackdepth
19
Navigating Execution Traces
execution trace
call stack
20
execution stack
method traceobject flow of aselected value
object flow list
Object flow
21
short demo...
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
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