Using Advanced Platform Builder Debugger Features Chenghui Lian Microsoft China Technology Center.

Slides:



Advertisements
Similar presentations
purpose Search : automation methods for device driver development in IP-based embedded systems in order to achieve high reliability, productivity, reusability.
Advertisements

Dynamic Analysis of Windows Phone 7 apps Behrang Fouladi, SensePost.
Debugging Windows ® CE Applications And Systems David Streams Lead Program Manager Windows CE Tools Microsoft Corporation
Building Embedded Systems With Windows® CE Platform Builder 3
Introduction to HT-IDE3000 Micro-C development System Department.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
1-1 Embedded Software Development Tools and Processes Hardware & Software Hardware – Host development system Software – Compilers, simulators etc. Target.
OllyDbg Debuger.
Introduction Purpose Objectives Content Learning Time
1 Semester 2 Module 2 Introduction to Routers Yuda college of business James Chen
Cortex-M3 Debugging System
MDK-ARM Microcontroller Development Kit MDK: Microcontroller Development Kit.
EMB425 Using Advanced Platform Builder Debugger Features James Stulz Program Manager Windows CE Core Tools Microsoft Corporation.
EMB313 Increasing Developer Productivity With Windows CE 5.0
How To Write A Windows CE SDIO Client Driver
Joe Chen Sr. Manager, Insyde Software
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Main sponsor PicassoMonet + RembrandtMatejko + Canaletto How Debuggers Work Karl Rehmer Failures Come in Flavors Michael Nygard REST in Java Stefan Tilkov.
System Calls 1.
EMB318 Improve Product Quality Using Windows CE Error Reporting (Watson) James Stulz Program Manager Windows CE Core Tools Microsoft Corporation.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
Windows CE 5.0 Memory Architecture Li-Ming Fan Escalation Engineer Microsoft GCR-GTSC.
EMB426 Windows CE Memory Architecture Steve Maillet CEO/Chief Software Architect EmbeddedFusion.
MICE III 68000/20/30 MICETEK International Inc. CPU MICEIII MICEView Examples Contents Part 1: An introduction to the MC68000,MC68020 and Part.
EMB423 Creating A Trusted Environment For Windows CE 5.0 Nat Frampton President Real Time Development
ANDROID Presented By Mastan Vali.SK. © artesis 2008 | 2 1. Introduction 2. Platform 3. Software development 4. Advantages Main topics.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Providing Bluetooth Functionality on Embedded Devices: A look at Embedded Operating Systems and Bluetooth Stacks Brian Fox Supervisors: Dr Greg Foster.
Enabling Media Playback On Windows CE 5.0 Li-Ming Fan Escalation Engineer Microsoft GCR GTSC.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
UBI >> Contents Chapter 2 Software Development tools Code Composer Essentials v3: Code Debugging Texas Instruments Incorporated University of Beira Interior.
Non-Volatile Object Store And Hive Based Registry Design For Windows CE 刘由顺 软件架构师 北京华夏互动文化传播有限公司.
Module 6: Debugging a Windows CE Image.  Overview Debug Zones IDE Debug Setup IDE Debug Commands Platform Builder Integrated Kernel Debugger Other Debugging.
EMB424 Implementing Fault Tolerant Systems in Windows CE 5.0 Nat Frampton President Real Time Development
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
EMB427 Writing Real-Time Applications On Windows CE 5.0 Nat Frampton President Real Time Development Corporation
Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. James Y. Wilson Principal Engineer, Windows.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Developing Windows CE 5.0 OAL Li-Ming Fan Escalation Engineer Microsoft GCR-GTSC.
Msdevcon.ru#msdevcon. ИЗ ПЕРВЫХ РУК: ДИАГНОСТИКА ПРИЛОЖЕНИЙ С ПОМОЩЮ ИНСТРУМЕНТОВ VISUAL STUDIO 2012 MAXIM GOLDIN Senior Developer, Microsoft.
Windows ® 2000 Debugging André Vachon Development Lead Windows Debuggers Microsoft Corporation.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
CLI210 Introduction To Managed Development For Devices With Visual Studio 2005 Scott D. Smith Program Manager Visual Studio for Devices Microsoft Corporation.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
UDI Technology Benefits Slide 1 Uniform Driver Interface UDI Technology Benefits.
1 Advanced.Net Debugging Using Visual Studio, R# and OzCode IT Week, Summer 2015.
Develop VB in WinCE Maker : Axel Chou. Introduction to WinCE 3.0 One of the Microsoft Embedded System –WinCE 3.0 –Embedded NT 4.0 Customize : Minimize.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
Improving Your Application with IntelliTrace #ITDevConnections.
Introduction to Operating Systems Concepts
Mobile Device Development
Processes and threads.
Current Generation Hypervisor Type 1 Type 2.
Debugging with gdb gdb is the GNU debugger on our CS machines.
Lecture Topics: 11/1 General Operating System Concepts Processes
Architectural Support for OS
Module 6: Debugging a Windows CE Image
Architectural Support for OS
Code Composer Essentials 3.0
Overview of System Development for Windows CE.NET
Presentation transcript:

