1<html lang="en"> 2<head> 3<title>Hurd Native - Debugging with GDB</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Debugging with GDB"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Native.html#Native" title="Native"> 9<link rel="prev" href="Cygwin-Native.html#Cygwin-Native" title="Cygwin Native"> 10<link rel="next" href="Darwin.html#Darwin" title="Darwin"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<!-- 13Copyright (C) 1988-2013 Free Software Foundation, Inc. 14 15Permission is granted to copy, distribute and/or modify this document 16under the terms of the GNU Free Documentation License, Version 1.3 or 17any later version published by the Free Software Foundation; with the 18Invariant Sections being ``Free Software'' and ``Free Software Needs 19Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' 20and with the Back-Cover Texts as in (a) below. 21 22(a) The FSF's Back-Cover Text is: ``You are free to copy and modify 23this GNU Manual. Buying copies from GNU Press supports the FSF in 24developing GNU and promoting software freedom.'' 25--> 26<meta http-equiv="Content-Style-Type" content="text/css"> 27<style type="text/css"><!-- 28 pre.display { font-family:inherit } 29 pre.format { font-family:inherit } 30 pre.smalldisplay { font-family:inherit; font-size:smaller } 31 pre.smallformat { font-family:inherit; font-size:smaller } 32 pre.smallexample { font-size:smaller } 33 pre.smalllisp { font-size:smaller } 34 span.sc { font-variant:small-caps } 35 span.roman { font-family:serif; font-weight:normal; } 36 span.sansserif { font-family:sans-serif; font-weight:normal; } 37--></style> 38<link rel="stylesheet" type="text/css" href="../cs.css"> 39</head> 40<body> 41<div class="node"> 42<a name="Hurd-Native"></a> 43<p> 44Next: <a rel="next" accesskey="n" href="Darwin.html#Darwin">Darwin</a>, 45Previous: <a rel="previous" accesskey="p" href="Cygwin-Native.html#Cygwin-Native">Cygwin Native</a>, 46Up: <a rel="up" accesskey="u" href="Native.html#Native">Native</a> 47<hr> 48</div> 49 50<h4 class="subsection">21.1.6 Commands Specific to <span class="sc">gnu</span> Hurd Systems</h4> 51 52<p><a name="index-g_t_0040sc_007bgnu_007d-Hurd-debugging-1358"></a> 53This subsection describes <span class="sc">gdb</span> commands specific to the 54<span class="sc">gnu</span> Hurd native debugging. 55 56 <dl> 57<dt><code>set signals</code><dt><code>set sigs</code><dd><a name="index-set-signals_0040r_007b_002c-Hurd-command_007d-1359"></a><a name="index-set-sigs_0040r_007b_002c-Hurd-command_007d-1360"></a>This command toggles the state of inferior signal interception by 58<span class="sc">gdb</span>. Mach exceptions, such as breakpoint traps, are not 59affected by this command. <code>sigs</code> is a shorthand alias for 60<code>signals</code>. 61 62 <br><dt><code>show signals</code><dt><code>show sigs</code><dd><a name="index-show-signals_0040r_007b_002c-Hurd-command_007d-1361"></a><a name="index-show-sigs_0040r_007b_002c-Hurd-command_007d-1362"></a>Show the current state of intercepting inferior's signals. 63 64 <br><dt><code>set signal-thread</code><dt><code>set sigthread</code><dd><a name="index-set-signal_002dthread-1363"></a><a name="index-set-sigthread-1364"></a>This command tells <span class="sc">gdb</span> which thread is the <code>libc</code> signal 65thread. That thread is run when a signal is delivered to a running 66process. <code>set sigthread</code> is the shorthand alias of <code>set 67signal-thread</code>. 68 69 <br><dt><code>show signal-thread</code><dt><code>show sigthread</code><dd><a name="index-show-signal_002dthread-1365"></a><a name="index-show-sigthread-1366"></a>These two commands show which thread will run when the inferior is 70delivered a signal. 71 72 <br><dt><code>set stopped</code><dd><a name="index-set-stopped_0040r_007b_002c-Hurd-command_007d-1367"></a>This commands tells <span class="sc">gdb</span> that the inferior process is stopped, 73as with the <code>SIGSTOP</code> signal. The stopped process can be 74continued by delivering a signal to it. 75 76 <br><dt><code>show stopped</code><dd><a name="index-show-stopped_0040r_007b_002c-Hurd-command_007d-1368"></a>This command shows whether <span class="sc">gdb</span> thinks the debuggee is 77stopped. 78 79 <br><dt><code>set exceptions</code><dd><a name="index-set-exceptions_0040r_007b_002c-Hurd-command_007d-1369"></a>Use this command to turn off trapping of exceptions in the inferior. 80When exception trapping is off, neither breakpoints nor 81single-stepping will work. To restore the default, set exception 82trapping on. 83 84 <br><dt><code>show exceptions</code><dd><a name="index-show-exceptions_0040r_007b_002c-Hurd-command_007d-1370"></a>Show the current state of trapping exceptions in the inferior. 85 86 <br><dt><code>set task pause</code><dd><a name="index-set-task_0040r_007b_002c-Hurd-commands_007d-1371"></a><a name="index-task-attributes-_0028_0040sc_007bgnu_007d-Hurd_0029-1372"></a><a name="index-pause-current-task-_0028_0040sc_007bgnu_007d-Hurd_0029-1373"></a>This command toggles task suspension when <span class="sc">gdb</span> has control. 87Setting it to on takes effect immediately, and the task is suspended 88whenever <span class="sc">gdb</span> gets control. Setting it to off will take 89effect the next time the inferior is continued. If this option is set 90to off, you can use <code>set thread default pause on</code> or <code>set 91thread pause on</code> (see below) to pause individual threads. 92 93 <br><dt><code>show task pause</code><dd><a name="index-show-task_0040r_007b_002c-Hurd-commands_007d-1374"></a>Show the current state of task suspension. 94 95 <br><dt><code>set task detach-suspend-count</code><dd><a name="index-task-suspend-count-1375"></a><a name="index-detach-from-task_002c-_0040sc_007bgnu_007d-Hurd-1376"></a>This command sets the suspend count the task will be left with when 96<span class="sc">gdb</span> detaches from it. 97 98 <br><dt><code>show task detach-suspend-count</code><dd>Show the suspend count the task will be left with when detaching. 99 100 <br><dt><code>set task exception-port</code><dt><code>set task excp</code><dd><a name="index-task-exception-port_002c-_0040sc_007bgnu_007d-Hurd-1377"></a>This command sets the task exception port to which <span class="sc">gdb</span> will 101forward exceptions. The argument should be the value of the <dfn>send 102rights</dfn> of the task. <code>set task excp</code> is a shorthand alias. 103 104 <br><dt><code>set noninvasive</code><dd><a name="index-noninvasive-task-options-1378"></a>This command switches <span class="sc">gdb</span> to a mode that is the least 105invasive as far as interfering with the inferior is concerned. This 106is the same as using <code>set task pause</code>, <code>set exceptions</code>, and 107<code>set signals</code> to values opposite to the defaults. 108 109 <br><dt><code>info send-rights</code><dt><code>info receive-rights</code><dt><code>info port-rights</code><dt><code>info port-sets</code><dt><code>info dead-names</code><dt><code>info ports</code><dt><code>info psets</code><dd><a name="index-send-rights_002c-_0040sc_007bgnu_007d-Hurd-1379"></a><a name="index-receive-rights_002c-_0040sc_007bgnu_007d-Hurd-1380"></a><a name="index-port-rights_002c-_0040sc_007bgnu_007d-Hurd-1381"></a><a name="index-port-sets_002c-_0040sc_007bgnu_007d-Hurd-1382"></a><a name="index-dead-names_002c-_0040sc_007bgnu_007d-Hurd-1383"></a>These commands display information about, respectively, send rights, 110receive rights, port rights, port sets, and dead names of a task. 111There are also shorthand aliases: <code>info ports</code> for <code>info 112port-rights</code> and <code>info psets</code> for <code>info port-sets</code>. 113 114 <br><dt><code>set thread pause</code><dd><a name="index-set-thread_0040r_007b_002c-Hurd-command_007d-1384"></a><a name="index-thread-properties_002c-_0040sc_007bgnu_007d-Hurd-1385"></a><a name="index-pause-current-thread-_0028_0040sc_007bgnu_007d-Hurd_0029-1386"></a>This command toggles current thread suspension when <span class="sc">gdb</span> has 115control. Setting it to on takes effect immediately, and the current 116thread is suspended whenever <span class="sc">gdb</span> gets control. Setting it to 117off will take effect the next time the inferior is continued. 118Normally, this command has no effect, since when <span class="sc">gdb</span> has 119control, the whole task is suspended. However, if you used <code>set 120task pause off</code> (see above), this command comes in handy to suspend 121only the current thread. 122 123 <br><dt><code>show thread pause</code><dd><a name="index-show-thread_0040r_007b_002c-Hurd-command_007d-1387"></a>This command shows the state of current thread suspension. 124 125 <br><dt><code>set thread run</code><dd>This command sets whether the current thread is allowed to run. 126 127 <br><dt><code>show thread run</code><dd>Show whether the current thread is allowed to run. 128 129 <br><dt><code>set thread detach-suspend-count</code><dd><a name="index-thread-suspend-count_002c-_0040sc_007bgnu_007d-Hurd-1388"></a><a name="index-detach-from-thread_002c-_0040sc_007bgnu_007d-Hurd-1389"></a>This command sets the suspend count <span class="sc">gdb</span> will leave on a 130thread when detaching. This number is relative to the suspend count 131found by <span class="sc">gdb</span> when it notices the thread; use <code>set thread 132takeover-suspend-count</code> to force it to an absolute value. 133 134 <br><dt><code>show thread detach-suspend-count</code><dd>Show the suspend count <span class="sc">gdb</span> will leave on the thread when 135detaching. 136 137 <br><dt><code>set thread exception-port</code><dt><code>set thread excp</code><dd>Set the thread exception port to which to forward exceptions. This 138overrides the port set by <code>set task exception-port</code> (see above). 139<code>set thread excp</code> is the shorthand alias. 140 141 <br><dt><code>set thread takeover-suspend-count</code><dd>Normally, <span class="sc">gdb</span>'s thread suspend counts are relative to the 142value <span class="sc">gdb</span> finds when it notices each thread. This command 143changes the suspend counts to be absolute instead. 144 145 <br><dt><code>set thread default</code><dt><code>show thread default</code><dd><a name="index-thread-default-settings_002c-_0040sc_007bgnu_007d-Hurd-1390"></a>Each of the above <code>set thread</code> commands has a <code>set thread 146default</code> counterpart (e.g., <code>set thread default pause</code>, <code>set 147thread default exception-port</code>, etc.). The <code>thread default</code> 148variety of commands sets the default thread properties for all 149threads; you can then change the properties of individual threads with 150the non-default commands. 151</dl> 152 153 </body></html> 154 155