Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "CDT/Archive/cdt-debug-dsf"

< CDT‎ | Archive
m (Test Procedures)
m (Test Procedures)
Line 105: Line 105:
 
== Test Procedures ==
 
== Test Procedures ==
  
=== Testing Debug view with PDA Example ===
+
=== PDA Example Debugger ===
  
* ''Launching''
+
* Launching  
*; Launch a new program
+
*# Launch a new program in the Debugger
*: Debug view activated upon launch (if preference set)
+
*#* Debug view activated upon launch (if preference set)
*; Check initial selection after launch  
+
*# Check initial selection after launch  
*: If the program is suspended, top stack frame should be selected.
+
*#* If the program is suspended, top stack frame should be selected.
*: If the program is running, the process should be selected.
+
*#* If the program is running, the process should be selected.
 +
* 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.
 +
* 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.
 +
* 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
 +
*# 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
 +
*# 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
 +
* 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 ''(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

Revision as of 18:44, 5 January 2009

Leader

Overview

Features

Debug view

  • Launching
    • Debug perspective activation on launch
    • Debug view activated on breakpoint hit
    • Initial selection after launch
  • Debug Targe' 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
    • Displaying limited number of frames
      • Preference
      • Viewing additional trace using double-click/context menu
  • Source Display
    • Source display upon stack frame selection
    • Stepping through different files
  • 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

Bugs

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 (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

Back to the top