/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Development/debugging/gdb/automation.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Automatic
 
2
=========
 
3
 display expr                           - Show expr each time programm stopping
 
4
 undisplay 
 
5
 display                                - Show everything just now
 
6
 info display                           - What is in display
 
7
 
 
8
Command Lists
 
9
=============
 
10
    commands <breakpoint_num>           - This commands will be executed after
 
11
        ... command-list ...            breakpoint is hit.
 
12
    end
 
13
 
 
14
    - if breakpoint_num omited, refers last breakpoint set
 
15
    - Supply empty command least to clean actions
 
16
 
 
17
Automatic processing
 
18
====================
 
19
    'continue', 'step', etc     - can be used to continue execution after all 
 
20
                                commands  have been processed.
 
21
    'set'                       - we can adjust variables, if necessary
 
22
    silent                      - prevent standard messages
 
23
 
 
24
Flow
 
25
====
 
26
 - User defined commands (accepts up to 9 arguments)
 
27
        define <cmdname>                
 
28
            p $arg0 + $arg1    
 
29
        end
 
30
 
 
31
 - Info on user defined commands
 
32
        help user-defined       - list
 
33
        show user <cmdname>     - info
 
34
 
 
35
 - show max-user-call-depth / set max-user-call-depth 
 
36
    controls how many recursion levels are allowed in user-defined commands before 
 
37
    GDB suspects an infinite recursion and aborts
 
38
 
 
39
 - Conditional execution
 
40
    if <expr> ... commands-list ... else  ... end
 
41
    while <expr> ... end
 
42
 
 
43
 - Hooks: defines set of command to run before and after command
 
44
     + define hook-cmdname ... end
 
45
     + define hookpost-cmdname ... end
 
46
 
 
47
 
 
48
Output
 
49
======
 
50
 output/fmt expr                - output only value, no gdb text
 
51
  + fmt:  x (hex), d (dec), u(unsigned), o(oct), t(bin), a(addr), c(char), f(fp)
 
52
 
 
53
 printf 'expr is %d\n", x       - formated output
 
54
 
 
55
 echi text \n\                  - Output multiline text messages
 
56
  mutline text.\n
 
57
 
 
58
Command Files
 
59
=============
 
60
 - On start GDB automatically executes commands from its init files (.gdbinit)
 
61
    (fist in home directory, than in current working directory)
 
62
 
 
63
 * source <filename>            - Execute gdb command file