Using Advanced Platform Builder Debugger Features Chenghui Lian Microsoft China Technology Center

Agenda Introduction to the PB Kernel Debugger Tools for debugging Remote tools Demo

Debugger Architecture foo.exe KdStub (kd.dll) kernel (nk.exe) Windows CE Device Desktop cemgr.exe Platform Builder Debugger (cepb.exe) KITL

PB kernel debugger VC++ version 6 roots –Familiar UI –Rich in features System Debugger –Exceptions from any process –Stops interrupts while in break state –Uses KITL connections –HW Assist thru 3rd party support Debugging Applications –Slightly different from eVC

Debug build vs. retail build –Debug Full debugging on by default Optimizations off can be easier to debug More messages output –Retail Default: IMGNODEBUGGER =1 Optimizations enabled  Code Movement Less messages output

Debug/Retail Build vs. Debugger Debug/Retail build –Optimization off/on –Compiler options –Controlled by “set wincedebug=debug” or “set wincedebug=retail” Debugger –Modules included in run time image to enable debugging –Controlled by “set IMGNODEBUGGER=”

Tools for debugging System debugging Hardware-assisted debugging Kernel profiler

Target State: Running CE Target Control service (shell.exe) populates Data Windows Processes Moduales –Path to *.pdb for each loaded module –Image Address & Relocated Address –Can Manually Unload symbols Threads –Call Stack for each thread only available when device is in break-state

Process Window (run)

Modules Window (run)

Threads Window (run)

Target State: Halted Can set Breakpoints Threads window includes call stacks Can set behavior for Exceptions Call Stack Window Watches Window Auto / Locals / this Window Registers Window Memory Window Disassembly Window

What are Breakpoints? Replace instruction with trap (ie INT 3) Requires Write Access to Instruction Kernel will page-in memory and lock Source-level stepping is implemented with breakpoints Max 256 BP Can set BP in call stack, source, or disassembly

Types of Breakpoints Location Breakpoints Conditional Breakpoints –Based on expression (iFoo == 27) Data Breakpoints –When iFoo changes, break –Can watch an array, and can limit scope Message Breakpoints –Break when window message received in a specific context Cond., Data, and Msg Breakpoints are based on VS6 implementation

Edit \ Breakpoints (ctrl+b)

Exceptions Control KdStub passes all exceptions to debugger (when connected) Specify behavior per exception type –Stop Always Debugger will break on each instance of an exception –Stop if not handled Debugger will return control to application’s exception handler (first chance). Can add custom exception types

Target \ CE Exceptions

Call Stack Switch process / thread context easily Frame Pointer Parameter values and types Source file and line number Can set breakpoints on function return Can “go to source” on each frame Can quickly log entire callstack  output window

Call Stack Window

Disassembly Window Essential for debugging retail devices Can set breakpoints in disassembly Can be set to “Mixed Source” Mode Works best with Debug build Can “Jump to Source” Can view raw code bytes or assembler instructions All CE CPU types supported

Debug Zone What is the simplest software debugging technique? –Output debug messages from applications –OutputDebugString API function allows you to output a debug message You can control the output of debug messages using debug zone. –If a debug zone is open, all messages sent on behalf of this zone will be accepted. –If a debug zone is closed, all debug messages for this zone will be ignored.

Debug Zone Allows you to access the debug zones of any registered module Dynamically turn on or off any debug zone on your platform Makes it easier to locate a particular debug message in the debug stream

Dynamically turn on/off debug zone

Using Debug Zone in Your Code Include DbgApi.h header file in your source code Declare a DBGPARAM structure that contains: –Module name –A name for each debug zone –An initial mask for the output status of all debug zones DBGPARAM structure must be called dpCurSettings dpCurSettings must be a global variable in your module

Hardware Assisted Debugging Can debug device without KdStub! Requires a 3 rd party probe & driver Same look and feel, tight integration Can debug *all* code –Can debug Device Bootup (ie OEMInit()) –Interrupt Service Routines –Bootloaders Can set breakpoints / step in ROM Additional features provided by probe –Tracing, Triggers, etc…

HW Debugging: eXDI Debugger(PB) Probe ( JTAG,BDM… ) or Emulator CPU eXDI Callbacks eXDI Interface Plug-ins Plug-ins Plug-ins Plug-ins eXDI Callbacks Driver Optional 3 rd party interface OsAxS.dll Can launch

Limitations of HW Assist Potentially Expensive Fewer available breakpoints (generally) Potentially more complicated setup Because no KdStub… –No kernel Data Windows (when halted) –Cannot view / edit all memory Cannot page-in memory on demand –No Module Load Notifications No Deferred Breakpoints Static (manual refresh) Modules List

HW Debug Probe Vendors ARM - ARM cores EPI - ARM cores, XSCALE, MIPS IV Hitachi - SH3, SH4 MacGregor/Intel - XSCALE NEC/Midas – MIPS II, MIPS IV Special Computing - X86, AMD, NSC Geode

Just-In-Time Debugging Required: Passive KITL Exception Occurs (“first chance”) –if(dbgr)  passed to Debugger –if(!dbgr)  application’s exception handler is called If application does not handle (“second chance”) –if(!dbgr)  KdStub halts OS, waiting for debugger connection When Debugger connects, can debug failure!

Kernel Profiler Debugging tool to collect various information –Monte Carlo profiling –System call profiling –Instrumented kernel profiling

Kernel Profiler Controlling the kernel profiler –Using prof command –Using profiler API –Using keyboard on the target device Mode of kernel profiler –Buffered –Unbuffered

Remote tools Remote heap walker Remote process viewer Remote spy Remote call profiler Remote kernel tracker Remote performance monitor

Remote tools

Tools & Resources msdn.microsoft.com/ embedded microsoft.public. windowsxp.embedded windowsce.platbuilder windowsce.platbuilder windowsce.embedded.vc windowsce.embedded.vc blogs.msdn.com/ mikehall Windows CE 5.0 Eval Kit Windows XP Embedded Eval Kit msdn.microsoft.com/ mobility microsoft.public. pocketpc.developer smartphone.developer dotnet.framework.compactframework blogs.msdn.com/ windowsmobile vsdteam netcfteam Windows Mobile 5.0 Eval Kit Websites Newsgroups Blogs Tools Build Develop

请填写资料袋内的黄色大会来宾反馈表, 到大会接 待台领取大会纪念包。 请在课程结束后填写课程培训反馈表,参加抽奖。 您还可以: 参加 Windows Mobile 动手实验室; 参观微软及合作伙伴展区; 体验基于 Windows Mobile 平台开发的最新硬件产品及解决方案。 大会注意事项