EMB425: Using Advanced Platform Builder Debugger Features

Download Report

Transcript EMB425: Using Advanced Platform Builder Debugger Features

EMB425
Using Advanced Platform
Builder Debugger
Features
James Stulz
Program Manager
Windows CE Core Tools
Microsoft Corporation
Hardware/Drivers
OEM/IHV Supplied
Programming
Model
Data
Device Building
Tools
BSP
(ARM, SH4, MIPS)
EDB
SQL Server 2005 Mobile Edition
Relational
Native
Server Side
Standard PC
Hardware and Drivers
Windows XP DDK
Windows Embedded
Studio
Platform Builder
Lightweight
Managed
OEM Hardware and
Standard Drivers
SQL Server 2005 Express Edition
SQL Server 2005
Win32
MFC 8.0, ATL 8.0
.NET Compact Framework
ASP.NET Mobile Controls
.NET Framework
ASP.NET
Windows Media
DirectX
Multimedia
Location Services
MapPoint
Development Tools
Visual Studio 2005
Internet Security and Acceleration Server
Exchange Server
Live Communications Server
Speech Server
Communications
& Messaging
Device Update Agent
Management
Tools
Image Update
Software Update Services
Systems Management Server
Microsoft Operations Manager
Agenda
Introduction to the PB
Kernel Debugger
Build Requirements
Debugger Settings
Advanced Features
Demo
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
Build Requirements
Retail builds
This is the default build
Debugger support is not on
Easy to add using PB
Enable Kernel Debugger (IMGNODEBUGGER= )
Enable KITL connectivity (IMGNOKITL=)
Debugging optimized code
Beware of code movement
View assembly
Set extra safety breakpoints
Some variables optimized away
Build Requirements
Debug builds
Not the default but easy to select
Debugger support is on
Full debug symbols support
Disadvantages
Not the code that ships
Some bugs only happen in retail builds
Build Requirements
HW assist debugging
Default (without IMGHDSTUB=1)
No OS Awareness
Load notifications
OS events/exceptions
No processes/threads data
Retail builds
Add IMGHDSTUB=1
Debug builds
Do not enable Kernel Debugger
(IMGNODEBUGGER=1)
Add IMGHDSTUB=1
Debugger Settings
Selecting The Debugger
Under Target\Connectivity Options
Default for Debug build is SW Assist
No options for HW Assist until eXDI
driver is installed
Debugger Settings
Just in time debugging
Enable Passive KITL
Requires a code change in the OAL
Run device as normal
Wait for a unhandled 2nd chance
exception on device
Unfortunately, there is no device UI
Attach the debugger
Debugger Settings
Post build debugging
Image was built with
IMGNODEBUGGER=
Requires KITL in the Image
Load the debugger support
Loaddbg.exe
Attach the debugger
Debugger Settings
Verbosity
Dialogs and message boxes have the
option “Don’t show me again”
To get them back settings under
Tools\options\Verbosity
Debugger Settings
Detaching the debugger
By default the device will still catch
debug events
If you want it to continue as a device
without debug support
Check the option Disable kdstub on Stop
Debugging in Tools\Options\Debug
Features
Breakpoints in ROM
Only works on code in Virtual memory
User code
Not Kernel
Limited to 10 VM pages simultaneously
Relies on the correct description of
ROM addresses from the OAL
Features
Breakpoint instances
New Breakpoint List window
Dockable and not modal
Tree control breakpoint lists
Generic top level description
Specific descriptions for instances
All instances are listed
Before this feature the debugger got
confused by multiple instances
Features
Deferred breakpoints
Not red (Some people see pink,
others see purple)
Colors are configurable
Waits for a module load
When it finds the symbol, it turns red
Features
Set breakpoints while running
Set as deferred
Instantiated at the next stopping event
If it stays deferred, it will not get hit
Features
Context specifier
Stopped in a context where a variable
or function is Not defined
{function,source,module}symbol_name
E.g.,
{,,coredll.dll}LocalAlloc
Features
Release directory modules
Instruct the loader to load from the
FlatRelDir instead of from the image
Advantage
Fast debugging turnaround
Remember to remove them when you
are done
Features
Source path mapping
Solves the build lab problem
Exposing the mapping to the user
Search order from top tp bottom
Remaps breakpoints on changes
Features
HW assist debugging
Doesn’t require a KITL enabled image
Debug before kd loads
Debug all code on the device (Bootloaders, ISRs, etc.)
Use HW resources (Registers, BPs, etc.)
Non intrusive
Full debugging support requires a hd component
on the device
JTAG pins must be available
Requires specific/compatible probe/eXDI support for
the architecture
HW Assist Vendors
Architecture
ARM4I
XScale
MIPS
SH3, SH4
Vendor
ARM – MultiICE
EPITools – Majic
Aiji – A900
Macgregor – Raven (Thru Intel)
EPITools - Majic
Hitachi – E10a
If you have a favorite Probe vendor that does not provide an
eXDI driver have them contact me
[email protected]
Debugger
James Stulz
Program Manager
Windows CE Core Tools
While at MEDC 2005…
Fill out an evaluation for this session
Randomly selected instant WIN prizes!
Visit the Microsoft Product Pavilion
in the Exhibit Hall
Shorelines B
Use real technology in a lab
Instructor led
Reef E/F & Breakers L
Self-paced
Reef B/C
After The Conference…
Build
Install
Full-featured trial versions of Windows CE
and/or Windows XP Embedded
Build
Cool stuff & tell us about it:
msdn.microsoft.com/embedded/community
Join
Windows Embedded Partner Program:
www.mswep.com
Develop
Install
Windows Mobile 5.0 Eval Kit including
Visual Studio 2005 Beta 2
Enter
Mobile2Market Contest and win up to $25000:
mobile2marketcontest.com
Join
Microsoft Solutions Partner Program:
partner.microsoft.com
Tools & Resources
Build
Develop
msdn.microsoft.com/
embedded
msdn.microsoft.com/
mobility
microsoft.public.
windowsxp.embedded
windowsce.platbuilder
windowsce.embedded.vc
microsoft.public.
pocketpc.developer
smartphone.developer
dotnet.framework.compactframework
Blogs
blogs.msdn.com/
mikehall
blogs.msdn.com/
windowsmobile
vsdteam
netcfteam
Tools
Windows CE 5.0 Eval Kit
Windows XP Embedded Eval Kit
Windows Mobile 5.0 Eval Kit
Websites
Newsgroups
© 2005 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.