Why Push Down Automata PDA 1 2 3

  • Slides: 10
Download presentation
Why Push Down Automata (PDA)? 1. 2. 3. 4. Prototype Flexible Hierarchy interfaces without

Why Push Down Automata (PDA)? 1. 2. 3. 4. Prototype Flexible Hierarchy interfaces without porting our entire debugger Demonstrate prinicples of our debugger design Demonstrate bugs in Platform that only show up with our debugger design Test out new ideas and design changes for our debugger Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Origninal PDA Design View Providers All threads synchronize on one or more semaphores in

Origninal PDA Design View Providers All threads synchronize on one or more semaphores in debug model + Simplementation. - It is difficult to implement the Debug Model without risking deadlocks, race conditions and other synchronization problems. - Many jobs are spawned during routine operations such as changing selection in Debug view. Debug Model PDA Engine Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Single Dispatch w/ traditional Debug Model + Allows for more complicated logic to be

Single Dispatch w/ traditional Debug Model + Allows for more complicated logic to be implemented in Connection module. + Deadlocks and race coditions eliminated. - Overall design more complicated and it requires programming agains asynchronous interfaces. - Multiple jobs are still spawned to populate the view. View Providers Debug Model Calling thread blocks while request is processed in dispatch thread Connection PDA Engine Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Single Dispatch w/ flexible hierarchy. View Providers Request on dispatch thread with asynchronous callback

Single Dispatch w/ flexible hierarchy. View Providers Request on dispatch thread with asynchronous callback + Complex logic in Connection implementation + Deadlocks addressed. + Only one job to service view requests. - More complicated design requiring asynchronous programming. - APIs to the model must be asynchronous. Connection PDA Engine Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Connection component design Clients All requests and all callbacks executed on dispatch thread Access

Connection component design Clients All requests and all callbacks executed on dispatch thread Access to services and expression evaluation Q Debug Control Expression evaluation Service-specific interfaces Debug Services Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Connection Interfaces public interface IDebug. Service { public String get. Signature(); public IEval. Result

Connection Interfaces public interface IDebug. Service { public String get. Signature(); public IEval. Result evaluate( IModel. Context context, String expression); … } public interface IDebug. Control extends IDebug. Service { public Q get. Q(); public void register. Service(IDebug. Service service); public IDebug. Service get. Debug. Service(String signature); … } Additional Interfaces extending IDebug. Service: IRun. Control, IBreakpoints, IStack Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Expression evaluation by providers View Item get. Data() IModel. Context retrieve. Children() chidren expression

Expression evaluation by providers View Item get. Data() IModel. Context retrieve. Children() chidren expression Content Provider evaluate(): IEval. Result Debug Control evaluate(): IEval. Result Debug Services Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Expression Evaluation Intefaces IEval. Result evaluate(IModel. Context context, String expression); interface IModel. Context {

Expression Evaluation Intefaces IEval. Result evaluate(IModel. Context context, String expression); interface IModel. Context { IDebug. Control get. Debug. Control(); IModel. Context get. Parent(); IModel. Context[] get. Path(); String get. Expression(); String get. Service. Signature(); } interface IEval. Result { IStatus get. Status(); Object get. Data(); IModel. Context get. Model. Context(); } Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Expression protocol • • • • • #pda#threads#stack. is. Available #pda#threads#stack. frames[<index>]. name #pda#threads#stack.

Expression protocol • • • • • #pda#threads#stack. is. Available #pda#threads#stack. frames[<index>]. name #pda#threads#stack. frames[<index>]. file #pda#threads#stack. frames[<index>]. pc #pda#threads#stack. frames[<index>]. locals[<index>] #pda#data_stack. is. Available #pda#data_stack. values[<index>] #pda#connection. application #pda#connection. request_port #pda#connection. listen_port #pda#variables(<variable name>) Copyright © 2006 Wind River Systems – Released under EPL version 1. 0

Expression evaluation #pda #threads #stack . frames [0] . locals PDADebug. Control. Context PDAStack.

Expression evaluation #pda #threads #stack . frames [0] . locals PDADebug. Control. Context PDAStack. Context PDARun. Control. Context PDAStack. Frames. Idx. Context PDAStack. Context Copyright © 2006 Wind River Systems – Released under EPL version 1. 0