July 14-16, 2009 Eclipse-Based CodeWarrior Debugger QorIQ Multicore Linux Kernel Debug Bogdan Irimia CodeWarrior Software Engineer
Tool used to develop software running on Freescale Power Architecture processors Bare board applications Embedded Linux operating systems Capability to proceed through all the development stages familiar to software developers Creating projects and writing code Compiling and linking Debugging CodeWarrior Development Studio 2
CodeWarrior Debugger Support for debugging singlecore and multicore applications Bare board applications Boot loaders AMP and SMP Embedded Linux Kernels User space applications running on Embedded Linux Kernels Possibility to use the tool with : QorIQ P4080 Virtutech Simics Simulator P4080 Palladium Emulator QorIQ P2020 processor Other Freescale Power Architecture processors 3
Launch configurations Create, manage and run different debug configurations: Attach debug an application that is already running on a target Connect debug a target without an application Download download an application to a target, then debug or run the application 4
Debug Perspective Registers Variables Breakpoints Source and Disassembly views Memory System Browser 5
Debugging an 8 cores SMP Linux Kernel Debugging the kernel from the very first instruction Attach to u-boot and boot the kernel Start debugging the kernel from 0x0 until the final prompt and further Possibility to debug each core as it is being enabled by the kernel Debugging the kernel after boot Attach to the running kernel and inspect each core stack, registers, tasks, etc Ability to debug a Simulator (Simics) or Emulator (Palladium) kernel checkpoint or saved state 6
How do I debug the kernel early boot stage? Attach to the boot loader that will start the kernel Use a Hardware breakpoint at 0x0 to stop the debugger at entry point Boot the kernel and check the debugger after it stops at 0x0 7
How do I debug the kernel early boot stage? Possibility to debug the kernel before and after MMU initialization Each core will be targeted by the debugger when the kernel will start every second core Each core debug process can continue in parallel for the whole 8 cores 8
How do I inspect a core status? Find the core I m interested in and inspect the stack Check this core registers Check the tasks associated with this core 9
Every core can be individually suspended for inspecting its state or resumed to perform the next action or reach another point Cores can be grouped for multicore operations and breakpoint halt groups Possibility to inspect every task associated with a core Stack Variables Registers How do I control the cores behavior? 10
Set a breakpoint at the desired function and issue the kernel command from the prompt Check the core and the task which is processing this kernel action Inspect the stack and different function variables Continue debugging with breakpoints and stepping How do I debug a kernel command? 11
Possibility to debug the whole command execution even if the kernel will switch its execution to another core How do I debug a kernel command? Using Hardware breakpoints the user can check if a specific core will execute a function or not 12
How do I debug a kernel module? Set a breakpoint in the kernel modules loading function and insmod the kernel module Check the core and the task on which the module is being loaded Inspect the stack and different function variables Identify the debugged module in the System Browser modules view and load the symbolics 13
How do I debug a kernel module? Set some breakpoints in the modules functions and resume the kernel Inspect the different debug views for checking the registers, variables, data or instruction cache, etc Continue with different functions or go directly to the module cleanup function and kernel delete one 14
Possibility to debug the whole module even if the loading it s being made on one core and the unloading on another core How do I debug a kernel module? By using stepping and breakpoints the user can easily follow the execution path of its module from the kernel into the module and backwards on every core from the whole 8 ones 15
Q&A Thank you for attending this presentation. We ll now take a few moments for the audience s questions and then we ll begin the question and answer session. 16