/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/signals.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
Signals
 
2
=======
 
3
info signals/handle             - List all available signals
 
4
 
 
5
Configuring
 
6
===========
 
7
 handle <signal> <keywords>
 
8
    signal is #(number), name, #-#(range), all (all signals)
 
9
    keywords:
 
10
     stop/nostop        - Stop program when signal happens
 
11
     print/noprint      - Print message when signal happens
 
12
     pass/nopass        - Pass the signal to the debugging application or not
 
13
     ignore/noignore    - ignore is equivalent of nopass
 
14
 
 
15
    - When a signal stops your program, the signal is not visible to the 
 
16
    program until you continue. 
 
17
    - After GDB reports a signal, you can use the handle command with pass or 
 
18
    nopass to control whether your program sees that signal when you continue.
 
19
 
 
20
 signal <signal>
 
21
    Resume execution where your program stopped, but immediately give it the 
 
22
    specified signal.
 
23
 signal 0
 
24
    If program stopped due to a signal and would ordinary see the signal when 
 
25
    resumed with the continue command; `signal 0' causes it to resume without 
 
26
    a signal.
 
27
 
 
28
Stopping Applications
 
29
=====================
 
30
    - Normaly, it could be achieved by sending SIGINT to gdb (or just presing
 
31
    Ctrl+C). 'nopass' should be set for SIGINT (default behavior). 
 
32
        + It is aslo possible to send SIGINT directly to app/thread pid.
 
33
        + The SIGINT should not be blocked in the thread of interest
 
34
 
 
35
    - Unfortunatelly, seems for multithreaded applications it would not prevent
 
36
    other threads from getting signal (at least in attach to process case).
 
37
        + Therefore, the best is to ignore SIGINT (set a dummy signal handler, 
 
38
        not block) in all application threads during debug. The SIGTERM could 
 
39
        be used for exit.