CDT/cdt-debug-dsf

From Eclipsepedia

< CDT
Jump to: navigation, search

Contents

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

N&N Entry

  • 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

N&N Entry

  • Preference
  • Viewing additional trace using double-click/context menu

Fast stepping

N&N Entry

  • 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

N&N Entry

  • 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

N&N Entry

  • 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

N&N Entry

  • 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

N&N Entry

  • 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)

N&N Entry

  • 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

N&N Entry

  • Variables name and type
  • Value shown in all available formats

Disassembly view

N&N Entry

  • Supports infinite scroll range

Memory view

N&N Entry

  • Supports standard memory renderings.

Test Procedures

PDA Example Debugger

Launching

    1. Launch a new program in the Debugger
      • Debug view activated upon launch (if preference set)
    2. 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.

Target/Launch/Processes

    1. Debug a new program
      • Check label of debug target
    2. Try resume/suspend operations on debug target element
      • All threads should resume/suspend
      • Stepping operations should be disabled
    3. 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.
    4. 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.

Threads

    1. Debug a new program
      • Check the thread label
    2. Try resume/suspend operations on the thread element
      • Single thread should resume/suspend
    3. Try step operations
    4. 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
    5. 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.

Stack frames

    1. 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
    2. 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

Source Display

    1. Debug a program with multiple source files
    2. 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

    1. 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
    2. Enable minimum step interval using the preference page
    3. Enable delaying stepping to update views using the preference page

Variables view

    1. Stop a debugged program when it has at least two stack levels
    2. 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
    3. Scroll down in the variable view
      • Check that newly displayed variables are correct
    4. Change the stack frame in the debug view
      • Check that the variables view properly shows the variables for the selected stack frame
    5. 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
    6. Step the program
      • Check that variable changes are reflected in the view and highlighted in color
    7. Select a variable and change its value in the variables view
      • Check that the value is shown in the view
    8. 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;
   }
    1. Launch the GDB debugger with the above program.
    2. Step into until you are in the level_04() routine
    3. Bring up the register view ( leave all register groups unexpanded )
    4. Select between the various stack frames
      • The Register Groups remain unexpanded.
    5. Now select stack frame level_04() and then expand the first ( perhaps only ) group in the Register view
    6. Now select the level_03() stack frame.
      • See that the expanded group retains its expansion.
    7. Now select the level_02() stack frame.
      • See that the expanded group retains its expansion.
    8. Now select the level_01() stack frame.
      • See that the expanded group retains its expansion.
    9. Now select the main() stack frame.
      • See that the expanded group retains its expansion.
    10. Now select the Thread[1] entry.
      • See that the expanded group retains its expansion.
    11. Select the Launch entry for the current application
      • The Registers view redraws showing nothing
    12. Reselect the level_04() stack frame
    13. Stretch the Register View to insure that the eip and eflags registers are visible
    14. Perform a Step_over
      • The eip and eflags registers are highlighted as changed
      • The eip indicates we are still at level_04 somewhere
    15. 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.
    16. Select the $eax register. Click in the "Value" field to begin cell editing.
    17. No matter what the current value, type in a 0x12
      • The new value of $eax is 0x12
    18. With the registers group expanded scroll to the bottom of the view
      • All registers update with what appear to be correct values
    19. 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
    20. 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
    21. 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
    22. 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
    23. 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)

    1. Debug the fibonacci.pda PDA program
    2. Set a breakpoint at the "var n" line within the fibonacci function
    3. Hit the F8 key 6 times so there are 6 stack frames showing
    4. Bring up the register view ( leave all register groups unexpanded )
    5. Select between the various stack frames
      • The Register Groups remain unexpanded.
    6. Now select stack frame 6 and then expand the "General" group
    7. Now select and expand the "status" register within the "General" group
    8. Now select the level 5 stack frame.
      • See that the expanded group retains its expansion.
    9. Now select the level 5 stack frame.
      • See that the expanded group retains its expansion.
    10. Now select the level 4 stack frame.
      • See that the expanded group retains its expansion.
    11. Now select the level 3 stack frame.
      • See that the expanded group retains its expansion.
    12. Now select the level 2 stack frame.
      • See that the expanded group retains its expansion.
    13. Now select the level 1 stack frame.
      • See that the expanded group retains its expansion.
    14. Select the Launch entry for the current application
      • The Registers view redraws showing nothing
    15. Reselect the level 6 stack frame
    16. Hit F8 until there are only 4 stack frames
      • The Registers View did not redraw
      • The General Registers group retained its expansion
    17. Select the $pc register. Click in the "Value" field to begin cell editing.
      • The regxister could not be edited ( it is read only )
    18. With the registers group expanded scroll to the bottom of the view
    19. 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
    20. 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
    21. 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
    22. 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
    23. 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

    1. Stop a debugged program when it has at least two stack levels
    2. Open expressions view
    3. 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
    4. Add expressions to allow to scroll down in the expressions view
      • Check that newly displayed expressions are correct
    5. Change the stack frame in the debug view
      • Check that the expressions view properly shows the expressions for the selected stack frame
    6. 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
    7. Step the program
      • Check that expressions changes are reflected in the view and highlighted in color
    8. Select a expressions and change its value in the expressions view
      • Check that the value is shown in the view
    9. Step the program
      • Check that the value for the changed expression is still correct
    10. 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.
    11. Remove all expressions using the context menu "Remove all..." command
      • Check that all expressions are removed
      • Check that expressions can be added again
    12. Modify an expression directly in the view
      • Check that the expression changes and its value and type correspond to the new expression

Modules view

    1. Start a debug session and open the Modules view.
    2. Select the process in Debug view
      • Check that the list of modules is shown in the Modules view.
    3. Select a thread then a stack frame in Debug view.
      • Check that the Modules view still shows a list of loaded modules.
    4. 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.
    1. Start a program.
      • Check: Update Modes menu is enabled.
    2. Select Manual Mode
      • Check: Open the menu again and confirm that the Manual mode is selected.
    3. Terminate the program and relaunch
      • Check: Confirm that the Manual mode is selected still.
    4. Terminate the Eclipse workbench and restart it, relaunch the program.
      • Check: Confirm that the Manual mode is selected still.
    5. In another view, select the "Breakpoint Hit" mode.
      • Check: In the first view, confirm that the Manual mode is still selected.
  • Automatic mode
    1. Launch a program and select the automatic mode in the view.
    2. Step through the program .
      • Check: Confirm that variables/registers ARE updated with every step.
    3. Run to a breakpoint.
      • Check: Confirm that variables/registers ARE updated.
  • Manual mode
    1. Select the Manual mode.
    2. Step through the code.
      • Check: Verify that variables/registers ARE NOT updated.
    3. Run to a breakpoint.
      • Check: Confirm that variables/registers ARE NOT updated.
  • Breakpoint hit mode
    1. (Using one of: Variables, or Registers, or Expressions view)
    2. Select the Breakpoint hit mode
    3. Step through the code
      • Check: Verify that variables/registers ARE NOT updated.
    4. Run to a breakpoint.
      • Check: Confirm that variables/registers ARE updated.
  • Refresh Action
    1. Select Manual update mode.
    2. Step through code
    3. Select the Refresh action.
      • Check: Verify that variables/registers are updated and that changed values are highlighted.
    4. 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
    1. Update Policy, Refresh, Refresh All actions should only appear in view if the action set is active.