TS 72 CNDdebugger

(Difference between revisions)
(Test suite: Debugger Actions)
 
(10 intermediate revisions not shown)
Line 4: Line 4:
'''Lastupdate:''' 28.03.2012 <br>
'''Lastupdate:''' 28.03.2012 <br>
'''Introduction:''' Test specification for Debugger support in NetBeans 7.2 C/C++ Pack<br>
'''Introduction:''' Test specification for Debugger support in NetBeans 7.2 C/C++ Pack<br>
 +
'''Setup:''' On Windows install Cygwin or MinGW + MSYS. See [http://netbeans.org/community/releases/71/cpp-setup-instructions.html#compilers C++ setup instructions]<br>
 +
'''Comments:''' Some tests require GDB 7.4<br>
 +
'''Important:''' On Windows all tests should be done using both Cygwin and MinGW tools<br>
__TOC__
__TOC__
<br>
<br>
-
====Test suite: Debugger Actions====
 
 +
====Test suite: Debugger Actions====
# {{testcase|Start debugging}}
# {{testcase|Start debugging}}
##create a sample application
##create a sample application
Line 16: Line 19:
##*start via project context menu  
##*start via project context menu  
##verify that debugger started correctly  
##verify that debugger started correctly  
-
 
# {{testcase|Step Into Project}}
# {{testcase|Step Into Project}}
##create a sample application
##create a sample application
##do step into project
##do step into project
-
###step into via project context menu
+
##*step into via project context menu
-
###step into via main menu  
+
##verify that debugger started correctly  
##verify that debugger started correctly  
 +
# {{testcase|Step Over}}
 +
##create a sample application
 +
##do step into project
 +
##do step over
 +
##*step over via main menu
 +
##*step over via toolbar
 +
##*step over via shortcut
 +
##verify that debugger stepped over correctly
 +
# {{testcase|Step Into}}
 +
##create a sample application with functions (e.g. Quote)
 +
##do step into project
 +
##do step into function
 +
##*step into via main menu
 +
##*step into via toolbar
 +
##*step into via shortcut
 +
##verify that debugger stepped into function correctly
 +
##do step into system function
 +
##*step into via main menu
 +
##*step into via toolbar
 +
##*step into via shortcut
 +
##verify that debugger stepped into function correctly
 +
# {{testcase|Step Out}}
 +
##create a sample application with functions (e.g. Quote)
 +
##do step into project
 +
##do step into function
 +
##do step out function
 +
##*step out via main menu
 +
##*step out via toolbar
 +
##*step out via shortcut
 +
##verify that debugger stepped out function correctly
 +
##do step into system function
 +
##do step out system function
 +
##*step out via main menu
 +
##*step out via toolbar
 +
##*step out via shortcut
 +
##verify that debugger stepped out function correctly
 +
##do step out 'main' function
 +
##*step out via main menu
 +
##*step out via toolbar
 +
##*step out via shortcut
 +
##verify that debugger stepped out main function correctly
 +
# {{testcase|Continue}}
 +
##create a sample application
 +
##set a breakpoint in the main function
 +
##start debugger
 +
##when debugger stops at BP do continue
 +
##*continue out via main menu
 +
##*continue out via toolbar
 +
##*continue out via shortcut
 +
##verify that debugger continued execution correctly
 +
# {{testcase|Pause}}
 +
##create an application with an endless loop
 +
##start debugger
 +
##when debugger starts do pause
 +
##*pause out via main menu
 +
##*pause out via toolbar
 +
##*pause out via shortcut
 +
##verify that debugger paused execution correctly
 +
# {{testcase|Finish}}
 +
##create a sample application
 +
##do step into project
 +
##do finish
 +
##*finish out via main menu
 +
##*finish out via toolbar
 +
##*finish out via shortcut
 +
##verify that debugger finished execution correctly
 +
# {{testcase|Make Current}}
 +
##create a sample application with functions (e.g. Quote)
 +
##do step into project
 +
##do step into function
 +
##open Call Stack view
 +
##select any stackframe and make it current
 +
##verify that Local Variables view and Watches were updated accordingly
 +
# {{testcase|Pop To Here}}
 +
##create a sample application with functions (e.g. Quote)
 +
##do step into project
 +
##do step into function
 +
##open Call Stack view
 +
##select caller stackframe and do pop to here
 +
##verify that debugger stops in caller function
 +
# {{testcase|Pop Topmost Call}}
 +
##create a sample application with functions (e.g. Quote)
 +
##do step into project
 +
##do step into function
 +
##open Call Stack view
 +
##open Debug menu Stack section and do pop topmost call
 +
##verify that debugger stops in topmost caller function
 +
# {{testcase|Make Caller Current}}
 +
##create a sample application with functions (e.g. Quote)
 +
##do step into project
 +
##do step into function
 +
##open Call Stack view
 +
##open Debug menu Stack section and make caller current
 +
##verify that Local Variables view and Watches were updated accordingly
 +
# {{testcase|Make Callee Current}}
 +
##create a sample application with functions (e.g. Quote)
 +
##do step into project
 +
##do step into function
 +
##open Call Stack view
 +
##open Debug menu Stack section and make caller current
 +
##open Debug menu Stack section and make callee current
 +
##verify that Local Variables view and Watches were updated accordingly
-
    Step Over
+
====Test suite: Debugger Views====
-
        create a sample application
+
'''Setup:''' Install Python libstdc++ and make changes in .gdbinit. See [http://sourceware.org/gdb/wiki/STLSupport STLSupport]<br>
-
        do step into project
+
# {{testcase|check views, open, close etc.}}
-
        do step over
+
##create a sample application
-
            step over via main menu
+
##do step into project
-
            step over via toolbar
+
##check Local Variables view, open, close, change visible columns etc.
-
            step over via shortcut
+
##check Watches view, open, close, change visible columns etc.
-
        verify that debugger stepped over correctly
+
##check Call Stack view, open, close, change visible columns etc.
 +
##check Sessions view, open, close, change visible columns etc.
 +
##check Breakpoints view, open, close, change visible columns etc.
 +
##check Threads view, open, close, change visible columns etc.
 +
##check Registers view, open, close, change visible columns etc.
 +
##check Memory view, open, close, change visible columns etc.
 +
# {{testcase|Variables}}
 +
##create a sample or some specific application
 +
##do step into project
 +
##check Variables in sample projects
 +
##check Variables in function
 +
##check numbers (short, int, long, float, double)
 +
##check char
 +
##check pointers
 +
##check arrays
 +
##check unions
 +
##check classes
 +
##check structures
 +
##modify values
 +
##check that values are updated accordingly
 +
# {{testcase|Watches}}
 +
##create a sample or some specific application
 +
##do step into project
 +
##create a new watch
 +
##customize watch
 +
##delete watch
 +
##watch for function
 +
##modify values
 +
##check that values are updated accordingly
 +
# {{testcase|Pretty Printers in Variables and Watches}}
 +
##create Quote sample (or some specific application which uses STL containers)
 +
##set Function breakpoint on "outCustomersList" function
 +
##start debugging
 +
##when the debugger stops in "outCustomersList" function open Variables or Watches
 +
##add a new watch for "customers"
 +
##expand the watch and check that elements of "customers" list are shown properly in user friendly manner
 +
# {{testcase|Call Stack}}
 +
##create a sample application with functions (e.g. Quote)
 +
##do step into project
 +
##call stack representation
 +
##see call stack actions
 +
# {{testcase|Breakpoints}}
 +
##create a sample or some specific application
 +
##set several breakpoint
 +
##do step into project
 +
##open Breakpoints view
 +
##check breakpoint representation
 +
##check Go To Source option
 +
##diasable BP
 +
##check that debugger ignore disabled BP
 +
##disable all BPs
 +
##check that debugger ignore disabled BPs
 +
##enable BP
 +
##check that debugger stops at BP
 +
##enable all BPs
 +
##check that debugger stops at BPs
 +
##customize BP (see Breakpoints section)
 +
##*line number
 +
##*condition
 +
##*count limit
 +
##*while in
 +
##*action
 +
##check that changed options has effect
 +
##delete BP
 +
##check that debugger does not stop at BP
 +
##delete all BPs
 +
##check that debugger does not stop at any BP
 +
# {{testcase|Sessions}}
 +
##create two or more sample or specific applications
 +
##set several breakpoint in these applications
 +
##do step into project or start debugger for each application
 +
##open Sessions view
 +
##check sessions representation in Sessions view
 +
##switch between sessions and check that Local Variables and Watches are changed accordingly
 +
# {{testcase|Threads}}
 +
##create a multi-threaded application
 +
##do step into project and do steps needed to create new threads
 +
##open Threads view
 +
##check threads representation
 +
##switch between threads and check that Local Variables and Watches are changed accordingly
 +
# {{testcase|Memory}}
 +
##create an application which modifies memory
 +
##do step into project
 +
##open Memory view and check memory content at the specific address
 +
##do some steps and check that memory content is changed accordingly
 +
# {{testcase|Disassembly}}
 +
##create a sample application
 +
##do step into project
 +
##open Disassembly view and check disassembled source code
 +
##do some steps and check that cursor moves accordingly
 +
# {{testcase|Registers}}
 +
##create a sample application
 +
##do step into project
 +
##open Registers view and check its content
 +
##do some steps and check that content is changed accordingly
 +
# {{testcase|Debugger Console}}
 +
##create a sample application
 +
##do step into project
 +
##open Debugger Console
 +
##do some steps and check console output
 +
# {{testcase|Output}}
 +
##create a sample application that needs input and produces output (e.g. Quote)
 +
##set Run/Console Type property to Internal Terminal
 +
##do step into project
 +
##do some steps and check that needed data can be entered and check output
 +
# {{testcase|External Terminal output}}
 +
##create a sample application that needs input and produces output (e.g. Quote)
 +
##set Run/Console Type property to External Terminal
 +
##do step into project
 +
##check that a new terminal window appears
 +
##do some steps and check that needed data can be entered and check output
-
    Step Into
+
====Test suite: Breakpoints====
-
        create a sample application with functions (e.g. Quote)
+
# {{testcase|Function BP}}
-
        do step into project
+
##create a sample application containing function calls (e.g. Quote)
-
        do step into function
+
##call Debug/New Breakpoint from the main menu
-
            step into via main menu
+
##set a breakpoint type to Function then enter function name and press OK
-
            step into via toolbar
+
##start debugger and check that created breakpoint does work
-
            step into via shortcut
+
##check that the breakpoint is displayed correctly in Breakpoints view  
-
        verify that debugger stepped into function correctly
+
# {{testcase|Line BP}}
-
        do step into system function
+
##create a sample application
-
            step into via main menu
+
##call Debug/New Breakpoint from the main menu
-
            step into via toolbar
+
##set a breakpoint type to Line then enter a desirable line number and press OK
-
            step into via shortcut
+
##start debugger and check that created breakpoint does work
-
        verify that debugger stepped into function correctly
+
##check that the breakpoint is displayed correctly in Breakpoints view  
-
 
+
# {{testcase|Address BP}}
-
    Step Out
+
##create a sample application
-
        create a sample application with functions (e.g. Quote)
+
##do step into project
-
        do step into project
+
##open Disassembly view and remember an address where a breakpoint can be set
-
        do step into function
+
##call Debug/New Breakpoint from the main menu
-
        do step out function
+
##set a breakpoint type to Address then enter a desirable address and press OK
-
            step out via main menu
+
##continue debugging and check that created breakpoint does work
-
            step out via toolbar
+
##check that the breakpoint is displayed correctly in Breakpoints view  
-
            step out via shortcut
+
# {{testcase|Toggle BP}}
-
        verify that debugger stepped out function correctly
+
##create a sample application
-
        do step into system function
+
##click on the gutter next to line in the editor where a breakpoint should be set
-
        do step out system function
+
##check that the breakpoint is created and a breakpoint annotation is added to the source file in the editor
-
            step out via main menu
+
##start debugger and check that created breakpoint does work
-
            step out via toolbar
+
##check that the breakpoint is displayed correctly in Breakpoints view  
-
            step out via shortcut
+
# {{testcase|Variable BP (Requires GDB 7.4 or higher)}}
-
        verify that debugger stepped out function correctly
+
##create a sample application (e.g. Welcome)
-
        do step out 'main' function
+
##do Step Into project
-
            step out via main menu
+
##do Step Over until the debugger cursor is inside "for" ("i" should be in scope)
-
            step out via toolbar
+
##create a new Variable breakpoint for "i"
-
            step out via shortcut
+
##check that the breakpoint is displayed correctly in Breakpoints view ("Change of i")
-
        verify that debugger stepped out main function correctly
+
##do Continue
-
 
+
##check that the debugger stops at the Variable breakpoint every time when "i" is incremented 
-
    Continue
+
# {{testcase|System Call BP (Requires GDB 7.4 or higher)}}
-
        create a sample application
+
##create a sample application (e.g. Welcome)
-
        set a breakpoint in the main function
+
##create a new System Call breakpoint (All System Calls, On Entranse)
-
        start debugger
+
##check that the System Call breakpoint is displayed correctly in Breakpoints view
-
        when debugger stops at BP do continue
+
##disable the System Call breakpoint
-
            continue out via main menu
+
##do Step Into project
-
            continue out via toolbar
+
##enable the System Call breakpoint
-
            continue out via shortcut
+
##continue debugging
-
        verify that debugger continued execution correctly
+
##check that the debugger stops at System Call when "std:cout<<..." line is executed
-
 
+
##open Call Stack view and check that the current frame is system call
-
    Pause
+
##do Continue several times checking Call Stack
-
        create an application with an endless loop
+
##customize the System Call breakpoint (change setting to "On Exit")
-
        start debugger
+
##do Continue several times checking Call Stack
-
        when debugger starts do pause
+
# {{testcase|Exception BP (Requires GDB 7.4 or higher)}}
-
            pause out via main menu
+
##create a sample application (e.g. Welcome)
-
            pause out via toolbar
+
##modify the code by adding "throw 1;" somewhere before "return" statement
-
            pause out via shortcut
+
##create a new Exception breakpoint (Any Exception)
-
        verify that debugger paused execution correctly
+
##check that the Exception breakpoint is displayed correctly in Breakpoints view
-
 
+
##start debugging
-
    Finish
+
##check that the debugger stops at the Exception breakpoint when "throw 1;" line is executed
-
        create a sample application
+
##modify the code to use other types of Exception breakpoints (Uncaught Exception, Unexpected Exception) and perform steps 4-6
-
        do step into project
+
# {{testcase|Customize BP}}
-
        do finish
+
##customize (change function/line)
-
            finish out via main menu
+
##start debugger and check that created breakpoint does work
-
            finish out via toolbar
+
##check that the breakpoint is displayed correctly in Breakpoints view
-
            finish out via shortcut
+
# {{testcase|Conditional BP}}
-
        verify that debugger finished execution correctly
+
##check condition
-
 
+
##check count exceeds
-
    Make Current
+
##start debugger and check that created breakpoint does work
-
        create a sample application with functions (e.g. Quote)
+
##check that the breakpoint is displayed correctly in Breakpoints view
-
        do step into project
+
-
        do step into function
+
-
        open Call Stack view
+
-
        select any stackframe and make it current
+
-
        verify that Local Variables view and Watches were updated accordingly
+
-
 
+
-
    Pop To Here
+
-
        create a sample application with functions (e.g. Quote)
+
-
        do step into project
+
-
        do step into function
+
-
        open Call Stack view
+
-
        select caller stackframe and do pop to here
+
-
        verify that debugger stops in caller function
+
-
 
+
-
    Pop Topmost Call
+
-
        create a sample application with functions (e.g. Quote)
+
-
        do step into project
+
-
        do step into function
+
-
        open Call Stack view
+
-
        open Debug menu Stack section and do pop topmost call
+
-
        verify that debugger stops in topmost caller function
+
-
 
+
-
    Make Caller Current
+
-
        create a sample application with functions (e.g. Quote)
+
-
        do step into project
+
-
        do step into function
+
-
        open Call Stack view
+
-
        open Debug menu Stack section and make caller current
+
-
        verify that Local Variables view and Watches were updated accordingly
+
-
 
+
-
    Make Callee Current
+
-
        create a sample application with functions (e.g. Quote)
+
-
        do step into project
+
-
        do step into function
+
-
        open Call Stack view
+
-
        open Debug menu Stack section and make caller current
+
-
        open Debug menu Stack section and make callee current
+
-
        verify that Local Variables view and Watches were updated accordingly
+
-
 
+
-
Views
+
-
 
+
-
    check views, open, close etc.
+
-
        create a sample application
+
-
        do step into project
+
-
        check Local Variables view, open, close, change visible columns etc.
+
-
        check Watches view, open, close, change visible columns etc.
+
-
        check Call Stack view, open, close, change visible columns etc.
+
-
        check Sessions view, open, close, change visible columns etc.
+
-
        check Breakpoints view, open, close, change visible columns etc.
+
-
        check Threads view, open, close, change visible columns etc.
+
-
        check Registers view, open, close, change visible columns etc.
+
-
        check Memory view, open, close, change visible columns etc.
+
-
 
+
-
    Local Variables
+
-
        create a sample or some specific application
+
-
        do step into project
+
-
        check LV on sample projects
+
-
        check LV in function
+
-
        check numbers (short, int, long, float, double)
+
-
        check char
+
-
        check pointers
+
-
        check arrays
+
-
        check unions
+
-
        check classes
+
-
        check structures
+
-
        modify values
+
-
        check that values are updated accordingly
+
-
 
+
-
    Watches
+
-
        create a sample or some specific application
+
-
        do step into project
+
-
        create a new watch
+
-
        customize watch
+
-
        delete watch
+
-
        watch for function
+
-
        modify values
+
-
        check that values are updated accordingly
+
-
 
+
-
    Call Stack
+
-
        create a sample application with functions (e.g. Quote)
+
-
        do step into project
+
-
        call stack representation
+
-
        see call stack actions
+
-
 
+
-
    Breakpoints
+
-
        create a sample or some specific application
+
-
        set several breakpoint
+
-
        do step into project
+
-
        open Breakpoints view
+
-
        check breakpoint representation
+
-
        check Go To Source option
+
-
        diasable BP
+
-
        check that debugger ignore disabled BP
+
-
        diasable all BPs
+
-
        check that debugger ignore disabled BPs
+
-
        enable BP
+
-
        check that debugger stops at BP
+
-
        enable all BPs
+
-
        check that debugger stops at BPs
+
-
        customize BP (see Breakpoints section)
+
-
            line number
+
-
            condition
+
-
            event counter
+
-
            action
+
-
            print text
+
-
        check that changed options has effect
+
-
        delete BP
+
-
        check that debugger does not stop at BP
+
-
        delete all BPs
+
-
        check that debugger does not stop at any BPs
+
-
 
+
-
    Sessions
+
-
        create two or more sample or specific applications
+
-
        set several breakpoint in these applications
+
-
        do step into project or start debugger for each application
+
-
        open Sessions view
+
-
        check sessions representation in Sessions view
+
-
        switch between sessions and check that Local Variables and Watches are changed accordingly
+
-
 
+
-
    Threads
+
-
        create a multithreaded application
+
-
        do step into project and do steps needed to create new threads
+
-
        open Threads view
+
-
        check threads representation
+
-
        switch between threads and check that Local Variables and Watches are changed accordingly
+
-
 
+
-
    Memory
+
-
        create an application which modifies memory
+
-
        do step into project
+
-
        open Memory view and check memory content at the specific address
+
-
        do some steps and check that memory content is changed accordingly
+
-
 
+
-
    Disassembly
+
-
        create a sample application
+
-
        do step into project
+
-
        open Disassembly view and check disassembled source code
+
-
        do some steps and check that cursor moves accordingly
+
-
 
+
-
    Registers
+
-
        create a sample application
+
-
        do step into project
+
-
        open Registers view and check its content
+
-
        do some steps and check that content is changed accordingly
+
-
 
+
-
    Debugger Console
+
-
        create a sample application
+
-
        do step into project
+
-
        open Debugger Console
+
-
        do some steps and check console output
+
-
 
+
-
    Output
+
-
        create a sample application that needs input and produces output (e.g. Quote)
+
-
        set Run/Console Type property to Output Window
+
-
        do step into project
+
-
        do some steps and check that needed data can be entered and check output
+
-
 
+
-
    Terminal wnidow
+
-
        create a sample application that needs input and produces output (e.g. Quote)
+
-
        set Run/Console Type property to Default
+
-
        do step into project
+
-
        check that a new terminal window appears
+
-
        do some steps and check that needed data can be entered and check output
+
-
 
+
-
Breakpoints
+
-
 
+
-
    Function BP
+
-
        create a sample application containing function calls (e.g. Quote)
+
-
        call Debug/New Breakpoint from the main menu
+
-
        set a breakpoint type to Function then enter function name and press OK
+
-
        start debugger and check that created breakpoint does work
+
-
        check that the breakpoint is displayed correctly in Breakpoints view  
+
-
 
+
-
    Line BP
+
-
        create a sample application
+
-
        call Debug/New Breakpoint from the main menu
+
-
        set a breakpoint type to Line then enter a desirable line number and press OK
+
-
        start debugger and check that created breakpoint does work
+
-
        check that the breakpoint is displayed correctly in Breakpoints view  
+
-
 
+
-
    Adress BP
+
-
        create a sample application
+
-
        do step into project
+
-
        open Disassembly view and remember an address where a breakpoint can be set
+
-
        call Debug/New Breakpoint from the main menu
+
-
        set a breakpoint type to Address then enter a desirable address and press OK
+
-
        continue debugging and check that created breakpoint does work
+
-
        check that the breakpoint is displayed correctly in Breakpoints view  
+
-
 
+
-
    Toggle BP
+
-
        create a sample application
+
-
        click on the gutter next to line in the editor where a breakpoint should be set
+
-
        check that the breakpoint is created and a breakpoint annotation is added to the source file in the editor
+
-
        start debugger and check that created breakpoint does work
+
-
        check that the breakpoint is displayed correctly in Breakpoints view  
+
-
 
+
-
    Customize BP
+
-
        customize (change function/line)
+
-
        start debugger and check that created breakpoint does work
+
-
        check that the breakpoint is displayed correctly in Breakpoints view  
+
-
 
+
-
    Conditional BP
+
-
        check condition
+
-
        check count exceeds
+
-
        start debugger and check that created breakpoint does work
+
-
        check that the breakpoint is displayed correctly in Breakpoints view  
+
-
 
+
-
    Actions for BP
+
-
        check suspend
+
-
        check Thread ID
+
-
        check Print Text
+
-
        start debugger and check that created breakpoint does work
+
-
        check that the breakpoint is displayed correctly in Breakpoints view
+
-
 
+
-
Multi-Threaded Debugging
+
-
 
+
-
    Breakpoints
+
-
        create a multithreaded application
+
-
        check global BP
+
-
        check BP for each thread (see breakpoint customize section)  
+
-
 
+
-
    LV/Watches
+
-
        create a multithreaded application
+
-
        check LV/Watches for thread (see Local Variables and Watches)  
+
-
 
+
-
Attach To Process
+
-
 
+
-
    Attach to process
+
-
        create a managed application
+
-
        run the application (in the IDE or from outside)
+
-
        call attach to process dialog
+
-
        find the process and attach to it
+
-
        debug attached process (check breakpoints, views, etc. )
+
-
        repeat the same steps for a makefile based application
+
-
 
+
-
    Attach to remote process
+
-
        create a managed remote application
+
-
        run the application in the IDE
+
-
        call attach to process dialog
+
-
        select an appropriate remote host
+
-
        select an appropriate project name
+
-
        find the process and attach to it
+
-
        debug attached process (check breakpoints, views, etc. )
+
-
        repeat the same steps for a makefile based application
+
-
 
+
-
    Attach to GDB server
+
-
        create a managed application (local or remote)
+
-
        run the application (in the IDE or from outside)
+
-
        call attach to process dialog
+
-
        select "Gdb Server" in the Debugger combobox
+
-
        set an appropriate hostname and port
+
-
        select an appropriate project name
+
-
        debug attached process (check breakpoints, views, etc. )
+
-
        repeat the same steps for a makefile based application
+
-
    Simple attach to the running process
+
====Test suite: Attach To Process====
-
        create a managed application (local or remote)
+
# {{testcase|Attach to process}}
-
        run the application in the IDE
+
##create a managed application
-
        press "Attach Debugger" button in the "Build,Run" output tab
+
##run the application (in the IDE or from outside)
-
        debug attached process (check breakpoints, views, etc. )
+
##call attach to process dialog
-
        repeat the same steps for a makefile based application
+
##find the process and attach to it
 +
##debug attached process (check breakpoints, views, etc. )
 +
##repeat the same steps for a makefile based application
 +
# {{testcase|Attach to remote process}}
 +
##create a managed remote application
 +
##run the application in the IDE
 +
##call attach to process dialog
 +
##select an appropriate remote host
 +
##select an appropriate project name
 +
##find the process and attach to it
 +
##debug attached process (check breakpoints, views, etc. )
 +
##repeat the same steps for a makefile based application
 +
# {{testcase|Attach to GDB server}}
 +
##create a managed application (local or remote)
 +
##run the application (in the IDE or from outside)
 +
##call attach to process dialog
 +
##select "Gdb Server" in the Debugger combobox
 +
##set an appropriate hostname and port
 +
##select an appropriate project name
 +
##debug attached process (check breakpoints, views, etc. )
 +
##repeat the same steps for a makefile based application
 +
# {{testcase|Simple attach to the running process}}
 +
##create a managed application (local or remote)
 +
##run the application in the IDE
 +
##press "Attach Debugger" button in the "Build,Run" output tab
 +
##debug attached process (check breakpoints, views, etc. )
 +
##repeat the same steps for a makefile based application

Current revision as of 13:57, 10 July 2012

C/C++ Pack Test Specification for Debugger

Author: Alexander Pepin
Version: 0.1
Lastupdate: 28.03.2012
Introduction: Test specification for Debugger support in NetBeans 7.2 C/C++ Pack
Setup: On Windows install Cygwin or MinGW + MSYS. See C++ setup instructions
Comments: Some tests require GDB 7.4
Important: On Windows all tests should be done using both Cygwin and MinGW tools

Contents


Test suite: Debugger Actions

  1. Start debugging
    1. create a sample application
    2. set a breakpoint in the main function
    3. start debugger
      • start via toolbar button
      • start via main menu
      • start via project context menu
    4. verify that debugger started correctly
  2. Step Into Project
    1. create a sample application
    2. do step into project
      • step into via project context menu
    3. verify that debugger started correctly
  3. Step Over
    1. create a sample application
    2. do step into project
    3. do step over
      • step over via main menu
      • step over via toolbar
      • step over via shortcut
    4. verify that debugger stepped over correctly
  4. Step Into
    1. create a sample application with functions (e.g. Quote)
    2. do step into project
    3. do step into function
      • step into via main menu
      • step into via toolbar
      • step into via shortcut
    4. verify that debugger stepped into function correctly
    5. do step into system function
      • step into via main menu
      • step into via toolbar
      • step into via shortcut
    6. verify that debugger stepped into function correctly
  5. Step Out
    1. create a sample application with functions (e.g. Quote)
    2. do step into project
    3. do step into function
    4. do step out function
      • step out via main menu
      • step out via toolbar
      • step out via shortcut
    5. verify that debugger stepped out function correctly
    6. do step into system function
    7. do step out system function
      • step out via main menu
      • step out via toolbar
      • step out via shortcut
    8. verify that debugger stepped out function correctly
    9. do step out 'main' function
      • step out via main menu
      • step out via toolbar
      • step out via shortcut
    10. verify that debugger stepped out main function correctly
  6. Continue
    1. create a sample application
    2. set a breakpoint in the main function
    3. start debugger
    4. when debugger stops at BP do continue
      • continue out via main menu
      • continue out via toolbar
      • continue out via shortcut
    5. verify that debugger continued execution correctly
  7. Pause
    1. create an application with an endless loop
    2. start debugger
    3. when debugger starts do pause
      • pause out via main menu
      • pause out via toolbar
      • pause out via shortcut
    4. verify that debugger paused execution correctly
  8. Finish
    1. create a sample application
    2. do step into project
    3. do finish
      • finish out via main menu
      • finish out via toolbar
      • finish out via shortcut
    4. verify that debugger finished execution correctly
  9. Make Current
    1. create a sample application with functions (e.g. Quote)
    2. do step into project
    3. do step into function
    4. open Call Stack view
    5. select any stackframe and make it current
    6. verify that Local Variables view and Watches were updated accordingly
  10. Pop To Here
    1. create a sample application with functions (e.g. Quote)
    2. do step into project
    3. do step into function
    4. open Call Stack view
    5. select caller stackframe and do pop to here
    6. verify that debugger stops in caller function
  11. Pop Topmost Call
    1. create a sample application with functions (e.g. Quote)
    2. do step into project
    3. do step into function
    4. open Call Stack view
    5. open Debug menu Stack section and do pop topmost call
    6. verify that debugger stops in topmost caller function
  12. Make Caller Current
    1. create a sample application with functions (e.g. Quote)
    2. do step into project
    3. do step into function
    4. open Call Stack view
    5. open Debug menu Stack section and make caller current
    6. verify that Local Variables view and Watches were updated accordingly
  13. Make Callee Current
    1. create a sample application with functions (e.g. Quote)
    2. do step into project
    3. do step into function
    4. open Call Stack view
    5. open Debug menu Stack section and make caller current
    6. open Debug menu Stack section and make callee current
    7. verify that Local Variables view and Watches were updated accordingly

Test suite: Debugger Views

Setup: Install Python libstdc++ and make changes in .gdbinit. See STLSupport

  1. check views, open, close etc.
    1. create a sample application
    2. do step into project
    3. check Local Variables view, open, close, change visible columns etc.
    4. check Watches view, open, close, change visible columns etc.
    5. check Call Stack view, open, close, change visible columns etc.
    6. check Sessions view, open, close, change visible columns etc.
    7. check Breakpoints view, open, close, change visible columns etc.
    8. check Threads view, open, close, change visible columns etc.
    9. check Registers view, open, close, change visible columns etc.
    10. check Memory view, open, close, change visible columns etc.
  2. Variables
    1. create a sample or some specific application
    2. do step into project
    3. check Variables in sample projects
    4. check Variables in function
    5. check numbers (short, int, long, float, double)
    6. check char
    7. check pointers
    8. check arrays
    9. check unions
    10. check classes
    11. check structures
    12. modify values
    13. check that values are updated accordingly
  3. Watches
    1. create a sample or some specific application
    2. do step into project
    3. create a new watch
    4. customize watch
    5. delete watch
    6. watch for function
    7. modify values
    8. check that values are updated accordingly
  4. Pretty Printers in Variables and Watches
    1. create Quote sample (or some specific application which uses STL containers)
    2. set Function breakpoint on "outCustomersList" function
    3. start debugging
    4. when the debugger stops in "outCustomersList" function open Variables or Watches
    5. add a new watch for "customers"
    6. expand the watch and check that elements of "customers" list are shown properly in user friendly manner
  5. Call Stack
    1. create a sample application with functions (e.g. Quote)
    2. do step into project
    3. call stack representation
    4. see call stack actions
  6. Breakpoints
    1. create a sample or some specific application
    2. set several breakpoint
    3. do step into project
    4. open Breakpoints view
    5. check breakpoint representation
    6. check Go To Source option
    7. diasable BP
    8. check that debugger ignore disabled BP
    9. disable all BPs
    10. check that debugger ignore disabled BPs
    11. enable BP
    12. check that debugger stops at BP
    13. enable all BPs
    14. check that debugger stops at BPs
    15. customize BP (see Breakpoints section)
      • line number
      • condition
      • count limit
      • while in
      • action
    16. check that changed options has effect
    17. delete BP
    18. check that debugger does not stop at BP
    19. delete all BPs
    20. check that debugger does not stop at any BP
  7. Sessions
    1. create two or more sample or specific applications
    2. set several breakpoint in these applications
    3. do step into project or start debugger for each application
    4. open Sessions view
    5. check sessions representation in Sessions view
    6. switch between sessions and check that Local Variables and Watches are changed accordingly
  8. Threads
    1. create a multi-threaded application
    2. do step into project and do steps needed to create new threads
    3. open Threads view
    4. check threads representation
    5. switch between threads and check that Local Variables and Watches are changed accordingly
  9. Memory
    1. create an application which modifies memory
    2. do step into project
    3. open Memory view and check memory content at the specific address
    4. do some steps and check that memory content is changed accordingly
  10. Disassembly
    1. create a sample application
    2. do step into project
    3. open Disassembly view and check disassembled source code
    4. do some steps and check that cursor moves accordingly
  11. Registers
    1. create a sample application
    2. do step into project
    3. open Registers view and check its content
    4. do some steps and check that content is changed accordingly
  12. Debugger Console
    1. create a sample application
    2. do step into project
    3. open Debugger Console
    4. do some steps and check console output
  13. Output
    1. create a sample application that needs input and produces output (e.g. Quote)
    2. set Run/Console Type property to Internal Terminal
    3. do step into project
    4. do some steps and check that needed data can be entered and check output
  14. External Terminal output
    1. create a sample application that needs input and produces output (e.g. Quote)
    2. set Run/Console Type property to External Terminal
    3. do step into project
    4. check that a new terminal window appears
    5. do some steps and check that needed data can be entered and check output

Test suite: Breakpoints

  1. Function BP
    1. create a sample application containing function calls (e.g. Quote)
    2. call Debug/New Breakpoint from the main menu
    3. set a breakpoint type to Function then enter function name and press OK
    4. start debugger and check that created breakpoint does work
    5. check that the breakpoint is displayed correctly in Breakpoints view
  2. Line BP
    1. create a sample application
    2. call Debug/New Breakpoint from the main menu
    3. set a breakpoint type to Line then enter a desirable line number and press OK
    4. start debugger and check that created breakpoint does work
    5. check that the breakpoint is displayed correctly in Breakpoints view
  3. Address BP
    1. create a sample application
    2. do step into project
    3. open Disassembly view and remember an address where a breakpoint can be set
    4. call Debug/New Breakpoint from the main menu
    5. set a breakpoint type to Address then enter a desirable address and press OK
    6. continue debugging and check that created breakpoint does work
    7. check that the breakpoint is displayed correctly in Breakpoints view
  4. Toggle BP
    1. create a sample application
    2. click on the gutter next to line in the editor where a breakpoint should be set
    3. check that the breakpoint is created and a breakpoint annotation is added to the source file in the editor
    4. start debugger and check that created breakpoint does work
    5. check that the breakpoint is displayed correctly in Breakpoints view
  5. Variable BP (Requires GDB 7.4 or higher)
    1. create a sample application (e.g. Welcome)
    2. do Step Into project
    3. do Step Over until the debugger cursor is inside "for" ("i" should be in scope)
    4. create a new Variable breakpoint for "i"
    5. check that the breakpoint is displayed correctly in Breakpoints view ("Change of i")
    6. do Continue
    7. check that the debugger stops at the Variable breakpoint every time when "i" is incremented
  6. System Call BP (Requires GDB 7.4 or higher)
    1. create a sample application (e.g. Welcome)
    2. create a new System Call breakpoint (All System Calls, On Entranse)
    3. check that the System Call breakpoint is displayed correctly in Breakpoints view
    4. disable the System Call breakpoint
    5. do Step Into project
    6. enable the System Call breakpoint
    7. continue debugging
    8. check that the debugger stops at System Call when "std:cout<<..." line is executed
    9. open Call Stack view and check that the current frame is system call
    10. do Continue several times checking Call Stack
    11. customize the System Call breakpoint (change setting to "On Exit")
    12. do Continue several times checking Call Stack
  7. Exception BP (Requires GDB 7.4 or higher)
    1. create a sample application (e.g. Welcome)
    2. modify the code by adding "throw 1;" somewhere before "return" statement
    3. create a new Exception breakpoint (Any Exception)
    4. check that the Exception breakpoint is displayed correctly in Breakpoints view
    5. start debugging
    6. check that the debugger stops at the Exception breakpoint when "throw 1;" line is executed
    7. modify the code to use other types of Exception breakpoints (Uncaught Exception, Unexpected Exception) and perform steps 4-6
  8. Customize BP
    1. customize (change function/line)
    2. start debugger and check that created breakpoint does work
    3. check that the breakpoint is displayed correctly in Breakpoints view
  9. Conditional BP
    1. check condition
    2. check count exceeds
    3. start debugger and check that created breakpoint does work
    4. check that the breakpoint is displayed correctly in Breakpoints view

Test suite: Attach To Process

  1. Attach to process
    1. create a managed application
    2. run the application (in the IDE or from outside)
    3. call attach to process dialog
    4. find the process and attach to it
    5. debug attached process (check breakpoints, views, etc. )
    6. repeat the same steps for a makefile based application
  2. Attach to remote process
    1. create a managed remote application
    2. run the application in the IDE
    3. call attach to process dialog
    4. select an appropriate remote host
    5. select an appropriate project name
    6. find the process and attach to it
    7. debug attached process (check breakpoints, views, etc. )
    8. repeat the same steps for a makefile based application
  3. Attach to GDB server
    1. create a managed application (local or remote)
    2. run the application (in the IDE or from outside)
    3. call attach to process dialog
    4. select "Gdb Server" in the Debugger combobox
    5. set an appropriate hostname and port
    6. select an appropriate project name
    7. debug attached process (check breakpoints, views, etc. )
    8. repeat the same steps for a makefile based application
  4. Simple attach to the running process
    1. create a managed application (local or remote)
    2. run the application in the IDE
    3. press "Attach Debugger" button in the "Build,Run" output tab
    4. debug attached process (check breakpoints, views, etc. )
    5. repeat the same steps for a makefile based application
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo