Top Banner
Remote Debugging and Reflection in Resource Constrained Devices Nikolaos Papoulias - December 2013 1
70

Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Aug 05, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Remote Debugging and Reflection in Resource Constrained DevicesNikolaos Papoulias - December 2013

����

! 1

Page 2: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Outline

Introduction

Related Work

Contributions

Implementation

Validation

Conclusion & Future Work

2

Page 3: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Context - Constrained Devices

Cannot locally support an IDE & Dev-Tools

Have different HW/SW Configurations from Dev-Machines3

Page 4: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Context - DebuggingConstrained Devices

Emulators

Post-Mortem Analysis

Developer's end Target Devices

Deployment

LogCollection

1

Coding / Compilation

2

Execution

3

45

Post-mortemanalysis

Logging4

Page 5: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Context - DebuggingConstrained Devices

Emulators

Post-Mortem Analysis

Deployment

Inspection

Coding / Compilation

2

Exec

utio

n

3

Action / Modification

14

5

Developer's end Target Devices

Remote Debugging5

Page 6: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Remote Debugging

Impact on productivity due to re-deployments [ZeroTurnAround 2011]

Lacks facilities otherwise available in a local setting (e.g O-Centric Debugging [Ressia 2012b])

Is a solution that is distributed in a nature:

6

Page 7: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Research Questions

What are the properties of an ideal remote debugging solution ?

Given these properties which model for remote debugging can exhibit them ?

What are the trade-offs between this ideal model and a real world implementation ?

7

Page 8: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Thesis Statement - Properties

InteractivenessInstrumentationDistributionSecurity

An ideal remote debugging solution should support

8

Page 9: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Interactiveness

the ability to incrementally update all partsof a remote application without losing the running

context (i.e without stopping the application).

Add/Rem Packages, Add/Rem Classes, Add/Rem Fields, Edit Hierarchy, Add/Rem Methods

9

Page 10: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Instrumentation

the ability to alter the semantics ofa running process in order to assist debugging

Method/Statement Execution, Class Instantiation/Field Read/WriteObject Read/Write/Send/Receive/Argument/Store/Interact

10

Page 11: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Distribution

the ability of a debugging solution to adapt its framework while debugging a remote target

No-Distribution / Fixed Middleware / Extensible Middleware / Adaptable Middleware

11

Page 12: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Security

the availability of prerequisites for security mechanisms such as

authentication and access restriction

Internal / External / Target-Side / Client-Side

12

Page 13: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Outline

Introduction

Related Work

Contributions

Implementation

Validation

Conclusion & Future Work

13

Page 14: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Related Work - Overview

Interactiveness (6)

Instrumentation (13)

Distribution (+++)

Security (4)

1 1 1 6 6 6 6

4 4 5 4 4 3 12

+ ++ + + + - -

3 4 2 3 3 0 0

GDB DCEJPDA .NET JREBEL SMALLTALK BIFROST

14

Page 15: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

1 1 1 6 6 6 6

4 4 5 4 4 3 12

+ ++ + + + - -

3 4 2 3 3 0 0

Related Work - Overview

GDB DCEJPDA .NET JREBEL SMALLTALK BIFROST(A) None of the existing solutions

met all of our criteria

(B) But reflective debugging proved

superior to other approaches in a local

setting15

Page 16: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

1 1 1 6 6 6 6

4 4 5 4 4 3 12

+ ++ + + + - -

3 4 2 3 3 0 0

Related Work - Overview

GDB DCEJPDA .NET JREBEL SMALLTALK BIFROST

(B) Since reflective debugging proved

superior to other approaches in a local

setting

(C) Investigate Remote Reflection

Design Patterns

16

Page 17: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Remote Reflection

DATA

PROGRAM

Meta System

INTERPRETER

Part of the world

DATA

PROGRAM

Reflective System

INTERPRETER

act uponrepresent

DISTRIBUTED-SELF-REPRESENTATION OF SYSTEM B

System A System B

Remote Proxy / Remote Facade / Mirrors

17

Page 18: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Mirrors - Explicit Meta-Objects

18

ObjectMirrorObject

anObject anObjectMIrrorreflects on

<<ObjectMirrorInterface>>

getClass()

Encapsulation StratificationOnt. Correspondance

Mirror on: anObjectIndirection

Page 19: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Design Patterns - Criteria

Extensibility, Re-use

Distribution

Identity [Bracha 2010]

Meta-recursion [Denker 2008]

Mirrors can be seen as an extension to both the remote proxy and

the remote facade patterns

19

Page 20: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Mirrors - Open Issues

Mirrors and the Problem of State - debugging meta-information in cohesive language kernels

Mirrors and Intercession - advanced instrumentation support while debugging

20

Page 21: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Outline

Introduction

Related Work

Contributions

Implementation

Validation

Conclusion & Future Work

21

Page 22: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Our Proposals

Α solution to the problem of Reflective-Data [Maes 1987b] in the context of mirrors [Bracha 2004]

The definition of a model for remote debugging that can exhibit the properties of: interactiveness, instrumentation distribution and security

MetaTalk

Mercury22

Page 23: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Our Proposal MetaTalk

From a language design perspective meta-objects should be both:

Pluggable as mirrors areand State-Full as 3-KRS meta-objects

23

Page 24: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

MetaTalk Kernel

Object

Point

Class

aPointBASE LEVEL META LEVEL

ObjectMirror ClassMirror

Mirror

AbstractMirrorObject

AbstractMirrorClass

Mirror on: ClassMirror on:

aPoint

Mirror on: Object

Mirror on: Point

24

Page 25: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

MetaTalk Implementation

MetaTalk-VM is written in PharoMetaTalk-Compiler relies on Petit-ParserObject-Model inspired by ObjVLisp

http://www.squeaksource.com/MetaTalk/

25

Page 26: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Our Proposals

Α solution to the problem of Reflective-Data [Maes 1987b] in the context of mirrors [Bracha 2004]

The definition of a model for remote debugging that can exhibit the properties of: interactiveness, instrumentation distribution and security

MetaTalk

Mercury26

Page 27: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Overview

DEBUGGED APPLICATION

DEVELOPER'S END TARGET

RUN-TIMEDEBUGGING SUPPORT

MIDDLEWARE

DEBUGGER / IDE

MODELOF THE DEBUGGED APP

MIDDLEWARE

Interactiveness - through a mirror-based remote meta-level that is causally connected to its target

Mercury

1

27

Page 28: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Core ModelTarget Side

Object Point

aPoint

instance ofRTSupport

RunTimeDebuggingSupport

+ objectinstVarAt(forObject: Object, anIvName: String): Object+ ...

.....

Mirror

- targetObject: Object

ObjectMirror

- rtMirror: RunTimeMirror

+ instVarAt(anIvName: String): ObjectMirror+ ...

mirrorOnAPoint

RunTimeMirror

- runTime: RTDebuggingSupport

+ objectinstVarAt(forObject: Object, anIvName: String): ObjectMirror+ ...

.....

aRunTimeMirror

runTimeDebuggingSupport

1*

1 1

reflects on

instance of

Development Side

MIDDLEWARE

28

Page 29: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Interactiveness

(2) Computational Reflection

ExceptionMirror

ProcessMirror

ContextMirror+ saveAndContinue(newSrc: String): ContextMirror

(1) Structural Reflection Mirror- targetObject: Object

RunTimeMirror- runTime: RunTimeDebuggingSupport

ObjectMirror- rtMirror: RunTimeMirror

+ setClass(aClassMirror: ClassMirror): ClassMirror

.....

EnvironmentMirror+ newPackageNamed(aPackageName: String): PackageMirror+ removePackageNamed(aPackageName: String): PackageMirror

ClassMirror+ setSuperClass(aClassMirror: ClassMirror): ClassMirror+ addInstVarName(anIvName: String): ClassMirror+ deleteInstVarName(anIvName: String): ClassMirror + addMethod(methodName: String, source: String): MethodMirror+ deleteMethod(methodName: String): MethodMirror

PackageMirror+ newClassNamed(aClassName: String): ClassMirror+ removeClassNamed(aClassName: String): ClassMirror

MethodMirror+ recompileWithSource(src: String): MethodMirror

29

Page 30: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Our Proposal - Overview

DEBUGGED APPLICATION

DEVELOPER'S END TARGET

RUN-TIMEDEBUGGING SUPPORT

MIDDLEWARE

DEBUGGER / IDE

MODELOF THE DEBUGGED APP

MIDDLEWARE

Instrumentation - through reflective intercession by reifying the underlying execution environment

2

30

Page 31: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

InstrumentationTarget Side Object

Closure

LocalCallBack

RemoteCallBack

