Talks on adb - Day 1 (pdf version)

9
Talks on Talks on adb adb Day 1 Day 1 [email protected] [email protected] 2010.07 2010.07

description

adb, debugging

Transcript of Talks on adb - Day 1 (pdf version)

Page 1: Talks on adb - Day 1 (pdf version)

Talks on Talks on adbadb

Day 1Day 1

[email protected]@tmax.co.kr2010.072010.07

Page 2: Talks on adb - Day 1 (pdf version)

DebuggerDebugger

Java DebuggingJava Debugging

Android Android

Debugging ToolsDebugging Tools

adbadb (Day 2)(Day 2)

Page 3: Talks on adb - Day 1 (pdf version)

DebuggerDebugger는는개발자들의개발자들의 고민을고민을덜어주고덜어주고 자유자유 시간을시간을보장한다보장한다..

Page 4: Talks on adb - Day 1 (pdf version)

DebuggerDebugger의의 작동작동 원리는원리는 그리그리 어렵지어렵지 않다않다

Debug Symbol Debug Symbol (PDB)(PDB)Line tableLine tablefor Profilingfor Profilingfor Dumpfor Dump

Event RequestEvent RequestSet BreakpointSet BreakpointSingle StepSingle Step

EventEventBreakpoint hitBreakpoint hitModule loadedModule loaded

Page 5: Talks on adb - Day 1 (pdf version)

JavaJava에서의에서의 DebuggingDebugging이라고이라고 크게크게다르지도다르지도 않을않을 것이다것이다

Debug Debug Symbol(PDBSymbol(PDB))Line tableLine tablefor Profilingfor Profilingfor Dumpfor Dump

Event RequestEvent RequestSet BreakpointSet BreakpointSingle StepSingle Step

EventEventBreakpoint hitBreakpoint hitDLL loadedDLL loaded

Debug Debug Symbol(classSymbol(class))Line tableLine tablefor Profilingfor Profilingfor Dumpfor Dump

Event RequestEvent RequestSet BreakpointSet BreakpointSingle StepSingle Step

EventEventBreakpoint hitBreakpoint hitClass loadedClass loaded

Page 6: Talks on adb - Day 1 (pdf version)

Java (Remote) Debugging: JPDAJava (Remote) Debugging: JPDA

JVMTIJVMTIagentagent

JNIJNIjavaagentjavaagent (BCI)(BCI)

JDWPJDWPcommand packetcommand packettransporttransport

JDI (JDI (com.sun.jdicom.sun.jdi)).connect.connect.event.event.request.requestListenerListener

VM----------back-end

front-end----------

UIJava Debug Interface

Java Debug Wire Protocol

Java VM Tool Interface

Components Debugger Interfaces

comm channel

Page 7: Talks on adb - Day 1 (pdf version)

javadtjavadt 데모데모 및및 Set Breakpoint Set Breakpoint 시나리오시나리오

Page 8: Talks on adb - Day 1 (pdf version)

Java (Remote) Debugging: JPDAJava (Remote) Debugging: JPDA

Debugger Debugging Server

Attaches by socket to other VMsAgent on the target VM- Supports JDWP to communicate with the debugger

suspendTransportService- Socket- SharedMemory

Gets a mirror of VMcom.sun.jdi.VirtualMachine

start debugger loop(JDIEventSource thread)

ClassPrepareEvent for a classVirtualMachine#eventQueue() Resolve & Create Breakpoint Request

JDWP.EventRequest.Set

(send packetstream)

!View slide note for event log

breakpoint hitshow it

!Confer to debug-related objects

register SourceListenerregister DebugListener

BreakpointEvent

(resolve)

Request resume

VM startClasses loaded

SetBreakpoint(jvmtiEnv* env…

Agent Event Callbacks

listen for a connection

Page 9: Talks on adb - Day 1 (pdf version)

traceviewtraceviewDDMSDDMSLogcatLogcat

jdwp