Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
CDT/Archive/cdt-debug-dsf
< CDT | Archive(Redirected from CDT/cdt-debug-dsf)
Contents
- 1 Overview
- 2 Source
- 3 Features
- 3.1 Launching
- 3.2 Debug view
- 3.3 Displaying limited number of frames
- 3.4 Fast stepping
- 3.5 Variables view
- 3.6 Registers view
- 3.7 Expressions view
- 3.8 Modules view
- 3.9 All Variables views (variables, registers, expressions)
- 3.10 Update modes (variables, registers, expressions)
- 3.11 Number Format Detail Pane
- 3.12 Disassembly view
- 3.13 Memory view
- 4 Test Procedures
Overview
Source
Source plugins and features are located in CVS at /cvsroot/tools/org.eclipse.cdt/dsf.
Features
Launching
- Debug perspective activation on launch
- Debug view activated on breakpoint hit
- Initial selection after launch
Debug view
- Debug Target element
- Debug Target label
- Resume/suspend operations
- Terminating
- Target program completion and exit handling
- Thread element
- Thread label
- Resume/suspend operations
- Step operations
- Multi-threaded programs
- Manual thread refresh mode
- Stack Frame element
- Frame label
- Selection upon suspend
- Resume/suspend operations
- Step operations
- Source Display
- Source display upon stack frame selection
- Stepping through different files
- Breadcrumb usage
Displaying limited number of frames
- Preference
- Viewing additional trace using double-click/context menu
Fast stepping
- Stepping fast by holding down the F5 key
- The Instruction Pointer in the editor should be painted after every step
- The line high-lighting selection in the editor should disappear until stepping slows down
- Minimum step interval preference
- Delay stepping to update views preference
Variables view
- Variables display
- Variable name, address, type, value
- Complex variables (with child elements)
- Arrays
- Changing variable value
- Variables for active stack frame, thread, debug target
Registers view
- Register Group
- Label: name, description
- Register
- Label: name, type, description, value
- Editing values
- Bit Field: name, type, description, value
- Editing
- Mnemonics: viewing, selecting
Expressions view
- Adding new expressions
- Using context menu in variables view, registers view, editor
- Using drag and drop
- By typing in expression into the "New Expression" entry.
- Using the New Expression dialog.
- Expressions with child elements
- Removing expressions
- Preserving expanded state of elements when removing.
- Using "Remove All"
- Editing expressions
- In-line
- Using dialog
- Editing expression values
- Editor type (text vs. drop down, etc.) as dictated by the expression type
- Updates the corresponding value in other views
- Values update as they are modified in other views
Modules view
- Labels
- Detail pane info (type, symbols loaded, file, base address, size).
All Variables views (variables, registers, expressions)
- Default number format
- Updating
- When stepping
- When changing selection in Debug view
Update modes (variables, registers, expressions)
- Visibility controlled using the Debug Update Policies action set
- Selecting a mode
- Disabled when no DSF debug session active
- Persisted across debug sessions, workbench sessions.
- Automatic mode
- Manual mode
- Breakpoint hit mode
- Refresh Action
- Updates the change history
- Refresh All
Number Format Detail Pane
- Variables name and type
- Value shown in all available formats
Disassembly view
- Supports infinite scroll range
Memory view
- Supports standard memory renderings.
Test Procedures
PDA Example Debugger
Launching
- Launch a new program in the Debugger
- Debug view activated upon launch (if preference set)
- Check initial selection after launch
- If the program is suspended, top stack frame should be selected.
- If the program is running, the process should be selected.
- Launch a new program in the Debugger
Target/Launch/Processes
- Debug a new program
- Check label of debug target
- Try resume/suspend operations on debug target element
- All threads should resume/suspend
- Stepping operations should be disabled
- Terminate the target
- Terminated target should remain in the view with a "<terminated>" label prefix a terminated target icon. Alternatively, the target can simply be removed from the view.
- The launch should also have a "<terminated>" prefix in the view.
- Running program to the completion,
- Target should change state to terminated
- The process (node representing the process) should also change state to terminated.
- If all processes are in terminated state, the launch should also be in terminated state.
- Debug a new program
Threads
- Debug a new program
- Check the thread label
- Try resume/suspend operations on the thread element
- Single thread should resume/suspend
- Try step operations
- Launch a multi-threaded program
- New threads should be added to the bottom of the thread list as they are created
- Exiting threads are removed from the thread list
- When stepping a thread, other threads should remain collapsed/expanded as they were
- Enable the "Thread manual refresh mode" from the view menu
- New threads should not be added to the thread list, and old threads should remain.
- The refresh button in view should update the thread list.
- Debug a new program
Stack frames
- Stop a debugged program when it has at least two stack levels
- Frame label should contain:
- Stack frame number
- Function name if known
- File and line
- Current program counter
- Frame label should contain:
- Select a stack frame
- Source editor is opened and positioned to the location of the PC
- Run control operations should be the same as when a thread is selected
- When a thread hits a breakpoint, that thread's stack frame is automatically selected
- Stop a debugged program when it has at least two stack levels
Source Display
- Debug a program with multiple source files
- Set a breakpoint at a function call which is in another source file, and run to the breakpoint
- Check: the source file with the breakpoint is displayed
- Step into the function
- Check: the new source file is displayed at the start of the new function
Fast stepping
- Step fast by holding down the F5 key
- The Instruction Pointer in the editor should be painted after every step
- The line high-lighting selection in the editor should disappear until stepping slows down
- Enable minimum step interval using the preference page
- Enable delaying stepping to update views using the preference page
- Step fast by holding down the F5 key
Variables view
- Stop a debugged program when it has at least two stack levels
- Open variables view
- Check that all variables of the current stack are shown
- Check that all values are shown
- Check that the layout menu behaves as expected
- Check that complex variables have a little arrow on the left
- Check that the arrow can be expanded to show children
- Select different variables in the view and check that the details pane shows the different formats
- Scroll down in the variable view
- Check that newly displayed variables are correct
- Change the stack frame in the debug view
- Check that the variables view properly shows the variables for the selected stack frame
- Go back to the previous stack frame in the debug view
- Check that the variables view properly shows the variables for the selected stack frame
- Step the program
- Check that variable changes are reflected in the view and highlighted in color
- Select a variable and change its value in the variables view
- Check that the value is shown in the view
- Step the program
- Check that the value for the changed variable is still correct
Registers view
#include <stdio.h> #include <stdlib.h> void level_04( int level ) { printf( "yes we are\n" ); } void level_03( int level ) { printf( "yes we are\n" ); level_04( 4 ); } void level_02( int level ) { printf( "yes we are\n" ); level_03( 3 ); } void level_01( int level ) { printf( "yes we are\n" ); level_02( 2 ); } int main(void) { level_01( 1 ); puts("Are we having fun yet"); /* prints Are we having fun yet */ puts("Are we having fun yet"); /* prints Are we having fun yet */ puts("Are we having fun yet"); /* prints Are we having fun yet */ puts("Are we having fun yet"); /* prints Are we having fun yet */ puts("Are we having fun yet"); /* prints Are we having fun yet */ puts("Are we having fun yet"); /* prints Are we having fun yet */ return EXIT_SUCCESS; }
- Launch the GDB debugger with the above program.
- Step into until you are in the level_04() routine
- Bring up the register view ( leave all register groups unexpanded )
- Select between the various stack frames
- The Register Groups remain unexpanded.
- Now select stack frame level_04() and then expand the first ( perhaps only ) group in the Register view
- Now select the level_03() stack frame.
- See that the expanded group retains its expansion.
- Now select the level_02() stack frame.
- See that the expanded group retains its expansion.
- Now select the level_01() stack frame.
- See that the expanded group retains its expansion.
- Now select the main() stack frame.
- See that the expanded group retains its expansion.
- Now select the Thread[1] entry.
- See that the expanded group retains its expansion.
- Select the Launch entry for the current application
- The Registers view redraws showing nothing
- Reselect the level_04() stack frame
- Stretch the Register View to insure that the eip and eflags registers are visible
- Perform a Step_over
- The eip and eflags registers are highlighted as changed
- The eip indicates we are still at level_04 somewhere
- Step until back at level_03()
- The Registers View did not redraw
- The General Registers group retained its expansion
- The eip now indicates level_03 in it.
- Select the $eax register. Click in the "Value" field to begin cell editing.
- No matter what the current value, type in a 0x12
- The new value of $eax is 0x12
- With the registers group expanded scroll to the bottom of the view
- All registers update with what appear to be correct values
- Leave the registers group expanded - In the drop down menu tab select Number Format - Binary
- All currently expanded/displayed registers change to display their values in a BINARY form
- Leave the registers group expanded - In the drop down menu tab select Number Format - Octal
- All currently expanded/displayed registers change to display their values in a OCTALform
- Leave the registers group expanded - In the drop down menu tab select Number Format - Decimal
- All currently expanded/displayed registers change to display their values in a DECIMAL form
- Leave the registers group expanded - In the drop down menu tab select Number Format - Hex
- All currently expanded/displayed registers change to display their values in a HEX form
- Leave the registers group expanded - In the drop down menu tab select Number Format - Natural
- All currently expanded/displayed registers change to display their values in a NATURAL form
Registers view
(note: this section of the test is currently outdated)
- Debug the fibonacci.pda PDA program
- Set a breakpoint at the "var n" line within the fibonacci function
- Hit the F8 key 6 times so there are 6 stack frames showing
- Bring up the register view ( leave all register groups unexpanded )
- Select between the various stack frames
- The Register Groups remain unexpanded.
- Now select stack frame 6 and then expand the "General" group
- Now select and expand the "status" register within the "General" group
- Now select the level 5 stack frame.
- See that the expanded group retains its expansion.
- Now select the level 5 stack frame.
- See that the expanded group retains its expansion.
- Now select the level 4 stack frame.
- See that the expanded group retains its expansion.
- Now select the level 3 stack frame.
- See that the expanded group retains its expansion.
- Now select the level 2 stack frame.
- See that the expanded group retains its expansion.
- Now select the level 1 stack frame.
- See that the expanded group retains its expansion.
- Select the Launch entry for the current application
- The Registers view redraws showing nothing
- Reselect the level 6 stack frame
- Hit F8 until there are only 4 stack frames
- The Registers View did not redraw
- The General Registers group retained its expansion
- Select the $pc register. Click in the "Value" field to begin cell editing.
- The regxister could not be edited ( it is read only )
- With the registers group expanded scroll to the bottom of the view
- Leave the registers group expanded - In the drop down menu tab select Number Format - Binary
- All currently expanded/displayed registers change to display their values in a BINARY form
- Leave the registers group expanded - In the drop down menu tab select Number Format - Octal
- All currently expanded/displayed registers change to display their values in a OCTALform
- Leave the registers group expanded - In the drop down menu tab select Number Format - Decimal
- All currently expanded/displayed registers change to display their values in a DECIMAL form
- Leave the registers group expanded - In the drop down menu tab select Number Format - Hex
- All currently expanded/displayed registers change to display their values in a HEX form
- Leave the registers group expanded - In the drop down menu tab select Number Format - Natural
- All currently expanded/displayed registers change to display their values in a NATURAL form
Expressions view
- Stop a debugged program when it has at least two stack levels
- Open expressions view
- Create two or three expressions including some of children of variables
- Check that an expression can be added with the "Add new expression" line
- Check that an expression can be added with "Add Watch Expression" context menu
- Check that the created expressions are shown
- Check that expressions values are shown
- Check that the layout menu works as expected
- Check that complex expressions have a little arrow on the left
- Check that the arrow can be expanded to show children
- Select different expressions in the view and check that the details pane shows the different formats
- Add expressions to allow to scroll down in the expressions view
- Check that newly displayed expressions are correct
- Change the stack frame in the debug view
- Check that the expressions view properly shows the expressions for the selected stack frame
- Go back to the previous stack frame in the debug view
- Check that the expressions view properly shows the expressions for the selected stack frame
- Step the program
- Check that expressions changes are reflected in the view and highlighted in color
- Select a expressions and change its value in the expressions view
- Check that the value is shown in the view
- Step the program
- Check that the value for the changed expression is still correct
- Remove an expression using the context menu
- Check that the expression is removed
- Check that the same expression can be added again
- Check that expansion state is retained as expressions are added/removed.
- Remove all expressions using the context menu "Remove all..." command
- Check that all expressions are removed
- Check that expressions can be added again
- Modify an expression directly in the view
- Check that the expression changes and its value and type correspond to the new expression
Modules view
- Start a debug session and open the Modules view.
- Select the process in Debug view
- Check that the list of modules is shown in the Modules view.
- Select a thread then a stack frame in Debug view.
- Check that the Modules view still shows a list of loaded modules.
- Select a module in the modules view.
- Check that the detailed module info (type, symbols loaded, file, base address, size) are shown.
Update modes
Perform tests using one of: Variables, or Registers, or Expressions view
- Selecting a mode
- Before launching a program check that Update Modes menu is disabled.
- Start a program.
- Check: Update Modes menu is enabled.
- Select Manual Mode
- Check: Open the menu again and confirm that the Manual mode is selected.
- Terminate the program and relaunch
- Check: Confirm that the Manual mode is selected still.
- Terminate the Eclipse workbench and restart it, relaunch the program.
- Check: Confirm that the Manual mode is selected still.
- In another view, select the "Breakpoint Hit" mode.
- Check: In the first view, confirm that the Manual mode is still selected.
- Automatic mode
- Launch a program and select the automatic mode in the view.
- Step through the program .
- Check: Confirm that variables/registers ARE updated with every step.
- Run to a breakpoint.
- Check: Confirm that variables/registers ARE updated.
- Manual mode
- Select the Manual mode.
- Step through the code.
- Check: Verify that variables/registers ARE NOT updated.
- Run to a breakpoint.
- Check: Confirm that variables/registers ARE NOT updated.
- Breakpoint hit mode
- (Using one of: Variables, or Registers, or Expressions view)
- Select the Breakpoint hit mode
- Step through the code
- Check: Verify that variables/registers ARE NOT updated.
- Run to a breakpoint.
- Check: Confirm that variables/registers ARE updated.
- Refresh Action
- Select Manual update mode.
- Step through code
- Select the Refresh action.
- Check: Verify that variables/registers are updated and that changed values are highlighted.
- Select the Refresh action again.
- Check: Verify that variables/registers remain unchanged and that highlighted values are no longer highlighted.
- "Debug Update Modes" action set
- Update Policy, Refresh, Refresh All actions should only appear in view if the action set is active.