ImplicitMetaObject- onReceive: Closure- onSend: Closure- onRead: Closure- onWrite: Closure….

InterpreterbaseMetaDict: Dictionary

RunTimeDebuggingSupport

+ ...+ objectHalt(): Object+ objectHaltOnReceive(): Object+ objectOnReceive(callBack: LocalCallBack)+ objectOnReceive(callBack: RemoteCallBack)

interpreter: Interpreter

values: Dictionary<Object>

MetaEnvironment

1

1

1

1

*

*

*

1

*1

31

Page 32: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Our Proposal - Overview

DEBUGGED APPLICATION

DEVELOPER'S END TARGET

RUN-TIMEDEBUGGING SUPPORT

MIDDLEWARE

DEBUGGER / IDE

MODELOF THE DEBUGGED APP

MIDDLEWARE

Distribution - through an Adaptable Middleware

3

32

Page 33: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Distribution

Middleware Deamon

Marshaller

DistributionPolicy Transporter

SecurityPolicy

33

Middleware Deamon

Marshaller

DistributionPolicy Transporter

SecurityPolicy

1 1

1

11

Page 34: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Our Proposal - Overview

DEBUGGED APPLICATION

DEVELOPER'S END TARGET

RUN-TIMEDEBUGGING SUPPORT

MIDDLEWARE

DEBUGGER / IDE

MODELOF THE DEBUGGED APP

MIDDLEWARE

Security - security by decomposing and authenticating access to reflective facilities

4a

4b

34

Page 35: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

SecurityDevelopment Side

Reflection

+ onEnvironment(environmentAddress: RemoteEnvironment) : EnvironmentMirrorRemoteEnvironment

- address: String

uses a

Mirror

- targetObject: Object

ObjectMirror

- rtMirror: RunTimeMirror

RunTimeMirror

- runTime: RunTimeDebuggingSupport

+ instVarAt(anIvName: String): ObjectIntrospectionMirror+ ...

IntrospectionMirrorForAPoint

instance of ObjectIntrospectionMirror

SecurityPolicy Process11 is invoked by

IntrercessionMirrorForAPoint

instance of

EnvironmentIntrospectionMirror

EnvironmentIntercessionMirror

ProcessIntrospectionMirror

ProcessIntercessionMirror

ObjectIntercessionMirror

+ instVarAtPut(anIvName: String, aValue: ObjectIntercessionMirror): ObjectIntercessionMirror+ ...

.....

35

Page 36: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Comparison

1 1 1 6 6 6 6 6

4 4 5 4 4 3 12 13

+ ++ + + + - - +++

3 4 2 3 3 0 0 4

GDB DCEJPDA .NET JREBEL SMALLTALK BIFROST MERCURY

36

Interactiveness (6)

Instrumentation (13)

Distribution (+++)

Security (4)

Page 37: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Outline

Introduction

Related Work

Contributions

Implementation

Validation

Conclusion & Future Work

37

Page 38: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Implementation Overview

Mercury-Core Mercury-Ui

Seamless MetaStackVM

(Alexandria)

http://ss3.gemstone.com/ss/Mercury-Prototype.html

http://ss3.gemstone.com/ss/Seamless.html

http://ss3.gemstone.com/ss/mSVM.html38

Page 39: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Meta-Recursion - mStackVM

39

Interpreter on: MessageReceived for: anObject do: [:reifications |

anObject incrementMessageCounter.anObject

perform: reifications selector withArguments: reifications arguments]

Ooops !

Page 40: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

MetaStackVM - Reflectogram

40

Interpreter on: MessageReceived for: anObject do: [:reifications :reflectogram |

reflectogram disable.anObject incrementMessageCounter.reflectogram enable.reflectogram

returnValue: reflectogram defaultAction]

Page 41: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

MetaStackVM - Reflectogram

41

Interpreter on: MessageReceived for: anObject do: [:reifications :reflectogram |

reflectogram disable.anObject incrementMessageCounter.reflectogram enable.reflectogram

returnValue: reflectogram defaultAction]

Reflectogram

+ ..+ enable+ disable+ remove+…+ defaultAction+ returnValue:+ …+ processMetaLevel+ objectMetaLevel+ …+ obj:perform:

Page 42: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Implementation Trade-offs

Through Local Reflection Through Virtual-Machine supportThrough Byte-code manipulation

Supporting Interactiveness and Instrumentation

42

Page 43: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Benchmark

No Instrumentation

Disabled Instrumentation

Enabled Instrumentation

1x 1x

1x 1x

35x 8x

Mercury

Benchmark basedon Tanter [Tanter 2003]

43

Page 44: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Outline

Introduction

Related Work

Contributions

Implementation

Validation

Conclusion & Future Work

44

Page 45: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Experimental Setting

Developer-Machine

Mac-Mini - (2.3 GHz / 4GB RAM)Ubuntu 12.04

Constraint Device (A)Phone

Galaxy Nexus - (1.2 GHz / 1GB RAM)Android 4.3

Constraint Device (B)Tablet

Galaxy Tab - (1.0 GHz / 1GB RAM)Android 4.0

Constraint Device (C)Remote Server

Running

HP Workstation - (2.3 GHz / 4GB RAM)Ubuntu 12.04

over wifi / usbover wifi / usb

over ethernet

ETH: 10.1.10.206WIFI: 10.1.160.116USB: PORT-FWD

WIFI: 10.1.160.158USB: PORT-FWD

ETH: 10.1.10.81WIFI: 10.1.160.92USB: PORT-FWD

Mercury IDE

45

Page 46: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Alexandria

46

Page 47: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Experimental Setting 47

Page 48: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

ObjectivesVerify the applicability of Mercury for these constrained debugging targets.

Illustrate how a debugging session benefits from Mercury’s properties

Remote Agile Debugging

Remote ObjectInstrumentation

Case-Study I Case-Study II

48

Page 49: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

49

Remote Agile Debugging

Phone: ’/charger’ Tablet: ’/default.prop’ Server: ’/User/.profile-xmind-portable-201212250029’

Suffix Bug

Page 50: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Remote Agile Debugging

Developer-Machine

Mac-Mini - (2.3 GHz / 4GB RAM)Ubuntu 12.04

Constraint Device (A)Phone

Galaxy Nexus - (1.2 GHz / 1GB RAM)Android 4.3

Constraint Device (B)Tablet

Galaxy Tab - (1.0 GHz / 1GB RAM)Android 4.0

Constraint Device (C)Remote Server

Running

HP Workstation - (2.3 GHz / 4GB RAM)Ubuntu 12.04

over wifi / usbover wifi / usb

over ethernet

ETH: 10.1.10.206WIFI: 10.1.160.116USB: PORT-FWD

WIFI: 10.1.160.158USB: PORT-FWD

ETH: 10.1.10.81WIFI: 10.1.160.92USB: PORT-FWD

Mercury IDE

50

FileBrowserTest

+ suffixOf: aString+ testSuffixWithDot+ testSuffixWithoutDot+ testLongFilePath

TestCaseFileBrowserTest

+ suffixOf: aString+ testSuffixWithDot+ testSuffixWithoutDot+ testLongFilePath

TestCase

FileBrowserTest

+ suffixOf: aString+ testSuffixWithDot+ testSuffixWithoutDot+ testLongFilePath

TestCase

Page 51: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Remote Agile Debugging 51

Page 52: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

ObjectivesVerify the applicability of Mercury for these constrained debugging targets.

Illustrate how a debugging session benefits from Mercury’s properties

Remote Agile Debugging

Remote ObjectInstrumentation

Case-Study I Case-Study II

52

Page 53: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

53

Remote Object Instrumentation

Suffix Bug

Phone: ’/charger’ Tablet: ’/default.prop’ Server: ’/User/.profile-xmind-portable-201212250029’

FileDirectory dot

Page 54: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Remote Object Instrumentation

54

Page 55: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Remote Object Instrumentation

55

Page 56: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Results

56

Page 57: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Outline

Introduction

Related Work

Contributions

Implementation

Validation

Conclusion & Future Work

57

Page 58: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Summary - Contributions

Identification of four desirable properties for remote debugging: interactiveness, instrumentation, distribution and security.

The definition of a model for remote debugging (Mercury) that exhibits these desirable properties.

A solution to the problem of Reflective-Data [Maes 1987b] in the context of mirrors [Bracha 2004] (MetaTalk)

58

Page 59: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Contributions

The reification of a previously illustrative notion (that of the reflectogram [Tanter 2003])

Prototype implementation of our model for remote debugging in the context of reflective languages.

Implementation of an adaptable middleware [David 2002] for supporting distribution (Seamless).

Implementation of a dedicated VM for Pharo (MetaStackVM) for advanced intercession facilities.

59

Page 60: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Diffusion of ResultsSubmitted/Published: Nikolaos Papoulias, Noury Bouraqadi, Marcus Denker, Stéphane Ducasse and Luc Fabresse. Towards Structural Decomposition of Reflection with Mirrors}. In Proceedings of International Workshop on Smalltalk Technologies (IWST’11), Edingburgh, United Kingdom, 2011. 105

Conference Talk: Nikolaos Papoulias. Seamless -- Let a thousand systems bloom. 20th International Smalltalk Conference, Ghent, Belgium, 2012.

To Be Submitted: Nikolaos Papoulias, Noury Bouraqadi, Luc Fabresse, Marcus Denker and Stéphane Ducasse. Mercury: Live Remote Debugging in Reflective Languages. To be submitted in The Journal of Object Technology.

To Be Submitted: Nikolaos Papoulias, Stéphane Ducasse, Marcus Denker, Guillermo Pollito, Noury Bouraqadi and Luc Fabresse. MetaTalk: Designing a Language with a Pluggable Meta-Level. To be submitted in The Journal for Universal Computer Science.

Invited Chapter: Nikolaos Papoulias. Seamless: an Adaptable Middleware Solution. Invited Chapter to be submitted for the forthcoming book Pharo in the Enterprise, by Square Bracket Associates.

60

Page 61: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Future Work

Language and Virtual-Machine Debugging in the Same ModelIntegration of Automated Debugging Techniques (e.g delta-debugging) in Developer-Driven Debugging

61

Page 62: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

MetaTalk

Mercury

����

Thank you !

!

62

Mercury-Core Mercury-Ui

Seamless MetaStackVM

(Alexandria)

Nick Papoulias 2013

Page 63: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Some time left ?Groovy !!

63

Page 64: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Collaborations

Seamless as a library for the Continuous integration services of Pharo.

The MetaTalk model as a case-study for bootstraping OO - languages.

Mercury integration with the PhaROS robotic middleware (on-going effort).

64

Page 65: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Design Patterns - Mirrors

Explicit meta-objectAbstract class / InterfaceFactoryFacade and Bridge

65

Page 66: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Conditional Meta-Action[:reifications :reflectogram |

reifications trigger halt. reflectogram override: true; returnValue: reflectogram defaultAction.

]

66

Page 67: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Seamless InitializationSeamlessDeamon class>>newDefaultWithGlobalAccess

^ self new buildWithTransporterClass: SeamlessSocketStreamTransporter transcoderClass: SeamlessFuelTranscoder proxyClass: SeamlessFastDNUProxy garbageCollectorClass: SeamlessDefaultGarbageCollector andAuthenticationManager: ((SeamlessAuthenticationManager new) addGroup: [...] withPolicy: (SeamlessDistributionPolicy

newWithEntryPoint: [...] classesToPassByValue: [...] classesToPassByShallowCopy: [...] andSecurityPolicy: (SeamlessSecurityPolicy

newWithClassesToPassByReference: [..] classesNotToReference: [..] includingMessages: [...] excludingMessages: [...]); addUser: [...] withPassword: [...] inGroup: [...]).

67

Page 68: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Seamless

SeamlessTranscoder SeamlessConnection

SeamlessTransporter

SeamlessObjectTransporter

SeamlessProtocol

SeamlessProcessManager

SeamlessDistributionTable

SeamlessDeamon

SeamlessSession

SeamlessAuthenticationManager

SeamlessDistributionStrategy

SeamlessUserGroup

SeamlessUser

SeamlessDistributionPolicy

SeamlessSecurityPolicy

68

Page 69: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

JMercury - Our model on top of Java

JPDA + DCE VM (Interactiveness)Reflex / ASM / JavaAssist (Instrumentation)Cajo Project (Distribution)Decomposed Hierarchy of Mirrors / Closer integration with SecurityManager (Security)

69

Page 70: Remote Debugging and Reflection in Resource Constrained Devices · 2015-11-03 · Remote Agile Debugging Developer-Machine Mac-Mini - (2.3 GHz / 4GB RAM) Ubuntu 12.04 Constraint

Emulators - Field Experience

IPhone/Android emulators (different models - versions of OSes - gyroscopes - touch gestures ...)Car-Team experience -- RoboShop 2013 Demo (unanticipated changes - people walking by - glass walls ...)

70